variant.h 736 B

1234567891011121314151617
  1. #pragma once
  2. #define digitalPinToPort(P) ( PIN_MAP[P].gpio_device )
  3. #define digitalPinToBitMask(P) ( BIT(PIN_MAP[P].gpio_bit) )
  4. #define portOutputRegister(port) ( &(port->regs->ODR) )
  5. #define portInputRegister(port) ( &(port->regs->IDR) )
  6. #define portSetRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BSRR) )
  7. #define portClearRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BRR) )
  8. #define portConfigRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->CRL) )
  9. static const uint8_t SS = BOARD_SPI1_NSS_PIN;
  10. static const uint8_t SS1 = BOARD_SPI2_NSS_PIN;
  11. static const uint8_t MOSI = BOARD_SPI1_MOSI_PIN;
  12. static const uint8_t MISO = BOARD_SPI1_MISO_PIN;
  13. static const uint8_t SCK = BOARD_SPI1_SCK_PIN;