Skip to content

Commit

Permalink
Revert "fix(MiscDrivers): Refactor TFT SPI transmit for tft_ssd2119 (#…
Browse files Browse the repository at this point in the history
…943)"

This reverts commit 31748bc.
  • Loading branch information
EricB-ADI committed Aug 21, 2024
1 parent 6253857 commit bcb928d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Libraries/MiscDrivers/Display/tft_ssd2119.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,16 @@ static void spi_transmit(void *datain, unsigned int count)
volatile uint16_t *u16ptrin = (volatile uint16_t *)datain;
unsigned int start = 0;

MXC_SPI_SetFrequency((mxc_spi_regs_t *)spi, tft_spi_freq);
MXC_SPI_SetDataSize((mxc_spi_regs_t *)spi, 9);

// HW requires disabling/renabling SPI block at end of each transaction (when SS is inactive).
spi->ctrl0 &= ~(MXC_F_SPI_CTRL0_EN);

// Setup the slave select
MXC_SETFIELD(spi->ctrl0, MXC_F_SPI_CTRL0_SS_ACTIVE,
((1 << ssel) << MXC_F_SPI_CTRL0_SS_ACTIVE_POS));

// number of RX Char is 0xffff
spi->ctrl1 &= ~(MXC_F_SPI_CTRL1_RX_NUM_CHAR);

Expand Down Expand Up @@ -519,10 +526,6 @@ static void tft_spi_init(void)
MXC_GPIO_SetVSSEL(g_spi_gpio.port, g_spi_gpio.vssel, g_spi_gpio.mask);
MXC_SPI_SetDataSize((mxc_spi_regs_t *)spi, 9);
MXC_SPI_SetWidth((mxc_spi_regs_t *)spi, SPI_WIDTH_STANDARD);
MXC_SPI_SetFrequency((mxc_spi_regs_t *)spi, tft_spi_freq);
// Setup the slave select
MXC_SETFIELD(spi->ctrl0, MXC_F_SPI_CTRL0_SS_ACTIVE,
((1 << ssel) << MXC_F_SPI_CTRL0_SS_ACTIVE_POS));
}

static void displayInit(void)
Expand Down

0 comments on commit bcb928d

Please sign in to comment.