00001
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef __rom_lcd_h__
00032 #define __rom_lcd_h__
00033
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037
00039
00040
00041
00043
00045
00053 typedef enum {
00054 man_stand = 0x3006,
00055 man_run = 0x3007,
00056
00057 s1_select = 0x3008,
00058 s1_active = 0x3009,
00059
00060 s2_select = 0x300A,
00061 s2_active = 0x300B,
00062
00063 s3_select = 0x300C,
00064 s3_active = 0x300D,
00065
00066 a_select = 0x300E,
00067 a_left = 0x300F,
00068 a_right = 0x3010,
00069
00070 b_select = 0x3011,
00071 b_left = 0x3012,
00072 b_right = 0x3013,
00073
00074 c_select = 0x3014,
00075 c_left = 0x3015,
00076 c_right = 0x3016,
00077
00078 unknown_1 = 0x3017,
00079
00080 circle = 0x3018,
00081
00082 dot = 0x3019,
00083
00084 dot_inv = 0x301A,
00085
00086
00087 battery_x = 0x301B,
00088
00089 ir_half = 0x301C,
00090 ir_full = 0x301D,
00091
00092 everything= 0x3020
00093
00094 } lcd_segment;
00095
00097
00099 typedef enum {
00100 digit = 0x3017,
00101
00102
00103 sign = 0x3001,
00104 unsign = 0x301F
00105
00106 } lcd_number_style;
00107
00109
00110
00111 typedef enum {
00112 digit_comma = 0x0000,
00113
00114
00115 e0 = 0x3002,
00116 e_1 = 0x3003,
00117 e_2 = 0x3004,
00118 e_3 = 0x3005,
00119
00120 } lcd_comma_style;
00121
00123 #define lcd_int(i) lcd_number(i,sign,e0)
00124
00126 #define lcd_unsigned(u) lcd_number(u,unsign,e0)
00127
00129
00131 #define lcd_clock(t) lcd_number(t,unsign,e_2)
00132
00134 #define lcd_digit(d) lcd_number(d,digit,digit_comma)
00135
00137
00138
00139
00141
00147 #ifdef CXX
00148 #define ASMVOLATILE
00149 #else
00150 #define ASMVOLATILE __volatile__
00151 #endif
00152
00154
00156 extern inline void lcd_show(lcd_segment segment)
00157 {
00158 __asm__ ASMVOLATILE(
00159 "push r6\n"
00160 "mov.w %0,r6\n"
00161 "jsr @lcd_show\n"
00162 "pop r6\n"
00163 :
00164 :"r"(segment)
00165 );
00166 }
00167
00169
00171 extern inline void lcd_hide(lcd_segment segment)
00172 {
00173 __asm__ ASMVOLATILE(
00174 "push r6\n"
00175 "mov.w %0,r6\n"
00176 "jsr @lcd_hide\n"
00177 "pop r6\n"
00178 :
00179 :"r"(segment)
00180 );
00181 }
00182
00184
00188 extern void lcd_number(int i, lcd_number_style n, lcd_comma_style c);
00189
00191 extern inline void lcd_clear(void)
00192 {
00193 __asm__ ASMVOLATILE(
00194 "push r6\n"
00195 "jsr @lcd_clear\n"
00196 "pop r6\n"
00197 );
00198 }
00199
00200 #ifdef __cplusplus
00201 }
00202 #endif
00203
00204 #endif // __rom_lcd_h__