this is a test of the library SSD1306 of adafruit for the oled of 128x64 with the card of development kl25z I have added a library to synthesize the main code
Fork of Adafruit_GFX by
I2C_Call.h@17:34dd85b7a465, 2017-10-24 (annotated)
- Committer:
- OswaldoAntonio
- Date:
- Tue Oct 24 00:47:39 2017 +0000
- Revision:
- 17:34dd85b7a465
I have added a library to synthesize the main code
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
OswaldoAntonio | 17:34dd85b7a465 | 1 | /* |
OswaldoAntonio | 17:34dd85b7a465 | 2 | * Copyright (c) 2012 Neal Horman - http://www.wanlink.com |
OswaldoAntonio | 17:34dd85b7a465 | 3 | * |
OswaldoAntonio | 17:34dd85b7a465 | 4 | * License: MIT open source (http://opensource.org/licenses/MIT) |
OswaldoAntonio | 17:34dd85b7a465 | 5 | * Summary; |
OswaldoAntonio | 17:34dd85b7a465 | 6 | * Use / modify / distribute / publish it how you want and |
OswaldoAntonio | 17:34dd85b7a465 | 7 | * if you use it, or don't, you can't hold me liable for how |
OswaldoAntonio | 17:34dd85b7a465 | 8 | * it does or doesn't work. |
OswaldoAntonio | 17:34dd85b7a465 | 9 | * If it doesn't work how you want, don't use it, or change |
OswaldoAntonio | 17:34dd85b7a465 | 10 | * it so that it does work. |
OswaldoAntonio | 17:34dd85b7a465 | 11 | */ |
OswaldoAntonio | 17:34dd85b7a465 | 12 | #include "mbed.h" |
OswaldoAntonio | 17:34dd85b7a465 | 13 | #include "Adafruit_SSD1306.h" |
OswaldoAntonio | 17:34dd85b7a465 | 14 | |
OswaldoAntonio | 17:34dd85b7a465 | 15 | /*// an SPI sub-class that provides a constructed default |
OswaldoAntonio | 17:34dd85b7a465 | 16 | |
OswaldoAntonio | 17:34dd85b7a465 | 17 | class SPIPreInit : public SPI |
OswaldoAntonio | 17:34dd85b7a465 | 18 | { |
OswaldoAntonio | 17:34dd85b7a465 | 19 | public: |
OswaldoAntonio | 17:34dd85b7a465 | 20 | SPIPreInit(PinName mosi, PinName miso, PinName clk) : SPI(mosi,miso,clk) |
OswaldoAntonio | 17:34dd85b7a465 | 21 | { |
OswaldoAntonio | 17:34dd85b7a465 | 22 | format(8,3); |
OswaldoAntonio | 17:34dd85b7a465 | 23 | frequency(2000000); |
OswaldoAntonio | 17:34dd85b7a465 | 24 | }; |
OswaldoAntonio | 17:34dd85b7a465 | 25 | }; |
OswaldoAntonio | 17:34dd85b7a465 | 26 | */ |
OswaldoAntonio | 17:34dd85b7a465 | 27 | // an I2C sub-class that provides a constructed default |
OswaldoAntonio | 17:34dd85b7a465 | 28 | |
OswaldoAntonio | 17:34dd85b7a465 | 29 | class I2CPreInit : public I2C |
OswaldoAntonio | 17:34dd85b7a465 | 30 | { |
OswaldoAntonio | 17:34dd85b7a465 | 31 | public: |
OswaldoAntonio | 17:34dd85b7a465 | 32 | I2CPreInit(PinName sda, PinName scl) : I2C(sda, scl) |
OswaldoAntonio | 17:34dd85b7a465 | 33 | { |
OswaldoAntonio | 17:34dd85b7a465 | 34 | frequency(400000); |
OswaldoAntonio | 17:34dd85b7a465 | 35 | start(); |
OswaldoAntonio | 17:34dd85b7a465 | 36 | }; |
OswaldoAntonio | 17:34dd85b7a465 | 37 | }; |
OswaldoAntonio | 17:34dd85b7a465 | 38 |