DA14580
3年前
Posted byroland0 points 1 replyOn 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.
肌萎缩性侧索硬化症o in my application I have to use EVEN 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?
3年前
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