MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxClGlikey_Types

Types for use with the Glikey driver. More...

Typedefs

typedef uint32_t mcuxClGlikey_BaseAddress_t
typedef uint32_t mcuxClGlikey_Status_t
typedef uint32_t mcuxClGlikey_IntEnable_t
typedef uint32_t mcuxClGlikey_GlikeyStatus_t

Functions

mcuxClGlikey_Status_t mcuxClGlikey_GetStatus (mcuxClGlikey_BaseAddress_t *base, mcuxClGlikey_GlikeyStatus_t *result)
 Retrieves the current status of Glikey.
mcuxClGlikey_Status_t mcuxClGlikey_SyncReset (mcuxClGlikey_BaseAddress_t *base)
 Perform a synchronous reset of Glikey.
mcuxClGlikey_Status_t mcuxClGlikey_SetIntEnable (mcuxClGlikey_BaseAddress_t *base, mcuxClGlikey_IntEnable_t value)
 Set interrupt enable flag of Glikey.
mcuxClGlikey_Status_t mcuxClGlikey_GetIntEnable (mcuxClGlikey_BaseAddress_t *base, mcuxClGlikey_IntEnable_t *value)
 Get interrupt enable flag of Glikey.
mcuxClGlikey_Status_t mcuxClGlikey_ClearIntStatus (mcuxClGlikey_BaseAddress_t *base)
 Clear the interrupt status flag of Glikey.
mcuxClGlikey_Status_t mcuxClGlikey_SetIntStatus (mcuxClGlikey_BaseAddress_t *base)
 Set the interrupt status flag of Glikey.
mcuxClGlikey_Status_t mcuxClGlikey_Lock (mcuxClGlikey_BaseAddress_t *base)
 Lock Glikey SFR interface.
mcuxClGlikey_Status_t mcuxClGlikey_IsLocked (mcuxClGlikey_BaseAddress_t *base)
 Check if Glikey is locked.
mcuxClGlikey_Status_t mcuxClGlikey_IsIndexLocked (mcuxClGlikey_BaseAddress_t *base, uint32_t index)
 Check if Glikey index is locked.
mcuxClGlikey_Status_t mcuxClGlikey_StartEnable (mcuxClGlikey_BaseAddress_t *base, uint32_t index)
 Start Glikey enable.
mcuxClGlikey_Status_t mcuxClGlikey_ContinueEnable (mcuxClGlikey_BaseAddress_t *base, uint32_t codeword)
 Continue Glikey enable.
mcuxClGlikey_Status_t mcuxClGlikey_LockIndex (mcuxClGlikey_BaseAddress_t *base)
 Lock Glikey index.
mcuxClGlikey_Status_t mcuxClGlikey_ResetIndex (mcuxClGlikey_BaseAddress_t *base, uint32_t index)
 Reset Glikey index.
mcuxClGlikey_Status_t mcuxClGlikey_EndOperation (mcuxClGlikey_BaseAddress_t *base)
 End Glikey operation TODO: if we are in locked state we cannot exit(move to init) as curent index is locked.

Detailed Description

Types for use with the Glikey driver.

Function Documentation

◆ mcuxClGlikey_GetStatus()

mcuxClGlikey_Status_t mcuxClGlikey_GetStatus ( mcuxClGlikey_BaseAddress_t * base,
mcuxClGlikey_GlikeyStatus_t * result )

Retrieves the current status of Glikey.

Parameters
[in]baseThe base address of the Glikey instance
[out]resultPointer which will be filled with the Glikey status information
Returns
A code-flow protected error code (see Flow Protection API)
Return values
#MCUXCLGLIKEY_STATUS_OKThe operation was successful

◆ mcuxClGlikey_SyncReset()

mcuxClGlikey_Status_t mcuxClGlikey_SyncReset ( mcuxClGlikey_BaseAddress_t * base)

Perform a synchronous reset of Glikey.

This function performs a synchronous reset of the Glikey. This results in:

  • Glikey will return to the INIT state, unless it is in the GLOBAL_LOCK state [TODO: REVIEW NAMING]
Parameters
[in]baseThe base address of the Glikey instance
Returns
A code-flow protected error code (see Flow Protection API)
Return values
#MCUXCLGLIKEY_STATUS_OKThe operation was successful
#MCUXCLGLIKEY_STATUS_LOCKED_ERRORGlikey is locked and cannot be reset by software

◆ mcuxClGlikey_SetIntEnable()

mcuxClGlikey_Status_t mcuxClGlikey_SetIntEnable ( mcuxClGlikey_BaseAddress_t * base,
mcuxClGlikey_IntEnable_t value )

Set interrupt enable flag of Glikey.

Parameters
[in]baseThe base address of the Glikey instance
[in]valueValue to set the interrupt enable flag to, see #[TODO: add reference to constants]
Returns
A code-flow protected error code (see Flow Protection API)
Return values
#MCUXCLGLIKEY_STATUS_OKThe operation was successful
#MCUXCLGLIKEY_STATUS_LOCKED_ERRORGlikey is locked and cannot be configured by software

◆ mcuxClGlikey_GetIntEnable()

mcuxClGlikey_Status_t mcuxClGlikey_GetIntEnable ( mcuxClGlikey_BaseAddress_t * base,
mcuxClGlikey_IntEnable_t * value )

Get interrupt enable flag of Glikey.

Parameters
[in]baseThe base address of the Glikey instance
[out]valuePointer which will be filled with the interrupt enable status, see #[TODO: add reference to constants]
Returns
A code-flow protected error code (see Flow Protection API)
Return values
#MCUXCLGLIKEY_STATUS_OKThe operation was successful

◆ mcuxClGlikey_ClearIntStatus()

mcuxClGlikey_Status_t mcuxClGlikey_ClearIntStatus ( mcuxClGlikey_BaseAddress_t * base)

Clear the interrupt status flag of Glikey.

Returns
A code-flow protected error code (see Flow Protection API)
Return values
#MCUXCLGLIKEY_STATUS_OKThe operation was successful
#MCUXCLGLIKEY_STATUS_LOCKED_ERRORGlikey is locked and cannot be configured by software

◆ mcuxClGlikey_SetIntStatus()

mcuxClGlikey_Status_t mcuxClGlikey_SetIntStatus ( mcuxClGlikey_BaseAddress_t * base)

Set the interrupt status flag of Glikey.

Returns
A code-flow protected error code (see Flow Protection API)
Return values
#MCUXCLGLIKEY_STATUS_OKThe operation was successful
#MCUXCLGLIKEY_STATUS_LOCKED_ERRORGlikey is locked and cannot be configured by software

◆ mcuxClGlikey_Lock()

mcuxClGlikey_Status_t mcuxClGlikey_Lock ( mcuxClGlikey_BaseAddress_t * base)

Lock Glikey SFR interface.

This operation locks the Glikey SFR interface if it is not locked yet.

Returns
A code-flow protected error code (see Flow Protection API)
Return values
#MCUXCLGLIKEY_STATUS_OKThe operation was successful

◆ mcuxClGlikey_IsLocked()

mcuxClGlikey_Status_t mcuxClGlikey_IsLocked ( mcuxClGlikey_BaseAddress_t * base)

Check if Glikey is locked.

This operation returns the locking status of Glikey.

Returns
A code-flow protected error code (see Flow Protection API)
Return values
#MCUXCLGLIKEY_STATUS_NOT_LOCKEDGlikey is not locked
#MCUXCLGLIKEY_STATUS_LOCKEDGlikey is locked

◆ mcuxClGlikey_IsIndexLocked()

mcuxClGlikey_Status_t mcuxClGlikey_IsIndexLocked ( mcuxClGlikey_BaseAddress_t * base,
uint32_t index )

Check if Glikey index is locked.

This operation returns the locking status of Glikey index. Using a wrong index (which is out of the bounds) leads to undefined program behavior.

Returns
A code-flow protected error code (see Flow Protection API)
Return values
#MCUXCLGLIKEY_STATUS_NOT_LOCKEDThe Glikey index is not locked
#MCUXCLGLIKEY_STATUS_LOCKEDThe Glikey index is locked

◆ mcuxClGlikey_StartEnable()

mcuxClGlikey_Status_t mcuxClGlikey_StartEnable ( mcuxClGlikey_BaseAddress_t * base,
uint32_t index )

Start Glikey enable.

This operation is used to set a new index and start a the sequence to enable it. It needs to be started from the INIT state. If the new index is already locked Glikey will go to LOCKED state, otherwise it will go to STEP1 state. If this operation is used when Glikey is in any state other than INIT Glikey will go to WR_DIS state. It can only recover from this state through a reset (synchronous or asynchronous). If the Glikey SFR lock is active this operation will return an error. Using a wrong index (which is out of the bounds) leads to undefined program behavior.

Returns
A code-flow protected error code (see Flow Protection API)
Precondition
The FSM is in the INIT state.
Return values
#MCUXCLGLIKEY_STATUS_OKThe operation was successful
#MCUXCLGLIKEY_STATUS_LOCKEDThe Glikey index is locked
#MCUXCLGLIKEY_STATUS_LOCKED_ERRORGlikey is locked and cannot be configured by software

◆ mcuxClGlikey_ContinueEnable()

mcuxClGlikey_Status_t mcuxClGlikey_ContinueEnable ( mcuxClGlikey_BaseAddress_t * base,
uint32_t codeword )

Continue Glikey enable.

This operation is used to progress through the different states of the state machine, starting from STEP1 until the state WR_EN is reached. Each next state of the state machine can only be reached by providing the right codeword to this function. The transition from a state to itself is always possible. The possible transitions are:

  • Step n -> Step n+1
  • Step n -> Step n
  • Step n_max -> WR_EN
  • WR_EN -> WR_EN If anything goes wrong the state machine will go to WR_DIS state and can only recover from it through a reset (synchronous or asynchronous). If the Glikey SFR lock is active this operation will return an error.
Returns
A code-flow protected error code (see Flow Protection API)
Return values
#MCUXCLGLIKEY_STATUS_OKThe state transition was triggered successfully
#MCUXCLGLIKEY_STATUS_LOCKED_ERRORGlikey is locked and cannot be configured by software

◆ mcuxClGlikey_LockIndex()

mcuxClGlikey_Status_t mcuxClGlikey_LockIndex ( mcuxClGlikey_BaseAddress_t * base)

Lock Glikey index.

This operation is used to lock a Glikey index. It can only be executed from the WR_EN state, executing it from any other state will result in Glikey entering WR_DIS state. When this happens Glikey requires a reset (synchronous or asynchronous) to go back to INIT state. If the Glikey SFR lock is active this operation will return an error.

Precondition
The FSM is in the WR_EN state.
Returns
A code-flow protected error code (see Flow Protection API)
Return values
#MCUXCLGLIKEY_STATUS_LOCKEDThe Glikey index is now locked
#MCUXCLGLIKEY_STATUS_LOCKED_ERRORGlikey is locked and cannot be configured by software

◆ mcuxClGlikey_ResetIndex()

mcuxClGlikey_Status_t mcuxClGlikey_ResetIndex ( mcuxClGlikey_BaseAddress_t * base,
uint32_t index )

Reset Glikey index.

This operation is used to reset a Glikey index. It can only be executed from the INIT state, executing it from any other state will result in Glikey entering WR_DIS state. When this happens Glikey requires a reset (synchronous or asynchronous) to go back to INIT state. If the Glikey SFR lock is active or the index is locked this operation will return an error. Using a wrong index (which is out of the bounds) leads to undefined program behavior.

Returns
A code-flow protected error code (see Flow Protection API)
Return values
#MCUXCLGLIKEY_STATUS_OKThe operation was successful
#MCUXCLGLIKEY_STATUS_LOCKEDThe Glikey index is locked
#MCUXCLGLIKEY_STATUS_LOCKED_ERRORGlikey is locked and cannot be configured by software

◆ mcuxClGlikey_EndOperation()

mcuxClGlikey_Status_t mcuxClGlikey_EndOperation ( mcuxClGlikey_BaseAddress_t * base)

End Glikey operation TODO: if we are in locked state we cannot exit(move to init) as curent index is locked.

This operation is used to end a Glikey operation. It can only be executed from the WR_EN, LOCKED, RESET, and INIT states. Executing it from any other state will result in Glikey entering WR_DIS state. When this happens Glikey requires a reset (synchronous or asynchronous) to go back to INIT state. After this operation Glikey will go to INIT state or stay in LOCKED state when the index was locked. If the Glikey SFR lock is active this operation will return an error.

Returns
A code-flow protected error code (see Flow Protection API)
Precondition
The FSM is in the WR_EN, LOCKED, RESET, or INIT state.
Return values
#MCUXCLGLIKEY_STATUS_OKThe operation was successful
#MCUXCLGLIKEY_STATUS_LOCKEDThe Glikey index is still locked
#MCUXCLGLIKEY_STATUS_LOCKED_ERRORGlikey is locked and cannot be configured by software