Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
MMAU Hardware Abstraction Layer

Overview

This section describes the programming interface of the MMAU HAL driver.

Modules

 MMAU Instruction Result Flags
 
 MMAU Interrupt Flags
 
 MMAU Interrupt Sources
 

Files

file  fsl_mmau_hal.h
 

Data Structures

struct  mmau_user_config_t
 Defines the structure to configure the MMAU. More...
 
struct  mmau_reg_state_t
 Defines the structure to hold states of the MMAU registers. More...
 

Macros

#define MMAU_HAL_StoreRegStateCmd(base)   volatile mmau_reg_state_t tmp; _store_mmau_state(base, &tmp)
 Stores the MMAU operand and control registers to the software stack. More...
 
#define MMAU_HAL_RestoreRegStateCmd(base)   _restore_mmau_reg_state(base, &tmp)
 Restores the MMAU operand and control registers from the software stack. More...
 

Enumerations

enum  mmau_status_t {
  kStatus_MMAU_Success = 0U,
  kStatus_MMAU_InvalidArgument = 1U,
  kStatus_MMAU_Failed = 2U
}
 MMAU status return codes. More...
 

Functions

void MMAU_HAL_Init (MMAU_Type *base)
 Resets the control/status register into a reset state. More...
 
void MMAU_HAL_Config (MMAU_Type *base, const mmau_user_config_t *configStructPtr)
 Configures the MMAU. More...
 
static void MMAU_HAL_SetIntCmd (MMAU_Type *base, uint32_t mask)
 Sets the interrupt request sources. More...
 
static uint32_t MMAU_HAL_GetInstrFlagsCmd (MMAU_Type *base)
 Gets the instruction result flags. More...
 
static void MMAU_HAL_WriteInstrFlagsCmd (MMAU_Type *base, uint32_t mask)
 Writes the instruction result flags. More...
 
static uint32_t MMAU_HAL_GetStateCmd (MMAU_Type *base)
 Gets MMAU state. More...
 
static uint32_t MMAU_HAL_GetIntStatusFlagsCmd (MMAU_Type *base)
 Gets interrupt flags. More...
 
static void MMAU_HAL_ConfigStateCmd (MMAU_Type *base, uint32_t state)
 Configures MMAU state. More...
 
static void MMAU_HAL_ClearIntStatusFlagsCmd (MMAU_Type *base, uint32_t mask)
 Clears the interrupt flags. More...
 
static void MMAU_HAL_SetDmaCmd (MMAU_Type *base, bool enable)
 Asserts the DMA request when in IDLE (not busy) state. More...
 
static void MMAU_HAL_SetSupervisorOnlyCmd (MMAU_Type *base, bool enable)
 Sets access mode to the MMAU operand accumulator and control/status registers. More...
 
static uint32_t MMAU_HAL_GetHwRevCmd (MMAU_Type *base)
 Gets the hardware revision level. More...
 
static void _store_mmau_state (MMAU_Type *base, volatile mmau_reg_state_t *p)
 Stores the MMAU operand and the control registers. More...
 
static void _restore_mmau_reg_state (MMAU_Type *base, volatile mmau_reg_state_t *p)
 Restores the MMAU operand and control registers. More...
 

Data Structure Documentation

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).
 
struct mmau_reg_state_t

Data Fields

uint32_t x0
 X0 Operand Register. More...
 
uint32_t x1
 X1 Operand Register. More...
 
uint32_t x2
 X2 Operand Register. More...
 
uint32_t x3
 X3 Operand Register. More...
 
uint32_t a0
 A0 Accumulator Register. More...
 
uint32_t a1
 A1 Accumulator Register. More...
 
uint32_t csr
 CSR Control/Status Register. More...
 

Field Documentation

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

Macro Definition Documentation

#define MMAU_HAL_StoreRegStateCmd (   base)    volatile mmau_reg_state_t tmp; _store_mmau_state(base, &tmp)

This function stores the MMAU operand and control registers to the software stack. Call this function at the interrupt service routine entry.

Parameters
basePeripheral MMAU base pointer.
#define MMAU_HAL_RestoreRegStateCmd (   base)    _restore_mmau_reg_state(base, &tmp)

This function restores the MMAU operand and control registers from the software stack. Call this function at exit the interrupt service routine.

Parameters
basePeripheral MMAU base pointer.

Enumeration Type Documentation

Enumerator
kStatus_MMAU_Success 

Success.

kStatus_MMAU_InvalidArgument 

Invalid argument existed.

kStatus_MMAU_Failed 

Execution failed.

Function Documentation

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
basePeripheral MMAU base pointer.
void MMAU_HAL_Config ( MMAU_Type *  base,
const mmau_user_config_t configStructPtr 
)

This function configures the MMAU.

Parameters
basePeripheral MMAU base pointer.
configStructPtrMMAU configuration structure.
static void MMAU_HAL_SetIntCmd ( MMAU_Type *  base,
uint32_t  mask 
)
inlinestatic

This function sets the interrupt request sources.

Parameters
basePeripheral MMAU base pointer.
maskMask 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
basePeripheral 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
basePeripheral MMAU base pointer.
maskMask 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
basePeripheral 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
basePeripheral 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
stateValue of a state of the MMAU.
basePeripheral MMAU base pointer.
static void MMAU_HAL_ClearIntStatusFlagsCmd ( MMAU_Type *  base,
uint32_t  mask 
)
inlinestatic

This function clears the interrupt flags.

Parameters
basePeripheral MMAU base pointer.
maskMask 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
basePeripheral MMAU base pointer.
enableBool 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
basePeripheral MMAU base pointer.
enableMMAU 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
basePeripheral 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
basePeripheral MMAU base pointer.
pPointer 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
basePeripheral MMAU base pointer.
pPointer 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.