SX126x_SPI.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef __SX126X_SPI_H__
  2. #define __SX126X_SPI_H__
  3. #include "stm32f10x.h"
  4. /*!
  5. * Board MCU pins definitions
  6. */
  7. //SPI
  8. #define RADIO_NSS_PIN GPIO_Pin_4
  9. #define RADIO_NSS_PORT GPIOA
  10. #define RADIO_MOSI_PIN GPIO_Pin_7
  11. #define RADIO_MOSI_PORT GPIOA
  12. #define RADIO_MISO_PIN GPIO_Pin_6
  13. #define RADIO_MISO_PORT GPIOA
  14. #define RADIO_SCK_PIN GPIO_Pin_5
  15. #define RADIO_SCK_PORT GPIOA
  16. //RST复位脚
  17. #define RADIO_nRESET_PIN GPIO_Pin_0
  18. #define RADIO_nRESET_PORT GPIOB
  19. //DIO1 引脚
  20. #define RADIO_DIO1_PIN GPIO_Pin_8
  21. #define RADIO_DIO1_PORT GPIOE
  22. //BUSY 引脚
  23. #define RADIO_DIO4_BUSY_PIN GPIO_Pin_4
  24. #define RADIO_DIO4_BUSY_PORT GPIOC
  25. //下面这几个引脚没用用到,设置为浮空输入模式
  26. //TXEN
  27. #define RADIO_DIO0_TXEN_PIN GPIO_Pin_1
  28. #define RADIO_DIO0_TXEN_PORT GPIOB
  29. //DIO2
  30. #define RADIO_DIO2_PIN GPIO_Pin_9
  31. #define RADIO_DIO2_PORT GPIOE
  32. //DIO3
  33. #define RADIO_DIO3_PIN GPIO_Pin_10
  34. #define RADIO_DIO3_PORT GPIOE
  35. //RXEN
  36. #define RADIO_DIO5_RXEN_PIN GPIO_Pin_5
  37. #define RADIO_DIO5_RXEN_PORT GPIOC
  38. uint8_t Spi1Init(void);
  39. uint8_t HALSpi1InOut(uint8_t data);
  40. #endif