ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts  1.0
ESP8266ILI9341DisplayProject
Functions | Variables
ili9341_hal.c File Reference

ili9341 driver inspired by Adafruit ili9341 code All code in this file has been rewritten by Mike Gore More...

#include "user_config.h"
#include <stdint.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include "display/ili9341.h"

Go to the source code of this file.

Functions

void tft_spi_init_slow ()
 Initialize TFT SPI clock speed and pin for slow speed Only used to read the CHIP ID return: void. More...
 
void tft_spi_init_fast ()
 Initialize TFT SPI clock speed and pin for normal speed return: void. More...
 
void tft_spi_begin ()
 Obtain SPI bus for TFT display, assert chip select return: void. More...
 
void tft_spi_end ()
 Release SPI bus from TFT display, deassert chip select return: void. More...
 
void tft_reset_init ()
 Initialize ILI9341 reset GPIO return: void. More...
 
void tft_reset_enable ()
 enable ILI9341 reset return: void More...
 
void tft_addr_init ()
 Initialize ILI9341 command/data GPIO return: void. More...
 
void tft_reset_disable ()
 disnable ILI9341 reset return: void More...
 
void tft_spi_TX (uint8_t *data, int bytes, uint8_t command)
 Transmit 8 bit data array. More...
 
void tft_spi_TXRX (uint8_t *data, int bytes, uint8_t command)
 Transmit and read 8 bit data array. More...
 
void tft_spi_RX (uint8_t *data, int bytes, uint8_t command)
 read 8 bit data array More...
 
MEMSPACE windowtft_init (void)
 Initialize TFT. More...
 

Variables

window tftwin
 
windowtft
 
uint32_t tft_clock = -1
 cahce of SPI clock devisor More...
 
uint16_t tft_ID
 

Detailed Description

ili9341 driver inspired by Adafruit ili9341 code All code in this file has been rewritten by Mike Gore

Copyright © 2016 Mike Gore, GPL License
You are free to use this code under the terms of GPL
please retain a copy of this notice in any code you use it in.

This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file ili9341_hal.c.

Function Documentation

void tft_addr_init ( void  )

Initialize ILI9341 command/data GPIO return: void.

Definition at line 112 of file ili9341_hal.c.

Referenced by tft_init().

MEMSPACE window* tft_init ( void  )

Initialize TFT.

Returns
diplay ID 9341

Definition at line 178 of file ili9341_hal.c.

Referenced by setup().

void tft_reset_disable ( void  )

disnable ILI9341 reset return: void

Definition at line 120 of file ili9341_hal.c.

Referenced by tft_init().

void tft_reset_enable ( void  )

enable ILI9341 reset return: void

Definition at line 103 of file ili9341_hal.c.

Referenced by tft_init().

void tft_reset_init ( void  )

Initialize ILI9341 reset GPIO return: void.

Definition at line 94 of file ili9341_hal.c.

Referenced by tft_init().

void tft_spi_begin ( void  )

Obtain SPI bus for TFT display, assert chip select return: void.

Definition at line 80 of file ili9341_hal.c.

Referenced by tft_bit_blit(), tft_Cmd_Data_TX(), tft_FillPolyLine(), tft_fillRectWH(), tft_invertDisplay(), tft_readPixel(), tft_readRect(), tft_readRegister(), and tft_writeRect().

void tft_spi_end ( void  )

Release SPI bus from TFT display, deassert chip select return: void.

Definition at line 87 of file ili9341_hal.c.

Referenced by tft_bit_blit(), tft_Cmd_Data_TX(), tft_FillPolyLine(), tft_fillRectWH(), tft_invertDisplay(), tft_readPixel(), tft_readRect(), tft_readRegister(), and tft_writeRect().

void tft_spi_init_fast ( )

Initialize TFT SPI clock speed and pin for normal speed return: void.

Definition at line 72 of file ili9341_hal.c.

Referenced by tft_init().

void tft_spi_init_slow ( )

Initialize TFT SPI clock speed and pin for slow speed Only used to read the CHIP ID return: void.

Definition at line 64 of file ili9341_hal.c.

Referenced by tft_init().

void tft_spi_RX ( uint8_t data,
int  bytes,
uint8_t  command 
)

read 8 bit data array

Parameters
[in]*datadata buffer to send
[in]bytesdata buffer size
[in]command1 = command, 0 = data return: void

Definition at line 165 of file ili9341_hal.c.

Referenced by tft_FillPolyLine(), tft_readPixel(), and tft_readRect().

void tft_spi_TX ( uint8_t data,
int  bytes,
uint8_t  command 
)

Transmit 8 bit data array.

Parameters
[in]*datadata buffer to send
[in]bytesdata buffer size
[in]command1 = command, 0 = data return: void

Definition at line 134 of file ili9341_hal.c.

Referenced by tft_bit_blit(), tft_Cmd(), tft_Cmd_Data_TX(), tft_fillRectWH(), and tft_writeRect().

void tft_spi_TXRX ( uint8_t data,
int  bytes,
uint8_t  command 
)

Transmit and read 8 bit data array.

Parameters
[in]*datadata buffer to send
[in]bytesdata buffer size
[in]command1 = command, 0 = data return: void

Definition at line 149 of file ili9341_hal.c.

Referenced by tft_Data().

Variable Documentation

window* tft

Definition at line 45 of file ili9341.c.

uint32_t tft_clock = -1

cahce of SPI clock devisor

=============================================================

Start SPI Hardware Abstraction Layer Keep all hardware dependent SPI code in this section

Definition at line 42 of file ili9341_hal.c.

Referenced by tft_spi_begin(), tft_spi_init_fast(), and tft_spi_init_slow().

uint16_t tft_ID

Definition at line 44 of file ili9341_hal.c.

Referenced by test_types(), and tft_init().

window tftwin

Definition at line 44 of file ili9341.c.