sx1250_defs.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. / _____) _ | |
  3. ( (____ _____ ____ _| |_ _____ ____| |__
  4. \____ \| ___ | (_ _) ___ |/ ___) _ \
  5. _____) ) ____| | | || |_| ____( (___| | | |
  6. (______/|_____)_|_|_| \__)_____)\____)_| |_|
  7. (C)2019 Semtech
  8. Description:
  9. Functions used to handle LoRa concentrator SX1250 radios.
  10. License: Revised BSD License, see LICENSE.TXT file include in the project
  11. */
  12. #ifndef _SX1250_DEFS_H
  13. #define _SX1250_DEFS_H
  14. /* -------------------------------------------------------------------------- */
  15. /* --- DEPENDANCIES --------------------------------------------------------- */
  16. #include <stdint.h> /* C99 types*/
  17. #include "config.h" /* library configuration options (dynamically generated) */
  18. /* -------------------------------------------------------------------------- */
  19. /* --- PUBLIC MACROS -------------------------------------------------------- */
  20. #define SX1250_FREQ_TO_REG(f) (uint32_t)((uint64_t)f * (1 << 25) / 32000000U)
  21. /* -------------------------------------------------------------------------- */
  22. /* --- PUBLIC CONSTANTS ----------------------------------------------------- */
  23. /* -------------------------------------------------------------------------- */
  24. /* --- PUBLIC TYPES --------------------------------------------------------- */
  25. typedef enum {
  26. CALIBRATE = 0x89,
  27. CALIBRATE_IMAGE = 0x98,
  28. CLR_IRQ_STATUS = 0x02,
  29. STOP_TIMER_ON_PREAMBLE = 0x9F,
  30. SET_RFSWITCHMODE = 0x9D,
  31. GET_IRQ_STATUS = 0x12,
  32. GET_RX_BUFFER_STATUS = 0x13,
  33. GET_PACKET_STATUS = 0x14,
  34. READ_BUFFER = 0x1E,
  35. READ_REGISTER = 0x1D,
  36. SET_DIO_IRQ_PARAMS = 0x08,
  37. SET_MODULATION_PARAMS = 0x8B,
  38. SET_PA_CONFIG = 0x95,
  39. SET_PACKET_PARAMS = 0x8C,
  40. SET_PACKET_TYPE = 0x8A,
  41. SET_RF_FREQUENCY = 0x86,
  42. SET_BUFFER_BASE_ADDRESS = 0x8F,
  43. SET_SLEEP = 0x84,
  44. SET_STANDBY = 0x80,
  45. SET_RX = 0x82,
  46. SET_TX = 0x83,
  47. SET_TX_PARAMS = 0x8E,
  48. WRITE_BUFFER = 0x0E,
  49. WRITE_REGISTER = 0x0D,
  50. SET_TXCONTINUOUSWAVE = 0xD1,
  51. SET_TXCONTINUOUSPREAMBLE= 0xD2,
  52. GET_STATUS = 0xC0,
  53. SET_REGULATORMODE = 0x96,
  54. SET_FS = 0xC1,
  55. GET_DEVICE_ERRORS = 0x17
  56. } sx1250_op_code_t;
  57. typedef enum {
  58. STDBY_RC = 0x00,
  59. STDBY_XOSC = 0x01
  60. } sx1250_standby_modes_t;
  61. typedef enum {
  62. PACKET_TYPE_GFSK = 0x00,
  63. PACKET_TYPE_LORA = 0x01
  64. } sx1250_packet_type_t;
  65. typedef enum {
  66. SET_RAMP_10U = 0x00,
  67. SET_RAMP_20U = 0x01,
  68. SET_RAMP_40U = 0x02,
  69. SET_RAMP_80U = 0x03,
  70. SET_RAMP_200U = 0x04,
  71. SET_RAMP_800U = 0x05,
  72. SET_RAMP_1700U = 0x06,
  73. SET_RAMP_3400U = 0x07
  74. } sx1250_ramp_time_t;
  75. #endif
  76. /* --- EOF ------------------------------------------------------------------ */