mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
Merge branch 'bugfix/add_rf_test_lib' into 'master'
esp_phy: Update esp32c3/s3 phy lib and add test lib Closes WIFI-5097 See merge request espressif/esp-idf!22058
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