Merge pull request #15 from Tectu/master

Merge Tectu Changes
ugfx_release_2.6
Andrew Hannam 2013-01-18 05:12:09 -08:00
commit 333fcad87f
4 changed files with 41 additions and 31 deletions

View File

@ -115,6 +115,39 @@ void tdisp_lld_home(void) {
tdisp_lld_write_cmd(0x02); tdisp_lld_write_cmd(0x02);
} }
void tdisp_lld_control(uint16_t what, void *value) {
(void)what;
(void)value;
/*
switch(attributes) {
case TDISP_ON:
_displaycontrol |= 0x04;
tdisp_lld_write_cmd(0x08 | _displaycontrol);
break;
case TDISP_OFF:
_displaycontrol &=~ 0x04;
tdisp_lld_write_cmd(0x08 | _displaycontrol);
break;
case TDISP_CURSOR_ON:
_displaycontrol |= 0x02;
tdisp_lld_write_cmd(0x08 | _displaycontrol);
break;
case TDISP_CURSOR_OFF:
_displaycontrol &=~ 0x02;
tdisp_lld_write_cmd(0x08 | _displaycontrol);
break;
case TDISP_CURSOR_BLINK_ON:
_displaycontrol |= 0x00;
tdisp_lld_write_cmd(0x08 | _displaycontrol);
break;
case TDISP_CURSOR_BLINK_OFF:
_displaycontrol &=~ 0x00;
tdisp_lld_write_cmd(0x08 | _displaycontrol);
break;
}
*/
}
#endif /* GFX_USE_TDISP */ #endif /* GFX_USE_TDISP */
/** @} */ /** @} */

View File

@ -44,6 +44,7 @@ extern void tdisp_lld_set_cursor(coord_t col, coord_t row);
extern void tdisp_lld_create_char(uint8_t address, char *charmap); extern void tdisp_lld_create_char(uint8_t address, char *charmap);
extern void tdisp_lld_clear(void); extern void tdisp_lld_clear(void);
extern void tdisp_lld_home(void); extern void tdisp_lld_home(void);
extern void tdisp_lld_control(uint16_t what, void *value);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -67,12 +67,13 @@ bool_t tdispInit(void);
/** /**
* @brief Control different display properties * @brief Control different display properties
* @note Multiple attributes can be passed using the OR operator. * @note A wrapper macro exists for each option, please use them
* @note Example: tdispSetAttributes(TDISP_DISPLAY_ON | TDISP_CURSOR_BLINK) * instead of this function manually.
* *
* @param[in] attributes The attributes * @param[in] what What you want to control
* @param[in] value The value to be assigned
*/ */
void tdispSetAttributes(uint8_t attributes); void tdispControl(uint16_t what, void *value);
/** /**
* @brief Clears the display * @brief Clears the display

View File

@ -41,33 +41,8 @@ bool_t tdispInit(void) {
return ret; return ret;
} }
void tdispSetAttributes(uint8_t attributes) { void tdispControl(uint16_t what, void *value) {
switch(attributes) { tdisp_lld_control(what, value);
case TDISP_ON:
_displaycontrol |= 0x04;
tdisp_lld_write_cmd(0x08 | _displaycontrol);
break;
case TDISP_OFF:
_displaycontrol &=~ 0x04;
tdisp_lld_write_cmd(0x08 | _displaycontrol);
break;
case TDISP_CURSOR_ON:
_displaycontrol |= 0x02;
tdisp_lld_write_cmd(0x08 | _displaycontrol);
break;
case TDISP_CURSOR_OFF:
_displaycontrol &=~ 0x02;
tdisp_lld_write_cmd(0x08 | _displaycontrol);
break;
case TDISP_CURSOR_BLINK_ON:
_displaycontrol |= 0x00;
tdisp_lld_write_cmd(0x08 | _displaycontrol);
break;
case TDISP_CURSOR_BLINK_OFF:
_displaycontrol &=~ 0x00;
tdisp_lld_write_cmd(0x08 | _displaycontrol);
break;
}
} }
void tdispClear(void) { void tdispClear(void) {