bootloader/uart_commands.h

34 lines
765 B
C
Raw Normal View History

2022-05-19 08:57:38 -04:00
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include "uart.h"
#include "iap.h"
#include "crc.h"
2022-05-22 13:52:44 -04:00
#define DELIMIERS ","
#define APP_OFFSET 4
2022-05-19 08:57:38 -04:00
typedef struct cmd {
char** argv; // a first command splitted as arguments in the argv style
int argc; // number of arguments in the first command
} cmd_t;
void uart_commands_getid(error_code* status);
void uart_commands_getserial(error_code* status);
crc_t uart_commands_prog(void);
2022-05-19 15:37:51 -04:00
error_code uart_commands_data(error_code* status, int size, crc_t* checksum_global, crc_t checksum_loc, int offset);
error_code uart_commands_check(crc_t crc_received, crc_t crc_calculated);
2022-05-19 08:57:38 -04:00
int uart_parse_command(char *user_input, cmd_t *cmd);
uint32_t uart_string_to_int(const char* str);