📄 dds.h
字号:
/****************************************************************************
Copyright (c) 2000, Infineon Technologies. All rights reserved.
No Warranty
Because the program is licensed free of charge, there is no warranty for
the program, to the extent permitted by applicable law. Except when
otherwise stated in writing the copyright holders and/or other parties
provide the program "as is" without warranty of any kind, either
expressed or implied, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose. The
entire risk as to the quality and performance of the program is with
you. should the program prove defective, you assume the cost of all
necessary servicing, repair or correction.
In no event unless required by applicable law or agreed to in writing
will any copyright holder, or any other party who may modify and/or
redistribute the program as permitted above, be liable to you for
damages, including any general, special, incidental or consequential
damages arising out of the use or inability to use the program
(including but not limited to loss of data or data being rendered
inaccurate or losses sustained by you or third parties or a failure of
the program to operate with any other programs), even if such holder or
other party has been advised of the possibility of such damages.
****************************************************************************
Module: DDS.H
Description: Contains global typedefs, macros and function declarations
of the SMART2000 firmware interface.
***************************************************************************/
// Group=DDS_H
/* ============================= */
/* Global typedef for data */
/* structure DDS_MSG. */
/* ============================= */
/****************************************************************************
Description:
Defines a message structure.
Remarks:
Defines the content of the messages sent from WinEasy to DDS and
vice versa.
***************************************************************************/
typedef struct _msg
{
/* Module ID of destination module.
Defines the destination module to
which the message is sent. */
WORD8 dst;
/* Module ID of source module.
Defines the source module from
which the message is sent. */
WORD8 src;
/* Defines whether the
message is send to slot1 or
slot2. */
WORD8 slotId;
/* Defines the ID of the
message itself. */
WORD16 id;
/* Used from firmware internally. */
WORD16 entity;
/* Defines the number of
data bytes which are transferred
as message parameters. */
WORD16 length;
/* Used from firmware
internally. */
struct _msg* pNext;
/* Used from firmware internally. */
WORD8* pData;
/* Used from firmware internally. */
WORD16 maxLength;
}
DDS_MSG;
/****************************************************************************
Description:
Defines a pointer to structure DDS_MSG.
Remarks:
By passing this pointer the message exchange between DDS and firmware is
done.
***************************************************************************/
typedef DDS_MSG* P_DDS_MSG;
/****************************************************************************
Description:
Defines a function pointer.
Remarks:
Defines a pointer to a function with return value 'void' and one
parameter of type P_DDS_MSG. Using this type, the function pointer of DDS
message entry functions are passed to the firmware.
***************************************************************************/
typedef void (*MSG_ENTRY_FCT) (P_DDS_MSG pMsg);
/* ============================= */
/* Global typedef for */
/* interrupt control. */
/* ============================= */
/****************************************************************************
Description:
Defines the global interrupt state.
Remarks:
Defines the value of the global interrupt disable counter. This enables
the firmware to restore the former interrupt disable state after a global
interrupt disable has been accomplished.
***************************************************************************/
typedef WORD16 INT_STATE;
/****************************************************************************
Description:
Defines a function pointer.
Remarks:
Defines a pointer to a function with return value 'void' and no parameter.
Using this type, the function pointer of DDS interrupt entry functions are
passed to the firmware.
***************************************************************************/
typedef void (*IRQ_FUNCTION) (void);
/* ============================= */
/* Global typedef for data */
/* structure TERMINAL. */
/* ============================= */
/****************************************************************************
Description:
Defines the terminal output types.
Remarks:
Defines a type which has two possible values for the diversion of DDS
printf() outputs. To execute the diversion, these values have to be
assigned to the global variable 'terminal' which is pre-defined in DDS.H.
***************************************************************************/
typedef enum
{
/* All outputs are sent to a
standard terminal on the PC. */
STD_TERMINAL,
/* All outputs are sent to the
DXI interface of WinEasy. */
DXI_TERMINAL
}
TERMINAL;
/* To execute the diversion of
printf() outputs, the values of
enum 'TERMINAL' have to be assigned
to this variable. */
extern TERMINAL terminal;
/* ============================= */
/* Global typedef for data */
/* structure DDS_INFO. */
/* ============================= */
/****************************************************************************
Description:
Defines info structure for DDS.
Remarks:
Enables the DDS to get additional firmware information and gives the
possiblity to access to the firmare main loop.
***************************************************************************/
typedef struct
{
/* Firmware version number
as hex value. */
WORD16 version;
/* Slot number the DDS is
running on (0 for slot1,
1 for slot2) */
WORD16 slotId;
/* Function pointer to a
polling function. This polling
function will be called
periodically within the firmware
main loop. */
void (*fPollFct) (void);
/* Pointer for additional
data transfer. */
void* pUser;
}
DDS_INFO;
/****************************************************************************
Description:
Defines a pointer to structure DDS_INFO.
Remarks:
By passing this pointer information data is sent from firmware to DDS.
***************************************************************************/
typedef DDS_INFO* P_DDS_INFO;
/* ============================= */
/* Global typedef for data */
/* structure BIN_INFO. */
/* ============================= */
/****************************************************************************
Description:
Defines info structure about binary file in the flash.
Remarks:
Enables the DDS to get information about the binary file which was
dowloaded from WinEasy to the flash device.
***************************************************************************/
typedef struct
{
/* Pointer to start address of
binary file. */
WORD8* pBinStart;
/* Length of binary file in bytes. */
WORD32 binLength;
/* Name of binary file ASCII coded. */
char binName[9];
}
BIN_INFO;
/* ============================= */
/* Global declaration for */
/* firmware functions. */
/* ============================= */
/****************************************************************************
Description:
Set the message entry point.
Remarks:
This function is used to hand over the address of the module
message entry function to the firmware. Therefore a pointer to
the message entry function is passed as parameter. Within the
message entry function all available module functions with their
respective message IDs are listed.
Arguments:
fMsgEntryFct - Pointer to message entry function.
src - Module ID the message entry function belongs to.
***************************************************************************/
int DdsSetMsgEntry (MSG_ENTRY_FCT fMsgEntryFct, WORD8 src);
/****************************************************************************
Description:
Message allocation function.
Remarks:
Allocates a message which can be sent afterwards.
Arguments:
length - Length of message to be allocated (in bytes).
Return:
Returns a pointer to the allocated message.
***************************************************************************/
P_DDS_MSG DdsMsgAlloc (WORD16 length);
/****************************************************************************
Description:
Message release function.
Remarks:
Releases an allocated message.
Arguments:
pMsg - Pointer to message to be released
***************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -