RadioLibSmol/src/modules/SX126x/STM32WLx_Module.h
Matthijs Kooijman 5e47d94418 [STM32WLx] Add module for STM32WL MCUs with integrated radio (#588)
This is a nearly complete implementation, except that the Dio1 interrupt
is not yet supported (this will be added in a subsequent commit to
simplify review).

This fixes #588.
2023-01-10 18:09:55 +01:00

49 lines
1.4 KiB
C++

/*
Copyright (c) 2022 STMicroelectronics
This file is licensed under the MIT License: https://opensource.org/licenses/MIT
*/
#if !defined(_RADIOLIB_STM32WLX_MODULE_H)
#define _RADIOLIB_STM32WLX_MODULE_H
#include "../../TypeDef.h"
#if !defined(RADIOLIB_EXCLUDE_STM32WLX)
#include "../../Module.h"
/*!
* \class STM32WLx_Module
*
* This is a subclass of Module to be used with the STM32WLx driver.
*
* It is used to override some callbacks, allowing access to some of the
* radio control signals that are wired to internal registers instead of
* actual GPIO pins.
*/
class STM32WLx_Module : public Module {
// Note: We cannot easily override any methods here, since most calls
// are non-virtual and made through a Module*, so they would not be
// calling any overridden methods. This means this class works by
// overriding some of the callbacks in its constructor.
public:
STM32WLx_Module();
#if !defined(RADIOLIB_GODMODE)
private:
#endif
// Replacement callbacks to handle virtual pins. These are static,
// since they replace global functions that cannot take any this
// pointer for context.
static void virtualPinMode(uint32_t dwPin, uint32_t dwMode);
static void virtualDigitalWrite(uint32_t dwPin, uint32_t dwVal);
static int virtualDigitalRead(uint32_t ulPin);
};
#endif // !defined(RADIOLIB_EXCLUDE_STM32WLX)
#endif // _RADIOLIB_STM32WLX_MODULE_H