MBSP

Microcontroller Board Support Package

User Tools

Site Tools


uart_group

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

uart_group [ 17.08.2025 05:39] – created larsuart_group [ 17.08.2025 05:49] (current) lars
Line 133: Line 133:
 **type**: int **type**: int
  
 +
 +
 +===== API =====
 +The part "signal_name" in the described functions will be replaced by the name of the signal. E.g. if your signal is called "debug_uart" then the API function "signal_name_send_bytes" will become "debug_uart_send_bytes".
 +
 +==== send ====
 +
 +<code>void signal_name_send_bytes(const uint8_t *data, const uint32_t length)</code>
 +Will send "length" bytes from the buffer "data" out on the TX line of the UART.
 +
 +<code>void signal_name_send_String(char* str)</code>
 +Will send out the bytes of the sting on the TX line of the UART.
 +
 +<code>void signal_name_putc(void* p, char c)</code>
 +Will send out the byte "c" on the TX line of the UART. The pointer "p" will not be used. This function is provided to be compatible with printf().
 +
 +==== receive ====
 +
 +<code>uint32_t signal_name_get_num_received_bytes(void)</code>
 +Returns the number of bytes that have been received on the RX line of the UART and have not been read.
 +
 +<code>uint8_t signal_name_get_next_received_byte(void)</code>
 +Returns the next byte that has been received on the RX line of the UART.
 +
 +<code>bool signal_name_get_received_bytes(uint8_t *buf, const uint32_t length)</code>
 +copies the "length" received bytes into the buffer "buf". If less than "length" bytes have been received then this function returns false.
  
uart_group.1755409175.txt.gz · Last modified: by lars