Fix: allow 80MHz clock speed

This commit is contained in:
Dorian Zedler 2024-08-20 13:12:32 +02:00
parent b67bd96067
commit 95dccdcc38
Signed by: dorian
GPG key ID: 989DE36109AFA354
2 changed files with 560 additions and 561 deletions

View file

@ -306,7 +306,7 @@ struct HUB75_I2S_CFG
bool clkphase; bool clkphase;
// Minimum refresh / scan rate needs to be configured on start due to LSBMSB_TRANSITION_BIT calculation in allocateDMAmemory() // Minimum refresh / scan rate needs to be configured on start due to LSBMSB_TRANSITION_BIT calculation in allocateDMAmemory()
uint8_t min_refresh_rate; uint16_t min_refresh_rate;
// struct constructor // struct constructor
HUB75_I2S_CFG( HUB75_I2S_CFG(
@ -498,7 +498,6 @@ public:
vlineDMA(x, y, h, r, g, b); vlineDMA(x, y, h, r, g, b);
else else
hlineDMA(x, y, w, r, g, b); hlineDMA(x, y, w, r, g, b);
} }
// rgb888 overload // rgb888 overload
virtual inline void drawFastVLine(int16_t x, int16_t y, int16_t h, uint8_t r, uint8_t g, uint8_t b) virtual inline void drawFastVLine(int16_t x, int16_t y, int16_t h, uint8_t r, uint8_t g, uint8_t b)
@ -526,7 +525,6 @@ public:
vlineDMA(x, y, h, r, g, b); vlineDMA(x, y, h, r, g, b);
else else
hlineDMA(x, y, w, r, g, b); hlineDMA(x, y, w, r, g, b);
} }
// rgb888 overload // rgb888 overload
virtual inline void drawFastHLine(int16_t x, int16_t y, int16_t w, uint8_t r, uint8_t g, uint8_t b) virtual inline void drawFastHLine(int16_t x, int16_t y, int16_t w, uint8_t r, uint8_t g, uint8_t b)
@ -550,7 +548,6 @@ public:
transform(x, y, w, h); transform(x, y, w, h);
fillRectDMA(x, y, w, h, r, g, b); fillRectDMA(x, y, w, h, r, g, b);
} }
// rgb888 overload // rgb888 overload
virtual inline void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint8_t r, uint8_t g, uint8_t b) virtual inline void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint8_t r, uint8_t g, uint8_t b)
@ -558,7 +555,6 @@ public:
transform(x, y, w, h); transform(x, y, w, h);
fillRectDMA(x, y, w, h, r, g, b); fillRectDMA(x, y, w, h, r, g, b);
} }
#endif #endif
@ -572,8 +568,8 @@ public:
#endif #endif
#ifdef NO_GFX #ifdef NO_GFX
inline int16_t width() const { return m_cfg.mx_width * m_cfg.chain_length; } inline int16_t width() const { return m_cfg.mx_width * m_cfg.chain_length; }
inline int16_t height() const { return m_cfg.mx_height; } inline int16_t height() const { return m_cfg.mx_height; }
#endif #endif
void drawIcon(int *ico, int16_t x, int16_t y, int16_t cols, int16_t rows); void drawIcon(int *ico, int16_t x, int16_t y, int16_t cols, int16_t rows);
@ -603,12 +599,9 @@ public:
dma_bus.flip_dma_output_buffer(back_buffer_id); dma_bus.flip_dma_output_buffer(back_buffer_id);
//back_buffer_id ^= 1; // back_buffer_id ^= 1;
back_buffer_id = back_buffer_id^1; back_buffer_id = back_buffer_id ^ 1;
fb = &frame_buffer[back_buffer_id]; fb = &frame_buffer[back_buffer_id];
} }
/** /**
@ -716,11 +709,11 @@ protected:
clearFrameBuffer(0); clearFrameBuffer(0);
brtCtrlOEv2(brightness, 0); brtCtrlOEv2(brightness, 0);
if (m_cfg.double_buff) { if (m_cfg.double_buff)
{
clearFrameBuffer(1); clearFrameBuffer(1);
brtCtrlOEv2(brightness, 1); brtCtrlOEv2(brightness, 1);
} }
} }
@ -777,7 +770,7 @@ private:
/** /**
* @brief - DP3246-family chips initialization routine * @brief - DP3246-family chips initialization routine
*/ */
void dp3246init(const HUB75_I2S_CFG& _cfg); void dp3246init(const HUB75_I2S_CFG &_cfg);
/** /**
* @brief - reset OE bits in DMA buffer in a way to control brightness * @brief - reset OE bits in DMA buffer in a way to control brightness
@ -841,7 +834,6 @@ protected:
Bus_Parallel16 dma_bus; Bus_Parallel16 dma_bus;
private: private:
// Matrix i2s settings // Matrix i2s settings
HUB75_I2S_CFG m_cfg; HUB75_I2S_CFG m_cfg;
@ -855,9 +847,9 @@ private:
frameStruct frame_buffer[2]; frameStruct frame_buffer[2];
frameStruct *fb; // What framebuffer we are writing pixel changes to? (pointer to either frame_buffer[0] or frame_buffer[1] basically ) used within updateMatrixDMABuffer(...) frameStruct *fb; // What framebuffer we are writing pixel changes to? (pointer to either frame_buffer[0] or frame_buffer[1] basically ) used within updateMatrixDMABuffer(...)
volatile int back_buffer_id = 0; // If using double buffer, which one is NOT active (ie. being displayed) to write too? volatile int back_buffer_id = 0; // If using double buffer, which one is NOT active (ie. being displayed) to write too?
int brightness = 128; // If you get ghosting... reduce brightness level. ((60/64)*255) seems to be the limit before ghosting on a 64 pixel wide physical panel for some panels. int brightness = 128; // If you get ghosting... reduce brightness level. ((60/64)*255) seems to be the limit before ghosting on a 64 pixel wide physical panel for some panels.
int lsbMsbTransitionBit = 0; // For colour depth calculations int lsbMsbTransitionBit = 0; // For colour depth calculations
/* ESP32-HUB75-MatrixPanel-I2S-DMA functioning constants /* ESP32-HUB75-MatrixPanel-I2S-DMA functioning constants
* we should not those once object instance initialized it's DMA structs * we should not those once object instance initialized it's DMA structs

File diff suppressed because it is too large Load diff