Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: FreeMASTER_HelloWorld FreeMASTER_HelloWorld2 FreeMASTER_HelloWorld3
Fork of freemaster_lib by
Diff: freemaster_tsa.h
- Revision:
- 15:24a63ac82fc3
- Parent:
- 11:d1de61dc3766
- Child:
- 16:be9b137b888c
--- a/freemaster_tsa.h Wed Sep 10 11:58:55 2014 +0000
+++ b/freemaster_tsa.h Wed Sep 10 12:27:44 2014 +0000
@@ -90,22 +90,69 @@
} FMSTR_TSA_ENTRY;
#endif
+/*****************************************************************************
+* TSA table definition
+*
+*//*! @addtogroup fmstr_tsa_table
+* @{
+*******************************************************************************/
+
/* list of available types for TSA table definition */
+/*****************************************************************************
+*//*!
+* @brief Register name of structure
+* @param name Name of the structure.
+******************************************************************************/
#define FMSTR_TSA_STRUCT_CFG(name) \
FMSTR_TSATBL_STRPTR_ENTRY(#name), FMSTR_TSATBL_STRPTR_ENTRY(NULL), FMSTR_TSATBL_VOIDPTR_ENTRY(NULL), FMSTR_TSA_INFO1(name, FMSTR_TSA_INFO_STRUCT)
+/*****************************************************************************
+*//*!
+* @brief Register member of structure
+* @param parenttype Name of the structure.
+* @param name Name of member in structure.
+* @param type Type of member in strucutre. @ref fmstr_tsa_types "FMSTR_TSA_xxx" constants.
+******************************************************************************/
#define FMSTR_TSA_MEMBER_CFG(parenttype,name,type) \
FMSTR_TSATBL_STRPTR_ENTRY(#name), FMSTR_TSATBL_STRPTR_ENTRY(type), FMSTR_TSATBL_VOIDPTR_ENTRY(&((parenttype*)0)->name), FMSTR_TSA_INFO1(((parenttype*)0)->name, FMSTR_TSA_INFO_MEMBER)
+/*****************************************************************************
+*//*!
+* @brief Register variable
+* @param name Name of variable.
+* @param type Type of member in strucutre. @ref fmstr_tsa_types "FMSTR_TSA_xxx" constants.
+******************************************************************************/
#define FMSTR_TSA_RO_VAR_CFG(name,type) \
FMSTR_TSATBL_STRPTR_ENTRY(#name), FMSTR_TSATBL_STRPTR_ENTRY(type), FMSTR_TSATBL_VOIDPTR_ENTRY(&(name)), FMSTR_TSA_INFO1(name, FMSTR_TSA_INFO_RO_VAR)
+/*****************************************************************************
+*//*!
+* @brief Register variable
+* @param name Name of variable.
+* @param type Type of member in strucutre. @ref fmstr_tsa_types "FMSTR_TSA_xxx" constants.
+******************************************************************************/
#define FMSTR_TSA_RW_VAR_CFG(name,type) \
FMSTR_TSATBL_STRPTR_ENTRY(#name), FMSTR_TSATBL_STRPTR_ENTRY(type), FMSTR_TSATBL_VOIDPTR_ENTRY(&(name)), FMSTR_TSA_INFO1(name, FMSTR_TSA_INFO_RW_VAR)
+/*****************************************************************************
+*//*!
+* @brief Register variable
+* @param name Name of variable.
+* @param type Type of member in strucutre. @ref fmstr_tsa_types "FMSTR_TSA_xxx" constants.
+* @param addr Address of variable.
+* @param size Size of variable.
+******************************************************************************/
#define FMSTR_TSA_RO_MEM_CFG(name,type,addr,size) \
FMSTR_TSATBL_STRPTR_ENTRY(#name), FMSTR_TSATBL_STRPTR_ENTRY(type), FMSTR_TSATBL_VOIDPTR_ENTRY(addr), FMSTR_TSA_INFO2(size, FMSTR_TSA_INFO_RO_VAR)
+/*****************************************************************************
+*//*!
+* @brief Register variable
+* @param name Name of variable.
+* @param type Type of member in strucutre. @ref fmstr_tsa_types "FMSTR_TSA_xxx" constants.
+* @param addr Address of variable.
+* @param size Size of variable.
+******************************************************************************/
#define FMSTR_TSA_RW_MEM_CFG(name,type,addr,size) \
FMSTR_TSATBL_STRPTR_ENTRY(#name), FMSTR_TSATBL_STRPTR_ENTRY(type), FMSTR_TSATBL_VOIDPTR_ENTRY(addr), FMSTR_TSA_INFO2(size, FMSTR_TSA_INFO_RW_VAR)
@@ -113,9 +160,15 @@
/*//////////////////////////////////////////////// */
/* single table-building macros */
+
#define FMSTR_TSA_FUNC(id) FMSTR_TsaGetTable_##id
#define FMSTR_TSA_FUNC_PROTO(id) const FMSTR_TSA_ENTRY* FMSTR_TSA_FUNC(id) (FMSTR_TSA_TSIZE* pTableSize)
-
+/*****************************************************************************
+*//*!
+* @brief Begins of the TSA table
+* @details This macro is used to begin the TSA table with unique ID.
+* @param id Identifier of the TSA table.
+******************************************************************************/
#define FMSTR_TSA_TABLE_BEGIN(id) \
FMSTR_TSA_FUNC_PROTO(id); \
FMSTR_TSA_FUNC_PROTO(id) { \
@@ -125,9 +178,10 @@
#define FMSTR_TSA_INFO1(elem, flags) FMSTR_TSATBL_VOIDPTR_ENTRY(((sizeof(elem))<<2)|(flags))
#define FMSTR_TSA_INFO2(size, flags) FMSTR_TSATBL_VOIDPTR_ENTRY(((size)<<2)|(flags))
+
#define FMSTR_TSA_STRUCT(name) \
{ FMSTR_TSA_STRUCT_CFG(name) },
-
+
#define FMSTR_TSA_MEMBER(parenttype,name,type) \
{ FMSTR_TSA_MEMBER_CFG(parenttype,name,type) },
@@ -147,25 +201,7 @@
if(pTableSize) *pTableSize = sizeof(fmstr_tsatable); \
return fmstr_tsatable; }
-/*///////////////////////////////////////////////////////////////////// */
-/* TSA "Base Types", all are implemented as a one-char strings */
-/* retrieved by PC and parsed according to the binary scheme */
-/* "111STTZZ" where TT=type[int,frac,fp,x] S=signed ZZ=size[1,2,4,8] */
-
-#define FMSTR_TSA_UINT8 "\xE0"
-#define FMSTR_TSA_UINT16 "\xE1"
-#define FMSTR_TSA_UINT32 "\xE2"
-#define FMSTR_TSA_UINT64 "\xE3"
-#define FMSTR_TSA_SINT8 "\xF0"
-#define FMSTR_TSA_SINT16 "\xF1"
-#define FMSTR_TSA_SINT32 "\xF2"
-#define FMSTR_TSA_SINT64 "\xF3"
-#define FMSTR_TSA_UFRAC16 "\xE5"
-#define FMSTR_TSA_UFRAC32 "\xE6"
-#define FMSTR_TSA_FRAC16 "\xF5"
-#define FMSTR_TSA_FRAC32 "\xF6"
-#define FMSTR_TSA_FLOAT "\xFA"
-#define FMSTR_TSA_DOUBLE "\xFB"
+/*! @} End of fmstr_tsa_table */
/* macro used to describe "User Type" */
#define FMSTR_TSA_USERTYPE(type) #type
