Initial cut of the open ath9k htc firmware.
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / target / inc / k2 / clock_api.h
1 #ifndef __CLOCK_API_H__
2 #define __CLOCK_API_H__
3
4 #define TICK_MSEC_RATIO                 1
5 #define TICK_TO_MSEC(tick)              ((tick)/TICK_MSEC_RATIO)
6 #define MSEC_TO_TICK(msec)              ((msec)* TICK_MSEC_RATIO)
7
8 typedef struct date_s {
9         uint16_t miliseconds;
10         uint16_t seconds;
11         uint16_t minutes;
12         uint16_t hours;
13 } A_DATE_T;
14
15 struct clock_api {
16         void (* _clock_init)(A_UINT32 ref_clk);
17         void (* _clockregs_init)(void);
18         A_UINT32 (* _uart_frequency)(void);
19         void (* _delay_us)(int);
20         void (* _wlan_band_set)(int);
21         A_UINT32 (* _refclk_speed_get)(void);
22         A_UINT32 (* _milliseconds)(void);
23         void (* _sysclk_change)(uint32_t sys_clk);
24         A_UINT32 (* _sysclk_get)(void);
25
26         void (* _clock_tick)(void);
27 };
28
29 #endif /* __CLOCK_API_H__ */