Minor updates
This commit is contained in:
parent
db629d87c8
commit
cb6f73558b
2 changed files with 17 additions and 17 deletions
|
@ -21,7 +21,7 @@
|
||||||
be set to the value to reflect the position the *previous* line is supposed to be on.
|
be set to the value to reflect the position the *previous* line is supposed to be on.
|
||||||
|
|
||||||
Finally, the screen has an OE input, which is used to disable the LEDs when latching new data and changing the state of the line select inputs:
|
Finally, the screen has an OE input, which is used to disable the LEDs when latching new data and changing the state of the line select inputs:
|
||||||
doing so hides any artifacts that appear at this time. The OE line is also used to dim the display by only turning it on for a limited time every
|
doing so hides any artefacts that appear at this time. The OE line is also used to dim the display by only turning it on for a limited time every
|
||||||
line.
|
line.
|
||||||
|
|
||||||
All in all, an image can be displayed by 'scanning' the display, say, 100 times per second. The slowness of the human eye hides the fact that
|
All in all, an image can be displayed by 'scanning' the display, say, 100 times per second. The slowness of the human eye hides the fact that
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
Then we ask the I2S-parallel driver to set up a DMA chain so the subframes are sent out in a sequence that satisfies the requirement that
|
Then we ask the I2S-parallel driver to set up a DMA chain so the subframes are sent out in a sequence that satisfies the requirement that
|
||||||
subframe x has to be sent out for (2^x) ticks. Finally, we fill the subframes with image data.
|
subframe x has to be sent out for (2^x) ticks. Finally, we fill the subframes with image data.
|
||||||
|
|
||||||
We use a frontbuffer/backbuffer technique here to make sure the display is refreshed in one go and drawing artifacts do not reach the display.
|
We use a front buffer/back buffer technique here to make sure the display is refreshed in one go and drawing artifacts do not reach the display.
|
||||||
In practice, for small displays this is not really necessarily.
|
In practice, for small displays this is not really necessarily.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -90,7 +90,7 @@ bool RGB64x32MatrixPanel_I2S_DMA::allocateDMAmemory()
|
||||||
if ( heap_caps_get_largest_free_block(MALLOC_CAP_DMA) < _frame_buffer_memory_required ) {
|
if ( heap_caps_get_largest_free_block(MALLOC_CAP_DMA) < _frame_buffer_memory_required ) {
|
||||||
|
|
||||||
#if SERIAL_DEBUG
|
#if SERIAL_DEBUG
|
||||||
Serial.printf("######### Insufficent memory for requested resolution. Reduce MATRIX_COLOR_DEPTH and try again.\r\n\tAdditional %d bytes of memory required.\r\n\r\n", (_frame_buffer_memory_required-heap_caps_get_largest_free_block(MALLOC_CAP_DMA)) );
|
Serial.printf("######### Insufficient memory for requested resolution. Reduce MATRIX_COLOR_DEPTH and try again.\r\n\tAdditional %d bytes of memory required.\r\n\r\n", (_frame_buffer_memory_required-heap_caps_get_largest_free_block(MALLOC_CAP_DMA)) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -125,7 +125,7 @@ bool RGB64x32MatrixPanel_I2S_DMA::allocateDMAmemory()
|
||||||
if ( heap_caps_get_largest_free_block(MALLOC_CAP_DMA) < _frame_buffer_memory_required ) {
|
if ( heap_caps_get_largest_free_block(MALLOC_CAP_DMA) < _frame_buffer_memory_required ) {
|
||||||
|
|
||||||
#if SERIAL_DEBUG
|
#if SERIAL_DEBUG
|
||||||
Serial.printf("######### Insufficent memory for second framebuffer for requested resolution. Reduce MATRIX_COLOR_DEPTH and try again.\r\n\tAdditional %d bytes of memory required.\r\n\r\n", (_frame_buffer_memory_required-heap_caps_get_largest_free_block(MALLOC_CAP_DMA)) );
|
Serial.printf("######### Insufficient memory for second framebuffer for requested resolution. Reduce MATRIX_COLOR_DEPTH and try again.\r\n\tAdditional %d bytes of memory required.\r\n\r\n", (_frame_buffer_memory_required-heap_caps_get_largest_free_block(MALLOC_CAP_DMA)) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
/* Library compile-time options */
|
/* Library compile-time options */
|
||||||
|
|
||||||
// Enable serial debugging of the library, to see how memory is allocated etc.
|
// Enable serial debugging of the library, to see how memory is allocated etc.
|
||||||
#define SERIAL_DEBUG 1
|
//#define SERIAL_DEBUG 1
|
||||||
|
|
||||||
// Experimental: Split the framebuffer into two smaller memory allocations.
|
// Experimental: Split the framebuffer into two smaller memory allocations.
|
||||||
// Can allow a bigger resolution due to the fragmented memory
|
// Can allow a bigger resolution due to the fragmented memory
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
#define MATRIX_ROWS_IN_PARALLEL 2
|
#define MATRIX_ROWS_IN_PARALLEL 2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PIXEL_COLOR_DEPTH_BITS 8 // 8bit per RGB color = 24 bit/per pixel, reduce to save RAM
|
#define PIXEL_COLOR_DEPTH_BITS 8 // 8bit per RGB color = 24 bit/per pixel, reduce to save RAM
|
||||||
|
|
||||||
/***************************************************************************************/
|
/***************************************************************************************/
|
||||||
/* ESP32 Pin Definition. You can change this, but best if you keep it as is... */
|
/* ESP32 Pin Definition. You can change this, but best if you keep it as is... */
|
||||||
|
@ -102,11 +102,11 @@
|
||||||
|
|
||||||
/***************************************************************************************/
|
/***************************************************************************************/
|
||||||
/* Keep this as is. Do not change. */
|
/* Keep this as is. Do not change. */
|
||||||
#define ESP32_I2S_DMA_MODE I2S_PARALLEL_BITS_16 // Pump 16 bits out in parallel
|
#define ESP32_I2S_DMA_MODE I2S_PARALLEL_BITS_16 // Pump 16 bits out in parallel
|
||||||
#define ESP32_I2S_DMA_STORAGE_TYPE uint16_t // one uint16_t at a time.
|
#define ESP32_I2S_DMA_STORAGE_TYPE uint16_t // one uint16_t at a time.
|
||||||
//#define ESP32_I2S_CLOCK_SPEED (20000000UL) // @ 20Mhz
|
//#define ESP32_I2S_CLOCK_SPEED (20000000UL) // @ 20Mhz
|
||||||
#define ESP32_I2S_CLOCK_SPEED (10000000UL) // @ 10Mhz
|
#define ESP32_I2S_CLOCK_SPEED (10000000UL) // @ 10Mhz
|
||||||
#define CLKS_DURING_LATCH 0 // Not used.
|
#define CLKS_DURING_LATCH 0 // Not used.
|
||||||
/***************************************************************************************/
|
/***************************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
@ -235,14 +235,14 @@ class RGB64x32MatrixPanel_I2S_DMA : public GFX {
|
||||||
|
|
||||||
// Converts RGB888 to RGB565
|
// Converts RGB888 to RGB565
|
||||||
uint16_t color565(uint8_t r, uint8_t g, uint8_t b); // This is what is used by Adafruit GFX!
|
uint16_t color565(uint8_t r, uint8_t g, uint8_t b); // This is what is used by Adafruit GFX!
|
||||||
|
|
||||||
// Converts RGB333 to RGB565
|
// Converts RGB333 to RGB565
|
||||||
uint16_t Color333(uint8_t r, uint8_t g, uint8_t b); // This is what is used by Adafruit GFX! Not sure why they have a capital 'C' for this particular function.
|
uint16_t Color333(uint8_t r, uint8_t g, uint8_t b); // This is what is used by Adafruit GFX! Not sure why they have a capital 'C' for this particular function.
|
||||||
|
|
||||||
inline void flipDMABuffer()
|
inline void flipDMABuffer()
|
||||||
{
|
{
|
||||||
if ( !double_buffering_enabled) return;
|
if ( !double_buffering_enabled) return;
|
||||||
|
|
||||||
// Flip to other buffer as the backbuffer. i.e. Graphic changes happen to this buffer (but aren't displayed until showDMABuffer())
|
// Flip to other buffer as the backbuffer. i.e. Graphic changes happen to this buffer (but aren't displayed until showDMABuffer())
|
||||||
back_buffer_id ^= 1;
|
back_buffer_id ^= 1;
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@ class RGB64x32MatrixPanel_I2S_DMA : public GFX {
|
||||||
|
|
||||||
#if SERIAL_DEBUG
|
#if SERIAL_DEBUG
|
||||||
Serial.printf("Showtime for buffer: %d\n", back_buffer_id);
|
Serial.printf("Showtime for buffer: %d\n", back_buffer_id);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
i2s_parallel_flip_to_buffer(&I2S1, back_buffer_id);
|
i2s_parallel_flip_to_buffer(&I2S1, back_buffer_id);
|
||||||
|
|
||||||
|
@ -376,8 +376,8 @@ inline uint16_t RGB64x32MatrixPanel_I2S_DMA::color565(uint8_t r, uint8_t g, uint
|
||||||
// Promote 3/3/3 RGB to Adafruit_GFX 5/6/5 RRRrrGGGgggBBBbb
|
// Promote 3/3/3 RGB to Adafruit_GFX 5/6/5 RRRrrGGGgggBBBbb
|
||||||
inline uint16_t RGB64x32MatrixPanel_I2S_DMA::Color333(uint8_t r, uint8_t g, uint8_t b) {
|
inline uint16_t RGB64x32MatrixPanel_I2S_DMA::Color333(uint8_t r, uint8_t g, uint8_t b) {
|
||||||
|
|
||||||
return ((r & 0x7) << 13) | ((r & 0x6) << 10) | ((g & 0x7) << 8) | ((g & 0x7) << 5) | ((b & 0x7) << 2) | ((b & 0x6) >> 1);
|
return ((r & 0x7) << 13) | ((r & 0x6) << 10) | ((g & 0x7) << 8) | ((g & 0x7) << 5) | ((b & 0x7) << 2) | ((b & 0x6) >> 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue