On page 370 of the DA14585 there is the mode register of the UART.
Using uart.h one can construct a config value for the register. So instead of using a vanilla "3" in the init code of DSPS I like to use UART_CHAR_FORMAT_8 instead.
甚至还在我的应用程序必须使用Parity so that would be something like setting the: (UART_CHAR_FORMAT_8 | (1<<3) | (1<<4) ) to get 8 bits data, even parity and 1 stopbit.
REGISTER "UART_LCR_REG"
UART_DLS bits [1..0]
UART_STOP bit [2]
UART_PEN [3] and
UART_EPS [4]
RESERVED [5]
UART_BC [6]
UART_DLAB [7]
There seems to be no correlation between the enum() in the uart.h and the description of the hardware register. One would expect that the UART_PARITYBIT_xxxx could be mapped directly on the UART_PEN/EPS bits. Now the values are also reversed UART_PARITYBIT_EVEN = 0 whereas the register in the datasheet defines it to be "1". The reserved bit [5] could fit nicely as the SPACE/MARK parity setting.
So is this all correct? Or is the datasheet wrong or the uart.h? Is the bit 5 actually a bit that can set parity mark space?
Hi roland,
Thanks for your information! Let me check your issue and I will get back to you as soon as possible.
Thanks, PM_DIalog