马达和触摸ic提交
authorp15692025051 <846603105@qq.com>
Sat, 11 Oct 2025 08:58:31 +0000 (16:58 +0800)
committerp15692025051 <846603105@qq.com>
Sat, 11 Oct 2025 08:58:31 +0000 (16:58 +0800)
2.code/aicos/app/AI_AMP_2_5/AI_AMP_2_5.h
2.code/aicos/app/AI_AMP_2_5/bk_key.c
2.code/aicos/app/AI_AMP_2_5/mot_dev.c
2.code/aicos/drivers/include/kpc.h
2.code/aicos/projects/banyan/ap/gx306l_h3_d_sms_aichat/config/kpc_cfg.c

index 08b8871..efb83fa 100644 (file)
@@ -1,7 +1,7 @@
 #include "aic_osa.h"
 
 #define SUPPORT_OPUS 1
-#define SUPPORT_MOT 0 //马达驱动
+#define SUPPORT_MOT 1 //马达驱动
 #define BK_SOCKET_IOT 0
 
 #define  BK_LOG_NONE 0//不打印
index cf5ca49..65f307c 100644 (file)
@@ -10,8 +10,9 @@
 #include "alog_api.h"  
 #include "pwr_key.h"
 #include "sysoff.h"
-
-
+#include "gpo_inc.h"
+#include <gpio_inc.h>
+#define TP_POWER_EN GPO_0
 #define LOG_MODULE    AMOD_KPC
 
 
@@ -127,7 +128,7 @@ void bk_to_ups_sync(void *ptr)
 void bk_key_init(void)
 {
     // bk_printf("开始初始化按键模块\n"); 不注释掉就卡住没日志
-    
+    aic_gpo_output(TP_POWER_EN,GPO_OUTPUT_HIGH );//tp电源
     int32_t handle = aic_srv_kpc_register("app", bk_kpc_callback);
     if (handle < 0) {
         alog_error("Failed to register KPC callback\n");  // 使用 alog_error 输出错误信息
index dce46d9..db1009a 100644 (file)
@@ -210,9 +210,9 @@ static void mot_dev_task(void *thread_input)//马达线程
 void mot_init(void)
 {
     bk_printf("mot_init:!!!!");
-    aic_gpo_output(MOT_EN_FWD_IO,GPIO_OUTPUT_LVL_LOW );//马达
+    aic_gpo_output(MOT_EN_FWD_IO,GPO_OUTPUT_LOW );//马达
     aic_gpio_output(MOT_EN_REV_IO,GPIO_OUTPUT_LVL_LOW );//马达
-    // aic_gpo_output( GPO_2,GPIO_OUTPUT_LVL_LOW );//马达
+    // aic_gpo_output( GPO_2,GPO_OUTPUT_LOW );//马达
     // aic_gpio_output(GPIO_14,GPIO_OUTPUT_LVL_LOW );//马达
     bk_printf("mot_init:22!!!!");
     // aic_gpio_input(MOT_TOP_SITE_IO, GPIO_TRIGGER_EDGE_FALLING,
@@ -242,13 +242,13 @@ void mot_init(void)
 void head_drop(void)//低头
 {
     bk_printf("head_drop");
-    aic_gpo_output(MOT_EN_FWD_IO,GPIO_OUTPUT_LVL_HIGH );//马达
+    aic_gpo_output(MOT_EN_FWD_IO,GPO_OUTPUT_HIGH );//马达
     aic_gpio_output(MOT_EN_REV_IO,GPIO_OUTPUT_LVL_LOW );//马达
 }
 void head_up(void)//抬头
 {
     bk_printf("head_up");
-    aic_gpo_output(MOT_EN_FWD_IO,GPIO_OUTPUT_LVL_LOW );//马达
+    aic_gpo_output(MOT_EN_FWD_IO,GPO_OUTPUT_LOW );//马达
     aic_gpio_output(MOT_EN_REV_IO,GPIO_OUTPUT_LVL_HIGH );//马达
 }
 void MTO_stop(void)
@@ -256,7 +256,7 @@ void MTO_stop(void)
     bk_printf("MTO_stop");
     mot_nod_count=0;
     mot_MIDDLE_flag = 0;
-    aic_gpo_output(MOT_EN_FWD_IO,GPIO_OUTPUT_LVL_LOW );//马达
+    aic_gpo_output(MOT_EN_FWD_IO,GPO_OUTPUT_LOW );//马达
     aic_gpio_output(MOT_EN_REV_IO,GPIO_OUTPUT_LVL_LOW );//马达
 }
 //马达归位
@@ -277,7 +277,7 @@ void MTO_restert(void)
     }else//已经到中间了
     {
         bk_printf("MTO_restert:已经到中间");
-        aic_gpo_output(MOT_EN_FWD_IO,GPIO_OUTPUT_LVL_LOW );//马达
+        aic_gpo_output(MOT_EN_FWD_IO,GPO_OUTPUT_LOW );//马达
         aic_gpio_output(MOT_EN_REV_IO,GPIO_OUTPUT_LVL_LOW );//马达
         return;
     }
@@ -292,7 +292,7 @@ void MTO_restert(void)
         aos_sleep(1);
     }
     aos_sleep(50);
-    aic_gpo_output(MOT_EN_FWD_IO,GPIO_OUTPUT_LVL_LOW );//马达
+    aic_gpo_output(MOT_EN_FWD_IO,GPO_OUTPUT_LOW );//马达
     aic_gpio_output(MOT_EN_REV_IO,GPIO_OUTPUT_LVL_LOW );//马达
 }
 static void mot_nod3(void)//点头处理
@@ -415,7 +415,7 @@ void mot_test(void)
     // {
     //     mot_test_flag =1;
     //     aic_gpio_output(MOT_EN_FWD_IO,GPIO_OUTPUT_LVL_HIGH );//马达
-    //     aic_gpo_output(MOT_EN_REV_IO,GPIO_OUTPUT_LVL_LOW );//马达
+    //     aic_gpo_output(MOT_EN_REV_IO,GPO_OUTPUT_LOW );//马达
     //         bk_printf("AI_KEY2_PRESS 0");
     // }else
     // {
index 9518c6a..613f43e 100644 (file)
@@ -18,7 +18,7 @@
 #define KPC_KEY_EVENT_LONGKEY           (4)
 #define KPC_KEY_EVENT_LONGKEY_RELEASE   (8)
 
-#define KPC_KEY_PRESSED_MAX_KEY_NUM     (5) /* include power key*/
+#define KPC_KEY_PRESSED_MAX_KEY_NUM     (8) /* include power key*/
 typedef struct kpc_key {
     u16 key_value;
     u16 key_event;
index bca6926..9bc9d44 100644 (file)
@@ -66,9 +66,9 @@ gpio_key_config_t g_gpio_key_config[] = {
     {KEY_2, KEY_2_GPIO_INDEX, KEY_TYPE_GPIO},
     {KEY_3, KEY_3_GPIO_INDEX, KEY_TYPE_EIPU},
 
-    // {KEY_4, KEY_4_GPIO_INDEX, KEY_TYPE_GPIO},
-    // {KEY_5, KEY_5_GPIO_INDEX, KEY_TYPE_EIPU},
-    // {KEY_6, KEY_6_GPIO_INDEX, KEY_TYPE_EIPU},
+    {KEY_4, KEY_4_GPIO_INDEX, KEY_TYPE_GPIO},
+    {KEY_5, KEY_5_GPIO_INDEX, KEY_TYPE_EIPU},
+    {KEY_6, KEY_6_GPIO_INDEX, KEY_TYPE_EIPU},
 
     /* add key upside */
     {0, 0, KEY_TYPE_MAX}