XRange SX1272Lib

Dependents:   XRangePingPong XRange-LoRaWAN-lmic-app lora-transceiver

Fork of SX1276Lib by Semtech

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers enums.h Source File

enums.h

00001 /*
00002  / _____)             _              | |
00003 ( (____  _____ ____ _| |_ _____  ____| |__
00004  \____ \| ___ |    (_   _) ___ |/ ___)  _ \
00005  _____) ) ____| | | || |_| ____( (___| | | |
00006 (______/|_____)_|_|_| \__)_____)\____)_| |_|
00007     ( C )2014 Semtech
00008 
00009 Description: -
00010 
00011 License: Revised BSD License, see LICENSE.TXT file include in the project
00012 
00013 Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin
00014 */
00015 #ifndef __ENUMS_H__
00016 #define __ENUMS_H__
00017 
00018 /*!
00019  *    State of the radio:
00020  *    [IDLE,
00021  *     RX_RUNNING, RX_TIMEOUT, RX_ERROR,
00022  *     TX_RUNNING, TX_TIMEOUT,
00023        CAD]
00024  */
00025 enum RadioState
00026 {
00027     LOWPOWER = 0,
00028     IDLE,
00029     
00030     RX,
00031     RX_TIMEOUT,
00032     RX_ERROR,
00033     
00034     TX,
00035     TX_TIMEOUT,
00036     
00037     CAD,
00038     CAD_DONE
00039 };
00040 
00041 /*!
00042  *    Type of the modem. [LORA / FSK]
00043  */
00044 enum ModemType
00045 {
00046     MODEM_FSK = 0,
00047     MODEM_LORA
00048 };
00049 
00050 /*!
00051  *    Type of the supported board. [SX1276MB1MAS / SX1276MB1LAS]
00052  */
00053 enum BoardType
00054 {
00055     SX1276MB1MAS = 0,
00056     SX1276MB1LAS,
00057     UNKNOWN
00058 };
00059 /*!
00060  * Radio FSK modem parameters
00061  */
00062 typedef struct
00063 {
00064     int8_t   Power;
00065     uint32_t Fdev;
00066     uint32_t Bandwidth;
00067     uint32_t BandwidthAfc;
00068     uint32_t Datarate;
00069     uint16_t PreambleLen;
00070     bool     FixLen;
00071     uint8_t  PayloadLen;
00072     bool     CrcOn;
00073     bool     IqInverted;
00074     bool     RxContinuous;
00075     uint32_t TxTimeout;
00076 }RadioFskSettings_t ;
00077 
00078 /*!
00079  * Radio FSK packet handler state
00080  */
00081 typedef struct
00082 {
00083     uint8_t  PreambleDetected;
00084     uint8_t  SyncWordDetected;
00085     int8_t   RssiValue;
00086     int32_t  AfcValue;
00087     uint8_t  RxGain;
00088     uint16_t Size;
00089     uint16_t NbBytes;
00090     uint8_t  FifoThresh;
00091     uint8_t  ChunkSize;
00092 }RadioFskPacketHandler_t ;
00093 
00094 /*!
00095  * Radio LoRa modem parameters
00096  */
00097 typedef struct
00098 {
00099     int8_t   Power;
00100     uint32_t Bandwidth;
00101     uint32_t Datarate;
00102     bool     LowDatarateOptimize;
00103     uint8_t  Coderate;
00104     uint16_t PreambleLen;
00105     bool     FixLen;
00106     uint8_t  PayloadLen;
00107     bool     CrcOn;
00108     bool     FreqHopOn;
00109     uint8_t  HopPeriod;
00110     bool     IqInverted;
00111     bool     RxContinuous;
00112     uint32_t TxTimeout;
00113 }RadioLoRaSettings_t ;
00114 
00115 /*!
00116  * Radio LoRa packet handler state
00117  */
00118 typedef struct
00119 {
00120     int8_t SnrValue;
00121     int8_t RssiValue;
00122     uint8_t Size;
00123 }RadioLoRaPacketHandler_t ;
00124 
00125 /*!
00126  * Radio Settings
00127  */
00128 typedef struct
00129 {
00130     RadioState               State;
00131     ModemType                Modem;
00132     uint32_t                 Channel;
00133     RadioFskSettings_t        Fsk;
00134     RadioFskPacketHandler_t   FskPacketHandler;
00135     RadioLoRaSettings_t       LoRa;
00136     RadioLoRaPacketHandler_t  LoRaPacketHandler;
00137 }RadioSettings_t ;
00138 
00139 
00140 #endif //__ENUMS_H__
00141