feat(802.15.4): introduce a series of APIs related power table

This commit is contained in:
zwx
2025-01-03 14:22:13 +08:00
parent 52f905b6c7
commit 5bf1cc9d44
7 changed files with 178 additions and 15 deletions
@@ -73,6 +73,52 @@ int8_t esp_ieee802154_get_txpower(void);
*/
esp_err_t esp_ieee802154_set_txpower(int8_t power);
/**
* @brief Set the transmission power table.
*
* @param[in] power_table The power table.
*
* @return
* - ESP_OK Set the transmission power table to successfully.
*/
esp_err_t esp_ieee802154_set_power_table(esp_ieee802154_txpower_table_t power_table);
/**
* @brief Get the transmission power table.
*
* @param[out] out_power_table The power table.
*
* @return
* - ESP_OK Get the transmission power table successfully.
* - ESP_ERR_INVALID_ARG Invalid arguments.
*
*/
esp_err_t esp_ieee802154_get_power_table(esp_ieee802154_txpower_table_t *out_power_table);
/**
* @brief Set the transmission power for a specific channel.
*
* @param[in] channel The channel.
* @param[in] power The power.
*
* @return
* - ESP_OK Set the transmission power for a specific channel successfully.
* - ESP_ERR_INVALID_ARG Invalid arguments.
*/
esp_err_t esp_ieee802154_set_power_with_channel(uint8_t channel, int8_t power);
/**
* @brief Get the transmission power for a specific channel.
*
* @param[in] channel The channel.
* @param[out] out_power The power.
*
* @return
* - ESP_OK Get the transmission power for a specific channel successfully.
* - ESP_ERR_INVALID_ARG Invalid arguments.
*/
esp_err_t esp_ieee802154_get_power_with_channel(uint8_t channel, int8_t *out_power);
/**
* @brief Get the promiscuous mode.
*
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -83,6 +83,14 @@ typedef struct {
uint64_t timestamp; /*!< The timestamp when the frame's SFD field was received */
} esp_ieee802154_frame_info_t;
/**
* @brief The O-QPSK PHY transmission power table for 2.4 GHz channels as defined by the IEEE 802.15.4 specification.
*
*/
typedef struct {
int8_t channel[16]; /*!< Index 0 -> Channel 11, Index 1 -> Channel 12 ... Index 15 -> Channel 26 */
} esp_ieee802154_txpower_table_t;
#ifdef __cplusplus
}
#endif