ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
1.0
ESP8266ILI9341DisplayProject
|
HSPI driver for ESP8255 Based on initial work from Sem 2015 - rewrittem Added code to handle proper aligned reads and writes and buffering. More...
#include "user_config.h"
#include <stdint.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include "hspi.h"
#include "gpio.h"
Go to the source code of this file.
Macros | |
#define | HSPI_PRESCALER 16 |
Functions | |
void | hspi_init (uint32_t prescale, int hwcs) |
HSPI Initiaization - with automatic chip select Pins: MISO GPIO12 MOSI GPIO13 CLK GPIO14 CS GPIO15 - optional DC GPIO2. More... | |
static void | hspi_config (int configState) |
HSPI Configuration for tranasmit and receive. More... | |
static void | hspi_setBits (uint16_t bytes) |
HSPI FIFO send or receive byte count. More... | |
static void | hspi_startSend (void) |
HSPI Start Send. More... | |
void | hspi_waitReady (void) |
HSPI Ready wait. More... | |
static void | hspi_writeFIFO (uint8_t *write_data, int bytes) |
HSPI FIFO write in units of 32 bits (4 byte words) More... | |
static void | hspi_readFIFO (uint8_t *read_data, int bytes) |
HSPI FIFO Read in units of 32 bits (4 byte words) More... | |
void | hspi_TX (uint8_t *data, int count) |
SPI buffered write functions. More... | |
void | hspi_TXRX (uint8_t *data, int count) |
HSPI write and read using FIFO. More... | |
void | hspi_RX (uint8_t *data, int count) |
HSPI read using FIFO. More... | |
Variables | |
static | _hspi_init_done = 0 |
uint32_t | hspi_clock = -1 |
hspi clock cached value More... | |
HSPI driver for ESP8255 Based on initial work from Sem 2015 - rewrittem Added code to handle proper aligned reads and writes and buffering.
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 hspi.c.
|
static |
HSPI Configuration for tranasmit and receive.
[in] | configState | CONFIG_FOR_RX_TX or CONFIG_FOR_RX |
Definition at line 104 of file hspi.c.
Referenced by hspi_RX(), hspi_TX(), and hspi_TXRX().
void hspi_init | ( | uint32_t | prescale, |
int | hwcs | ||
) |
HSPI Initiaization - with automatic chip select Pins: MISO GPIO12 MOSI GPIO13 CLK GPIO14 CS GPIO15 - optional DC GPIO2.
[in] | prescale | prescale from CPU clock 0 .. 0x1fff |
[in] | hwcs | enable GPIO15 hardware chip select |
Definition at line 55 of file hspi.c.
Referenced by setup(), and spi_init().
|
static |
HSPI FIFO Read in units of 32 bits (4 byte words)
[in] | read_data | read buffer |
[in] | bytes | bytes to write |
Definition at line 215 of file hspi.c.
Referenced by hspi_RX(), and hspi_TXRX().
void hspi_RX | ( | uint8_t * | data, |
int | count | ||
) |
HSPI read using FIFO.
[in] | *data | receive buffer |
[in] | count | number of bytes to read |
Definition at line 318 of file hspi.c.
Referenced by spi_RX(), and spi_RX_buffer().
|
static |
HSPI FIFO send or receive byte count.
[in] | bytes | bytes to send or receive |
Definition at line 140 of file hspi.c.
Referenced by hspi_readFIFO(), and hspi_writeFIFO().
|
static |
HSPI Start Send.
Definition at line 151 of file hspi.c.
Referenced by hspi_RX(), hspi_TX(), and hspi_TXRX().
void hspi_TX | ( | uint8_t * | data, |
int | count | ||
) |
SPI buffered write functions.
=================================================================HSPI write using FIFO
[in] | *data | transmit buffer |
[in] | count | number of bytes to write |
Definition at line 265 of file hspi.c.
Referenced by spi_TX(), and spi_TX_buffer().
void hspi_TXRX | ( | uint8_t * | data, |
int | count | ||
) |
HSPI write and read using FIFO.
[in] | *data | transmit / receive buffer |
[in] | count | number of bytes to write / read |
Definition at line 292 of file hspi.c.
Referenced by spi_TXRX(), and spi_TXRX_buffer().
void hspi_waitReady | ( | void | ) |
HSPI Ready wait.
Definition at line 159 of file hspi.c.
Referenced by esp_yield(), hspi_config(), hspi_init(), hspi_RX(), hspi_TX(), hspi_TXRX(), loop_wrapper(), and spi_waitReady().
|
static |
HSPI FIFO write in units of 32 bits (4 byte words)
[in] | write_data | write buffer |
[in] | bytes | bytes to write |
Definition at line 169 of file hspi.c.
Referenced by hspi_RX(), hspi_TX(), and hspi_TXRX().
|
static |
Definition at line 41 of file hspi.c.
Referenced by hspi_init().
uint32_t hspi_clock = -1 |