Files
motor-controller/modules/cmd_parser/cmd_parser.h
robinson cf934cf6b7 [feat] UART command interface, per-motor control, filtering modules
- Add callback_task with ISR-based UART command parser (@command\n protocol)
- Add log_printf with mutex protection to prevent printf interleaving
- Add per-motor enable/disable (motor enable yaw|pitch)
- Add PID tuning via UART (pid roll kp 15)
- Add cmd_parser module (registration + tokenize + dispatch)
- Add UART layer architecture (interface → HAL → BSP)
- Add filter modules (lowpass, moving_average, notch, rate_limiter)
- Rewrite I2C bus and UART bus modules
- Rewrite PID controller and MF4010V2 motor driver
- Fix soft I2C driver

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 01:38:11 +08:00

33 lines
681 B
C

#ifndef CMD_PARSER_H
#define CMD_PARSER_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define CMD_PARSER_MAX_CMDS 32
#define CMD_PARSER_NAME_LEN 20
#define CMD_PARSER_MAX_ARGS 16
typedef int (*cmd_handler_t)(void *ctx, int argc, char **argv);
typedef struct {
struct {
char name[CMD_PARSER_NAME_LEN];
cmd_handler_t handler;
} entries[CMD_PARSER_MAX_CMDS];
int count;
} cmd_parser_t;
void cmd_parser_init(cmd_parser_t *parser);
int cmd_parser_register(cmd_parser_t *parser, const char *name, cmd_handler_t handler);
int cmd_parser_dispatch(cmd_parser_t *parser, char *buf, void *ctx);
#ifdef __cplusplus
}
#endif
#endif