Skip to content

Commit

Permalink
Sharp displays - Horrible patch for CC13x0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rei Vilo committed Apr 23, 2020
1 parent 321cb55 commit 8b9dede
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
13 changes: 8 additions & 5 deletions libraries/LCD_SharpBoosterPack_SPI/LCD_SharpBoosterPack_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
// Example for library for Sharp BoosterPack LCD with hardware SPI
//
//
// Author : StefanSch
// Author : Stefan Schauer
// Date : Mar 05, 2015
// Version: 1.04
// File : LCD_SharpBoosterPack_SPI_main.c
//
// Version: 1.01 : added support for CC3200
// Version: 1.02 : added print class
// Version: 1.03 : added support for Sharp 128
// Version: 1.04 : added support for Data in FRAM
// version: 1.04 : horrible patch for CC13x0 ENERGIA_ARCH_CC13XX
//
// Based on the LCD5110 Library
// Created by Rei VILO on 28/05/12
// Copyright (c) 2012 http://embeddedcomputing.weebly.com
// Copyright (c) 2012 https://embeddedcomputing.weebly.com
// Licence CC = BY SA NC
//
// Edited 2015-07-11 by ReiVilo
Expand Down Expand Up @@ -75,7 +75,6 @@ unsigned char flagSendToggleVCOMCommand = 0;
#define SHARP_REQUEST_TOGGLE_VCOM 0x02



static void SendToggleVCOMCommand(void);

uint8_t textx = 0;
Expand Down Expand Up @@ -540,9 +539,13 @@ static void SendToggleVCOMCommand(void)
// Set P2.4 High for CS
digitalWrite(_pinChipSelect, HIGH);

#if defined(ENERGIA_ARCH_CC13XX) // Horrible patch for CC13x0
shiftOut(15, 7, MSBFIRST, (char)command);
shiftOut(15, 7, MSBFIRST, (char)SHARP_LCD_TRAILER_BYTE);
#else
SPI.transfer((char)command);
SPI.transfer((char)SHARP_LCD_TRAILER_BYTE);

#endif
// Wait for last byte to be sent, then drop SCS
delayMicroseconds(10);
// Set P2.4 High for CS
Expand Down
14 changes: 10 additions & 4 deletions libraries/LCD_SharpBoosterPack_SPI/LCD_SharpBoosterPack_SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
// Example for library for Sharp BoosterPack LCD 96 and 128 with hardware SPI
//
//
// Author : StefanSch
// Author : Stefan Schauer
// Date : Mar 05, 2015
// Version: 1.03
// Version: 1.04
// File : LCD_SharpBoosterPack_SPI_main.h
//
// Based on the LCD5110 Library
// Created by Rei VILO on 28 May 2012
// Copyright (c) 2012 http://embeddedcomputing.weebly.com
// Copyright (c) 2012 https://embeddedcomputing.weebly.com
// Licence CC = BY SA NC
//
// Edited 11 Jul 2015 by ReiVilo
Expand All @@ -24,6 +24,9 @@
// Edited 2019-03-19 by StefaSch
// Added support for smaller memory with put LCD data to FRAM
//
// Edited 22 Apr 2020 by ReiVilo
// Horrible patch for CC13x0 ENERGIA_ARCH_CC13XX
//

#ifndef LCD_SharpBoosterPack_SPI_h
#define LCD_SharpBoosterPack_SPI_h
Expand Down Expand Up @@ -75,6 +78,7 @@ class LCD_SharpBoosterPack_SPI : public Print
/// @param pinVCC VCC pin
/// @param model default=SHARP_96 for compatibility, SHARP_128
///
/// @note For SensorTag CC2650
/// @code
/// LCD_SharpBoosterPack_SPI myScreen(7, 10, 1, SHARP_96);
/// LCD_SharpBoosterPack_SPI myScreen(7, 10, 1, true, SHARP_128);
Expand Down Expand Up @@ -138,7 +142,7 @@ class LCD_SharpBoosterPack_SPI : public Print

///
/// @brief Get size àf the screen
/// @return 96 for 96x96 or &28 for 128x128
/// @return 96 for 96x96 or 128 for 128x128
///
uint8_t getSize();

Expand Down Expand Up @@ -175,6 +179,8 @@ class LCD_SharpBoosterPack_SPI : public Print
void TA0_turnOff();
uint8_t _orientation;
bool _reverse;
uint8_t lcd_vertical_max;
uint8_t lcd_horizontal_max;
};
#endif

0 comments on commit 8b9dede

Please sign in to comment.