Siphon Regulator 1.0
Nanosattelite attitude determination and control system.
Loading...
Searching...
No Matches
cmd_processing_def.h
Go to the documentation of this file.
1/*
2 * cmd_processing library
3 * (c) Antonin_Putala 2026
4 *
5 * Developed using STM32CubeIDE
6 * Tested on BluePill board and STM32F103C8T6, 32 MHz.
7 */
8
20#ifndef INC_CMD_PROCESSING_DEF_H_
21#define INC_CMD_PROCESSING_DEF_H_
22
23/* Defines ------------------------------------------------*/
25#define CMD_BUFFER_LEN 256
26
28#define PULSE_LEN_MIN 100
29
31#define PULSE_LEN_MAX 1000
32
34#define MAX_TIME 255
35
37#define TURN_ANGLE_MIN 10
38
40#define TURN_ANGLE_MAX 90
41
43#define HOME_ANGLE_MIN -180
44
46#define HOME_ANGLE_MAX 180
47
48
49/* Static functions declaration ---------------------------*/
50/* Function prototypes ------------------------------------*/
63static void process_cmd(char * cmd, uint32_t * p_reg);
64
77static void process_cmd_read(char * cmd);
78
98static void process_cmd_turn(char * cmd, uint32_t * p_reg);
99
111static void process_cmd_home(uint32_t * p_reg);
112
140static void process_cmd_pulse(char * cmd, uint32_t * p_reg);
141
162static void process_cmd_set(char * cmd, uint32_t * p_reg);
163
176static void process_cmd_ncmd(char * cmd, uint32_t * p_reg);
177
193static void process_cmd_autoread(char * cmd, uint32_t * p_reg);
194
204static void process_cmd_reset(uint32_t * p_reg);
205
222static void process_cmd_set_read(char * cmd, uint32_t * p_reg);
223
232static void process_cmd_set_auto(char * cmd);
233
251static void process_cmd_set_time(char * cmd);
252
262static void process_cmd_set_angle(char * cmd);
263
273static void process_cmd_set_home(char * cmd);
274
276#endif /* INC_CMD_PROCESSING_DEF_H_ */
static void process_cmd(char *cmd, uint32_t *p_reg)
Executes the corresponding commands are stores the result in the command register.
static void process_cmd_read(char *cmd)
Sends sensors data based on the command.
static void process_cmd_turn(char *cmd, uint32_t *p_reg)
Triggers a rotation by a defined angle.
static void process_cmd_ncmd(char *cmd, uint32_t *p_reg)
Reserved.
static void process_cmd_autoread(char *cmd, uint32_t *p_reg)
Enables and disables autoread.
static void process_cmd_set_read(char *cmd, uint32_t *p_reg)
Enables turn on/off autoreport from these sensors.
static void process_cmd_home(uint32_t *p_reg)
Triggers a home command.
static void process_cmd_set_time(char *cmd)
Allows adjusting the valve-opening time settings.
static void process_cmd_set(char *cmd, uint32_t *p_reg)
Allows modifying the settings global variable and changing the contents of the autoread report.
static void process_cmd_set_angle(char *cmd)
Allows setting the rotation angle for the TURN command.
static void process_cmd_set_auto(char *cmd)
Enables change the period of autoreading.
static void process_cmd_reset(uint32_t *p_reg)
Clears command register. Closes valves.
static void process_cmd_set_home(char *cmd)
Allows setting the default orientation for the HOME command.
static void process_cmd_pulse(char *cmd, uint32_t *p_reg)
Triggers a pulse with a defined duration.