1111

Fork of SX1276Lib by Semtech

Committer:
GregCr
Date:
Mon Aug 18 14:24:46 2014 +0000
Revision:
0:e6ceb13d2d05
Child:
2:5eb3066446dd
SX1276 Library first attempt

Who changed what in which revision?

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