reflow-oven-control-sw/stm-firmware/include/reflow-controller/ui/lcd.h

50 lines
1.4 KiB
C
Raw Normal View History

/* 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.
*
* 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 __LCD_H__
#define __LCD_H__
2020-02-23 21:22:38 +01:00
#define LCD_DPORT (GPIOD)
#define LCD_RCC_MASK RCC_AHB1ENR_GPIODEN
#define LCD_DATA_BIT_OFFSET (8)
#define LCD_RS (6)
#define LCD_E (7)
#define LCD_DATA_MASK (0xFU << LCD_DATA_BIT_OFFSET)
#define LCD_RS_MASK (1U << LCD_RS)
#define LCD_E_MASK (1U << LCD_E)
2020-06-01 21:42:31 +02:00
#define LCD_CHAR_WIDTH 16
#define LCD_ROW_COUNT 4
enum lcd_fsm_ret {LCD_FSM_NOP, LCD_FSM_CALL_AGAIN, LCD_FSM_WAIT_CALL};
void lcd_init(void);
void lcd_string(const char *data);
void lcd_home(void);
enum lcd_fsm_ret lcd_fsm_write_buffer(const char (*display_buffer)[21]);
#endif /* __LCD_H__ */