SG12864A
Dependents: SG12864A_TestProgram
SG12864A.h
- Committer:
- shintamainjp
- Date:
- 2010-07-19
- Revision:
- 0:238f2d048222
- Child:
- 1:aacd73a4e7ee
File content as of revision 0:238f2d048222:
/** * SG12864A Graphics LCD module driver class (Version 0.0.1) * * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems) * http://shinta.main.jp/ */ #ifndef _SG12864A_H_ #define _SG12864A_H_ #include "mbed.h" class SG12864A { public: SG12864A( PinName di, PinName rw, PinName en, PinName db0, PinName db1, PinName db2, PinName db3, PinName db4, PinName db5, PinName db6, PinName db7, PinName cs1, PinName cs2, PinName res); ~SG12864A(); enum Target { CS1, CS2 }; void reset(void); void clear(void); void setDisplayOnOff(Target t, bool on); void setDisplayStartLine(Target t, uint8_t displayStartLine); void setPageAddress(Target t, uint8_t addr); void setColumnAddress(Target t, uint8_t addr); void readStatus(Target t, uint8_t *c); void writeData(Target t, uint8_t c); void readData(Target t, uint8_t *c); private: static const int PAGES = 8; static const int COLUMNS = 64; DigitalOut ioDI; DigitalOut ioRW; DigitalOut ioEN; BusInOut ioDB; DigitalOut ioCS1; DigitalOut ioCS2; DigitalOut ioRES; enum Mode { Data, Instruction }; void setDirectionToRead(); void setDirectionToWrite(); void write(Target t, Mode m, uint8_t c); void read(Target t, Mode m, uint8_t *c); void reset(bool b); }; #endif