Integrate with the Arduino Print class
This commit is contained in:
parent
a26f29fca9
commit
c38d5764a8
|
|
@ -354,7 +354,7 @@ void Adafruit_RA8875::textEnlarge(uint8_t scale)
|
||||||
@args len[in] The size of the buffer in bytes
|
@args len[in] The size of the buffer in bytes
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
void Adafruit_RA8875::textWrite(char* buffer, uint16_t len)
|
void Adafruit_RA8875::textWrite(const char* buffer, uint16_t len)
|
||||||
{
|
{
|
||||||
if (len == 0) len = strlen(buffer);
|
if (len == 0) len = strlen(buffer);
|
||||||
writeCommand(RA8875_MRWC);
|
writeCommand(RA8875_MRWC);
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ class Adafruit_RA8875 : public Adafruit_GFX {
|
||||||
void textColor(uint16_t foreColor, uint16_t bgColor);
|
void textColor(uint16_t foreColor, uint16_t bgColor);
|
||||||
void textTransparent(uint16_t foreColor);
|
void textTransparent(uint16_t foreColor);
|
||||||
void textEnlarge(uint8_t scale);
|
void textEnlarge(uint8_t scale);
|
||||||
void textWrite(char* buffer, uint16_t len=0);
|
void textWrite(const char* buffer, uint16_t len=0);
|
||||||
|
|
||||||
/* Graphics functions */
|
/* Graphics functions */
|
||||||
void graphicsMode(void);
|
void graphicsMode(void);
|
||||||
|
|
@ -123,6 +123,15 @@ class Adafruit_RA8875 : public Adafruit_GFX {
|
||||||
uint16_t width(void);
|
uint16_t width(void);
|
||||||
uint16_t height(void);
|
uint16_t height(void);
|
||||||
|
|
||||||
|
virtual size_t write(uint8_t b) {
|
||||||
|
textWrite((const char *)&b, 1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
virtual size_t write(const uint8_t *buffer, size_t size) {
|
||||||
|
textWrite((const char *)buffer, size);
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void PLLinit(void);
|
void PLLinit(void);
|
||||||
void initialize(void);
|
void initialize(void);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue