diff --git a/.gitmodules b/.gitmodules index 98674a7..2ed4068 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "PID"] path = PID url = https://github.com/Carsten1987/PID.git -[submodule "lcd_16x2"] - path = lcd_16x2 - url = http://gitea.keller/carsten/lcd_16x2.git diff --git a/Source/Display.cpp b/Source/Display.cpp deleted file mode 100644 index 9e84be3..0000000 --- a/Source/Display.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Display.cpp - * - * Created on: Jul 29, 2023 - * Author: Carst - */ - -#include -#include -#include -#include -#include "Display.hpp" -#include "lcd_1602.h" - -extern "C" void LCD_RS_SetLow(void) -{ - LL_GPIO_ResetOutputPin(GPIOB, LL_GPIO_PIN_4); -} -extern "C" void LCD_RS_SetHigh(void) -{ - LL_GPIO_SetOutputPin(GPIOB, LL_GPIO_PIN_4); -} -extern "C" void LCD_RW_SetLow(void) -{ - LL_GPIO_ResetOutputPin(GPIOB, LL_GPIO_PIN_5); -} -extern "C" void LCD_RW_SetHigh(void) -{ - LL_GPIO_SetOutputPin(GPIOB, LL_GPIO_PIN_5); -} -extern "C" void LCD_E_SetLow(void) -{ - LL_GPIO_ResetOutputPin(GPIOB, LL_GPIO_PIN_6); -} -extern "C" void LCD_E_SetHigh(void) -{ - LL_GPIO_SetOutputPin(GPIOB, LL_GPIO_PIN_6); -} -extern "C" void LCD_DB_Set(uint8_t data) -{ - LL_GPIO_SetOutputPin(GPIOB, data); - LL_GPIO_ResetOutputPin(GPIOB, ~data & 0x0FUL); -} -extern "C" uint8_t LCD_DB_Get(void) -{ - return LL_GPIO_ReadInputPort(GPIOB); -} -extern "C" void LCD_DB_ConfigInput(void) -{ - LL_GPIO_SetPinMode(GPIOB, LL_GPIO_PIN_0, LL_GPIO_MODE_INPUT); - LL_GPIO_SetPinMode(GPIOB, LL_GPIO_PIN_1, LL_GPIO_MODE_INPUT); - LL_GPIO_SetPinMode(GPIOB, LL_GPIO_PIN_2, LL_GPIO_MODE_INPUT); - LL_GPIO_SetPinMode(GPIOB, LL_GPIO_PIN_3, LL_GPIO_MODE_INPUT); -} -extern "C" void LCD_DB_ConfigOutput(void) -{ - LL_GPIO_SetPinMode(GPIOB, LL_GPIO_PIN_0, LL_GPIO_MODE_OUTPUT); - LL_GPIO_SetPinMode(GPIOB, LL_GPIO_PIN_1, LL_GPIO_MODE_OUTPUT); - LL_GPIO_SetPinMode(GPIOB, LL_GPIO_PIN_2, LL_GPIO_MODE_OUTPUT); - LL_GPIO_SetPinMode(GPIOB, LL_GPIO_PIN_3, LL_GPIO_MODE_OUTPUT); - -} -namespace ElektronischeLast -{ - Display::Display(void) - { - lcd_init(); - } - - Display::~Display(void) - { - - } - void Display::NewData(uint32_t strom, uint32_t spannung, uint32_t temperatur) - { - char buf[17]; // 16 Zeichen pro Zeile + \0 - snprintf(buf, 16, "U: %2" PRIu32 ".%" PRIu32 " T: %2" PRIu32 ".%1" PRIu32, - spannung / 1000UL, spannung %1000UL, temperatur, 0UL); - lcd_set_cursor(eLine1, 0U); - lcd_string(buf); - - snprintf(buf, 16, "I: %2" PRIu32 ".%" PRIu32 " P: %4" PRIu32, - strom / 1000UL, strom %1000UL, strom * spannung / 1000UL); - lcd_string(buf); - lcd_set_cursor(eLine2, 0U); - } -} diff --git a/Source/Display.hpp b/Source/Display.hpp deleted file mode 100644 index ec03998..0000000 --- a/Source/Display.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Display.hpp - * - * Created on: Jul 29, 2023 - * Author: Carst - */ - -#ifndef DISPLAY_HPP_ -#define DISPLAY_HPP_ - -#ifdef __cplusplus - extern "C" { - #include -#else - #include -#endif - -void LCD_RS_SetLow(void); -void LCD_RS_SetHigh(void); -void LCD_RW_SetLow(void); -void LCD_RW_SetHigh(void); -void LCD_E_SetLow(void); -void LCD_E_SetHigh(void); -void LCD_DB_Set(uint8_t data); // Write data -uint8_t LCD_DB_Get(void); // Read Data -void LCD_DB_ConfigInput(void); // Konfiguriere I/O als Input -void LCD_DB_ConfigOutput(void); // Konfiguriere I/O als Output - -#ifdef __cplusplus -namespace ElektronischeLast -{ - class Display - { - public: - Display(void); - ~Display(void); - void NewData(uint32_t strom, uint32_t spannung, uint32_t temperatur); - }; -} -#endif -#ifdef __cplusplus - } -#endif - -#endif /* DISPLAY_HPP_ */ diff --git a/Source/ElektronischeLast.cpp b/Source/ElektronischeLast.cpp index 6a7d40f..a17ee80 100644 --- a/Source/ElektronischeLast.cpp +++ b/Source/ElektronischeLast.cpp @@ -17,7 +17,6 @@ #include "serial.hpp" #include "PID.h" #include "FanControl.hpp" -#include "Display.hpp" #include "CLI.h" using namespace ElektronischeLast; @@ -60,9 +59,7 @@ int main (void) iDAC dac = iDAC(); iADC adc = iADC(); FanControl fan = FanControl(); - Display display = Display(); std::uint32_t last_tick = systick; - std::uint32_t sec_tick = systick; printf("\r\nElektronische Last\r\n"); printf("- Initialisierung erfolgreich\r\n"); @@ -88,11 +85,6 @@ int main (void) serial_cyclic(); } - if(sec_tick + 1000UL > systick) - { - sec_tick = systick; - display.NewData(strom, spannung, temperatur); - } } } diff --git a/Source/lcd_16x2_config.h b/Source/lcd_16x2_config.h deleted file mode 100644 index f412741..0000000 --- a/Source/lcd_16x2_config.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * lcd_16x2_config.h - * - * Created on: Jul 29, 2023 - * Author: Carst - */ - -#ifndef LCD_16X2_CONFIG_H_ -#define LCD_16X2_CONFIG_H_ - -#include -#include "Display.hpp" - -#define NOP __NOP -#define __delay_ms(x) { for(int i=0;i