MeterLogger
|
#include <esp8266.h>
#include "driver/uart.h"
#include "driver/uart_register.h"
#include "user_interface.h"
#include "kmp_request.h"
Go to the source code of this file.
Functions | |
LOCAL void | uart0_rx_intr_handler (void *para) |
LOCAL void ICACHE_FLASH_ATTR | uart_config (uint8 uart_no) |
STATUS | uart_tx_one_char (uint8 uart, uint8 TxChar) |
void ICACHE_FLASH_ATTR | uart1_write_char (char c) |
void ICACHE_FLASH_ATTR | uart0_write_char (char c) |
void ICACHE_FLASH_ATTR | uart0_tx_buffer (uint8 *buf, uint16 len) |
void ICACHE_FLASH_ATTR | uart0_sendStr (const char *str) |
void ICACHE_FLASH_ATTR | uart_init (UartBautRate uart0_br, UartBautRate uart1_br) |
void ICACHE_FLASH_ATTR | uart_set_word_length (uint8_t uart_no, UartBitsNum4Char len) |
void ICACHE_FLASH_ATTR | uart_set_stop_bits (uint8_t uart_no, UartStopBitsNum bit_num) |
void ICACHE_FLASH_ATTR | uart_set_line_inverse (uint8_t uart_no, UART_LineLevelInverse inverse_mask) |
void ICACHE_FLASH_ATTR | uart_set_parity (uint8_t uart_no, UartParityMode Parity_mode) |
void ICACHE_FLASH_ATTR | uart_set_baudrate (uint8 uart_no, uint32_t baud_rate) |
Variables | |
UartDevice | UartDev |
LOCAL void uart0_rx_intr_handler | ( | void * | para | ) |
Definition at line 199 of file uart.c.
References en61107_fifo_put(), en61107_is_eod_char(), en61107_received_task_prio, ICACHE_FLASH_ATTR, kmp_fifo_put(), kmp_received_task_prio, READ_PERI_REG, system_os_post(), UART0, UART_FIFO, UART_FRM_ERR_INT_CLR, UART_FRM_ERR_INT_ST, UART_INT_CLR, UART_INT_ST, UART_RXFIFO_CNT, UART_RXFIFO_CNT_S, UART_RXFIFO_FULL_INT_CLR, UART_RXFIFO_FULL_INT_ST, UART_RXFIFO_TOUT_INT_CLR, UART_RXFIFO_TOUT_INT_ST, UART_STATUS, and WRITE_PERI_REG.
Referenced by uart_config().
void ICACHE_FLASH_ATTR uart0_sendStr | ( | const char * | str | ) |
Definition at line 181 of file uart.c.
References LOCAL, UART0, and uart_tx_one_char().
void ICACHE_FLASH_ATTR uart0_tx_buffer | ( | uint8 * | buf, |
uint16 | len | ||
) |
Definition at line 163 of file uart.c.
References ICACHE_FLASH_ATTR, UART0, and uart_tx_one_char().
Referenced by en61107_uart_send_en61107(), en61107_uart_send_en61107_ident(), en61107_uart_send_inst_values(), en61107_uart_send_standard_data_1(), en61107_uart_send_standard_data_2(), kmp_get_register_timer_func(), and kmp_get_serial_timer_func().
void ICACHE_FLASH_ATTR uart0_write_char | ( | char | c | ) |
Definition at line 143 of file uart.c.
References ICACHE_FLASH_ATTR, UART0, and uart_tx_one_char().
Referenced by uart_init().
void ICACHE_FLASH_ATTR uart1_write_char | ( | char | c | ) |
Definition at line 126 of file uart.c.
References ICACHE_FLASH_ATTR, UART1, and uart_tx_one_char().
LOCAL void ICACHE_FLASH_ATTR uart_config | ( | uint8 | uart_no | ) |
Definition at line 39 of file uart.c.
References UartDevice::baut_rate, CLEAR_PERI_REG_MASK, UartDevice::data_bits, ETS_UART_INTR_ATTACH, UartDevice::exist_parity, FUNC_U0RTS, FUNC_U0TXD, FUNC_U1TXD_BK, NONE_BITS, UartDevice::parity, PERIPHS_IO_MUX_GPIO2_U, PERIPHS_IO_MUX_MTDO_U, PERIPHS_IO_MUX_U0TXD_U, PIN_FUNC_SELECT, PIN_PULLUP_DIS, UartDevice::rcv_buff, SET_PERI_REG_MASK, STICK_PARITY_DIS, STICK_PARITY_EN, UartDevice::stop_bits, RcvMsgBuff::TrigLvl, UART0, uart0_rx_intr_handler(), UART1, UART_BIT_NUM, UART_BIT_NUM_S, UART_CLK_FREQ, UART_CONF0, UART_CONF1, UART_FRM_ERR_INT_ENA, UART_INT_CLR, UART_INT_ENA, UART_PARITY_EN_M, UART_PARITY_EN_S, UART_PARITY_M, UART_PARITY_S, UART_RX_FLOW_EN, UART_RX_FLOW_THRHD, UART_RX_FLOW_THRHD_S, UART_RX_TOUT_EN, UART_RX_TOUT_THRHD, UART_RX_TOUT_THRHD_S, UART_RXFIFO_FULL_INT_ENA, UART_RXFIFO_FULL_THRHD, UART_RXFIFO_FULL_THRHD_S, UART_RXFIFO_RST, UART_RXFIFO_TOUT_INT_ENA, UART_STOP_BIT_NUM, UART_STOP_BIT_NUM_S, UART_TXFIFO_RST, and WRITE_PERI_REG.
Referenced by uart_init().
void ICACHE_FLASH_ATTR uart_init | ( | UartBautRate | uart0_br, |
UartBautRate | uart1_br | ||
) |
Definition at line 273 of file uart.c.
References UartDevice::baut_rate, UartDevice::data_bits, EIGHT_BITS, ETS_UART_INTR_ENABLE, EVEN_BITS, UartDevice::exist_parity, ICACHE_FLASH_ATTR, NONE_BITS, os_install_putc1, UartDevice::parity, SEVEN_BITS, STICK_PARITY_DIS, STICK_PARITY_EN, UartDevice::stop_bits, TWO_STOP_BIT, UART0, uart0_write_char(), UART1, and uart_config().
void ICACHE_FLASH_ATTR uart_set_baudrate | ( | uint8 | uart_no, |
uint32_t | baud_rate | ||
) |
Definition at line 337 of file uart.c.
References UART_CLK_FREQ.
Referenced by en61107_delayed_uart_change_setting_timer_func(), en61107_uart_send_en61107(), en61107_uart_send_en61107_ident(), en61107_uart_send_inst_values(), en61107_uart_send_standard_data_1(), and en61107_uart_send_standard_data_2().
void ICACHE_FLASH_ATTR uart_set_line_inverse | ( | uint8_t | uart_no, |
UART_LineLevelInverse | inverse_mask | ||
) |
Definition at line 321 of file uart.c.
References CLEAR_PERI_REG_MASK, ICACHE_FLASH_ATTR, SET_PERI_REG_MASK, UART_CONF0, and UART_LINE_INV_MASK.
void ICACHE_FLASH_ATTR uart_set_parity | ( | uint8_t | uart_no, |
UartParityMode | Parity_mode | ||
) |
Definition at line 327 of file uart.c.
References CLEAR_PERI_REG_MASK, ICACHE_FLASH_ATTR, NONE_BITS, SET_PERI_REG_MASK, UART_CONF0, UART_PARITY, and UART_PARITY_EN.
Referenced by en61107_uart_send_en61107(), en61107_uart_send_en61107_ident(), en61107_uart_send_inst_values(), en61107_uart_send_standard_data_1(), and en61107_uart_send_standard_data_2().
void ICACHE_FLASH_ATTR uart_set_stop_bits | ( | uint8_t | uart_no, |
UartStopBitsNum | bit_num | ||
) |
Definition at line 316 of file uart.c.
References ICACHE_FLASH_ATTR, SET_PERI_REG_BITS, UART_CONF0, UART_STOP_BIT_NUM, and UART_STOP_BIT_NUM_S.
Referenced by en61107_delayed_uart_change_setting_timer_func(), en61107_uart_send_en61107(), en61107_uart_send_en61107_ident(), en61107_uart_send_inst_values(), en61107_uart_send_standard_data_1(), and en61107_uart_send_standard_data_2().
void ICACHE_FLASH_ATTR uart_set_word_length | ( | uint8_t | uart_no, |
UartBitsNum4Char | len | ||
) |
Definition at line 311 of file uart.c.
References ICACHE_FLASH_ATTR, SET_PERI_REG_BITS, UART_BIT_NUM, UART_BIT_NUM_S, and UART_CONF0.
Referenced by en61107_uart_send_en61107(), en61107_uart_send_en61107_ident(), en61107_uart_send_inst_values(), en61107_uart_send_standard_data_1(), and en61107_uart_send_standard_data_2().
Definition at line 104 of file uart.c.
References ICACHE_FLASH_ATTR, OK, READ_PERI_REG, UART_FIFO, UART_STATUS, UART_TXFIFO_CNT, UART_TXFIFO_CNT_S, and WRITE_PERI_REG.
Referenced by uart0_sendStr(), uart0_tx_buffer(), uart0_write_char(), and uart1_write_char().
UartDevice UartDev |