NetBurner 3.5.8
PDF Version
Toggle main menu visibility
SOMRT1061/include/pins.h
1
/*NB_REVISION*/
2
3
/*NB_COPYRIGHT*/
4
5
#ifndef _NB_PINS_H_
6
#define _NB_PINS_H_
7
8
#include <pinconstant.h>
9
#include <cpu_pins.h>
10
25
26
#define PLAT_PIN_COUNT 92
// 4 pins are tied to *two* cpu pads
27
28
class
PinIOArray;
29
class
FastIOArray
30
{
31
static
const
FastIO::def_t cpuPinMap[PLAT_PIN_COUNT];
32
public
:
33
FastIO operator[] (
int
n )
const
34
{
35
if
((n <= 0) || (n > PLAT_PIN_COUNT))
36
{
37
return
FastIO(FastIO::def_t(PinDef_INVALID).port,
38
FastIO::def_t(PinDef_INVALID).idx);
39
}
40
41
return
FastIO( cpuPinMap[n-1].port, cpuPinMap[n-1].idx );
42
};
43
FastIO::def_t getDef(
int
n )
const
44
{
45
if
((n <= 0) || (n > PLAT_PIN_COUNT))
46
{
47
return
FastIO::def_t(PinDef_INVALID);
48
}
49
return
cpuPinMap[n-1];
50
};
51
friend
class
PinIOArray;
52
};
53
54
class
PinIOArray
55
{
56
public
:
57
PinIO operator[] (
int
n )
const
58
{
59
if
((n <= 0) || (n > PLAT_PIN_COUNT))
60
{
61
return
PinIO(PinIO::def_t(PinDef_INVALID).port,
62
PinIO::def_t(PinDef_INVALID).idx);
63
}
64
65
return
PinIO( FastIOArray::cpuPinMap[n-1].port, FastIOArray::cpuPinMap[n-1].idx );
66
};
67
const
PinIO::def_t getDef(
int
n )
const
68
{
69
if
((n <= 0) || (n > PLAT_PIN_COUNT))
70
{
71
return
PinIO::def_t(PinDef_INVALID);
72
}
73
return
{FastIOArray::cpuPinMap[n-1].port,
74
FastIOArray::cpuPinMap[n-1].idx};
75
};
76
};
77
78
79
extern
const
FastIOArray FastPins;
80
extern
const
PinIOArray Pins;
81
82
#endif
/* _NB_PINS_H_ */
platform
SOMRT1061
include
pins.h
Generated by
1.18.0