Giter VIP home page Giter VIP logo

esp32lib's Introduction

bitluni's ESP32Lib

ESP32Lib is a collection features for the ESP32 including highest performance VGA graphics (sprites, 3D), sound and game controllers packed in an Arduino library. Check out https://youtube.com/bitlunislab for project updates

If you found it useful please consider supporting my work on

Patreon https://patreon.com/bitluni Paypal https://paypal.me/bitluni

Acknowledgements

Thanks to Ivan Grokhotkov & Jeroen Domburg (aka Sprite_tm) for their great work on I2S revealing some nitty-gritty details and quirks of the ESP32. Special thanks to Fabrizio Di Vittorio for the inpiration to look deeper into 8Bit modes enabling higher resolutions. He developed the FabGL library simultaneously.

License

bitluni 2019 Creative Commons Attribution ShareAlike 4.0 https://creativecommons.org/licenses/by-sa/4.0/

If you need another license, please feel free to contact me

Documentation

Installation

This library only supports the ESP32. I be able to install the ESP32 features in the board manager you need to add an additional Boards Manager URL in the Preferences (File -> Preferences)

https://dl.espressif.com/dl/package_esp32_index.json

The ESP32Lib can be found in the Library Manager (Sketch -> Include Library -> Manage Libaries) To be able to use the library featues the main header needs to included in the sketch

#include <ESP32Lib.h>

VGA Features

ESP32Lib implements VGA output over I²S.
The highest possible resolution with this library is 800x600. Many common resolutions like 320x240 are preconfigured und can be used without any effort. Two color depths are available. 14Bit R5G5B4 and 3Bit(8 color) R1G1B1 for convenience and memory savings.

To simplify things you can find boards specially designed to work with this library in my shop: https://www.tindie.com/stores/bitluni/ Any purchase supports the further development. Thanks!

Predefined Pin Configurations

A simplified way to configure the pins for shields from my tindie store is using the default predefined configurations VGAv01, VGABlackEdition, VGAWhiteEdition, PicoVGA like this:

vga.init(vga.MODE320x200, vga.VGABlackEdition); 

Pin configuration

An VGA cable can be used to connect to the ESP32 The connector pins can be found here: https://en.wikipedia.org/wiki/VGA_connector The 3Bit modes are very easy to set up. You can connect the Ground, Red, Green, Blue, hSync and vSync to output pins of the ESP32.

3Bit color setup

The 14Bit mode require a resistor ladder to be set up for each color (DAC) as shown here

14Bit color setup

There are limitation on which the VGA output an DACs can work:

I/O GPIO pads are 0-19, 21-23, 25-27, 32-39 Input/Output GPIOs are 0-19, 21-23, 25-27, 32-33. GPIO pads 34-39 are input-only.

Beware of pin 0. It selects the boot mode. It's not suitable for color channels and might cause problems as sync signals as well.

Pin 5 is often tied to the LED but can be used as hSync if you don't need the LED. I²C is on 21 (SDA), 22(SCL) DACs are 25, 26 ins 1(TX), 3(RX) sould only be used if really don't need to communicate anymore.

Here is an overview for your convenience: (0), 2, 4, (5), 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 27, 32, 33

Usage

There are 4 diffent VGA Drivers VGA3Bit, VGA3BitI, VGA14Bit and VGA14BitI. VGA3Bit, VGA14Bit are the high performance drivers that don't need any CPU time to serve the VGA. However the VGA3Bit driver takes twice the memory compared to VGA3BitI. The high performace drivers work the best with the WiFi features. The other driver might cause errors. WiFi should connect first before VGA3BitI and VGA14BitI is initialized. The I drivers are using an interrupt to feed the pixels to the I²S. This feature can be used for realtime outputs (Check the VGANoFramebuffer example). An instance of the driver has to be created. The optional parameter (only for 14 bit versions) is the I²S bus to be used. If no parameter is given 1 is used by default to keep I²S0 free for audio output.

VGA14Bit vga(1);

Creating the instance does nothing until the init method is called once. The driver will initialize with one frame buffer by default (that's the memory where the pixels are stored). Showing animated using only one frame buffer will cause flickering since the frame will be displayed while it is redrawn. To have smooth animations double buffering is recommended. A second - the back buffer - is used to paint the graphics in the back ground. When the rendering is finished the front and back buffer are flipped. The disadvantage of the second buffer is the doubled memory requirements. 320x240 will no longer work (320x200 will). Double buffering is enabled using

vga.setFrameBufferCount(2);

before the init method is called (not calling it will result in a single buffer init)

vga.init(vga.MODE320x200, redPins, greenPins, bluePins, hsyncPin, vsyncPin);

The R, G and B pins are passed as arrays for the 14Bit driver and as single integers for the 3Bit version. Please try the examples The following modes are predefined:

  • MODE320x480
  • MODE320x240
  • MODE320x120
  • MODE320x400
  • MODE320x200
  • MODE360x400
  • MODE360x200
  • MODE360x350
  • MODE360x175
  • MODE320x350
  • MODE320x175
  • MODE400x300
  • MODE400x150
  • MODE400x100
  • MODE200x150
  • MODE500x480
  • MODE500x240
  • MODE800x600
  • MODE720x400
  • MODE720x350
  • MODE640x480
  • MODE640x400
  • MODE800x600

These native modes require a too high pixel clock but can be used as a base to create a custom resolution. Please check out the VGACustomResolution example:

  • MODE1280x1024
  • MODE1280x960
  • MODE1280x800
  • MODE1024x768

2D features

The vga instance implements several drawing methods that can be seen in the VGA2DFeatures example. A complete list will be available in an API documentation soon...

Converting 3D Meshes

The Utilities folder provides a convenient StlConverter that you can use directly from the browser. No worries, your files are not uploaded. Make sure your STL is low poly. The 3D example use a model with < 5000 triangles.

Converting Sprites and Images

The Utilities folder provides a convenient SpriteEditor that you can use directly from the browser. No worries, your files are not uploaded. The correct pixel format for VGA14Bit and VGA3Bit is R5G5B4A2 (that will be improved in future). You can import PNG files to use transparency. Each sprite has the origin in the center by default. You can modify it by changing the x/y values of the first point definition. Clicking on the image creates additional points that can be used for other purpouses like hit boxes etc.

esp32lib's People

Contributors

bitluni avatar martin-laclaustra avatar yonliud 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  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  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

esp32lib's Issues

Which Core Question

Hi - ive made the VGA 14 bit resistor network which worked well (though my OLD SCRAP monitored died a couple of days later - voltages all seem < 0.7v so dont think it was a problem) and im wondering about which cpu core the interrupt code is running on. Im assuming core 1 but is there any means to decide which core to run the ISR on?

This of course leaves the other main core free to run the application code so im assuming that using pure ISR mode wont be a problem to generate higher resolutions so long as the application runs on the other CPU core even if its paused whist in ISR (unsure thats correct or not) ?

how to export .h 3d model ???

how to export .h 3d model as the one from the example the thinker.h . I i tried with a cmd tool but nothing from the side of eps32 also i tried a way via Euphoria/Blender but again no luck. If eny one can help i will be grateful.

VGADemo14Bit.ino and schematic.png: R2/R3 pin definitions

It seems, that in the schematic the pins of R2 and R3 are swapped accidentially (or in the example :-) ).
Schematic says R2 -> pin 13 and R3 -> pin 12, example says R2 -> pin 12 and R3 -> pin 13.
Should be clarified/corrected.

Can't compile any example sketch

I'm trying to compile the VGAHelloWorld example, but every time I try to upload it, the Arduino IDE just fails.
I'm using Arduino IDE 1.8.10

`In file included from c:\users\varga\documents\arduino\libraries\bitluni_esp32lib\src\i2s\DMABufferDescriptor.h:13:0,
from c:\users\varga\documents\arduino\libraries\bitluni_esp32lib\src\i2s\i2s.h:23,
from C:\Users\varga\Documents\Arduino\libraries\bitluni_ESP32Lib\src/VGA/VGA.h:14,
from C:\Users\varga\Documents\Arduino\libraries\bitluni_ESP32Lib\src/VGA/VGA14BitI.h:13,
from C:\Users\varga\Documents\Arduino\libraries\bitluni_ESP32Lib\src/ESP32Lib.h:3,
from C:\Users\varga\Documents\Arduino\libraries\bitluni_ESP32Lib\examples\VGAHelloWorld\VGAHelloWorld.ino:6:

c:\users\varga\documents\arduino\libraries\bitluni_esp32lib\src\i2s\DMABufferDescriptor.h: In static member function static void** DMABufferDescriptor::allocateDMABufferArray(int, int, bool, long unsigned int):

c:\users\varga\documents\arduino\libraries\bitluni_esp32lib\src\tools\log.h:25:59: error: exception handling disabled, use -fexceptions to enable

#define ERROR(a) {Serial.println((a)); delay(3000); throw 0;};

c:\users\varga\documents\arduino\libraries\bitluni_esp32lib\src\i2s\DMABufferDescriptor.h:34:4: note: in expansion of macro ERROR

ERROR(Not enough DMA memory);

Multiple libraries were found for ESP32Lib.h
Used: C:\Users\varga\Documents\Arduino\libraries\bitluni_ESP32Lib
exit status 1
Error compiling for board ESP32 Dev Module.`

Interrupt modes crash when accessing SPIFFS or Wifi

Dear Matthias, thank you for all your work. You have been an inspiration for my interest in microcontrollers.

The part of your code that uses DMA interrupt works if used alone, but crashes when using SPIFFS and/or wifi, which is a big limitation for their use.
Your appreciation of the problem in #31 ("interrupt based version of the driver [...] needs a lot of cpu power") was no spot-on this time.
I tested it this way: initialized/connected SPIFFS or Wifi (with server) before vga.init. The microcontroller was stable (occasional crash) until a request to the server was done, or SPIFFS was accessed File root = FILESYSTEM.open("/","r");.
Then, an exception was raised: Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed)
The exception decoder showed that flash was being accessed (through SPI) (also happened in wifi usage, without SPIFFS), and the conflict was in the static function interrupt of the I2S object.
All documentation of the error pointed to lack of use of IRAM attribute for functions and DRAM for consts.

I tracked this error to several problems:

  • Interrupt clearance through the i2s object was not safe i2s.int_clr.val = i2s.int_raw.val;.
  • A call to a member function was not safe (tested several options).

I worked out a solution, which is implemented in pull request #37.
Unfortunately wifi usage caused losing vSync and the screen needed some seconds to recover.
Thus, I further worked on a solution, to make hSync and vSync independent of the rendering routine in the interrupt, which is implemented in pull request #38. (You can ignore the previous pull request, which is there to provide you with understanding of the changes)
This code suffers only almost imperceptible glitches during wifi usage.

I hope that you find these changes interesting and worthwhile.

By the way, VGA6BitI had an error in

int p0 = (line[j] >> 0) & 7;

which is also fixed.

[Question] font size

Great project.

I order the board and I cant wait to start playing with it.
in my project, I will need very big fonts (5 numbers will fill all the screen).
I have to create a new file in the ressources but for the moment i don't know how.
any suggestion will be appreciated.

thank you

Printing "special" methods get strange results

I love this library!!! Thank you!!

It is much easier for me to experiment with. So of course I used it to continue an experiment I have of dumping Serial debug text to various displays when using the Blynk IoT App

Anyhow... the story is here -

https://community.blynk.cc/t/my-attempts-at-transferring-blynk-print-to-various-displays/21649/37

But the issue/question I have is how to vga.print(char(<ASCII value>)) and actually get the character and not the decimal value?

I also noticed some strange buffer dumps or something (that ended up showing the ASCII text from before) when printing things like this vga.print(uptime + ", "); as in my example in the link.

Yes, I know I am using this library in a strange way... but hey it sorta worked :)

2019-02-19 03 29 42

VGA I2S will interrupt the ESP32 on deep sleep

Hi there,

I was trying to use VGA library for a battery powered ESP32 which has a deep sleep button.

It seems as result of I2S interrupt the device goes to deep sleep but wakes up immediately.

Is there any way to disable I2S interrupt just before we go to sleep mode?

Thanks a lot.

Halting after vga.init

I used your example code VGAHelloWorld, added some Serial messages and tried it. They were printed until vga.init(...); the next messages are not shown and further code is not executed either.
I also tried using other pins.
I'm using the Wemos ESP32 (small blue one), that you also showed in your video.

Thank you for helping!

vga.init conflict with SPIFFS?

I am trying to use a SPIFFS filesystem in conjunction with your vga library. If I do all of my SPIFFS calls before doing vga.init() everything seems to work fine. However, if I try to do any SPIFFS operations after vga.init() I get crashes and core dumps

I am using pins 21, 22, 18, 19, 4, 5, 23, 15 for VGA

For example, the following code fails, but if I move the vga.init call as indicated, it all works fine

if(!SPIFFS.begin(true)){
Serial.println("An Error has occurred while mounting SPIFFS");
return;
}

Serial.println("About to call vga.init");
vga.init(vga.MODE400x300, redPin, greenPin, bluePin, hsyncPin, vsyncPin);

unsigned char * ram = nas.ram;
File file = SPIFFS.open("/lollipop.bin");
long len = file.size();
file.read(ram + 0x1000, len);
file.close();

// <-- move vga.init call to here and it works fine -->

by "fails" I mean the arduino serial console reports:

About to call vga.init
I2S TX
Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed)
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x400f53d0: bad00bad bad00bad bad00bad

I don't want to be rash and call this a "bug" but I'd be interested in any theories of why your vga library would interact badly with SPIFFS

thanks.

Neal.

Idea: keyboard/swipe input from iPhone via QR code

If you display a QR code on the screen, simply pointing an iPhone/iPad camera at it will scan the QR code - no app needed.

If the qr code contains a URL then it will ask the iPhone user and open the URL.

You could point that URL to a link local address https://en.wikipedia.org/wiki/Link-local_address like http://bitluni.local here is the QR code for http://bitluni.local which I made just using an online QR code generator https://imgur.com/MXRkYSV - try pointing your phone camera at it! (update: Actually I'm not sure if iPhones can access .local addresses, I'll have to check. update2: checked, .local addresses work OK on iPhone)

The link local named address (http://esp32fs.local) technique is seen here: https://github.com/espressif/arduino-esp32/blob/master/libraries/WebServer/examples/FSBrowser/FSBrowser.ino I believe it is done via ESPmDNS.h

You can then serve a page from the esp32 to the iphone and use websockets to send keystrokes from the iPhone to the esp32.

If you got really fancy you could actually send touch gestures like swipes from the phone to the esp32 to give the bitluni graphics a touch/swipe interface.

I don't know if Android camera is able to scan QR codes.

Taking it even further, you could send sounds from the esp32 to the phone web page to give sound output. Or as a game control input - multiple people could connect this way and play party games.

By the way, using QR codes is also a good way to send your YouTube audience to your Tindie page :-)

Update - sorry I see here you are already sending input from phone keyboard - so it's not a new idea https://www.youtube.com/watch?v=qJ68fRff5_k

Requesting an MIT license for the I2S interface code and DMA buffer

Hello. I've been watching your videos and I've decided to buy an ESP32 and a parallel ILI9341 display since it seems that ESP32 is the only microcontroller fast enough to drive a full 320x240x16bit@60fps display. I would like to use your I2S interface code and the DMA buffer code, but my project is going to be licensed under the MIT license which is incompatible with your ShareAlike license. Could you please give me an MIT license for this piece of code? I would also be very thankful if you could also give me instructions on how to drive my ILI9341 display with that piece of code. I'm thinking of using a scanline buffer rather than a framebuffer too and that requires very precise timing to prevent screen tearing.

Thank you.
Best regards,
Zvoc

Jitter

I experienced a noticeable jitter in the image which i thought may be resolved when i put a cheap VGA->HDMI adaptor directly on the prototype board screw terminal VGA connector. It didn't resolve it though i was sure it wasnt a sync/clock problem as described in the videos.

What eventually resolved it was when i purchased a small pack of 8 snap shut ferrite cores from Amazon with an 3mm tube down the centre. I put them on all the colour digital lines bunching a few wires together, then one on the three DAC output RGB lines, two on the USB power line (one at each end) and one around the H & V sync and the jitter has now gone.

Obviously it was picking up some RF interference from local power supplies or a noisy mains device which is why lots of devices have internal metal shielding.

esp32 VGA visual programming

Hello,
i've made block for ardublock for programming the vga
i will publish when it's debug (it s in french and english, the screen is in french)

image 3

and i ve made an app to have direct link in arduino to the sprite editor

image 2
unzip in arduino/tools
SpriteEditor.zip

vga connector

hello,
just for information
there is some VGA connecteur maybe easier and quicker
image
image 1
i don't know where to post his information so i make an issue

ESP-WROOM32 vga not working

Hi,

Im trying to get 3bit work with WROOM32 chip, and i get no video (hello world code).. tryed some commom resolutions with no success, checked cable and pinnout.. dunno what else i can do.. please help! Thank you very much

Implementation of text mode with little memory requirements

Following the line of modes requiring low-memory I have implemented a text-only mode.
It can use fonts already available.
It is a "monochrome" mode like 1-bit, meaning that it can be used as pure monochrome (connect only 3 pins: signal-hsync-vsync) or be used for a dual color screen (palette of two colors) (connect 5 pins).

VGAWiFiTextTerminal_demo not conect

I tried a lot of routines and the display works fine. But only this program, the IP address generated by the phone connection: 192.168.4.1 cannot be connected. The display has been shown to connect to WiFi and generate an IP address, and the phone is connected to the same WiFi. However, the page cannot be opened.
I hope I can get your help, thank you.

[Question] ESP32-WROVER PSRAM

Since the VGA is using practically the whole amount of ram on a high resolutions I wonder if the lib can utilize the WROVER additional PSRAM which it have, instead of using the normal RAM?

font creation

hi, is there a manual or tool for creating a font?
I need to add the Cyrillic alphabet, but I can’t understand how

Any plans for a 6-bit variant?

Maybe somebody has already fiddled with a 6-bit variant using 2 GPIO pins per (R,G,B) channel, this would greatly simplify the resistor ladder (only one resistor for each GPIO pin) yet offer 4 color depths per channel for a total of 64 colors. Asking because the 3-bit variant is not sufficient for showing text mode art, yet the 14-bit variant has considerable more requirements for a beginning electronics enthousiast that wants to get started with VGA based projects.

Keep up the great work, loving this library!

make a model

Hello,
great job, it's an awesome librarie.
i arrived to display the thinker and the venus just by connecting the rgb pin and vsync, hsync
i would like to display my own model
i know how to produce stl or obj file of my 3dmodel
but i don' know to transforme them in vertices.
which software could i use to do it ? thanks a lot
img_20190205_225618
img_20190205_230105

Use the library inside a thread

Hello.
I am trying the standard way of working with threads, but seems like I cant make it hapen.
Is there a way to make it work in a thread ?

void setup()
{
	xTaskCreatePinnedToCore(
		Task1code,   /* Task function. */
		"Task1",     /* name of task. */
		286720,       /* Stack size of task */
		NULL,        /* parameter of the task */
		1,           /* priority of the task */
		&Task1,      /* Task handle to keep track of created task */
		0 );          /* pin task to core 0 */
	delay( 500 );
}

void Task1code( void * pvParameters )
{
	
	//Serial.println( xPortGetCoreID() );
	vga = new VGA3BitI();
	vga->setFrameBufferCount( 2 );
	//initializing the graphics mode
	vga->init( vga->MODE640x400, redPin, greenPin, bluePin, hsyncPin, vsyncPin );
	//setting the font
	vga->setFont( Font6x8 );
	//clearing with white background

	vga->clear( vga->RGB( 0xffffff ) );
	//text position
	vga->setCursor( 10, 10 );
	//black text color no background color
	vga->setTextColor( vga->RGB( 0 ) );
	//show the remaining memory
	vga->print( "free memory: " );
	vga->print( ( int )heap_caps_get_free_size( MALLOC_CAP_DEFAULT ) );
	//draw the logo
	//bitluni( 150, 60, 20 );
	delay( 200 );

	for( ;;)
	{
		vga->clear( 0 );
		drawMenu();
		vga->show();
	}
}

Advanced modes and refactoring suggestions

Dear Matthias,
I am working in refactoring several parts to ease code comprehension, increase modularity, and allow more flexibility for expanding the library.
All my suggested changes are explained in detail in the commit messages in the "advanced_redesign" branch of my fork (commits starting from "Graphics class redesign" to "In ESP32Lib.h exclude old composite video modes"):
https://github.com/Martin-Laclaustra/martin-laclaustra_ESP32Lib/tree/advanced_redesign

I am not creating a pull request for this until you can look into it and agree that it is a step forward.

I started with the Graphics class, but I am going to visit other classes as well. I aim to keep all changes ordered (one class at a time) to help understanding what is going on in the code.
I needed to start this refactoring because before, the structure was holding back development of new modes that I have been preparing.
Also, it took me some effort to understand the overall design and I would like to clear the path for other collaborators that want to contribute (some documenting tasks are also planned).

So far, the modes I developed were modular (independent patches) and fully compatible with the current status of your master branch.
This refactoring is based on my "advanced" branch, which is your master branch with all my patches merged in.
Until you can review and comment on the specific changes, anyone can use and/or test the new modes by downloading the branch from my repository:
git clone -b advanced https://github.com/Martin-Laclaustra/martin-laclaustra_ESP32Lib.git
I will go on with new modes in the redesigned branch, that will also be available and functional to anyone who want to use it:
git clone -b advanced_redesign https://github.com/Martin-Laclaustra/martin-laclaustra_ESP32Lib.git

Regards,
Martin

How to deal with "i2s_dev_t does not refer to the unqualified type"

I followed you step to build an arduino ide environment for ESP32VGA, and I got this error when I try to run helloworld prog. Now I have no idea how to fix it. Could you please tell me how to loacte the source of this error. Thank you for your help in advance.

In file included from C:\Users\MECHREV.X8TI\Documents\Arduino\libraries\bitluni_ESP32Lib\src\I2S\I2S.h:18:0,

                 from C:\Users\MECHREV.X8TI\Documents\Arduino\libraries\bitluni_ESP32Lib\src\I2S\I2S.cpp:12:

E:\Program Files (x86)\Arduino\hardware\arduino-esp\esp32/tools/sdk/include/soc/soc/i2s_struct.h:458:18: error: 'i2s_dev_t I2S0', declared using anonymous type, is used but never defined [-fpermissive]

 extern i2s_dev_t I2S0;

                  ^

E:\Program Files (x86)\Arduino\hardware\arduino-esp\esp32/tools/sdk/include/soc/soc/i2s_struct.h:457:3: note: 'typedef volatile struct<anonymous> i2s_dev_t' does not refer to the unqualified type, so it is not used for linkage

 } i2s_dev_t;

   ^

E:\Program Files (x86)\Arduino\hardware\arduino-esp\esp32/tools/sdk/include/soc/soc/i2s_struct.h:459:18: error: 'i2s_dev_t I2S1', declared using anonymous type, is used but never defined [-fpermissive]

 extern i2s_dev_t I2S1;

                  ^

E:\Program Files (x86)\Arduino\hardware\arduino-esp\esp32/tools/sdk/include/soc/soc/i2s_struct.h:457:3: note: 'typedef volatile struct<anonymous> i2s_dev_t' does not refer to the unqualified type, so it is not used for linkage

 } i2s_dev_t;

   ^

exit status 1

[Question] Any hints/examples how to deal with displaying color bitmaps?

Hi,

previously i used FabGL for some VGA display experiments. There it was straightforward for me to display a bitmap graphic (converted to a char array).
With ESP32Lib i am not really aware how to deal with color bitmaps, how to convert them to the right format (want to use 6 bits) and so on. There seems to be no example for that and the source code is the best documentation i can get.

Any hints or examples where i can see how to deal with color bitmaps?

Thanks.

Regards, Thorsten

Solving vsync in non-interrupt driver versions

You pose the problem here:

//TODO read the I2S docs to find out

There is a solution. You need to use the interrupt though. Nevertheless I think I solved all the stability problems (see #39 ).
The interrupt could be used just to read the buffer descriptor address of the DMA buffer just outed, to update dmaBufferDescriptorActive and then work currentLine from that (you implemented lines split in two buffers).
This is how I did in the interrupt versions:

DMABufferDescriptor *currentDmaBufferDescriptor = (DMABufferDescriptor *)REG_READ(I2S_OUT_EOF_DES_ADDR_REG(staticthis->i2sIndex));
staticthis->dmaBufferDescriptorActive = ((uint32_t)currentDmaBufferDescriptor - (uint32_t)staticthis->dmaBufferDescriptors)/sizeof(DMABufferDescriptor);

staticthis is just a this pointer I prepared to be used in a static function.
Also in that code I assume (I know because I create it so in the same source file) that descriptors are in an array block. This might be assuming too much if we want to implement a more generic code.

I would implement updating dmaBufferDescriptorActive in i2s.cpp, and I would search for the pointer through the linked list (after doing some timing measurements - we do not want to bog the ISR), to avoid assuming the block layout.

I could prepare some draft code for that if you are interested.

Problems in 6 bit mode

Hi.

I am using esp32lib in a ZX spectrum emulator (https://github.com/rampa069/ZX-ESPectrum) and it works fine in 3 and 14 bits. but when in 6 bits (dont need the 14 bits and RAM memory is a needed resource) seems that the osd is not working at all. The emulation only uses init,clear and dotfast, the osd uses rect, and print. Are all the primitives working in 6bit?

Thanks in advance.

Ideas and performance improvements for the 3D engine.

Quaternions require less computation to rotate than matrices and have no real drawbacks. It will make the transformation in your 3D engine even faster. They are a little unintuitive to use API-wise, but that can be fixed with Quaternion to / from Euler methods.

Possible to add texture mapping?

VGANoFrameBuffer

Hello,
i've seen you're exemple with VGANoFrameBuffer
it work perfectly.

is it possible to mixe it with wifi connection and
juste :
const int redPin =
const int greenPin =
const int bluePin =
const int hsyncPin =
const int vsyncPin =

i don't arrived to mixe all them together.
thanks a lot

[Doubt] SPI

Not a problem, but can we still use some SPI channel, using vga 14 bits, without sacrificing performance?

Monochrome grayscale output without extra components

Colors are great, but sometimes increasing the number of possible tones is preferable to changing hue.
I implemented ( #46 ) a solution to display 55 (or 256 if a voltage divider is used) levels of grey, or the same number of color tones of a particular hue depending on the combination of vga channels connected to the output pin.
This solution works connecting only 3 pins.

Best way to draw many pixels at once?

I'm working on a project that involves drawing a bunch of pixels at once. I ahve looked through waht documentation I can find and the examples. The problem is drawing abunch of single points in a row is very slow. Is there a way to feed the library an array of pixels or soemthing, so it will draw them all all at one? or is the best solution to try and compute them into a combination of rects and lines and draw those?

ESP32VGA + IR Receiver

Hi,

I'm trying to use esp32 vga with ir remote receiver but i get a weird problem..

IR receiver works fine, until i use two or more vga.print commands and it stop updating ir signals.

IR library is: <IRremoteESP8266.h>

Thanks for any help!

Change resolution while running

Your VGA-Lib is pure wizardry!
I am trying to change the resolution while the system is running (using setResolution).
But it does not change the resolution it self and seems to allocate new frameBuffers - which causes the ESP32 to crash after 2 calls.
It would be nice to have the possibility to change the Y-resolution e.g. switch between MODE400x300 and MODE 400x150. ("hires/no-back-buffer" or "lowres/with-back-buffer")
Is this possible? Or can you give me a clue how to implement this.
As I understood from reading the code the I2S really pumps directly the content of the active frameBuffer to the pins (including the sync-signals).
Keep up the good work!
Gunter

OTA Updates not working when using VGA3Bit mode

I can only get OTA working when using VGA3BitI, the interupt vesion of the driver, but want to use the VGA3Bit high performance driver so the CPU doesn't have to do much. Anyone know whats going on

Composite color

I updated PR #47 with code to produce color composite signals.
Drawing on the canvas is slow but colors are bright and nice!
NTSC color works well in all TVs I checked (CRT and LCD), through DAC or through R2R.
PAL color works in CRT TVs. Maybe the code needs to be reviewed because I hacked the formula to get the right colors. In LCD TV only green and blue appeared. PAL at the programmed frequency did not always work (no image) with my toy ladder. It should be tested with your hardware. However, a lower frequency produced PAL colors in my ladder (see example), although the frequency is too low and vertical black bars appear.

1-bit implementation

Some projects only need black and white displays or only have such. It would be nice to have one.

Higher resolutions than 200x150 or 320x240?

Hi,
I am using an AZ-Delivery ESP32 DevkitC (ESP-WROOM-32) and tried out the 14Bit VGA.
The examples VGADemo14Bit, VGASprites and VGA3DEngine are working well so far, but when i try to set a higher resolution, the ESP32 runs into a boot loop caused by an unhandeled exception:

Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x400d12c7  PS      : 0x00060f30  A0      : 0x800d1328  A1      : 0x3ffb1e60  
A2      : 0x00000258  A3      : 0x00000640  A4      : 0x00000000  A5      : 0x3ffb8484  
A6      : 0x000000ae  A7      : 0x3ffb81cc  A8      : 0x00000000  A9      : 0x3ffb1e40  
A10     : 0x00000000  A11     : 0x00000001  A12     : 0x00000000  A13     : 0x00000003  
A14     : 0x00000003  A15     : 0x00060823  SAR     : 0x00000000  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000000  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xffffffff  

Backtrace: 0x400d12c7:0x3ffb1e60 0x400d1325:0x3ffb1e90 0x400d1335:0x3ffb1eb0 0x400eb7dd:0x3ffb1ed0 0x400eb61b:0x3ffb1ef0 0x400eb5fe:0x3ffb1f10 0x400d23bc:0x3ffb1f30 0x400d1385:0x3ffb1f50 0x400d2d2b:0x3ffb1fb0 0x400874a9:0x3ffb1fd0

What do i have to do to get higher resolutions? My intention was to use 800x600 for a project, at least 640x480, but currently i don't know how to get those modes work.
Any ideas/hints/solutions?

Regards, Thorsten

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.