179 int16_t dx, dy, sx, sy, err, e2,
i, tmp;
199 dx = (x0 < x1) ? (x1 - x0) : (x0 - x1);
200 dy = (y0 < y1) ? (y1 - y0) : (y0 - y1);
201 sx = (x0 < x1) ? 1 : -1;
202 sy = (y0 < y1) ? 1 : -1;
203 err = ((dx > dy) ? dx : -dy) / 2;
222 for (
i = y0;
i <= y1;
i++)
246 for (
i = x0;
i <= x1;
i++)
256 if (x0 == x1 && y0 == y1)
287 for (j = 0; j < font->
bytes; j++)
290 if (font->
order == 0)
292 for (k = 0; k < 8 && k < font->
width - j * 8; k++)
306 for (k = 0; k < 8 && k < font->
width - j * 8; k++)
308 if (b & (0x0001 << k))
3500x00, 0x00, 0x00, 0x00, 0x00,
3510x02, 0x02, 0x02, 0x00, 0x02,
3520x05, 0x05, 0x00, 0x00, 0x00,
3530x05, 0x07, 0x05, 0x07, 0x05,
3540x06, 0x03, 0x06, 0x03, 0x02,
3550x01, 0x04, 0x02, 0x01, 0x04,
3560x03, 0x03, 0x07, 0x05, 0x06,
3570x02, 0x02, 0x00, 0x00, 0x00,
3580x04, 0x02, 0x02, 0x02, 0x04,
3590x01, 0x02, 0x02, 0x02, 0x01,
3600x05, 0x02, 0x05, 0x00, 0x00,
3610x00, 0x02, 0x07, 0x02, 0x00,
3620x00, 0x00, 0x00, 0x02, 0x01,
3630x00, 0x00, 0x07, 0x00, 0x00,
3640x00, 0x00, 0x00, 0x00, 0x02,
3650x00, 0x04, 0x02, 0x01, 0x00,
3660x07, 0x05, 0x05, 0x05, 0x07,
3670x02, 0x03, 0x02, 0x02, 0x07,
3680x07, 0x04, 0x07, 0x01, 0x07,
3690x07, 0x04, 0x06, 0x04, 0x07,
3700x05, 0x05, 0x07, 0x04, 0x04,
3710x07, 0x01, 0x07, 0x04, 0x07,
3720x07, 0x01, 0x07, 0x05, 0x07,
3730x07, 0x04, 0x04, 0x04, 0x04,
3740x07, 0x05, 0x07, 0x05, 0x07,
3750x07, 0x05, 0x07, 0x04, 0x07,
3760x00, 0x02, 0x00, 0x02, 0x00,
3770x00, 0x02, 0x00, 0x02, 0x01,
3780x04, 0x02, 0x01, 0x02, 0x04,
3790x00, 0x07, 0x00, 0x07, 0x00,
3800x01, 0x02, 0x04, 0x02, 0x01,
3810x07, 0x04, 0x02, 0x00, 0x02,
3820x02, 0x05, 0x07, 0x01, 0x06,
3830x02, 0x05, 0x07, 0x05, 0x05,
3840x03, 0x05, 0x03, 0x05, 0x03,
3850x06, 0x01, 0x01, 0x01, 0x06,
3860x03, 0x05, 0x05, 0x05, 0x03,
3870x07, 0x01, 0x07, 0x01, 0x07,
3880x07, 0x01, 0x07, 0x01, 0x01,
3890x06, 0x01, 0x07, 0x05, 0x06,
3900x05, 0x05, 0x07, 0x05, 0x05,
3910x07, 0x02, 0x02, 0x02, 0x07,
3920x04, 0x04, 0x04, 0x05, 0x02,
3930x05, 0x05, 0x03, 0x05, 0x05,
3940x01, 0x01, 0x01, 0x01, 0x07,
3950x05, 0x07, 0x07, 0x05, 0x05,
3960x05, 0x07, 0x07, 0x07, 0x05,
3970x02, 0x05, 0x05, 0x05, 0x02,
3980x03, 0x05, 0x03, 0x01, 0x01,
3990x02, 0x05, 0x05, 0x05, 0x06,
4000x03, 0x05, 0x07, 0x03, 0x05,
4010x06, 0x01, 0x02, 0x04, 0x03,
4020x07, 0x02, 0x02, 0x02, 0x02,
4030x05, 0x05, 0x05, 0x05, 0x02,
4040x05, 0x05, 0x05, 0x02, 0x02,
4050x05, 0x05, 0x07, 0x07, 0x05,
4060x05, 0x05, 0x02, 0x05, 0x05,
4070x05, 0x05, 0x02, 0x02, 0x02,
4080x07, 0x04, 0x02, 0x01, 0x07,
4090x03, 0x01, 0x01, 0x01, 0x03,
4100x00, 0x01, 0x02, 0x04, 0x00,
4110x06, 0x04, 0x04, 0x04, 0x06,
4120x02, 0x05, 0x00, 0x00, 0x00,
4130x00, 0x00, 0x00, 0x00, 0x07,
4140x01, 0x02, 0x00, 0x00, 0x00,
4150x00, 0x03, 0x06, 0x05, 0x07,
4160x01, 0x03, 0x05, 0x05, 0x03,
4170x00, 0x06, 0x01, 0x01, 0x06,
4180x04, 0x06, 0x05, 0x05, 0x06,
4190x00, 0x06, 0x05, 0x03, 0x06,
4200x04, 0x02, 0x07, 0x02, 0x02,
4210x06, 0x05, 0x07, 0x04, 0x02,
4220x01, 0x03, 0x05, 0x05, 0x05,
4230x02, 0x00, 0x02, 0x02, 0x02,
4240x04, 0x00, 0x04, 0x04, 0x03,
4250x01, 0x05, 0x03, 0x03, 0x05,
4260x03, 0x02, 0x02, 0x02, 0x07,
4270x00, 0x07, 0x07, 0x07, 0x05,
4280x00, 0x03, 0x05, 0x05, 0x05,
4290x00, 0x02, 0x05, 0x05, 0x02,
4300x00, 0x03, 0x05, 0x03, 0x01,
4310x00, 0x06, 0x05, 0x06, 0x04,
4320x00, 0x06, 0x01, 0x01, 0x01,
4330x00, 0x06, 0x03, 0x06, 0x03,
4340x02, 0x07, 0x02, 0x02, 0x06,
4350x00, 0x05, 0x05, 0x05, 0x06,
4360x00, 0x05, 0x05, 0x05, 0x02,
4370x00, 0x05, 0x07, 0x07, 0x07,
4380x00, 0x05, 0x02, 0x02, 0x05,
4390x00, 0x05, 0x06, 0x04, 0x06,
4400x00, 0x07, 0x06, 0x03, 0x07,
4410x06, 0x02, 0x01, 0x02, 0x06,
4420x02, 0x02, 0x02, 0x02, 0x02,
4430x03, 0x02, 0x04, 0x02, 0x03,
4440x00, 0x06, 0x03, 0x00, 0x00,
4450x07, 0x07, 0x07, 0x07, 0x07,
4490x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4500x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x00,
4510x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00,
4520x0a, 0x0a, 0x1f, 0x0a, 0x1f, 0x0a, 0x0a,
4530x04, 0x1e, 0x05, 0x0e, 0x14, 0x0f, 0x04,
4540x00, 0x19, 0x1a, 0x04, 0x0b, 0x13, 0x00,
4550x06, 0x09, 0x05, 0x02, 0x15, 0x09, 0x16,
4560x06, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00,
4570x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08,
4580x02, 0x04, 0x08, 0x08, 0x08, 0x04, 0x02,
4590x00, 0x04, 0x15, 0x0e, 0x15, 0x04, 0x00,
4600x00, 0x04, 0x04, 0x1f, 0x04, 0x04, 0x00,
4610x00, 0x00, 0x00, 0x00, 0x0c, 0x08, 0x04,
4620x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00,
4630x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06,
4640x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00,
4650x0e, 0x11, 0x19, 0x15, 0x13, 0x11, 0x0e,
4660x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x0e,
4670x0e, 0x11, 0x10, 0x08, 0x04, 0x02, 0x1f,
4680x1f, 0x08, 0x04, 0x08, 0x10, 0x11, 0x0e,
4690x08, 0x0c, 0x0a, 0x09, 0x1f, 0x08, 0x08,
4700x1f, 0x01, 0x0f, 0x10, 0x10, 0x11, 0x0e,
4710x0c, 0x02, 0x01, 0x0f, 0x11, 0x11, 0x0e,
4720x1f, 0x10, 0x08, 0x04, 0x02, 0x02, 0x02,
4730x0e, 0x11, 0x11, 0x0e, 0x11, 0x11, 0x0e,
4740x0e, 0x11, 0x11, 0x1e, 0x10, 0x08, 0x06,
4750x00, 0x06, 0x06, 0x00, 0x06, 0x06, 0x00,
4760x00, 0x06, 0x06, 0x00, 0x06, 0x04, 0x02,
4770x08, 0x04, 0x02, 0x01, 0x02, 0x04, 0x08,
4780x00, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x00,
4790x02, 0x04, 0x08, 0x10, 0x08, 0x04, 0x02,
4800x0e, 0x11, 0x10, 0x08, 0x04, 0x00, 0x04,
4810x0e, 0x11, 0x10, 0x16, 0x1d, 0x11, 0x0e,
4820x0e, 0x11, 0x11, 0x11, 0x1f, 0x11, 0x11,
4830x0f, 0x11, 0x11, 0x0f, 0x11, 0x11, 0x0f,
4840x0e, 0x11, 0x01, 0x01, 0x01, 0x11, 0x0e,
4850x07, 0x09, 0x11, 0x11, 0x11, 0x09, 0x07,
4860x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x1f,
4870x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x01,
4880x0e, 0x11, 0x01, 0x1d, 0x11, 0x11, 0x1e,
4890x11, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11,
4900x0e, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e,
4910x1c, 0x08, 0x08, 0x08, 0x08, 0x09, 0x06,
4920x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11,
4930x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f,
4940x11, 0x1b, 0x15, 0x15, 0x11, 0x11, 0x11,
4950x11, 0x11, 0x13, 0x15, 0x19, 0x11, 0x11,
4960x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e,
4970x0f, 0x11, 0x11, 0x0f, 0x01, 0x01, 0x01,
4980x0e, 0x11, 0x11, 0x11, 0x15, 0x09, 0x16,
4990x0f, 0x11, 0x11, 0x0f, 0x05, 0x09, 0x11,
5000x1e, 0x01, 0x01, 0x0e, 0x10, 0x10, 0x0f,
5010x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
5020x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e,
5030x11, 0x11, 0x11, 0x11, 0x11, 0x0a, 0x04,
5040x11, 0x11, 0x11, 0x15, 0x15, 0x15, 0x0a,
5050x11, 0x11, 0x0a, 0x04, 0x0a, 0x11, 0x11,
5060x11, 0x11, 0x11, 0x0a, 0x04, 0x04, 0x04,
5070x1f, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f,
5080x0e, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0e,
5090x15, 0x0a, 0x15, 0x0a, 0x15, 0x0a, 0x15,
5100x0e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0e,
5110x04, 0x0a, 0x11, 0x00, 0x00, 0x00, 0x00,
5120x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f,
5130x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00,
5140x00, 0x00, 0x0e, 0x10, 0x1e, 0x11, 0x1e,
5150x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x0f,
5160x00, 0x00, 0x0e, 0x01, 0x01, 0x11, 0x0e,
5170x10, 0x10, 0x16, 0x19, 0x11, 0x11, 0x1e,
5180x00, 0x00, 0x0e, 0x11, 0x1f, 0x01, 0x0e,
5190x0c, 0x12, 0x02, 0x07, 0x02, 0x02, 0x02,
5200x00, 0x1e, 0x11, 0x11, 0x1e, 0x10, 0x0e,
5210x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x11,
5220x04, 0x00, 0x06, 0x04, 0x04, 0x04, 0x0e,
5230x08, 0x00, 0x0c, 0x08, 0x08, 0x09, 0x06,
5240x01, 0x01, 0x09, 0x05, 0x03, 0x05, 0x09,
5250x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e,
5260x00, 0x00, 0x0b, 0x15, 0x15, 0x11, 0x11,
5270x00, 0x00, 0x0d, 0x13, 0x11, 0x11, 0x11,
5280x00, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e,
5290x00, 0x00, 0x0f, 0x11, 0x0f, 0x01, 0x01,
5300x00, 0x00, 0x16, 0x19, 0x1e, 0x10, 0x10,
5310x00, 0x00, 0x0d, 0x13, 0x01, 0x01, 0x01,
5320x00, 0x00, 0x0e, 0x01, 0x0e, 0x10, 0x0f,
5330x02, 0x02, 0x07, 0x02, 0x02, 0x12, 0x0c,
5340x00, 0x00, 0x11, 0x11, 0x11, 0x19, 0x16,
5350x00, 0x00, 0x11, 0x11, 0x11, 0x0a, 0x04,
5360x00, 0x00, 0x11, 0x11, 0x15, 0x15, 0x0a,
5370x00, 0x00, 0x11, 0x0a, 0x04, 0x0a, 0x11,
5380x00, 0x00, 0x11, 0x11, 0x1e, 0x10, 0x0e,
5390x00, 0x00, 0x1f, 0x08, 0x04, 0x02, 0x1f,
5400x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08,
5410x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
5420x02, 0x04, 0x04, 0x08, 0x04, 0x04, 0x02,
5430x00, 0x00, 0x02, 0x15, 0x08, 0x00, 0x00,
5440x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x00,
uint8_t SPI_TxRx(uint8_t dat)
void SYS_Delay(uint16_t t)
uint8_t val[MAX7219_BLOCKS]
char PCD8544_Putc(char ch, FontDef_t *font, uint8_t color)
Put one character to internal RAM.
void PCD8544_DrawPixel(uint8_t x, uint8_t y, uint8_t color)
Draws pixel at desired location.
static void PCD8544_Transmit(const uint8_t *pDat, uint32_t size)
void PCD8544_GotoXY(uint8_t x, uint8_t y)
Sets cursor pointer to desired location for strings.
void PCD8544_UpdateScreen(void)
Update LCD display with changes.
void PCD8544_SetTemperatureCoef(uint8_t val)
Set TCx (temperature coefficient)
void PCD8544_DrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t color)
Draws line on LCD.
char PCD8544_Puts(char *str, FontDef_t *Font, uint8_t color)
Puts string to internal RAM.
void PCD8544_Reset(void)
Hardware reset PCD8544 LCD.
void PCD8544_Init(void)
Initializes PCD8544 Display.
void PCD8544_SetDisplayAllOn(void)
Set PCD8544 To Turn On All Segments.
static __CODE uint8_t Font3x5[]
void PCD8544_SetDisplayInverted(void)
Set PCD8544 Display Mode to Inverted.
void PCD8544_SetBackLightState(HAL_State_t state)
Turn PCD8544 LCD backlight on or off.
void PCD8544_Fill(uint8_t color)
Fills entire LCD with specified color.
static __CODE uint8_t Font5x7[]
void PCD8544_SetContrast(uint8_t bias, uint8_t val)
Set the contrast level by adjusting Vlcd.
void PCD8544_WriteCommand(uint8_t command)
Write a single byte command to PCD8544.
void PCD8544_SetPowerDownMode(HAL_State_t state)
Powerdown mode control.
void PCD8544_SetBias(uint8_t val)
Set bias system level.
__CODE FontDef_t Font_5x7
void PCD8544_SetDisplayBlank(void)
Set PCD8544 Display Mode to Blank.
static __XDATA uint8_t PCD8544_Buffer[PCD8544_WIDTH *PCD8544_HEIGHT/8]
void PCD8544_WriteSameData(uint8_t dat, uint32_t size)
void PCD8544_SetDisplayNormal(void)
Set PCD8544 Display Mode to Normal.
void PCD8544_WriteData(uint8_t dat)
Writes single byte data to PCD8544.
__CODE FontDef_t Font_3x5
#define PCD8544_DISPLAY_NORMAL
#define PCD8544_DISPLAY_BLANK
#define PCD8544_SET_XADDR
#define PCD8544_SET_YADDR
#define PCD8544_FUNCTIONSET
#define PCD8544_EXT_INSTRUCTION
#define PCD8544_DISPLAY_ALLON
#define PCD8544_POWERDOWN
#define PCD8544_DISPLAY_CONTROL
#define PCD8544_DISPLAY_INVERTED