pin pong

Dependents:   SX1272PingPong

Fork of SX1276Lib by Semtech

Committer:
tmulrooney
Date:
Wed Feb 17 00:47:12 2016 +0000
Revision:
24:9100348e6c28
Parent:
23:273a2f93ae99
pin changes for FRDK-K22F

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,
tmulrooney 23:273a2f93ae99 45 SX1272RF1,
mluis 13:618826a997e2 46 UNKNOWN
mluis 21:2e496deb7858 47 }BoardType_t;
mluis 21:2e496deb7858 48
GregCr 0:e6ceb13d2d05 49 /*!
GregCr 0:e6ceb13d2d05 50 * Radio FSK modem parameters
GregCr 0:e6ceb13d2d05 51 */
GregCr 0:e6ceb13d2d05 52 typedef struct
GregCr 0:e6ceb13d2d05 53 {
GregCr 0:e6ceb13d2d05 54 int8_t Power;
GregCr 0:e6ceb13d2d05 55 uint32_t Fdev;
GregCr 0:e6ceb13d2d05 56 uint32_t Bandwidth;
GregCr 0:e6ceb13d2d05 57 uint32_t BandwidthAfc;
GregCr 0:e6ceb13d2d05 58 uint32_t Datarate;
GregCr 0:e6ceb13d2d05 59 uint16_t PreambleLen;
GregCr 0:e6ceb13d2d05 60 bool FixLen;
mluis 13:618826a997e2 61 uint8_t PayloadLen;
GregCr 0:e6ceb13d2d05 62 bool CrcOn;
GregCr 0:e6ceb13d2d05 63 bool IqInverted;
GregCr 0:e6ceb13d2d05 64 bool RxContinuous;
GregCr 0:e6ceb13d2d05 65 uint32_t TxTimeout;
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;
GregCr 0:e6ceb13d2d05 103 }RadioLoRaSettings_t;
GregCr 0:e6ceb13d2d05 104
GregCr 0:e6ceb13d2d05 105 /*!
GregCr 0:e6ceb13d2d05 106 * Radio LoRa packet handler state
GregCr 0:e6ceb13d2d05 107 */
GregCr 0:e6ceb13d2d05 108 typedef struct
GregCr 0:e6ceb13d2d05 109 {
GregCr 0:e6ceb13d2d05 110 int8_t SnrValue;
GregCr 0:e6ceb13d2d05 111 int8_t RssiValue;
GregCr 0:e6ceb13d2d05 112 uint8_t Size;
GregCr 0:e6ceb13d2d05 113 }RadioLoRaPacketHandler_t;
GregCr 0:e6ceb13d2d05 114
GregCr 0:e6ceb13d2d05 115 /*!
GregCr 0:e6ceb13d2d05 116 * Radio Settings
GregCr 0:e6ceb13d2d05 117 */
GregCr 0:e6ceb13d2d05 118 typedef struct
GregCr 0:e6ceb13d2d05 119 {
mluis 13:618826a997e2 120 RadioState State;
mluis 13:618826a997e2 121 ModemType Modem;
GregCr 0:e6ceb13d2d05 122 uint32_t Channel;
GregCr 0:e6ceb13d2d05 123 RadioFskSettings_t Fsk;
GregCr 0:e6ceb13d2d05 124 RadioFskPacketHandler_t FskPacketHandler;
GregCr 0:e6ceb13d2d05 125 RadioLoRaSettings_t LoRa;
GregCr 0:e6ceb13d2d05 126 RadioLoRaPacketHandler_t LoRaPacketHandler;
GregCr 0:e6ceb13d2d05 127 }RadioSettings_t;
GregCr 0:e6ceb13d2d05 128
GregCr 0:e6ceb13d2d05 129
GregCr 0:e6ceb13d2d05 130 #endif //__ENUMS_H__