1210040Scognet/*-
2210040Scognet * Copyright (c) 2009 Sylvestre Gallon.  All rights reserved.
3210040Scognet *
4210040Scognet * Redistribution and use in source and binary forms, with or without
5210040Scognet * modification, are permitted provided that the following conditions
6210040Scognet * are met:
7210040Scognet * 1. Redistributions of source code must retain the above copyright
8210040Scognet *    notice, this list of conditions and the following disclaimer.
9210040Scognet * 2. Redistributions in binary form must reproduce the above copyright
10210040Scognet *    notice, this list of conditions and the following disclaimer in the
11210040Scognet *    documentation and/or other materials provided with the distribution.
12210040Scognet *
13210040Scognet * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14210040Scognet * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15210040Scognet * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16210040Scognet * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
17210040Scognet * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18210040Scognet * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19210040Scognet * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20210040Scognet * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21210040Scognet * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22210040Scognet * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23210040Scognet * SUCH DAMAGE.
24210040Scognet */
25210040Scognet
26210040Scognet/* $FreeBSD$ */
27210040Scognet
28238370Simp#ifndef ARM_AT91_AT91_PITREG_H
29238370Simp#define ARM_AT91_AT91_PITREG_H
30210040Scognet
31236989Simp#define PIT_MR		0x0
32210040Scognet#define PIT_SR		0x4
33210040Scognet#define PIT_PIVR	0x8
34210040Scognet#define PIT_PIIR	0xc
35210040Scognet
36210040Scognet/* PIT_MR */
37210040Scognet#define PIT_PIV(x)	(x & 0xfffff) /* periodic interval value */
38210040Scognet#define PIT_CNT(x)	((x >>20) & 0xfff) /* periodic interval counter */
39210040Scognet#define PIT_EN		(1 << 24) /* pit enable */
40210040Scognet#define PIT_IEN		(1 << 25) /* pit interrupt enable */
41210040Scognet
42210040Scognet/* PIT_SR */
43210040Scognet#define PIT_PITS_DONE	1 /* interrupt done */
44210040Scognet
45238370Simpvoid at91_pit_delay(int us);
46238370Simp
47238370Simp#endif /* ARM_AT91_AT91_PITREG_H */
48