mirror of
https://github.com/arduino/Arduino.git
synced 2024-11-29 10:24:12 +01:00
Added INPUT_PULLUP mode for pinMode command
This commit is contained in:
parent
8c5e21470f
commit
6640bc9bd2
@ -28,6 +28,7 @@ extern "C"{
|
||||
|
||||
#define INPUT 0x0
|
||||
#define OUTPUT 0x1
|
||||
#define INPUT_PULLUP 0x2
|
||||
|
||||
#define true 0x1
|
||||
#define false 0x0
|
||||
|
@ -41,6 +41,16 @@ extern void pinMode( uint32_t ulPin, uint32_t ulMode )
|
||||
0 ) ;
|
||||
break ;
|
||||
|
||||
case INPUT_PULLUP:
|
||||
/* Enable peripheral for clocking input */
|
||||
pmc_enable_periph_clk( g_APinDescription[ulPin].ulPeripheralId ) ;
|
||||
PIO_Configure(
|
||||
g_APinDescription[ulPin].pPort,
|
||||
PIO_INPUT,
|
||||
g_APinDescription[ulPin].ulPin,
|
||||
PIO_PULLUP ) ;
|
||||
break ;
|
||||
|
||||
case OUTPUT:
|
||||
PIO_Configure(
|
||||
g_APinDescription[ulPin].pPort,
|
||||
|
Loading…
Reference in New Issue
Block a user