Prusa MINI Firmware overview
|
#include "lcdsim.h"
#include <string.h>
#include "dbg.h"
◆ LCD_DDRAM_SIZE
#define LCD_DDRAM_SIZE 0x80 |
◆ LCD_CGRAM_SIZE
#define LCD_CGRAM_SIZE 0x40 |
◆ LCD_CMD_CLEARDISPLAY
#define LCD_CMD_CLEARDISPLAY 0x01 |
◆ LCD_CMD_RETURNHOME
#define LCD_CMD_RETURNHOME 0x02 |
◆ LCD_CMD_ENTRYMODESET
#define LCD_CMD_ENTRYMODESET 0x04 |
◆ LCD_CMD_DISPLAYCONTROL
#define LCD_CMD_DISPLAYCONTROL 0x08 |
◆ LCD_CMD_CURSORSHIFT
#define LCD_CMD_CURSORSHIFT 0x10 |
◆ LCD_CMD_FUNCTIONSET
#define LCD_CMD_FUNCTIONSET 0x20 |
◆ LCD_CMD_SETCGRAMADDR
#define LCD_CMD_SETCGRAMADDR 0x40 |
◆ LCD_CMD_SETDDRAMADDR
#define LCD_CMD_SETDDRAMADDR 0x80 |
◆ LCD_FLG_FUNC8BIT
#define LCD_FLG_FUNC8BIT 0x10 |
◆ LCD_FLG_FUNC2LINE
#define LCD_FLG_FUNC2LINE 0x08 |
◆ LCD_FLG_FUNC10DOTS
#define LCD_FLG_FUNC10DOTS 0x04 |
◆ LCD_FLG_SHIFTDISPLAY
#define LCD_FLG_SHIFTDISPLAY 0x08 |
◆ LCD_FLG_SHIFTRIGHT
#define LCD_FLG_SHIFTRIGHT 0x04 |
◆ LCD_FLG_DISPLAYON
#define LCD_FLG_DISPLAYON 0x04 |
◆ LCD_FLG_CURSORON
#define LCD_FLG_CURSORON 0x02 |
◆ LCD_FLG_BLINKON
#define LCD_FLG_BLINKON 0x01 |
◆ LCD_FLG_ENTRYLEFT
#define LCD_FLG_ENTRYLEFT 0x01 |
◆ LCD_FLG_ENTRYSHIFTINC
#define LCD_FLG_ENTRYSHIFTINC 0x02 |
◆ LCD_EXPANDER_RS
#define LCD_EXPANDER_RS 0x01 |
◆ LCD_EXPANDER_RW
#define LCD_EXPANDER_RW 0x02 |
◆ LCD_EXPANDER_EN
#define LCD_EXPANDER_EN 0x04 |
◆ LCD_EXPANDER_BL
#define LCD_EXPANDER_BL 0x08 |
◆ lcdsim_cmd_clearDisplay()
◆ lcdsim_addr2row()
60 return ((addr & 0x40) >> 6) | (((addr & 0x3f) >= 0x14) ? 2 : 0);
◆ lcdsim_addr2col()
64 return (addr & 0x3f) % 20;
◆ lcdsim_pos2addr()
68 return lcdsim_row_addr[row & 0x03] + (col % 20);
◆ lcdsim_init()
◆ lcdsim_invalidate()
81 for (
i = 0;
i < 4;
i++)
◆ lcdsim_char_at()
◆ lcdsim_user_charset_ptr()
◆ lcdsim_grab_text()
uint16_t lcdsim_grab_text |
( |
char * |
text | ) |
|
97 for (row = 0; row < 4; row++) {
98 for (col = 0; col < 20; col++)
100 for (col = 19; col >= 0; col--)
101 if (text[
i + col] !=
' ')
◆ lcdsim_cmd_setDDRamAddr()
void lcdsim_cmd_setDDRamAddr |
( |
int8_t |
addr | ) |
|
◆ lcdsim_cmd_setCGRamAddr()
void lcdsim_cmd_setCGRamAddr |
( |
int8_t |
addr | ) |
|
◆ lcdsim_cmd_functionSet()
void lcdsim_cmd_functionSet |
( |
int |
func8bit, |
|
|
int |
func2line, |
|
|
int |
func10dots |
|
) |
| |
◆ lcdsim_cmd_cursorShift()
void lcdsim_cmd_cursorShift |
( |
int |
shiftDisplay, |
|
|
int |
shiftRight |
|
) |
| |
◆ lcdsim_cmd_displayControl()
void lcdsim_cmd_displayControl |
( |
int |
displayOn, |
|
|
int |
cursorOn, |
|
|
int |
blinkOn |
|
) |
| |
◆ lcdsim_cmd_entryModeSet()
void lcdsim_cmd_entryModeSet |
( |
int |
entryLeft, |
|
|
int |
entryShiftInc |
|
) |
| |
◆ lcdsim_cmd_returnHome()
◆ lcdsim_wr_cmd()
◆ lcdsim_wr_data()
◆ lcdsim_expander_write()
214 d0_7 = (d4_7 & 0xf0) | (expander >> 4);
221 d4_7 = expander | 0x0f;
◆ lcdsim_expander
◆ lcdsim_ddram
◆ lcdsim_cgram
◆ lcdsim_ddram_addr
◆ lcdsim_cgram_addr
◆ lcdsim_inval_mask
uint32_t lcdsim_inval_mask[LCDSIM_ROWS] |
◆ lcdsim_shift
◆ lcdsim_func8bit
◆ lcdsim_func2line
◆ lcdsim_func10dots
int lcdsim_func10dots = 1 |
◆ lcdsim_displayOn
◆ lcdsim_cursorOn
◆ lcdsim_blinkOn
◆ lcdsim_entryLeft
◆ lcdsim_entryShiftInc
int lcdsim_entryShiftInc = 0 |
#define LCD_CMD_DISPLAYCONTROL
Definition: lcdsim.c:12
#define LCD_FLG_BLINKON
Definition: lcdsim.c:25
int lcdsim_blinkOn
Definition: lcdsim.c:53
#define LCD_CMD_RETURNHOME
Definition: lcdsim.c:10
void lcdsim_cmd_setDDRamAddr(int8_t addr)
Definition: lcdsim.c:110
int lcdsim_func2line
Definition: lcdsim.c:49
#define LCD_FLG_ENTRYSHIFTINC
Definition: lcdsim.c:27
uint8_t lcdsim_char_at(uint8_t col, uint8_t row)
Definition: lcdsim.c:85
#define LCD_FLG_FUNC8BIT
Definition: lcdsim.c:18
static uint8_t lcdsim_addr2col(uint8_t addr)
Definition: lcdsim.c:63
void lcdsim_cmd_returnHome(void)
Definition: lcdsim.c:147
uint8_t data[8]
Definition: masstorage.h:49
#define LCD_DDRAM_SIZE
Definition: lcdsim.c:6
#define LCD_FLG_ENTRYLEFT
Definition: lcdsim.c:26
#define LCD_CMD_ENTRYMODESET
Definition: lcdsim.c:11
uint8_t i
Definition: screen_test_graph.c:72
uint8_t lcdsim_expander
Definition: lcdsim.c:34
uint8_t lcdsim_ddram[LCD_DDRAM_SIZE]
Definition: lcdsim.c:36
#define LCD_CMD_CLEARDISPLAY
Definition: lcdsim.c:9
int lcdsim_entryShiftInc
Definition: lcdsim.c:55
void lcdsim_cmd_setCGRamAddr(int8_t addr)
Definition: lcdsim.c:115
#define LCD_FLG_SHIFTDISPLAY
Definition: lcdsim.c:21
uint32_t lcdsim_inval_mask[LCDSIM_ROWS]
Definition: lcdsim.c:40
void lcdsim_invalidate(void)
Definition: lcdsim.c:79
void lcdsim_cmd_displayControl(int displayOn, int cursorOn, int blinkOn)
Definition: lcdsim.c:136
int8_t lcdsim_ddram_addr
Definition: lcdsim.c:38
int lcdsim_func8bit
Definition: lcdsim.c:48
void lcdsim_cmd_functionSet(int func8bit, int func2line, int func10dots)
Definition: lcdsim.c:119
void lcdsim_wr_data(uint8_t data)
Definition: lcdsim.c:184
#define LCD_CMD_CURSORSHIFT
Definition: lcdsim.c:13
#define LCD_FLG_SHIFTRIGHT
Definition: lcdsim.c:22
#define LCD_EXPANDER_RS
Definition: lcdsim.c:29
int8_t lcdsim_cgram_addr
Definition: lcdsim.c:39
#define LCD_CGRAM_SIZE
Definition: lcdsim.c:7
int lcdsim_entryLeft
Definition: lcdsim.c:54
void lcdsim_cmd_cursorShift(int shiftDisplay, int shiftRight)
Definition: lcdsim.c:125
int8_t lcdsim_shift
Definition: lcdsim.c:46
int lcdsim_func10dots
Definition: lcdsim.c:50
uint8_t lcdsim_cgram[LCD_CGRAM_SIZE]
Definition: lcdsim.c:37
#define LCD_CMD_FUNCTIONSET
Definition: lcdsim.c:14
#define LCD_CMD_SETDDRAMADDR
Definition: lcdsim.c:16
const uint8_t[]
Definition: 404_html.c:3
static uint8_t lcdsim_addr2row(uint8_t addr)
Definition: lcdsim.c:59
int lcdsim_cursorOn
Definition: lcdsim.c:52
#define LCD_FLG_FUNC2LINE
Definition: lcdsim.c:19
#define LCD_FLG_DISPLAYON
Definition: lcdsim.c:23
void lcdsim_cmd_clearDisplay(void)
Definition: lcdsim.c:153
#define LCD_CMD_SETCGRAMADDR
Definition: lcdsim.c:15
static uint8_t lcdsim_pos2addr(uint8_t col, uint8_t row)
Definition: lcdsim.c:67
void lcdsim_wr_cmd(uint8_t cmd)
Definition: lcdsim.c:165
#define LCD_FLG_FUNC10DOTS
Definition: lcdsim.c:20
int lcdsim_displayOn
Definition: lcdsim.c:51
#define LCD_EXPANDER_EN
Definition: lcdsim.c:31
void lcdsim_cmd_entryModeSet(int entryLeft, int entryShiftInc)
Definition: lcdsim.c:142