Browse Source

Tweaks to fastio_Due.h

Scott Lahteine 7 years ago
parent
commit
fc10101b06
1 changed files with 16 additions and 17 deletions
  1. 16
    17
      Marlin/src/HAL/HAL_DUE/fastio_Due.h

+ 16
- 17
Marlin/src/HAL/HAL_DUE/fastio_Due.h View File

78
   else port->PIO_CODR = mask; \
78
   else port->PIO_CODR = mask; \
79
 } while(0)
79
 } while(0)
80
 
80
 
81
-// toggle a pin
81
+// Toggle a pin
82
 #define _TOGGLE(IO) _WRITE(IO, !READ(IO))
82
 #define _TOGGLE(IO) _WRITE(IO, !READ(IO))
83
 
83
 
84
-// set pin as input
84
+// Set pin as input
85
 #define _SET_INPUT(IO) do{ \
85
 #define _SET_INPUT(IO) do{ \
86
   pmc_enable_periph_clk(g_APinDescription[IO].ulPeripheralId); \
86
   pmc_enable_periph_clk(g_APinDescription[IO].ulPeripheralId); \
87
   PIO_Configure(g_APinDescription[IO].pPort, PIO_INPUT, g_APinDescription[IO].ulPin, 0); \
87
   PIO_Configure(g_APinDescription[IO].pPort, PIO_INPUT, g_APinDescription[IO].ulPin, 0); \
88
 }while(0)
88
 }while(0)
89
 
89
 
90
-// set pin as output
90
+// Set pin as output
91
 #define _SET_OUTPUT(IO) do{ \
91
 #define _SET_OUTPUT(IO) do{ \
92
   pmc_enable_periph_clk(g_APinDescription[IO].ulPeripheralId); \
92
   pmc_enable_periph_clk(g_APinDescription[IO].ulPeripheralId); \
93
   PIO_Configure(g_APinDescription[IO].pPort, _READ(IO) ? PIO_OUTPUT_1 : PIO_OUTPUT_0, g_APinDescription[IO].ulPin, g_APinDescription[IO].ulPinConfiguration); \
93
   PIO_Configure(g_APinDescription[IO].pPort, _READ(IO) ? PIO_OUTPUT_1 : PIO_OUTPUT_0, g_APinDescription[IO].ulPin, g_APinDescription[IO].ulPinConfiguration); \
94
   g_pinStatus[IO] = (g_pinStatus[IO] & 0xF0) | PIN_STATUS_DIGITAL_OUTPUT;\
94
   g_pinStatus[IO] = (g_pinStatus[IO] & 0xF0) | PIN_STATUS_DIGITAL_OUTPUT;\
95
 }while(0)
95
 }while(0)
96
 
96
 
97
-// set pin as input with pullup mode
97
+// Set pin as input with pullup mode
98
 #define _PULLUP(IO,V) pinMode(IO, (V) ? INPUT_PULLUP : INPUT)
98
 #define _PULLUP(IO,V) pinMode(IO, (V) ? INPUT_PULLUP : INPUT)
99
 
99
 
100
-// check if pin is an input
100
+// Check if pin is an input
101
 #define _GET_INPUT(IO)
101
 #define _GET_INPUT(IO)
102
-// check if pin is an output
102
+// Check if pin is an output
103
 #define _GET_OUTPUT(IO)
103
 #define _GET_OUTPUT(IO)
104
-
105
-// check if pin is a timer
104
+// Check if pin is a timer
106
 #define _GET_TIMER(IO)
105
 #define _GET_TIMER(IO)
107
 
106
 
108
-// Read a pin wrapper
107
+// Read a pin (wrapper)
109
 #define READ(IO) _READ(IO)
108
 #define READ(IO) _READ(IO)
110
 
109
 
111
-// Write to a pin wrapper
110
+// Write to a pin (wrapper)
112
 #define WRITE_VAR(IO,V) _WRITE_VAR(IO,V)
111
 #define WRITE_VAR(IO,V) _WRITE_VAR(IO,V)
113
 #define WRITE(IO,V) _WRITE(IO,V)
112
 #define WRITE(IO,V) _WRITE(IO,V)
114
 
113
 
115
-// toggle a pin wrapper
114
+// Toggle a pin (wrapper)
116
 #define TOGGLE(IO) _TOGGLE(IO)
115
 #define TOGGLE(IO) _TOGGLE(IO)
117
 
116
 
118
-// set pin as input wrapper
117
+// Set pin as input (wrapper)
119
 #define SET_INPUT(IO) _SET_INPUT(IO)
118
 #define SET_INPUT(IO) _SET_INPUT(IO)
120
-// set pin as input with pullup wrapper
119
+// Set pin as input with pullup (wrapper)
121
 #define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0)
120
 #define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0)
122
-// set pin as output wrapper -  reads the pin and sets the output to that value
121
+// Set pin as output (wrapper) -  reads the pin and sets the output to that value
123
 #define SET_OUTPUT(IO) _SET_OUTPUT(IO)
122
 #define SET_OUTPUT(IO) _SET_OUTPUT(IO)
124
-// check if pin is an input wrapper
123
+// Check if pin is an input (wrapper)
125
 #define GET_INPUT(IO) _GET_INPUT(IO)
124
 #define GET_INPUT(IO) _GET_INPUT(IO)
126
-// check if pin is an output wrapper
125
+// Check if pin is an output (wrapper)
127
 #define GET_OUTPUT(IO) _GET_OUTPUT(IO)
126
 #define GET_OUTPUT(IO) _GET_OUTPUT(IO)
128
 
127
 
129
-// check if pin is a timer (wrapper)
128
+// Check if pin is a timer (wrapper)
130
 #define GET_TIMER(IO) _GET_TIMER(IO)
129
 #define GET_TIMER(IO) _GET_TIMER(IO)
131
 
130
 
132
 // Shorthand
131
 // Shorthand

Loading…
Cancel
Save