This section describes the programming interface of the MMAU HAL driver.
struct mmau_user_config_t |
Data Fields |
uint32_t | mmauIntReqMask |
| Enable interrupt request sources: INT_MMAU_QIE|INT_MMAU_VIE|INT_MMAU_DZIE.
|
|
bool | mmauDmaReq |
| Enable (true) or disable (false) DMA request when MMAU is in IDLE (not busy) state.
|
|
bool | mmauAccess |
| MMAU registers can only be accessed in Supervisor Mode (true) or in both User Mode or Supervisor Mode (false).
|
|
uint32_t mmau_reg_state_t::x0 |
uint32_t mmau_reg_state_t::x1 |
uint32_t mmau_reg_state_t::x2 |
uint32_t mmau_reg_state_t::x3 |
uint32_t mmau_reg_state_t::a0 |
uint32_t mmau_reg_state_t::a1 |
uint32_t mmau_reg_state_t::csr |
This function stores the MMAU operand and control registers to the software stack. Call this function at the interrupt service routine entry.
- Parameters
-
base | Peripheral MMAU base pointer. |
This function restores the MMAU operand and control registers from the software stack. Call this function at exit the interrupt service routine.
- Parameters
-
base | Peripheral MMAU base pointer. |
Enumerator |
---|
kStatus_MMAU_Success |
Success.
|
kStatus_MMAU_InvalidArgument |
Invalid argument existed.
|
kStatus_MMAU_Failed |
Execution failed.
|
void MMAU_HAL_Init |
( |
MMAU_Type * |
base | ) |
|
This function resets the control/status register to a known state. This state is defined in a Reference Manual, which is power on reset value. This function must execute in a Supervisor Mode.
- Parameters
-
base | Peripheral MMAU base pointer. |
This function configures the MMAU.
- Parameters
-
base | Peripheral MMAU base pointer. |
configStructPtr | MMAU configuration structure. |
static void MMAU_HAL_SetIntCmd |
( |
MMAU_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
This function sets the interrupt request sources.
- Parameters
-
base | Peripheral MMAU base pointer. |
mask | Mask of the MMAU interrupts to be enabled (INT_MMAU_QIE|INT_MMAU_VIE|INT_MMAU_DZIE). |
static uint32_t MMAU_HAL_GetInstrFlagsCmd |
( |
MMAU_Type * |
base | ) |
|
|
inlinestatic |
This function gets the instruction result flags. Instruction result flags are updated by the MMAU after the computation of each instruction.
- Parameters
-
base | Peripheral MMAU base pointer. |
- Returns
- Mask of the instruction result flags (INS_MMAU_Q|INS_MMAU_V|INS_MMAU_DZ|INS_MMAU_N).
static void MMAU_HAL_WriteInstrFlagsCmd |
( |
MMAU_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
This function writes the instruction result flags.
- Parameters
-
base | Peripheral MMAU base pointer. |
mask | Mask of the instruction result flags to be written (INS_MMAU_Q|INS_MMAU_V|INS_MMAU_DZ|INS_MMAU_N). |
static uint32_t MMAU_HAL_GetStateCmd |
( |
MMAU_Type * |
base | ) |
|
|
inlinestatic |
This function gets the state of the MMAU. It returns control/status register value.
- Parameters
-
base | Peripheral MMAU base pointer. |
- Returns
- Control/status register value.
static uint32_t MMAU_HAL_GetIntStatusFlagsCmd |
( |
MMAU_Type * |
base | ) |
|
|
inlinestatic |
This function gets the interrupt flags.
- Parameters
-
base | Peripheral MMAU base pointer. |
- Returns
- Mask of the asserted interrupt flags (INT_MMAU_QIF|INT_MMAU_VIF|INT_MMAU_DZIF).
static void MMAU_HAL_ConfigStateCmd |
( |
MMAU_Type * |
base, |
|
|
uint32_t |
state |
|
) |
| |
|
inlinestatic |
This function configures MMAU state. It writes state into the control interrupt flag clear register.
- Parameters
-
state | Value of a state of the MMAU. |
base | Peripheral MMAU base pointer. |
static void MMAU_HAL_ClearIntStatusFlagsCmd |
( |
MMAU_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
This function clears the interrupt flags.
- Parameters
-
base | Peripheral MMAU base pointer. |
mask | Mask of the MMAU interrupts to be cleared (INT_MMAU_QIF|INT_MMAU_VIF|INT_MMAU_DZIF). |
- Note
- This function preserves instruction result flags.
static void MMAU_HAL_SetDmaCmd |
( |
MMAU_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
This function asserts the DMA request when in IDLE (not busy) state. After it is enabled, the DMA request is asserted when the BUSY flag is cleared.
- Parameters
-
base | Peripheral MMAU base pointer. |
enable | Bool value for enabling (true) or disabling (false) DMA function. |
static void MMAU_HAL_SetSupervisorOnlyCmd |
( |
MMAU_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
This function sets access mode to the MMAU operand, control, and status registers.
- Parameters
-
base | Peripheral MMAU base pointer. |
enable | MMAU registers can only be accessed in Supervisor Mode (true) or in both User Mode or Supervisor Mode (false). |
static uint32_t MMAU_HAL_GetHwRevCmd |
( |
MMAU_Type * |
base | ) |
|
|
inlinestatic |
This function gets the hardware revision level of the MMAU. It returns HDR field of the control/status register.
- Parameters
-
base | Peripheral MMAU base pointer. |
- Returns
- uint32_t hardware revision level.
static void _store_mmau_state |
( |
MMAU_Type * |
base, |
|
|
volatile mmau_reg_state_t * |
p |
|
) |
| |
|
inlinestatic |
This function stores MMAU operand and the control registers to the parameter p.
- Parameters
-
base | Peripheral MMAU base pointer. |
p | Pointer to the structure to store the MMAU registers. |
- Note
- This is an internal used function, it is recommend to use the function MMAU_HAL_StoreRegStateCmd() instead.
static void _restore_mmau_reg_state |
( |
MMAU_Type * |
base, |
|
|
volatile mmau_reg_state_t * |
p |
|
) |
| |
|
inlinestatic |
This function restores the MMAU operand and control registers from the parameter p.
- Parameters
-
base | Peripheral MMAU base pointer. |
p | Pointer to the structure to restore the MMAU registers. |
- Note
- This is an internal used function, it is recommend to use the function MMAU_HAL_RestoreRegStateCmd() instead.