diff --git a/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/dats_main.c b/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/dats_main.c index 4987581980b..4e3e6fc638e 100644 --- a/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/dats_main.c +++ b/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/dats_main.c @@ -342,7 +342,7 @@ static void trimStart(void) extern void wutTrimCb(int err); /* Start the 32 kHz crystal trim procedure */ - err = MXC_WUT_TrimCrystalAsync(wutTrimCb); + err = MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb); if (err != E_NO_ERROR) { APP_TRACE_INFO1("Error starting 32kHz crystal trim %d", err); } diff --git a/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/freertos_tickless.c b/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/freertos_tickless.c index 7f8b864d752..9b282eade90 100644 --- a/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/freertos_tickless.c +++ b/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/freertos_tickless.c @@ -60,7 +60,7 @@ int freertos_permit_tickless(void) { /* Can not disable BLE DBB and 32 MHz clock while trim procedure is ongoing */ - if (MXC_WUT_TrimPending() != E_NO_ERROR) { + if (MXC_WUT_TrimPending(MXC_WUT0) != E_NO_ERROR) { return E_BUSY; } @@ -160,8 +160,8 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime) /* Determine if we need to snapshot the PalBb clock */ if (schTimerActive) { /* Snapshot the current WUT value with the PalBb clock */ - MXC_WUT_Store(); - preCapture = MXC_WUT_GetCount(); + MXC_WUT_Store(MXC_WUT0); + preCapture = MXC_WUT_GetCount(MXC_WUT0); schUsec = PalTimerGetExpTime(); /* Adjust idleTicks for the time it takes to restart the BLE hardware */ @@ -176,8 +176,8 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime) } } else { /* Snapshot the current WUT value */ - MXC_WUT_Edge(); - preCapture = MXC_WUT_GetCount(); + MXC_WUT_Edge(MXC_WUT0); + preCapture = MXC_WUT_GetCount(MXC_WUT0); bleSleepTicks = 0; schUsec = 0; } @@ -221,7 +221,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime) if (schTimerActive) { /* Restore the BB counter */ - MXC_WUT_RestoreBBClock(BB_CLK_RATE_HZ); + MXC_WUT_RestoreBBClock(MXC_WUT0, BB_CLK_RATE_HZ); /* Restart the BLE scheduler timer */ dsWutTicks = MXC_WUT->cnt - preCapture; @@ -237,8 +237,8 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime) } /* Recalculate dsWutTicks for the FreeRTOS tick counter update */ - MXC_WUT_Edge(); - postCapture = MXC_WUT_GetCount(); + MXC_WUT_Edge(MXC_WUT0); + postCapture = MXC_WUT_GetCount(MXC_WUT0); dsWutTicks = postCapture - preCapture; /* diff --git a/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/stack_dats.c b/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/stack_dats.c index 4d161efd20f..a478911ed61 100644 --- a/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/stack_dats.c +++ b/Examples/MAX32690/Bluetooth/BLE_FreeRTOS/stack_dats.c @@ -279,7 +279,7 @@ void trim32k(void) /* Execute the trim procedure */ wutTrimComplete = 0; - if (MXC_WUT_TrimCrystalAsync(wutTrimCb) != E_NO_ERROR) { + if (MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb) != E_NO_ERROR) { APP_TRACE_INFO0("Error with 32k trim"); } else { while (!wutTrimComplete) {} diff --git a/Examples/MAX32690/Bluetooth/BLE_datc/main.c b/Examples/MAX32690/Bluetooth/BLE_datc/main.c index 974026c8523..ae3983a5d69 100644 --- a/Examples/MAX32690/Bluetooth/BLE_datc/main.c +++ b/Examples/MAX32690/Bluetooth/BLE_datc/main.c @@ -277,7 +277,7 @@ int main(void) /* Execute the trim procedure */ wutTrimComplete = 0; - MXC_WUT_TrimCrystalAsync(wutTrimCb); + MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb); while (!wutTrimComplete) {} /* Shutdown the 32 MHz crystal and the BLE DBB */ diff --git a/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c b/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c index 385b79dc7ae..35ae6279283 100644 --- a/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c +++ b/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c @@ -403,7 +403,7 @@ static void trimStart(void) extern void wutTrimCb(int err); /* Start the 32 kHz crystal trim procedure */ - err = MXC_WUT_TrimCrystalAsync(wutTrimCb); + err = MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb); if (err != E_NO_ERROR) { APP_TRACE_INFO1("Error starting 32kHz crystal trim %d", err); } diff --git a/Examples/MAX32690/Bluetooth/BLE_dats/main.c b/Examples/MAX32690/Bluetooth/BLE_dats/main.c index 43d033646e3..94f62ccbf4e 100644 --- a/Examples/MAX32690/Bluetooth/BLE_dats/main.c +++ b/Examples/MAX32690/Bluetooth/BLE_dats/main.c @@ -272,7 +272,7 @@ int main(void) /* Execute the trim procedure */ wutTrimComplete = 0; - MXC_WUT_TrimCrystalAsync(wutTrimCb); + MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb); while (!wutTrimComplete) {} /* Shutdown the 32 MHz crystal and the BLE DBB */ diff --git a/Examples/MAX32690/Bluetooth/BLE_fit/main.c b/Examples/MAX32690/Bluetooth/BLE_fit/main.c index 170005b548d..1cec080a019 100644 --- a/Examples/MAX32690/Bluetooth/BLE_fit/main.c +++ b/Examples/MAX32690/Bluetooth/BLE_fit/main.c @@ -272,7 +272,7 @@ int main(void) /* Execute the trim procedure */ wutTrimComplete = 0; - MXC_WUT_TrimCrystalAsync(wutTrimCb); + MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb); while (!wutTrimComplete) {} /* Shutdown the 32 MHz crystal and the BLE DBB */ diff --git a/Examples/MAX32690/Bluetooth/BLE_otac/main.c b/Examples/MAX32690/Bluetooth/BLE_otac/main.c index 2e4a0fbd036..2a63e84d709 100644 --- a/Examples/MAX32690/Bluetooth/BLE_otac/main.c +++ b/Examples/MAX32690/Bluetooth/BLE_otac/main.c @@ -273,7 +273,7 @@ int main(void) /* Execute the trim procedure */ wutTrimComplete = 0; - MXC_WUT_TrimCrystalAsync(wutTrimCb); + MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb); while (!wutTrimComplete) {} /* Shutdown the 32 MHz crystal and the BLE DBB */ diff --git a/Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c b/Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c index e1748d10954..b201a6f1044 100644 --- a/Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c +++ b/Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c @@ -349,7 +349,7 @@ static void trimStart(void) extern void wutTrimCb(int err); /* Start the 32 kHz crystal trim procedure */ - err = MXC_WUT_TrimCrystalAsync(wutTrimCb); + err = MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb); if (err != E_NO_ERROR) { APP_TRACE_INFO1("Error starting 32kHz crystal trim %d", err); } diff --git a/Examples/MAX32690/Bluetooth/BLE_otas/main.c b/Examples/MAX32690/Bluetooth/BLE_otas/main.c index e1a07935747..ac69bee4a59 100644 --- a/Examples/MAX32690/Bluetooth/BLE_otas/main.c +++ b/Examples/MAX32690/Bluetooth/BLE_otas/main.c @@ -276,7 +276,7 @@ int main(void) /* Execute the trim procedure */ wutTrimComplete = 0; - MXC_WUT_TrimCrystalAsync(wutTrimCb); + MXC_WUT_TrimCrystalAsync(MXC_WUT0, wutTrimCb); while (!wutTrimComplete) {} /* Stop here to measure the 32 kHz clock */ diff --git a/Examples/MAX32690/Bluetooth/RF_Test/freertos_tickless.c b/Examples/MAX32690/Bluetooth/RF_Test/freertos_tickless.c index cc9813c097e..4d9949f0afb 100644 --- a/Examples/MAX32690/Bluetooth/RF_Test/freertos_tickless.c +++ b/Examples/MAX32690/Bluetooth/RF_Test/freertos_tickless.c @@ -60,7 +60,7 @@ int freertos_permit_tickless(void) { /* Can not disable BLE DBB and 32 MHz clock while trim procedure is ongoing */ - if (MXC_WUT_TrimPending() != E_NO_ERROR) { + if (MXC_WUT_TrimPending(MXC_WUT0) != E_NO_ERROR) { return E_BUSY; } @@ -160,8 +160,8 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime) /* Determine if we need to snapshot the PalBb clock */ if (schTimerActive) { /* Snapshot the current WUT value with the PalBb clock */ - MXC_WUT_Store(); - preCapture = MXC_WUT_GetCount(); + MXC_WUT_Store(MXC_WUT0); + preCapture = MXC_WUT_GetCount(MXC_WUT0); schUsec = PalTimerGetExpTime(); /* Adjust idleTicks for the time it takes to restart the BLE hardware */ @@ -176,8 +176,8 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime) } } else { /* Snapshot the current WUT value */ - MXC_WUT_Edge(); - preCapture = MXC_WUT_GetCount(); + MXC_WUT_Edge(MXC_WUT0); + preCapture = MXC_WUT_GetCount(MXC_WUT0); bleSleepTicks = 0; schUsec = 0; } @@ -222,7 +222,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime) PalBbRestore(); /* Restore the BB counter */ - MXC_WUT_RestoreBBClock(BB_CLK_RATE_HZ); + MXC_WUT_RestoreBBClock(MXC_WUT0, BB_CLK_RATE_HZ); /* Restart the BLE scheduler timer */ dsWutTicks = MXC_WUT->cnt - preCapture; @@ -238,8 +238,8 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime) } /* Recalculate dsWutTicks for the FreeRTOS tick counter update */ - MXC_WUT_Edge(); - postCapture = MXC_WUT_GetCount(); + MXC_WUT_Edge(MXC_WUT0); + postCapture = MXC_WUT_GetCount(MXC_WUT0); dsWutTicks = postCapture - preCapture; /* diff --git a/Examples/MAX32690/FreeRTOSDemo/freertos_tickless.c b/Examples/MAX32690/FreeRTOSDemo/freertos_tickless.c index 6fc84f7cc72..f1a6d70bab4 100644 --- a/Examples/MAX32690/FreeRTOSDemo/freertos_tickless.c +++ b/Examples/MAX32690/FreeRTOSDemo/freertos_tickless.c @@ -67,7 +67,7 @@ __attribute__((weak)) int freertos_permit_tickless(void) */ void wutHitSnooze(void) { - wutSnooze = MXC_WUT_GetCount() + MAX_WUT_SNOOZE; + wutSnooze = MXC_WUT_GetCount(MXC_WUT0) + MAX_WUT_SNOOZE; wutSnoozeValid = 1; } @@ -108,7 +108,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime) } /* Check the WUT snooze */ - if (wutSnoozeValid && (MXC_WUT_GetCount() < wutSnooze)) { + if (wutSnoozeValid && (MXC_WUT_GetCount(MXC_WUT0) < wutSnooze)) { /* Finish out the rest of this tick with normal sleep */ MXC_LP_EnterSleepMode(); return; @@ -134,16 +134,16 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime) MXC_GPIO_OutSet(uart_rts.port, uart_rts.mask); /* Snapshot the current WUT value */ - MXC_WUT_Edge(); - pre_capture = MXC_WUT_GetCount(); - MXC_WUT_SetCompare(pre_capture + wut_ticks); - MXC_WUT_Edge(); + MXC_WUT_Edge(MXC_WUT0); + pre_capture = MXC_WUT_GetCount(MXC_WUT0); + MXC_WUT_SetCompare(MXC_WUT0, pre_capture + wut_ticks); + MXC_WUT_Edge(MXC_WUT0); LED_Off(1); MXC_LP_EnterStandbyMode(); - post_capture = MXC_WUT_GetCount(); + post_capture = MXC_WUT_GetCount(MXC_WUT0); actual_ticks = post_capture - pre_capture; LED_On(1); diff --git a/Examples/MAX32690/FreeRTOSDemo/main.c b/Examples/MAX32690/FreeRTOSDemo/main.c index 6a0c817a88e..a4a7c4862b6 100644 --- a/Examples/MAX32690/FreeRTOSDemo/main.c +++ b/Examples/MAX32690/FreeRTOSDemo/main.c @@ -345,7 +345,7 @@ int freertos_permit_tickless(void) */ void WUT_IRQHandler(void) { - MXC_WUT_ClearFlags(); + MXC_WUT_ClearFlags(MXC_WUT0); NVIC_ClearPendingIRQ(WUT0_IRQn); } @@ -374,7 +374,7 @@ int main(void) #if configUSE_TICKLESS_IDLE /* Initialize Wakeup timer */ - MXC_WUT_Init(MXC_WUT_PRES_1); + MXC_WUT_Init(MXC_WUT0, MXC_WUT_PRES_1); mxc_wut_cfg_t wut_cfg; wut_cfg.mode = MXC_WUT_MODE_COMPARE; wut_cfg.cmp_cnt = 0xFFFFFFFF; @@ -386,8 +386,8 @@ int main(void) NVIC_EnableIRQ(WUT_IRQn); /* Configure and start the WUT */ - MXC_WUT_Config(&wut_cfg); - MXC_WUT_Enable(); + MXC_WUT_Config(MXC_WUT0, &wut_cfg); + MXC_WUT_Enable(MXC_WUT0); /* Setup CTS interrupt */ MXC_GPIO_IntConfig(&uart_cts, MXC_GPIO_INT_FALLING);