mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-19 15:59:08 +00:00
esp_phy: Add RF certification APIs
This commit is contained in:
44
components/esp_phy/src/phy_callback.c
Normal file
44
components/esp_phy/src/phy_callback.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef enum {
|
||||
OK = 0,
|
||||
FAIL,
|
||||
PENDING,
|
||||
BUSY,
|
||||
CANCEL,
|
||||
} STATUS;
|
||||
|
||||
extern int phy_printf(const char* format, ...);
|
||||
|
||||
static uint8_t g_rf_cmdstop = 3;
|
||||
|
||||
void esp_phy_test_start_stop(uint8_t value)
|
||||
{
|
||||
g_rf_cmdstop = value;
|
||||
}
|
||||
|
||||
int esp_phy_cmdstop_callback(void)
|
||||
{
|
||||
return g_rf_cmdstop;
|
||||
}
|
||||
|
||||
STATUS esp_phy_getstopcmd(void)
|
||||
{
|
||||
uint8_t value = esp_phy_cmdstop_callback();
|
||||
if (value == 0) {
|
||||
return OK;
|
||||
} else if (value == 1) {
|
||||
return BUSY;
|
||||
} else if (value == 2) {
|
||||
phy_printf("Please run cmdstop to exit current cmd!\n");
|
||||
return FAIL;
|
||||
} else {
|
||||
return FAIL;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user