AN370
Rev. 1.0
11
4.4. Stack Size Requirements
Table 1 shows the additional stack requirements when the user code is calling an API function. The number of
bytes in the table is in addition to the 2 bytes return address storage requirements for the return address to be
stored on top of the stack when the function is called. For example, if the function is not using any additional stack
storage (not calling any other function, and not using PUSH/POP instructions), then the function internal stack
requirement is listed as 0.
The maximum stack size requirement is determined by the interrupt service routines and if the application is using
one or two interrupt priorities. The worst case stack requirement would come from the application using two levels
of interrupt levels and lower priority ISR was interrupted by the higher priority ISR.
The user is required to leave at least additional 4 bytes of stack space, 2 bytes as a guard and 2 bytes for possible
Silicon Labs use in the future.
Table 1. Additional Stack Requirements
Function
Internal stack use
[bytes]
vAes_Cipher
3
vAes_InvCipher
3
vAes_InvGenKey
3
wBsr_Pop
—
vBsr_Setup
4
vBsr_InitPts
2
bBsr_GetPtsItemCnt
—
vBsr_Service
4
wBsr_GetCurrentButton
—
bBsr_GetTimestamp
2
vDmdTs_Setup
—
iDmdTs_GetData
—
iDmdTs_GetLatestDmdSample
—
iDmdTs_GetLatestTemp
2
vDmdTs_ClearDmd
—
vDmdTs_ClearDmdIntFlag
—
vDmdTs_IsrCall
2
bDmdTs_GetSamplesTaken
—
vDmdTs_Enable
—
vDmdTs_RunForTemp
2
vDmdTs_ResetCounts
—
bEnc_4b5bEncode
—
vEnc_Set4b5bLastBit
—
bEnc_ManchesterEncode
—
vFCast_Setup
—
vFCast_XoSetup
4
vFCast_Tune
8
vFCast_FskAdj
4
vFCast_FineTune
4
vFc_Setup
—
vFc_StartCount
—
vFc_PollDone
—
lFc_StartPollGetCount
2
lFc_GetCount
—