Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(PeriphDrivers)!: Update WUT API naming schemes for MAX32655, MAX32657, MAX32665, MAX32690, MAX78000, and MAX78002. Offer WUT selection on MAX32690 #1291

Merged
merged 10 commits into from
Dec 16, 2024
6 changes: 3 additions & 3 deletions Examples/MAX32655/Bluetooth/BLE_FreeRTOS/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ 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(MXC_WUT0);
MXC_WUT_StoreCount(MXC_WUT0);
preCapture = MXC_WUT_GetCount(MXC_WUT0);
schUsec = PalTimerGetExpTime();

Expand All @@ -176,7 +176,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}
} else {
/* Snapshot the current WUT value */
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);
preCapture = MXC_WUT_GetCount(MXC_WUT0);
bleSleepTicks = 0;
schUsec = 0;
Expand Down Expand Up @@ -239,7 +239,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}

/* Recalculate dsWutTicks for the FreeRTOS tick counter update */
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);
postCapture = MXC_WUT_GetCount(MXC_WUT0);
dsWutTicks = postCapture - preCapture;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ 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(MXC_WUT0);
MXC_WUT_StoreCount(MXC_WUT0);
preCapture = MXC_WUT_GetCount(MXC_WUT0);
schUsec = PalTimerGetExpTime();

Expand All @@ -176,7 +176,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}
} else {
/* Snapshot the current WUT value */
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);
preCapture = MXC_WUT_GetCount(MXC_WUT0);
bleSleepTicks = 0;
schUsec = 0;
Expand Down Expand Up @@ -238,7 +238,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}

/* Recalculate dsWutTicks for the FreeRTOS tick counter update */
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);
postCapture = MXC_WUT_GetCount(MXC_WUT0);
dsWutTicks = postCapture - preCapture;

Expand Down
4 changes: 2 additions & 2 deletions Examples/MAX32655/Bluetooth/RF_Test/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
MXC_GPIO_OutSet(uart_rts.port, uart_rts.mask);

/* Snapshot the current WUT value */
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);
pre_capture = MXC_WUT_GetCount(MXC_WUT0);
MXC_WUT_SetCompare(MXC_WUT0, pre_capture + wut_ticks);
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);

LED_Off(1);

Expand Down
4 changes: 2 additions & 2 deletions Examples/MAX32655/FreeRTOSDemo/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
MXC_GPIO_OutSet(uart_rts.port, uart_rts.mask);

/* Snapshot the current WUT value */
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);
pre_capture = MXC_WUT_GetCount(MXC_WUT0);
MXC_WUT_SetCompare(MXC_WUT0, pre_capture + wut_ticks);
MXC_WUT_Edge(MXC_WUT0);
MXC_WUT_WaitForEdge(MXC_WUT0);

LED_Off(1);

Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32655/FreeRTOSDemo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ int freertos_permit_tickless(void)
*/
void WUT_IRQHandler(void)
{
MXC_WUT_IntClear(MXC_WUT0);
MXC_WUT_ClearFlags(MXC_WUT0);
NVIC_ClearPendingIRQ(WUT_IRQn);
}

Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32655/WUT/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

void WUT_IRQHandler(void)
{
MXC_WUT_IntClear(MXC_WUT0);
MXC_WUT_ClearFlags(MXC_WUT0);
}

// *****************************************************************************
Expand Down
6 changes: 3 additions & 3 deletions Examples/MAX32665/Bluetooth/BLE_FreeRTOS/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ 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();
MXC_WUT_StoreCount();
preCapture = MXC_WUT_GetCount();
schUsec = PalTimerGetExpTime();

Expand All @@ -266,7 +266,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}
} else {
/* Snapshot the current WUT value */
MXC_WUT_Edge();
MXC_WUT_WaitForEdge();
preCapture = MXC_WUT_GetCount();
bleSleepTicks = 0;
schUsec = 0;
Expand Down Expand Up @@ -327,7 +327,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}

/* Recalculate dsWutTicks for the FreeRTOS tick counter update */
MXC_WUT_Edge();
MXC_WUT_WaitForEdge();
postCapture = MXC_WUT_GetCount();
dsWutTicks = postCapture - preCapture;

Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32665/Bluetooth/BLE_FreeRTOS/stack_dats.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ static void mainWsfInit(void)
/*************************************************************************************************/
void WUT_IRQHandler(void)
{
MXC_WUT_IntClear();
MXC_WUT_ClearFlags();
NVIC_ClearPendingIRQ(WUT_IRQn);
MXC_WUT_Handler();
PalTimerIRQCallBack();
Expand Down
6 changes: 3 additions & 3 deletions Examples/MAX32665/Bluetooth/RF_Test/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ 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();
MXC_WUT_StoreCount();
preCapture = MXC_WUT_GetCount();
schUsec = PalTimerGetExpTime();

Expand All @@ -264,7 +264,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}
} else {
/* Snapshot the current WUT value */
MXC_WUT_Edge();
MXC_WUT_WaitForEdge();
preCapture = MXC_WUT_GetCount();
bleSleepTicks = 0;
schUsec = 0;
Expand Down Expand Up @@ -326,7 +326,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}

/* Recalculate dsWutTicks for the FreeRTOS tick counter update */
MXC_WUT_Edge();
MXC_WUT_WaitForEdge();
postCapture = MXC_WUT_GetCount();
dsWutTicks = postCapture - preCapture;

Expand Down
4 changes: 2 additions & 2 deletions Examples/MAX32665/FreeRTOSDemo/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
MXC_GPIO_OutSet(uart_rts.port, uart_rts.mask);

/* Snapshot the current WUT value */
MXC_WUT_Edge();
MXC_WUT_WaitForEdge();
pre_capture = MXC_WUT_GetCount();
MXC_WUT_SetCompare(pre_capture + wut_ticks);
MXC_WUT_Edge();
MXC_WUT_WaitForEdge();

LED_Off(SLEEP_LED);

Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32665/FreeRTOSDemo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ void turnOffUnused(void)
*/
void WUT_IRQHandler(void)
{
MXC_WUT_IntClear();
MXC_WUT_ClearFlags();
NVIC_ClearPendingIRQ(WUT_IRQn);
}

Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32665/WUT/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/***** Functions *****/
void WUT_IRQHandler(void)
{
MXC_WUT_IntClear();
MXC_WUT_ClearFlags();
}

// *****************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions Examples/MAX32680/FreeRTOSDemo/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
MXC_GPIO_OutSet(uart_rts.port, uart_rts.mask);

/* Snapshot the current WUT value */
MXC_WUT_Edge(MXC_WUT);
MXC_WUT_WaitForEdge(MXC_WUT);
pre_capture = MXC_WUT_GetCount(MXC_WUT);
MXC_WUT_SetCompare(MXC_WUT, pre_capture + wut_ticks);
MXC_WUT_Edge(MXC_WUT);
MXC_WUT_WaitForEdge(MXC_WUT);

LED_Off(1);

Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32680/FreeRTOSDemo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ int freertos_permit_tickless(void)
*/
void WUT_IRQHandler(void)
{
MXC_WUT_IntClear(MXC_WUT);
MXC_WUT_ClearFlags(MXC_WUT);
NVIC_ClearPendingIRQ(WUT_IRQn);
}

Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32680/WUT/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void setTrigger(int waitForTrigger)

void WUT_IRQHandler(void)
{
MXC_WUT_IntClear(MXC_WUT);
MXC_WUT_ClearFlags(MXC_WUT);
}

// *****************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_FreeRTOS/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
16 changes: 8 additions & 8 deletions Examples/MAX32690/Bluetooth/BLE_FreeRTOS/freertos_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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_StoreCount(MXC_WUT0);
preCapture = MXC_WUT_GetCount(MXC_WUT0);
schUsec = PalTimerGetExpTime();

/* Adjust idleTicks for the time it takes to restart the BLE hardware */
Expand All @@ -176,8 +176,8 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
}
} else {
/* Snapshot the current WUT value */
MXC_WUT_Edge();
preCapture = MXC_WUT_GetCount();
MXC_WUT_WaitForEdge(MXC_WUT0);
preCapture = MXC_WUT_GetCount(MXC_WUT0);
bleSleepTicks = 0;
schUsec = 0;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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_WaitForEdge(MXC_WUT0);
postCapture = MXC_WUT_GetCount(MXC_WUT0);
dsWutTicks = postCapture - preCapture;

/*
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_FreeRTOS/stack_dats.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_datc/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_dats/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_fit/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_otac/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_otas/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Loading
Loading