1 #ifndef STM32F103CB_USART_H_ 2 #define STM32F103CB_USART_H_ 63 #include <libopencm3/stm32/usart.h> 64 #include <libopencm3/stm32/rcc.h> 65 #include <libopencm3/cm3/nvic.h> 144 #define USART_DEFAULT_BAUD USART_BAUD_9600 145 #define USART_DEFAULT_STOP USART_STOP_ONE 146 #define USART_DEFAULT_DATA USART_DATA_EIGHT 147 #define USART_DEFAULT_PARITY USART_PARITY_NONE mcu_error USART_setStop(usart_periph peripheral, usart_stop stopBits)
Set the number of stop bits for the port.
mcu_error USART_setTxISR(usart_periph peripheral, void(*new_handler)(void))
Sets the target function called when transmit ISR is triggered.
Header file for stm32f103cb DEBUG.
Header file for stm32f103 GPIO.
usart_isr
ISR values for the port.
mcu_error USART_setData(usart_periph peripheral, usart_data data)
Set the data frame size for the port.
Even parity for the port.
v_fp_u8 USART_add_put(usart_periph peripheral)
Return the address of the peripheral put function.
mcu_error USART_disableISR(usart_periph peripheral, usart_isr isr_type)
Disables the specified ISR function.
usart_data
Data frame lengths for the port.
usart_periph
Peripheral ports available on the MCU.
Two stop bits for the port.
usart_stop
Stop bit options available for the port.
mcu_error USART_enableISR(usart_periph peripheral, usart_isr isr_type)
Enables the specified ISR function.
void(* v_fp_u8)(uint8_t)
Function pointer typedef for void function with uint8_t parameter.
mcu_error USART_setParity(usart_periph peripheral, usart_parity parity)
Set the parity for the port.
Eight bit data frame for the port.
usart_baud
Baud rate options for the port.
uint8_t USART_get(usart_periph peripheral)
Get a byte on the given peripheral (blocking).
mcu_error USART_setup(usart_periph peripheral)
Initialize USART port.
mcu_error USART_put(usart_periph peripheral, uint8_t byte)
Send a byte on the given peripheral.
usart_parity
Parity option available for the port.
One stop bit for the port.
mcu_error USART_setRxISR(usart_periph peripheral, void(*new_handler)(uint8_t received))
Sets the target function called when recieve ISR is triggered.
mcu_error USART_setBaud(usart_periph peripheral, usart_baud baud)
Set the baud rate for the port.
Nine bit data frame for the port.
mcu_error
Error enumerators for the Debug peripheral.