CARME-M4 BSP  V1.5
uart.h
Go to the documentation of this file.
1 #ifndef __UART_H__
2 #define __UART_H__
3 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif /* __cplusplus */
76 
77 /*----- Header-Files -------------------------------------------------------*/
78 #include <stm32f4xx.h> /* Processor STM32F407IG */
79 
80 /*----- Macros -------------------------------------------------------------*/
81 #define CARME_UART0 USART1
82 #define CARME_UART1 USART3
84 /* CARME error codes */
85 #define CARME_ERROR_UART_NO_DATA (CARME_ERROR_UART_BASE+0)
87 /*----- Data types ---------------------------------------------------------*/
88 
89 /*----- Function prototypes ------------------------------------------------*/
90 extern void CARME_UART_Init(USART_TypeDef *UARTx,
91  USART_InitTypeDef *pUSART_InitStruct);
92 extern void CARME_UART_GPIO_Init(void);
93 extern void CARME_UART_SendChar(USART_TypeDef *UARTx, char c);
94 extern void CARME_UART_SendString(USART_TypeDef *UARTx, char *pStr);
95 extern ERROR_CODES CARME_UART_ReceiveChar(USART_TypeDef *UARTx, char *pc);
96 extern ERROR_CODES CARME_UART_ReceiveString(USART_TypeDef *UARTx, char *pc,
97  uint8_t count);
98 
99 /*----- Data ---------------------------------------------------------------*/
100 
101 #ifdef __cplusplus
102 }
103 #endif /* __cplusplus */
104 
110 #endif /* __UART_H__ */
uint8_t ERROR_CODES
Error variable.
Definition: carme.h:255
void CARME_UART_Init(USART_TypeDef *UARTx, USART_InitTypeDef *pUSART_InitStruct)
UART initialization.
Definition: uart.c:125
void CARME_UART_SendString(USART_TypeDef *UARTx, char *pStr)
Send a string over the UART port. You can use printf() to send a formated String over the CARME_UART0...
Definition: uart.c:206
void CARME_UART_SendChar(USART_TypeDef *UARTx, char c)
Send a char over the UART port.
Definition: uart.c:188
void CARME_UART_GPIO_Init(void)
CARME UART port GPIO initialization.
Definition: uart.c:166
USART Init Structure definition.
ERROR_CODES CARME_UART_ReceiveString(USART_TypeDef *UARTx, char *pc, uint8_t count)
Receive a string from the UART input buffer until new line or carriage return or there is no more dat...
Definition: uart.c:253
ERROR_CODES CARME_UART_ReceiveChar(USART_TypeDef *UARTx, char *pc)
Receive a char from the UART input buffer.
Definition: uart.c:225