ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
1.0
ESP8266ILI9341DisplayProject
|
Uart driver for ESP8266. More...
Go to the source code of this file.
Macros | |
#define | UARTS 2 |
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 () |
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 () |
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... | |
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 () |
Reinitialize uart0 and uart1 calls uart_init() More... | |
Variables | |
int | uart_debug_port = 0 |
Uart driver for ESP8266.
Uart driver for ESP8266 based on Esprissif documents.
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/.
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 uart.c.
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 | ) |
MEMSPACE int uart1_getc | ( | void | ) |
MEMSPACE int uart1_putc | ( | uint8 | c | ) |
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().
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_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().