boolean RA8876_common::ra8876Initialize() {
RA8876_SW_Reset(); <--------------------------
// Init PLL
if (!ra8876PllInitial())
return false;
// Init SDRAM
if (!ra8876SdramInitial())
return false;
lcdRegWrite(RA8876_CCR); // 01h
#if defined(USE_SPI)
lcdDataWrite(RA8876_PLL_ENABLE << 7 | RA8876_WAIT_NO_MASK << 6 | RA8876_KEY_SCAN_DISABLE << 5 | RA8876_TFT_OUTPUT24 << 3 |
RA8876_I2C_MASTER_DISABLE << 2 | RA8876_SERIAL_IF_ENABLE << 1 | RA8876_HOST_DATA_BUS_SERIAL);
#else
if(_bus_width == 16) {
lcdDataWrite(RA8876_PLL_ENABLE<<7|RA8876_WAIT_NO_MASK<<6|RA8876_KEY_SCAN_DISABLE<<5|RA8876_TFT_OUTPUT24<<3
|RA8876_I2C_MASTER_DISABLE<<2|RA8876_SERIAL_IF_ENABLE<<1|RA8876_HOST_DATA_BUS_16BIT);
} else {
lcdDataWrite(RA8876_PLL_ENABLE<<7|RA8876_WAIT_NO_MASK<<6|RA8876_KEY_SCAN_DISABLE<<5|RA8876_TFT_OUTPUT24<<3
|RA8876_I2C_MASTER_DISABLE<<2|RA8876_SERIAL_IF_ENABLE<<1|RA8876_HOST_DATA_BUS_8BIT);
}
#endif
boolean RA8876_common::ra8876Initialize() {
//RA8876_SW_Reset(); <-------------------------
// Init PLL
if (!ra8876PllInitial())
return false;
// Init SDRAM
if (!ra8876SdramInitial())
return false;
lcdRegWrite(RA8876_CCR); // 01h
#if defined(USE_SPI)
lcdDataWrite(RA8876_PLL_ENABLE << 7 | RA8876_WAIT_NO_MASK << 6 | RA8876_KEY_SCAN_DISABLE << 5 | RA8876_TFT_OUTPUT24 << 3 |
RA8876_I2C_MASTER_DISABLE << 2 | RA8876_SERIAL_IF_ENABLE << 1 | RA8876_HOST_DATA_BUS_SERIAL);
#else
if(_bus_width == 16) {
lcdDataWrite(RA8876_PLL_ENABLE<<7|RA8876_WAIT_NO_MASK<<6|RA8876_KEY_SCAN_DISABLE<<5|RA8876_TFT_OUTPUT24<<3
|RA8876_I2C_MASTER_DISABLE<<2|RA8876_SERIAL_IF_ENABLE<<1|RA8876_HOST_DATA_BUS_16BIT);
} else {
lcdDataWrite(RA8876_PLL_ENABLE<<7|RA8876_WAIT_NO_MASK<<6|RA8876_KEY_SCAN_DISABLE<<5|RA8876_TFT_OUTPUT24<<3
|RA8876_I2C_MASTER_DISABLE<<2|RA8876_SERIAL_IF_ENABLE<<1|RA8876_HOST_DATA_BUS_8BIT);
}
#endif
Pretty much can use any pin that does not conflict. I usually just have BL connected to 3.3v or 5v so I dont have to bother with it.Just a quick note, I noticed that pin #7 is also being used for the backlite pin. That conflicts with the WR pin on the MMod and Dev board. Is there a standard pin number defined for Backlite control? Or should I just select a pin that does not conflict. Don't know if DMA mode has been tested yet so I am testing it...
Feels good to be somewhat functional againPretty much can use any pin that does not conflict. I usually just have BL connected to 3.3v or 5v so I dont have to bother with it.
Sounds like you are recovering nicely.
Know the feeling. Just don't over do it for a bit.Feels good to be somewhat functional again
FASTRUN void RA8876_t41_p::FlexIO_Config_DMA_MultiBeat()
FASTRUN void RA8876_t41_p::FlexIO_Config_MultiBeat()
MicroMod Board and RA8876 parallel 8080 mode testing (8Bit/DMA)
FlexIO_Init: D0:40 WR:7 RD:8
Bus speed: 24 MHZ
Bus Width: 8-bits
Wrote 397400 bytes in 21ms
Press anykey to continue
Would that be:I am currently working off of your new library ... cherry pick.
//**************************************************************//
// RA8876_t41_p()
//**************************************************************//
// Create RA8876 driver instance 8080 IF
//**************************************************************//
#ifndef BUS_WIDTH
#define BUS_WIDTH 8
#endif
RA8876_t41_p::RA8876_t41_p(const uint8_t DCp, const uint8_t CSp, const uint8_t RSTp)
: _dc(DCp), _cs(CSp), _rst(RSTp),
_data_pins{DISPLAY_D0, DISPLAY_D1, DISPLAY_D2, DISPLAY_D3, DISPLAY_D4, DISPLAY_D5, DISPLAY_D6, DISPLAY_D7,
#if defined(DISPLAY_D8)
DISPLAY_D8, DISPLAY_D9, DISPLAY_D10, DISPLAY_D11, DISPLAY_D12, DISPLAY_D13, DISPLAY_D14, DISPLAY_D15},
#else
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
#endif
_wr_pin(DISPLAY_WR), _rd_pin(DISPLAY_RD)
{
RA8876_GFX(BUS_WIDTH);
}
//**************************************************************//
// RA8876_t41_p()
//**************************************************************//
// Create RA8876 driver instance 8080 IF
//**************************************************************//
//#ifndef BUS_WIDTH
//#define BUS_WIDTH 8
//#endif
RA8876_t41_p::RA8876_t41_p(const uint8_t DCp, const uint8_t CSp, const uint8_t RSTp)
: _dc(DCp), _cs(CSp), _rst(RSTp),
_data_pins{DISPLAY_D0, DISPLAY_D1, DISPLAY_D2, DISPLAY_D3, DISPLAY_D4, DISPLAY_D5, DISPLAY_D6, DISPLAY_D7,
#if defined(DISPLAY_D8)
DISPLAY_D8, DISPLAY_D9, DISPLAY_D10, DISPLAY_D11, DISPLAY_D12, DISPLAY_D13, DISPLAY_D14, DISPLAY_D15},
#else
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
#endif
_wr_pin(DISPLAY_WR), _rd_pin(DISPLAY_RD)
{
RA8876_GFX(_bus_width);
}
void RA8876_common::RA8876_GFX(uint16_t buswidth) {
_width = SCREEN_WIDTH;
_height = SCREEN_HEIGHT;
_bus_width = buswidth;
}
lcd.pushPixels16bitAsync(teensy41_Cardlike,10,10,575,424);
lcd.pushPixels16bitDMA(teensy41,1,1,480,320); // FLASHMEM buffer
I was wondering the same thing. The only other issue would be 8/16bit bus usage. I think DMA is only setup for 8bit and I am not sure about async...Quick note, I did another update of the branch mentioned above. I think I integrated the IRQ code and it might be working.
However there appears like there might not be any current test sketches that calls the functions like:
Code:lcd.pushPixels16bitAsync(teensy41_Cardlike,10,10,575,424);
Looks like there may be some related new methods for DMA like:
Code:lcd.pushPixels16bitDMA(teensy41,1,1,480,320); // FLASHMEM buffer
Wondering if it makes sense to combine into one method, like the pushPixels16bitAsync
where it detects if the FlexIO supports DMA, if so use it, else fallback to the IRQ code
I was wondering the same thing. The only other issue would be 8/16bit bus usage. I think DMA is only setup for 8bit and I am not sure about async...
...
lcd.setRotation(0);
lcd.onCompleteCB(&frame_complete_callback);
}
void frame_complete_callback() {
Serial.println("\n*** Frame Complete Callback ***");
}
void loop() {
#if 1
lcd.fillScreen(BLUE);
lcd.pushPixels16bitAsync(teensy41_Cardlike,10,10,575,424);
waitforInput();
...