NetBurner 3.5.6
PDF Version
MOD5441X/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
11#define PINS
12//namespace PINS
13//{
28//class PinIO
29//{
30// uint8_t connector, pinnum;
31// PinIO(int j, int n)
32// {
33// connector = j;
34// pinnum = n;
35// };
36//
37// public:
38// void set(BOOL = TRUE); // Set output high
39// void clr() { set(FALSE); }; // Set output low
40// BOOL toggle(); // Set output state to the opposite of current state
41// BOOL read(); // Read hi/low state of input pin
42// BOOL readBack(); // Read pin state without affecting direction
43// void hiz() { read(); }; // Set output to tristate
44// void drive(); // Turn output on (opposite of tristate)
45// void function(int ft); // Set pin to special function
46// int getFunction(); // Get the special function the pin is set to
47// PinIO &operator=(BOOL b)
48// {
49// set(b);
50// return *this;
51// };
52// PinIO &operator=(int i)
53// {
54// set(i);
55// return *this;
56// };
57// operator int() { return read(); }; // Read and return int value
58// operator BOOL() { return read(); }; // Read and return BOOL value
59// operator bool() { return (read() != 0); }; // Read and return boolean value
60// friend class PinIOJ1Array;
61// friend class PinIOJ2Array;
62//};
63
65{
66 public:
67 PinIO operator[](int n);// { return PinIO(1, n); };
68};
69
70class PinIOJ2Array
71{
72 public:
73 PinIO operator[](int n);// { return PinIO(2, n); };
74};
75
76class PinIOPinsArray
77{
78 public:
79 PinIO operator[](int n);// { return PinIO(2, n); };
80};
81//} // namespace PINS
82
83extern PinIOJ1Array J1;
84extern PinIOJ2Array J2;
85extern PinIOJ1Array P0; // SB700EX implementation only
86extern PinIOJ2Array P1; // SB700EX implementation only
87extern PinIOPinsArray Pins;
88
89class FastIOJ1Array
90{
91 public:
92 FastIO operator[](int n);// { return PinIO(1, n); };
93};
94
95class FastIOJ2Array
96{
97 public:
98 FastIO operator[](int n);// { return PinIO(2, n); };
99};
100class FastIOPinsArray
101{
102 public:
103 FastIO operator[](int n);// { return PinIO(2, n); };
104};
105//} // namespace PINS
106
107extern FastIOJ1Array Fast_J1;
108extern FastIOJ2Array Fast_J2;
109extern FastIOJ1Array Fast_P0; // SB700EX implementation only
110extern FastIOJ2Array Fast_P1; // SB700EX implementation only
111extern PinIOPinsArray Fast_Pins;
112
113//typedef PINS::PinIO PinIO;
114
115#endif /* _NB_PINS_H_ */
GPIO Pin Class.
Definition coldfire/cpu/MCF5441X/include/cpu_pins.h:15
Definition MOD5441X/include/pins.h:65