|
SmartSnippets DA1459x SDK
|
Go to the documentation of this file.
59 #define MCIF_CLIENTS_NR 1
67 #ifndef MCIF_USE_TASK_NOTIFICATIONS
68 #define MCIF_USE_TASK_NOTIFICATIONS 0
77 #define MCIF_MAX_ARGS 2
87 #define MCIF_UART HW_UART1
95 #ifndef MCIF_GPIO_PORT_UART_RX
96 #define MCIF_GPIO_PORT_UART_RX HW_GPIO_PORT_1
104 #ifndef MCIF_GPIO_PIN_UART_RX
105 #define MCIF_GPIO_PIN_UART_RX HW_GPIO_PIN_5
113 #ifndef MCIF_GPIO_PORT_UART_TX
114 #define MCIF_GPIO_PORT_UART_TX HW_GPIO_PORT_1
122 #ifndef MCIF_GPIO_PIN_UART_TX
123 #define MCIF_GPIO_PIN_UART_TX HW_GPIO_PIN_0
133 #ifndef MCIF_UART_BAUDRATE
134 #define MCIF_UART_BAUDRATE HW_UART_BAUDRATE_115200
143 #ifndef MCIF_UART_DATABITS
144 #define MCIF_UART_DATABITS HW_UART_DATABITS_8
153 #ifndef MCIF_UART_STOPBITS
154 #define MCIF_UART_STOPBITS HW_UART_STOPBITS_1
163 #ifndef MCIF_UART_PARITY
164 #define MCIF_UART_PARITY HW_UART_PARITY_NONE
175 #define MCIF_LOG_TAG 30
184 #ifndef MCIF_ASCII_MAX_LINE
185 #define MCIF_ASCII_MAX_LINE 80
194 #ifndef MCIF_UART_DMA_BUFFER
195 #define MCIF_UART_DMA_BUFFER MCIF_ASCII_MAX_LINE
197 #if (MCIF_UART_DMA_BUFFER < MCIF_ASCII_MAX_LINE)
198 #undef MCIF_UART_DMA_BUFFER
199 #define MCIF_UART_DMA_BUFFER MCIF_ASCII_MAX_LINE
209 #ifndef MCIF_ASCII_PROMPT
210 #define MCIF_ASCII_PROMPT "\r\nEnter command (or ?/help for help) > "
227 struct mcif_message_s {
241 #define MCIF_ASCII_FLAGS_MASK 0x3
250 #define MCIF_ASCII_FLAGS_ARG1_NA 0x0
251 #define MCIF_ASCII_FLAGS_ARG2_NA 0x0
252 #define MCIF_ASCII_FLAGS_ARG3_NA 0x0
253 #define MCIF_ASCII_FLAGS_ARG4_NA 0x0
254 #define MCIF_ASCII_FLAGS_ARG5_NA 0x0
255 #define MCIF_ASCII_FLAGS_ARG6_NA 0x0
264 #define MCIF_ASCII_FLAGS_ARG1_INT 0x1
265 #define MCIF_ASCII_FLAGS_ARG2_INT 0x4
266 #define MCIF_ASCII_FLAGS_ARG3_INT 0x10
267 #define MCIF_ASCII_FLAGS_ARG4_INT 0x40
268 #define MCIF_ASCII_FLAGS_ARG5_INT 0x100
269 #define MCIF_ASCII_FLAGS_ARG6_INT 0x400
280 #define MCIF_ASCII_FLAGS_ARG1_STR 0x2
281 #define MCIF_ASCII_FLAGS_ARG2_STR 0x8
282 #define MCIF_ASCII_FLAGS_ARG3_STR 0x20
283 #define MCIF_ASCII_FLAGS_ARG4_STR 0x80
284 #define MCIF_ASCII_FLAGS_ARG5_STR 0x200
285 #define MCIF_ASCII_FLAGS_ARG6_STR 0x800
296 #define MCIF_ASCII_FLAGS_ARG1_STR_NO_WHITE 0x3
297 #define MCIF_ASCII_FLAGS_ARG2_STR_NO_WHITE 0xc
298 #define MCIF_ASCII_FLAGS_ARG3_STR_NO_WHITE 0x30
299 #define MCIF_ASCII_FLAGS_ARG4_STR_NO_WHITE 0xc0
300 #define MCIF_ASCII_FLAGS_ARG5_STR_NO_WHITE 0x300
301 #define MCIF_ASCII_FLAGS_ARG6_STR_NO_WHITE 0xc00
311 #if MCIF_MAX_ARGS < 4
312 #define MCIF_ASCII_FLAGS_AUTO_REPLY 0x80
314 #define MCIF_ASCII_FLAGS_AUTO_REPLY 0x8000
317 #if MCIF_MAX_ARGS > 2
318 typedef void (*
cmd_cb_t)(xQueueHandle txq,
void **args);
320 typedef void (*
cmd_cb_t)(xQueueHandle txq,
void *arg1,
void *arg2);
340 #if MCIF_MAX_ARGS > 2
341 void (*
fn)(xQueueHandle txq,
void **args);
343 void (*
fn)(xQueueHandle txq,
void *arg1,
void *arg2);
346 #if MCIF_MAX_ARGS < 4
374 struct mcif_message_s *
msg);
400 struct mcif_message_s *
msg) __WEAK;
424 struct mcif_message_s *
msg) __WEAK;
447 struct mcif_message_s *
msg,
bool show_prompt);
472 #if MCIF_USE_TASK_NOTIFICATIONS == 1
496 void mcif_setup_client_notifications(
int cli_id, OS_TASK handle, uint8_t notif_bit);
515 OS_TICK_TIME wait_ticks);
uint8_t flags
Definition: mcif.h:347
void mcif_ascii_print_unknown(const struct mcif_ascii_parse_element_s *parse_table, xQueueHandle txq, struct mcif_message_s *msg) __WEAK
Print the unknown command message.
const char * name
Definition: mcif.h:339
void mcif_init(void)
Initialize MCIF framework.
void mcif_setup_queues(int cli_id, OS_QUEUE txq, OS_QUEUE rxq)
Setup the MCIF queues.
void mcif_ascii_send_response(const struct mcif_ascii_parse_element_s *parse_table, xQueueHandle txq, struct mcif_message_s *msg, bool show_prompt)
Send a response to the terminal.
OS abstraction layer API.
MCIF-ASCII command description structure.
Definition: mcif.h:337
OS_BASE_TYPE mcif_queue_send(int cli_id, const void *item, OS_TICK_TIME wait_ticks)
Send a message to MCIF.
const char * help_str
Definition: mcif.h:345
void(* cmd_cb_t)(xQueueHandle txq, void *arg1, void *arg2)
ASCII command-set argument X not-applicable flag.
Definition: mcif.h:320
void(* fn)(xQueueHandle txq, void *arg1, void *arg2)
Definition: mcif.h:343
void mcif_ascii_print_prompt(const struct mcif_ascii_parse_element_s *parse_table, xQueueHandle txq, struct mcif_message_s *msg) __WEAK
Print a prompt.
void mcif_ascii_parse_message(const struct mcif_ascii_parse_element_s *parse_table, xQueueHandle txq, struct mcif_message_s *msg)
Parse the received message.
Structure for messages with id, type, data.
Definition: msg_queues.h:144