board.h 617 B

1234567891011121314151617181920212223
  1. #ifndef __BOARD_H
  2. #define __BOARD_H
  3. /* MACROs for SET, RESET or TOGGLE Output port */
  4. #define GPIO_HIGH(a,b) a->ODR |= b
  5. #define GPIO_LOW(a,b) a->ODR &= ~b
  6. #define GPIO_TOGGLE(a,b) a->ODR ^= b
  7. #define BUTTON_NUM 2
  8. #define BUTTON1_PORT GPIOD
  9. #define BUTTON1_PIN GPIO_PIN_4
  10. #define BUTTON2_PORT GPIOA
  11. #define BUTTON2_PIN GPIO_PIN_3
  12. #define SPI_PORT GPIOC
  13. #define SPI_SCK GPIO_PIN_5
  14. #define SPI_MOSI GPIO_PIN_6
  15. #define SPI_PINS (SPI_SCK | SPI_MOSI)
  16. #define SPI_LOAD_PORT GPIOD
  17. #define SPI_LOAD GPIO_PIN_3
  18. #endif /* __BOARD_H */