sh7045lib.h

00001 #ifndef SH_7045_LIB_H
00002 #define SH_7045_LIB_H
00003 
00004 /*
00005   SH7045Fの制御ライブラリ
00006   Satofumi KAMIMURA
00007   $Id$
00008 */
00009 
00010 #include "sci_init.h"
00011 
00012 
00013 typedef void (*timerHandler_t)(void);
00014 
00015 enum {
00016   // SCI
00017 #ifndef SCI_BUFFER_SIZE_SHIFT
00018   SCI_BUFFER_SIZE_SHIFT = 9,
00019 #endif
00020   SCI_BUFFER_SIZE = 1 << SCI_BUFFER_SIZE_SHIFT,
00021   SCI_0 = 0,
00022   SCI_1 = 1,
00023 
00024 #ifndef TIMER_HANDLER_MAX
00025   TIMER_HANDLER_MAX = 16,
00026 #endif
00027 };
00028 
00029 
00030 //#include "cpp_extern_macro.h"
00031 BEGIN_C_DECLS;
00032 
00033 extern void set_imask(int mask);
00034 extern int get_imask(void);
00035 
00036 extern void init_sci(int port, int level);
00037 extern void stop_sci(int port);
00038 extern int sci_sending(int port);
00039 extern int putstr(int port, const unsigned char *data);
00040 extern int puthex(int port, unsigned long num, int hexwidth);
00041 extern int putnum(int port, int num);
00042 extern int sci_read(int port, unsigned char *data, int size);
00043 extern int sci_copy(int port, unsigned char *data, int size);
00044 extern int get_sciReadable(int port);
00045 extern void flush_sciRecv(int port);
00046 
00047 extern void init_timer(int level);
00048 extern int set_timerHandler(timerHandler_t callback, int interval_usec);
00049 extern void unset_timerHandler(timerHandler_t callback);
00050 extern int start_timer(int usec);
00051 extern void stop_timer(void);
00052 extern void getRawCount(unsigned short *cnt);
00053 extern void getTimestamp(unsigned long *msec, unsigned short *usec);
00054 
00055 END_C_DECLS;
00056 #endif /* !SH_7045_LIB_H */
00057 

Generated on Mon Apr 13 22:52:04 2009 by  doxygen 1.5.7.1