Пример #1
0
// ported from Screen_HX8353E
void _writeData64(uint16_t *data) {
    gioSetBit(_portDataCommand, _pinDataCommand, 1);
    mibspiSetData(mibspiREG3, 2, &data[0]);
    mibspiTransfer(mibspiREG3, 2 );
    while(!(mibspiIsTransferComplete(mibspiREG3, 2))) {
    }
}
Пример #2
0
// ported from Screen_HX8353E
void _fastFill(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t colour) {
    if (x1 > x2) _swapU(&x1, &x2);
    if (y1 > y2) _swapU(&y1, &y2);
    _setWindow(x1, y1, x2, y2);
    gioSetBit(_portDataCommand, _pinDataCommand, 1);

//    uint32_t t; // todo: this can be extremely optimized using the mibspi buffer + dma
//    for (t=(uint32_t)(y2-y1+1)*(x2-x1+1); t>1; t--) {
//        mibspiSetData(mibspiREG3, 2, &colour);
//        mibspiTransfer(mibspiREG3, 2 );
//        while(!(mibspiIsTransferComplete(mibspiREG3, 2))) {
//        }
//    }
//    mibspiSetData(mibspiREG3, 1, &colour);
//    mibspiTransfer(mibspiREG3, 1 );
//    while(!(mibspiIsTransferComplete(mibspiREG3, 1))) {
//    }
    uint32_t t; // todo: this can be extremely optimized using the mibspi buffer + dma
    for (t=(uint32_t)(y2-y1+1)*(x2-x1+1); t>0; t--) {
        mibspiSetData(mibspiREG3, 1, &colour);
        mibspiTransfer(mibspiREG3, 1 );
        while(!(mibspiIsTransferComplete(mibspiREG3, 1))) {
        }
    }
}
Пример #3
0
// ported from Screen_HX8353E
void _writeData16(uint16_t data16) {
    gioSetBit(_portDataCommand, _pinDataCommand, 1);
    mibspiSetData(mibspiREG3, 1, &data16);
    mibspiTransfer(mibspiREG3, 1 );
    while(!(mibspiIsTransferComplete(mibspiREG3, 1))) {
    }
}
Пример #4
0
// ported from Screen_HX8353E
void _writeCommand(uint16_t command8) {
    gioSetBit(_portDataCommand, _pinDataCommand, 0);

    mibspiSetData(mibspiREG3, 0, &command8);
    mibspiTransfer(mibspiREG3,0 );
    while(!(mibspiIsTransferComplete(mibspiREG3,0))) {
    }
}
Пример #5
0
// ported from Screen_HX8353E
void _writeData88(uint16_t dataHigh16, uint16_t dataLow16) {
    uint16_t data = (dataHigh16 << 8) | 0x00FF ;
    uint16_t data_low = dataLow16 | 0xFF00;
    data &= data_low;
    gioSetBit(_portDataCommand, _pinDataCommand, 1);
    mibspiSetData(mibspiREG3, 1, &data);
    mibspiTransfer(mibspiREG3, 1 );
    while(!(mibspiIsTransferComplete(mibspiREG3, 1))) {
    }
}
Пример #6
0
void main(void)
{
/* USER CODE BEGIN (3) */
#if 1
    /** - Initialize LIN/SCI2 Routines to receive Command and transmit data */
    sciInit();

    UARTprintf("--> ITS SDCARD H/W Test V3.0<--\r\n ");
    UARTprintf("Type \'help\' for help.\r\n");
    UARTprintf("TI project modified for ITS. (Pradeepa) \r\n");

    /* Initialize RTI driver */
    rtiInit();
    /* Enable RTI Compare 3 interrupt notification */
    rtiEnableNotification(rtiNOTIFICATION_COMPARE3);
    /* Enable IRQ - Clear I flag in CPS register */
    _enable_IRQ();
    /* Start RTI Counter Block 1 */
    rtiStartCounter(rtiCOUNTER_BLOCK1);

    mmcSelectSpi(mibspiPORT5, mibspiREG5);  // SD card is on the SPI5

	safeti_SRAM_ECC_ERROR_FORCING_1BIT();
	safeti_SRAM_ECC_ERROR_FORCING_2BIT();
	safeti_FEE_ECC_DATA_CORR_MODE();
	safeti_FEE_ECC_TEST_MODE_1BIT();
	safeti_FEE_ECC_TEST_MODE_2BIT();
	safeti_FEE_ECC_SYN_REPORT_MODE();
	safeti_FEE_ECC_MALFUNCTION_MODE1();
	safeti_FEE_ECC_MALFUNCTION_MODE2();
	safeti_FLASH_ECC_ADDR_TAG_REG_MODE();
	safeti_FLASH_ECC_TEST_MODE_1BIT();
	safeti_FLASH_ECC_TEST_MODE_2BIT();
	safeti_PSCON_SELF_TEST();
	safeti_PSCON_ERROR_FORCING();
	safeti_PSCON_SELF_TEST_ERROR_FORCING();
	safeti_PSCON_PMA_TEST();
	safeti_EFUSE_SELF_TEST_STUCK_AT_ZERO();
	safeti_EFUSE_SELF_TEST_ECC();
	safeti_SRAM_RADECODE_DIAGNOSTICS();
	safeti_SRAM_PAR_ADDR_CTRL_SELF_TEST();
	safeti_SRAM_ECC_ERROR_PROFILING();
	safeti_FLASH_ADDRESS_PARITY_SELF_TEST();
	safeti_CCMR4F_SELF_TEST();
	safeti_CCMR4F_ERROR_FORCING_TEST();
	safeti_CCMR4F_SELF_TEST_ERROR_FORCING();

    SD_Test();

#endif

#if 0
uint16_t tx_buf = 5;
uint16_t rx_buf;



mibspiInit();
//while(!(mibspiIsTransferComplete(mibspiREG5, 0)));

mibspiPORT5-> DCLR = 0x00;
//mibspiEnableLoopback(mibspiREG5, Digital_Lbk);
mibspiSetData(mibspiREG5, 0, &tx_buf);

mibspiTransfer(mibspiREG5, 0);

while(!(mibspiIsTransferComplete(mibspiREG5, 0)));

mibspiGetData(mibspiREG5,0,&rx_buf);

mibspiPORT5-> DCLR = 0x01;
//mibspiEnableLoopback(mibspiREG5, Digital_Lbk);
mibspiSetData(mibspiREG5, 0, &tx_buf);

mibspiTransfer(mibspiREG5, 0);

while(!(mibspiIsTransferComplete(mibspiREG5, 0)));

mibspiGetData(mibspiREG5,0,&rx_buf);
#endif
    while(1);

/* USER CODE END */
}
Пример #7
0
void _writeData64DMA() {
    gioSetBit(_portDataCommand, _pinDataCommand, 1);
    mibspiTransfer(mibspiREG3, 2 );
    while(!(mibspiIsTransferComplete(mibspiREG3, 2))) {
    }
}