Revert "Display-Integration"
This reverts commit d36c69b19c31adba67c13cfba22e4a5ade72dcdd.
This commit is contained in:
parent
f714e40344
commit
1cc68d7eba
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -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
|
||||
|
@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Display.cpp
|
||||
*
|
||||
* Created on: Jul 29, 2023
|
||||
* Author: Carst
|
||||
*/
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cinttypes>
|
||||
#include <stm32g0xx_ll_gpio.h>
|
||||
#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);
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Display.hpp
|
||||
*
|
||||
* Created on: Jul 29, 2023
|
||||
* Author: Carst
|
||||
*/
|
||||
|
||||
#ifndef DISPLAY_HPP_
|
||||
#define DISPLAY_HPP_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#include <cstdint>
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#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_ */
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 <stm32g071xx.h>
|
||||
#include "Display.hpp"
|
||||
|
||||
#define NOP __NOP
|
||||
#define __delay_ms(x) { for(int i=0;i<x*64000;i++); }
|
||||
#define __delay_us(x) { for(int i=0;i<x*64;i++); }
|
||||
|
||||
#endif /* LCD_16X2_CONFIG_H_ */
|
1
lcd_16x2
1
lcd_16x2
@ -1 +0,0 @@
|
||||
Subproject commit 89fb8a8d898bc6e7dd1048b2bb706cb2857854ba
|
Loading…
x
Reference in New Issue
Block a user