TLx493D 3D Hall Sensor Generic Library  0.2
Generic library for the TLx493D 3D Hall sensor family
conf_uart.h
Go to the documentation of this file.
1 /*
2  * conf_uart.h
3  *
4  * Created on: Sep 3, 2018
5  * Author: nicolaem
6  */
7 
12 #ifndef SRC_PERIPHERALS_UART_CONF_UART_H_
13 #define SRC_PERIPHERALS_UART_CONF_UART_H_
14 
15 #include <xmc_usic.h>
16 #include <xmc_uart.h>
17 #include <xmc_gpio.h>
18 
19 
21 #define CONF_UART_CH XMC_UART0_CH0
22 
24 #define CONF_UART_RX_PIN P2_2
25 
27 #define CONF_UART_TX_PIN P2_1
28 
29 
30 /* UART RX pin (pin 2.2) configuration */
31 static const XMC_GPIO_CONFIG_t UART_RX_PIN_CONFIG =
32 {
33  .mode = XMC_GPIO_MODE_INPUT_TRISTATE,
34  .input_hysteresis = XMC_GPIO_INPUT_HYSTERESIS_STANDARD
35 };
36 
37 /* UART TX pin (pin 2.1) configuration */
38 static const XMC_GPIO_CONFIG_t UART_TX_PIN_CONFIG =
39 {
40  .mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL_ALT6,
41  .input_hysteresis = XMC_GPIO_INPUT_HYSTERESIS_STANDARD
42 };
43 
44 /* UART channel configuration */
45 static const XMC_UART_CH_CONFIG_t UART_CHANNEL_CONFIG =
46 {
47  .baudrate = 115200U,
48  .data_bits = 8U,
49  .frame_length = 8U,
50  .stop_bits = 1U,
51  .oversampling = 16U,
52  .parity_mode = XMC_USIC_CH_PARITY_MODE_NONE
53 };
54 
55 #endif /* SRC_PERIPHERALS_UART_CONF_UART_H_ */