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