STM32F411: implement PULLUP_ON() and PULLUP_OFF().
This commit is contained in:
parent
313e37c0b2
commit
73df1be2d2
12
pinio.h
12
pinio.h
|
|
@ -157,6 +157,18 @@
|
|||
IO ## _PORT->OSPEEDR |= (3 << ((IO ## _PIN) << 1)); \
|
||||
} while (0)
|
||||
|
||||
/// Enable pullup resistor.
|
||||
#define _PULLUP_ON(IO) \
|
||||
do { \
|
||||
IO ## _PORT->PUPDR &= ~(3 << ((IO ## _PIN) << 1)); \
|
||||
IO ## _PORT->PUPDR |= (1 << ((IO ## _PIN) << 1)) * 0x1; \
|
||||
} while (0)
|
||||
/// Disable pullup resistor.
|
||||
#define _PULLUP_OFF(IO) \
|
||||
do { \
|
||||
IO ## _PORT->PUPDR &= ~(1 << ((IO ## _PIN) << 1)) * 0x1; \
|
||||
} while (0)
|
||||
|
||||
#elif defined SIMULATOR
|
||||
|
||||
#include "simulator.h"
|
||||
|
|
|
|||
Loading…
Reference in New Issue