dRonin
adbada4
dRonin firmware
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
pios_usart_config.h
Go to the documentation of this file.
1
/*
2
* pios_usart_config.h
3
*
4
* Created on: May 8, 2011
5
* Author: Michael Smioth
6
*/
7
8
#ifndef PIOS_USART_CONFIG_H_
9
#define PIOS_USART_CONFIG_H_
10
14
#define USART_CONFIG(_usart, _baudrate, _rx_gpio, _rx_pin, _tx_gpio, _tx_pin) \
15
{ \
16
.regs = _usart, \
17
.remap = GPIO_AF_ ## _usart, \
18
.init = { \
19
.USART_BaudRate = _baudrate, \
20
.USART_WordLength = USART_WordLength_8b, \
21
.USART_Parity = USART_Parity_No, \
22
.USART_StopBits = USART_StopBits_1, \
23
.USART_HardwareFlowControl = USART_HardwareFlowControl_None, \
24
.USART_Mode = USART_Mode_Rx | USART_Mode_Tx, \
25
}, \
26
.irq = { \
27
.init = { \
28
.NVIC_IRQChannel = _usart ## _IRQn, \
29
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGH, \
30
.NVIC_IRQChannelSubPriority = 0, \
31
.NVIC_IRQChannelCmd = ENABLE, \
32
}, \
33
}, \
34
.rx = { \
35
.gpio = _rx_gpio, \
36
.init = { \
37
.GPIO_Pin = _rx_pin, \
38
.GPIO_Mode = GPIO_Mode_AF, \
39
.GPIO_Speed = GPIO_Speed_50MHz, \
40
.GPIO_OType = GPIO_OType_PP, \
41
.GPIO_PuPd = GPIO_PuPd_UP, \
42
}, \
43
}, \
44
.tx = { \
45
.gpio = _tx_gpio, \
46
.init = { \
47
.GPIO_Pin = _tx_pin, \
48
.GPIO_Mode = GPIO_Mode_AF, \
49
.GPIO_Speed = GPIO_Speed_50MHz, \
50
.GPIO_OType = GPIO_OType_PP, \
51
.GPIO_PuPd = GPIO_PuPd_UP, \
52
}, \
53
}, \
54
}
55
56
#endif
/* PIOS_USART_CONFIG_H_ */
flight
PiOS
STM32F4xx
inc
pios_usart_config.h
Generated by
1.8.6