E_paper, E_ink, Screen size 1.54", resolution 200x200, 4 wire spi, Waveshare, Black and White, Kl25Z, 8 wire print connector, supply 3.3 Volt, IL0373 Controller, font size is 8, 12, 16 and 24.
Diff: epd1in54.cpp
- Revision:
- 6:469fb6b0d26d
- Parent:
- 3:e4399b5ceb4b
- Child:
- 7:25cadf37fd86
diff -r 3b7204bd6832 -r 469fb6b0d26d epd1in54.cpp --- a/epd1in54.cpp Wed Mar 28 08:28:47 2018 +0000 +++ b/epd1in54.cpp Wed Mar 28 09:21:33 2018 +0000 @@ -24,17 +24,20 @@ * THE SOFTWARE. */ -#include <stdlib.h> +#ifndef MBED_H_ +#define MBED_H_ +#include "mbed.h" +#endif #include "epd1in54.h" Epd::~Epd() { }; Epd::Epd() { - reset_pin = RST_PIN; - dc_pin = DC_PIN; - cs_pin = CS_PIN; - busy_pin = BUSY_PIN; + reset_pin_no= 0; + dc_pin_no = 1; + cs_pin_no = 2; + busy_pin_no = 3; width = EPD_WIDTH; height = EPD_HEIGHT; }; @@ -72,7 +75,7 @@ * @brief: basic function for sending commands */ void Epd::SendCommand(unsigned char command) { - DigitalWrite(dc_pin, LOW); + DigitalWrite(dc_pin_no, LOW); SpiTransfer(command); } @@ -80,18 +83,16 @@ * @brief: basic function for sending data */ void Epd::SendData(unsigned char data) { - DigitalWrite(dc_pin, HIGH); + DigitalWrite(dc_pin_no, HIGH); SpiTransfer(data); } - - /** * @brief: Wait until the busy_pin goes LOW */ void Epd::WaitUntilIdle(void) { - while(DigitalRead(busy_pin) == HIGH) { //LOW: idle, HIGH: busy + while(DigitalRead(busy_pin_no) == HIGH) { //LOW: idle, HIGH: busy DelayMs(100); } } @@ -102,9 +103,9 @@ * see Epd::Sleep(); */ void Epd::Reset(void) { - DigitalWrite(reset_pin, LOW); //module reset + DigitalWrite(reset_pin_no, LOW); //module reset DelayMs(200); - DigitalWrite(reset_pin, HIGH); + DigitalWrite(reset_pin_no, HIGH); DelayMs(200); }