Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: DmTftSsd2119.cpp
- Revision:
- 7:6cd8c36cbdb3
- Parent:
- 0:d6ff5fa503e8
- Child:
- 14:2db7065edbec
--- a/DmTftSsd2119.cpp Fri May 23 08:10:09 2014 +0000
+++ b/DmTftSsd2119.cpp Fri Jul 04 09:26:32 2014 +0000
@@ -49,30 +49,24 @@
}
void DmTftSsd2119::sendCommand(uint8_t index) {
- // cbi(_pinCS, _bitmaskCS);
cbi(_pinDC, _bitmaskDC);
- writeBus(0x00); // Temp
+ writeBus(0x00);
writeBus(index);
- // sbi(_pinCS, _bitmaskCS);
}
void DmTftSsd2119::send8BitData(uint8_t data) {
- //cbi(_pinCS, _bitmaskCS);
sbi(_pinDC, _bitmaskDC);
writeBus(data);
- //sbi(_pinCS, _bitmaskCS);
}
void DmTftSsd2119::sendData(uint16_t data) {
uint8_t dh = data>>8;
uint8_t dl = data&0xff;
- //cbi(_pinCS, _bitmaskCS);
sbi(_pinDC, _bitmaskDC);
writeBus(dh);
writeBus(dl);
- //sbi(_pinCS, _bitmaskCS);
}
void DmTftSsd2119::setAddress(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) {
@@ -115,8 +109,6 @@
sbi(_pinCS, _bitmaskCS);
}
-
-
void DmTftSsd2119::init(void) {
setTextColor(BLACK, WHITE);
#if defined (DM_TOOLCHAIN_ARDUINO)
@@ -161,7 +153,7 @@
sendCommand(0x11); // Entry Mode ,SET LCM interface Mode.
sendData(0x6870); // SET 65K colors,MCU interface Mode.TypeB ,ID=11 AM=0 the address counter is updated in the horizontal direction.
- sendCommand(0x15); // Generic Interface Control. DOCLK,HSYNC,VSYNC,DE
+ sendCommand(0x15); // Generic Interface Control. DOCLK,HSYNC,VSYNC,DE
sendData(0x0000);
sendCommand(0x01); // Driver Output Control
@@ -174,25 +166,25 @@
sendData(0x0000); // The valid range is from 1 to 240
// LCD POWER CONTROL
- sendCommand(0x03); // Power Control 1, VGH,VGL
- sendData(0x6A38); // Set dct=fline*4, VGH=2 x VCIX2 + VCI,VGL=-(VGH) + VCix2, DC=Fline × 8, AP=Medium to large
+ sendCommand(0x03); // Power Control 1, VGH,VGL
+ sendData(0x6A38); // Set dct=fline*4, VGH=2 x VCIX2 + VCI,VGL=-(VGH) + VCix2, DC=Fline × 8, AP=Medium to large
sendCommand(0X0B); // Frame Cycle Control.
sendData(0x5308); // SET NO SDT=1 clock cycle (POR) ,Sets the equalizing period,
- sendCommand(0x0C); // Power Control 2 设VCIX2 电压
+ sendCommand(0x0C); // Power Control 2 VCIX2
sendData(0x0003); // Adjust VCIX2 output voltage=5.7V
sendCommand(0x0D); // Set amplitude magnification of VLCD63
sendData(0x000A); // vlcd63=VREF(2.0V)* 2.335V
- sendCommand(0x0E); // SET VCOMG VDV .设VCOM电压
+ sendCommand(0x0E); // SET VCOMG VDV .VCOM
sendData(0x2B00); // SET VCOMG=1,VCOM=VLCD63* //2A
sendCommand(0X0F); // Gate Scan Position.
sendData(0x0000); // The valid range is from 1 to 240.
- sendCommand(0x1E); // SET nOTP VCOMH ,设VCOMH电压
+ sendCommand(0x1E); // SET nOTP VCOMH ,VCOMH
sendData(0x00B7); // SET nOTP=0, VCOMH=VLCD63* //B8
sendCommand(0x25); // Frame Frequency Control
@@ -204,9 +196,8 @@
sendCommand(0x27); // Analog setting
sendData(0x0078);
- //
- sendCommand(0x12); // Sleep mode
- sendData(0xD999);
+// sendCommand(0x12); // Sleep mode
+// sendData(0xD999);
// SET WINDOW
sendCommand(0x4E); // Ram Address Set
@@ -263,5 +254,3 @@
/*********************************************************************************************************
END FILE
*********************************************************************************************************/
-
-