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

Source file for stm32f103cb USART. More...

Go to the source code of this file.

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...
 
mcu_error USART_setStop (usart_periph peripheral, usart_stop stop)
 Set the number of stop bits 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_setParity (usart_periph peripheral, usart_parity parity)
 Set the parity for the port. More...
 
mcu_error USART_put (usart_periph peripheral, uint8_t byte)
 Send a byte on the given peripheral. More...
 
v_fp_u8 USART_add_put (usart_periph peripheral)
 Return the address of the peripheral put function. More...
 
uint8_t USART_get (usart_periph peripheral)
 Get a byte on the given peripheral (blocking). 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_disableISR (usart_periph peripheral, usart_isr isr_target)
 Disables the specified ISR function. More...
 
mcu_error USART_enableISR (usart_periph peripheral, usart_isr isr_target)
 Enables the specified ISR function. More...
 

Detailed Description

Source file for stm32f103cb USART.


Author
Stuart Ianna
Version
0.1
Date
May 2018
Warning
None
Bug:
The USART.get() function is not compatible when using ISRs. This is becuase the data register needs to be read to reset the flags. This cannot be efficiently done in both ISR and get function. This is not a large problem as the get function is blocking, and isn't really used with an ISR.
Compilers
  • arm-none-eabi-gcc (15:4.9.3+svn231177-1) 4.9.3 20150529 (prerelease)

Definition in file stm32f103cb_usart.c.