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.
Revision 22:31c54fc61f12, committed 2017-02-01
- Comitter:
- eencae
- Date:
- Wed Feb 01 12:48:13 2017 +0000
- Parent:
- 21:4cbdc20fea9f
- Child:
- 23:eb7e6632fc9e
- Commit message:
- Moved 'initSPI' method call to init() method from constructor.
Changed in this revision
| N5110.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/N5110.cpp Sat Jan 28 20:25:43 2017 +0000
+++ b/N5110.cpp Wed Feb 01 12:48:13 2017 +0000
@@ -13,7 +13,6 @@
N5110::N5110(PinName pwrPin, PinName scePin, PinName rstPin, PinName dcPin, PinName mosiPin, PinName sclkPin, PinName ledPin)
{
spi = new SPI(mosiPin,NC,sclkPin); // create new SPI instance and initialise
- initSPI();
// set up pins as required
led = new PwmOut(ledPin);
@@ -30,7 +29,6 @@
N5110::N5110(PinName scePin, PinName rstPin, PinName dcPin, PinName mosiPin, PinName sclkPin, PinName ledPin)
{
spi = new SPI(mosiPin,NC,sclkPin); // create new SPI instance and initialise
- initSPI();
// set up pins as required
led = new PwmOut(ledPin);
@@ -43,6 +41,8 @@
// initialise function - powers up and sends the initialisation commands
void N5110::init()
{
+ initSPI();
+
turnOn(); // power up
wait_ms(10); // small delay seems to prevent spurious pixels during mbed reset
reset(); // reset LCD - must be done within 100 ms