From 1a5767266a8680c8dd2060f2b51e3f204dea951c Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Thu, 31 Jul 2025 17:57:11 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91=E9=97=AE?= =?utf8?q?=E9=A2=98(=E8=A1=A5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../zhihui/4g/cat1Service/Service/cat1_ctl.c | 20 +++++++++++++++++++ .../zhihui/4g/cat1Service/include/cat1_ctl.h | 3 ++- ...ywee_ble_Service.h => cywee_ble_service.h} | 0 3 files changed, 22 insertions(+), 1 deletion(-) rename code/sdk/zhihui/drivers/cywee/ble_service/{cywee_ble_Service.h => cywee_ble_service.h} (100%) diff --git a/code/sdk/zhihui/4g/cat1Service/Service/cat1_ctl.c b/code/sdk/zhihui/4g/cat1Service/Service/cat1_ctl.c index e0372348f..8117977e1 100644 --- a/code/sdk/zhihui/4g/cat1Service/Service/cat1_ctl.c +++ b/code/sdk/zhihui/4g/cat1Service/Service/cat1_ctl.c @@ -246,6 +246,26 @@ uint32_t uapi_cat1_power_on(uint32_t pwron) return 0; } +uint32_t uapi_cat1_bat_on(uint32_t pwron) +{ +#if defined(BOARD_W9) || defined(BOARD_N9) + pin_t bat_en_pin = S_AGPIO_L17; + + if( pwron == 0) + { + uapi_gpio_set_dir(bat_en_pin, GPIO_DIRECTION_OUTPUT); + uapi_gpio_set_val(bat_en_pin, GPIO_LEVEL_LOW); + printf("BAT OFF Cat1! %d low \r\n",bat_en_pin); + }else{ + uapi_gpio_set_dir(bat_en_pin, GPIO_DIRECTION_OUTPUT); + uapi_gpio_set_val(bat_en_pin, GPIO_LEVEL_HIGH); + printf("BAT ON Cat1! %d high \r\n",bat_en_pin); + } +#endif + + return 0; +} + void power_on_cat1(void) { #if defined(BOARD_FD230) diff --git a/code/sdk/zhihui/4g/cat1Service/include/cat1_ctl.h b/code/sdk/zhihui/4g/cat1Service/include/cat1_ctl.h index 67af1a2b9..e33eb4517 100644 --- a/code/sdk/zhihui/4g/cat1Service/include/cat1_ctl.h +++ b/code/sdk/zhihui/4g/cat1Service/include/cat1_ctl.h @@ -2,7 +2,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2025-05-15 11:28:07 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2025-07-31 17:29:02 + * @LastEditTime: 2025-07-31 17:46:49 * @FilePath: /FD230/code/sdk/zhihui/4g/cat1Service/include/cat1_ctl.h * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -36,6 +36,7 @@ void power_off_cat1(void); uint32_t uapi_cat1_reset(uint32_t pwron); uint32_t uapi_cat1_power_on(uint32_t pwron); +uint32_t uapi_cat1_bat_on(uint32_t pwron); void cat1_api_wakeup_cat1(uint8_t wakeup); void cat1_api_keep_wakeup(uint8_t keep_wakeup); diff --git a/code/sdk/zhihui/drivers/cywee/ble_service/cywee_ble_Service.h b/code/sdk/zhihui/drivers/cywee/ble_service/cywee_ble_service.h similarity index 100% rename from code/sdk/zhihui/drivers/cywee/ble_service/cywee_ble_Service.h rename to code/sdk/zhihui/drivers/cywee/ble_service/cywee_ble_service.h -- 2.17.1