blob: ae0c6341637f382e78d19fde1a87e20bb9e2c3c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Hardware timer driver API */
#ifndef __CROS_EC_HWTIMER_H
#define __CROS_EC_HWTIMER_H
/**
* Programs when the next timer should fire an interrupt.
* deadline: timestamp of the event.
*/
void __hw_clock_event_set(uint32_t deadline);
/* Returns the timestamp of the next programed event */
uint32_t __hw_clock_event_get(void);
/* Cancel the next event programed by __hw_clock_event_set */
void __hw_clock_event_clear(void);
/* Returns the value of the free-running counter used as clock. */
uint32_t __hw_clock_source_read(void);
/**
* Initializes the hardware timer used to provide clock services.
*
* It returns the IRQ number of the timer routine.
*/
int __hw_clock_source_init(void);
/**
* Searches the next deadline and program it in the timer hardware.
*
* overflow: if true, the 32-bit counter as overflowed since the last call.
*
* This function is exported from the common timers code as an helper for the
* hardware timer interrupt routine.
*/
void process_timers(int overflow);
#endif /* __CROS_EC_HWTIMER_H */
|