first
This commit is contained in:
2232
Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio.c
vendored
Normal file
2232
Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1225
Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio_driver.c
vendored
Normal file
1225
Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio_driver.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1275
Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio_driver.h
vendored
Normal file
1275
Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio_driver.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1102
Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio_fw.c
vendored
Normal file
1102
Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio_fw.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
150
Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio_fw.h
vendored
Normal file
150
Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio_fw.h
vendored
Normal file
@ -0,0 +1,150 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file radio_fw.h
|
||||
* @author MCD Application Team
|
||||
* @brief Extends radio capabilities (whitening, long packet)
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2020(-2021) STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __RADIO_FW_H__
|
||||
#define __RADIO_FW_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/*reserved for SubGHz_Phy internal MW communication*/
|
||||
typedef enum
|
||||
{
|
||||
CONFIG_RX = 0,
|
||||
CONFIG_TX,
|
||||
}ConfigGenericRTx_t;
|
||||
|
||||
typedef struct{
|
||||
TxConfigGeneric_t* TxConfig;
|
||||
RxConfigGeneric_t* RxConfig;
|
||||
ConfigGenericRTx_t rtx;
|
||||
} ConfigGeneric_t;
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* External variables --------------------------------------------------------*/
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
|
||||
/*!
|
||||
* @brief Initialise the RFW module and enables custom whithing, optionally long packet feature
|
||||
*
|
||||
* @param [in] config rx or tx config from the application
|
||||
* @param [in] RadioEvents from the radio
|
||||
* @param [in] TimeoutTimerEvent Timer for Rx or Tx timeout event
|
||||
* @return 0 when no parameters error, -1 otherwise
|
||||
*/
|
||||
int32_t RFW_Init( ConfigGeneric_t* config, RadioEvents_t* RadioEvents, TimerEvent_t* TimeoutTimerEvent);
|
||||
|
||||
/*!
|
||||
* @brief Return whether the RFW module is enabled
|
||||
*
|
||||
* @return 0 when not initialised, -1 otherwise
|
||||
*/
|
||||
uint8_t RFW_Is_Init( void);
|
||||
|
||||
/*!
|
||||
* @brief Return whether the RFW module long packet is enabled
|
||||
*
|
||||
* @return 0 when not initialised, -1 otherwise
|
||||
*/
|
||||
uint8_t RFW_Is_LongPacketModeEnabled( void);
|
||||
|
||||
/*!
|
||||
* @brief Return whether the RFW module long packet is enabled
|
||||
*
|
||||
* @param [in] Modem set in the radio
|
||||
*/
|
||||
void RFW_SetRadioModem(RadioModems_t Modem);
|
||||
|
||||
/*!
|
||||
* @brief DeInitialise the RFW module and enable custom whithing and optionally long packet feature
|
||||
*
|
||||
*/
|
||||
void RFW_DeInit( void);
|
||||
|
||||
/*!
|
||||
* @brief DeInitialise the TxLongPacket
|
||||
*
|
||||
*/
|
||||
void RFW_DeInit_TxLongPacket(void);
|
||||
|
||||
/*!
|
||||
* @brief Set antenna switch output to be used in Tx
|
||||
*
|
||||
* @param [in] AntSwitch RFO_LP or FRO_HP
|
||||
*
|
||||
*/
|
||||
void RFW_SetAntSwitch( uint8_t AntSwitch);
|
||||
|
||||
/*!
|
||||
* @brief Initialise reception for IBM whitening case
|
||||
*
|
||||
* @return 0 when RFW_ENABLE exists, -1 otherwise
|
||||
*/
|
||||
int32_t RFW_ReceiveInit( void );
|
||||
|
||||
/*!
|
||||
* @brief Initialise transmission for IBM whitening case
|
||||
*
|
||||
* @param [in,out] inOutBuffer pointer of exchange buffer to send or receive data
|
||||
* @param [in] size input buffer size
|
||||
* @param [out] outSize output buffer size
|
||||
*
|
||||
*/
|
||||
int32_t RFW_TransmitInit(uint8_t* inOutBuffer, uint8_t size, uint8_t* outSize);
|
||||
|
||||
/*!
|
||||
* @brief Starts receiving payload. Called at Rx Sync IRQ
|
||||
*
|
||||
*/
|
||||
void RFW_ReceivePayload(void );
|
||||
|
||||
/*!
|
||||
* @brief Starts transmitting long Packet, note packet length may be on 1 bytes depending on config
|
||||
*
|
||||
* @param [in] payload_size total payload size to be sent
|
||||
* @param [in] timeout Reception timeout [ms]
|
||||
* @param [in] TxLongPacketGetNextChunkCb callback to be implemented on user side to feed partial chunk
|
||||
* buffer: source buffer allocated by the app
|
||||
* size: size in bytes to feed. User to implement the offset based on previous chunk request
|
||||
* @return 0 when no parameters error, -1 otherwise
|
||||
*/
|
||||
int32_t RFW_TransmitLongPacket( uint16_t payload_size, uint32_t timeout, void (*TxLongPacketGetNextChunkCb) (uint8_t** buffer, uint8_t buffer_size) );
|
||||
|
||||
/*!
|
||||
* @brief Starts receiving long Packet, packet maybe short
|
||||
*
|
||||
* @param [in] boosted_mode boosted_mode: 0 normal Rx, 1:improved sensitivity
|
||||
* @param [in] timeout Reception timeout [ms]
|
||||
* @param [in] RxLongStorePacketChunkCb callback to be implemented on user side to record partial chunk in the application
|
||||
* buffer: source buffer allocated in the radio driver
|
||||
* size: size in bytes to record
|
||||
* @return 0 when no parameters error, -1 otherwise
|
||||
*/
|
||||
int32_t RFW_ReceiveLongPacket( uint8_t boosted_mode, uint32_t timeout, void (*RxLongStorePacketChunkCb) (uint8_t* buffer, uint8_t chunk_size) );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*__RADIO_FW_H__*/
|
||||
53
Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/subghz_phy_version.h
vendored
Normal file
53
Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/subghz_phy_version.h
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
/******************************************************************************
|
||||
* @file subghz_phy_version.h
|
||||
* @author MCD Application Team
|
||||
* @brief defines the radio driver version
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2020(-2021) STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
|
||||
#ifndef __SUBGHZ_PHY_VERSION_H__
|
||||
#define __SUBGHZ_PHY_VERSION_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* __SUBGHZ_PHY_TYPE: 0x01 STM32WL
|
||||
0x61 SX126X
|
||||
0x72 SX1272
|
||||
0x76 SX1276 */
|
||||
|
||||
#define SUBGHZ_PHY_VERSION_MAIN (0x01U) /*!< [31:24] main version */
|
||||
#define SUBGHZ_PHY_VERSION_SUB1 (0x02U) /*!< [23:16] sub1 version */
|
||||
#define SUBGHZ_PHY_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */
|
||||
#define SUBGHZ_PHY_TYPE (0x01U) /*!< [7:0] type version */
|
||||
#define SUBGHZ_PHY_VERSION ((SUBGHZ_PHY_VERSION_MAIN << 24) \
|
||||
|(SUBGHZ_PHY_VERSION_SUB1 << 16) \
|
||||
|(SUBGHZ_PHY_VERSION_SUB2 << 8) \
|
||||
|(SUBGHZ_PHY_TYPE))
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* External variables --------------------------------------------------------*/
|
||||
/* Exported macros -----------------------------------------------------------*/
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*__SUBGHZ_PHY_VERSION_H__*/
|
||||
Reference in New Issue
Block a user