RadioLib
Universal wireless communication library for Arduino
STM32WLx.h
1 /*
2 
3 Copyright (c) 2018 Jan Gromeš
4 Copyright (c) 2022 STMicroelectronics
5 
6 This file is licensed under the MIT License: https://opensource.org/licenses/MIT
7 */
8 
9 #if !defined(_RADIOLIB_STM32WLx_H)
10 #define _RADIOLIB_STM32WLx_H
11 
12 #include "../../TypeDef.h"
13 
14 #if !defined(RADIOLIB_EXCLUDE_STM32WLX)
15 
16 #include "../../Module.h"
17 #include "SX1262.h"
18 #include "STM32WLx_Module.h"
19 
34 class STM32WLx : public SX1262 {
35  // NOTE: This class could not be named STM32WL (or STM32WLxx), since
36  // those are macros defined by
37  // system/Drivers/CMSIS/Device/ST/STM32WLxxx/Include/stm32wlxx.h
38  public:
45 
53  enum OpMode_t {
64  };
65 
66  // basic methods
67 
71  int16_t begin(float freq = 434.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = RADIOLIB_SX126X_SYNC_WORD_PRIVATE, int8_t power = 10, uint16_t preambleLength = 8, float tcxoVoltage = 1.6, bool useRegulatorLDO = false);
72 
76  int16_t beginFSK(float freq = 434.0, float br = 4.8, float freqDev = 5.0, float rxBw = 156.2, int8_t power = 10, uint16_t preambleLength = 16, float tcxoVoltage = 1.6, bool useRegulatorLDO = false);
77 
78  // configuration methods
79 
93  virtual int16_t setOutputPower(int8_t power) override;
94 
110  // Note: This explicitly inherits this method only to override docs
112 
118  void setDio1Action(void (*func)(void));
119 
123  void clearDio1Action();
124 
125 #if !defined(RADIOLIB_GODMODE)
126  protected:
127 #endif
128  virtual int16_t clearIrqStatus(uint16_t clearIrqParams) override;
129 
130 #if !defined(RADIOLIB_GODMODE)
131  private:
132 #endif
133 };
134 
135 #endif // !defined(RADIOLIB_EXCLUDE_SX126X)
136 
137 #endif // _RADIOLIB_STM32WLX_MODULE_H
@ MODE_TX
Definition: Module.h:68
@ MODE_IDLE
Definition: Module.h:64
@ MODE_RX
Definition: Module.h:66
@ MODE_END_OF_TABLE
Definition: Module.h:62
Definition: STM32WLx_Module.h:26
Derived class for STM32WL modules.
Definition: STM32WLx.h:34
int16_t begin(float freq=434.0, float bw=125.0, uint8_t sf=9, uint8_t cr=7, uint8_t syncWord=RADIOLIB_SX126X_SYNC_WORD_PRIVATE, int8_t power=10, uint16_t preambleLength=8, float tcxoVoltage=1.6, bool useRegulatorLDO=false)
Initialization method for LoRa modem.
Definition: STM32WLx.cpp:15
void clearDio1Action()
Clears interrupt service routine to call when DIO1/2/3 activates.
Definition: STM32WLx.cpp:100
void setDio1Action(void(*func)(void))
Sets interrupt service routine to call when DIO1/2/3 activates.
Definition: STM32WLx.cpp:90
virtual int16_t setOutputPower(int8_t power) override
Sets output power. Allowed values are in range from -17 to 22 dBm.
Definition: STM32WLx.cpp:43
STM32WLx(STM32WLx_Module *mod)
Default constructor.
Definition: STM32WLx.cpp:12
OpMode_t
Custom operation modes for STMWLx.
Definition: STM32WLx.h:53
@ MODE_END_OF_TABLE
Definition: STM32WLx.h:55
@ MODE_TX_LP
Definition: STM32WLx.h:61
@ MODE_TX_HP
Definition: STM32WLx.h:63
@ MODE_RX
Definition: STM32WLx.h:59
@ MODE_IDLE
Definition: STM32WLx.h:57
int16_t beginFSK(float freq=434.0, float br=4.8, float freqDev=5.0, float rxBw=156.2, int8_t power=10, uint16_t preambleLength=16, float tcxoVoltage=1.6, bool useRegulatorLDO=false)
Initialization method for FSK modem.
Definition: STM32WLx.cpp:29
Derived class for SX1262 modules.
Definition: SX1262.h:23
void setRfSwitchTable(const RADIOLIB_PIN_TYPE(&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[])
Some modules contain external RF switch controlled by pins. This function gives RadioLib control over...
Definition: SX126x.cpp:1364