periph_ctrl: Refactor to add periph_module_reset(), avoid potential race in SPI DMA workaround

Also refactor use of direct clock access in unit test ref_clock (probably not a real issue)
This commit is contained in:
Angus Gratton
2017-10-02 17:48:16 +11:00
committed by Angus Gratton
parent a3731902f5
commit 0dd9b899b7
4 changed files with 190 additions and 228 deletions

View File

@@ -56,6 +56,7 @@ typedef enum {
*
* @param[in] periph : Peripheral module name
*
* Clock for the module will be ungated, and reset de-asserted.
*
* @return NULL
*
@@ -67,12 +68,28 @@ void periph_module_enable(periph_module_t periph);
*
* @param[in] periph : Peripheral module name
*
* Clock for the module will be gated, reset asserted.
*
* @return NULL
*
*/
void periph_module_disable(periph_module_t periph);
/**
* @brief reset peripheral module
*
* @param[in] periph : Peripheral module name
*
* Reset will asserted then de-assrted for the peripheral.
*
* Calling this function does not enable or disable the clock for the module.
*
* @return NULL
*
*/
void periph_module_reset(periph_module_t periph);
#ifdef __cplusplus
}
#endif