pcb changes

Fork of SingleFrequencyLora by Christopher De Bank

Committer:
mluis
Date:
Mon Apr 24 09:26:23 2017 +0000
Revision:
26:d09a8ef807e2
Parent:
22:7f3aab69cca9
WARNING: Radio API timings changed from micro-seconds to milliseconds; ; Synchronized with https://github.com/Lora-net/LoRaMac-node git revision e506c246652fa44c3f24cecb89d0707b49ece739

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 (______/|_____)_|_|_| \__)_____)\____)_| |_|
mluis 22:7f3aab69cca9 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 /*!
mluis 21:2e496deb7858 19 * Radio driver internal state machine states definition
GregCr 0:e6ceb13d2d05 20 */
mluis 21:2e496deb7858 21 typedef enum RadioState
GregCr 0:e6ceb13d2d05 22 {
mluis 21:2e496deb7858 23 RF_IDLE = 0,
mluis 21:2e496deb7858 24 RF_RX_RUNNING,
mluis 21:2e496deb7858 25 RF_TX_RUNNING,
mluis 21:2e496deb7858 26 RF_CAD,
mluis 21:2e496deb7858 27 }RadioState_t;
GregCr 0:e6ceb13d2d05 28
GregCr 0:e6ceb13d2d05 29 /*!
mluis 13:618826a997e2 30 * Type of the modem. [LORA / FSK]
GregCr 0:e6ceb13d2d05 31 */
mluis 21:2e496deb7858 32 typedef enum ModemType
GregCr 0:e6ceb13d2d05 33 {
mluis 13:618826a997e2 34 MODEM_FSK = 0,
mluis 13:618826a997e2 35 MODEM_LORA
mluis 21:2e496deb7858 36 }RadioModems_t;
GregCr 0:e6ceb13d2d05 37
GregCr 2:5eb3066446dd 38 /*!
mluis 21:2e496deb7858 39 * Type of the supported board. [SX1276MB1MAS / SX1276MB1LAS]
GregCr 2:5eb3066446dd 40 */
mluis 21:2e496deb7858 41 typedef enum BoardType
GregCr 2:5eb3066446dd 42 {
mluis 13:618826a997e2 43 SX1276MB1MAS = 0,
mluis 13:618826a997e2 44 SX1276MB1LAS,
mluis 13:618826a997e2 45 UNKNOWN
mluis 21:2e496deb7858 46 }BoardType_t;
mluis 21:2e496deb7858 47
GregCr 0:e6ceb13d2d05 48 /*!
GregCr 0:e6ceb13d2d05 49 * Radio FSK modem parameters
GregCr 0:e6ceb13d2d05 50 */
GregCr 0:e6ceb13d2d05 51 typedef struct
GregCr 0:e6ceb13d2d05 52 {
GregCr 0:e6ceb13d2d05 53 int8_t Power;
GregCr 0:e6ceb13d2d05 54 uint32_t Fdev;
GregCr 0:e6ceb13d2d05 55 uint32_t Bandwidth;
GregCr 0:e6ceb13d2d05 56 uint32_t BandwidthAfc;
GregCr 0:e6ceb13d2d05 57 uint32_t Datarate;
GregCr 0:e6ceb13d2d05 58 uint16_t PreambleLen;
GregCr 0:e6ceb13d2d05 59 bool FixLen;
mluis 13:618826a997e2 60 uint8_t PayloadLen;
GregCr 0:e6ceb13d2d05 61 bool CrcOn;
GregCr 0:e6ceb13d2d05 62 bool IqInverted;
GregCr 0:e6ceb13d2d05 63 bool RxContinuous;
GregCr 0:e6ceb13d2d05 64 uint32_t TxTimeout;
mluis 26:d09a8ef807e2 65 uint32_t RxSingleTimeout;
GregCr 0:e6ceb13d2d05 66 }RadioFskSettings_t;
GregCr 0:e6ceb13d2d05 67
GregCr 0:e6ceb13d2d05 68 /*!
GregCr 0:e6ceb13d2d05 69 * Radio FSK packet handler state
GregCr 0:e6ceb13d2d05 70 */
GregCr 0:e6ceb13d2d05 71 typedef struct
GregCr 0:e6ceb13d2d05 72 {
GregCr 0:e6ceb13d2d05 73 uint8_t PreambleDetected;
GregCr 0:e6ceb13d2d05 74 uint8_t SyncWordDetected;
GregCr 0:e6ceb13d2d05 75 int8_t RssiValue;
GregCr 0:e6ceb13d2d05 76 int32_t AfcValue;
GregCr 0:e6ceb13d2d05 77 uint8_t RxGain;
GregCr 0:e6ceb13d2d05 78 uint16_t Size;
GregCr 0:e6ceb13d2d05 79 uint16_t NbBytes;
GregCr 0:e6ceb13d2d05 80 uint8_t FifoThresh;
GregCr 0:e6ceb13d2d05 81 uint8_t ChunkSize;
GregCr 0:e6ceb13d2d05 82 }RadioFskPacketHandler_t;
GregCr 0:e6ceb13d2d05 83
GregCr 0:e6ceb13d2d05 84 /*!
GregCr 0:e6ceb13d2d05 85 * Radio LoRa modem parameters
GregCr 0:e6ceb13d2d05 86 */
GregCr 0:e6ceb13d2d05 87 typedef struct
GregCr 0:e6ceb13d2d05 88 {
GregCr 0:e6ceb13d2d05 89 int8_t Power;
GregCr 0:e6ceb13d2d05 90 uint32_t Bandwidth;
GregCr 0:e6ceb13d2d05 91 uint32_t Datarate;
GregCr 0:e6ceb13d2d05 92 bool LowDatarateOptimize;
GregCr 0:e6ceb13d2d05 93 uint8_t Coderate;
GregCr 0:e6ceb13d2d05 94 uint16_t PreambleLen;
GregCr 0:e6ceb13d2d05 95 bool FixLen;
mluis 13:618826a997e2 96 uint8_t PayloadLen;
GregCr 0:e6ceb13d2d05 97 bool CrcOn;
mluis 13:618826a997e2 98 bool FreqHopOn;
GregCr 6:e7f02929cd3d 99 uint8_t HopPeriod;
GregCr 0:e6ceb13d2d05 100 bool IqInverted;
GregCr 0:e6ceb13d2d05 101 bool RxContinuous;
GregCr 0:e6ceb13d2d05 102 uint32_t TxTimeout;
mluis 26:d09a8ef807e2 103 bool PublicNetwork;
GregCr 0:e6ceb13d2d05 104 }RadioLoRaSettings_t;
GregCr 0:e6ceb13d2d05 105
GregCr 0:e6ceb13d2d05 106 /*!
GregCr 0:e6ceb13d2d05 107 * Radio LoRa packet handler state
GregCr 0:e6ceb13d2d05 108 */
GregCr 0:e6ceb13d2d05 109 typedef struct
GregCr 0:e6ceb13d2d05 110 {
GregCr 0:e6ceb13d2d05 111 int8_t SnrValue;
GregCr 0:e6ceb13d2d05 112 int8_t RssiValue;
GregCr 0:e6ceb13d2d05 113 uint8_t Size;
GregCr 0:e6ceb13d2d05 114 }RadioLoRaPacketHandler_t;
GregCr 0:e6ceb13d2d05 115
GregCr 0:e6ceb13d2d05 116 /*!
GregCr 0:e6ceb13d2d05 117 * Radio Settings
GregCr 0:e6ceb13d2d05 118 */
GregCr 0:e6ceb13d2d05 119 typedef struct
GregCr 0:e6ceb13d2d05 120 {
mluis 13:618826a997e2 121 RadioState State;
mluis 13:618826a997e2 122 ModemType Modem;
GregCr 0:e6ceb13d2d05 123 uint32_t Channel;
GregCr 0:e6ceb13d2d05 124 RadioFskSettings_t Fsk;
GregCr 0:e6ceb13d2d05 125 RadioFskPacketHandler_t FskPacketHandler;
GregCr 0:e6ceb13d2d05 126 RadioLoRaSettings_t LoRa;
GregCr 0:e6ceb13d2d05 127 RadioLoRaPacketHandler_t LoRaPacketHandler;
GregCr 0:e6ceb13d2d05 128 }RadioSettings_t;
GregCr 0:e6ceb13d2d05 129
GregCr 0:e6ceb13d2d05 130
GregCr 0:e6ceb13d2d05 131 #endif //__ENUMS_H__