Skip to content

Commit

Permalink
fix(PeriphDrivers): Fix LPUART GetClockSource Settings for MAX32655 a…
Browse files Browse the repository at this point in the history
…nd MAX78000 (#1119)

Co-authored-by: EricB-ADI <eric.busch@analogdevices.com>
Co-authored-by: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 19, 2024
1 parent 330aef5 commit fb3ae96
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
9 changes: 9 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32680/uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,15 @@ int MXC_UART_SetFlowCtrl(mxc_uart_regs_t *uart, mxc_uart_flow_t flowCtrl, int rt
*/
int MXC_UART_SetClockSource(mxc_uart_regs_t *uart, mxc_uart_clock_t clock);

/**
* @brief Gets the clock source used for the UART instance
*
* @param uart Pointer to UART registers (selects the UART block used.)
*
* @return The selected clock source for the UART instance
*/
mxc_uart_clock_t MXC_UART_GetClockSource(mxc_uart_regs_t *uart);

/* ************************************************************************* */
/* Low-level functions */
/* ************************************************************************* */
Expand Down
4 changes: 2 additions & 2 deletions Libraries/PeriphDrivers/Source/UART/uart_ai85.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ mxc_uart_clock_t MXC_UART_GetClockSource(mxc_uart_regs_t *uart)
break;
case 3:
switch (clock_option) {
case 0:
case 2:
return MXC_UART_IBRO_CLK;
case 1:
case 3:
return MXC_UART_ERTCO_CLK;
default:
return E_BAD_STATE;
Expand Down
5 changes: 2 additions & 3 deletions Libraries/PeriphDrivers/Source/UART/uart_me17.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ int MXC_UART_Init(mxc_uart_regs_t *uart, unsigned int baud, mxc_uart_clock_t clo
if (retval != E_NO_ERROR) {
return retval;
}

return MXC_UART_RevB_Init((mxc_uart_revb_regs_t *)uart, baud, MXC_UART_GetClockSource(uart));
}

Expand Down Expand Up @@ -320,9 +319,9 @@ mxc_uart_clock_t MXC_UART_GetClockSource(mxc_uart_regs_t *uart)
break;
case 3:
switch (clock_option) {
case 0:
case 2:
return MXC_UART_IBRO_CLK;
case 1:
case 3:
return MXC_UART_ERTCO_CLK;
default:
return E_BAD_STATE;
Expand Down

0 comments on commit fb3ae96

Please sign in to comment.