Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
freemaster_private.h File Reference

FreeMASTER driver private declarations, used internally by the driver. More...

#include "freemaster_cfg.h"
#include "freemaster_Kxx.h"

Go to the source code of this file.

Macros

#define NULL
 
#define FMSTR_TRUE
 
#define FMSTR_FALSE
 
#define FMSTR_CAN_EXTID
 
#define FMSTR_INLINE
 
#define FMSTR_MACROCODE_BEGIN()
 
#define FMSTR_MACROCODE_END()
 
#define FMSTR_UNUSED(sym)
 
#define FMSTR_LONG_INTR
 
#define FMSTR_SHORT_INTR
 
#define FMSTR_POLL_DRIVEN
 
#define FMSTR_USE_JTAG
 
#define FMSTR_USE_MSCAN
 
#define FMSTR_USE_FLEXCAN
 
#define FMSTR_USE_CAN
 
#define FMSTR_USE_MQX_IO
 
#define FMSTR_USE_SCI
 
#define FMSTR_USE_READMEM
 
#define FMSTR_USE_WRITEMEM
 
#define FMSTR_USE_WRITEMEMMASK
 
#define FMSTR_USE_READVAR
 
#define FMSTR_USE_WRITEVAR
 
#define FMSTR_USE_WRITEVARMASK
 
#define FMSTR_USE_SCOPE
 
#define FMSTR_MAX_SCOPE_VARS
 
#define FMSTR_USE_RECORDER
 
#define FMSTR_MAX_REC_VARS
 
#define FMSTR_REC_FARBUFF
 
#define FMSTR_REC_OWNBUFF
 
#define FMSTR_USE_FASTREC
 
#define FMSTR_LIGHT_VERSION
 
#define FMSTR_REC_COMMON_ERR_CODES
 
#define FMSTR_SCI_TWOWIRE_ONLY
 
#define FMSTR_REC_STATIC_POSTTRIG
 
#define FMSTR_REC_STATIC_DIVISOR
 
#define FMSTR_USE_APPCMD
 
#define FMSTR_APPCMD_BUFF_SIZE
 
#define FMSTR_MAX_APPCMD_CALLS
 
#define FMSTR_USE_TSA
 
#define FMSTR_USE_TSA_SAFETY
 
#define FMSTR_USE_SFIO
 
#define FMSTR_USE_PIPES
 
#define FMSTR_USE_PIPE_PRINTF
 
#define FMSTR_USE_PIPE_PRINTF_VARG
 
#define FMSTR_USE_BRIEFINFO
 
#define FMSTR_COMM_BUFFER_SIZE
 
#define FMSTR_COMM_BUFFER_SIZE
 

Functions

void FMSTR_InitSerial (void)
 
FMSTR_BOOL FMSTR_InitMQX (void)
 
void FMSTR_SendResponse (FMSTR_BPTR pMessageIO, FMSTR_SIZE8 nLength)
 
void FMSTR_ProcessSCI (void)
 
void FMSTR_ProcessJTAG (void)
 
FMSTR_BOOL FMSTR_ProtocolDecoder (FMSTR_BPTR pMessageIO)
 Decodes the FreeMASTER protocol and calls appropriate handlers. More...
 
FMSTR_BPTR FMSTR_GetBoardInfo (FMSTR_BPTR pMessageIO)
 Handling GETINFO or GETINFO_BRIEF. More...
 
FMSTR_BPTR FMSTR_ReadMem (FMSTR_BPTR pMessageIO)
 Handling READMEM and READMEM_EX commands. More...
 
FMSTR_BPTR FMSTR_ReadVar (FMSTR_BPTR pMessageIO, FMSTR_SIZE8 nSize)
 Handling READVAR and READVAR_EX commands (for all sizes 1,2,4) More...
 
FMSTR_BPTR FMSTR_WriteMem (FMSTR_BPTR pMessageIO)
 Handling WRITEMEM and WRITEMEM_EX commands. More...
 
FMSTR_BPTR FMSTR_WriteVar (FMSTR_BPTR pMessageIO, FMSTR_SIZE8 nSize)
 Handling WRITEVAR command. More...
 
FMSTR_BPTR FMSTR_WriteVarMask (FMSTR_BPTR pMessageIO, FMSTR_SIZE8 nSize)
 Handling WRITEVARMASK command. More...
 
FMSTR_BPTR FMSTR_WriteMemMask (FMSTR_BPTR pMessageIO)
 Handling WRITEMEMMASK and WRITEMEMMASK_EX commands. More...
 
void FMSTR_InitAppCmds (void)
 
FMSTR_BPTR FMSTR_StoreAppCmd (FMSTR_BPTR pMessageIO)
 
FMSTR_BPTR FMSTR_GetAppCmdStatus (FMSTR_BPTR pMessageIO)
 
FMSTR_BPTR FMSTR_GetAppCmdRespData (FMSTR_BPTR pMessageIO)
 
void FMSTR_InitScope (void)
 
FMSTR_BPTR FMSTR_SetUpScope (FMSTR_BPTR pMessageIO)
 
FMSTR_BPTR FMSTR_ReadScope (FMSTR_BPTR pMessageIO)
 
void FMSTR_InitRec (void)
 
FMSTR_BPTR FMSTR_SetUpRec (FMSTR_BPTR pMessageIO)
 
FMSTR_BPTR FMSTR_StartRec (FMSTR_BPTR pMessageIO)
 
FMSTR_BPTR FMSTR_StopRec (FMSTR_BPTR pMessageIO)
 
FMSTR_BPTR FMSTR_GetRecStatus (FMSTR_BPTR pMessageIO)
 
FMSTR_BPTR FMSTR_GetRecBuff (FMSTR_BPTR pMessageIO)
 
FMSTR_BOOL FMSTR_IsInRecBuffer (FMSTR_ADDR nAddr, FMSTR_SIZE8 nSize)
 
FMSTR_SIZE FMSTR_GetRecBuffSize (void)
 
void FMSTR_InitTsa (void)
 
FMSTR_BPTR FMSTR_GetTsaInfo (FMSTR_BPTR pMessageIO)
 
FMSTR_BPTR FMSTR_GetStringLen (FMSTR_BPTR pMessageIO)
 
FMSTR_BOOL FMSTR_CheckTsaSpace (FMSTR_ADDR nAddr, FMSTR_SIZE8 nSize, FMSTR_BOOL bWriteAccess)
 
FMSTR_U16 FMSTR_StrLen (FMSTR_ADDR nAddr)
 Private inline implementation of "strlen" used by TSA and Pipes. More...
 
void FMSTR_InitSfio (void)
 
FMSTR_BPTR FMSTR_SfioFrame (FMSTR_BPTR pMessageIO)
 
FMSTR_BPTR FMSTR_SfioGetResp (FMSTR_BPTR pMessageIO)
 
void FMSTR_InitPipes (void)
 
FMSTR_BPTR FMSTR_PipeFrame (FMSTR_BPTR pMessageIO)
 
void FMSTR_InitCan (void)
 
void FMSTR_SetCanCmdID (FMSTR_U32 canID)
 
void FMSTR_SetCanRespID (FMSTR_U32 canID)
 
FMSTR_BOOL FMSTR_TxCan (void)
 
FMSTR_BOOL FMSTR_RxCan (void)
 
void FMSTR_ProcessCanRx (void)
 
void FMSTR_ProcessCanTx (void)
 

Detailed Description

Version
1.0.1.0
Date
May-4-2012

Macro Definition Documentation

#define FMSTR_APPCMD_BUFF_SIZE
#define FMSTR_CAN_EXTID
#define FMSTR_COMM_BUFFER_SIZE
#define FMSTR_COMM_BUFFER_SIZE
#define FMSTR_FALSE
#define FMSTR_INLINE
#define FMSTR_LIGHT_VERSION
#define FMSTR_LONG_INTR
#define FMSTR_MACROCODE_BEGIN ( )
#define FMSTR_MACROCODE_END ( )
#define FMSTR_MAX_APPCMD_CALLS
#define FMSTR_MAX_REC_VARS
#define FMSTR_MAX_SCOPE_VARS
#define FMSTR_POLL_DRIVEN
#define FMSTR_REC_COMMON_ERR_CODES
#define FMSTR_REC_FARBUFF
#define FMSTR_REC_OWNBUFF
#define FMSTR_REC_STATIC_DIVISOR
#define FMSTR_REC_STATIC_POSTTRIG
#define FMSTR_SCI_TWOWIRE_ONLY
#define FMSTR_SHORT_INTR
#define FMSTR_TRUE
#define FMSTR_UNUSED (   sym)
#define FMSTR_USE_APPCMD
#define FMSTR_USE_BRIEFINFO
#define FMSTR_USE_CAN
#define FMSTR_USE_FASTREC
#define FMSTR_USE_FLEXCAN
#define FMSTR_USE_JTAG
#define FMSTR_USE_MQX_IO
#define FMSTR_USE_MSCAN
#define FMSTR_USE_PIPE_PRINTF
#define FMSTR_USE_PIPE_PRINTF_VARG
#define FMSTR_USE_PIPES
#define FMSTR_USE_READMEM
#define FMSTR_USE_READVAR
#define FMSTR_USE_RECORDER
#define FMSTR_USE_SCI
#define FMSTR_USE_SCOPE
#define FMSTR_USE_SFIO
#define FMSTR_USE_TSA
#define FMSTR_USE_TSA_SAFETY
#define FMSTR_USE_WRITEMEM
#define FMSTR_USE_WRITEMEMMASK
#define FMSTR_USE_WRITEVAR
#define FMSTR_USE_WRITEVARMASK
#define NULL

Function Documentation

FMSTR_BOOL FMSTR_CheckTsaSpace ( FMSTR_ADDR  nAddr,
FMSTR_SIZE8  nSize,
FMSTR_BOOL  bWriteAccess 
)
FMSTR_BPTR FMSTR_GetAppCmdRespData ( FMSTR_BPTR  pMessageIO)
FMSTR_BPTR FMSTR_GetAppCmdStatus ( FMSTR_BPTR  pMessageIO)
FMSTR_BPTR FMSTR_GetBoardInfo ( FMSTR_BPTR  pMessageIO)
Parameters
pMessageIO- original command (in) and response buffer (out)
Returns
As all command handlers, the return value should be the buffer pointer where the response output finished (except checksum)
FMSTR_BPTR FMSTR_GetRecBuff ( FMSTR_BPTR  pMessageIO)
FMSTR_SIZE FMSTR_GetRecBuffSize ( void  )
FMSTR_BPTR FMSTR_GetRecStatus ( FMSTR_BPTR  pMessageIO)
FMSTR_BPTR FMSTR_GetStringLen ( FMSTR_BPTR  pMessageIO)
FMSTR_BPTR FMSTR_GetTsaInfo ( FMSTR_BPTR  pMessageIO)
void FMSTR_InitAppCmds ( void  )
void FMSTR_InitCan ( void  )
FMSTR_BOOL FMSTR_InitMQX ( void  )
void FMSTR_InitPipes ( void  )
void FMSTR_InitRec ( void  )
void FMSTR_InitScope ( void  )
void FMSTR_InitSerial ( void  )
void FMSTR_InitSfio ( void  )
void FMSTR_InitTsa ( void  )
FMSTR_BOOL FMSTR_IsInRecBuffer ( FMSTR_ADDR  nAddr,
FMSTR_SIZE8  nSize 
)
FMSTR_BPTR FMSTR_PipeFrame ( FMSTR_BPTR  pMessageIO)
void FMSTR_ProcessCanRx ( void  )
void FMSTR_ProcessCanTx ( void  )
void FMSTR_ProcessJTAG ( void  )
void FMSTR_ProcessSCI ( void  )
FMSTR_BOOL FMSTR_ProtocolDecoder ( FMSTR_BPTR  pMessageIO)
Parameters
pMessageIO- message in/out buffer
Returns
TRUE if frame was valid and any output was generated to IO buffer

This Function decodes given message and invokes proper command handler which fills in the response. The response transmission is initiated in this call as well.

FMSTR_BPTR FMSTR_ReadMem ( FMSTR_BPTR  pMessageIO)
Parameters
pMessageIO- original command (in) and response buffer (out)
Returns
As all command handlers, the return value should be the buffer pointer where the response output finished (except checksum)
FMSTR_BPTR FMSTR_ReadScope ( FMSTR_BPTR  pMessageIO)
FMSTR_BPTR FMSTR_ReadVar ( FMSTR_BPTR  pMessageIO,
FMSTR_SIZE8  nSize 
)
Parameters
pMessageIO- original command (in) and response buffer (out)
Returns
As all command handlers, the return value should be the buffer pointer where the response output finished (except checksum)
FMSTR_BOOL FMSTR_RxCan ( void  )
void FMSTR_SendResponse ( FMSTR_BPTR  pMessageIO,
FMSTR_SIZE8  nLength 
)
void FMSTR_SetCanCmdID ( FMSTR_U32  canID)
void FMSTR_SetCanRespID ( FMSTR_U32  canID)
FMSTR_BPTR FMSTR_SetUpRec ( FMSTR_BPTR  pMessageIO)
FMSTR_BPTR FMSTR_SetUpScope ( FMSTR_BPTR  pMessageIO)
FMSTR_BPTR FMSTR_SfioFrame ( FMSTR_BPTR  pMessageIO)
FMSTR_BPTR FMSTR_SfioGetResp ( FMSTR_BPTR  pMessageIO)
FMSTR_BPTR FMSTR_StartRec ( FMSTR_BPTR  pMessageIO)
FMSTR_BPTR FMSTR_StopRec ( FMSTR_BPTR  pMessageIO)
FMSTR_BPTR FMSTR_StoreAppCmd ( FMSTR_BPTR  pMessageIO)
FMSTR_U16 FMSTR_StrLen ( FMSTR_ADDR  nAddr)
FMSTR_BOOL FMSTR_TxCan ( void  )
FMSTR_BPTR FMSTR_WriteMem ( FMSTR_BPTR  pMessageIO)
Parameters
pMessageIO- original command (in) and response buffer (out)
Returns
As all command handlers, the return value should be the buffer pointer where the response output finished (except checksum)
FMSTR_BPTR FMSTR_WriteMemMask ( FMSTR_BPTR  pMessageIO)
Parameters
pMessageIO- original command (in) and response buffer (out)
Returns
As all command handlers, the return value should be the buffer pointer where the response output finished (except checksum)
FMSTR_BPTR FMSTR_WriteVar ( FMSTR_BPTR  pMessageIO,
FMSTR_SIZE8  nSize 
)
Parameters
pMessageIO- original command (in) and response buffer (out)
nSize- variable size
Returns
As all command handlers, the return value should be the buffer pointer where the response output finished (except checksum)
FMSTR_BPTR FMSTR_WriteVarMask ( FMSTR_BPTR  pMessageIO,
FMSTR_SIZE8  nSize 
)
Parameters
pMessageIO- original command (in) and response buffer (out)
nSize- variable size
Returns
As all command handlers, the return value should be the buffer pointer where the response output finished (except checksum)