Jump to content

board_ILI9341_spi.h - send_data()


crteensy

Recommended Posts

When implementing send_data(uint16_t data) for the ILI9341, is it supposed to send just 8 bits? If so, should the 8 MSBs or the 8 LSBs be sent?

The encoding of the comments for that function and write_index() seems to be broken.

and please please please turn off that filter:

The following words in your search query were ignored because they are too common words: ili9341

Regards,

Christoph

Link to comment
Share on other sites

When implementing send_data(uint16_t data) for the ILI9341, is it supposed to send just 8 bits? If so, should the 8 MSBs or the 8 LSBs be sent?

You always have to sent 16-bits. The implementation depends on whether you use the controller in 8-bit or in 16-bit mode. In 16-bit mode you just write the word to the bus and you are done. In case of 8-Bit mode you will write the high-byte first and then the low-byte.

Here are two example implementations for the ILI9341 that we are using successfully:


// ILI9342 in 8-bit mode
static inline void write_pixel(GDisplay* g, uint16_t pixel) {
(void) g;

LCD_DATA = (uint8_t)((pixel >> 8));
LCD_DATA = (uint8_t)((pixel >> 0));
}

// ILI9342 in 16-bit mode
static inline void write_pixel(GDisplay* g, uint16_t pixel) {
(void) g;

LCD_DATA16 = pixel;
}

Note that we hooked up our display controller to the FSMC peripheral of an STM32 CPU and therefore the timings are taken care of through the timings configuration.

and please please please turn off that filter:

The following words in your search query were ignored because they are too common words: ili9341

Done.

~ Tectu

Link to comment
Share on other sites

The Mikromedia STM32 M4 board uses the ILI9341 in SPI mode (I think). If not the STM32F429iDiscovery uses that chip (but initialised in a strange way) in SPI mode. For the discovery board you can find that code in the board_STM32LTDC.h file as it is only used to initialise the display before the LTDC controller takes over.

Although the code might be different at least the way it uses the bus should be the same.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...