reflow-oven-control-sw/stm-firmware/include/reflow-controller/periph-config/shell-uart-config.h

36 lines
1.0 KiB
C
Raw Permalink Normal View History

2020-02-24 18:48:26 +01:00
#ifndef __SHELL_UART_CONFIG_H__
#define __SHELL_UART_CONFIG_H__
#define SHELL_UART_RECEIVE_DMA_STREAM DMA2_Stream5
#define SHELL_UART_SEND_DMA_STREAM DMA2_Stream7
#define SHELL_UART_PERIPH USART1
#define SHELL_UART_RCC_REG RCC->APB2ENR
#define SHELL_UART_RCC_MASK RCC_APB2ENR_USART1EN
#define SHELL_UART_RX_DMA_TRIGGER 4U
#define SHELL_UART_TX_DMA_TRIGGER 4U
#if defined(DEBUGBUILD) || defined(UART_ON_DEBUG_HEADER)
2020-02-24 18:48:26 +01:00
#define SHELL_UART_PORT GPIOA
#define SHELL_UART_PORT_RCC_MASK RCC_AHB1ENR_GPIOAEN
#define SHELL_UART_RX_PIN 10
#define SHELL_UART_TX_PIN 9
#define SHELL_UART_RX_PIN_ALTFUNC 7
#define SHELL_UART_TX_PIN_ALTFUNC 7
#else
#endif
/* UART_DIV is 45.5625 => 115200 @ 84 MHz */
#define SHELL_UART_DEFAULT_DIV_FRACTION 9U /* Equals 9/16 = 0.5625 */
#define SHELL_UART_DEFAULT_DIV_MANTISSA 45U /* Equals 45 */
2020-02-24 18:48:26 +01:00
#define SHELL_UART_DEFAULT_BRR_REG_VALUE ((SHELL_UART_DEFAULT_DIV_MANTISSA<<4) | SHELL_UART_DEFAULT_DIV_FRACTION);
#define SHELL_UART_PERIPHERAL_CLOCK (84000000UL)
2020-02-24 18:48:26 +01:00
#endif /* __SHELL_UART_CONFIG_H__ */