Come from standard seeed epaper, but adding SPI signal in construtor
Fork of seeedstudio-epaper by
Diff: EPD.cpp
- Revision:
- 2:c5bb7d34974d
- Parent:
- 1:2f62e2b80305
--- a/EPD.cpp Fri Jul 18 09:20:24 2014 +0000 +++ b/EPD.cpp Fri Nov 13 20:46:53 2015 +0000 @@ -26,23 +26,24 @@ #define CU8(...) (ARRAY(const uint8_t, __VA_ARGS__)) Timer timer; -SPI spi(p20, p22, p25); -static void SPI_put(uint8_t c); -static void SPI_put_wait(uint8_t c, DigitalIn busy_pin); -static void SPI_send(DigitalOut cs_pin, const uint8_t *buffer, uint16_t length); -static void SPI_on(); +//thierry +//--origine SPI spi(p20, p22, p25); +//SPI spi(P0_25,P0_28,P0_29); -EPD_Class::EPD_Class(PinName Pin_EPD_CS, PinName Pin_PANEL_ON, PinName Pin_BORDER, PinName Pin_DISCHARGE, PinName Pin_PWM, PinName Pin_RESET, PinName Pin_BUSY) : + +EPD_Class::EPD_Class(PinName Pin_EPD_CS, PinName Pin_PANEL_ON, PinName Pin_BORDER, PinName Pin_DISCHARGE, PinName Pin_PWM, PinName Pin_RESET, PinName Pin_BUSY,PinName Pin_MOSI,PinName Pin_MISO,PinName Pin_CLK) : EPD_Pin_EPD_CS(Pin_EPD_CS), EPD_Pin_PANEL_ON(Pin_PANEL_ON), EPD_Pin_BORDER(Pin_BORDER), EPD_Pin_DISCHARGE(Pin_DISCHARGE), EPD_Pin_PWM(Pin_PWM), EPD_Pin_RESET(Pin_RESET), - EPD_Pin_BUSY(Pin_BUSY) { - + EPD_Pin_BUSY(Pin_BUSY), + spi (Pin_MOSI,Pin_MISO,Pin_CLK) + { + } void EPD_Class::begin(EPD_size sz) @@ -537,17 +538,17 @@ SPI_send(this->EPD_Pin_EPD_CS, CU8(0x72, 0x2f), 2); } -static void SPI_on() { +void EPD_Class::SPI_on() { wait_us(10); } -static void SPI_put(uint8_t c) { +void EPD_Class::SPI_put(uint8_t c) { spi.write(c); } -static void SPI_put_wait(uint8_t c, DigitalIn busy_pin) { +void EPD_Class::SPI_put_wait(uint8_t c, DigitalIn busy_pin) { SPI_put(c); @@ -557,7 +558,7 @@ } -static void SPI_send(DigitalOut cs_pin, const uint8_t *buffer, uint16_t length) { +void EPD_Class::SPI_send(DigitalOut cs_pin, const uint8_t *buffer, uint16_t length) { // CS low cs_pin = 0;