Skip to content

Commit b67efa7

Browse files
Merge pull request #94 from martinayotte/master
Add missing/forgotten variant.h to STM32F4 supplied by @martinayotte
2 parents 07ba8f2 + fbed6fb commit b67efa7

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#ifndef _VARIANT_ARDUINO_STM32_
2+
#define _VARIANT_ARDUINO_STM32_
3+
4+
#define digitalPinToPort(P) ( PIN_MAP[P].gpio_device )
5+
#define digitalPinToBitMask(P) ( BIT(PIN_MAP[P].gpio_bit) )
6+
#define portOutputRegister(port) ( &(port->regs->ODR) )
7+
#define portInputRegister(port) ( &(port->regs->IDR) )
8+
9+
#define portSetRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BSRR) )
10+
#define portClearRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BRR) )
11+
12+
#define portConfigRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->CRL) )
13+
14+
#endif /* _VARIANT_ARDUINO_STM32_ */

0 commit comments

Comments
 (0)