board707 / DMD_STM32

STM32Duino library for RGB, Monochrome and Two-color led matrix panels
GNU General Public License v3.0
64 stars 21 forks source link

Add a new panel p4 80x40 s10 TC7258, DP5125 #88

Closed OkSingra closed 6 months ago

OkSingra commented 6 months ago

IMG_20240312_130207

Panel description

Dimensions (in pixels) : 80x40

Scan factor: 1/10

Chips on rear side: TC7258, DP5125, HCT245

Panel photos

IMG_20240312_115759 IMG_20240312_115807

Sample videos

https://youtu.be/0p1VcwUeOEg?si=G7sypG-Y_HRYbILC

Specifications

board707 commented 6 months ago

Hi I am on vacation now, I'll return after 20th of March

board707 commented 6 months ago

Hi Which patern used in your video?

OkSingra commented 6 months ago

DMD_RGB <RGB32x16plainS4, COLOR_4BITS> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER);

board707 commented 6 months ago

Hmmm...

Please, add the line

#define RGB80x40_S10_OKSingra       4,80,40,10,2    

and show the video with this pattern.

OkSingra commented 6 months ago

https://youtu.be/CrBiFKOpCQ8?si=rMaDW9aubWuPBPhj

board707 commented 6 months ago

Thank you. Add this code after #include DMD_RGB.h line

#define RGB80x40_S10_OKSingra       4,80,40,10,16   
template <int MUX_CNT, int P_Width, int P_Height, int SCAN, int COL_DEPTH>
class DMD_RGB<MUX_CNT, P_Width, P_Height, SCAN, 16, COL_DEPTH> : public DMD_RGB_BASE2<COL_DEPTH>
{
public:
    DMD_RGB(uint8_t* mux_list, byte _pin_nOE, byte _pin_SCLK, uint8_t* pinlist,
        byte panelsWide, byte panelsHigh, bool d_buf = false) :
        DMD_RGB_BASE2<COL_DEPTH>(MUX_CNT, mux_list, _pin_nOE, _pin_SCLK, pinlist,
            panelsWide, panelsHigh, d_buf, COL_DEPTH, SCAN, P_Width, P_Height)
     {
      this->fast_Hbyte = false;
      this->use_shift = false;
      }
    // Fast text shift is disabled for complex patterns, so we don't need the method
    void disableFastTextShift(bool shift) override {}

protected:
    uint16_t get_base_addr(int16_t& x, int16_t& y) override {
        this->transform_XY(x, y);
        uint8_t pol_y = y % this->pol_displ;
                static const uint8_t pix_base = 16;
        x += (y / this->DMD_PIXELS_DOWN) * this->WIDTH;
        uint16_t base_addr = (pol_y % this->nRows) * this->x_len +
            (x / pix_base) * this->multiplex * pix_base +
            x % pix_base ;
        if (pol_y < this->nRows)  base_addr += pix_base;

               return base_addr;
    }
};
OkSingra commented 6 months ago

Everything works fine Thanks

board707 commented 6 months ago

I will be glad if the library turns out to be useful.