added emsuart_stop()

This commit is contained in:
proddy
2019-01-02 12:40:10 +01:00
parent 1c4fff2c84
commit f15aa9508d
2 changed files with 10 additions and 1 deletions

View File

@@ -109,7 +109,7 @@ void ICACHE_FLASH_ATTR emsuart_init() {
USC0(EMSUART_UART) |= (tmp); // set bits
USC0(EMSUART_UART) &= ~(tmp); // clear bits
// conf 1 params
// conf1 params
// UCTOE = RX TimeOut enable (default is 1)
// UCTOT = RX TimeOut Threshold (7bit) = want this when no more data after 2 characters. (default is 2)
// UCFFT = RX FIFO Full Threshold (7 bit) = want this to be 31 for 32 bytes of buffer. (default was 127).
@@ -137,6 +137,14 @@ void ICACHE_FLASH_ATTR emsuart_init() {
system_uart_swap();
}
/*
* stop UART0 driver
*/
void ICACHE_FLASH_ATTR emsuart_stop() {
ETS_UART_INTR_DISABLE();
ETS_UART_INTR_ATTACH(NULL, NULL);
}
/*
* Send a BRK signal
* Which is a 11-bit set of zero's (11 cycles)

View File

@@ -28,6 +28,7 @@ typedef struct {
} _EMSRxBuf;
void ICACHE_FLASH_ATTR emsuart_init();
void ICACHE_FLASH_ATTR emsuart_stop();
void ICACHE_FLASH_ATTR emsuart_tx_buffer(uint8_t * buf, uint8_t len);
void ICACHE_FLASH_ATTR emsaurt_tx_poll();
void ICACHE_FLASH_ATTR emsuart_tx_brk();