1 /******************************************************************************
2 ** File Name: timer_phy.h *
5 ** Copyright: 2010 Spreatrum, Incoporated. All Rights Reserved. *
6 ** Description: This file define the basic hw interfaces of I2C device. *
7 ******************************************************************************
9 ******************************************************************************
11 ** ------------------------------------------------------------------------- *
12 ** DATE NAME DESCRIPTION *
13 ** 08/09/2010 DingJi Create. *
14 ******************************************************************************/
18 /*----------------------------------------------------------------------------*
20 **------------------------------------------------------------------------- */
22 #include "sci_types.h"
24 /**---------------------------------------------------------------------------*
26 **--------------------------------------------------------------------------*/
31 /**---------------------------------------------------------------------------*
33 **---------------------------------------------------------------------------*/
42 TIMER_PHY_MODE_E mode; //work mode
43 uint32 clk_freq; //frequency of timer
44 uint32 load_count; //the count which will be load by timer at first, it depends on clk_freq
45 uint32 irq_op; //enable irq or disable irq
50 TIMER_PHY_MODE_E mode; //work mode
52 uint32 clk_freq; //frequency of timer
53 uint32 max_count; //max load count
54 uint32 max_us; // max load count transfer to max us
55 uint32 cnt_per_timeunit; // how many count for one time unit
57 uint32 current_value; //current count
58 uint32 running_status; //running or stop
59 uint32 irq_status; //irq be enabled or disabled
64 int32 (*init)(uint32 timer_id);
65 int32 (*enable)(uint32 timer_id);
66 int32 (*disable)(uint32 timer_id);
67 int32 (*config)(uint32 timer_id, TIMER_PHY_CONFIG_T *timer_config);
68 int32 (*query)(uint32 timer_id, TIMER_PHY_STATUS_T *timer_status);
69 int32 (*clr_irq)(uint32 timer_id);
70 int32 (*reload)(uint32 timer_id);
71 } TIMER_PHY_OPERATION_T;
73 /**----------------------------------------------------------------------------*
74 ** Symbol Prototype **
75 **----------------------------------------------------------------------------*/
76 extern TIMER_PHY_STATUS_T timer_phy_status[];
78 /**----------------------------------------------------------------------------*
79 ** Function Prototype **
80 **----------------------------------------------------------------------------*/
81 PUBLIC TIMER_PHY_OPERATION_T *timer_get_phy_operation(void);
83 /**----------------------------------------------------------------------------*
85 **----------------------------------------------------------------------------*/
89 /**---------------------------------------------------------------------------*/