CogletESP-camera-version/main/uart_component.h

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();