Replacement for regular GPIO (DigitalIn, DigitalOut, DigitalInOut) classes which has superior speed. (modified for use opendrain in stm32)
Fork of FastIO by
Diff: Devices/FastIO_NUCLEO_F401.h
- Revision:
- 5:3dd1ab9bbc59
- Parent:
- 4:6ebbf25b9167
- Child:
- 7:1e784ae11fba
--- a/Devices/FastIO_NUCLEO_F401.h Wed Jul 16 19:31:35 2014 +0000 +++ b/Devices/FastIO_NUCLEO_F401.h Wed Jul 16 19:43:49 2014 +0000 @@ -10,7 +10,7 @@ #define PINMASK (1 << STM_PIN(pin)) #define PORT ((GPIO_TypeDef *)(GPIOA_BASE + 0x0400 * STM_PORT(pin))) -#define INIT_PIN RCC->AHB1ENR |= (1 << STM_PORT(pin)); container.mask = PINMASK +#define INIT_PIN RCC->AHB1ENR |= (1 << STM_PORT(pin)); (PORT->MODER &= ~(GPIO_MODER_MODER0_1 << (STM_PIN(pin) * 2))); container.mask = PINMASK #define DESTROY_PIN #define SET_DIR_INPUT (PORT->MODER &= ~(GPIO_MODER_MODER0 << (STM_PIN(pin) * 2)))