|
SDK3.5
This document shows Ameba SDK 3.5 APIs
|
log_uart functions More...
Ameba1 Only | |
| typedef void(* | loguart_irq_handler) (uint32_t id, LOG_UART_INT_ID event) |
| typedef struct log_uart_s | log_uart_t |
| int32_t | log_uart_init (log_uart_t *obj, int baudrate, int data_bits, SerialParity parity, int stop_bits) |
| Initialize Realtek log uart. Initialize the required parts of the log uart. i.e. baudrate, data bits, parity, etc. More... | |
| void | log_uart_free (log_uart_t *obj) |
| Release the resources related to Realtek log uart. More... | |
| void | log_uart_baud (log_uart_t *obj, int baudrate) |
| Set the baud rate of log uart. More... | |
| void | log_uart_format (log_uart_t *obj, int data_bits, SerialParity parity, int stop_bits) |
| Set parameters for log uart. including data bits, parity type and stop bits. More... | |
| void | log_uart_irq_handler (log_uart_t *obj, loguart_irq_handler handler, uint32_t id) |
| Set irq handler for log uart. More... | |
| void | log_uart_irq_set (log_uart_t *obj, LOG_UART_INT_ID irq, uint32_t enable) |
| Enable/disable the specific irq indication ID. More... | |
| char | log_uart_getc (log_uart_t *obj) |
| Read one character from log uart. This function will block untill the log uart gets something to read. More... | |
| void | log_uart_putc (log_uart_t *obj, char c) |
| Write one character to log uart. This function will block untill the data is successfully written to log uart. More... | |
| int | log_uart_readable (log_uart_t *obj) |
| Check whether log uart is ready to read data. More... | |
| int | log_uart_writable (log_uart_t *obj) |
| Check whether log uart is ready to write data. More... | |
| void | log_uart_clear (log_uart_t *obj) |
| Clear both data at log uart This function will clear data in both TX FIFO and RX FIFO of log uart. More... | |
| void | log_uart_clear_tx (log_uart_t *obj) |
| Clear TX FIFO of log uart. More... | |
| void | log_uart_clear_rx (log_uart_t *obj) |
| Clear RX FIFO of log uart. More... | |
| void | log_uart_break_set (log_uart_t *obj) |
| Set break control for log uart. More... | |
| void | log_uart_break_clear (log_uart_t *obj) |
| Clear break control for log uart. More... | |
| void | log_uart_tx_comp_handler (log_uart_t *obj, void *handler, uint32_t id) |
| Set the handler for complete TX. More... | |
| void | log_uart_rx_comp_handler (log_uart_t *obj, void *handler, uint32_t id) |
| Set the handler for complete RX. More... | |
| void | log_uart_line_status_handler (log_uart_t *obj, void *handler, uint32_t id) |
| Set the handler for line status. More... | |
| int32_t | log_uart_recv (log_uart_t *obj, char *prxbuf, uint32_t len, uint32_t timeout_ms) |
| Read data from log uart in blocking mode. More... | |
| int32_t | log_uart_send (log_uart_t *obj, char *ptxbuf, uint32_t len, uint32_t timeout_ms) |
| Send data to log uart in blocking mode. More... | |
| int32_t | log_uart_recv_stream (log_uart_t *obj, char *prxbuf, uint32_t len) |
| Read data from log uart in interrupt mode(Non-blocking) More... | |
| int32_t | log_uart_send_stream (log_uart_t *obj, char *ptxbuf, uint32_t len) |
| Send data to log uart in interrupt mode(Non-blocking) More... | |
| int32_t | log_uart_recv_stream_timeout (log_uart_t *obj, char *prxbuf, uint32_t len, uint32_t timeout_ms, void *force_cs) |
| Read data from log uart with a given timeout in interrupt mode(Non-blocking) More... | |
| int32_t | log_uart_send_stream_abort (log_uart_t *obj) |
| Abort interrupt mode of sending data. More... | |
| int32_t | log_uart_recv_stream_abort (log_uart_t *obj) |
| Abort interrupt mode of receiving data. More... | |
| void | log_uart_disable (log_uart_t *obj) |
| Disable log uart. More... | |
| void | log_uart_enable (log_uart_t *obj) |
| Enable log uart. More... | |
| uint8_t | log_uart_raed_lsr (log_uart_t *obj) |
| Read Line-Status register. More... | |
| uint8_t | log_uart_raed_msr (log_uart_t *obj) |
| Read Modem-Status register. More... | |
log_uart functions
| typedef void(* loguart_irq_handler) (uint32_t id, LOG_UART_INT_ID event) |
Log uart irq handler function pointer type
| id | : The argument for log uart interrupt handler |
| event | : The log uart interrupt indication ID. More details is shown in hal_log_uart.h |
| void log_uart_baud | ( | log_uart_t * | obj, |
| int | baudrate | ||
| ) |
Set the baud rate of log uart.
| [in] | obj | The address of log uart object. |
| [in] | baudrate | Baud rate of the log uart object. |
| void log_uart_break_clear | ( | log_uart_t * | obj | ) |
Clear break control for log uart.
| [in] | obj | The address of log uart object. |
| void log_uart_break_set | ( | log_uart_t * | obj | ) |
Set break control for log uart.
| [in] | obj | The address of log uart object. |
| void log_uart_clear | ( | log_uart_t * | obj | ) |
Clear both data at log uart This function will clear data in both TX FIFO and RX FIFO of log uart.
| [in] | obj | The address of log uart object. |
| void log_uart_clear_rx | ( | log_uart_t * | obj | ) |
Clear RX FIFO of log uart.
| [in] | obj | The address of log uart object. |
| void log_uart_clear_tx | ( | log_uart_t * | obj | ) |
Clear TX FIFO of log uart.
| [in] | obj | The address of log uart object. |
| void log_uart_disable | ( | log_uart_t * | obj | ) |
Disable log uart.
| [in] | obj | The address of log uart object. |
| void log_uart_enable | ( | log_uart_t * | obj | ) |
Enable log uart.
| [in] | obj | The address of log uart object. |
| void log_uart_format | ( | log_uart_t * | obj, |
| int | data_bits, | ||
| SerialParity | parity, | ||
| int | stop_bits | ||
| ) |
Set parameters for log uart. including data bits, parity type and stop bits.
| [in] | obj | The address of log uart object. |
| [in] | data_bits | Data bits of log uart object. |
| [in] | parity | Parity type of the log uart object
|
| [in] | stop_bits | The number of stop bits for the log uart object. |
| void log_uart_free | ( | log_uart_t * | obj | ) |
Release the resources related to Realtek log uart.
| [in] | obj | The address of log uart object. |
| char log_uart_getc | ( | log_uart_t * | obj | ) |
Read one character from log uart. This function will block untill the log uart gets something to read.
| [in] | obj | The address of log uart object. |
| int32_t log_uart_init | ( | log_uart_t * | obj, |
| int | baudrate, | ||
| int | data_bits, | ||
| SerialParity | parity, | ||
| int | stop_bits | ||
| ) |
Initialize Realtek log uart. Initialize the required parts of the log uart. i.e. baudrate, data bits, parity, etc.
| [in] | obj | The address of log uart object. |
| [in] | baudrate | Baud rate of the log uart object. |
| [in] | data_bits | Data bits of the log uart object. |
| [in] | parity | Parity type of the log uart object
|
| [in] | stop_bits | The number of stop bits for the log uart object. |
| void log_uart_irq_handler | ( | log_uart_t * | obj, |
| loguart_irq_handler | handler, | ||
| uint32_t | id | ||
| ) |
Set irq handler for log uart.
| [in] | obj | The address of log uart object. |
| [in] | handler | The interrupt handler for log uart. |
| [in] | id | The argument for log uart interrupt handler. |
| void log_uart_irq_set | ( | log_uart_t * | obj, |
| LOG_UART_INT_ID | irq, | ||
| uint32_t | enable | ||
| ) |
Enable/disable the specific irq indication ID.
| [in] | obj | The address of log uart object. |
| [in] | irq | The log uart interrupt indication ID which will be enabled/disabled. |
| [in] | enable | 1 enable, 0 disable |
| void log_uart_line_status_handler | ( | log_uart_t * | obj, |
| void * | handler, | ||
| uint32_t | id | ||
| ) |
Set the handler for line status.
| [in] | obj | The address of log uart object. |
| [in] | handler | The function which is called when log uart gets an line status indication ID. |
| [in] | id | The parameter for handler. |
| void log_uart_putc | ( | log_uart_t * | obj, |
| char | c | ||
| ) |
Write one character to log uart. This function will block untill the data is successfully written to log uart.
| [in] | obj | The address of log uart object. |
| [in] | c | The one byte data to be written to log uart. |
| uint8_t log_uart_raed_lsr | ( | log_uart_t * | obj | ) |
Read Line-Status register.
| uint8_t log_uart_raed_msr | ( | log_uart_t * | obj | ) |
Read Modem-Status register.
| int log_uart_readable | ( | log_uart_t * | obj | ) |
Check whether log uart is ready to read data.
| [in] | obj | The address of log uart object. |
| int32_t log_uart_recv | ( | log_uart_t * | obj, |
| char * | prxbuf, | ||
| uint32_t | len, | ||
| uint32_t | timeout_ms | ||
| ) |
Read data from log uart in blocking mode.
| [in] | obj | The address of log uart object. |
| [out] | prxbuf | The buffer to store received data. |
| [in] | len | The maximum length of data to be read |
| [in] | timeout_ms | Blocking time in ms. |
| int32_t log_uart_recv_stream | ( | log_uart_t * | obj, |
| char * | prxbuf, | ||
| uint32_t | len | ||
| ) |
Read data from log uart in interrupt mode(Non-blocking)
| [in] | obj | The address of log uart object. |
| [out] | prxbuf | The buffer to store received data. |
| [in] | len | The maximum length of data to be read |
| int32_t log_uart_recv_stream_abort | ( | log_uart_t * | obj | ) |
Abort interrupt mode of receiving data.
| [in] | obj | The address of log uart object. |
| int32_t log_uart_recv_stream_timeout | ( | log_uart_t * | obj, |
| char * | prxbuf, | ||
| uint32_t | len, | ||
| uint32_t | timeout_ms, | ||
| void * | force_cs | ||
| ) |
Read data from log uart with a given timeout in interrupt mode(Non-blocking)
| [in] | obj | The address of log uart object. |
| [out] | prxbuf | The buffer to store received data. |
| [in] | len | The maximum length of data to be read |
| [in] | timeout_ms | The timeout for reading data in ms |
| [in] | force_cs | User callback function |
| void log_uart_rx_comp_handler | ( | log_uart_t * | obj, |
| void * | handler, | ||
| uint32_t | id | ||
| ) |
Set the handler for complete RX.
| [in] | obj | The address of log uart object. |
| [in] | handler | The function which is called when log uart has finished receving data |
| [in] | id | The parameter for handler. |
| int32_t log_uart_send | ( | log_uart_t * | obj, |
| char * | ptxbuf, | ||
| uint32_t | len, | ||
| uint32_t | timeout_ms | ||
| ) |
Send data to log uart in blocking mode.
| [in] | obj | The address of log uart object. |
| [in] | ptxbuf | Data buffer to be sent to log uart |
| [in] | len | Length of data to be sent to log uart |
| [in] | timeout_ms | Blocking time in ms. |
| int32_t log_uart_send_stream | ( | log_uart_t * | obj, |
| char * | ptxbuf, | ||
| uint32_t | len | ||
| ) |
Send data to log uart in interrupt mode(Non-blocking)
| [in] | obj | The address of log uart object. |
| [in] | ptxbuf | Data buffer to be sent to log uart |
| [in] | len | Length of data to be sent to log uart |
| int32_t log_uart_send_stream_abort | ( | log_uart_t * | obj | ) |
Abort interrupt mode of sending data.
| [in] | obj | The address of log uart object. |
| void log_uart_tx_comp_handler | ( | log_uart_t * | obj, |
| void * | handler, | ||
| uint32_t | id | ||
| ) |
Set the handler for complete TX.
| [in] | obj | The address of log uart object. |
| [in] | handler | The function which is called when log uart has finished transmitting data. |
| [in] | id | The parameter for handler. |
| int log_uart_writable | ( | log_uart_t * | obj | ) |
Check whether log uart is ready to write data.
| [in] | obj | The address of log uart object. |
1.8.11