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.
Diff: epd1in54.cpp
- Revision:
- 6:469fb6b0d26d
- Parent:
- 3:e4399b5ceb4b
- Child:
- 7:25cadf37fd86
--- 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);
}