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 driver.

All driver functions documented in this module are synchronous - that is, all operations are complete and results is available for further usage when a function returns. When called, driver functions don't return until complete. The driver functions are not re-entrant.

Driver functions implement optional protection by a mutex for multithreading. The feature can be enabled by the LTC_DRV_RTOS_MULTI_THREAD compile time macro. The option is recommended for enabling in RTOS environment to protect LTC module against concurrent accesses from different tasks. If you compile LTC driver with LTC_DRV_RTOS_MULTI_THREAD disabled, you still should implement custom way of protection against concurrent calls to LTC driver API from different tasks or from interrupts.

Driver functions implement optional sleep in RTOS feature (calling task is blocked while waiting for an operation to complete). The feature can be enabled by the LTC_DRV_RTOS_SLEEP compile time macro. The option is recommended for enabling in RTOS environment to allow other tasks execute. If enabled, the driver enables LTC interrupt and from it's interrupt service routine, LTC_DRV_IRQHandler() shall be called. If the LTC_DRV_RTOS_SLEEP option is disabled, the driver disables LTC interrupt.

All possible combinations of the two settings is supported. The driver functions cannot be called inside an interrupt service routine, unless both settings LTC_DRV_RTOS_MULTI_THREAD and LTC_DRV_RTOS_SLEEP are disabled. Only in this configuration the driver executes simple polling loops, they can be called inside an interrupt service routine, although execution time shall be considered.

LTC Driver Initialization

LTC Driver is initialized by calling the LTC_DRV_Init() function. If AES engine is used and the LTC module implementation features LTC DPA Mask Seed register, seed the DPA mask generator, by using the seed from a random number generator. The LTC_DRV_SetDPAMaskSeed() function is provided to set the DPA mask seed.

Modules

 LTC AES driver
 
 LTC DES driver
 
 LTC HASH driver
 
 LTC PKHA driver
 

Macros

#define LTC_DRV_RTOS_MULTI_THREAD   (USE_RTOS)
 Enables/disables multithread support in the LTC driver. More...
 
#define LTC_DRV_RTOS_SLEEP   (USE_RTOS)
 Enables/disables putting the calling task to "sleep" during the LTC blocking operation. More...
 

Functions

ltc_status_t LTC_DRV_Init (uint32_t instance)
 Initializes the LTC driver. More...
 
void LTC_DRV_Deinit (uint32_t instance)
 Deinitializes the LTC driver. More...
 
void LTC_DRV_IRQHandler (uint32_t instance)
 LTC interrupt handler. More...
 

Variables

LTC_Type *const g_ltcBase []
 Table of base addresses for LTC instances. More...
 
const IRQn_Type g_ltcIrqId []
 Table to save LTC IRQ enumeration numbers defined in the CMSIS header file. More...
 

Macro Definition Documentation

#define LTC_DRV_RTOS_MULTI_THREAD   (USE_RTOS)

Enables/disables multithread support in the LTC driver, which is achieved by locking critical sections with a mutex and enabled by default for RTOS.

#define LTC_DRV_RTOS_SLEEP   (USE_RTOS)

Enables/disables putting the calling task to "sleep" during the LTC blocking operation. If enabled, it requires using of LTC IRQ handler. It is enabled by default for RTOS.

Function Documentation

ltc_status_t LTC_DRV_Init ( uint32_t  instance)

This function initializes the LTC driver.

Parameters
instanceLTC instance ID.
void LTC_DRV_Deinit ( uint32_t  instance)

This function deinitializes the LTC driver.

Parameters
instanceLTC instance ID.
void LTC_DRV_IRQHandler ( uint32_t  instance)

This function handles the LTC interrupt.

Parameters
instanceLTC instance ID.

Variable Documentation

LTC_Type* const g_ltcBase[]
const IRQn_Type g_ltcIrqId[]