Giorgos Tsapparellas / SX1272Lib

Dependents:   LoRaWAN_mbed_lmic_agriculture_app

Fork of SX1272Lib 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 )2015 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 
00016  Used by Giorgos Tsapparellas for Internet of Things (IoT) smart monitoring
00017  device for agriculture using LoRaWAN technology.
00018  
00019  Date of issued copy: 20 January 2018
00020  
00021  Modifications: 
00022  - No external modifications of the existing "AS IT IS" software.
00023 */
00024 #ifndef __ENUMS_H__
00025 #define __ENUMS_H__
00026 
00027 /*!
00028  * Radio driver internal state machine states definition
00029  */
00030 typedef enum RadioState
00031 {
00032     RF_IDLE = 0,
00033     RF_RX_RUNNING,
00034     RF_TX_RUNNING,
00035     RF_CAD,
00036 }RadioState_t;
00037 
00038 /*!
00039  *    Type of the modem. [LORA / FSK]
00040  */
00041 typedef enum ModemType
00042 {
00043     MODEM_FSK = 0,
00044     MODEM_LORA
00045 }RadioModems_t;
00046 
00047 /*!
00048  * Type of the supported board. 
00049  */
00050 typedef enum BoardType
00051 {
00052     SX1272MB2XAS = 0,
00053     SX1272MB1DCS,
00054     NA_MOTE_72,
00055     MDOT_F411RE,
00056     UNKNOWN
00057 }BoardType_t;
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     uint32_t RxSingleTimeout;
00077 }RadioFskSettings_t ;
00078 
00079 /*!
00080  * Radio FSK packet handler state
00081  */
00082 typedef struct
00083 {
00084     uint8_t  PreambleDetected;
00085     uint8_t  SyncWordDetected;
00086     int8_t   RssiValue;
00087     int32_t  AfcValue;
00088     uint8_t  RxGain;
00089     uint16_t Size;
00090     uint16_t NbBytes;
00091     uint8_t  FifoThresh;
00092     uint8_t  ChunkSize;
00093 }RadioFskPacketHandler_t ;
00094 
00095 /*!
00096  * Radio LoRa modem parameters
00097  */
00098 typedef struct
00099 {
00100     int8_t   Power;
00101     uint32_t Bandwidth;
00102     uint32_t Datarate;
00103     bool     LowDatarateOptimize;
00104     uint8_t  Coderate;
00105     uint16_t PreambleLen;
00106     bool     FixLen;
00107     uint8_t  PayloadLen;
00108     bool     CrcOn;
00109     bool     FreqHopOn;
00110     uint8_t  HopPeriod;
00111     bool     IqInverted;
00112     bool     RxContinuous;
00113     uint32_t TxTimeout;
00114     bool     PublicNetwork;
00115 }RadioLoRaSettings_t ;
00116 
00117 /*!
00118  * Radio LoRa packet handler state
00119  */
00120 typedef struct
00121 {
00122     int8_t SnrValue;
00123     int8_t RssiValue;
00124     uint8_t Size;
00125 }RadioLoRaPacketHandler_t ;
00126 
00127 /*!
00128  * Radio Settings
00129  */
00130 typedef struct
00131 {
00132     RadioState               State;
00133     ModemType                Modem;
00134     uint32_t                 Channel;
00135     RadioFskSettings_t        Fsk;
00136     RadioFskPacketHandler_t   FskPacketHandler;
00137     RadioLoRaSettings_t       LoRa;
00138     RadioLoRaPacketHandler_t  LoRaPacketHandler;
00139 }RadioSettings_t ;
00140 
00141 
00142 #endif //__ENUMS_H__