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.
Dependencies: CMSIS_DSP_401 GPS MPU9150_DMP PID QuaternionMath Servo mbed
Fork of SolarOnFoils_MainModule_20150518 by
Diff: LCD_I2C.h
- Revision:
- 2:f6d058931b17
- Parent:
- 0:81b21910454e
diff -r b4a0d63db637 -r f6d058931b17 LCD_I2C.h --- a/LCD_I2C.h Fri Jun 26 09:21:33 2015 +0000 +++ b/LCD_I2C.h Tue Aug 11 08:38:55 2015 +0000 @@ -10,7 +10,8 @@ // Changelog : // // Date: Name: Comment: // // 25/03/2015 DNB First version // -// 25/03/2015 DNB implemntation LCD_printPos // +// 25/03/2015 DNB Implementation LCD_printPos // +// 26/06/2015 DNB Rebuild LCD_I2C to class // // // ////////////////////////////////////////////////////////////////////////////////////// @@ -20,14 +21,63 @@ ////////////////////////////////////////////////////////////////////////////////////// // includes // ////////////////////////////////////////////////////////////////////////////////////// - #include <stdio.h> #include "MCP23017.h" ////////////////////////////////////////////////////////////////////////////////////// -// functions // +// class // +////////////////////////////////////////////////////////////////////////////////////// +class LCD_I2C +{ + private: + // resources + I2C i2c; + MCP23017 mcp23017; + + // variable + uint32_t uiCounter; + + char deviceAdress; + char buffer_GPIOB; + + bool bError; + + public: + // Constructor + LCD_I2C(PinName, PinName, char); + // Destructor + ~LCD_I2C(); + +////////////////////////////////////////////////////////////////////////////////////// +// base functions // ////////////////////////////////////////////////////////////////////////////////////// +void vLCD_delay_I2C (unsigned int t_delay); // delay up to 65535 ticks +void vLCD_cmd_I2C (unsigned char commando); // send commando to LCD +void vLCD_data_I2C (unsigned char data); // write single character to LCD +void vLCD_init_I2C (void); // init LCD +void vLCD_clear_I2C (void); // clear LCD +////////////////////////////////////////////////////////////////////////////////////// +// write functions // +////////////////////////////////////////////////////////////////////////////////////// +void vLCD_print_I2C (unsigned char *string, unsigned char line); // write a string to certain line +void vLCD_printLine_I2C (unsigned char *string, unsigned char line); // write a string to certain line +void vLCD_printPos_I2C (unsigned char *sting, unsigned char line, unsigned char character);// write a string to certain line +void vLCD_printInt_I2C (int value, unsigned char line, unsigned char character); // write a integer to certain line + +////////////////////////////////////////////////////////////////////////////////////// +// update LCD // +////////////////////////////////////////////////////////////////////////////////////// +void vLCD_update (void); // update LCD + + +};//end class + + +////////////////////////////////////////////////////////////////////////////////////// +// original functions // +////////////////////////////////////////////////////////////////////////////////////// +/* void vLCD_delay_I2C (unsigned int t_delay); // delay up to 65535 ticks void vLCD_cmd_I2C (unsigned char commando); // send commando to LCD void vLCD_data_I2C (unsigned char data); // write single character to LCD @@ -41,6 +91,8 @@ void vLCD_printInt_I2C (int value, unsigned char line, unsigned char character); // update lcd void vLCD_update (void); +*/ + #endif /* defined(____LCD_I2C__) */ //////////////////////////////////////////////////////////////////////////////////////