Add a bunch of stuff: Add baudrate reconfig command to shell and move the uart to separate C file
This commit is contained in:
51
stm-firmware/include/reflow-controller/ui/shell-uart.h
Normal file
51
stm-firmware/include/reflow-controller/ui/shell-uart.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* Reflow Oven Controller
|
||||
*
|
||||
* Copyright (C) 2021 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of the Reflow Oven Controller Project.
|
||||
*
|
||||
* The reflow oven controller is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* The Reflow Oven Control Firmware is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with the reflow oven controller project.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __SHELL_UART_H__
|
||||
|
||||
#include <shellmatta.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @brief Configure the UART for the shellmatta shell.
|
||||
*
|
||||
* This will configure the UART for use with a DMA ring buffer.
|
||||
* @param uart
|
||||
*/
|
||||
void shell_uart_setup(void);
|
||||
|
||||
shellmatta_retCode_t shell_uart_write_callback(const char *data, uint32_t len);
|
||||
|
||||
int shell_uart_receive_data_with_dma(const char **data, size_t *len);
|
||||
|
||||
/**
|
||||
* @brief Configure a new connection speed.
|
||||
* @param new_baud Baudrate. E.g: 115200
|
||||
* @return Error in permille (1/1000). A return value of 2 means a baudrate error of: 0.002 or 0.2%.
|
||||
* Return value is negative in case of a hard error.
|
||||
*/
|
||||
int32_t shell_uart_reconfig_baud(uint32_t new_baud);
|
||||
|
||||
uint32_t shell_uart_get_current_baudrate(void);
|
||||
|
||||
#define __SHELL_UART_H__
|
||||
|
||||
#endif /* __SHELL_UART_H__ */
|
35
stm-firmware/include/reflow-controller/ui/shell.h
Normal file
35
stm-firmware/include/reflow-controller/ui/shell.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/* Reflow Oven Controller
|
||||
*
|
||||
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of the Reflow Oven Controller Project.
|
||||
*
|
||||
* The reflow oven controller is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* GDSII-Converter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with the reflow oven controller project.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __SHELL_H__
|
||||
#define __SHELL_H__
|
||||
|
||||
#include <stddef.h>
|
||||
#include <shellmatta.h>
|
||||
|
||||
shellmatta_handle_t shell_init(shellmatta_write_t write_func);
|
||||
|
||||
void shell_handle_input(shellmatta_handle_t shell, const char *data, size_t len);
|
||||
|
||||
void shell_print_string(shellmatta_handle_t shell, const char *string);
|
||||
|
||||
void shell_print_motd(shellmatta_handle_t shell);
|
||||
|
||||
#endif /* __SHELL_H__ */
|
Reference in New Issue
Block a user