Skip to content

Commit

Permalink
Updated wut.h Doxygen comments
Browse files Browse the repository at this point in the history
  • Loading branch information
crsz20 committed Dec 12, 2024
1 parent 2e1e9ee commit a982765
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Libraries/PeriphDrivers/Include/MAX32655/wut.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ MXC_WUT_IntClear(mxc_wut_regs_t *wut);

/**
* @brief Clear the timer interrupt.
* @param wut Pointer to Wakeup Timer instance to clear interrupt flags for.
*/
void MXC_WUT_ClearFlags(mxc_wut_regs_t *wut);

Expand All @@ -177,7 +178,7 @@ MXC_WUT_IntStatus(mxc_wut_regs_t *wut);

/**
* @brief Get the timer interrupt status.
* @param wut Pointer to Wakeup Timer instance to get interrupt staus from.
* @param wut Pointer to Wakeup Timer instance to get interrupt status from.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_GetFlags(mxc_wut_regs_t *wut);
Expand Down
3 changes: 2 additions & 1 deletion Libraries/PeriphDrivers/Include/MAX32657/wut.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ MXC_WUT_IntClear(mxc_wut_regs_t *wut);

/**
* @brief Clear the timer interrupt.
* @param wut Pointer to Wakeup Timer instance to clear interrupt flags for.
*/
void MXC_WUT_ClearFlags(mxc_wut_regs_t *wut);

Expand All @@ -175,7 +176,7 @@ MXC_WUT_IntStatus(mxc_wut_regs_t *wut);

/**
* @brief Get the timer interrupt status.
* @param wut Pointer to Wakeup Timer instance to get interrupt staus from.
* @param wut Pointer to Wakeup Timer instance to get interrupt status from.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_GetFlags(mxc_wut_regs_t *wut);
Expand Down
1 change: 1 addition & 0 deletions Libraries/PeriphDrivers/Include/MAX32680/wut.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ MXC_WUT_IntClear(mxc_wut_regs_t *wut);

/**
* @brief Clear the timer interrupt.
* @param wut Pointer to Wakeup Timer instance to clear interrupt flags for.
*/
void MXC_WUT_ClearFlags(mxc_wut_regs_t *wut);

Expand Down
24 changes: 23 additions & 1 deletion Libraries/PeriphDrivers/Include/MAX32690/wut.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,62 +112,73 @@ typedef void (*mxc_wut_complete_cb_t)(int result);

/**
* @brief Initialize timer module clock.
* @param wut Pointer to Wakeup Timer instance to initialize.
* @param pres Prescaler value.
*/
void MXC_WUT_Init(mxc_wut_regs_t *wut, mxc_wut_pres_t pres);

/**
* @brief Shutdown timer module clock.
* @param wut Pointer to Wakeup Timer instance to shutdown.
*/
void MXC_WUT_Shutdown(mxc_wut_regs_t *wut);

/**
* @brief Enable the timer.
* @param wut Pointer to Wakeup Timer instance to enable.
*/
void MXC_WUT_Enable(mxc_wut_regs_t *wut);

/**
* @brief Disable the timer.
* @param wut Pointer to Wakeup Timer instance to disable.
*/
void MXC_WUT_Disable(mxc_wut_regs_t *wut);

/**
* @brief Configure the timer.
* @param wut Pointer to Wakeup Timer instance to configure.
* @param cfg Pointer to timer configuration struct.
*/
void MXC_WUT_Config(mxc_wut_regs_t *wut, const mxc_wut_cfg_t *cfg);

/**
* @brief Get the timer compare count.
* @param wut Pointer to Wakeup Timer instance to get compare value from.
* @return Returns the current compare count.
*/
uint32_t MXC_WUT_GetCompare(mxc_wut_regs_t *wut);

/**
* @brief Get the timer capture count.
* @param wut Pointer to Wakeup Timer instance to get capture count value from.
* @return Returns the most recent capture count.
*/
uint32_t MXC_WUT_GetCapture(mxc_wut_regs_t *wut);

/**
* @brief Get the timer count.
* @param wut Pointer to Wakeup Timer instance to get count value from.
* @return Returns the current count.
*/
uint32_t MXC_WUT_GetCount(mxc_wut_regs_t *wut);

/**
* @brief Clear the timer interrupt.
* @param wut Pointer to Wakeup Timer instance to clear interrupt flags for.
*/
void MXC_WUT_ClearFlags(mxc_wut_regs_t *wut);

/**
* @brief Get the timer interrupt status.
* @param wut Pointer to Wakeup Timer instance to get interrupt status from.
* @return Returns the interrupt status. 1 if interrupt has occurred.
*/
uint32_t MXC_WUT_GetFlags(mxc_wut_regs_t *wut);

/**
* @brief Set the timer compare count.
* @param wut Pointer to Wakeup Timer instance to set compare value for.
* @param cmp_cnt New compare count.
* @note This function does not protect against output glitches in PWM mode.
* Use MXC_WUT_PWMSetPeriod when in PWM mode.
Expand All @@ -176,12 +187,14 @@ void MXC_WUT_SetCompare(mxc_wut_regs_t *wut, uint32_t cmp_cnt);

/**
* @brief Set the timer count.
* @param wut Pointer to Wakeup Timer instance to set count value for.
* @param cnt New count.
*/
void MXC_WUT_SetCount(mxc_wut_regs_t *wut, uint32_t cnt);

/**
* @brief Convert real time to timer ticks.
* @param wut Pointer to Wakeup Timer instance to get tick count for.
* @param time Number of units of time.
* @param units Which units of time you want to convert.
* @param ticks Pointer to store the number of ticks calculated.
Expand All @@ -192,6 +205,7 @@ int MXC_WUT_GetTicks(mxc_wut_regs_t *wut, uint32_t time, mxc_wut_unit_t units, u

/**
* @brief Convert timer ticks to real time.
* @param wut Pointer to Wakeup Timer instance to get time for.
* @param ticks Number of ticks.
* @param time Pointer to store number of units of time.
* @param units Pointer to store the units that time represents.
Expand All @@ -202,35 +216,41 @@ int MXC_WUT_GetTime(mxc_wut_regs_t *wut, uint32_t ticks, uint32_t *time, mxc_wut

/**
* @brief Wait for an edge of the WUT count register.
* @param wut Pointer to Wakeup Timer instance to wait on.
*/
void MXC_WUT_WaitForEdge(mxc_wut_regs_t *wut);

/**
* @brief Store the count and snapshot values.
* @param wut Pointer to Wakeup Timer instance to store count and snapshot values for.
*/
void MXC_WUT_StoreCount(mxc_wut_regs_t *wut);

/**
* @brief Restore the DBB clock with the stored count and snapshot values.
* @param wut Pointer to Wakeup Timer instance restore count and snapshot values for.
* @param dbbFreq Frequency of DBB clock.
*/
void MXC_WUT_RestoreBBClock(mxc_wut_regs_t *wut, uint32_t dbbFreq);

/**
* @brief Get the difference between the stored counter value
* and the current counter value.
* @param wut Pointer to Wakeup Timer instance to get current sleep ticks for.
* @return Returns the current counter value - stored counter value.
*/
uint32_t MXC_WUT_GetSleepTicks(mxc_wut_regs_t *wut);

/**
* @brief Delays for the given number of milliseconds.
* @param wut Pointer to Wakeup Timer instance to use as the delay timer.
* @param waitMs Number of milliseconds to wait.
*/
void MXC_WUT_Delay_MS(mxc_wut_regs_t *wut, uint32_t waitMs);

/**
* @brief Trim the 32 kHz crystal load settings, blocks until complete.
* @param wut Pointer to Wakeup Timer instance to trim.
* @details This procedure uses the WUT and the BLE DBB, driven by the 32 MHz crystal,
* to trim the load settings of the 32 kHz crystal. This procedure will only
* work if the BLE DBB is initialized and running.
Expand All @@ -241,6 +261,7 @@ int MXC_WUT_TrimCrystal(mxc_wut_regs_t *wut);

/**
* @brief Trim the 32 kHz crystal load settings, non-blocking interrupt based.
* @param wut Pointer to Wakeup Timer instance to trim.
* @details This procedure uses the WUT and the BLE DBB, driven by the 32 MHz crystal,
* to trim the load settings of the 32 kHz crystal. This procedure will only
* work if the BLE DBB is initialized and running.
Expand All @@ -252,14 +273,15 @@ int MXC_WUT_TrimCrystalAsync(mxc_wut_regs_t *wut, mxc_wut_complete_cb_t cb);

/**
* @brief Check to see if the trim procedure is ongoing.
* @param wut Pointer to Wakeup Timer instance to check trim status for.
* @details Must leave the 32 MHz clock and BLE DBB running while the trim procedure is pending.
* @return #E_NO_ERROR If trim is complete, E_BUSY if trim procedure is ongoing.
*/
int MXC_WUT_TrimPending(mxc_wut_regs_t *wut);

/**
* @brief Interrupt handler for trim procedure.
*
* @param wut Pointer to Wakeup Timer instance to handle interrupts for.
* @return #E_NO_ERROR If trim is complete, E_BUSY if trim procedure is ongoing.
*/
int MXC_WUT_Handler(mxc_wut_regs_t *wut);
Expand Down

0 comments on commit a982765

Please sign in to comment.