Driver for the SX1280 RF Transceiver
Dependents: SX1280PingPong RangignMaster RangingSlave MSNV2-Terminal_V1-6 ... more
Diff: sx1280.h
- Revision:
- 12:c4f110f3fe3e
- Parent:
- 11:d60df50e108f
--- a/sx1280.h Wed Jul 18 08:48:34 2018 +0000 +++ b/sx1280.h Thu Nov 08 10:08:44 2018 +0000 @@ -138,6 +138,9 @@ */ #define REG_LR_RANGINGRESULTCLEARREG 0x0923 + +#define REG_RANGING_RSSI 0x0964 + /*! * \brief The default number of samples considered in built-in ranging filter */ @@ -192,7 +195,26 @@ /*! * \brief Select high sensitivity versus power consumption */ -#define REG_HIGH_SENSITIVITY 0x0891 +#define REG_LNA_REGIME 0x0891 +#define MASK_LNA_REGIME 0xC0 + +/* + * \brief Register and mask controling the enabling of manual gain control + */ +#define REG_ENABLE_MANUAL_GAIN_CONTROL 0x089F +#define MASK_MANUAL_GAIN_CONTROL 0x80 + +/*! + * \brief Register and mask controling the demodulation detection + */ +#define REG_DEMOD_DETECTION 0x0895 +#define MASK_DEMOD_DETECTION 0xFE + +/*! + * Register and mask to set the manual gain parameter + */ +#define REG_MANUAL_GAIN_VALUE 0x089E +#define MASK_MANUAL_GAIN_VALUE 0xF0 /*! * \brief Represents the states of the radio @@ -643,8 +665,8 @@ */ typedef enum { - LNA_LOW_POWER_MASK = 0x00, - LNA_HIGH_SENSITIVITY_MASK = 0xC0, + LNA_LOW_POWER_MODE, + LNA_HIGH_SENSITIVITY_MODE, }RadioLnaSettings_t; /*! @@ -1520,6 +1542,40 @@ * \param [in] seed Initial LFSR value */ void SetWhiteningSeed( uint8_t seed ); + + /*! + * \brief Enable manual gain control and disable AGC + * + * \see SX1280::SetManualGainValue, SX1280::DisableManualGain + */ + void EnableManualGain( void ); + + /*! + * \brief Disable the manual gain control and enable AGC + * + * \see SX1280::EnableManualGain + */ + void DisableManualGain( void ); + + /*! + * \brief Set the gain for the AGC + * + * SX1280::EnableManualGain must be called before using this method + * + * \param [in] gain The value of gain to set, refer to datasheet for value meaning + * + * \see SX1280::EnableManualGain, SX1280::DisableManualGain + */ + void SetManualGainValue( uint8_t gain ); + + /*! + * \brief Configure the LNA regime of operation + * + * \param [in] lnaSetting The LNA setting. Possible values are + * LNA_LOW_POWER_MODE and + * LNA_HIGH_SENSITIVITY_MODE + */ + void SetLNAGainSetting( const RadioLnaSettings_t lnaSetting ); /*! * \brief Sets the number of bits used to check that ranging request match ranging ID @@ -1555,6 +1611,18 @@ double GetRangingResult( RadioRangingResultTypes_t resultType ); /*! + * \brief Return the last ranging result power indicator + * + * The value returned is not an absolute power measurement. It is + * a relative power measurement. + * + * \retval deltaThreshold A relative power indicator + */ + uint8_t GetRangingPowerDeltaThresholdIndicator( void ); + + + + /*! * \brief Sets the standard processing delay between Master and Slave * * \param [in] cal RxTx delay offset for correcting ranging bias.