void ks0066WriteString(char *string) { while(*string) ks0066WriteData(*string++); return; }
static void lcdGenLevels(void) { if (userSybmols != LCD_LEVELS) { /* Generate 7 level symbols */ userSybmols = LCD_LEVELS; uint8_t i, j; ks0066StartSym(0); for (i = 0; i < 7; i++) for (j = 0; j < 8; j++) if (i + j >= 7) ks0066WriteData(0xFF); else ks0066WriteData(0x00); } return; }
static void lcdGenBar(uint8_t sym) { static const uint8_t bar[] PROGMEM = { 0b00000, 0b10000, 0b10100, 0b10101, 0b00101, 0b00001, }; static const uint8_t speakerIcon[] PROGMEM = { 0b00001, 0b00011, 0b11101, 0b10101, 0b11101, 0b00011, 0b00001, 0b00000, }; static const uint8_t loudnessIcon[] PROGMEM = { 0b00000, 0b10000, 0b10001, 0b10101, 0b10101, 0b10101, 0b10101, 0b00000, }; static const uint8_t surroundIcon[] PROGMEM = { 0b01010, 0b10001, 0b10101, 0b10101, 0b10101, 0b10001, 0b01010, 0b00000, }; static const uint8_t effect3dIcon[] PROGMEM = { 0b01110, 0b10001, 0b00000, 0b01110, 0b00000, 0b10001, 0b01110, 0b00000, }; static const uint8_t toneDefeatIcon[] PROGMEM = { 0b01000, 0b10101, 0b00010, 0b00000, 0b11111, 0b00000, 0b11111, 0b00000, }; static const uint8_t stereoIcon[] PROGMEM = { 0b00000, 0b11011, 0b10101, 0b10101, 0b10101, 0b11011, 0b00000, 0b00000, }; static const uint8_t crossIcon[] PROGMEM = { 0b00000, 0b10001, 0b01010, 0b00100, 0b01010, 0b10001, 0b00000, 0b00000, }; static const uint8_t degreeIcon[] PROGMEM = { 0b00110, 0b01001, 0b01001, 0b00110, 0b00000, 0b00000, 0b00000, 0b00000, }; uint8_t i; if (userSybmols != LCD_BAR || userAddSym != sym) { /* Generate main 6 bar symbols */ userSybmols = LCD_BAR; ks0066StartSym(0); for (i = 0; i < 48; i++) { if ((i & 0x07) == 0x03) { ks0066WriteData(0x15); } else if ((i & 0x07) == 0x07) { ks0066WriteData(0x00); } else { ks0066WriteData(pgm_read_byte(&bar[i>>3])); } } /* Generate two additional symbols */ userAddSym = sym; switch (sym) { case SYM_MUTE_CROSS: for (i = 0; i < 8; i++) ks0066WriteData(pgm_read_byte(&speakerIcon[i])); for (i = 0; i < 8; i++) ks0066WriteData(pgm_read_byte(&crossIcon[i])); break; case SYM_LOUDNESS_CROSS: for (i = 0; i < 8; i++) ks0066WriteData(pgm_read_byte(&loudnessIcon[i])); for (i = 0; i < 8; i++) ks0066WriteData(pgm_read_byte(&crossIcon[i])); break; case SYM_SURROUND_CROSS: for (i = 0; i < 8; i++) ks0066WriteData(pgm_read_byte(&surroundIcon[i])); for (i = 0; i < 8; i++) ks0066WriteData(pgm_read_byte(&crossIcon[i])); break; case SYM_EFFECT_3D_CROSS: for (i = 0; i < 8; i++) ks0066WriteData(pgm_read_byte(&effect3dIcon[i])); for (i = 0; i < 8; i++) ks0066WriteData(pgm_read_byte(&crossIcon[i])); break; case SYM_TONE_DEFEAT_CROSS: for (i = 0; i < 8; i++) ks0066WriteData(pgm_read_byte(&toneDefeatIcon[i])); for (i = 0; i < 8; i++) ks0066WriteData(pgm_read_byte(&crossIcon[i])); break; default: for (i = 0; i < 8; i++) ks0066WriteData(pgm_read_byte(&stereoIcon[i])); for (i = 0; i < 8; i++) ks0066WriteData(pgm_read_byte(°reeIcon[i])); break; } }