|
SmartSnippets DA1459x SDK
|
Files | |
| file | console.h |
| Definition of the API for the Console utilities service. | |
Macros | |
| #define | CONSOLE_TASK_PRIORITY (OS_TASK_PRIORITY_NORMAL) |
| Console task priority. | |
Functions | |
| void | console_init (const ad_uart_controller_conf_t *ad_uart_ctrl_conf) |
| Initialize console to use with specified serial device. More... | |
| int | console_write (const char *buf, int len) |
| Write to serial console. More... | |
| int | console_read (char *buf, int len) |
| Read from serial console. More... | |
| void | console_wkup_handler (void) |
| Wake up handler for serial console. More... | |
| void console_init | ( | const ad_uart_controller_conf_t * | ad_uart_ctrl_conf | ) |
Initialize console to use with specified serial device.
This function will allocate all necessary resources for serial console (RAM, task, synchronization primitives).
| [in] | ad_uart_ctrl_conf | controller configuration |
| int console_read | ( | char * | buf, |
| int | len | ||
| ) |
Read from serial console.
Call this function to read data from serial console.
| [out] | buf | pointer to buffer to fill with data from serial console |
| [in] | len | number of bytes to read |
| void console_wkup_handler | ( | void | ) |
Wake up handler for serial console.
It shall be called when the UART CTS GPIO pin is asserted to signal this event for the console task. Imperative setup actions in order to use it:
Note: The UART CTS line/pin is of reverse logic, i.e. it is asserted when low (logic 0).
| int console_write | ( | const char * | buf, |
| int | len | ||
| ) |
Write to serial console.
This function can be called from normal task as well as interrupts. When called from interrupts this function will not block. If buffer can't hold all requested data some data will be dropped and will never leave UART. When called from a task, this function can block if there is no space in buffer to hold data.
| [in] | buf | pointer to data to send to serial console |
| [in] | len | number of bytes to print |
1.8.16