Skip to content

Commit

Permalink
feat(PeriphDrivers): MSDK 1238: Add a way to remove clk and gpio init…
Browse files Browse the repository at this point in the history
…ialization at compile time (#730)

Signed-off-by: Sadik Ozer <[email protected]>
  • Loading branch information
ozersa authored Sep 25, 2023
1 parent a100fea commit 33fddc4
Show file tree
Hide file tree
Showing 107 changed files with 427 additions and 19 deletions.
4 changes: 4 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32520/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ typedef mxc_dma_srcdst_t (*mxc_dma_trans_chain_t)(mxc_dma_srcdst_t dest);
/**
* @brief Initialize DMA resources
* @details This initialization is required before using the DMA driver functions.
* @note On default this function enables DMA peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
* @return #E_NO_ERROR if successful
*/
int MXC_DMA_Init(void);
Expand Down
5 changes: 5 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32520/tmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ typedef void (*mxc_tmr_complete_t)(int error);

/**
* @brief Initialize timer module clock.
* @note On default this function enables TMR peripheral clock and related GPIOs.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param tmr Pointer to timer module to initialize.
* @param cfg configuration object
*/
Expand Down
8 changes: 7 additions & 1 deletion Libraries/PeriphDrivers/Include/MAX32520/wdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ typedef enum {

/**
* @brief Initialize the Watchdog Timer
* @param wdt Pointer to the watchdog registers
* @note On default this function enables WDT peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param wdt Pointer to the watchdog registers, has no effect incase of
* MSDK_NO_GPIO_CLK_INIT has been defined.
* @return See \ref MXC_Error_Codes for the list of error codes.
*/
int MXC_WDT_Init(mxc_wdt_regs_t *wdt);
Expand Down
4 changes: 4 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32570/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ typedef mxc_dma_srcdst_t (*mxc_dma_trans_chain_t)(mxc_dma_srcdst_t dest);
/**
* @brief Initialize DMA resources
* @details This initialization is required before using the DMA driver functions.
* @note On default this function enables DMA peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
* @return #E_NO_ERROR if successful
*/
int MXC_DMA_Init(void);
Expand Down
5 changes: 5 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32570/tmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ typedef void (*mxc_tmr_complete_t)(int error);

/**
* @brief Initialize timer module clock.
* @note On default this function enables TMR peripheral clock and related GPIOs.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param tmr Pointer to timer module to initialize.
* @param cfg configuration object
*/
Expand Down
8 changes: 7 additions & 1 deletion Libraries/PeriphDrivers/Include/MAX32570/wdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ typedef enum {

/**
* @brief Initialize the Watchdog Timer
* @param wdt Pointer to the watchdog registers
* @note On default this function enables WDT peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param wdt Pointer to the watchdog registers, has no effect incase of
* MSDK_NO_GPIO_CLK_INIT has been defined.
* @return See \ref MXC_Error_Codes for the list of error codes.
*/
int MXC_WDT_Init(mxc_wdt_regs_t *wdt);
Expand Down
4 changes: 4 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32572/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ typedef mxc_dma_srcdst_t (*mxc_dma_trans_chain_t)(mxc_dma_srcdst_t dest);
/**
* @brief Initialize DMA resources
* @details This initialization is required before using the DMA driver functions.
* @note On default this function enables DMA peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
* @return #E_NO_ERROR if successful
*/
int MXC_DMA_Init(void);
Expand Down
5 changes: 5 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32572/tmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ typedef void (*mxc_tmr_complete_t)(int error);

/**
* @brief Initialize timer module clock.
* @note On default this function enables TMR peripheral clock and related GPIOs.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param tmr Pointer to timer module to initialize.
* @param cfg configuration object
*/
Expand Down
8 changes: 7 additions & 1 deletion Libraries/PeriphDrivers/Include/MAX32572/wdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ typedef enum {

/**
* @brief Initialize the Watchdog Timer
* @param wdt Pointer to the watchdog registers
* @note On default this function enables WDT peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param wdt Pointer to the watchdog registers, has no effect incase of
* MSDK_NO_GPIO_CLK_INIT has been defined.
* @return See \ref MXC_Error_Codes for the list of error codes.
*/
int MXC_WDT_Init(mxc_wdt_regs_t *wdt);
Expand Down
4 changes: 4 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32650/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ typedef mxc_dma_srcdst_t (*mxc_dma_trans_chain_t)(mxc_dma_srcdst_t dest);
/**
* @brief Initialize DMA resources
* @details This initialization is required before using the DMA driver functions.
* @note On default this function enables DMA peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
* @return #E_NO_ERROR if successful
*/
int MXC_DMA_Init(void);
Expand Down
5 changes: 5 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32650/tmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ typedef void (*mxc_tmr_complete_t)(int error);

/**
* @brief Initialize timer module clock.
* @note On default this function enables TMR peripheral clock and related GPIOs.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param tmr Pointer to timer module to initialize.
* @param cfg configuration object
*/
Expand Down
10 changes: 8 additions & 2 deletions Libraries/PeriphDrivers/Include/MAX32650/wdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,14 @@ typedef enum {

/**
* @brief Initialize the Watchdog Timer
* @param wdt Pointer to the watchdog registers
* @param sys_cfg The system configuration object
* @note On default this function enables WDT peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param wdt Pointer to the watchdog registers, has no effect incase of
* MSDK_NO_GPIO_CLK_INIT has been defined.
* @return See \ref MXC_Error_Codes for the list of error codes.
*/
int MXC_WDT_Init(mxc_wdt_regs_t *wdt);

Expand Down
4 changes: 4 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32655/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ typedef mxc_dma_srcdst_t (*mxc_dma_trans_chain_t)(mxc_dma_srcdst_t dest);
/**
* @brief Initialize DMA resources
* @details This initialization is required before using the DMA driver functions.
* @note On default this function enables DMA peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
* @return #E_NO_ERROR if successful
*/
int MXC_DMA_Init(void);
Expand Down
4 changes: 4 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32655/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ typedef int (*mxc_i2c_slave_handler_t)(mxc_i2c_regs_t *i2c, mxc_i2c_slave_event_
* @brief Initialize and enable I2C peripheral.
* @note This function sets the I2C Speed to 100kHz, if another speed is
* desired use the MXC_I2C_SetFrequency() function to set it.
* @note On default this function enables I2C peripheral clock and i2c gpio pins.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param i2c Pointer to I2C registers (selects the I2C block used.)
* @param masterMode Whether to put the device in master or slave mode. Use
Expand Down
8 changes: 7 additions & 1 deletion Libraries/PeriphDrivers/Include/MAX32655/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ struct _mxc_spi_req_t {
* SPI Width - SPI_WIDTH_STANDARD (even if quadModeUsed is set)
*
* These parameters can be modified after initialization using low level functions
*
* @note On default this function enables SPI peripheral clock and spi gpio pins.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param spi Pointer to SPI registers (selects the SPI block used.)
* @param masterMode Whether to put the device in master or slave mode. Use
Expand All @@ -191,7 +196,8 @@ struct _mxc_spi_req_t {
* will be returned by the function if successful. Used in
* master mode only.
* @param pins SPI pin structure. Pins selected as true will be initialized
* for the requested SPI block.
* for the requested SPI block. Has no effect incase of
* MSDK_NO_GPIO_CLK_INIT has been defined.
*
* @return If successful, the actual clock frequency is returned. Otherwise, see
* \ref MXC_Error_Codes for a list of return codes.
Expand Down
7 changes: 6 additions & 1 deletion Libraries/PeriphDrivers/Include/MAX32655/tmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,15 @@ typedef void (*mxc_tmr_complete_t)(int error);

/**
* @brief Initialize timer module clock.
* @note On default this function enables TMR peripheral clock and related GPIOs.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param tmr Pointer to timer module to initialize.
* @param cfg System configuration object
* @param init_pins True will initialize pins corresponding to the TMR and False will not if pins are pinned out otherwise it will not
* be used
* be used, has no effect incase of MSDK_NO_GPIO_CLK_INIT has been defined.
*
* @return Success/Fail, see \ref MXC_Error_Codes for a list of return codes.
*/
Expand Down
5 changes: 5 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32655/uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ struct _mxc_uart_req_t {
*
* These parameters can be modified after initialization using low level functions
*
* @note On default this function enables UART peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param uart Pointer to UART registers (selects the UART block used.)
* @param baud The requested clock frequency. The actual clock frequency
* will be returned by the function if successful.
Expand Down
5 changes: 5 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32655/wdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ typedef struct {

/**
* @brief Initialize the Watchdog Timer
* @note On default this function enables WDT peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param wdt Pointer to the watchdog registers
* @param cfg watchdog configuration
* @return See \ref MXC_Error_Codes for the list of error codes.
Expand Down
4 changes: 4 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32660/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ typedef mxc_dma_srcdst_t (*mxc_dma_trans_chain_t)(mxc_dma_srcdst_t dest);
/**
* @brief Initialize DMA resources
* @details This initialization is required before using the DMA driver functions.
* @note On default this function enables DMA peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
* @return #E_NO_ERROR if successful
*/
int MXC_DMA_Init(void);
Expand Down
5 changes: 5 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32660/tmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ typedef void (*mxc_tmr_complete_t)(int error);

/**
* @brief Initialize timer module clock.
* @note On default this function enables TMR peripheral clock and related GPIOs.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param tmr Pointer to timer module to initialize.
* @param cfg System configuration object
*
Expand Down
4 changes: 4 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32662/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ typedef mxc_dma_srcdst_t (*mxc_dma_trans_chain_t)(mxc_dma_srcdst_t dest);
/**
* @brief Initialize DMA resources
* @details This initialization is required before using the DMA driver functions.
* @note On default this function enables DMA peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
* @return #E_NO_ERROR if successful
*/
int MXC_DMA_Init(void);
Expand Down
10 changes: 8 additions & 2 deletions Libraries/PeriphDrivers/Include/MAX32662/tmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,17 @@ typedef void (*mxc_tmr_complete_t)(int error);

/**
* @brief Initialize timer module clock.
* @note On default this function enables TMR peripheral clock and related GPIOs.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param tmr Pointer to timer module to initialize.
* @param cfg System configuration object
* @param init_pins True will initialize pins corresponding to the TMR and False will not if pins are pinned out otherwise it will not
* be used
* @param pin_sel Selects which set of pins to initialize (if init_pins set to true) for the given timer instance
* be used, has no effect incase of MSDK_NO_GPIO_CLK_INIT has been defined.
* @param pin_sel Selects which set of pins to initialize (if init_pins set to true) for the given timer instance,
* has no effect incase of MSDK_NO_GPIO_CLK_INIT has been defined.
*
* @return Success/Fail, see \ref MXC_Error_Codes for a list of return codes.
*/
Expand Down
5 changes: 5 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32662/wdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ typedef struct {

/**
* @brief Initialize the Watchdog Timer
* @note On default this function enables WDT peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param wdt Pointer to the watchdog registers
* @param cfg watchdog configuration
* @return See \ref MXC_Error_Codes for the list of error codes.
Expand Down
4 changes: 4 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32665/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ typedef mxc_dma_srcdst_t (*mxc_dma_trans_chain_t)(mxc_dma_srcdst_t dest);
* @brief Initialize DMA resources
* @param dma Pointer to DMA registers.
* @details This initialization is required before using the DMA driver functions.
* @note On default this function enables DMA peripheral clock.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
* @return #E_NO_ERROR if successful
*/
int MXC_DMA_Init(mxc_dma_regs_t *dma);
Expand Down
4 changes: 4 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32665/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ typedef int (*mxc_i2c_slave_handler_t)(mxc_i2c_regs_t *i2c, mxc_i2c_slave_event_
* @brief Initialize and enable I2C peripheral.
* @note This function sets the I2C Speed to 100kHz, if another speed is
* desired use the MXC_I2C_SetFrequency() function to set it.
* @note On default this function enables I2C peripheral clock and i2c gpio pins.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file
*
* @param i2c Pointer to I2C registers (selects the I2C block used.)
* @param masterMode Whether to put the device in master or slave mode. Use
Expand Down
8 changes: 7 additions & 1 deletion Libraries/PeriphDrivers/Include/MAX32665/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ struct _mxc_spi_req_t {
* SPI Width - SPI_WIDTH_STANDARD (even if quadModeUsed is set)
*
* These parameters can be modified after initialization using low level functions
*
* @note On default this function enables SPI peripheral clock and spi gpio pins.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param spi Pointer to SPI registers (selects the SPI block used.)
* @param masterMode Whether to put the device in master or slave mode. Use
Expand All @@ -169,7 +174,8 @@ struct _mxc_spi_req_t {
* @param hz The requested clock frequency. The actual clock frequency
* will be returned by the function if successful. Used in
* master mode only.
* @param map Mapping (MAP_A or MAP_B) to use for SPIO
* @param map Mapping (MAP_A or MAP_B) to use for SPIO, Has no effect
* incase of MSDK_NO_GPIO_CLK_INIT has been defined.
*
* @return If successful, the actual clock frequency is returned. Otherwise, see
* \ref MXC_Error_Codes for a list of return codes.
Expand Down
5 changes: 5 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32665/tmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ typedef void (*mxc_tmr_complete_t)(int error);

/**
* @brief Initialize timer module clock.
* @note On default this function enables TMR peripheral clock and related GPIOs.
* if you wish to manage clock and gpio related things in upper level instead of here.
* Define MSDK_NO_GPIO_CLK_INIT flag in project.mk file.
* By this flag this function will remove clock and gpio related codes from file.
*
* @param tmr Pointer to timer module to initialize.
* @param cfg configuration object
*/
Expand Down
Loading

0 comments on commit 33fddc4

Please sign in to comment.