You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.1 KiB
51 lines
1.1 KiB
4 years ago
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com>
|
||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||
|
//
|
||
|
// LCD driver for Sharp LS018B7DH02 monochrome display
|
||
|
|
||
|
#ifndef __LCD_H__
|
||
|
#define __LCD_H__
|
||
|
|
||
|
#include "stm32h7xx_hal.h"
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <stdbool.h>
|
||
|
|
||
|
#define SCREEN_WIDTH 230
|
||
|
#define SCREEN_HEIGHT 303
|
||
|
#define SCREEN_BYTES_PER_LINE (240 / 8)
|
||
|
#define SCREEN_BUF_SIZE (SCREEN_BYTES_PER_LINE * SCREEN_HEIGHT)
|
||
|
|
||
|
typedef struct
|
||
|
{
|
||
|
uint8_t header[2];
|
||
|
union {
|
||
|
uint8_t pixels[SCREEN_BYTES_PER_LINE];
|
||
|
uint16_t pixels_u16[SCREEN_BYTES_PER_LINE / 2];
|
||
|
};
|
||
|
} ScreenLine;
|
||
|
|
||
|
typedef struct
|
||
|
{
|
||
|
ScreenLine lines[SCREEN_HEIGHT];
|
||
|
uint16_t dummy;
|
||
|
} Screen;
|
||
|
|
||
|
// Data structures for lcd_test pattern creation
|
||
|
typedef struct _LCDTestLine {
|
||
|
uint8_t pixels[SCREEN_BYTES_PER_LINE];
|
||
|
} LCDTestLine;
|
||
|
|
||
|
typedef struct _LCDTestScreen {
|
||
|
LCDTestLine lines[SCREEN_HEIGHT];
|
||
|
} LCDTestScreen;
|
||
|
|
||
|
void lcd_init(void);
|
||
|
void lcd_deinit(void);
|
||
|
void lcd_clear(bool invert);
|
||
|
void lcd_update(uint8_t* screen_data, bool invert);
|
||
|
void lcd_show_busy_bar();
|
||
|
void lcd_test(void);
|
||
|
#endif /* __LCD_H__ */
|