Giter Site home page Giter Site logo

bb_spi_lcd's Introduction

Welcome to my open source libraries. The aim of my efforts is to bring speed and unexpected features to all devices, big and small.

Larry's GitHub stats

bb_spi_lcd's People

Contributors

bitbank2 avatar cyberman54 avatar taraholeinit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bb_spi_lcd's Issues

Enhancement: setPower(bool bOn);

Can we have a setPower(bool bOn) function/method, like in OneBitDisplay?
Most LCD displays have a LED line for switching backlight on / off. This would be a useful API enhancement for this lib.

DRAW_WITH_DMA only draw half of the screen

Hi, I am working on an ESP32-WROOM-32UE with arduino-esp32 and an LCD_ST7789_240 (40MHz) screen.

This bug occurs with the spilcdWriteDataBlock function and the DRAW_WITH_DMA flag, tested with the JPEGDEC example esp32_jpeg.

My image, adapted to the resolution of my screen, has the following description:

// Data size = 4213 bytes
//
// JFIF, Compression=JPEG, Size: 240 x 240, 24-Bpp
//

Changing the resolution, the quality of my JPEG, or the SPI frequency didn't make a difference.

I don't have the capability to manually test if the problem is related to JPEG decoding or not. However, I did test the PNGdec png_transparency example, and spilcdWritePixelsMasked functions correctly with DRAW_WITH_DMA.
So, I assume that the problem does not come from my ESP32.

Capture

Does not build (on Linux at least)

Needed to make a few minor changes to get this to build. Needed to drop #include <SPI.h>, and various declaration/call mismatches due to missing/added SPILCD* param. Have not tested yet, so logging issue rather than giving you untested changes I made.

Errors trying to compile and run on ESP32

I have my ST7789 LCD setup and working with my ESP32 board with the TFT_eSPI library. But, I want to support multiple displays, so without changing anything in my working hardware set up, I'm trying this library. But I'm having trouble getting it to work.

The first issue I encountered is that the parallel file does not compile. I get numerous errors, some of the most obvious are unknown types, such as:

lcd_cam_dev_t
esp_lcd_i80_bus_handle_t

I noticed there's references to S3 in this file, is this perhaps only for S3? I removed references to the parallel API in the main file, and then I was able to compile. I'm only using SPI anyway.

But now I get an exception when trying to init, from this call:

spilcdInit(&lcd, LCD_ST7789, FLAGS_NONE, 40000000, -1, 21, 19, -1, -1, 22, 23);

0x400dd0a3: spilcdWriteCommand(tagSPILCD*, unsigned char) at C:/exp/frameworks/esp-idf-v4.4.6/components/arduino/libraries/bb_spi_lcd/src/bb_spi_lcd.cpp:2909
0x400dd336: spilcdInit(tagSPILCD*, int, int, int, int, int, int, int, int, int, int) at C:/exp/frameworks/esp-idf-v4.4.6/components/arduino/libraries/bb_spi_lcd/src/bb_spi_lcd.cpp:1951
...

Version <2.5.0 doesn't compile on Teensy

Since the DMA parameter was integrated into the initialization, I can no longer compile my scatch for the Teensy 4.0.
All examples will also not compile unless I use a different target like ESP32. When I use an older version everything seems to work.
These are the params used:

// LCD
#define TFT_CS 10
#define TFT_RST -1
#define TFT_DC 5
#define TFT_LED 4
#define TFT_MOSI 11
#define TFT_SCK 13
#define TFT_DMA 18

// In Setup:

spilcdInit(&lcd, LCD_ST7789_240, FLAGS_NONE, 40000000, TFT_CS, TFT_DC, TFT_RST, TFT_LED, -1, TFT_MOSI, TFT_SCK, TFT_DMA);

// Error Message:

/Users/nico/Library/Arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /private/var/folders/5y/d7cssz3n79g1cypwdh9xnk6h0000gn/T/arduino/sketches/303FA847A94E5B39878BC7D97E824030/sketch/teensy_Poly_Synth_V2_5.ino.cpp.o: in function setup': /Users/nico/Documents/Arduino/projects/teensy_Poly_Synth_V2_5/teensy_Poly_Synth_V2_5.ino:351: undefined reference to spilcdInit(tagSPILCD*, int, int, long, int, int, int, int, int, int, int, int)'
collect2: error: ld returned 1 exit status
Multiple libraries were found for "SD.h"
Used: /Users/nico/Library/Arduino15/packages/teensy/hardware/avr/1.59.0/libraries/SD
Not used: /Users/nico/Library/Arduino15/libraries/SD
Not used: /Users/nico/Documents/Arduino/libraries/SD
Multiple libraries were found for "SdFat.h"
Used: /Users/nico/Library/Arduino15/packages/teensy/hardware/avr/1.59.0/libraries/SdFat
Not used: /Users/nico/Documents/Arduino/libraries/SdFat_-_Adafruit_Fork
exit status 1

Library crashes when display class is instantiated in c++ style

Using this lib with a TTGO T-Display board on Arduino framework, it crashes when the display class is instantiated:

BB_SPI_LCD *dp = NULL;

void setup() { 
dp = new BB_SPI_LCD;
dp->begin( LCD_ST7789_135, FLAGS_NONE, 32000000, 5, 16, -1, 4, -1, 19, 18);
...
}

Crash occurs in line db->begin.

Current version from master clashes with bb_captouch

The current version on the master branch clashes with the bb_captouch library, due to
bb_captouch.h:74:16: error: redefinition of 'struct _fttouchinfo'

The latest releases version works fine (due to missing touchscreen support)

Touch controller support.

Greetings,

I was wondering about touch controller support, specifically for the XPT2046.

I see that there are some touch functions outlined in the bb_spi_lcd.h file, but they have no implementations at the moment.

I know that i could use a third party library for just the touch handling, but I am very tight on free pins, so I was hoping to have the touch controller share the same pins as the lcd (aside from the CS pin of course).

I have attempted to do something similar to how TFT_eSPI implements this, but so far I havent had any success. Could you guide me a bit on this issue? How would one go about implementing device switching and clock speed changing while using the DMA. Btw, I am using an esp32-cam.

Many thanks for this library and all your work with it and JPEGDEC.

Crash when trying to draw image on ESP32

I am using BB_SPI_LCD class on ESP32 with ST7789. I can fill and draw to the LCD, but haven't been able to successfully display an image.

I tried lcd.pushImage(0,0,154,190,alien_straight_bm); with my lcd-image-converter output as described in the below header. That results in this exception:

    ret=spi_device_polling_transmit(spi, &t);  //Transmit!
    assert(ret==ESP_OK);            //Should have had no issues.

assert failed: void myspiWrite(SPILCD*, unsigned char*, int, int, int) bb_spi_lcd.cpp:1579 (ret==ESP_OK)

0x400dd9ce: myspiWrite(tagSPILCD*, unsigned char*, int, int, int) at bb_spi_lcd/src/bb_spi_lcd.cpp:1579 (discriminator 1)
0x400dda5d: spilcdWriteDataBlock(tagSPILCD*, unsigned char*, int, int) at bb_spi_lcd/src/bb_spi_lcd.cpp:1646
0x400dfb4b: BB_SPI_LCD::pushImage(int, int, int, int, unsigned short*, int) at libraries/bb_spi_lcd/src/bb_spi_lcd.cpp:6011

/*******************************************************************************

  • generated by lcd-image-converter rev.030b30d from 2019-03-17 01:38:34 +0500
  • image
  • filename: unsaved
  • name: alien154x190-straight
  • preset name: Color R5G6B5
  • data block size: 16 bit(s), uint16_t
  • RLE compression enabled: no
  • conversion type: Color, not_used not_used
  • split to rows: yes
  • bits per pixel: 16
  • preprocess:
  • main scan direction: top_to_bottom
  • line scan direction: forward
  • inverse: no
    *******************************************************************************/
    static const uint16_t alien_straight_bm[29260] PROGMEM = {

using ili9488

Hi,

I wanna to use your example but change to ILI9488 LCD
I try this very simple code but didn't display anything ???

//
// ZIP library example sketch
//
// Written by Larry Bank
// June 9, 2021
//
// This example shows how to do the following:
// - Step through all of the files in a ZIP archive
// - Display the name of each file
// - Allocate a buffer for the uncompressed file size
// - Read (decompress) the data into the buffer
// - Display the results (in this case a BMP file) on the SPI LCD
//
#include <unzipLIB.h>
#include <bb_spi_lcd.h>
// Set these to the appropriate values for your SPI LCD display
// -1 means the pin is not connected

#define TFT_MISO 39
#define TFT_CS 4
#define TFT_RST 26
#define TFT_DC 25
#define TFT_CLK 18
#define TFT_MOSI 23
#define TFT_BL 13

// Use a zip file in memory for this test
#include "bmp_icons.h"
UNZIP zip; // Statically allocate the 41K UNZIP class/structure
SPILCD lcd; // my display library

void setup()
{
Serial.begin(115200);
delay(1000); // give Serial a little time to start
spilcdInit(&lcd, LCD_ILI9488, FLAGS_NONE, 40000000, TFT_CS, TFT_DC, TFT_RST, TFT_BL, TFT_MISO, TFT_MOSI, TFT_CLK);
spilcdSetOrientation(&lcd, LCD_ORIENTATION_90); // for the ILI it's nice to use it in landscape orientation
}

void loop()
{
int rc, x, y;
char szComment[256], szName[256];
unz_file_info fi;
uint8_t *ucBitmap; // temp storage for each icon bitmap

//spilcdFill(&lcd, 0, DRAW_TO_LCD); // Erase the display to black
spilcdWriteString(&lcd, 0, 0, (char *)"Unzip BMP Files Test", 0xffff, 0, FONT_12x16, DRAW_TO_LCD); // white text on a black background
delay(5000); // Allow time to see it happen

// }
// while (1) {};
}

Backlight start but nothing appear on screen! why ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.