Files
mcu-codegen-template/App/Protocol/jb_product.h
T

71 lines
4.1 KiB
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.
/* ================================================================
* jb_product.h — 用户层头文件(自动生成)
* 设备: 侠客猫激光 | 生成时间: 2026-07-28 15:42:40
*
* 声明用户需实现的函数。数据结构定义见 jb_protocol.h
* ================================================================
*/
#ifndef _JB_PRODUCT_H
#define _JB_PRODUCT_H
#include "jb_protocol.h"
/* ════════════════════════════════════════════════════════════════
* 硬件配置(按实际 MCU 调整)
* ════════════════════════════════════════════════════════════════ */
#define UART_BAUDRATE 9600
#define TIMER_PERIOD_MS 1
/* ════════════════════════════════════════════════════════════════
* 版本管理
* ════════════════════════════════════════════════════════════════ */
/* MCU software version: Vmajor.minor.patch */
#define JB_MCU_SW_VERSION_MAJOR 1
#define JB_MCU_SW_VERSION_MINOR 0
#define JB_MCU_SW_VERSION_PATCH 0
/* MCU hardware version: Vmajor.minor.patch */
#define JB_MCU_HW_VERSION_MAJOR 1
#define JB_MCU_HW_VERSION_MINOR 0
#define JB_MCU_HW_VERSION_PATCH 0
/* ════════════════════════════════════════════════════════════════
* 用户 API
* ════════════════════════════════════════════════════════════════ */
/* 全局设备数据 — 协议层直接读写该变量 */
extern jb_data_point_t gDevData;
/* ==================== 用户必须实现 ============================== */
void userInit(void); /* DP 默认值与外设初始化 */
void userHandle(void); /* 用户数据采集 */
void uartInit(void); /* UART 9600 8N1 */
void timerInit(void); /* 1ms 定时器 */
void jbTimerIrq(void); /* Call from 1ms timer ISR */
void mcuRestart(void); /* 软件复位 */
/* =========== 协议回调(声明见 jb_protocol.h================== */
/* int8_t jbEventProcess(...); // 0x03 控制事件 */
/* void jbOnWorkState(...); // 0x14 状态同步(含RSSI) */
/* void jbOnBleRestartRequest(); // 0x1A BLE 通知重启 */
/* void jbOnOtaNotify(...); // 0x30 OTA 请求 */
/* void jbOnOtaData(...); // 0x32 OTA 数据 */
/* void jbOnOtaStop(); // 0x36/0x38 停止 OTA */
/* void jbOnTimeSync(...); // 0x1D 时间同步应答 */
/* void jbOnAck(...); // 任意请求 ACK(结果) */
/* ============= 主动请求(声明见 jb_protocol.h================ */
/* int32_t jbRequestPairing(...); // 0x10 请求配对 */
/* int32_t jbRequestTime(); // 0x1C 获取时间 */
/* int32_t jbRequestBleReset(); // 0x16 重置 BLE */
/* int32_t jbRequestBleRestart(); // 0x18 重启 BLE */
/* int32_t jbRequestProduction(...); // 0x20 产测模式 */
/* int32_t jbRequestPhoto(); // 0x22 开启拍照 */
/* int32_t jbRequestRecord(...); // 0x24 开启录像 */
/* int32_t jbRequestAudio(...); // 0x26 启动音频 */
/* int32_t jbNotifyOtaStop(); // 0x38 通知 BLE 停止 OTA */
/* int32_t jbSendOtaResult(...); // 0x34 OTA 结果 */
#endif /* _JB_PRODUCT_H */