Added SPI burst mode to spi 8 bit.
Dependents: Bicycl_Computer_NUCLEO-F411RE Bicycl_Computer_NUCLEO-L476RG
Fork of UniGraphic by
Added SPI burst mode to this graphics driver. If whoever wants this rolled in to repository let me know. I replaced _spi.write(); with fastWrite(); and clearRX();
SPI8.cpp
// need to re-create SPI firmware to access SPI handle static SPI_HandleTypeDef SpiHandle; void SPI8::fastWrite(int data) { SpiHandle.Instance = SPI1; // Check if data is transmitted while ((SpiHandle.Instance->SR & SPI_SR_TXE) == 0); SpiHandle.Instance->DR = data; } void SPI8::clearRX( void ) { SpiHandle.Instance = SPI1; //Check if the RX buffer is busy //While busy, keep checking while (SpiHandle.Instance->SR & SPI_SR_BSY){ // Check RX buffer readable while ((SpiHandle.Instance->SR & SPI_SR_RXNE) == 0); int dummy = SpiHandle.Instance->DR; } }
Diff: Display/LCD.h
- Revision:
- 21:ae0a4eedfc90
- Parent:
- 20:14daa48ffd4c
- Child:
- 25:daacdcf34e52
--- a/Display/LCD.h Mon Mar 23 14:08:04 2015 +0000 +++ b/Display/LCD.h Tue Mar 31 21:14:48 2015 +0000 @@ -4,6 +4,7 @@ #include "GraphicsDisplay.h" #include "PAR8.h" +#include "BUS8.h" #include "SPI8.h" #include "SPI16.h" #include "Protocols.h" @@ -30,11 +31,16 @@ public: - /** Create a monochrome LCD Parallel interface + /** Create a monochrome LCD Parallel Port interface * @param name The name used by the parent class to access the interface */ LCD(proto_t displayproto,PortName port, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const int lcdsize_x, const int lcdsize_y, const int ic_x_segs, const int ic_y_coms, const char* name); + /** Create a monochrome LCD Parallel Bus interface + * @param name The name used by the parent class to access the interface + */ + LCD(proto_t displayproto,PinName* buspins, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const int lcdsize_x, const int lcdsize_y, const int ic_x_segs, const int ic_y_coms, const char* name); + /** Create a monochrome LCD SPI interface * @param name The name used by the parent class to access the interface */