summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/uart.h
diff options
context:
space:
mode:
authordaniel-k <github@daniel-krebs.net>2016-07-26 17:56:13 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-07-27 21:05:45 +0300
commitaa4ada943a1e08e595630875135a2d7816718194 (patch)
tree878141850bcd4badcb2e75a9fd1c50a45ff195d0 /esp8266/uart.h
parent01816068c8254c3440e8e6afac250ae00e332b91 (diff)
downloadmicropython-aa4ada943a1e08e595630875135a2d7816718194.tar.gz
micropython-aa4ada943a1e08e595630875135a2d7816718194.zip
esp8266/modpybuart: Fix UART parity setting.
The configuration bits for the UART register were wrong and the parity couldn't be enabled, because the exist_parity member hasn't been updated. I took this ESP8266 register description (http://esp8266.ru/esp8266-uart-reg/) as reference. Verification has been done with a logic analyzer.
Diffstat (limited to 'esp8266/uart.h')
-rw-r--r--esp8266/uart.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/esp8266/uart.h b/esp8266/uart.h
index 21894d3fa6..2b97683ff8 100644
--- a/esp8266/uart.h
+++ b/esp8266/uart.h
@@ -1,6 +1,8 @@
#ifndef _INCLUDED_UART_H_
#define _INCLUDED_UART_H_
+#include <eagle_soc.h>
+
#define UART0 (0)
#define UART1 (1)
@@ -18,14 +20,14 @@ typedef enum {
} UartStopBitsNum;
typedef enum {
- UART_NONE_BITS = 0,
- UART_ODD_BITS = 0,
- UART_EVEN_BITS = BIT4
+ UART_NONE_BITS = 0,
+ UART_ODD_BITS = BIT0,
+ UART_EVEN_BITS = 0
} UartParityMode;
typedef enum {
UART_STICK_PARITY_DIS = 0,
- UART_STICK_PARITY_EN = BIT3 | BIT5
+ UART_STICK_PARITY_EN = BIT1
} UartExistParity;
typedef enum {