Quantcast
Channel: 懒得折腾
Viewing all articles
Browse latest Browse all 764

ILI9341 on STM32

$
0
0
  1. https://github.com/fagcinsk/stm-ILI9341-spi  Library for working with the ILI9341 display via SPI using direct memory access. Drawing primitives + text is ported from the Arduin library from Adafruit with some optimization.Pins are configured in the config.h file in the folder with the library

    Project for CLION IDE. A standard library is used to work with periphyry. For successful compilation, edit library paths in CMakeLists.txt CMSISSTM32F10x_StdPeriph_Lib_V3.5.0

  2. https://github.com/martnak/STM32-ILI9341 Simple HAL driver for ILI9341 320×240 TFT LCD with Touchscreen for STM32 microcontrollers

    STM32-ILI9341

    Simple driver for ILI9341 320×240 TFT LCD with Touchscreen for STM32 microcontrollers

    Requires no DMA or Interrupts while still maintaining very fast screen draws. See performance analysis below

    The intent of this library is to provide a really simple way to get ILI9341 projects started without complex methods. Basic SPI and GPIO inputs/Outputs are enough to use the library.

    Contains:

    • main driver for initialization and basic functions “ILI9341_STM32_Driver”
    • GFX driver for advanced functionality (fonts, pictures)
    • Touchscreen driver
    • Example project with CubeMX built for STM32F746ZG Nucleo board
      • Example usage of functions

    Downloading project and setting up example based on STM32F7:

    • Extract the project into a folder and run CubeMX project
    • Generate code using CubeMX
    • Add ILI9341 folder to flash->configure flash tools->C/C++ ->Include paths
    • Add files in ILI9341 folder to project (Add existing files to group…)

    Alternatively download entire project in .rar file. Paths might be broken and might require re-linking. ¯\(ツ)

    ILI9341 Driver library for STM32

    While there are other libraries for ILI9341 they mostly require either interrupts, DMA or both for fast drawing The intent of this library is to offer a simple yet still reasonably fast alternatives for those that do not wish to use interrupts or DMA in their projects.

    Library is written for STM32 HAL library and supports STM32CUBEMX. To use the library with Cube software you need to tick the box that generates peripheral initialization code in their own respective .c and .h file

    Performance

    Settings:

    • SPI @ 50MHz
    • STM32F746ZG Nucleo board
    • Redraw entire screen

    Theoretical maximum FPS with 50Mhz SPI calculated to be 40.69 FPS

    320×240 = 76800 pixels, each pixel contains 16bit colour information (2×8) Theoretical Max FPS: 1/((320x240x16)/50000000)

    With ART Accelerator, instruction prefetch, CPU ICACHE and CPU DCACHE enabled:

    • FPS: 39.62
    • SPI utilization: 97.37%
    • MB/Second: 6.09

    With ART Accelerator, instruction prefetch, CPU ICACHE and CPU DCACHE disabled:

    • FPS: 35.45
    • SPI utilization: 87.12%
    • MB/Second: 5.44

    ART Accelerator, instruction prefetch, CPU ICACHE and CPU DCACHE settings found in MXCUBE under “System-> CORTEX M7 button”

  3. https://github.com/libopencm3/libopencm3-examples/blob/master/examples/stm32/f4/stm32f429i-discovery/lcd-dma/lcd-spi.c
  4. https://github.com/1Bitsy/1bitsy-examples/tree/master/examples/1bitsy/tft1
  5. https://github.com/testep02/stm32f4discovery_cppThe STM32F4 Discovery has become quite the popular platform since its release. This code is my attempt at getting the hardware on the board to work with C++ as the development language. The current code is incredibly disorganized and some parts (most parts, actually) are incomplete. This is mostly a test code base. The real framework that I am developing has not been uploaded yet, but wull be soon. However, there is a lot of code in this project that is quite useful. I have kept this code simple for a reason. I want people that stumble across this code to a feel for how the hardware is initialized and works without a bunch of useless junk in the way. I also wanted to demonstrate the use of C++ instead of C.

    Features of this code

    • Demonstrate use of ST’s Std_Periph_Lib with C++
    • Demonstrate use of some of the peripherals on the STM32F407
    • Demonstrate use of components that are included on the board such as the accelerometer
    • Demonstrate use of timer with C++ code
    • Demonstrate use of interrupts with C++
    • Provide drivers for a couple of popular TFTs
      • SeeedStudio Touch Shield V1.0 with 8-bit parallel connection
      • TFT-Proto board from MikroE that uses the ILI9341 driver with 16-bit parallel connection
        • This one uses FSMC to drive the TFT. It is actually quite fast. You can also see in the code that I am working on implementing the TE line which would allow the developer to not only display static images, but also display movies and animations as well

    Future Enhancements

    There will not be many changes made to this code. Instead, I will eventually upload the entire framework I have created with all of this code (in a completed state) included. That project will be a much better starting point for someone wanting to have a good base to start from. That project also has some graphics libs included that are not included here to help with drawing and managing screens.

    Again, I am sorry for the state of this code. I really just needed a place to put it so that I didn’t lose it by accident, which happens occassionally.

  6. https://github.com/MagicPrince666/STM32_LCD

    How To Use

    It should run on any *nux system. It has been tested on:

    • ArchLinux
    • Ubuntu / Debian
    • Mac OS X

    for mac os x

    • Install arm-none-eabi-gcc Cross Compile Toolchain
    brew tap blanboom/homebrew-mcu-devtools
    brew install gcc-arm-none-eabi
    
    • Install stlink
    brew install stlink
    

    you can see the infomation by typing brew info stlink

    stlink: stable 1.1.0 (bottled), HEAD
    stm32 discovery line Linux programmer
    https://github.com/texane/stlink
    /usr/local/Cellar/stlink/1.1.0 (12 files, 255.7K) *
      Poured from bottle
    From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/stlink.rb
    ==> Dependencies
    Build: autoconf ✔, automake ✔, pkg-config ✔
    Required: libusb ✔
    
    • you can run make bulid

    for other

    You can do it by yourself!

    STM32_LCD

  7. https://github.com/stevstrong/Adafruit_TFTLCD_8bit_STM32
    This is a library for the 8 bit parallel driven TFT displays, ported from the Adafruit library [https://github.com/adafruit/TFTLCD-Library] and adapted to STM32F103Cx controller. No other CPU architecture is supportted at the moment.
    
    The scope of this library is to achieve highest display update rate while maintaing the compatibility with original Adafruit display API.
    Only tested with ILI9328 and "unknown" ILI9341-compatitble driver chips.
    
    Contribution from users for other display control types is welcome and made easy by allocating separate files for each controller type in part. 
    
    How to use:
    - Place the Adafruit_TFT library folder your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.
    
    - Also requires the Adafruit_GFX library for Arduino. https://github.com/adafruit/Adafruit-GFX-Library . Alternatively, you can change Adafruit_TFTLCD_8bit_STM32.h to #include <Adafruit_GFX_AS.h>, instead.
    
    - Pin connections can be configured near the top of Adafruit_TFTLCD_8bit_STM32.h . Note that the data lines have to be on consequtive pins of the same output register (PB0...PB7, by default).
      To use the higher pins (PX8..PX15), set TFT_DATA_SHIFT to 8. The four control pins must all be one output register (the same as the data pins, or a different one), but can be freely
      assigned within the register. The TFT reset line can be assigned, freely.

Viewing all articles
Browse latest Browse all 764

Trending Articles