[SX126x] Added low-level access macro

pull/274/head
jgromes 2021-03-13 19:57:38 +01:00
rodzic 1a721b3daf
commit 4342be8386
4 zmienionych plików z 16 dodań i 12 usunięć

Wyświetl plik

@ -35,7 +35,7 @@ class SX1261 : public SX1262 {
*/
int16_t setOutputPower(int8_t power);
#ifndef RADIOLIB_GODMODE
#if !defined(RADIOLIB_GODMODE)
private:
#endif

Wyświetl plik

@ -95,7 +95,7 @@ class SX1262: public SX126x {
*/
int16_t setOutputPower(int8_t power);
#ifndef RADIOLIB_GODMODE
#if !defined(RADIOLIB_GODMODE)
private:
#endif

Wyświetl plik

@ -95,7 +95,7 @@ class SX1268: public SX126x {
*/
int16_t setOutputPower(int8_t power);
#ifndef RADIOLIB_GODMODE
#if !defined(RADIOLIB_GODMODE)
private:
#endif

Wyświetl plik

@ -928,11 +928,22 @@ class SX126x: public PhysicalLayer {
int16_t fixImplicitTimeout();
int16_t fixInvertedIQ(uint8_t iqConfig);
#ifndef RADIOLIB_GODMODE
private:
#if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL)
protected:
#endif
Module* _mod;
// common low-level SPI interface
int16_t SPIwriteCommand(uint8_t cmd, uint8_t* data, uint8_t numBytes, bool waitForBusy = true);
int16_t SPIwriteCommand(uint8_t* cmd, uint8_t cmdLen, uint8_t* data, uint8_t numBytes, bool waitForBusy = true);
int16_t SPIreadCommand(uint8_t cmd, uint8_t* data, uint8_t numBytes, bool waitForBusy = true);
int16_t SPIreadCommand(uint8_t* cmd, uint8_t cmdLen, uint8_t* data, uint8_t numBytes, bool waitForBusy = true);
int16_t SPItransfer(uint8_t* cmd, uint8_t cmdLen, bool write, uint8_t* dataOut, uint8_t* dataIn, uint8_t numBytes, bool waitForBusy, uint32_t timeout = 5000);
#if !defined(RADIOLIB_GODMODE)
protected:
#endif
uint8_t _bw = 0, _sf = 0, _cr = 0, _ldro = 0, _crcType = 0, _headerType = 0;
uint16_t _preambleLength = 0;
float _bwKhz = 0;
@ -950,13 +961,6 @@ class SX126x: public PhysicalLayer {
size_t _implicitLen = 0;
int16_t config(uint8_t modem);
// common low-level SPI interface
int16_t SPIwriteCommand(uint8_t cmd, uint8_t* data, uint8_t numBytes, bool waitForBusy = true);
int16_t SPIwriteCommand(uint8_t* cmd, uint8_t cmdLen, uint8_t* data, uint8_t numBytes, bool waitForBusy = true);
int16_t SPIreadCommand(uint8_t cmd, uint8_t* data, uint8_t numBytes, bool waitForBusy = true);
int16_t SPIreadCommand(uint8_t* cmd, uint8_t cmdLen, uint8_t* data, uint8_t numBytes, bool waitForBusy = true);
int16_t SPItransfer(uint8_t* cmd, uint8_t cmdLen, bool write, uint8_t* dataOut, uint8_t* dataIn, uint8_t numBytes, bool waitForBusy, uint32_t timeout = 5000);
};
#endif