GlobLib
HAL and API libraries for MCUs and hardware.
stm32f103cb_usart.h File Reference

Header file for stm32f103cb USART. More...

#include <libopencm3/stm32/usart.h>
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/cm3/nvic.h>
#include "stm32f103cb_gpio.h"
#include "stm32f103cb_debug.h"
#include <stdint.h>

Go to the source code of this file.

Macros

#define USART_DEFAULT_BAUD   USART_BAUD_9600
 The default baud rate used by setup function.
 
#define USART_DEFAULT_STOP   USART_STOP_ONE
 The default stop bits used by setup function.
 
#define USART_DEFAULT_DATA   USART_DATA_EIGHT
 The default data frame used by setup function.
 
#define USART_DEFAULT_PARITY   USART_PARITY_NONE
 The default parity used by setup function.
 

Typedefs

typedef void(* v_fp_u8) (uint8_t)
 Function pointer typedef for void function with uint8_t parameter.
 

Enumerations

Functions

mcu_error USART_setup (usart_periph peripheral)
 Initialize USART port. More...
 
mcu_error USART_setBaud (usart_periph peripheral, usart_baud baud)
 Set the baud rate for the port. More...
 
v_fp_u8 USART_add_put (usart_periph peripheral)
 Return the address of the peripheral put function. More...
 
mcu_error USART_put (usart_periph peripheral, uint8_t byte)
 Send a byte on the given peripheral. More...
 
uint8_t USART_get (usart_periph peripheral)
 Get a byte on the given peripheral (blocking). More...
 
mcu_error USART_setStop (usart_periph peripheral, usart_stop stopBits)
 Set the number of stop bits for the port. More...
 
mcu_error USART_setParity (usart_periph peripheral, usart_parity parity)
 Set the parity for the port. More...
 
mcu_error USART_setData (usart_periph peripheral, usart_data data)
 Set the data frame size for the port. More...
 
mcu_error USART_setRxISR (usart_periph peripheral, void(*new_handler)(uint8_t received))
 Sets the target function called when recieve ISR is triggered. More...
 
mcu_error USART_setTxISR (usart_periph peripheral, void(*new_handler)(void))
 Sets the target function called when transmit ISR is triggered. More...
 
mcu_error USART_enableISR (usart_periph peripheral, usart_isr isr_type)
 Enables the specified ISR function. More...
 
mcu_error USART_disableISR (usart_periph peripheral, usart_isr isr_type)
 Disables the specified ISR function. More...
 

Detailed Description

Header file for stm32f103cb USART.

Definition in file stm32f103cb_usart.h.