tdisp update

This commit is contained in:
Joel Bodenmann 2013-01-11 14:39:27 +01:00
parent 905bb0292b
commit c974ec449f
2 changed files with 24 additions and 7 deletions

View file

@ -45,11 +45,12 @@
* @name TDISP display attributes * @name TDISP display attributes
* @{ * @{
*/ */
#define TDISP_ON 0x01 #define TDISP_ON 0x01
#define TDISP_OFF 0x02 #define TDISP_OFF 0x02
#define TDISP_CURSOR_ON 0x03 #define TDISP_CURSOR_ON 0x03
#define TDISP_CURSOR_OFF 0x04 #define TDISP_CURSOR_OFF 0x04
#define TDISP_CURSOR_BLINK 0x05 #define TDISP_CURSOR_BLINK_ON 0x05
#define TDISP_CURSOR_BLINK_OFF 0x06
/** @} */ /** @} */
/** /**

View file

@ -31,10 +31,12 @@
#if GFX_USE_TDISP || defined(__DOXYGEN__) #if GFX_USE_TDISP || defined(__DOXYGEN__)
static uint8_t _displaycontrol;
bool_t tdispInit(void) { bool_t tdispInit(void) {
bool_t ret; bool_t ret;
ret = TDISP_LLD(init)(); ret = TDIP_LLD(init)();
return ret; return ret;
} }
@ -42,14 +44,28 @@ bool_t tdispInit(void) {
void tdispSetAttributes(uint8_t attributes) { void tdispSetAttributes(uint8_t attributes) {
switch(attributes) { switch(attributes) {
case TDISP_ON: case TDISP_ON:
_displaycontrol |= 0x04;
TDISP_LLD(write_cmd)(0x08 | _displaycontrol);
break; break;
case TDISP_OFF: case TDISP_OFF:
_displaycontrol &=~ 0x04;
TDISP_LLD(write_cmd)(0x08 | _displaycontrol);
break; break;
case TDISP_CURSOR_ON: case TDISP_CURSOR_ON:
_displaycontrol |= 0x02;
TDISP_LLD(write_cmd)(0x08 | _displaycontrol);
break; break;
case TDISP_CURSOR_OFF: case TDISP_CURSOR_OFF:
_displaycontrol &=~ 0x02;
TDISP_LLD(write_cmd)(0x08 | _displaycontrol);
break; break;
case TDISP_CURSOR_BLINK: 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; break;
} }
} }