project_config.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef __PROJECT_CONFIG_H__
  2. #define __PROJECT_CONFIG_H__
  3. //基于semtech官网驱动移植
  4. //官网驱动网址 https://github.com/Lora-net/LoRaMac-node/tree/master/src/radio 下载日期 2021/2/3
  5. #define LORA_SOFT_VERSION "sx126x driver for stm32f103 V0.0.0"
  6. //--------------------------------------------- 测试默认配置 ---------------------------------------------
  7. #define LORA_FRE 486300000//470000000 // 收发频率
  8. #define LORA_TX_OUTPUT_POWER 17 // 测试默认使用的发射功率,126x发射功率0~22dbm,127x发射功率2~20dbm
  9. #define LORA_BANDWIDTH 1 // [0: 125 kHz, 测试默认使用的带宽,sx126x:[0: 125 kHz,1: 250 kHz,2: 500 kHz,3: Reserved]
  10. #define LORA_SPREADING_FACTOR 7 // 测试默认使用的扩频因子范围7~12
  11. #define LORA_CODINGRATE 2 // 测试默认使用的纠错编码率[1: 4/5,2: 4/6,3: 4/7,4: 4/8]
  12. #define LORA_PREAMBLE_LENGTH 8 // 前导码长度
  13. #define LORA_SX126X_SYMBOL_TIMEOUT 0 // Symbols(sx126x用到的是0,127x用到的是5)
  14. #define LORA_FIX_LENGTH_PAYLOAD_ON false // 是否为固定长度包(暂时只是sx126x用到了)
  15. #define LORA_IQ_INVERSION_ON false // 这个应该是设置是否翻转中断电平的(暂时只是sx126x用到了)
  16. #define LORA_RX_TIMEOUT_VALUE 0
  17. /*!
  18. * Board MCU pins definitions
  19. */
  20. //SPI
  21. #define RADIO_NSS_PIN GPIO_Pin_4
  22. #define RADIO_NSS_PORT GPIOA
  23. #define RADIO_MOSI_PIN GPIO_Pin_7
  24. #define RADIO_MOSI_PORT GPIOA
  25. #define RADIO_MISO_PIN GPIO_Pin_6
  26. #define RADIO_MISO_PORT GPIOA
  27. #define RADIO_SCK_PIN GPIO_Pin_5
  28. #define RADIO_SCK_PORT GPIOA
  29. //RST复位脚
  30. #define RADIO_nRESET_PIN GPIO_Pin_0
  31. #define RADIO_nRESET_PORT GPIOB
  32. //DIO1 引脚
  33. #define RADIO_DIO1_PIN GPIO_Pin_8
  34. #define RADIO_DIO1_PORT GPIOE
  35. //BUSY 引脚
  36. #define RADIO_DIO4_BUSY_PIN GPIO_Pin_4
  37. #define RADIO_DIO4_BUSY_PORT GPIOC
  38. //下面这几个引脚没用用到,设置为浮空输入模式
  39. //TXEN
  40. #define RADIO_DIO0_TXEN_PIN GPIO_Pin_1
  41. #define RADIO_DIO0_TXEN_PORT GPIOB
  42. //DIO2
  43. #define RADIO_DIO2_PIN GPIO_Pin_9
  44. #define RADIO_DIO2_PORT GPIOE
  45. //DIO3
  46. #define RADIO_DIO3_PIN GPIO_Pin_10
  47. #define RADIO_DIO3_PORT GPIOE
  48. //RXEN
  49. #define RADIO_DIO5_RXEN_PIN GPIO_Pin_5
  50. #define RADIO_DIO5_RXEN_PORT GPIOC
  51. #endif // __PROJECT_CONFIG_H__