xref: /netbsd-src/sys/arch/hpcarm/dev/ipaq_atmel.h (revision ce099b40997c43048fb78bd578195f81d2456523)
1 /*	$NetBSD: ipaq_atmel.h,v 1.3 2008/04/28 20:23:21 martin Exp $	*/
2 
3 /*-
4  * Copyright (c) 2001 The NetBSD Foundation, Inc.  All rights reserved.
5  *
6  * This code is derived from software contributed to The NetBSD Foundation
7  * by Ichiro FUKUHARA (ichiro@ichiro.org).
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 /*
32  * Atmel microcontroller (Proxy Controller for StrongARM)
33  */
34 
35 /* Frame character */
36 #define FRAME_SOF		0x02	/* Start of Frame character */
37 #define FRAME_EOF		0x04	/* End of Frame character */
38 #define FRAME_OVERHEAD_SIZE	3	/* FRAME_SOF + (ID+len) + checksum */
39 
40 /* ID */
41 #define ID_VERSION		0x00	/* Get version ID */
42 #define EVENT_BUTTON		0x02	/* Get event of BUTTON */
43 #define EVENT_TS		0x03	/* Get event of Touch Screen */
44 #define READ_EEPROM		0x04	/* Read EEPROM */
45 #define WRITE_EEPROM		0x05	/* Write EEPROM */
46 #define SW_LED			0x08	/* Switch of LED */
47 #define STATUS_BATTERY		0x09	/* Get status of battery */
48 #define READ_IIC		0x0b	/* Read data via IIC protocol */
49 #define WRITE_IIC		0x0c	/* Write data via IIC protocol */
50 #define SET_BACKLIGHT		0x0d	/* Backlight Control command */
51 #define STATUS_EXTP		0xa1	/* Get status of Extension Pack */
52 
53 #define MAX_SENDSIZE		32	/* maximum data size of sendData() */
54 #define MAX_RECVSIZE		16	/* maximum data size of recv data */
55 
56 
57 /*
58  * Battery status
59  */
60 #define BATT_STATUS_HIGH		0x00
61 #define BATT_STATUS_LOW			0x01
62 #define BATT_STATUS_CRITICAL 		0x02
63 #define BATT_STATUS_CHARGING		0x04
64 #define BATT_STATUS_CHARGING_MAIN	0x10
65 #define BATT_STATUS_NOBATT		0x80
66 #define BATT_STATUS_UNKNOWN		0xff
67 
68 /*
69  * AC status
70  */
71 #define AC_STATUS_OFFLINE		0x00
72 #define AC_STATUS_ONLINE		0x01
73 #define AC_STATUS_BACKUP		0x02
74 #define AC_STATUS_UNKNOWN		0xff
75 
76 /*
77  * kind of battery
78  */
79 #define BATT_ALKALINE			0x01
80 #define BATT_NICD			0x02
81 #define BATT_NIMH			0x03
82 #define BATT_LION			0x04
83 #define BATT_LIPOLY			0x05
84 #define BATT_UNKNOWN			0xff
85