/* Configure the RS485 mode according to the specified parameters in the uart_rs485_config_t.  */
void ald_uart_rs485_config(ald_uart_handle_t *hperh, ald_uart_rs485_config_t *config)
/* Configure the RS485 mode according to the specified parameters in the uart_rs485_config_t.  */
void ald_uart_rs485_config(ald_uart_handle_t *hperh, ald_uart_rs485_config_t *config)
{
    assert_param(IS_UART_ALL(hperh->perh));
    assert_param(IS_FUNC_STATE(config->normal));
    assert_param(IS_FUNC_STATE(config->dir));
    assert_param(IS_FUNC_STATE(config->invert));
    MODIFY_REG(hperh->perh->RS485, UART_RS485_AADNEN_MSK, config->normal << UART_RS485_AADNEN_POS);
    MODIFY_REG(hperh->perh->RS485, UART_RS485_AADACEN_MSK, config->dir << UART_RS485_AADACEN_POS);
    MODIFY_REG(hperh->perh->RS485, UART_RS485_AADINV_MSK, config->invert << UART_RS485_AADINV_POS);
    MODIFY_REG(hperh->perh->RS485, UART_RS485_ADDR_MSK, config->addr << UART_RS485_ADDR_POSS);
    return;
}