Trust Anchor Specific API

Include file: <mi.h> | Linker switch: -lmi

Debugging

miDebuggingDisable
miDebuggingEnable

Embedded Events

miDeregisterEmbeddedEvent
miEnableEmbeddedLowPowerMode
miFlushEmbeddedEvent
miFlushEmbeddedEventWithInfo
miGetEmbeddedEventId
miGetEmbeddedEventInfo
miSetEmbeddedInterfaceType*
miSetEmbeddedPowerMode*
miRegisterEmbeddedEvent
miSetContactlessBehaviour
miSetEarlyCombinedModeStartupEvents
miVccPowerApplied

Fault Processing

miAbendReason
miPerformHalt
miPerformRestart
miSetAbendFunction

GPIO

miGPIOAllocatePin
miGPIOAllocatePins
miGPIOAllocateStartupPin
miGPIOClearMonitoredPinEvent
miGPIODeallocateStartupPin
miGPIOEnableOutputPin
miGPIOEnableOutputPins
miGPIOEnablePullupPin
miGPIOEnablePullupPins
miGPIOMonitoredPinEventOccurred
miGPIOMonitorPin
miGPIOReadPin
miGPIOReadPort
miGPIOSetPin
miGPIOSetPort
miGPIOSetStartupPin
miGPIOUnmonitorPin

I2C

miI2CInitialise
miI2CReceiveByte
miI2CRegisterAccess
miI2CRegisterReadByte
miI2CRegisterReadBytes
miI2CRegisterWriteByte
miI2CRestrictBuffers*
miI2CRegisterWriteBytes
miI2CSetPeripheralAddress
miI2CSlaveGetNumReceivedBytes
miI2CSlaveGetReceivedBytes
miI2CSlaveInitialise
miI2CSlaveSetAutoReadRegister*
miI2CSlaveTransmitBytes
miI2CStart
miI2CStop
miI2CTransmitByte

I2C Types

Integrity Checking

miPerformIntegrityCheck

Printing

sprintf

Serial IO

miSerialIOFlushReceiveBuffer
miSerialIOGetNumReceivedBytes
miSerialIOGetReceiveBufferState
miSerialIOGetReceivedBytes
miSerialIOInitialise
miSerialIORestrictBuffers*
miSerialIOSetActivePort
miSerialIOTransmitBytes

SPI

miSPIInitialise
miSPIRestrictBuffers*
miSPISetSlave
miSPITransmitReceive

Timers

miDelay
miDelayJitter
miTimerCreate
miTimerExpired
miTimerFree
miTimerPause
miTimerRead
miTimerResume
miTimerStart
miWatchdogInitialise
miWatchdogRefresh

Version

miGetLibraryVersion

* These functions are not supported by the M5-P19 used in some early versions of the Trust Anchor dev. kit.

 

Standard MULTOS C-API

This is a cutdown version of the standard MULTOS C-API including the functionality most needed for the Trust Anchor product. The full C-API documentation is here

Include file: <multos.h> | Linker switch: None (included by default)

Arithmetic and Logic

multosAdd
multosAnd
multosBCDtoBIN
multosBINtoBCD
multosCheckBCD*
multosDecrement
multosDivide
multosIncrement
multosInvert
multosMultiply
multosOr
multosRotateLeft
multosRotateRight
multosShiftLeft
multosShiftRight
multosSubtract
multosSubtractBCD
multosTestZero
multosXor

Program Flow

multosCallCodelet
multosCallExtensionPrimitive
multosCheckCase
multosDelegate
multosExit
multosExitLa
multosExitSW
multosExitSWLa
multosGetDelegatorAID
multosGetProcessEvent
multosRejectProcessEvent
multosRestoreStack*
multosReturnFromCodelet
multosSaveStack*

System

multosCardBlock
multosCardUnBlock
multosGetAID*
multosGetConfigData*
multosGetData
multosGetDIRFile
multosGetFCI
multosGetFCIState*
multosGetManufacturerData
multosGetMultosData
multosQueryCodelet
multosQueryCryptographicAlgorithm
multosQueryPrimitive

Cryptography

multosChecksum
multosDecipherCBC
multosDecipherECB
multosEccGenerateKeyPair
multosECDH
multosECDSA
multosECDSAVerify
multosEncipherCBC
multosEncipherECB
multosGenerateDESCBCSignature
multosGenerateMAC*
multosGenerateRsaKeyPair
multosGenerateTripleDESCBCSignature
multosGetRandomNumber
multosModularExponentiation
multosModularExponentiationCRT
multosPad
multosPlatformOptimisedChecksum
multosRsaVerify
multosSecureHash
multosSecureHashIV
multosSHA1
multosUnPad

Memory

multosClear
multosCompare
multosCompareEnhanced*
multosCopy
multosCopyFixedLength
multosCopyFromAdditionalStatic
multosCopySessionFromReplacedApp*
multosCopyStaticFromReplacedApp*
multosCopyToAdditionalStatic
multosCopyWithinAdditionalStatic
multosFillAdditionalStatic
multosGetReplacedAppState*
multosGetSessionSize*
multosGetStaticSize
multosGetTransactionState*
multosIndex
multosLookup
multosLookupWord
multosResetSessionData
multosSetProtectedMemoryAccess
multosSetTransactionProtection
multosUpdateSessionSize*
multosUpdateStaticSize

PIN Management

multosGetPINStatus
multosGetPINTryCounter
multosGetPINTryLimit
multosInitialisePIN
multosInitialisePINExtended*
multosGetPINVerificationStatus*
multosReadPIN
multosSetPINTryCounter
multosSetPINTryLimit
multosSetPINVerificationStatus*
multosVerifyPIN

* These functions are not supported by the M5-P19 used in some early versions of the Trust Anchor dev. kit.

 

C Language Support

<ctype.h>

isalpha

isupper

islower

isdigit

isspace

ispunct

isalnum

isprint

isgraph

iscntrl

<stdio.h>

printf**

<stdlib.h>

abs

div

labs

ldiv

calloc*

malloc*

realloc*

free*

itoa

ltoa

ultoa

 

<heap.h>

heap_init

heap_used

<string.h>

memcpy

memmove

memcmp

memchr

memset***

 

strcpy

strncpy

strcat

strncat

strcmp

strncmp

strchr

strcspn

strpbrk

strrchr

strspn

strstr

strlen

Notes:

* There is no heap as such in MULTOS as applications have to define their memory usage during the loading process. However it is possible to pre-allocate an area of memory as heap using the functions in <heap.h> allowing malloc etc. to be used.

** printf will output to console when using the simulator or to the default serial port when running in the chip.

*** It is much faster to use multosClear than memset to set a block of memory to zero.