AnsweredAssumed Answered

UART parity in driver usart_001.h incorrect

Question asked by Vivien Wong on Jul 28, 2016
Latest reply on Aug 1, 2016 by Kerry Zhou

Hi,

 

    I am currently using the lpc_ip driver usart_001.h and realized that there is an error in the definition of the UART parity bits:    The driver sets it to:

typedef enum IP_UART_PARITY {

    UART_PARITY_NONE = 0,                                    /*!< No parity */

    UART_PARITY_ODD = (4 << 3),                                /*!< Odd parity */

    UART_PARITY_EVEN = (5 << 3),                            /*!< Even parity */

    UART_PARITY_SP_1 = (6 << 3),                            /*!< Forced "1" stick parity */

    UART_PARITY_SP_0 = (7 << 3)                                /*!< Forced "0" stick parity */

} IP_UART_PARITY_T;

 

However, based on the LPC18xx user manual, I believe this should be set to

typedef enum IP_UART_PARITY {

    UART_PARITY_NONE = 0,                                    /*!< No parity */

    UART_PARITY_ODD = (1 << 3),                                /*!< Odd parity */

    UART_PARITY_EVEN = (3 << 3),                            /*!< Even parity */

    UART_PARITY_SP_1 = (5 << 3),                            /*!< Forced "1" stick parity */

    UART_PARITY_SP_0 = (7 << 3)                                /*!< Forced "0" stick parity */

} IP_UART_PARITY_T;

 

  I have debug on my board and confirm that this could be an error on the driver.

Outcomes