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  };
67 
68  // basic methods
69 
73  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);
74 
78  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);
79 
80  // configuration methods
81 
95  virtual int16_t setOutputPower(int8_t power) override;
96 
112  // Note: This explicitly inherits this method only to override docs
114 
120  void setDio1Action(void (*func)(void));
121 
125  void clearDio1Action();
126 
127 #if !defined(RADIOLIB_GODMODE)
128  protected:
129 #endif
130  virtual int16_t clearIrqStatus(uint16_t clearIrqParams) override;
131 
132 #if !defined(RADIOLIB_GODMODE)
133  private:
134 #endif
135 };
136 
137 #endif // !defined(RADIOLIB_EXCLUDE_SX126X)
138 
139 #endif // _RADIOLIB_STM32WLX_MODULE_H
@ MODE_TX
Definition: Module.h:56
@ MODE_IDLE
Definition: Module.h:52
@ MODE_RX
Definition: Module.h:54
@ MODE_END_OF_TABLE
Definition: Module.h:50
Definition: STM32WLx_Module.h:26
Derived class for STM32WL modules.
Definition: STM32WLx.h:34
static const Module::RfSwitchMode_t END_OF_MODE_TABLE
Definition: STM32WLx.h:66
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:19
void clearDio1Action()
Clears interrupt service routine to call when DIO1/2/3 activates.
Definition: STM32WLx.cpp:104
void setDio1Action(void(*func)(void))
Sets interrupt service routine to call when DIO1/2/3 activates.
Definition: STM32WLx.cpp:94
virtual int16_t setOutputPower(int8_t power) override
Sets output power. Allowed values are in range from -17 to 22 dBm.
Definition: STM32WLx.cpp:47
STM32WLx(STM32WLx_Module *mod)
Default constructor.
Definition: STM32WLx.cpp:16
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:33
Derived class for SX1262 modules.
Definition: SX1262.h:22
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:1325
Definition: Module.h:34