This group defines all used Universal Asynchronous Receiver Transmitter (UART) interfaces.
Each UART is a sub group with the UART name as the group name.
"UART": { "debug_uart": { "pad_tx": "PA5", "pad_rx": "PA6", "pad_cts": "PA7", "pad_rts": "PA15", "bits_per_packet": "8", "parity": "None", "stop_bits": "1", "baud_rate": "115200", "hardware_flow_control": "no", "receive_buffer_size": "100", "send_buffer_size": "500", "peripheral" : "UART0", "IRQ" : "20", "IRQ_priority" : "0", } }
The UART will send data on this pin. (Idle = High). Either this or the pad_rx must be given.
The UART will receive (read) signals on this pin. Either this or pad_rx must be given.
Clear to send signal for flow control. Will not be used if not defined.
Request to Send signal for flow control. Will not be used if not defined.
defines the number of data bits. Possible values are:
type: enum
default: 8
defines the parity bit. Possible values are:
type: enum
default: None
defines the number of stop bits. Possible values are:
type: enum
default: 8
defines the number of bits send per second.
type: int
default: 115200
defines if the Request to Send (RTS) and Clear to send (CTS) signals should be used for flow control. Possible values are:
type: enum
default: off
defines the number of bytes in the receive buffer of the driver.
type: int
default: 100
defines the number of bytes in the send buffer of the driver.
type: int
default: 500
name of the UART peripheral to use.
type: String
The interrupt number of the peripheral.
type: int
The interrupt priority of the interrupt.
type: int
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”.
void signal_name_send_bytes(const uint8_t *data, const uint32_t length)
Will send “length” bytes from the buffer “data” out on the TX line of the UART.
void signal_name_send_String(char* str)
Will send out the bytes of the sting on the TX line of the UART.
void signal_name_putc(void* p, char c)
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().
uint32_t signal_name_get_num_received_bytes(void)
Returns the number of bytes that have been received on the RX line of the UART and have not been read.
uint8_t signal_name_get_next_received_byte(void)
Returns the next byte that has been received on the RX line of the UART.
bool signal_name_get_received_bytes(uint8_t *buf, const uint32_t length)
copies the “length” received bytes into the buffer “buf”. If less than “length” bytes have been received then this function returns false.