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

Overview

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

Data Structures

struct  ltc_hal_pkha_mode_params_t
 LTC PKHA parameters. More...
 

Typedefs

typedef uint32_t ltc_hal_mode_t
 Full word representing the actual bit values for the LTC mode register. More...
 

Enumerations

enum  ltc_status_err_shift_t { kStatus_LTC_ErrShift = 4 }
 
enum  ltc_status_t { ,
  kStatus_LTC_Error = 0x00000005U,
  kStatus_LTC_ModeError = 0x00000015U,
  kStatus_LTC_DataSizeError = 0x00000025U,
  kStatus_LTC_KeySizeError = 0x00000035U,
  kStatus_LTC_PKHA_RegASzError = 0x00000045U,
  kStatus_LTC_PKHA_RegBSzError = 0x00000055U,
  kStatus_LTC_DataOutOfSeqError = 0x00000065U,
  kStatus_LTC_PKHA_DivByZeroError = 0x00000075U,
  kStatus_LTC_PKHA_ModulusEvenError = 0x00000085U,
  kStatus_LTC_DES_KeyParityError = 0x00000095U,
  kStatus_LTC_ICV_CheckFailed = 0x000000A5U,
  kStatus_LTC_InternalHwFailure = 0x000000B5U,
  kStatus_LTC_CCM_AadSzError = 0x000000C5U,
  kStatus_LTC_CCM_InvalidCryptoSel = 0x000000F5U,
  kStatus_LTC_OSAError = 0x00000006U
}
 Error codes for LTC HAL and PD. More...
 
enum  ltc_hal_algorithm_t
 LTC algorithm mode. More...
 
enum  ltc_hal_pkha_reg_area_t
 Register areas for PKHA clear memory operations. More...
 
enum  ltc_hal_pkha_clr_quad_area_t
 Quadrant areas for 2048-bit registers for PKHA clear memory operations. More...
 
enum  ltc_hal_pkha_quad_area_t
 Quadrant areas for 2048-bit registers for PKHA copy memory operations. More...
 
enum  ltc_hal_pkha_montgomery_form_t
 Montgomery or normal PKHA input format. More...
 
enum  ltc_hal_pkha_f2m_t {
  kLTC_PKHA_Integer_Arith = 0U,
  kLTC_PKHA_F2M_Arith = 1U
}
 Integer vs binary polynomial arithmetic selection. More...
 
enum  ltc_hal_pkha_r2_t {
  kLTC_PKHA_R2_Calc = 0U,
  kLTC_PKHA_R2_Input = 1U
}
 User-supplied (R^2 mod N) input or LTC should calculate. More...
 
enum  ltc_hal_pkha_timing_t
 Use of timing equalized version of a PKHA function. More...
 
enum  ltc_hal_pkha_output_reg_t
 Select PKHA output destination register. More...
 
enum  ltc_hal_pkha_func_t { ,
  kLTC_PKHA_Arith_ModAdd = 2U,
  kLTC_PKHA_Arith_ModSub1 = 3U,
  kLTC_PKHA_Arith_ModSub2 = 4U,
  kLTC_PKHA_Arith_ModMul = 5U,
  kLTC_PKHA_Arith_ModExp = 6U,
  kLTC_PKHA_Arith_ModRed = 7U,
  kLTC_PKHA_Arith_ModInv = 8U,
  kLTC_PKHA_Arith_ECCAdd = 9U,
  kLTC_PKHA_Arith_ECCDouble = 10U,
  kLTC_PKHA_Arith_ECCMul = 11U,
  kLTC_PKHA_Arith_ModR2 = 12U,
  kLTC_PKHA_Arith_GCD = 14U,
  kLTC_PKHA_Arith_PrimalityTest = 15U
}
 PKHA functions - arithmetic, copy/clear memory. More...
 
enum  ltc_hal_mode_encrypt_t
 LTC encrypt/decrypt mode for symmetric key operations. More...
 
enum  ltc_hal_mode_icv_check_t
 LTC ICV check enable/disable. More...
 
enum  ltc_hal_mode_algorithm_state_t
 LTC algorithm state. More...
 
enum  ltc_hal_mode_symmetric_alg_t
 LTC symmetric key encryption/decryption operating mode. More...
 
enum  ltc_hal_mode_decrypt_key_t
 LTC ModeR Register AAI field DK bit.
 
enum  ltc_hal_cmd_t {
  kLTCCmd_ResetAll = 1U << LTC_COM_ALL_SHIFT,
  kLTCCmd_ResetAES = 1U << LTC_COM_AES_SHIFT,
  kLTCCmd_ResetDES = 1U << LTC_COM_DES_SHIFT,
  kLTCCmd_ResetPKHA = 1U << LTC_COM_PK_SHIFT
}
 LTC reset command. More...
 
enum  ltc_hal_key_lock_t {
  kLTCCtrl_KeyRegisterReadable = 0U,
  kLTCCtrl_KeyRegisterNotReadable = 1U
}
 LTC key register read access. More...
 
enum  ltc_hal_byte_swap_t {
  kLTCCtrl_ByteNoSwap = 0U,
  kLTCCtrl_ByteSwap = 1U
}
 LTC byte swap. More...
 
enum  ltc_hal_fifo_dma_size_t {
  kLTCCtrl_DMASize_1byte = 0U,
  kLTCCtrl_DMASize_4byte = 1U
}
 LTC FIFO DMA request size. More...
 
enum  ltc_hal_dma_enable_t {
  kLTCCtrl_DMA_Disabled = 0U,
  kLTCCtrl_DMA_Enabled = 1U
}
 LTC DMA module enable. More...
 
enum  ltc_hal_isr_mask_t {
  kLTCCtrl_ISR_Not_Masked = 0U,
  kLTCCtrl_ISR_Masked = 1U
}
 LTC Interrupt mask. More...
 
enum  ltc_hal_clear_written_t
 LTC clear register.
 
enum  ltc_hal_status_flag_t
 LTC status flags.
 
enum  ltc_hal_error_status_flag_t
 LTC error status flags.
 
enum  ltc_hal_fifo_status_t {
  kLTCFIFO_OutputFifoFull = 0x80000000U,
  kLTCFIFO_OutputFifoLevel = 0x007F0000U,
  kLTCFIFO_InputFifoFull = 0x00008000U,
  kLTCFIFO_InputFifoLevel = 0x0000007FU
}
 LTC FIFO status. More...
 

Functions

static uint32_t LTC_HAL_GetWordFromUnaligned (const uint8_t *src)
 Reads an unaligned word. More...
 
static void LTC_HAL_SetUnalignedFromWord (uint32_t srcWord, uint8_t *dst)
 Converts a 32-bit word into a byte array. More...
 
void LTC_HAL_Init (LTC_Type *base)
 Initializes the LTC HAL. More...
 
static void LTC_HAL_ModeSetAlgorithm (ltc_hal_mode_t *outMode, ltc_hal_algorithm_t alg)
 Sets the LTC operating algorithm. More...
 
static void LTC_HAL_ModeSetEncrypt (ltc_hal_mode_t *outMode, ltc_hal_mode_encrypt_t encrypt)
 Sets the encrypt/decrypt mode. More...
 
static ltc_hal_mode_encrypt_t LTC_HAL_ModeGetEncrypt (ltc_hal_mode_t *outMode)
 Gets the encrypt/decrypt mode. More...
 
static void LTC_HAL_ModeSetICVTest (ltc_hal_mode_t *outMode, ltc_hal_mode_icv_check_t check)
 Sets the ICV test selection. More...
 
static void LTC_HAL_ModeSetAlgorithmState (ltc_hal_mode_t *outMode, ltc_hal_mode_algorithm_state_t as)
 Sets the algorithm state. More...
 
static
ltc_hal_mode_algorithm_state_t 
LTC_HAL_ModeGetAlgorithmState (ltc_hal_mode_t *outMode)
 Gets the algorithm state. More...
 
static void LTC_HAL_ModeSetSymmetricAlg (ltc_hal_mode_t *outMode, ltc_hal_mode_symmetric_alg_t alg)
 Sets the symmetric algorithm. More...
 
static void LTC_HAL_ModeSetDecryptKey (LTC_Type *base)
 Sets the mode DK bit. More...
 
static void LTC_HAL_PKHA_ModeSetFunc (ltc_hal_mode_t *outMode, ltc_hal_pkha_func_t func)
 Sets the PKHA function. More...
 
static void LTC_HAL_PKHA_ModeSetMontgomeryInput (ltc_hal_mode_t *outMode, ltc_hal_pkha_montgomery_form_t form)
 Sets PKHA montgomery inputs. More...
 
static void LTC_HAL_PKHA_ModeSetMontgomeryOutput (ltc_hal_mode_t *outMode, ltc_hal_pkha_montgomery_form_t form)
 Sets PKHA montgomery outputs. More...
 
static void LTC_HAL_PKHA_ModeSetF2M (ltc_hal_mode_t *outMode, ltc_hal_pkha_f2m_t form)
 Sets the PKHA arithmetic type (f2m or integer). More...
 
static void LTC_HAL_PKHA_ModeSetR2 (ltc_hal_mode_t *outMode, ltc_hal_pkha_r2_t form)
 Sets the PKHA use of R2 mod N. More...
 
static void LTC_HAL_PKHA_ModeSetTimingEqual (ltc_hal_mode_t *outMode, ltc_hal_pkha_timing_t form)
 Sets the PKHA timing equalization. More...
 
static void LTC_HAL_PKHA_ModeSetOutput (ltc_hal_mode_t *outMode, ltc_hal_pkha_output_reg_t form)
 Sets the PKHA output selection. More...
 
static void LTC_HAL_PKHA_ModeSetRamArea (ltc_hal_mode_t *outMode, ltc_hal_pkha_reg_area_t area)
 Sets the PKHA RAM area selection. More...
 
static void LTC_HAL_PKHA_ModeSetQuadArea (ltc_hal_mode_t *outMode, ltc_hal_pkha_clr_quad_area_t quad)
 Sets the PKHA Quad area selection. More...
 
static void LTC_HAL_WriteMode (LTC_Type *base, ltc_hal_mode_t mode)
 LTC write mode register. More...
 
static ltc_hal_mode_t LTC_HAL_ReadMode (LTC_Type *base)
 LTC read mode register. More...
 
static uint8_t LTC_HAL_GetKeySize (LTC_Type *base)
 Gets the LTC key size. More...
 
ltc_status_t LTC_HAL_SetKeySize (LTC_Type *base, uint8_t keySize)
 Sets the LTC key size. More...
 
static uint16_t LTC_HAL_GetDataSize (LTC_Type *base)
 Gets the LTC data size. More...
 
ltc_status_t LTC_HAL_SetDataSize (LTC_Type *base, uint16_t dataSize)
 Sets the LTC data size. More...
 
static uint8_t LTC_HAL_GetICVSize (LTC_Type *base)
 Gets the LTC ICV size. More...
 
ltc_status_t LTC_HAL_SetICVSize (LTC_Type *base, uint8_t dataSize)
 Sets the LTC ICV size. More...
 
static void LTC_HAL_Command (LTC_Type *base, ltc_hal_cmd_t cmd)
 Issues LTC commands. More...
 
static void LTC_HAL_SetInterruptMask (LTC_Type *base, ltc_hal_isr_mask_t mask)
 Sets LTC Interrupt Masked. More...
 
static void LTC_HAL_SetPKHAEnableDMA (LTC_Type *base, ltc_hal_dma_enable_t enable)
 Sets LTC DMA enable for PKHA. More...
 
static void LTC_HAL_SetInputFIFOEnableDMA (LTC_Type *base, ltc_hal_dma_enable_t enable)
 Sets LTC DMA enable for input FIFO. More...
 
static void LTC_HAL_SetInputFIFORequestSizeDMA (LTC_Type *base, ltc_hal_fifo_dma_size_t size)
 Sets the LTC DMA input FIFO request size. More...
 
static void LTC_HAL_SetOutputFIFOEnableDMA (LTC_Type *base, ltc_hal_dma_enable_t enable)
 Sets the LTC DMA enable for output FIFO. More...
 
static void LTC_HAL_SetOutputFIFORequestSizeDMA (LTC_Type *base, ltc_hal_fifo_dma_size_t size)
 Sets the LTC DMA output FIFO request size. More...
 
static void LTC_HAL_SetInputFIFOByteSwap (LTC_Type *base, ltc_hal_byte_swap_t swap)
 Sets the LTC input FIFO byte swap. More...
 
static void LTC_HAL_SetOutputFIFOByteSwap (LTC_Type *base, ltc_hal_byte_swap_t swap)
 Sets the LTC output FIFO byte swap. More...
 
static void LTC_HAL_SetKeyRegInputByteSwap (LTC_Type *base, ltc_hal_byte_swap_t swap)
 Sets the LTC input key register byte swap. More...
 
static void LTC_HAL_SetKeyRegOutputByteSwap (LTC_Type *base, ltc_hal_byte_swap_t swap)
 Sets the LTC output key register byte swap. More...
 
static void LTC_HAL_SetCtxRegInputByteSwap (LTC_Type *base, ltc_hal_byte_swap_t swap)
 Sets the LTC input context register byte swap. More...
 
static void LTC_HAL_SetCtxRegOutputByteSwap (LTC_Type *base, ltc_hal_byte_swap_t swap)
 Sets the LTC output context register byte swap. More...
 
static void LTC_HAL_SetKeyRegAccessLock (LTC_Type *base, ltc_hal_key_lock_t lock)
 Sets the LTC key register access lock. More...
 
static void LTC_HAL_ClearWritten (LTC_Type *base, ltc_hal_clear_written_t clear)
 Clears LTC internal registers. More...
 
static bool LTC_HAL_GetStatusFlag (LTC_Type *base, ltc_hal_status_flag_t flag)
 Gets LTC status flags. More...
 
static void LTC_HAL_ClearDoneInterruptStatus (LTC_Type *base)
 Clears the status done interrupt. More...
 
void LTC_HAL_GetStatusFlagMasked (LTC_Type *base, ltc_hal_status_flag_t in, ltc_hal_status_flag_t *out)
 Gets LTC masked status flags. More...
 
static bool LTC_HAL_GetErrorStatusFlag (LTC_Type *base, ltc_hal_error_status_flag_t flag)
 Gets LTC error status flags. More...
 
void LTC_HAL_GetErrorStatusFlagMasked (LTC_Type *base, ltc_hal_error_status_flag_t in, ltc_hal_error_status_flag_t *out)
 Gets LTC masked error status flags. More...
 
uint8_t LTC_HAL_GetAADSize (LTC_Type *base, bool *authOnly)
 Gets the LTC AAD size. More...
 
void LTC_HAL_SetAADSize (LTC_Type *base, uint16_t size, bool authOnly)
 Sets the LTC AAD size. More...
 
uint8_t LTC_HAL_GetIVSize (LTC_Type *base, bool *onlyIV)
 Gets the LTC IV size. More...
 
void LTC_HAL_SetIVSize (LTC_Type *base, uint16_t size, bool onlyIV)
 Sets the LTC IV size. More...
 
static void LTC_HAL_SetDPAMaskSeed (LTC_Type *base, uint32_t mask)
 Sets the DPA mask seed value. More...
 
ltc_status_t LTC_HAL_PKHA_SetASize (LTC_Type *base, uint16_t size)
 Sets the PKHA A size. More...
 
static uint16_t LTC_HAL_PKHA_GetASize (LTC_Type *base)
 Gets the PKHA A size. More...
 
ltc_status_t LTC_HAL_PKHA_SetBSize (LTC_Type *base, uint16_t size)
 Sets the PKHA B size. More...
 
static uint16_t LTC_HAL_PKHA_GetBSize (LTC_Type *base)
 Gets the PKHA B size. More...
 
ltc_status_t LTC_HAL_PKHA_SetNSize (LTC_Type *base, uint16_t size)
 Sets the PKHA N size. More...
 
static uint16_t LTC_HAL_PKHA_GetNSize (LTC_Type *base)
 Gets the PKHA N size. More...
 
ltc_status_t LTC_HAL_PKHA_SetESize (LTC_Type *base, uint16_t size)
 Sets the PKHA E size. More...
 
static uint16_t LTC_HAL_PKHA_GetESize (LTC_Type *base)
 Gets the PKHA E size. More...
 
ltc_status_t LTC_HAL_SetContext (LTC_Type *base, const uint8_t *data, uint8_t dataSize, uint8_t startIndex)
 Writes the LTC context register;. More...
 
ltc_status_t LTC_HAL_GetContext (LTC_Type *base, uint8_t *dest, uint8_t dataSize, uint8_t startIndex)
 Reads the LTC context register. More...
 
ltc_status_t LTC_HAL_SetKey (LTC_Type *base, const uint8_t *key, uint8_t keySize)
 Sets the LTC keys. More...
 
ltc_status_t LTC_HAL_GetKey (LTC_Type *base, uint8_t *key, uint8_t keySize)
 Gets the LTC keys. More...
 
static uint8_t LTC_HAL_InputFIFOGetLevel (LTC_Type *base)
 Gets the input FIFO level. More...
 
static bool LTC_HAL_InputFIFOFull (LTC_Type *base)
 Gets the input FIFO level. More...
 
static uint8_t LTC_HAL_OutputFIFOGetLevel (LTC_Type *base)
 Gets the output FIFO level. More...
 
static bool LTC_HAL_OutputFIFOFull (LTC_Type *base)
 Gets the output FIFO level. More...
 
static void LTC_HAL_WriteInputFIFO (LTC_Type *base, uint32_t data)
 Writes data to input FIFO. More...
 
static uint32_t LTC_HAL_ReadOutputFIFO (LTC_Type *base)
 Reads data from the output FIFO. More...
 
static uint32_t LTC_HAL_GetStatusFIFO (LTC_Type *base)
 Reads data from the LTC FIFO Status register. More...
 
ltc_status_t LTC_HAL_WritePKA (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize)
 Writes data to the PKHA A register. More...
 
ltc_status_t LTC_HAL_WriteSizedPKA (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize)
 Writes data and its size to the PKHA A register. More...
 
void LTC_HAL_ReadPKA (LTC_Type *base, uint8_t quad, uint8_t *data, uint16_t dataSize)
 Reads data from the PKHA A register. More...
 
ltc_status_t LTC_HAL_WritePKB (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize)
 Writes data to the PKHA B register. More...
 
ltc_status_t LTC_HAL_WriteSizedPKB (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize)
 Writes data and its size to the PKHA B register. More...
 
void LTC_HAL_ReadPKB (LTC_Type *base, uint8_t quad, uint8_t *data, uint16_t dataSize)
 Reads data from the PKHA B register. More...
 
ltc_status_t LTC_HAL_WritePKN (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize)
 Writes data to the PKHA N register. More...
 
ltc_status_t LTC_HAL_WriteSizedPKN (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize)
 Writes data and its size to the PKHA N register. More...
 
void LTC_HAL_ReadPKN (LTC_Type *base, uint8_t quad, uint8_t *data, uint16_t dataSize)
 Reads data from the PKHA N register. More...
 
ltc_status_t LTC_HAL_WritePKE (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize)
 Writes data to the PKHA E register. More...
 
ltc_status_t LTC_HAL_WriteSizedPKE (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize)
 Writes data and its size to the PKHA E register. More...
 
void LTC_HAL_ReadPKE (LTC_Type *base, uint8_t quad, uint8_t *data, uint16_t dataSize)
 Reads data from the PKHA E register. More...
 
void LTC_HAL_PKHA_ModeSetSrcRegCopy (ltc_hal_mode_t *outMode, ltc_hal_pkha_reg_area_t reg)
 Sets the PKHA copy source register. More...
 
void LTC_HAL_PKHA_ModeSetDstRegCopy (ltc_hal_mode_t *outMode, ltc_hal_pkha_reg_area_t reg)
 Sets the PKHA copy destination register. More...
 
void LTC_HAL_PKHA_ModeSetSrcSegCopy (ltc_hal_mode_t *outMode, ltc_hal_pkha_quad_area_t quad)
 Sets the PKHA copy source segment. More...
 
void LTC_HAL_PKHA_ModeSetDstSegCopy (ltc_hal_mode_t *outMode, ltc_hal_pkha_quad_area_t quad)
 Sets the PKHA copy destination segment. More...
 

Data Structure Documentation

struct ltc_hal_pkha_mode_params_t

Typedef Documentation

typedef uint32_t ltc_hal_mode_t

Enumeration Type Documentation

Enumerator
kStatus_LTC_ErrShift 

Number of left shift bits for ltc_status_t General Error OR'ed with LTC Error Status Register ERRID1 value.

Enumerator
kStatus_LTC_Error 

General Error.

kStatus_LTC_ModeError 

Error Status Register: Mode Error.

kStatus_LTC_DataSizeError 

Error Status Register: Data Size Error, including PKHA N Register Size Error.

kStatus_LTC_KeySizeError 

Error Status Register: Key Size Error, including PKHA E Register Size Error.

kStatus_LTC_PKHA_RegASzError 

Error Status Register: PKHA A Register Size Error.

kStatus_LTC_PKHA_RegBSzError 

Error Status Register: PKHA B Register Size Error.

kStatus_LTC_DataOutOfSeqError 

Error Status Register: Data Arrived Out of Sequence Error.

kStatus_LTC_PKHA_DivByZeroError 

Error Status Register: PKHA Divide By Zero Error.

kStatus_LTC_PKHA_ModulusEvenError 

Error Status Register: PKHA Modulus Even Error.

kStatus_LTC_DES_KeyParityError 

Error Status Register: DES Key Parity Error.

kStatus_LTC_ICV_CheckFailed 

Error Status Register: ICV Check Failed (Received MAC compare failed)

kStatus_LTC_InternalHwFailure 

Error Status Register: Internal Hardware Failure.

kStatus_LTC_CCM_AadSzError 

Error Status Register: CCM AAD Size Error.

kStatus_LTC_CCM_InvalidCryptoSel 

Error Status Register: Invalid Crypto Engine Selected.

kStatus_LTC_OSAError 

OSA initialisation failed.

Enumerator
kLTC_PKHA_Integer_Arith 

Use integer arithmetic.

kLTC_PKHA_F2M_Arith 

Use binary polynomial arithmetic.

Enumerator
kLTC_PKHA_R2_Calc 

Calculate (R^2 mod N)

kLTC_PKHA_R2_Input 

(R^2 mod N) supplied as input

Enumerator
kLTC_PKHA_Arith_ModAdd 

(A + B) mod N

kLTC_PKHA_Arith_ModSub1 

(A - B) mod N

kLTC_PKHA_Arith_ModSub2 

(B - A) mod N

kLTC_PKHA_Arith_ModMul 

(A x B) mod N

kLTC_PKHA_Arith_ModExp 

(A^E) mod N

kLTC_PKHA_Arith_ModRed 

(A) mod N

kLTC_PKHA_Arith_ModInv 

(A^-1) mod N

kLTC_PKHA_Arith_ECCAdd 

(P1 + P2)

kLTC_PKHA_Arith_ECCDouble 

(P2 + P2)

kLTC_PKHA_Arith_ECCMul 

(E x P1)

kLTC_PKHA_Arith_ModR2 

(R^2 mod N)

kLTC_PKHA_Arith_GCD 

GCD (A, N)

kLTC_PKHA_Arith_PrimalityTest 

Miller-Rabin.

Enumerator
kLTCCmd_ResetAll 

Reset all internal logic.

kLTCCmd_ResetAES 

Reset AES core.

kLTCCmd_ResetDES 

Reset DES core.

kLTCCmd_ResetPKHA 

Reset PKHA core.

Enumerator
kLTCCtrl_KeyRegisterReadable 

Key register readable.

kLTCCtrl_KeyRegisterNotReadable 

Key register not readable.

Enumerator
kLTCCtrl_ByteNoSwap 

Don't swap bytes on read/write.

kLTCCtrl_ByteSwap 

Swap bytes on read/write.

Enumerator
kLTCCtrl_DMASize_1byte 

DMA request FIFO 1 entry.

kLTCCtrl_DMASize_4byte 

DMA request FIFO 4 entries.

Enumerator
kLTCCtrl_DMA_Disabled 

DMA disable.

kLTCCtrl_DMA_Enabled 

DMA enabled.

Enumerator
kLTCCtrl_ISR_Not_Masked 

Interrupt not masked.

kLTCCtrl_ISR_Masked 

Interrupt masked.

Enumerator
kLTCFIFO_OutputFifoFull 

Output FIFO Full bit mask.

kLTCFIFO_OutputFifoLevel 

Output FIFO Level bit mask.

kLTCFIFO_InputFifoFull 

Input FIFO Full bit mask.

kLTCFIFO_InputFifoLevel 

Input FIFO Level bit mask.

Function Documentation

static uint32_t LTC_HAL_GetWordFromUnaligned ( const uint8_t *  src)
inlinestatic

This function creates a 32-bit word from an input array of four bytes.

Parameters
srcInput array of four bytes. The array can start at any address in memory.
Returns
32-bit unsigned int created from the input byte array.
static void LTC_HAL_SetUnalignedFromWord ( uint32_t  srcWord,
uint8_t *  dst 
)
inlinestatic

This function creates an output array of four bytes from an input 32-bit word.

Parameters
srcWordInput 32-bit unsigned integer.
dstOutput array of four bytes. The array can start at any address in memory.
void LTC_HAL_Init ( LTC_Type *  base)

Initializes the LTC module to a known working state.

Parameters
baseLTC module base pointer.
static void LTC_HAL_ModeSetAlgorithm ( ltc_hal_mode_t outMode,
ltc_hal_algorithm_t  alg 
)
inlinestatic

This function sets the mode algorithm to use to switch between the major operating modes of PKHA, AES, DES, and 3DES. The value of this determines which way the mode register is interpreted, and should be set first before setting other mode settings.

Parameters
outModeOutput mode word
algAlgorithm to select
static void LTC_HAL_ModeSetEncrypt ( ltc_hal_mode_t outMode,
ltc_hal_mode_encrypt_t  encrypt 
)
inlinestatic

Sets the operating mode to encrypt or decrypt symmetric key algorithms.

Parameters
outModeOutput mode word
encryptEncrypt/decrypt mode selector
static ltc_hal_mode_encrypt_t LTC_HAL_ModeGetEncrypt ( ltc_hal_mode_t outMode)
inlinestatic

Gets the operating mode to encrypt or decrypt the symmetric key algorithms.

Parameters
outModeOutput mode word
Returns
Encrypt/decrypt mode selector
static void LTC_HAL_ModeSetICVTest ( ltc_hal_mode_t outMode,
ltc_hal_mode_icv_check_t  check 
)
inlinestatic

Sets the algorithm to perform or not perform ICV checking for all algorithms other than AES ECB.

Parameters
outModeOutput mode word
checkCompare / Don't compare selector
static void LTC_HAL_ModeSetAlgorithmState ( ltc_hal_mode_t outMode,
ltc_hal_mode_algorithm_state_t  as 
)
inlinestatic

Sets the state of the algorithm to be executed.

Parameters
outModeOutput mode word
asAlgorithm state to select
static ltc_hal_mode_algorithm_state_t LTC_HAL_ModeGetAlgorithmState ( ltc_hal_mode_t outMode)
inlinestatic

Gets the state of the algorithm.

Returns
Algorithm state
static void LTC_HAL_ModeSetSymmetricAlg ( ltc_hal_mode_t outMode,
ltc_hal_mode_symmetric_alg_t  alg 
)
inlinestatic

Sets the symmetric encryption/decryption operating mode.

Parameters
outModeOutput mode word
algOperation mode to use
static void LTC_HAL_ModeSetDecryptKey ( LTC_Type *  base)
inlinestatic

Sets the LTC AES Mode DK bit to mark the key as decrypt key.

static void LTC_HAL_PKHA_ModeSetFunc ( ltc_hal_mode_t outMode,
ltc_hal_pkha_func_t  func 
)
inlinestatic

Sets the mathematics or memory function for the PKHA mode operation.

Parameters
outModeOutput mode word
funcFunction to use
static void LTC_HAL_PKHA_ModeSetMontgomeryInput ( ltc_hal_mode_t outMode,
ltc_hal_pkha_montgomery_form_t  form 
)
inlinestatic

Sets the LTC PKHA mode to use regular or montgomery-form inputs.

Parameters
outModeOutput mode word
formForm to use
static void LTC_HAL_PKHA_ModeSetMontgomeryOutput ( ltc_hal_mode_t outMode,
ltc_hal_pkha_montgomery_form_t  form 
)
inlinestatic

Sets the LTC PKHA mode to use regular or montgomery-form outputs.

Parameters
outModeOutput mode word
formForm to use
static void LTC_HAL_PKHA_ModeSetF2M ( ltc_hal_mode_t outMode,
ltc_hal_pkha_f2m_t  form 
)
inlinestatic

Sets the LTC PKHA mode to perform integer or f2m binary polynomial operations.

Parameters
outModeOutput mode word
formForm to use
static void LTC_HAL_PKHA_ModeSetR2 ( ltc_hal_mode_t outMode,
ltc_hal_pkha_r2_t  form 
)
inlinestatic

Sets the LTC PKHA mode to calculate or use the supplied R2 mod N inputs.

Parameters
outModeOutput mode word
formForm to use
static void LTC_HAL_PKHA_ModeSetTimingEqual ( ltc_hal_mode_t outMode,
ltc_hal_pkha_timing_t  form 
)
inlinestatic

Sets the LTC PKHA mode to use timing equalized version of functions or not.

Parameters
outModeOutput mode word
formForm to use
static void LTC_HAL_PKHA_ModeSetOutput ( ltc_hal_mode_t outMode,
ltc_hal_pkha_output_reg_t  form 
)
inlinestatic

Sets the LTC PKHA mode to output results in a particular destination register.

Parameters
outModeOutput mode word
formForm to use
static void LTC_HAL_PKHA_ModeSetRamArea ( ltc_hal_mode_t outMode,
ltc_hal_pkha_reg_area_t  area 
)
inlinestatic

Sets the LTC PKHA mode to clear a particular RAM area.

Parameters
outModeOutput mode word
areaRam area to clear.
static void LTC_HAL_PKHA_ModeSetQuadArea ( ltc_hal_mode_t outMode,
ltc_hal_pkha_clr_quad_area_t  quad 
)
inlinestatic

Sets the LTC PKHA mode to clear a particular Quadrant area.

Parameters
outModeOutput mode word
quadQuad area to clear.
static void LTC_HAL_WriteMode ( LTC_Type *  base,
ltc_hal_mode_t  mode 
)
inlinestatic

The mode register can only be written all at once. Use the other LTC_HAL_ModeSet* utility functions to construct the mode and then use this to write it to the hardware.

Parameters
baseLTC module base pointer
modeMode to set
static ltc_hal_mode_t LTC_HAL_ReadMode ( LTC_Type *  base)
inlinestatic
Parameters
baseLTC module base pointer
static uint8_t LTC_HAL_GetKeySize ( LTC_Type *  base)
inlinestatic

Returns the size in bytes of the key used for AES/DES operations.

Parameters
baseLTC module base pointer
Returns
Size of key in bytes
ltc_status_t LTC_HAL_SetKeySize ( LTC_Type *  base,
uint8_t  keySize 
)

Sets the size in bytes of the key being used for AES/DES operations.

Note
This should be called after the key itself is written because a write to this prevents writing the key.
Parameters
baseLTC module base pointer
keySizeSize in bytes of the key to write
Returns
LTC status
static uint16_t LTC_HAL_GetDataSize ( LTC_Type *  base)
inlinestatic

Returns the size in bytes of the data being used for AES/DES operations.

Parameters
baseLTC module base pointer
Returns
Size of key in bytes
ltc_status_t LTC_HAL_SetDataSize ( LTC_Type *  base,
uint16_t  dataSize 
)

Sets the size in bytes of the data being used for AES/DES operations.

Parameters
baseLTC module base pointer
dataSizeSize in bytes of the data that will be written to the input FIFO
Returns
LTC status
static uint8_t LTC_HAL_GetICVSize ( LTC_Type *  base)
inlinestatic

Returns the size in bytes of data in the last block of ICV (integrity check value) is valid when performing AES integrity checks.

Parameters
baseLTC module base pointer
Returns
Size of valid ICV data in bytes
ltc_status_t LTC_HAL_SetICVSize ( LTC_Type *  base,
uint8_t  dataSize 
)

Sets the size in bytes of data that is valid in the last block ICV (integrity check value).

Parameters
baseLTC module base pointer
dataSizeSize in bytes of the valid ICV data
Returns
LTC status
static void LTC_HAL_Command ( LTC_Type *  base,
ltc_hal_cmd_t  cmd 
)
inlinestatic

Issues LTC commands to reset the module or submodules.

Parameters
baseLTC module base pointer
cmdCommand to issue.
static void LTC_HAL_SetInterruptMask ( LTC_Type *  base,
ltc_hal_isr_mask_t  mask 
)
inlinestatic
Note
After this bit is set, it can only be cleared by hard reset.
Parameters
baseLTC module base pointer
maskISR mask/no mask setting
static void LTC_HAL_SetPKHAEnableDMA ( LTC_Type *  base,
ltc_hal_dma_enable_t  enable 
)
inlinestatic

Enables/disables DMA request and done signals for PKHA.

Parameters
baseLTC module base pointer
enableEnable/disable DMA
static void LTC_HAL_SetInputFIFOEnableDMA ( LTC_Type *  base,
ltc_hal_dma_enable_t  enable 
)
inlinestatic

Enables/disables the DMA request and done signals for input FIFO.

Parameters
baseLTC module base pointer
enableEnable/disable DMA
static void LTC_HAL_SetInputFIFORequestSizeDMA ( LTC_Type *  base,
ltc_hal_fifo_dma_size_t  size 
)
inlinestatic

Input FIFO only requests data if the input FIFO has enough space for the request size.

Parameters
baseLTC module base pointer
sizeInput FIFO DMA request size of 1 or 4 bytes
static void LTC_HAL_SetOutputFIFOEnableDMA ( LTC_Type *  base,
ltc_hal_dma_enable_t  enable 
)
inlinestatic

Enables/disables the DMA request and done signals for output FIFO.

Parameters
baseLTC module base pointer
enableEnable/disable DMA
static void LTC_HAL_SetOutputFIFORequestSizeDMA ( LTC_Type *  base,
ltc_hal_fifo_dma_size_t  size 
)
inlinestatic

Input FIFO only requests data if the output FIFO has enough space for the request size.

Parameters
baseLTC module base pointer
sizeOutput FIFO DMA request size of 1 or 4 bytes
static void LTC_HAL_SetInputFIFOByteSwap ( LTC_Type *  base,
ltc_hal_byte_swap_t  swap 
)
inlinestatic

Sets whether the input FIFO should byte swap all data written to.

Parameters
baseLTC module base pointer
swapInput FIFO byte swap value
static void LTC_HAL_SetOutputFIFOByteSwap ( LTC_Type *  base,
ltc_hal_byte_swap_t  swap 
)
inlinestatic

Sets whether the output FIFO should byte swap all data read from.

Parameters
baseLTC module base pointer
swapOutput FIFO byte swap value
static void LTC_HAL_SetKeyRegInputByteSwap ( LTC_Type *  base,
ltc_hal_byte_swap_t  swap 
)
inlinestatic

Sets whether the key register should byte swap all data written to. Data is byte-swapped only within a single word.

Parameters
baseLTC module base pointer
swapInput key register byte swap value
static void LTC_HAL_SetKeyRegOutputByteSwap ( LTC_Type *  base,
ltc_hal_byte_swap_t  swap 
)
inlinestatic

Sets whether the key register should byte swap all data read from. Data is byte-swapped only within a single word.

Parameters
baseLTC module base pointer
swapOutput key register byte swap value
static void LTC_HAL_SetCtxRegInputByteSwap ( LTC_Type *  base,
ltc_hal_byte_swap_t  swap 
)
inlinestatic

Sets whether the context register should byte swap all data written to. Data is byte-swapped only within a single word.

Parameters
baseLTC module base pointer
swapInput context register byte swap value
static void LTC_HAL_SetCtxRegOutputByteSwap ( LTC_Type *  base,
ltc_hal_byte_swap_t  swap 
)
inlinestatic

Sets whether the context register should byte swap all data read from. Data is byte-swapped only within a single word.

Parameters
baseLTC module base pointer
swapOutput context register byte swap value
static void LTC_HAL_SetKeyRegAccessLock ( LTC_Type *  base,
ltc_hal_key_lock_t  lock 
)
inlinestatic

Sets read access to the LTC key register.

Parameters
baseLTC module base pointer
swaplock Key register read access value
static void LTC_HAL_ClearWritten ( LTC_Type *  base,
ltc_hal_clear_written_t  clear 
)
inlinestatic

This function clears various internal registers of the LTC to reset components to a known state.

Parameters
baseLTC module base pointer
clearSubmodule to be cleared
static bool LTC_HAL_GetStatusFlag ( LTC_Type *  base,
ltc_hal_status_flag_t  flag 
)
inlinestatic

Returns the status of a single or multiple status flags. The return value is only true if at least one of the selected flags are true.

Parameters
baseLTC module base pointer
flagStatus flag to check
Returns
bool Status flag true/false
static void LTC_HAL_ClearDoneInterruptStatus ( LTC_Type *  base)
inlinestatic

This function clears the interrupt flag that signals an operation has completed, so it can be reasserted on a subsequent operation.

Parameters
baseLTC module base pointer
void LTC_HAL_GetStatusFlagMasked ( LTC_Type *  base,
ltc_hal_status_flag_t  in,
ltc_hal_status_flag_t out 
)

Returns the status of each individual flag requested.

Parameters
baseLTC module base pointer
inStatus flags to check
outOutput status flags set
static bool LTC_HAL_GetErrorStatusFlag ( LTC_Type *  base,
ltc_hal_error_status_flag_t  flag 
)
inlinestatic

Returns the status of a single or multiple error status flags. The return value is only true if all selected flags are true.

Parameters
baseLTC module base pointer
flagError status flag to check
Returns
bool Error status flag true/false
void LTC_HAL_GetErrorStatusFlagMasked ( LTC_Type *  base,
ltc_hal_error_status_flag_t  in,
ltc_hal_error_status_flag_t out 
)

Returns the error status of each individual flag requested.

Parameters
baseLTC module base pointer
flagError status flag to check
inError status flags to check
outOutput error status flags set
uint8_t LTC_HAL_GetAADSize ( LTC_Type *  base,
bool *  authOnly 
)

Returns the size in bytes (mod 16) of how much of the last block of AAD is valid.

Parameters
baseLTC module base pointer
authOnlyOutput parameter to store whether or not only AAD data is to be written to the FIFO, meaning only authentication is being performed.
Returns
Size of the AAD, mod 16
void LTC_HAL_SetAADSize ( LTC_Type *  base,
uint16_t  size,
bool  authOnly 
)

Sets the size of the AAD to be written. This data is added to the data size register, which is the AAD size rounded up to the next 16-byte boundary. If the 'authOnly' flag is set, it tells the engine that only authentication is performed which means only AAD data is written into the input FIFO.

Parameters
baseLTC module base pointer
SizeSize in bytes of the AAD data
authOnlyWhether or not only AAD data is to be written to the FIFO, meaning only authentication is being performed.
uint8_t LTC_HAL_GetIVSize ( LTC_Type *  base,
bool *  onlyIV 
)

Returns the size in bytes (mod 16) of how much of the last block of IV is valid.

Parameters
baseLTC module base pointer
onlyIVOutput parameter to store whether or not only IV data is to be written to the FIFO.
Returns
Size of the IV, mod 16
void LTC_HAL_SetIVSize ( LTC_Type *  base,
uint16_t  size,
bool  onlyIV 
)

Sets the size of the IV to be written. This data is added to the data size register, which is the IV size rounded up to the next 16-byte boundary.

Parameters
baseLTC module base pointer
SizeSize in bytes (mod 16) of the IV data
onlyIVWhether or not only IV data is to be written to the FIFO
Returns
LTC status
static void LTC_HAL_SetDPAMaskSeed ( LTC_Type *  base,
uint32_t  mask 
)
inlinestatic

The differential power analysis (DPA) needs a seed mask to introduce noise into the power consumed by the AES module. This should be seeded at least at POR but preferably every 100 k AES blocks processed to provide DPA protection.

Parameters
baseLTC module base pointer
maskRandom DPA mask seed value
ltc_status_t LTC_HAL_PKHA_SetASize ( LTC_Type *  base,
uint16_t  size 
)

Sets the size in bytes of data contained in the PKHA A register.

Parameters
baseLTC module base pointer
sizeSize in bytes (maximum 256)
static uint16_t LTC_HAL_PKHA_GetASize ( LTC_Type *  base)
inlinestatic

Returns the size in bytes of data contained in the PKHA A register.

Parameters
baseLTC module base pointer
Returns
Size in bytes
ltc_status_t LTC_HAL_PKHA_SetBSize ( LTC_Type *  base,
uint16_t  size 
)

Sets the size in bytes of data contained in the PKHA B register.

Parameters
baseLTC module base pointer
sizeSize in bytes (maximum 256)
static uint16_t LTC_HAL_PKHA_GetBSize ( LTC_Type *  base)
inlinestatic

Returns the size in bytes of data contained in the PKHA B register.

Parameters
baseLTC module base pointer
Returns
Size in bytes
ltc_status_t LTC_HAL_PKHA_SetNSize ( LTC_Type *  base,
uint16_t  size 
)

Sets the size in bytes of data contained in the PKHA N register.

Parameters
baseLTC module base pointer
sizeSize in bytes (maximum 256)
static uint16_t LTC_HAL_PKHA_GetNSize ( LTC_Type *  base)
inlinestatic

Returns the size in bytes of data contained in the PKHA N register.

Parameters
baseLTC module base pointer
Returns
Size in bytes
ltc_status_t LTC_HAL_PKHA_SetESize ( LTC_Type *  base,
uint16_t  size 
)

Sets the size in bytes of data contained in the PKHA E register.

Parameters
baseLTC module base pointer
sizeSize in bytes (maximum 256)
static uint16_t LTC_HAL_PKHA_GetESize ( LTC_Type *  base)
inlinestatic

Returns the size in bytes of data contained in the PKHA E register.

Parameters
baseLTC module base pointer
Returns
Size in bytes
ltc_status_t LTC_HAL_SetContext ( LTC_Type *  base,
const uint8_t *  data,
uint8_t  dataSize,
uint8_t  startIndex 
)

The LTC context register is a 512 bit (64 byte) register that holds internal context for the crypto engine. The meaning varies based on the algorithm and operating state being used. This register is written by the driver/application to load state such as IV, counter, and so on. Then, it is updated by the internal crypto engine as needed.

Parameters
baseLTC module base pointer
dataData to write
dataSizeSize of data to write in bytes
startIndexStarting word (4-byte) index into the 16-word register.
Returns
Status of write
ltc_status_t LTC_HAL_GetContext ( LTC_Type *  base,
uint8_t *  dest,
uint8_t  dataSize,
uint8_t  startIndex 
)

The LTC context register is a 512 bit (64 byte) register that holds internal context for the crypto engine. The meaning varies based on the algorithm and operating state being used. This register is written by the driver/application to load state such as IV, counter, and so on. Then, it is updated by the internal crypto engine as needed.

Parameters
baseLTC module base pointer
dataDestination of read data
dataSizeSize of data to read in bytes
startIndexStarting word (4-byte) index into the 16-word register.
Returns
Status of read
ltc_status_t LTC_HAL_SetKey ( LTC_Type *  base,
const uint8_t *  key,
uint8_t  keySize 
)

This function writes the LTC keys into the key register. The keys should be written before the key size.

Parameters
baseLTC module base pointer
keyArray of key words
keySizeNumber of bytes for all keys to be loaded (maximum 32, must be a multiple of 4).
Returns
Key set status
ltc_status_t LTC_HAL_GetKey ( LTC_Type *  base,
uint8_t *  key,
uint8_t  keySize 
)

This function retrieves the LTC keys from the key register.

Parameters
baseLTC module base pointer
keyArray of data to store keys
keySizeNumber of bytes of keys to retrieve
Returns
Key set status
static uint8_t LTC_HAL_InputFIFOGetLevel ( LTC_Type *  base)
inlinestatic

Returns the number of entries currently in the input FIFO.

Parameters
baseLTC module base pointer
Returns
Input FIFO entries
static bool LTC_HAL_InputFIFOFull ( LTC_Type *  base)
inlinestatic

Returns the number of entries currently in the input FIFO.

Parameters
baseLTC module base pointer
Returns
Input FIFO entries
static uint8_t LTC_HAL_OutputFIFOGetLevel ( LTC_Type *  base)
inlinestatic

Returns the number of entries currently in the output FIFO.

Parameters
baseLTC module base pointer
Returns
Output FIFO entries
static bool LTC_HAL_OutputFIFOFull ( LTC_Type *  base)
inlinestatic

Returns the number of entries currently in the output FIFO.

Parameters
baseLTC module base pointer
Returns
Output FIFO entries
static void LTC_HAL_WriteInputFIFO ( LTC_Type *  base,
uint32_t  data 
)
inlinestatic

Writes a word of data to the input FIFO for algorithm processing.

Parameters
baseLTC module base pointer
dataData to write
static uint32_t LTC_HAL_ReadOutputFIFO ( LTC_Type *  base)
inlinestatic

Reads a word of data from the output FIFO after algorithm processing.

Parameters
baseLTC module base pointer
Returns
Data read
static uint32_t LTC_HAL_GetStatusFIFO ( LTC_Type *  base)
inlinestatic

Reads LTC FIFO Status register actual value.

Parameters
baseLTC module base pointer
Returns
Data read
ltc_status_t LTC_HAL_WritePKA ( LTC_Type *  base,
uint8_t  quad,
const uint8_t *  data,
uint16_t  dataSize 
)

Writes data in byte-sized chunks to the PKHA A register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero.

Parameters
baseLTC module base pointer
quadQuadrant in register (0 - 3) to refer to the sub-registers.
dataArray of bytes to be written
dataSizeSize of data to be written in bytes
Returns
Status
ltc_status_t LTC_HAL_WriteSizedPKA ( LTC_Type *  base,
uint8_t  quad,
const uint8_t *  data,
uint16_t  dataSize 
)

Writes data in byte-sized chunks to the PKHA A register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero. Also write data size to PKASZ register.

Parameters
baseLTC module base pointer
quadQuadrant in register (0 - 3) to refer to the sub-registers.
dataArray of bytes to be written
dataSizeSize of data to be written in bytes and stored in PKASZ reg.
Returns
Status
void LTC_HAL_ReadPKA ( LTC_Type *  base,
uint8_t  quad,
uint8_t *  data,
uint16_t  dataSize 
)

Reads data in byte-sized chunks from PKHA A register, which is 2048 bits in size.

Parameters
baseLTC module base pointer
quadQuadrant in register (0 - 3) to refer to the sub-registers.
dataArray of bytes to be read into. This must be large enough to store 'dataSize' bytes.
dataSizeSize of data to be read, in bytes
ltc_status_t LTC_HAL_WritePKB ( LTC_Type *  base,
uint8_t  quad,
const uint8_t *  data,
uint16_t  dataSize 
)

Writes data in byte-sized chunks to PKHA B register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero.

Parameters
baseLTC module base pointer
quadQuadrant in register (0 - 3) to refer to the sub-registers.
dataArray of bytes to be written
dataSizeSize of data to be written in bytes
Returns
Status
ltc_status_t LTC_HAL_WriteSizedPKB ( LTC_Type *  base,
uint8_t  quad,
const uint8_t *  data,
uint16_t  dataSize 
)

Writes data in byte-sized chunks to PKHA B register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero. Also write data size to PKBSZ register.

Parameters
baseLTC module base pointer
quadQuadrant in register (0 - 3) to refer to the sub-registers.
dataArray of bytes to be written
dataSizeSize of data to be written in bytes and stored in PKBSZ reg.
Returns
Status
void LTC_HAL_ReadPKB ( LTC_Type *  base,
uint8_t  quad,
uint8_t *  data,
uint16_t  dataSize 
)

Reads data in byte-sized chunks from PKHA B register, which is 2048 bits in size.

Parameters
baseLTC module base pointer
quadQuadrant in register (0 - 3) to refer to the sub-registers.
dataArray of bytes to be read into. This must be large enough to store 'dataSize' bytes.
dataSizeSize of data to be read, in bytes
ltc_status_t LTC_HAL_WritePKN ( LTC_Type *  base,
uint8_t  quad,
const uint8_t *  data,
uint16_t  dataSize 
)

Writes data in byte-sized chunks to PKHA N register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero.

Parameters
baseLTC module base pointer
quadQuadrant in register (0 - 3) to refer to the sub-registers.
dataArray of bytes to be written
dataSizeSize of data to be written in bytes
Returns
Status
ltc_status_t LTC_HAL_WriteSizedPKN ( LTC_Type *  base,
uint8_t  quad,
const uint8_t *  data,
uint16_t  dataSize 
)

Writes data in byte-sized chunks to the PKHA N register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero. Also write data size to PKNSZ register.

Parameters
baseLTC module base pointer
quadQuadrant in register (0 - 3) to refer to the sub-registers.
dataArray of bytes to be written
dataSizeSize of data to be written in bytes and stored in PKNSZ reg.
Returns
Status
void LTC_HAL_ReadPKN ( LTC_Type *  base,
uint8_t  quad,
uint8_t *  data,
uint16_t  dataSize 
)

Reads data in byte-sized chunks from PKHA N register, which is 2048 bits in size.

Parameters
baseLTC module base pointer
quadQuadrant in register (0 - 3) to refer to the sub-registers.
dataArray of bytes to be read into. This must be large enough to store 'dataSize' bytes.
dataSizeSize of data to be read, in bytes
ltc_status_t LTC_HAL_WritePKE ( LTC_Type *  base,
uint8_t  quad,
const uint8_t *  data,
uint16_t  dataSize 
)

Writes data in byte-sized chunks to PKHA E register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero.

Parameters
baseLTC module base pointer
quadQuadrant in register (0 - 3) to refer to the sub-registers.
dataArray of bytes to be written
dataSizeSize of data to be written in bytes
Returns
Status
ltc_status_t LTC_HAL_WriteSizedPKE ( LTC_Type *  base,
uint8_t  quad,
const uint8_t *  data,
uint16_t  dataSize 
)

Writes data in byte-sized chunks to PKHA E register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero. Also write data size to PKESZ register.

Parameters
baseLTC module base pointer
quadQuadrant in register (0 - 3) to refer to the sub-registers.
dataArray of bytes to be written
dataSizeSize of data to be written in bytes and stored in PKESZ reg.
Returns
Status
void LTC_HAL_ReadPKE ( LTC_Type *  base,
uint8_t  quad,
uint8_t *  data,
uint16_t  dataSize 
)

Reads data in byte-sized chunks from PKHA E register, which is 2048 bits in size.

Parameters
baseLTC module base pointer
quadQuadrant in register (0 - 3) to refer to the sub-registers.
dataArray of bytes to be read into. This must be large enough to store 'dataSize' bytes.
dataSizeSize of data to be read, in bytes
void LTC_HAL_PKHA_ModeSetSrcRegCopy ( ltc_hal_mode_t outMode,
ltc_hal_pkha_reg_area_t  reg 
)

Sets the LTC PKHA source register to perform register copy.

Parameters
outModeOutput mode word
regRegister to use
void LTC_HAL_PKHA_ModeSetDstRegCopy ( ltc_hal_mode_t outMode,
ltc_hal_pkha_reg_area_t  reg 
)

Sets the LTC PKHA destination register to perform register copy.

Parameters
outModeOutput mode word
regRegister to use
void LTC_HAL_PKHA_ModeSetSrcSegCopy ( ltc_hal_mode_t outMode,
ltc_hal_pkha_quad_area_t  quad 
)

Sets the LTC PKHA source segment to perform register copy.

Parameters
outModeOutput mode word
regRegister to use
void LTC_HAL_PKHA_ModeSetDstSegCopy ( ltc_hal_mode_t outMode,
ltc_hal_pkha_quad_area_t  quad 
)

Sets the LTC PKHA destination segment to perform register copy.

Parameters
outModeOutput mode word
regRegister to use