NetBurner 3.5.6
PDF Version
SBE70LC/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// class PinIO
26// {
27// uint8_t connector, pinnum;
28// PinIO(int j, int n)
29// {
30// connector = j;
31// pinnum = n;
32// };
33
34// public:
35// void set(BOOL = TRUE); // Set output high
36// void clr() { set(FALSE); }; // Set output low
37// BOOL toggle(); // Set output state to the opposite of current state
38// BOOL read(); // Read hi/low state of input pin
39// BOOL readBack(); // Read pin state without affecting direction
40// void hiz() { read(); }; // Set output to tristate
41// void drive(); // Turn output on (opposite of tristate)
42// void function(int ft); // Set pin to special function
43// int getFunction(); // Get the special function the pin is set to
44// PinIO &operator=(BOOL b)
45// {
46// set(b);
47// return *this;
48// };
49// PinIO &operator=(int i)
50// {
51// set(i);
52// return *this;
53// };
54// operator int() { return read(); }; // Read and return int value
55// operator BOOL() { return read(); }; // Read and return BOOL value
56// operator bool() { return (read() != 0); }; // Read and return boolean value
57// };
58
60{
61 static const int pinCount;
62
63 public:
64 PinIO operator[](int n)
65 {
66 switch (n)
67 {
68 case 3: return PinIO(3, 12); // PD12 3,12
69 case 4: return PinIO(3, 21); // PD21 3,21
70 case 5: return PinIO(1, 3); // PB3 1,3
71 case 6: return PinIO(3, 20); // PD20 3,20
72 case 7: return PinIO(3, 22); // PD22 3,22
73 case 8: return PinIO(0, 25); // PA25 0,25
74 case 9: return PinIO(0, 24); // PA24 0,24
75 case 10: return PinIO(1, 1); // PB1 1,1
76 case 11: return PinIO(1, 0); // PB0 1,0
77 case 12: return PinIO(1, 4); // PB4 1,4
78 case 13: return PinIO(0, 21); // PA21 0,21
79 case 14: return PinIO(1, 2); // PB2 1,2
80 case 15: return PinIO(3, 24); // PD24 3,24
81 case 16: return PinIO(0, 3); // PA3 0,3
82 case 17: return PinIO(0, 4); // PA4 0,4
83 default: return PinIO();
84 }
85 }
86
87 int GetIndex(const PinIO &io) const;
88 inline constexpr int GetPinCount() { return pinCount; }
89};
90
91class PinIOArrayJ3
92{
93 static const int pinCount;
94
95 public:
96 PinIO operator[](int n)
97 {
98 switch (n)
99 {
100 case 2: return PinIO(1, 13); // PB13 1,13
101 case 3: return PinIO(2, 12); // PC12 2,12
102 case 4: return PinIO(1, 4); // PB4 1,4
103 case 5: return PinIO(3, 30); // PD30 3,30
104 case 6: return PinIO(1, 5); // PB5 1,5
105 case 7: return PinIO(0, 17); // PA17 0,17
106 default: return PinIO();
107 }
108 }
109
110 int GetIndex(const PinIO &io) const;
111 inline constexpr int GetPinCount() { return pinCount; }
112};
113
114class PinIOArrayJ4
115{
116 static const int pinCount;
117 public:
118 PinIO operator[](int n)
119 {
120 switch (n)
121 {
122 case 1: return PinIO(2, 30); // PC30 2,30
123 case 2: return PinIO(3, 25); // PD25 3,25
124 case 3: return PinIO(3, 22); // PD22 3,22
125 case 4: return PinIO(3, 20); // PD20 3,20
126 case 5: return PinIO(3, 21); // PD21 3,21
127 case 6: return PinIO(0, 26); // PA26 0,26
128 case 7: return PinIO(0, 28); // PA28 0,28
129 default: return PinIO();
130 }
131 }
132
133 int GetIndex(const PinIO &io) const;
134 inline constexpr int GetPinCount() { return pinCount; }
135};
136
137class PinIOPinsArray
138{
139 static const int pinCount;
140 public:
141 PinIO operator[](int n);
142
143 int GetIndex(const PinIO &io) const;
144 inline constexpr int GetPinCount() { return pinCount; }
145};
146
147extern PinIOArrayJ1 J1;
148extern PinIOArrayJ3 J3;
149extern PinIOArrayJ4 J4;
150extern PinIOPinsArray Pins;
151//#define Pins J1
152
153class FastIOArrayJ1
154{
155 public:
156 FastIO operator[](int n);
157};
158
159class FastIOArrayJ3
160{
161 public:
162 FastIO operator[](int n);
163};
164
165class FastIOArrayJ4
166{
167 public:
168 FastIO operator[](int n);
169};
170
171class FastIOPinsArray
172{
173 public:
174 FastIO operator[](int n);
175};
176
177extern FastIOArrayJ1 Fast_P1;
178extern FastIOArrayJ3 Fast_P3;
179extern FastIOArrayJ4 Fast_P4;
180extern FastIOPinsArray Fast_Pins;
181#endif /* _NB_PINS_H_ */
Definition SBE70LC/include/pins.h:60
GPIO Pin Class.
Definition coldfire/cpu/MCF5441X/include/cpu_pins.h:15