|
STM32G0 MCAL 0.0.1
Tiny MCAL for educational purpose.
|
Complex Device Driver (CDD) for the NVIC. More...
#include "Nvic_Cfg.h"Go to the source code of this file.
Functions | |
| void | CDD_Nvic_SetPriority (Nvic_IrqType irq, uint32 priority) |
| Sets the priority for a specific peripheral interrupt in the NVIC. | |
| uint32 | CDD_Nvic_GetPriority (Nvic_IrqType irq) |
| Return the priority of a specific peripheral interrupt from the NVIC. | |
| void | CDD_Nvic_EnableIrq (Nvic_IrqType irq) |
| Enables a specific peripheral interrupt in the NVIC. | |
| void | CDD_Nvic_DisableIrq (Nvic_IrqType irq) |
| Disables a specific peripheral interrupt in the NVIC. | |
| uint32 | CDD_Nvic_GetPendingIrq (Nvic_IrqType irq) |
| Return the pending status of a specific peripheral interrupt in the NVIC. | |
| void | CDD_Nvic_SetPendingIrq (Nvic_IrqType irq) |
| Sets a specific peripheral interrupt as pending in the NVIC. | |
| void | CDD_Nvic_ClearPendingIrq (Nvic_IrqType irq) |
| Clears the pending status of a specific peripheral interrupt in the NVIC. | |
Complex Device Driver (CDD) for the NVIC.
This file provides the interface for controlling the NVIC functionality. It controls the activation of interrupts in ARM microcontrollers via the NVIC peripheral
| void CDD_Nvic_ClearPendingIrq | ( | Nvic_IrqType | Irq | ) |
Clears the pending status of a specific peripheral interrupt in the NVIC.
The function checks if the interrupt number belongs to the microcontroller's peripherals. If the number is valid, it uses the Bfx_PutBit_u32u8u8 function to clear the pending status of that interrupt in the NVIC's ICPR register.
| Irq | Interrupt number whose pending status is to be cleared. |
< Minimum IQR value
< Maximum IRQ value
< Starting index for NVIC register
< Mask to obtain bits from an IRQ value
| void CDD_Nvic_DisableIrq | ( | Nvic_IrqType | Irq | ) |
Disables a specific peripheral interrupt in the NVIC.
The function checks if the interrupt number belongs to the microcontroller's peripherals. If the number is valid, it uses the Bfx_PutBit_u32u8u8 function to disable the interrupt in the NVIC's ICER register.
| Irq | Interrupt number to be disabled. |
< Minimum IQR value
< Maximum IRQ value
< Starting index for NVIC register
< Mask to obtain bits from an IRQ value
| void CDD_Nvic_EnableIrq | ( | Nvic_IrqType | Irq | ) |
Enables a specific peripheral interrupt in the NVIC.
The function checks if the interrupt number belongs to the microcontroller's peripherals. If the number is valid, it uses the Bfx_SetBit_u32u8 function to enable the interrupt in the NVIC's ISER register.
| Irq | Interrupt number to be enabled. |
< Minimum IQR value
< Maximum IRQ value
< Starting index for NVIC register
< Mask to obtain bits from an IRQ value
| uint32 CDD_Nvic_GetPendingIrq | ( | Nvic_IrqType | Irq | ) |
Return the pending status of a specific peripheral interrupt in the NVIC.
The function checks if the interrupt number belongs to the microcontroller's peripherals. If the number is valid, it uses the Bfx_GetBit_u32u8_u8 function to determine if the interrupt is pending in the NVIC's ISPR register.
| Irq | Interrupt number whose pending status is to be checked. |
< Value to specifie IRQ is not pending
< Minimum IQR value
< Maximum IRQ value
< Starting index for NVIC register
< Mask to obtain bits from an IRQ value
| uint32 CDD_Nvic_GetPriority | ( | Nvic_IrqType | Irq | ) |
Return the priority of a specific peripheral interrupt from the NVIC.
The function checks if the interrupt number belongs to the microcontroller's peripherals. If the number is valid, it uses the Bfx_GetBits_u32u8u8_u32 function to extract the priority from the NVIC's IP register. Otherwise, it returns an INVALID_PRIORITY value.
| Irq | Interrupt number whose priority is to be retrieved. |
| Priority | value of the interrupt. Returns INVALID_PRIORITY if the interrupt number is not a valid peripheral interrupt. |
< Invalid priority indicator
< Minimum IQR value
< Maximum IRQ value
< Calculate the index for IRQ priority register
< Calculate the bit shift for IRQ priority
| void CDD_Nvic_SetPendingIrq | ( | Nvic_IrqType | Irq | ) |
Sets a specific peripheral interrupt as pending in the NVIC.
The function checks if the interrupt number belongs to the microcontroller's peripherals. If the number is valid, it utilizes the Bfx_SetBit_u32u8 function to set the interrupt as pending in the NVIC's ISPR register.
| Irq | Interrupt number to set as pending. |
< Minimum IQR value
< Maximum IRQ value
< Starting index for NVIC register
< Mask to obtain bits from an IRQ value
| void CDD_Nvic_SetPriority | ( | Nvic_IrqType | Irq, |
| uint32 | Priority ) |
Sets the priority for a specific peripheral interrupt in the NVIC.
The function checks if the interrupt number belongs to the microcontroller's peripherals. If valid, it utilizes the Bfx_PutBitsMask_u32u32u32 function to update the NVIC's IP register with the desired priority.
| Irq | Interrupt number to set. |
| Priority | Priority value to assign to the interrupt. |
< Minimum IQR value
< Maximum IRQ value
< Maximum priority value
< Calculate the index for IRQ priority register
< Calculate the bit shift for IRQ priority
< Calculate the index for IRQ priority register
< Calculate the bit shift for IRQ priority