A library with drivers for different peripherals on the LPC4088 QuickStart Board or related add-on boards.
Dependents: LPC4088test LPC4088test_ledonly LPC4088test_deleteall LPC4088_RAMtest ... more
Diff: EaLcdBoard.h
- Revision:
- 4:b32cf4ef45c5
- Parent:
- 0:0fdadbc3d852
- Child:
- 12:15597e45eea0
diff -r 9d31a3c5013e -r b32cf4ef45c5 EaLcdBoard.h --- a/EaLcdBoard.h Wed Oct 09 07:51:52 2013 +0000 +++ b/EaLcdBoard.h Fri Oct 18 12:48:58 2013 +0200 @@ -24,6 +24,30 @@ NameBufferSize = 30 }; + enum TouchPanelId { + // must be first + TouchPanelInvalidFirst = 0x80, + + // Texas Instruments Touch Screen Controller (TSC2046). + TouchPanel_TSC2046, + // Microchip Touch Screen Controller (AR1021). + TouchPanel_AR1021, + + // Must be after last panel ID + TouchPanelInvalidLast, + // unknown touch panel + TouchPanelUnknown = 0xFF + + }; + + typedef struct { + uint8_t swap; // set to 1 if x and y should be swapped + uint32_t xres; // x resistance + uint32_t yres; // y resistance + TouchPanelId panelId; // identifies touch panel + + } TouchParams_t; + /** Create an interface to an Embedded Artists LCD Board * * @param sda I2C data line pin @@ -111,6 +135,36 @@ */ Result getPowerDownSeq(char* buf, int len); + /** + * Get the touch panel parameters stored in persistent storage + * + * @param params pointer to a configuration object. Parameters are copied to + * this object. + * + * @returns the result of the operation + */ + Result getTouchParameters(TouchParams_t* params); + + /** + * Write display parameters to the EEPROM. Please use this function with + * care since original parameters will be overwritten and cannot be restored. + * + * @param lcdName the name of the display + * @param lcdMfg the display manufacturer + * @param cfg the display configuration parameters + * @param initSeqStr the initialization sequence string + * @param pdSeqStr the power down sequence string + * @param touch touch panel parameters + */ + Result storeParameters( + const char* lcdName, + const char* lcdMfg, + LcdController::Config* cfg, + const char* initSeqStr, + const char* pdSeqStr, + TouchParams_t* touch, + bool controlWp = false); + private: @@ -134,6 +188,7 @@ Result checkVersion(char* v, uint32_t len); Result execDelay(char* del, uint32_t len); Result execSeqCtrl(char* cmd, uint32_t len); + Result execPinSet(char* cmd, uint32_t len); void setLsStates(uint16_t states, uint8_t* ls, uint8_t mode); void setLeds(void); @@ -142,6 +197,7 @@ void pca9532_setBlink0Duty(uint8_t duty); void pca9532_setBlink0Leds(uint16_t ledMask); + void setWriteProtect(bool enable); void set3V3Signal(bool enabled); void set5VSignal(bool enabled); void setDisplayEnableSignal(bool enabled); @@ -157,5 +213,3 @@ }; #endif - -