From fbed6fbe50ee15c8dbae6ad5cd0bbf8228b1e45e Mon Sep 17 00:00:00 2001 From: Martin Ayotte Date: Sun, 26 Jul 2015 10:49:05 -0400 Subject: [PATCH] add missing/forgotten variant.h --- STM32F4/variants/discovery_f407/variant.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 STM32F4/variants/discovery_f407/variant.h diff --git a/STM32F4/variants/discovery_f407/variant.h b/STM32F4/variants/discovery_f407/variant.h new file mode 100644 index 0000000..6e399f3 --- /dev/null +++ b/STM32F4/variants/discovery_f407/variant.h @@ -0,0 +1,14 @@ +#ifndef _VARIANT_ARDUINO_STM32_ +#define _VARIANT_ARDUINO_STM32_ + +#define digitalPinToPort(P) ( PIN_MAP[P].gpio_device ) +#define digitalPinToBitMask(P) ( BIT(PIN_MAP[P].gpio_bit) ) +#define portOutputRegister(port) ( &(port->regs->ODR) ) +#define portInputRegister(port) ( &(port->regs->IDR) ) + +#define portSetRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BSRR) ) +#define portClearRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BRR) ) + +#define portConfigRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->CRL) ) + +#endif /* _VARIANT_ARDUINO_STM32_ */ \ No newline at end of file