Nol.A SDK Library  24.11.0
For IoT System Software Development
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | List of all members
SX126xChip Class Referenceabstract
Inheritance diagram for SX126xChip:
LoRaRadioChip PacketRadioChip

Classes

union  CalibrationParams_t
 Represents a calibration configuration. More...
 

Public Types

enum  DeviceId_t { SX1261 = 1 , SX1262 = 2 }
 
- Public Types inherited from LoRaRadioChip
enum  State_t { RF_IDLE = 0 , RF_RX_RUNNING = 1 , RF_TX_RUNNING = 2 , RF_CAD = 3 }
 

Public Member Functions

 SX126xChip (SPI &s, int8_t pinReset, int8_t pinCs, int8_t pinBusy, int8_t pinDio1)
 
virtual DeviceId_t SX126xGetDeviceId ()
 
virtual void SX126xAntSwOn ()=0
 
virtual void SX126xAntSwOff ()=0
 
error_t begin () override
 
error_t readFrame (RadioPacket *) override
 수신 버퍼에서 프레임을 읽습니다. More...
 
bool bufferIsEmpty () override
 
void flushBuffer () override
 
virtual void sleep () override
 
virtual void wakeup () override
 
error_t transmit (RadioPacket *frame) override
 
void setChannel (uint32_t) override
 채널을 설정합니다.
 
uint32_t getChannel () override
 현재 설정된 채널을 반환합니다.
 
State_t getStatus () override
 
int16_t getRssi () override
 RSSI를 dB 단위로 읽습니다.
 
void doCAD (void(*func)(LoRaRadioChip &, bool)) override
 CAD (Carrier Activity Detection) 검사를 수행합니다. (LoRa 전용) More...
 
void setStandby () override
 
void setPublicNetwork (bool) override
 Syncword를 설정합니다. More...
 
void transmitCW () override
 Continuous Wave (CW) 신호를 송출합니다. (LoRa 전용)
 
- Public Member Functions inherited from LoRaRadioChip
virtual void setRadio (Radio::LoRaSF_t sf, Radio::LoRaBW_t bw, Radio::LoRaCR_t cr, bool crcOn=true, bool iqInverted=false, uint16_t symbTimeout=0, uint16_t preambleLen=8, uint8_t payloadLen=0, bool freqHopOn=false, uint8_t hopPeriod=0)
 
virtual void setRadio (uint32_t datarate, uint32_t bandwidth, uint32_t bandwidthAfc, uint32_t fDev, bool crcOn=true, uint16_t symbTimeout=0, uint16_t preambleLen=5, uint8_t payloadLen=0)
 
uint32_t getTimeOnAir (uint8_t payloadLen)
 
virtual void setTxPower (int8_t dBm) override
 송신 출력을 설정합니다. More...
 
virtual int8_t getTxPower () override
 현재 설정된 송신 출력을 반환합니다. More...
 
virtual bool cca () override
 채널이 혼잡한지 아닌지 검사합니다. More...
 
void setFreqOffset (int32_t offsetHz)
 중심 주파수 오차를 제거하기 위한 offset을 설정합니다. More...
 
int32_t getFreqOffset ()
 중심 주파수 오차를 제거하기 위한 offset을 가져옵니다.
 
- Public Member Functions inherited from PacketRadioChip
void setCcaThreshold (int16_t dBthreshold)
 
virtual int64_t getDeviceTimestamp ()
 장치 내부의 timestamp 값을 읽습니다. More...
 

Protected Types

enum  { SPI_CLOCK_HZ = 16000000 }
 
enum  RadioTcxoCtrlVoltage_t {
  TCXO_CTRL_1_6V = 0x00 , TCXO_CTRL_1_7V = 0x01 , TCXO_CTRL_1_8V = 0x02 , TCXO_CTRL_2_2V = 0x03 ,
  TCXO_CTRL_2_4V = 0x04 , TCXO_CTRL_2_7V = 0x05 , TCXO_CTRL_3_0V = 0x06 , TCXO_CTRL_3_3V = 0x07
}
 Represents the voltage used to control the TCXO on/off from DIO3.
 

Protected Member Functions

virtual void beginTransaction ()
 
virtual void endTransaction ()
 
void SX126xWakeupCore ()
 
virtual void SX126xWakeup ()
 
void SX126xSetDio2AsRfSwitchCtrl (uint8_t enable)
 Indicates if DIO2 is used to control an RF Switch. More...
 
virtual void SX126xIoRfSwitchInit ()
 
void SX126xSetDio3AsTcxoCtrl (RadioTcxoCtrlVoltage_t tcxoVoltage, uint32_t timeout)
 Indicates if the Radio main clock is supplied from a tcxo. More...
 
virtual void SX126xIoTcxoInit ()
 
virtual uint32_t SX126xGetBoardTcxoWakeupTime ()
 
- Protected Member Functions inherited from LoRaRadioChip
virtual void ccaTask ()
 

Additional Inherited Members

- Static Public Member Functions inherited from LoRaRadioChip
static uint32_t TimeOnAir (Radio::LoRaSF_t, Radio::LoRaBW_t, Radio::LoRaCR_t, uint16_t preambleLen, bool fixLen, uint8_t payloadLen, bool crcOn)
 
static uint32_t TimeOnAir (uint32_t datarate, uint32_t bandwidth, uint16_t preambleLen, bool fixLen, uint8_t payloadLen, bool crcOn)
 
- Public Attributes inherited from LoRaRadioChip
int8_t antennaGain = 0
 Antenna gain을 고려한 송신 출력(EIRP)을 사용하기 위한 antenna gain (단위: dBi)
 
void(* onRxTimeout )(void *, GPIOInterruptInfo_t *) = nullptr
 
void * ctxOnRxTimeout
 
- Public Attributes inherited from PacketRadioChip
void(* onRxStarted )(void *, GPIOInterruptInfo_t *)
 수신이 시작될 때 호출될 콜백함수 포인터 More...
 
void * ctxOnRxStarted
 onRxStarted 가 호출될 때 함께 전달될 context
 
void(* onRxDone )(void *, GPIOInterruptInfo_t *)
 수신이 완료될 때 호출될 콜백함수 포인터 More...
 
void * ctxOnRxDone
 onRxDone 이 호출될 때 함께 전달될 context
 
void(* onTxDone )(void *, bool, GPIOInterruptInfo_t *)
 transmit() 후, 송신이 완료될 때 호출될 콜백함수 포인터 More...
 
void * ctxOnTxDone
 onTxDone 이 호출될 때 함께 전달될 context
 
void(* onChannelBusy )(void *, GPIOInterruptInfo_t *)
 cca() 시 채널이 혼잡할 때 호출될 콜백함수 포인터 More...
 
void * ctxOnChannelBusy
 onChannelBusy 가 호출될 때 함께 전달될 context
 
int16_t dBccaThreshold = -65
 cca() 시 채널이 혼잡하다고 판단하기 위한 에너지 레벨을 설정합니다. (단위: dB, 기본값: -65)
 
- Static Protected Member Functions inherited from LoRaRadioChip
static void CCATask (void *)
 
- Protected Attributes inherited from LoRaRadioChip
struct {
   uint32_t   channel
 
   Radio::Modulation_t   modulation
 
   int8_t   txPower
 
   uint32_t   txTimeout
 
   union {
      struct {
         uint32_t   drHz
 
         uint32_t   bwHz
 
         uint32_t   afcBwHz
 
         uint32_t   fDevHz
 
         uint16_t   symbTimeout
 
         bool   addCrc
 
         uint16_t   preambleLength
 
         uint8_t   fixedPayloadLength
 
      }   FSK
 
      struct {
         Radio::LoRaSF_t   sf
 
         Radio::LoRaCR_t   cr
 
         Radio::LoRaBW_t   bw
 
         uint16_t   preambleLength
 
         uint8_t   fixedPayloadLength
 
         bool   iqInverted
 
         bool   addCrc
 
         uint16_t   symbTimeout
 
      }   LoRa
 
   } 
 
defaultSetting
 
void(* cadCompletedHandler )(LoRaRadioChip &, bool) = nullptr
 
volatile bool inCca = false
 
bool inChannelBusyHandler = false
 
int32_t freqOffset
 

Member Function Documentation

◆ doCAD()

void SX126xChip::doCAD ( void(*)(LoRaRadioChip &, bool)  func)
overridevirtual

CAD (Carrier Activity Detection) 검사를 수행합니다. (LoRa 전용)

Parameters
funcCAD 검사가 완료될 때 호출될 콜백함수 포인터

Implements LoRaRadioChip.

◆ readFrame()

error_t SX126xChip::readFrame ( RadioPacket frame)
overridevirtual

수신 버퍼에서 프레임을 읽습니다.

Returns
  • ERROR_SUCCESS : 성공
  • ERROR_FAIL : 실패 (수신한 프레임이 없음)
  • ERROR_INVALID_ARGS : frame 이 NULL 이거나, frame 내부 버퍼가 충분히 크지 않아서 실패

Implements PacketRadioChip.

◆ setPublicNetwork()

void SX126xChip::setPublicNetwork ( bool  enable)
overridevirtual

Syncword를 설정합니다.

Parameters
valueenable (true: LoRaWAN, false: non-LoRaWAN)

Implements LoRaRadioChip.

◆ SX126xSetDio2AsRfSwitchCtrl()

void SX126xChip::SX126xSetDio2AsRfSwitchCtrl ( uint8_t  enable)
protected

Indicates if DIO2 is used to control an RF Switch.

Parameters
[in]enabletrue of false

◆ SX126xSetDio3AsTcxoCtrl()

void SX126xChip::SX126xSetDio3AsTcxoCtrl ( RadioTcxoCtrlVoltage_t  tcxoVoltage,
uint32_t  timeout 
)
protected

Indicates if the Radio main clock is supplied from a tcxo.

Parameters
[in]tcxoVoltagevoltage used to control the TCXO
[in]timeouttime given to the TCXO to go to 32MHz

The documentation for this class was generated from the following file: