00001
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef __dbutton_h__
00030 #define __dbutton_h__
00031
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035
00037
00038
00039
00041
00042 #define BUTTON_ONOFF 0x0002
00043 #define BUTTON_RUN 0x0004
00044 #define BUTTON_VIEW 0x4000
00045 #define BUTTON_PROGRAM 0x8000
00046
00047
00048
00049
00051
00052 #define RELEASED(state,button) ((state) & (button))
00053
00055
00056 #define PRESSED(state,button) (!RELEASED(state,button))
00057
00059
00060
00061
00063
00065
00067 extern inline int dbutton(void)
00068 {
00069 int rv;
00070 __asm__ __volatile__("\n\
00071 mov.b @_PORT4,%0l\n\
00072 mov.b @_PORT7,%0h\n\
00073 " :"=r"(rv)
00074 :
00075 :"cc"
00076 );
00077
00078 return rv;
00079 }
00080
00081 #ifdef __cplusplus
00082 }
00083 #endif
00084
00085 #endif // __dbutton_h__