19#define ABS(x) ((x) > 0 ? (x) : -(x))
102#if (ST7567_MODEL == ST7567_MODEL_ST7565)
196 for (j = 0; j < font->
bytes; j++)
199 if (font->
order == 0)
201 for (k = 0; k < 8 && k < font->
width - j * 8; k++)
215 for (k = 0; k < 8 && k < font->
width - j * 8; k++)
217 if (b & (0x0001 << k))
259 int16_t dx, dy, sx, sy, err, e2,
i, tmp;
279 dx = (x0 < x1) ? (x1 - x0) : (x0 - x1);
280 dy = (y0 < y1) ? (y1 - y0) : (y0 - y1);
281 sx = (x0 < x1) ? 1 : -1;
282 sy = (y0 < y1) ? 1 : -1;
283 err = ((dx > dy) ? dx : -dy) / 2;
302 for (
i = y0;
i <= y1;
i++)
328 for (
i = x0;
i <= x1;
i++)
340 if (x0 == x1 && y0 == y1)
3590x00, 0x00, 0x00, 0x00, 0x00,
3600x02, 0x02, 0x02, 0x00, 0x02,
3610x05, 0x05, 0x00, 0x00, 0x00,
3620x05, 0x07, 0x05, 0x07, 0x05,
3630x06, 0x03, 0x06, 0x03, 0x02,
3640x01, 0x04, 0x02, 0x01, 0x04,
3650x03, 0x03, 0x07, 0x05, 0x06,
3660x02, 0x02, 0x00, 0x00, 0x00,
3670x04, 0x02, 0x02, 0x02, 0x04,
3680x01, 0x02, 0x02, 0x02, 0x01,
3690x05, 0x02, 0x05, 0x00, 0x00,
3700x00, 0x02, 0x07, 0x02, 0x00,
3710x00, 0x00, 0x00, 0x02, 0x01,
3720x00, 0x00, 0x07, 0x00, 0x00,
3730x00, 0x00, 0x00, 0x00, 0x02,
3740x00, 0x04, 0x02, 0x01, 0x00,
3750x07, 0x05, 0x05, 0x05, 0x07,
3760x02, 0x03, 0x02, 0x02, 0x07,
3770x07, 0x04, 0x07, 0x01, 0x07,
3780x07, 0x04, 0x06, 0x04, 0x07,
3790x05, 0x05, 0x07, 0x04, 0x04,
3800x07, 0x01, 0x07, 0x04, 0x07,
3810x07, 0x01, 0x07, 0x05, 0x07,
3820x07, 0x04, 0x04, 0x04, 0x04,
3830x07, 0x05, 0x07, 0x05, 0x07,
3840x07, 0x05, 0x07, 0x04, 0x07,
3850x00, 0x02, 0x00, 0x02, 0x00,
3860x00, 0x02, 0x00, 0x02, 0x01,
3870x04, 0x02, 0x01, 0x02, 0x04,
3880x00, 0x07, 0x00, 0x07, 0x00,
3890x01, 0x02, 0x04, 0x02, 0x01,
3900x07, 0x04, 0x02, 0x00, 0x02,
3910x02, 0x05, 0x07, 0x01, 0x06,
3920x02, 0x05, 0x07, 0x05, 0x05,
3930x03, 0x05, 0x03, 0x05, 0x03,
3940x06, 0x01, 0x01, 0x01, 0x06,
3950x03, 0x05, 0x05, 0x05, 0x03,
3960x07, 0x01, 0x07, 0x01, 0x07,
3970x07, 0x01, 0x07, 0x01, 0x01,
3980x06, 0x01, 0x07, 0x05, 0x06,
3990x05, 0x05, 0x07, 0x05, 0x05,
4000x07, 0x02, 0x02, 0x02, 0x07,
4010x04, 0x04, 0x04, 0x05, 0x02,
4020x05, 0x05, 0x03, 0x05, 0x05,
4030x01, 0x01, 0x01, 0x01, 0x07,
4040x05, 0x07, 0x07, 0x05, 0x05,
4050x05, 0x07, 0x07, 0x07, 0x05,
4060x02, 0x05, 0x05, 0x05, 0x02,
4070x03, 0x05, 0x03, 0x01, 0x01,
4080x02, 0x05, 0x05, 0x05, 0x06,
4090x03, 0x05, 0x07, 0x03, 0x05,
4100x06, 0x01, 0x02, 0x04, 0x03,
4110x07, 0x02, 0x02, 0x02, 0x02,
4120x05, 0x05, 0x05, 0x05, 0x02,
4130x05, 0x05, 0x05, 0x02, 0x02,
4140x05, 0x05, 0x07, 0x07, 0x05,
4150x05, 0x05, 0x02, 0x05, 0x05,
4160x05, 0x05, 0x02, 0x02, 0x02,
4170x07, 0x04, 0x02, 0x01, 0x07,
4180x03, 0x01, 0x01, 0x01, 0x03,
4190x00, 0x01, 0x02, 0x04, 0x00,
4200x06, 0x04, 0x04, 0x04, 0x06,
4210x02, 0x05, 0x00, 0x00, 0x00,
4220x00, 0x00, 0x00, 0x00, 0x07,
4230x01, 0x02, 0x00, 0x00, 0x00,
4240x00, 0x03, 0x06, 0x05, 0x07,
4250x01, 0x03, 0x05, 0x05, 0x03,
4260x00, 0x06, 0x01, 0x01, 0x06,
4270x04, 0x06, 0x05, 0x05, 0x06,
4280x00, 0x06, 0x05, 0x03, 0x06,
4290x04, 0x02, 0x07, 0x02, 0x02,
4300x06, 0x05, 0x07, 0x04, 0x02,
4310x01, 0x03, 0x05, 0x05, 0x05,
4320x02, 0x00, 0x02, 0x02, 0x02,
4330x04, 0x00, 0x04, 0x04, 0x03,
4340x01, 0x05, 0x03, 0x03, 0x05,
4350x03, 0x02, 0x02, 0x02, 0x07,
4360x00, 0x07, 0x07, 0x07, 0x05,
4370x00, 0x03, 0x05, 0x05, 0x05,
4380x00, 0x02, 0x05, 0x05, 0x02,
4390x00, 0x03, 0x05, 0x03, 0x01,
4400x00, 0x06, 0x05, 0x06, 0x04,
4410x00, 0x06, 0x01, 0x01, 0x01,
4420x00, 0x06, 0x03, 0x06, 0x03,
4430x02, 0x07, 0x02, 0x02, 0x06,
4440x00, 0x05, 0x05, 0x05, 0x06,
4450x00, 0x05, 0x05, 0x05, 0x02,
4460x00, 0x05, 0x07, 0x07, 0x07,
4470x00, 0x05, 0x02, 0x02, 0x05,
4480x00, 0x05, 0x06, 0x04, 0x06,
4490x00, 0x07, 0x06, 0x03, 0x07,
4500x06, 0x02, 0x01, 0x02, 0x06,
4510x02, 0x02, 0x02, 0x02, 0x02,
4520x03, 0x02, 0x04, 0x02, 0x03,
4530x00, 0x06, 0x03, 0x00, 0x00,
4540x07, 0x07, 0x07, 0x07, 0x07,
4580x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4590x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x00,
4600x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00,
4610x0a, 0x0a, 0x1f, 0x0a, 0x1f, 0x0a, 0x0a,
4620x04, 0x1e, 0x05, 0x0e, 0x14, 0x0f, 0x04,
4630x00, 0x19, 0x1a, 0x04, 0x0b, 0x13, 0x00,
4640x06, 0x09, 0x05, 0x02, 0x15, 0x09, 0x16,
4650x06, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00,
4660x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08,
4670x02, 0x04, 0x08, 0x08, 0x08, 0x04, 0x02,
4680x00, 0x04, 0x15, 0x0e, 0x15, 0x04, 0x00,
4690x00, 0x04, 0x04, 0x1f, 0x04, 0x04, 0x00,
4700x00, 0x00, 0x00, 0x00, 0x0c, 0x08, 0x04,
4710x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00,
4720x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06,
4730x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00,
4740x0e, 0x11, 0x19, 0x15, 0x13, 0x11, 0x0e,
4750x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x0e,
4760x0e, 0x11, 0x10, 0x08, 0x04, 0x02, 0x1f,
4770x1f, 0x08, 0x04, 0x08, 0x10, 0x11, 0x0e,
4780x08, 0x0c, 0x0a, 0x09, 0x1f, 0x08, 0x08,
4790x1f, 0x01, 0x0f, 0x10, 0x10, 0x11, 0x0e,
4800x0c, 0x02, 0x01, 0x0f, 0x11, 0x11, 0x0e,
4810x1f, 0x10, 0x08, 0x04, 0x02, 0x02, 0x02,
4820x0e, 0x11, 0x11, 0x0e, 0x11, 0x11, 0x0e,
4830x0e, 0x11, 0x11, 0x1e, 0x10, 0x08, 0x06,
4840x00, 0x06, 0x06, 0x00, 0x06, 0x06, 0x00,
4850x00, 0x06, 0x06, 0x00, 0x06, 0x04, 0x02,
4860x08, 0x04, 0x02, 0x01, 0x02, 0x04, 0x08,
4870x00, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x00,
4880x02, 0x04, 0x08, 0x10, 0x08, 0x04, 0x02,
4890x0e, 0x11, 0x10, 0x08, 0x04, 0x00, 0x04,
4900x0e, 0x11, 0x10, 0x16, 0x1d, 0x11, 0x0e,
4910x0e, 0x11, 0x11, 0x11, 0x1f, 0x11, 0x11,
4920x0f, 0x11, 0x11, 0x0f, 0x11, 0x11, 0x0f,
4930x0e, 0x11, 0x01, 0x01, 0x01, 0x11, 0x0e,
4940x07, 0x09, 0x11, 0x11, 0x11, 0x09, 0x07,
4950x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x1f,
4960x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x01,
4970x0e, 0x11, 0x01, 0x1d, 0x11, 0x11, 0x1e,
4980x11, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11,
4990x0e, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e,
5000x1c, 0x08, 0x08, 0x08, 0x08, 0x09, 0x06,
5010x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11,
5020x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f,
5030x11, 0x1b, 0x15, 0x15, 0x11, 0x11, 0x11,
5040x11, 0x11, 0x13, 0x15, 0x19, 0x11, 0x11,
5050x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e,
5060x0f, 0x11, 0x11, 0x0f, 0x01, 0x01, 0x01,
5070x0e, 0x11, 0x11, 0x11, 0x15, 0x09, 0x16,
5080x0f, 0x11, 0x11, 0x0f, 0x05, 0x09, 0x11,
5090x1e, 0x01, 0x01, 0x0e, 0x10, 0x10, 0x0f,
5100x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
5110x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e,
5120x11, 0x11, 0x11, 0x11, 0x11, 0x0a, 0x04,
5130x11, 0x11, 0x11, 0x15, 0x15, 0x15, 0x0a,
5140x11, 0x11, 0x0a, 0x04, 0x0a, 0x11, 0x11,
5150x11, 0x11, 0x11, 0x0a, 0x04, 0x04, 0x04,
5160x1f, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f,
5170x0e, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0e,
5180x15, 0x0a, 0x15, 0x0a, 0x15, 0x0a, 0x15,
5190x0e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0e,
5200x04, 0x0a, 0x11, 0x00, 0x00, 0x00, 0x00,
5210x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f,
5220x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00,
5230x00, 0x00, 0x0e, 0x10, 0x1e, 0x11, 0x1e,
5240x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x0f,
5250x00, 0x00, 0x0e, 0x01, 0x01, 0x11, 0x0e,
5260x10, 0x10, 0x16, 0x19, 0x11, 0x11, 0x1e,
5270x00, 0x00, 0x0e, 0x11, 0x1f, 0x01, 0x0e,
5280x0c, 0x12, 0x02, 0x07, 0x02, 0x02, 0x02,
5290x00, 0x1e, 0x11, 0x11, 0x1e, 0x10, 0x0e,
5300x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x11,
5310x04, 0x00, 0x06, 0x04, 0x04, 0x04, 0x0e,
5320x08, 0x00, 0x0c, 0x08, 0x08, 0x09, 0x06,
5330x01, 0x01, 0x09, 0x05, 0x03, 0x05, 0x09,
5340x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e,
5350x00, 0x00, 0x0b, 0x15, 0x15, 0x11, 0x11,
5360x00, 0x00, 0x0d, 0x13, 0x11, 0x11, 0x11,
5370x00, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e,
5380x00, 0x00, 0x0f, 0x11, 0x0f, 0x01, 0x01,
5390x00, 0x00, 0x16, 0x19, 0x1e, 0x10, 0x10,
5400x00, 0x00, 0x0d, 0x13, 0x01, 0x01, 0x01,
5410x00, 0x00, 0x0e, 0x01, 0x0e, 0x10, 0x0f,
5420x02, 0x02, 0x07, 0x02, 0x02, 0x12, 0x0c,
5430x00, 0x00, 0x11, 0x11, 0x11, 0x19, 0x16,
5440x00, 0x00, 0x11, 0x11, 0x11, 0x0a, 0x04,
5450x00, 0x00, 0x11, 0x11, 0x15, 0x15, 0x0a,
5460x00, 0x00, 0x11, 0x0a, 0x04, 0x0a, 0x11,
5470x00, 0x00, 0x11, 0x11, 0x1e, 0x10, 0x0e,
5480x00, 0x00, 0x1f, 0x08, 0x04, 0x02, 0x1f,
5490x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08,
5500x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
5510x02, 0x04, 0x04, 0x08, 0x04, 0x04, 0x02,
5520x00, 0x00, 0x02, 0x15, 0x08, 0x00, 0x00,
5530x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x00,
uint8_t SPI_TxRx(uint8_t dat)
void SYS_Delay(uint16_t t)
uint8_t val[MAX7219_BLOCKS]
void ST7567_SetContrast(uint8_t val)
Turn ST7567 LCD backlight off.
void ST7567_WriteCommand(uint8_t command)
Write a single byte command to ST7567.
void ST7567_GotoXY(uint16_t x, uint16_t y)
Sets cursor pointer to desired location for strings.
void ST7567_WriteSameData(uint8_t dat, uint32_t size)
void ST7567_Fill(uint8_t color)
Fills entire LCD with specified color.
static __XDATA uint8_t ST7567_Buffer_all[ST7567_WIDTH *ST7567_PAGES]
void ST7567_SetPowerSaveMode(HAL_State_t state)
Powersave mode control.
static __CODE uint8_t Font3x5[]
void ST7567_DrawPixel(uint8_t x, uint8_t y, uint8_t color)
Draws pixel at desired location.
void ST7567_DrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t c)
Draws line on LCD.
void ST7567_ToggleInvert(void)
Toggles pixels invertion inside internal RAM.
char ST7567_Puts(char *str, FontDef_t *Font, uint8_t color)
Puts string to internal RAM.
static void ST7567_Transmit(const uint8_t *pDat, uint32_t size)
__BIT ST7567_colorInverted
void ST7567_Reset(void)
Hardware reset ST7567 LCD.
static __CODE uint8_t Font5x7[]
void ST7567_SetBackLightState(HAL_State_t state)
Turn ST7567 LCD backlight on or off.
void ST7567_Init(void)
Initializes ST7567 LCD.
void ST7567_WriteData(uint8_t dat)
Write a single byte data to ST7567.
__CODE FontDef_t Font_5x7
char ST7567_Putc(char ch, FontDef_t *font, uint8_t color)
Puts character to internal RAM.
__CODE FontDef_t Font_3x5
void ST7567_UpdateScreen(void)
Update LCD display with buffer changes.
#define ST7567_DISPLAY_ON
#define ST7567_REGULATION_RATIO_5_0
#define ST7567_INVERSE_DISPLAY_ON
#define ST7567_POWER_CONTROL
#define ST7567_POWER_CONTROL_VR
#define ST7567_SET_PAGE_ADDRESS
#define ST7567_COLOR_FRONT
#define ST7567_SET_START_LINE_MASK
#define ST7567_REGULATION_RATIO
#define ST7567_SET_PAGE_ADDRESS_MASK
#define ST7567_ALL_PIXEL_NORMAL
#define ST7567_SET_COLUMN_ADDRESS_MSB
#define ST7567_POWER_CONTROL_VF
#define ST7567_SET_COLUMN_ADDRESS_MSB_MASK
#define ST7567_DISPLAY_OFF
#define ST7567_ALL_PIXEL_ON
#define ST7567_SET_EV_MASK
#define ST7567_SET_COLUMN_ADDRESS_LSB_MASK
#define ST7567_POWER_CONTROL_VB
#define ST7567_COLOR_BACK
#define ST7567_SET_START_LINE
#define ST7567_INVERSE_DISPLAY_OFF
#define ST7567_SET_COLUMN_ADDRESS_LSB