This commit is contained in:
Mario Hüttel 2020-02-24 18:48:26 +01:00
parent 37e2c78b0b
commit 4bc85d474f
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,33 @@
#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
#ifdef DEBUGBUILD
#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_DIV_FRACTION 9U /* Equals 9/16 = 0.5625 */
#define SHELL_UART_DIV_MANTISSA 45U /* Equals 45 */
#define SHELL_UART_BRR_REG_VALUE ((SHELL_UART_DIV_MANTISSA<<4) | SHELL_UART_DIV_FRACTION);
#endif /* __SHELL_UART_CONFIG_H__ */

View File

@ -24,7 +24,7 @@
#include <stddef.h>
#include <shellmatta.h>
shellmatta_handle_t shell_init(void);
shellmatta_handle_t shell_init(shellmatta_write_t write_func);
void shell_handle_input(shellmatta_handle_t shell, const char *data, size_t len);