![]() |
RZ Flexible Software Package Documentation
Release v4.0.0
|
|
Driver for the CGC peripheral on RZ microprocessor. This module implements the CGC Interface.
The CGC module supports runtime modifications of clock settings. Key features include the following:
The RZ microprocessor have multiple internal clocks. Each clock domain has its own divider that can be updated in R_CGC_SystemClockSet().
The internal clocks include:
The RZ microprocessor have multiple internal clocks. Each clock domain has its own divider that can be updated in R_CGC_SystemClockSet().
The internal clocks include:
| Configuration | Options | Default | Description |
|---|---|---|---|
| Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
| Configuration | Options | Default | Description |
|---|---|---|---|
| Name | Name must be a valid C symbol | g_cgc0 | Module name. |
This module is used to configure the system clocks. There are no module specific clock configurations required to use it.
This is a basic example of minimal use of the CGC in an application for RZ/T2M and RZ/T2L.
This is a basic example of minimal use of the CGC in an application for RZ/T2H.
This example demonstrates configuring multiple clocks in a single function call using R_CGC_ClocksCfg() for RZ/T2M and RZ/T2L.
This example demonstrates configuring multiple clocks in a single function call using R_CGC_ClocksCfg() for RZ/T2H.
Classes | |
| struct | st_cgc_instance_ctrl |
Typedefs | |
| typedef struct st_cgc_instance_ctrl | cgc_instance_ctrl_t |
| struct RZT::st_cgc_instance_ctrl |
CGC private control block. DO NOT MODIFY. Initialization occurs when R_CGC_Open() is called.
| typedef struct st_cgc_instance_ctrl cgc_instance_ctrl_t |
CGC private control block. DO NOT MODIFY. Initialization occurs when R_CGC_Open() is called. Please refer to the struct st_cgc_instance_ctrl.
| fsp_err_t R_CGC_Open | ( | cgc_ctrl_t *const | p_ctrl, |
| cgc_cfg_t const *const | p_cfg | ||
| ) |
Initialize the CGC API. Implements cgc_api_t::open.
| FSP_SUCCESS | CGC successfully initialized. |
| FSP_ERR_ASSERTION | Invalid input argument. |
| FSP_ERR_ALREADY_OPEN | Module is already open. |
| fsp_err_t R_CGC_ClocksCfg | ( | cgc_ctrl_t *const | p_ctrl, |
| cgc_clocks_cfg_t const *const | p_clock_cfg | ||
| ) |
Reconfigures all main system clocks. This API can be used for any of the following purposes:
If the requested system clock source has a stabilization flag, this function blocks waiting for the stabilization flag of the requested system clock source to be set. If the requested system clock source was just started and it has no stabilization flag, this function blocks for the stabilization time required by the requested system clock source according to the Electrical Characteristics section of the hardware manual. If the requested system clock source has no stabilization flag and it is already running, it is assumed to be stable and this function will not block.
Do not attempt to stop the requested clock source or the source of the PLL if the PLL will be running after this operation completes.
Implements cgc_api_t::clocksCfg.
| FSP_SUCCESS | Clock configuration applied successfully. |
| FSP_ERR_ASSERTION | Invalid input argument. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| FSP_ERR_NOT_STABILIZED | Clock not stabilized. |
| FSP_ERR_INVALID_ARGUMENT | Clock configuration setting is invalid. |
| fsp_err_t R_CGC_ClockStart | ( | cgc_ctrl_t *const | p_ctrl, |
| cgc_clock_t | clock_source, | ||
| cgc_pll_cfg_t const *const | p_pll_cfg | ||
| ) |
Start the specified clock if it is not currently active. Implements cgc_api_t::clockStart.
| FSP_SUCCESS | Clock initialized successfully. |
| FSP_ERR_ASSERTION | Invalid input argument. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| fsp_err_t R_CGC_ClockStop | ( | cgc_ctrl_t *const | p_ctrl, |
| cgc_clock_t | clock_source | ||
| ) |
Stop the specified clock if it is active. Implements cgc_api_t::clockStop.
| FSP_SUCCESS | Clock stopped successfully. |
| FSP_ERR_ASSERTION | Invalid input argument. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| FSP_ERR_IN_USE | Attempt to stop the current system clock or the PLL source clock. |
| FSP_ERR_NOT_STABILIZED | Clock not stabilized after starting. |
| fsp_err_t R_CGC_ClockCheck | ( | cgc_ctrl_t *const | p_ctrl, |
| cgc_clock_t | clock_source | ||
| ) |
Check the specified clock for stability. Implements cgc_api_t::clockCheck.
| FSP_SUCCESS | Clock is running and stable. |
| FSP_ERR_ASSERTION | Invalid input argument. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| FSP_ERR_NOT_STABILIZED | Clock not stabilized. |
| FSP_ERR_CLOCK_INACTIVE | Clock not turned on. |
| fsp_err_t R_CGC_SystemClockSet | ( | cgc_ctrl_t *const | p_ctrl, |
| cgc_clock_t | clock_source, | ||
| cgc_divider_cfg_t const *const | p_divider_cfg | ||
| ) |
Set the specified clock as the system clock and configure the internal dividers. Implements cgc_api_t::systemClockSet.
This function also updates the SystemCoreClock CMSIS global variable.
| FSP_SUCCESS | Operation performed successfully. |
| FSP_ERR_ASSERTION | Invalid input argument. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| FSP_ERR_CLOCK_INACTIVE | The specified clock source is inactive. |
| FSP_ERR_NOT_STABILIZED | The clock source is not stabilized after being turned off or PLL clock source is not stable. |
| fsp_err_t R_CGC_SystemClockGet | ( | cgc_ctrl_t *const | p_ctrl, |
| cgc_clock_t *const | p_clock_source, | ||
| cgc_divider_cfg_t *const | p_divider_cfg | ||
| ) |
Return the current system clock source and configuration. Implements cgc_api_t::systemClockGet.
| FSP_SUCCESS | Parameters returned successfully. |
| FSP_ERR_ASSERTION | Invalid input argument. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| fsp_err_t R_CGC_OscStopDetectEnable | ( | cgc_ctrl_t *const | p_ctrl | ) |
Enable the oscillation stop detection for the main clock. API not supported.
Implements cgc_api_t::oscStopDetectEnable.
| FSP_ERR_UNSUPPORTED | API not supported. |
| fsp_err_t R_CGC_OscStopDetectDisable | ( | cgc_ctrl_t *const | p_ctrl | ) |
Disable the oscillation stop detection for the main clock. API not supported.
Implements cgc_api_t::oscStopDetectDisable.
| FSP_ERR_UNSUPPORTED | API not supported. |
| fsp_err_t R_CGC_OscStopStatusClear | ( | cgc_ctrl_t *const | p_ctrl | ) |
Clear the Oscillation Stop Detection Status register. API not supported.
Implements cgc_api_t::oscStopStatusClear.
| FSP_ERR_UNSUPPORTED | API not supported. |
| fsp_err_t R_CGC_CallbackSet | ( | cgc_ctrl_t *const | p_ctrl, |
| void(*)(cgc_callback_args_t *) | p_callback, | ||
| void *const | p_context, | ||
| cgc_callback_args_t *const | p_callback_memory | ||
| ) |
Updates the user callback and has option of providing memory for callback structure. Implements cgc_api_t::callbackSet
| FSP_ERR_UNSUPPORTED | API not supported. |
| fsp_err_t R_CGC_Close | ( | cgc_ctrl_t *const | p_ctrl | ) |
Closes the CGC module. Implements cgc_api_t::close.
| FSP_SUCCESS | The module is successfully closed. |
| FSP_ERR_ASSERTION | Invalid input argument. |
| FSP_ERR_NOT_OPEN | Module is not open. |