2 * Copyright Droids Corporation (2010)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Revision : $Id: i2c_commands.h,v 1.9 2009-05-27 20:04:06 zer0 Exp $
22 #ifndef _I2C_COMMANDS_H_
23 #define _I2C_COMMANDS_H_
25 #define I2C_MAINBOARD_ADDR 1
26 #define I2C_IMUBOARD_ADDR 2
33 /* commands that do not need and answer */
36 #define I2C_CMD_GENERIC_LED_CONTROL 0x00
38 struct i2c_cmd_led_control {
39 struct i2c_cmd_hdr hdr;
45 /* requests and their answers */
49 #define I2C_REQ_IMUBOARD_STATUS 0x80
51 struct i2c_req_imuboard_status {
52 struct i2c_cmd_hdr hdr;
53 /* add data in request if any */
56 #define I2C_ANS_IMUBOARD_STATUS 0x81
58 struct i2c_ans_imuboard_status {
59 struct i2c_cmd_hdr hdr;
61 #define I2C_IMUBOARD_STATUS_BOOT_OK 0x01
62 #define I2C_IMUBOARD_STATUS_SDCARD_OK 0x02
63 #define I2C_IMUBOARD_STATUS_GPS_OK 0x04
64 #define I2C_IMUBOARD_STATUS_IMU_OK 0x08
67 int32_t latitude; /* between -90e7 and 90e7, in 1/1e-7 degrees,
68 * positive means north hemisphere */
69 int32_t longitude; /* between -180e7 and 180e7, in 1/1e-7 degrees,
70 * positive means east */
71 uint32_t altitude; /* altitude from elipsoid, in 1/100 meters */
73 uint16_t roll; /* XXX unit ? */
78 #endif /* _I2C_PROTOCOL_H_ */