Blame view

emetteur/SX1276Lib/enums/enums.h 2.49 KB
64abd45d   rcavalie   arrangements fich...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
  /*
   / _____)             _              | |
  ( (____  _____ ____ _| |_ _____  ____| |__
   \____ \| ___ |    (_   _) ___ |/ ___)  _ \
   _____) ) ____| | | || |_| ____( (___| | | |
  (______/|_____)_|_|_| \__)_____)\____)_| |_|
      (C) 2014 Semtech
  
  Description: -
  
  License: Revised BSD License, see LICENSE.TXT file include in the project
  
  Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin
  */
  #ifndef __ENUMS_H__
  #define __ENUMS_H__
  
  /*!
   * Radio driver internal state machine states definition
   */
  typedef enum RadioState
  {
      RF_IDLE = 0,
      RF_RX_RUNNING,
      RF_TX_RUNNING,
      RF_CAD,
  }RadioState_t;
  
  /*!
   *    Type of the modem. [LORA / FSK]
   */
  typedef enum ModemType
  {
      MODEM_FSK = 0,
      MODEM_LORA
  }RadioModems_t;
  
  /*!
   * Type of the supported board. [SX1276MB1MAS / SX1276MB1LAS]
   */
  typedef enum BoardType
  {
      SX1276MB1MAS = 0,
      SX1276MB1LAS,
      UNKNOWN
  }BoardType_t;
  
  /*!
   * Radio FSK modem parameters
   */
  typedef struct
  {
      int8_t   Power;
      uint32_t Fdev;
      uint32_t Bandwidth;
      uint32_t BandwidthAfc;
      uint32_t Datarate;
      uint16_t PreambleLen;
      bool     FixLen;
      uint8_t  PayloadLen;
      bool     CrcOn;
      bool     IqInverted;
      bool     RxContinuous;
      uint32_t TxTimeout;
      uint32_t RxSingleTimeout;
  }RadioFskSettings_t;
  
  /*!
   * Radio FSK packet handler state
   */
  typedef struct
  {
      uint8_t  PreambleDetected;
      uint8_t  SyncWordDetected;
      int8_t   RssiValue;
      int32_t  AfcValue;
      uint8_t  RxGain;
      uint16_t Size;
      uint16_t NbBytes;
      uint8_t  FifoThresh;
      uint8_t  ChunkSize;
  }RadioFskPacketHandler_t;
  
  /*!
   * Radio LoRa modem parameters
   */
  typedef struct
  {
      int8_t   Power;
      uint32_t Bandwidth;
      uint32_t Datarate;
      bool     LowDatarateOptimize;
      uint8_t  Coderate;
      uint16_t PreambleLen;
      bool     FixLen;
      uint8_t  PayloadLen;
      bool     CrcOn;
      bool     FreqHopOn;
      uint8_t  HopPeriod;
      bool     IqInverted;
      bool     RxContinuous;
      uint32_t TxTimeout;
      bool     PublicNetwork;
  }RadioLoRaSettings_t;
  
  /*!
   * Radio LoRa packet handler state
   */
  typedef struct
  {
      int8_t SnrValue;
      int8_t RssiValue;
      uint8_t Size;
  }RadioLoRaPacketHandler_t;
  
  /*!
   * Radio Settings
   */
  typedef struct
  {
      RadioState               State;
      ModemType                Modem;
      uint32_t                 Channel;
      RadioFskSettings_t       Fsk;
      RadioFskPacketHandler_t  FskPacketHandler;
      RadioLoRaSettings_t      LoRa;
      RadioLoRaPacketHandler_t LoRaPacketHandler;
  }RadioSettings_t;
  
  
  #endif //__ENUMS_H__