ePaper display for ACD52832 Dev board
Dependents: acd52832_LSM9DS1 BB
Diff: GDEP015OC1.cpp
- Revision:
- 1:4fff95e316c9
- Child:
- 2:1c8f73aa2a16
diff -r 5bcd2ada1e26 -r 4fff95e316c9 GDEP015OC1.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GDEP015OC1.cpp Wed Sep 14 14:57:23 2016 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" + +#include "GDEP015OC1.h" + +GDEP015OC1::GDEP015OC1(spi& spi, PinName cs=p5, PinName dc=p6, PinName rst=p7, PinName busy=p8) : _spi(spi), _cs(cs), _dc(dc), _rst(rst), _busy(busy){ + _init(); +} + +void GDEP015OC1::_spiCallback(int event){ + if(event = SPI_EVENT_COMPLETE) + cs = 1; +} + +bool GDEP015OC1::_spiCommand(unsigned char command){ + unsigned char _package = command; + cs = dc = 0; + wait_us(1); + + while(transfer(&_package, 1, NULL, 0, NULL)!= 0); +} +