ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
1.0
ESP8266ILI9341DisplayProject
|
Go to the source code of this file.
Macros | |
#define | UART0 0 |
#define | UART1 1 |
#define | UART_FIFO_LEN 128 /* define the tx fifo length */ |
#define | FUNC_U0TXD 0 |
#define | FUNC_U0RXD 0 |
Enumerations | |
enum | UartStopBitsNum { ONE_STOP_BIT = 0x1, TWO_STOP_BIT = 0x3 } |
enum | UartParityMode { NO_PARITY = 0, EVEN_PARITY = UART_PARITY_EN, ODD_PARITY = UART_PARITY_EN | UART_PARITY } |
enum | UartBaudRate { BIT_RATE_300 = 300, BIT_RATE_600 = 600, BIT_RATE_1200 = 1200, BIT_RATE_2400 = 2400, BIT_RATE_4800 = 4800, BIT_RATE_9600 = 9600, BIT_RATE_19200 = 19200, BIT_RATE_38400 = 38400, BIT_RATE_57600 = 57600, BIT_RATE_74880 = 74880, BIT_RATE_115200 = 115200, BIT_RATE_230400 = 230400, BIT_RATE_460800 = 460800, BIT_RATE_921600 = 921600, BIT_RATE_1843200 = 1843200, BIT_RATE_3686400 = 3686400 } |
Functions | |
void | uart_rx_enable (uint8 uart_no) |
Enable receive interrupts for a uart. More... | |
void | uart_rx_disable (uint8 uart_no) |
Disable receive interrupts for a uart. More... | |
void | uart_tx_enable (uint8_t uart_no) |
Enable transmit interrupts for a uart. More... | |
void | uart_tx_disable (uint8_t uart_no) |
Disable transmit interrupts for a uart. More... | |
void | tx_fifo_flush (int uart_no) |
Flush transmit fifo for a uart. More... | |
void | rx_fifo_flush (int uart_no) |
Flush receive fifo for a uart. More... | |
MEMSPACE int | tx_fifo_used (int uart_no) |
Get the number of bytes used in transmit fifo. More... | |
MEMSPACE int | tx_fifo_free (int uart_no) |
Get the number of bytes free in transmit fifo. More... | |
MEMSPACE int | tx_fifo_empty (int uart_no) |
Test if the transmit fifo is empty. More... | |
MEMSPACE int | rx_fifo_used (int uart_no) |
Get the number of bytes used in receive fifo. More... | |
MEMSPACE int | rx_fifo_free (int uart_no) |
Get the number of bytes free in receive fifo. More... | |
MEMSPACE int | rx_fifo_empty (int uart_no) |
Test if the receive fifo is empty. More... | |
MEMSPACE int | tx_fifo_putb (int uart_no, uint8_t c) |
Add a byte to the trasmit fifo We assume that tx_fifo_free() was called! More... | |
MEMSPACE int | rx_fifo_getb (int uart_no) |
Remove a byte from the receive fifo We assume that rx_fifo_used() was called! More... | |
MEMSPACE int | tx_fifo_write (int uart_no, uint8_t *buf, int size) |
Write a data buffer to the transmit fifo Note: This function does not wait/block util there is enough free space to meet the request. So you must check that the return value matches the size. More... | |
MEMSPACE int | rx_fifo_read (int uart_no, uint8_t *buf, int size) |
Read a data buffer from the receive fifo Note: This function does not wait/block util there is enough free space to meet the request. So you must check that the return value matches the size. More... | |
LOCAL MEMSPACE int | uart_putb (uint8 uart_no, uint8 data) |
Polled Blocking I/O functions that poll. More... | |
LOCAL MEMSPACE int | uart_getb (int uart_no) |
Read a byte from a uart Note: This function waits/blocks util the read can happen. More... | |
MEMSPACE int | uart_putc (uint8 uart_no, char c) |
Write a byte from a uart with NL to CR/NL conversion Note: This function waits/blocks util the write can happen. More... | |
MEMSPACE int | uart_getc (int uart_no) |
Read a byte from a uart with NL to CR/NL conversion Note: This function waits/blocks util the read can happen. More... | |
MEMSPACE int | uart0_putc (uint8 c) |
Write a byte to uart0 with NL to CR/NL conversion Note: This function waits/blocks util the write can happen. More... | |
MEMSPACE int | uart0_getc (void) |
Read a byte from uart0 with NL to CR/NL conversion Note: This function waits/blocks util the read can happen. More... | |
MEMSPACE int | uart1_putc (uint8 c) |
Write a byte to uart1 with NL to CR/NL conversion Note: This function waits/blocks util the write can happen. More... | |
MEMSPACE int | uart1_getc (void) |
Read a byte from uart1 with NL to CR/NL conversion Note: This function waits/blocks util the read can happen. More... | |
MEMSPACE void | uart_flush (uint8_t uart_no) |
Flush TX buffer Note: This function waits/blocks util the write happen. More... | |
LOCAL MEMSPACE int | uart_queue_getb (uint8_t uart_no) |
MEMSPACE uint8_t | uart_queue_getc (uint8_t uart_no) |
MEMSPACE uint8_t | uart0_queue_getc (void) |
MEMSPACE uint8_t | uart1_queue_getc (void) |
void | uart_task (void) |
LOCAL MEMSPACE void | uart_queue_putb (uint8 uart_no, uint8 data) |
MEMSPACE void | uart_queue_putc (uint8_t uart_no, char c) |
MEMSPACE void | uart0_queue_putc (char c) |
MEMSPACE void | uart1_queue_putc (char c) |
int | kbhiteol (int uart_no) |
Has an EOL been read on stdin ? More... | |
int | kbhit (int uart_no) |
Has ANY character been read in stdin. More... | |
void | uart_callback (void *p) |
Uart interrupt callback function Process all receive and transmit events here. More... | |
MEMSPACE void | UART_SetPrintPort (uint8 uart_no) |
Install debug uart. More... | |
MEMSPACE void | uart_config (uint8 uart_no, uint32_t baud, uint8_t data_bits, uint8_t stop_bits, uint8_t parity) |
Uart configuration, baud rate, data and stop bits, parity. More... | |
MEMSPACE void | uart_init (UartBaudRate uart0_br, UartBaudRate uart1_br) |
initialize uart0 and uart1 Defaults: 8 = data bits, 1 = stop bits, no parity More... | |
MEMSPACE void | uart_reattach (void) |
Reinitialize uart0 and uart1 calls uart_init() More... | |
#define UART0 0 |
Definition at line 29 of file uart.h.
Referenced by rx_fifo_empty(), rx_fifo_free(), rx_fifo_getb(), rx_fifo_read(), and rx_fifo_used().
#define UART_FIFO_LEN 128 /* define the tx fifo length */ |
Definition at line 65 of file uart.h.
Referenced by rx_fifo_free(), and tx_fifo_free().
enum UartBaudRate |
enum UartParityMode |
enum UartStopBitsNum |
int kbhit | ( | int | uart_no | ) |
Has ANY character been read in stdin.
[in] | uart_no | uart number |
Definition at line 585 of file uart.c.
Referenced by testpage().
int kbhiteol | ( | int | uart_no | ) |
Has an EOL been read on stdin ?
[in] | uart_no | uart number |
Definition at line 572 of file uart.c.
Referenced by user_tasks().
MEMSPACE int rx_fifo_empty | ( | int | uart_no | ) |
Test if the receive fifo is empty.
[in] | uart_no | uart number |
Definition at line 182 of file uart.c.
Referenced by uart_getb().
void rx_fifo_flush | ( | int | uart_no | ) |
MEMSPACE int rx_fifo_free | ( | int | uart_no | ) |
MEMSPACE int rx_fifo_getb | ( | int | uart_no | ) |
Remove a byte from the receive fifo We assume that rx_fifo_used() was called!
[in] | uart_no | uart number |
Definition at line 217 of file uart.c.
Referenced by uart_getb().
Read a data buffer from the receive fifo Note: This function does not wait/block util there is enough free space to meet the request. So you must check that the return value matches the size.
[in] | uart_no | uart number |
[in] | *buf | output buffer |
[in] | size | size of output buffer |
MEMSPACE int rx_fifo_used | ( | int | uart_no | ) |
Get the number of bytes used in receive fifo.
[in] | uart_no | uart number |
Definition at line 155 of file uart.c.
Referenced by rx_fifo_getb(), and rx_fifo_read().
MEMSPACE int tx_fifo_empty | ( | int | uart_no | ) |
Test if the transmit fifo is empty.
[in] | uart_no | uart number |
Definition at line 143 of file uart.c.
Referenced by uart_flush().
void tx_fifo_flush | ( | int | uart_no | ) |
MEMSPACE int tx_fifo_free | ( | int | uart_no | ) |
Get the number of bytes free in transmit fifo.
[in] | uart_no | uart number |
Definition at line 130 of file uart.c.
Referenced by tx_fifo_putb(), tx_fifo_write(), and uart_putb().
Add a byte to the trasmit fifo We assume that tx_fifo_free() was called!
[in] | uart_no | uart number |
[in] | c | byte to add |
Definition at line 199 of file uart.c.
Referenced by uart_putb().
MEMSPACE int tx_fifo_used | ( | int | uart_no | ) |
Get the number of bytes used in transmit fifo.
[in] | uart_no | uart number |
Definition at line 118 of file uart.c.
Referenced by uart_flush().
Write a data buffer to the transmit fifo Note: This function does not wait/block util there is enough free space to meet the request. So you must check that the return value matches the size.
[in] | uart_no | uart number |
[in] | *buf | output buffer |
[in] | size | size of input buffer |
MEMSPACE int uart0_getc | ( | void | ) |
MEMSPACE int uart0_putc | ( | uint8 | c | ) |
Referenced by uart_flush().
MEMSPACE void uart0_queue_putc | ( | char | c | ) |
Referenced by uart_flush().
MEMSPACE int uart1_getc | ( | void | ) |
MEMSPACE int uart1_putc | ( | uint8 | c | ) |
Referenced by uart_flush().
MEMSPACE void uart1_queue_putc | ( | char | c | ) |
Referenced by uart_flush().
void uart_callback | ( | void * | p | ) |
MEMSPACE void uart_config | ( | uint8 | uart_no, |
uint32_t | baud, | ||
uint8_t | data_bits, | ||
uint8_t | stop_bits, | ||
uint8_t | parity | ||
) |
Uart configuration, baud rate, data and stop bits, parity.
[in] | uart_no | uart number |
[in] | baud | baud |
[in] | data_bits | number of data bits, 5 .. 8 |
[in] | stop_bits | number of stop bits, ONE_STOP_BIT|TWO_STOP_BIT |
[in] | parity | parity, NO_PARITY,ODD_PARITY,EVEN_PARITY |
LOCAL MEMSPACE int uart_getb | ( | int | uart_no | ) |
Read a byte from a uart Note: This function waits/blocks util the read can happen.
[in] | uart_no | uart number |
Definition at line 304 of file uart.c.
Referenced by uart_getc().
MEMSPACE int uart_getc | ( | int | uart_no | ) |
Read a byte from a uart with NL to CR/NL conversion Note: This function waits/blocks util the read can happen.
[in] | uart_no | uart number |
Definition at line 337 of file uart.c.
Referenced by uart0_getc(), and uart1_getc().
MEMSPACE void uart_init | ( | UartBaudRate | uart0_br, |
UartBaudRate | uart1_br | ||
) |
LOCAL MEMSPACE int uart_putb | ( | uint8 | uart_no, |
uint8 | data | ||
) |
Polled Blocking I/O functions that poll.
Write a byte to a uart Note: This function waits/blocks util the write can happen
[in] | uart_no | uart number |
[in] | data | byte to write |
Definition at line 289 of file uart.c.
Referenced by uart_putc().
MEMSPACE int uart_putc | ( | uint8 | uart_no, |
char | c | ||
) |
Write a byte from a uart with NL to CR/NL conversion Note: This function waits/blocks util the write can happen.
[in] | uart_no | uart number |
[in] | c | character |
Definition at line 323 of file uart.c.
Referenced by _uart0_fn(), fatfs_ls(), uart0_putc(), and uart1_putc().
Referenced by uart_flush().
Referenced by uart_flush().
LOCAL MEMSPACE void uart_queue_putb | ( | uint8 | uart_no, |
uint8 | data | ||
) |
Referenced by uart_flush().
Referenced by _uart0_fn(), and uart_flush().
MEMSPACE void uart_reattach | ( | void | ) |
void uart_rx_disable | ( | uint8 | uart_no | ) |
void uart_rx_enable | ( | uint8 | uart_no | ) |
MEMSPACE void UART_SetPrintPort | ( | uint8 | uart_no | ) |
void uart_task | ( | void | ) |
Referenced by uart_flush().
void uart_tx_disable | ( | uint8_t | uart_no | ) |
void uart_tx_enable | ( | uint8_t | uart_no | ) |
Enable transmit interrupts for a uart.
[in] | uart_no | uart number |
Definition at line 72 of file uart.c.
Referenced by tx_fifo_putb(), tx_fifo_write(), and uart_flush().