metawatch/metawatch_protocol.h

113 lines
3.2 KiB
C
Raw Normal View History

2011-07-23 21:32:08 +02:00
/*
* (c) 2011 Siegen, Germany by Nils Faerber <nils.faerber@kernelconcepts.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
2011-07-23 21:32:08 +02:00
*/
2011-07-18 22:33:40 +02:00
#ifndef _MW_PROT_H
#define _MW_PROT_H
2011-07-23 17:56:24 +02:00
#define MW_SOF 0x01
2011-07-18 22:33:40 +02:00
2011-08-10 20:13:00 +02:00
/* general */
2011-07-18 22:33:40 +02:00
#define MW_GET_DEVICE_TYPE 0x01
#define MW_GET_DEVICE_TYPE_RSP 0x02
#define MW_DEVICE_TYPE_RESERVED 0x00
#define MW_DEVICE_TYPE_ANA_DIGI 0x01
#define MW_DEVICE_TYPE_DIGITAL 0x02
#define MW_DEVICE_TYPE_DEVB_DIGI 0x03
#define MW_DEVICE_TYPE_DEVB_ANA_DIGI 0x04
2011-07-18 22:33:40 +02:00
#define MW_GET_INFORMATION_STRING 0x03
#define MW_GET_INFORMATION_STRING_RSP 0x04
2011-08-10 20:13:00 +02:00
/* specific for ana-digi version */
#define MW_UPDATE_OLED_DISPLAY_MSG 0x10
#define MW_WRITE_OLED_IDLE_DISPLAY_MSG 0x11
#define MW_WRITE_OLED_SCROLL_BUFFER_MSG 0x15
#define MW_ENABLE_OLED_DISPLAY_MSG 0x16
2011-07-18 22:33:40 +02:00
#define MW_ADVANCE_WATCH_HANDS 0x20
2011-08-10 20:13:00 +02:00
2011-07-18 22:33:40 +02:00
#define MW_SET_VIBRATE_MODE 0x23
#define MW_SET_REAL_TIME_CLOCK 0x26
#define MW_GET_REAL_TIME_CLOCK 0x27
#define MW_GET_REAL_TIME_CLOCK_RSP 0x28
2011-07-19 12:31:32 +02:00
#define MW_RTC_CLOCK_12HR 0x00
#define MW_RTC_CLOCK_24HR 0x01
#define MW_RTC_DATE_MMDD 0x00
#define MW_RTC_DATE_DDMM 0x01
2011-07-18 22:33:40 +02:00
#define MW_RESERVED 0x32
#define MW_STATUS_CHANGE_EVENT 0x33
#define MW_BUTTON_EVENT_MESSAGE 0x34
2011-08-10 20:13:00 +02:00
/* specific for digital version */
2011-07-18 22:33:40 +02:00
#define MW_WRITE_BUFFER 0x40
#define MW_CONFIGURE_MODE 0x41
#define MW_CONFIGURE_IDLE_BUFFER_SIZE 0x42
#define MW_UPDATE_DISPLAY 0x43
#define MW_LOAD_TEMPLATE 0x44
#define MW_RESERVED2 0x45
#define MW_ENABLE_BUTTON 0x46
#define MW_DISABLE_BUTTON 0x47
#define MW_READ_BUTTON_CONFIG 0x48
#define MW_READ_BUTTON_CONFIG_RSP 0x49
#define MW_RESERVED3 0x4a
#define MW_BATTERY_CONFIG_MSG 0x53
#define MW_LOW_BATTERY_WARNING_MSG 0x54
#define MW_LOW_BATTERY_BT_OFF_MSG 0x55
#define MW_READ_BATTERY_VOLTAGE_MSG 0x56
#define MW_READ_BATTERY_VOLTAGE_RSP 0x57
2011-07-30 17:22:05 +02:00
#define MW_READ_LIGHT_SENSOR_MSG 0x58
#define MW_READ_LIGHT_SENSOR_RSP 0x59
2011-07-18 22:33:40 +02:00
#define MW_ACCELEROMETER 0xea
2011-08-03 00:50:24 +02:00
/* screen modes */
#define MW_SCREEN_MODE_IDLE 0x00
#define MW_SCREEN_MODE_APPLICATION 0x01
#define MW_SCREEN_MODE_NOTIFICATION 0x02
#define MW_SCREEN_MODE_SCROLL 0x03
2011-07-23 21:32:08 +02:00
2011-08-03 00:50:24 +02:00
/* button definitions */
#define MW_BUTTON_A 0x00
#define MW_BUTTON_B 0x01
#define MW_BUTTON_C 0x02
#define MW_BUTTON_D 0x03
#define MW_BUTTON_RES4 0x04
#define MW_BUTTON_E 0x05
#define MW_BUTTON_F 0x06
#define MW_BUTTON_PULLSW 0x07
2011-08-10 20:13:00 +02:00
/* button events */
2011-08-03 00:50:24 +02:00
#define MW_BUTTON_IMMEDIATE 0x00
#define MW_BUTTON_PRESS_AND_RELEASE 0x01
#define MW_BUTTON_HOLD_RELEASE 0x02
#define MW_BUTTON_LONG_HOLD_RELEASE 0x03
2011-08-10 20:13:00 +02:00
/* OLEDs */
#define MW_OLED_UPPER 0x00
#define MW_OLED_LOWER 0x01
2011-08-03 00:50:24 +02:00
2011-07-18 22:33:40 +02:00
#endif
2011-07-23 17:56:24 +02:00