![]() |
RZT Flexible Software Package Documentation
Release v2.3.0
|
|
Functions | |
fsp_err_t | R_ICU_INTER_CPU_IRQ_Open (icu_inter_cpu_irq_ctrl_t *const p_ctrl, icu_inter_cpu_irq_cfg_t const *const p_cfg) |
fsp_err_t | R_ICU_INTER_CPU_IRQ_Generate (icu_inter_cpu_irq_ctrl_t *const p_ctrl) |
fsp_err_t | R_ICU_INTER_CPU_IRQ_CallbackSet (icu_inter_cpu_irq_ctrl_t *const p_ctrl, void(*p_callback)(icu_inter_cpu_irq_callback_args_t *), void const *const p_context, icu_inter_cpu_irq_callback_args_t *const p_callback_memory) |
fsp_err_t | R_ICU_INTER_CPU_IRQ_Close (icu_inter_cpu_irq_ctrl_t *const p_ctrl) |
Driver for the ICU peripheral on RZ microprocessor. This module implements the Inter CPU IRQ Interface.
The Inter-CPU IRQ on ICU driver implements an interface for inter-CPU interrupt.
It is possible to generate not only the interrupt inter-CPUs but also the software interrupt to its own CPU.
Configuration | Options | Default | Description |
---|---|---|---|
Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
Multiplex Interrupt |
| Disabled | Enable multiplex interrupt for a single driver. |
Configuration | Options | Default | Description |
---|---|---|---|
Name | Name must be a valid C symbol | g_icu_inter_cpu_irq0 | Module name. |
Channel | Value must be an integer greater than or equal to 0 | 0 | Specify the hardware channel. |
Software Interrupt Priority | MCU Specific Options | Select the Software interrupt priority. | |
Callback | Name must be a valid C symbol | NULL | A user callback function can be provided here. If this callback function is provided, it is called from the interrupt service routine (ISR) each time the IRQn triggers |
The ICU peripheral module doesn't require any specific clock settings.
This module does not use I/O pins.
Software interrupts can be generated to CPU0 itself using INTCPU.
stack | config | CPU0 |
---|---|---|
0 | Name | g_icu_inter_cpu_irq0 |
Channel | 0 | |
Software Interrupt Priority | 12 | |
Callback | cpu0_ic0_callback |
Image of single core software interrupt operation
Software interrupts can be generated between CPU0 and CPU1 using INTCPU.
If the parameter check is Enable and "Callback" is "NULL", the R_ICU_INTER_CPU_IRQ_Open() function returns FSP_ERR_ASSERTION, so set any callback function.
stack | config | CPU0 | CPU1 |
---|---|---|---|
0 | Name | g_icu_inter_cpu_irq0 | g_icu_inter_cpu_irq0 |
Channel | 1 | 1 | |
Software Interrupt Priority | Disabled | 12 | |
Callback | NULL | cpu1_ic1_callback | |
1 | Name | g_icu_inter_cpu_irq1 | g_icu_inter_cpu_irq1 |
Channel | 2 | 2 | |
Software Interrupt Priority | 12 | Disabled | |
Callback | cpu0_ic2_callback | NULL |
Image of dual core software interrupt operation
Software interrupts can be generated between CPU0 and CPU1 using same INTCPU.
Property setting example
stack | config | CPU0 | CPU1 |
---|---|---|---|
0 | Name | g_icu_inter_cpu_irq0 | g_icu_inter_cpu_irq0 |
Channel | 3 | 3 | |
Software Interrupt Priority | 12 | 12 | |
Callback | cpu0_ic3_callback | cpu1_ic3_callback |
Image of dual core software interrupt operation
This is a basic example of minimal use of the icu_inter_cpu_irq module in an application.
fsp_err_t R_ICU_INTER_CPU_IRQ_Open | ( | icu_inter_cpu_irq_ctrl_t *const | p_ctrl, |
icu_inter_cpu_irq_cfg_t const *const | p_cfg | ||
) |
Opens the icu_inter_cpu_irq driver. Implements icu_inter_cpu_irq_api_t::open().
FSP_SUCCESS | opened successfully. |
FSP_ERR_IP_CHANNEL_NOT_PRESENT | The channel requested in p_cfg is not available on the device selected in r_bsp_cfg.h. |
FSP_ERR_ALREADY_OPEN | Module is already open. |
FSP_ERR_ASSERTION | Parameter check failure due to one or more reasons below:
|
fsp_err_t R_ICU_INTER_CPU_IRQ_Generate | ( | icu_inter_cpu_irq_ctrl_t *const | p_ctrl | ) |
Generate software interrupt. Implements icu_inter_cpu_irq_api_t::generate().
FSP_SUCCESS | Function executed without issue. |
FSP_ERR_ASSERTION | p_ctrl or p_src is NULL. |
FSP_ERR_NOT_OPEN | Device is not open. |
fsp_err_t R_ICU_INTER_CPU_IRQ_CallbackSet | ( | icu_inter_cpu_irq_ctrl_t *const | p_ctrl, |
void(*)(icu_inter_cpu_irq_callback_args_t *) | p_callback, | ||
void const *const | p_context, | ||
icu_inter_cpu_irq_callback_args_t *const | p_callback_memory | ||
) |
Updates the user callback with the option to provide memory for the callback argument structure. Implements icu_inter_cpu_irq_api_t::callbackSet().
FSP_SUCCESS | Callback updated successfully. |
FSP_ERR_ASSERTION | A required pointer is NULL. |
FSP_ERR_NOT_OPEN | The control block has not been opened. |
fsp_err_t R_ICU_INTER_CPU_IRQ_Close | ( | icu_inter_cpu_irq_ctrl_t *const | p_ctrl | ) |
Closes the icu_inter_cpu_irq. Implements icu_inter_cpu_irq_api_t::close().
FSP_SUCCESS | Device closed successfully. |
FSP_ERR_NOT_OPEN | Device not opened. |
FSP_ERR_ASSERTION | p_ctrl is NULL. |