smart-fursuit-tail-esp32/embedded/src/uartprint.cpp

20 lines
629 B
C++

#include "uartprint.hpp"
#include "string.h"
void setup_uart(){
uart_config_t uart_config = {
.baud_rate = 9600,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE
};
uart_param_config(UART_NUM_0, &uart_config);
uart_set_pin(UART_NUM_0, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
uart_driver_install(UART_NUM_0, 4096, 8192, 10, NULL, 0);
}
void uart_print(const char* data){
uart_write_bytes(UART_NUM_0, (const char*) data, strlen(data));
}