2014-12-05 01:58:27 -08:00
|
|
|
#ifndef _VARIANT_ARDUINO_STM32_
|
|
|
|
#define _VARIANT_ARDUINO_STM32_
|
|
|
|
|
2015-02-08 02:28:05 -08:00
|
|
|
#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) )
|
2014-12-05 01:58:27 -08:00
|
|
|
|
2015-02-15 14:09:11 -08:00
|
|
|
#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) )
|
|
|
|
|
2014-12-05 01:58:27 -08:00
|
|
|
#endif /* _VARIANT_ARDUINO_STM32_ */
|