1 #ifndef LIBPICOFE_PLAT_H
2 #define LIBPICOFE_PLAT_H
8 /* target device, everything is optional */
10 int (*cpu_clock_get)(void);
11 int (*cpu_clock_set)(int clock);
12 int (*get_bat_capacity)(void);
13 void (*set_filter)(int which);
15 void (*set_lcdrate)(int is_pal);
16 void (*step_volume)(int is_up);
19 extern struct plat_target plat_target;
20 int plat_target_init(void);
21 void plat_target_finish(void);
22 void plat_target_setup_input(void);
24 static __inline void plat_target_set_filter(int which)
26 if (plat_target.set_filter)
27 plat_target.set_filter(which);
30 static __inline void plat_target_set_lcdrate(int is_pal)
32 if (plat_target.set_lcdrate)
33 plat_target.set_lcdrate(is_pal);
36 /* menu: enter (switch bpp, etc), begin/end drawing */
37 void plat_video_menu_enter(int is_rom_loaded);
38 void plat_video_menu_begin(void);
39 void plat_video_menu_end(void);
40 void plat_video_menu_leave(void);
42 void plat_video_flip(void);
43 void plat_video_wait_vsync(void);
45 /* return the dir/ where configs, saves, bios, etc. are found */
46 int plat_get_root_dir(char *dst, int len);
48 int plat_is_dir(const char *path);
49 int plat_wait_event(int *fds_hnds, int count, int timeout_ms);
50 void plat_sleep_ms(int ms);
52 void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed);
53 void *plat_mremap(void *ptr, size_t oldsize, size_t newsize);
54 void plat_munmap(void *ptr, size_t size);
56 /* timers, to be used for time diff and must refer to the same clock */
57 unsigned int plat_get_ticks_ms(void);
58 unsigned int plat_get_ticks_us(void);
59 void plat_wait_till_us(unsigned int us);
61 void plat_debug_cat(char *str);
67 #endif /* LIBPICOFE_PLAT_H */