Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F60519849
uart.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Apr 30, 19:57
Size
1 KB
Mime Type
text/x-c
Expires
Thu, May 2, 19:57 (2 d)
Engine
blob
Format
Raw Data
Handle
17366361
Attached To
R2671 HHRI-software
uart.h
View Options
#ifndef __UART_H
#define __UART_H
#include "../main.h"
#include "../lib/circular_buffer.h"
#define USART_RX_Pin GPIO_Pin_5
#define USART_RX_PinSource GPIO_PinSource5
#define USART_RX_Port GPIOD
#define USART_TX_Pin GPIO_Pin_6
#define USART_TX_PinSource GPIO_PinSource6
#define USART_TX_Port GPIOD
#define USART_PC_COMM USART2 // UART peripheral used for the comm with the PC.
#define USART_BAUDRATE 1843200 //921600 // USART baudrate [b/s].
/** @defgroup UART Driver / UART
* @brief Driver for the UART serial communication peripheral.
*
* This driver controls the UART peripheral of the STM32, connected to the
* USB-to-serial chip.
*
* Call uart_Init() first in the initialization code, specifiying the function
* to call when a byte arrives (sent from the computer). To send data, call
* uart_SendByte() or uart_SendBytes().
*
* Note that this module should not be used directly. It is a better option to
* use it through the Communication module, to benefit from the already
* implemented communication protocol between the board and MATLAB.
*
* @addtogroup UART
* @{
*/
/**
* Typedef for a pointer to a function to call automatically when a byte
* arrives from the computer.
*/
typedef void (*uart_rxByteHandlerFunc)(uint8_t rxByte);
void uart_Init(void);
void uart_Step(void);
cb_CircularBuffer* uart_GetRxQueue(void);
void uart_SendByteAsync(uint8_t data);
void uart_SendBytesAsync(uint8_t *data, int length);
void uart_FlushTx(void);
/**
* @}
*/
#endif
Event Timeline
Log In to Comment