トランジスタ技術2011年9月号「mbed30分クッキング」のプログラムです。

Dependencies:   mbed TextLCD SDFileSystem

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers micro.h Source File

micro.h

00001 /*****************************************************************************
00002 * File:         micro.h
00003 * Description:  This header file contains the function prototype to the
00004 *               primary interface function for the XSVF player.
00005 * Usage:        FIRST - PORTS.C
00006 *               Customize the ports.c function implementations to establish
00007 *               the correct protocol for communicating with your JTAG ports
00008 *               (setPort() and readTDOBit()) and tune the waitTime() delay
00009 *               function.  Also, establish access to the XSVF data source
00010 *               in the readByte() function.
00011 *               FINALLY - Call xsvfExecute().
00012 *****************************************************************************/
00013 #ifndef XSVF_MICRO_H
00014 #define XSVF_MICRO_H
00015 
00016 /* Legacy error codes for xsvfExecute from original XSVF player v2.0 */
00017 #define XSVF_LEGACY_SUCCESS 1
00018 #define XSVF_LEGACY_ERROR   0
00019 
00020 /* 4.04 [NEW] Error codes for xsvfExecute. */
00021 /* Must #define XSVF_SUPPORT_ERRORCODES in micro.c to get these codes */
00022 #define XSVF_ERROR_NONE         0
00023 #define XSVF_ERROR_UNKNOWN      1
00024 #define XSVF_ERROR_TDOMISMATCH  2
00025 #define XSVF_ERROR_MAXRETRIES   3   /* TDO mismatch after max retries */
00026 #define XSVF_ERROR_ILLEGALCMD   4
00027 #define XSVF_ERROR_ILLEGALSTATE 5
00028 #define XSVF_ERROR_DATAOVERFLOW 6   /* Data > lenVal MAX_LEN buffer size*/
00029 /* Insert new errors here */
00030 #define XSVF_ERROR_LAST         7
00031 
00032 /*****************************************************************************
00033 * Function:     xsvfExecute
00034 * Description:  Process, interpret, and apply the XSVF commands.
00035 *               See port.c:readByte for source of XSVF data.
00036 * Parameters:   none.
00037 * Returns:      int - For error codes see above.
00038 *****************************************************************************/
00039 int execute_micro(char *filename, void (*cbfunc_progress)(int done, int total), void (*cbfunc_waittime)(int microsec));
00040 
00041 #endif  /* XSVF_MICRO_H */
00042