#include "regEntries.hpp"


SSettingDesctriptors _descriptors=
{
   //------ RegOpMode
   { RESequencerOff, "Sequencer Off", {
               [ESequencerOff::SequencerOn]="Sequencer on",
               [ESequencerOff::SequencerOff]="Sequencer Off" } },
   { REListenOn,     "Listening On", {
               [EListenOn::ListenOff]="Listen Off",
               [EListenOn::ListenOn]="Listen On" } },
   { REListenAbort,  "Abort Listening", {
               "Always reads zero" } },
   { REMode,         "Operating mode", {
               [EMode::Sleep]="Sleep",
               [EMode::Standby]="Standby",
               [EMode::FrequencySynth]="Frequency Synthesizer mode",
               [EMode::Transmit]="Transmitter mode",
               [EMode::Receive]="Receiver mode" } },

   //------ RegDataModul
   { REDataMode, "Data processing mode", {
               [EDataMode::PacketMode]="Packet mode",
               [EDataMode::Reserved]="reserved",
               [EDataMode::ContinuousWithBitSynchronizer]="continuous with bit synchronizer",
               [EDataMode::ContinuousWithoutBitSynchronizer]="continuous without bit synchronizer" } },
   { REModulationType, "Modulation scheme", {
               [EModulationType::FSK]="FSK",
               [EModulationType::OOK]="OOK" } },
   { REModulationShaping, "Datashaping", {
               [EModulationShaping::None]="no shaping",
               [EModulationShaping::Gaussian_BT_1_0]="Gaussian filter, BT=1.0",
               [EModulationShaping::Gaussian_BT_0_5]="Gaussian filter, BT=0.5",
               [EModulationShaping::Gaussian_BT_0_3]="Gaussian filter, BT=0.3" } },

   //------ RegBitRateMsb, RegBitRateLsb, RegFdevMsb, RegFdevLsb, RegFrfMsb, RegFrfMid, RegFrfLsb
   { REBitRateMsb, "Bitrate MSB", {
               } },
   { REBitRateLsb, "Bitrate LSB", {
               } },
   { REFdevMsb, "frequency deviation MSB", {
               } },
   { REFdevLsb, "frequency deviation LSB", {
               } },
   { REFrfMsb, "RF carrier frequency MSB", {
               } },
   { REFrfMid, "RF carrier frequency Mid", {
               } },
   { REFrfLsb, "RF carrier frequency LSB", {
               } },

   //------ RegOsc1
   { RERcCalStart, "Triggers the calibration of the RC oscillator when set", {
               "Write only",
               } },
   { RERcCalDone, "Calibration done", {
               [ERcCalDone::Progress]="RC calibration in progress",
               [ERcCalDone::Done]="RC calibration is over",
               } },

   //------ RegAfcCtrl
   { REAfcLowBetaOn, "Improved AFC routine for signals with modulation index lower than 2", {
               [EAfcLowBetaOn::Standard]="Standard AFC routine",
               [EAfcLowBetaOn::Improved]="Improved AFC routine",
               } },

   //------ RegListenMode
   { REListenResolIdle, "Resolution of listen mode idle time", {
               "reserved",
               "64µs",
               "4.4ms",
               "262ms"
               } },
   { REListenResolRx, "Resolution of listen mode Rx time", {
               "reserved",
               "64µs",
               "4.4ms",
               "262ms"
               } },
   { REListenCriteria, "Criteria for packet acceptance in Listen mode", {
               "signal strength is above RssiThreshold",
               "signal strength is above RssiThreshold and SyncAddress matched"
               } },
   { REListenEnd, "Action taken after acceptance of packet in listen mode", {
               "chip stays in Rx mode",
               "mode defined by 'Mode'",
               "Listen mode resumes in idle state",
               "reserved",
               } },

   //------ RegListen2, RegListen3
   { REListenCoefIdle, "Duration of the idle phase in listen mode", { } },
   { REListenCoefRx, "Duration of the Rx phase in listen mode", { } },

   //------ RegVersion
   { REVersion, "Version code of the chip", { } },

   //------ RegPaLevel
   { REPa0On, "Enable PA0, connected to RFIO and LNA", { } },
   { REPa1On, "Enable PA1, on PA_BOOST pin", { } },
   { REPa2On, "Enable PA2, on PA_BOOST pin", { } },
   { REOutputPower, "Output power setting, with 1dB steps", { } },

   //------ RegPaRamp
   { REPaRamp, "Rise/Fall time of ramp up/down in FSK", { } },

   //------ RegOcp
   { REOcpOn, "Enables overload current protection for the PA", { } },
   { REOcpTrim, "Trimming of Ocp current", { } },

   //------ RegLna
   { RELnaZin, "LNAs input impedance", { } },
   { RELnaCurrentGain, "Current LNA gain", { } },
   { RELnaGainSelect, "LNA gain setting", { } },

   //------ RegRxBw
   { REDccFreq, "Cut-off frequency of the DC offset canceller", { } },
   { RERxBwMant, "Channel filter bandwidth control", { } },
   { RERxBwExp, "Channel filter bandwith control", { } },

   //------ RegAfcBw
   { REDccFreqAfc, "DccFreq parameter used during the AFC", { } },
   { RERxBwMantAfc, "RxBwMant parameter used during the AFC", { } },
   { RERxBwExpAfc, "RxBwExp parameter used during the AFC", { } },


    //------ RegOokPeak
   { REOokThreshType, "Selects type of threshold in the OOK data slicer", { } },
   { REOokPeakTheshStep, "Size of each decrement of the RSSI threshold in the OOK demodulator", { } },
   { REOokPeakTheshDec, "Period of decrement of the RSSI threshold in the OOK demodulator", { } },

   //------ RegOokAvg, RegOokFix
   { REOokAverageThreshFilt, "Filter coefficients in average mode of the OOK demodulator", { } },
   { REOokFixedThresh, "Fixed threshold value (in dB) in the OOK demodulator", { } },

   //------ RegOokAvg
   { REFeiDone, "FEI done", { } },
   { REFeiStart, "write only", { } },
   { REAfcDone, "AFC done", { } },
   { REAfcAutclearOn, "Only valid if AfcAutoOn is set", { } },
   { REAfcAutoOn, "AFC auto on", { } },
   { REAfcClear, "AFC auto clear", { } },
   { REAfcStart, "AFC Start; always 0", { } },

   //------ RegAfcMsb, RegAfcLsb, RegFeiMsb, RegFeiLsb
   { REAfcValueMsb, "MSB of the AfcValue, 2’s complement format", { } },
   { REAfcValueLsb, "LSB of the AfcValue, 2’s complement format", { } },
   { REFeiValueMsb, "MSB of the measured frequency offset, 2’s complement", { } },
   { REFeiValueLsb, "LSB of the measured frequency offset, 2’s complement", { } },

   //------ RegRssiConfig
   { RERssiDone, "Rssi done", { } },
   { RERssiStart, "Trigger a RSSI measurement when set. Always reads 0", { } },

   //------ RegRssiValue
   { RERssiValue, "Absolute value of the RSSI in dBm, 0.5dB steps.", { } },

   //------ RegDioMapping1
   { REDio0Mapping, "Mapping of pins DIO0", { } },
   { REDio1Mapping, "Mapping of pins DIO1", { } },
   { REDio2Mapping, "Mapping of pins DIO2", { } },
   { REDio3Mapping, "Mapping of pins DIO3", { } },
   { REDio5Mapping, "Mapping of pins DIO5", { } },

   //------ RegDioMapping2
   { REClkOut, "Selects CLKOUT frequency", { } },

   //------ RegIrqFlags1
   { REModeReady, "Set when the operation mode requested in Mode, is ready", { } },
   { RERxReady, "Set in Rx mode, after RSSI, AGC and AFC", { } },
   { RETxReady, "Set in Tx mode, after PA ramp-up", { } },
   { REPllLock, "Set (in FS, Rx or Tx) when the PLL is locked", { } },
   { RERssi, "Set in Rx when the RssiValue exceeds RssiThreshold", { } },
   { RETimeout, "Set when a timeout occurs", { } },
   { REAutoMode, "Set when entering Intermediate mode", { } },
   { RESyncAddressMatch, "Set when Sync and Address (if enabled) are detected", { } },

   //------ RegIrqFlags2
   { REFifoFull, "Set when FIFO is full", { } },
   { REFifoNotEmpty, "Set when FIFO contains at least one byte", { } },
   { REFifoLevel, "Set when the number of bytes in the FIFO strictly exceeds FifoThreshold", { } },
   { REFifoOverrun, "Set when FIFO overrun occurs", { } },
   { REPacketSent, "Set in Tx when the complete packet has been sent", { } },
   { REPayloadReady, "Set in Rx when the payload is ready", { } },
   { RECrcOk, "Set in Rx when the CRC of the payload is Ok", { } },

   //------ RegRssiThresh, RegRxTimeout1, RegRxTimeout2, RegPreambleMsb, RegPreambleLsb
   { RERssiThreshold, "RSSI trigger level for Rssi interrup", { } },
   { RETimeoutRxStart, "Timeout interrupt is generated (Start)", { } },
   { RETimeoutRssiThresh, "Timeout interrupt is generated (Threshold)", { } },
   { REPreambleSizeMsb, "Size of the preamble to be sent (MSB)", { } },
   { REPreambleSizeLsb, "Size of the preamble to be sent (LSB)", { } },

   //------ RegSyncConfig
   { RESyncOn, "Enables the Sync word generation and detection", { } },
   { REFifoFillCondition, "FIFO filling condition", { } },
   { RESyncSize, "Size of the Sync word", { } },
   { RESyncTol, "Number of tolerated bit errors in Sync word", { } },

   //------ RegSyncValue1...RegSyncValue8
   { RESyncValue1, "1st byte of Sync word", { } },
   { RESyncValue2, "2st byte of Sync word", { } },
   { RESyncValue3, "3st byte of Sync word", { } },
   { RESyncValue4, "4st byte of Sync word", { } },
   { RESyncValue5, "5st byte of Sync word", { } },
   { RESyncValue6, "6st byte of Sync word", { } },
   { RESyncValue7, "7st byte of Sync word", { } },
   { RESyncValue8, "8st byte of Sync word", { } },

   //------ RegPacketConfig1
   { REPacketFormat, "Defines the packet format used", { } },
   { REDcFree, "Defines DC-free encoding/decoding performed", { } },
   { RECrcOn, "Enables CRC calculation/check", { } },
   { RECrcAutoClearOff, "Defines the behavior of the packet handler when CRC check fails", { } },
   { REAddressFiltering, "Defines address based filtering in Rx", { } },

   //------ RegPayloadLength, RegNodeAdrs, RegBroadcastAdrs
   { REPayloadLength, "payload length/max length in packet mode for RX", { } },
   { RENodeAddress, "Node address used in address filtering", { } },
   { REBroadcastAddress, "Broadcast address used in address filtering", { } },

   //------ RegAutoModes
   { REEnterCondition, "Interrupt condition for entering the intermediate mode", { } },
   { REExitCondition, "Interrupt condition for exiting the intermediate mode", { } },
   { REIntermediateMode, "Intermediate mode", { } },

   //------ RegFifoThresh
   { RETxStartCondition, "Defines the condition to start packet transmission", { } },
   { REFifoThreshold, "Used to trigger FifoLevel interrup", { } },

   //------ RegPacketConfig2
   { REInterPacketRxDelay, "After PayloadReady occurred, defines the delay between FIFO empty and the start of a new RSSI phase for next packet", { } },
   { RERestartRx, "Forces the Receiver in WAIT mode, in Continuous Rx mode", { } },
   { REAutoRxRestartOn, "Enables automatic Rx restart after packet has been completely read from FIFO", { } },
   { REAesOn, "Enable the AES encryption/decryption", { } },

   //------ RegAesKey1 ... RegAesKey16
   { REAesKey1, "1st byte of cipher key", { } },
   { REAesKey2, "2nd byte of cipher key", { } },
   { REAesKey3, "3rd byte of cipher key", { } },
   { REAesKey4, "4th byte of cipher key", { } },
   { REAesKey5, "5th byte of cipher key", { } },
   { REAesKey6, "6th byte of cipher key", { } },
   { REAesKey7, "7th byte of cipher key", { } },
   { REAesKey8, "8th byte of cipher key", { } },
   { REAesKey9, "9th byte of cipher key", { } },
   { REAesKey10, "10th byte of cipher key", { } },
   { REAesKey11, "11th byte of cipher key", { } },
   { REAesKey12, "12th byte of cipher key", { } },
   { REAesKey13, "13th byte of cipher key", { } },
   { REAesKey14, "14th byte of cipher key", { } },
   { REAesKey15, "15th byte of cipher key", { } },
   { REAesKey16, "16th byte of cipher key", { } },

   { RETempMeasStart, "Triggers the temperature measurement when set", { } },
   { RETempMeasRunning, "Set to 1 while the temperature measurement is running", { } },
   { RETempValue, "Measured temperature", { } },

   //------ RegTemp1
   { RETempMeasStart, "Triggers the temperature measurement when set", { } },
   { RETempMeasRunning, "Set to 1 while the temperature measurement is running", { } },
   { RETempValue, "Measured temperature", { } },

   //------ Test registers
   { RESensitivityBoost, "High sensitivity(0x2D) or normal sensitivity mode(0x1B)", { } },
   { REPa13dBm1, "Set to 0x5D for +13 dBm operation", { } },
   { REPa13dBm2, "Set to 0x7C for +13 dBm operation", { } },
   { REContinuousDagc, "Fading Margin Improvement", { } },
   { RELowBetaAfcOffset, "AFC offset set for low modulation index systems, used if AfcLowBetaOn=1", { } },
};

SSettingDesctriptor* descriptors=_descriptors;
int descriptorCount = sizeof(_descriptors)/sizeof(_descriptors[0]);
