CogletESP-CogletESP/main/uart_component.h
Rdzleo c63b35a0e7
Some checks failed
Build Boards / Determine variants to build (push) Successful in 6m26s
Build Boards / Build ${{ matrix.name }} (push) Failing after 6m43s
1、第一次提交项目,项目初始化;
2、修改了RP2040的代码,使其在没有安装摄像头的情况下也可以左右转动眼球和左右转动身体;
3、增加了一些中文注释的说明;
2026-04-09 14:22:24 +08:00

21 lines
699 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "driver/uart.h"
// ESP32 → RP2040 的 UART 通信引脚定义
// ESP32 的 GPIO17(TX) 连接 RP2040 的 GP5(RX)
// ESP32 的 GPIO18(RX) 连接 RP2040 的 GP4(TX)
#define TXD_PIN 17
#define RXD_PIN 18
#define UART_PORT_NUM UART_NUM_1 // 使用 UART1UART0 用于调试日志)
#define BUF_SIZE 1024
// 初始化 UART 组件115200 波特率8N1
void uart_init_component();
// 发送状态字符串给 RP2040如 "speaking"、"listening"、"idle" 等)
// RP2040 收到后驱动 9 个舵机执行对应动画
void uart_send_string(const char* str);
// 发送说话开始信号
void uart_signal_start();
// 发送说话停止信号
void uart_signal_stop();