stm32f429i-disco: implements ili9341 interface
This add a new sub driver ili93414ws which implements the ili9341 interface. This allows to control the ili9341 lcd display of the stm32f429i-disco board. This also modifies the board specific header to make the entry point to the sub driver known. Generally the display supports two different ways to drawing pixel data. This can be done by RGB interface or MCU interface. Second one is supported by this driver. The configuration of the MCU interface is fixed by the hardware pinout. In the case of the stm32f429i-disco board it is a 4-wire serial (spi) interface. The display is connected on spi5 and acts as a slave device. It supports half duplex bidirectional mode for transmitting and receiving data. Nuttx spi interface only support full duplex so the interface can not be used for the driver in conventional way. Therefore the driver has its own logic for the communication with the spi5 device. But if multiple devices share the same spi5 bus, e.g. if MEMS support enabled the spi bus must be locked to avoid inconsistency. This is done by enable CONFIG_STM32_SPI5 in the nuttx configuration. In this case the driver uses the spi_dev_s instance for the spi5 port to interact with the nuttx spi interface, e.g. using method SPI_LOCK to lock the bus for the current usage. So it is safe to share the spi bus. Keep in mind this is a possible workaround. I would be happy if nuttx spi interface supports different spi modes other than full duplex only. Are there any plans? Futhermore the driver supports a few configurable settings: 1. SPI Frequency. This allows to configure the spi frequency for the communication with the display. As a result of the spi devices of the stm32f429 only allow fixed frequency by divider depending on PCLK1, it is not possible to configure each spi clock we want. A divider of 4, what means ~10Mhz spi clock, gives me the best results and should be near the upper limit. 2. SPI 16-bit mode. This allows to setup the spi hardware to 16-bit mode for read or write operations when receiving or transmitting pixel data from or to the gram of the display. This is not documented in the ili9341 reference manual but this trick works just fine because we use only one read or write operation for each pixel, instead two. This gives a small performance boost. The driver implements all functions described in the header (see include/nuttx/lcd/ili9341.h). Note! Using the backlight function has no effect, because the board doesn't support controlling of the backlight in the current hardware layout. Todo: Add support for dma transfer for writing pixel data to the displays gram. Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
This commit is contained in:
parent
3035f1a88f
commit
f02de7c7ec
1242
configs/stm32f429i-disco/src/stm32_ili93414ws.c
Normal file
1242
configs/stm32f429i-disco/src/stm32_ili93414ws.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,8 @@
|
||||
* configs/stm32f429i-disco/src/stm32f429i-disco.h
|
||||
*
|
||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Marco Krahl <ocram.lhark@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@ -44,6 +45,10 @@
|
||||
#include <nuttx/compiler.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef CONFIG_STM32F429I_DISCO_ILI9341
|
||||
#include <nuttx/lcd/ili9341.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************************************
|
||||
* Definitions
|
||||
****************************************************************************************************/
|
||||
@ -234,6 +239,25 @@ void stm32_pmbuttons(void);
|
||||
int nsh_archinitialize(void);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F429I_DISCO_ILI9341
|
||||
/****************************************************************************
|
||||
* Name: stm32_ili93414ws_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the device structure to control the LCD Single chip driver.
|
||||
*
|
||||
* Input Parameters:
|
||||
*
|
||||
* Returned Value:
|
||||
* On success, this function returns a reference to the LCD control object
|
||||
* for the specified ILI9341 LCD Single chip driver connected as 4 wire serial
|
||||
* (spi). NULL is returned on any failure.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
FAR struct ili9341_lcd_s *stm32_ili93414ws_initialize(void);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_STM32F429I_DISCO_SRC_STM32F429I_DISCO_H */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user