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.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * Freescale Semiconductor Inc.
4 * (c) Copyright 2004-2010 Freescale Semiconductor
5 * ALL RIGHTS RESERVED.
6 *
7 ****************************************************************************/
25 #ifndef __FREEMASTER_H
26 #define __FREEMASTER_H
27 
28 /* identify our current platform */
29 #define FMSTR_PLATFORM_KXX 1
30 
31 /* user configuration */
32 #include "freemaster_cfg.h"
33 
34 /*****************************************************************************
35 * Global types
36 ******************************************************************************/
37 
38 typedef unsigned char* FMSTR_ADDR; /* CPU address type (4bytes) */
39 typedef unsigned short FMSTR_SIZE; /* general size type (at least 16 bits) */
40 typedef unsigned char FMSTR_BOOL; /* general boolean type */
41 
42 /* application command-specific types */
43 typedef unsigned char FMSTR_APPCMD_CODE;
44 typedef unsigned char FMSTR_APPCMD_DATA, *FMSTR_APPCMD_PDATA;
45 typedef unsigned char FMSTR_APPCMD_RESULT;
46 
47 /* pointer to application command callback handler */
49 
50 /*****************************************************************************
51 * TSA-related user types and macros
52 ******************************************************************************/
53 
54 #include "freemaster_tsa.h"
55 
56 /*****************************************************************************
57 * Constants
58 ******************************************************************************/
59 
60 /* application command status information */
61 #define FMSTR_APPCMDRESULT_NOCMD 0xff
62 #define FMSTR_APPCMDRESULT_RUNNING 0xfe
63 #define MFSTR_APPCMDRESULT_LASTVALID 0xf7 /* F8-FF are reserved */
64 
65 /* recorder time base declaration helpers */
66 #define FMSTR_REC_BASE_SECONDS(x) ((x) & 0x3fff)
67 #define FMSTR_REC_BASE_MILLISEC(x) (((x) & 0x3fff) | 0x4000)
68 #define FMSTR_REC_BASE_MICROSEC(x) (((x) & 0x3fff) | 0x8000)
69 #define FMSTR_REC_BASE_NANOSEC(x) (((x) & 0x3fff) | 0xc000)
70 
71 /*****************************************************************************
72 * Global functions
73 ******************************************************************************/
74 
75 /* FreeMASTER serial communication API */
76 FMSTR_BOOL FMSTR_Init(void); /* general initiazlation */
77 void FMSTR_Poll(void); /* polling call, use in SHORT_INTR and POLL_DRIVEN modes */
78 
79 void FMSTR_Isr(void); /* interrupt handler for LONG_INTR and SHORT_INTR modes */
80 void FMSTR_Isr2(void); /* the second interrupt handler (when RX,TX vecotrs separate) */
81 
82 /* Recorder API */
83 void FMSTR_Recorder(void);
84 void FMSTR_TriggerRec(void);
85 void FMSTR_SetUpRecBuff(FMSTR_ADDR nBuffAddr, FMSTR_SIZE nBuffSize);
86 
87 /* Application commands API */
91 
92 void FMSTR_AppCmdAck(FMSTR_APPCMD_RESULT nResultCode);
93 void FMSTR_AppCmdSetResponseData(FMSTR_ADDR nResultDataAddr, FMSTR_SIZE nResultDataLen);
94 
95 #endif /* __FREEMASTER_H */
96 
unsigned char FMSTR_APPCMD_RESULT
Definition: freemaster.h:45
void FMSTR_AppCmdAck(FMSTR_APPCMD_RESULT nResultCode)
Definition: freemaster_appcmd.c:421
unsigned char FMSTR_BOOL
Definition: freemaster.h:40
unsigned short FMSTR_SIZE
Definition: freemaster.h:39
unsigned char FMSTR_APPCMD_CODE
Definition: freemaster.h:43
void FMSTR_Isr2(void)
FMSTR_APPCMD_PDATA FMSTR_GetAppCmdData(FMSTR_SIZE *pDataLen)
Definition: freemaster_appcmd.c:437
FMSTR_APPCMD_CODE FMSTR_GetAppCmd(void)
Definition: freemaster_appcmd.c:432
void FMSTR_TriggerRec(void)
Definition: freemaster_rec.c:853
void FMSTR_AppCmdSetResponseData(FMSTR_ADDR nResultDataAddr, FMSTR_SIZE nResultDataLen)
Definition: freemaster_appcmd.c:426
FMSTR_BOOL FMSTR_Init(void)
FreeMASTER driver initialization.
Definition: freemaster_protocol.c:34
void FMSTR_SetUpRecBuff(FMSTR_ADDR nBuffAddr, FMSTR_SIZE nBuffSize)
Definition: freemaster_rec.c:857
FMSTR_BOOL FMSTR_RegisterAppCmdCall(FMSTR_APPCMD_CODE nAppCmdCode, FMSTR_PAPPCMDFUNC pCallbackFunc)
Definition: freemaster_appcmd.c:443
unsigned char * FMSTR_APPCMD_PDATA
Definition: freemaster.h:44
void FMSTR_Isr(void)
Definition: freemaster_Kxx.c:37
unsigned char * FMSTR_ADDR
Definition: freemaster.h:38
void FMSTR_Poll(void)
FreeMASTER Driver TSA feature.
void FMSTR_Recorder(void)
Definition: freemaster_rec.c:849
unsigned char FMSTR_APPCMD_DATA
Definition: freemaster.h:44
FMSTR_APPCMD_RESULT(* FMSTR_PAPPCMDFUNC)(FMSTR_APPCMD_CODE, FMSTR_APPCMD_PDATA, FMSTR_SIZE)
Definition: freemaster.h:48