1 /* vim:ts=4 sts=4 et tw=80
5 * for additional information please
6 * see http://lochraster.org/fnordlichtmini
8 * (c) by Alexander Neumann <alexander@bumpern.de>
10 * This program is free software: you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License version 3 as published by
12 * the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 * You should have received a copy of the GNU General Public License along with
20 * this program. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef __REMOTE_PROTO_COMMON
24 #define __REMOTE_PROTO_COMMON 1
26 #define REMOTE_MSG_LEN 15
27 #define REMOTE_SYNC_LEN 15
30 #define REMOTE_CMD_FADE_RGB 0x01
31 #define REMOTE_CMD_FADE_HSV 0x02
32 #define REMOTE_CMD_SAVE_RGB 0x03
33 #define REMOTE_CMD_SAVE_HSV 0x04
34 #define REMOTE_CMD_SAVE_CURRENT 0x05
35 #define REMOTE_CMD_CONFIG_OFFSETS 0x06
36 #define REMOTE_CMD_START_PROGRAM 0x07
37 #define REMOTE_CMD_STOP 0x08
38 #define REMOTE_CMD_MODIFY_CURRENT 0x09
39 #define REMOTE_CMD_PULL_INT 0x0A
40 #define REMOTE_CMD_CONFIG_STARTUP 0x0B
41 #define REMOTE_CMD_POWERDOWN 0x0C
43 #define REMOTE_CMD_RESYNC 0x1b
45 /* max mode for startup configuration is 1 */
46 #define REMOTE_STARTUP_MAX_MODE 1
47 /* maximum parameter size (for copy loop), size of structure storage_config_t,
48 * minus 1 for startup_mode enum */
49 #define REMOTE_STARTUP_MAX_PARAMSIZE 11
51 /* bootloader commands */
52 #define REMOTE_CMD_BOOTLOADER 0x80
53 #define REMOTE_CMD_BOOT_CONFIG 0x81
54 #define REMOTE_CMD_BOOT_INIT 0x82
55 #define REMOTE_CMD_BOOT_DATA 0x83
56 #define REMOTE_CMD_CRC_CHECK 0x84
57 #define REMOTE_CMD_CRC_FLASH 0x85
58 #define REMOTE_CMD_FLASH 0x86
59 #define REMOTE_CMD_ENTER_APP 0x87
61 #define REMOTE_ADDR_BROADCAST 0xff
68 uint8_t data
[REMOTE_MSG_LEN
-2];
71 /* bootloader commands */
72 #define BOOTLOADER_MAGIC_BYTE1 0x6b
73 #define BOOTLOADER_MAGIC_BYTE2 0x56
74 #define BOOTLOADER_MAGIC_BYTE3 0x27
75 #define BOOTLOADER_MAGIC_BYTE4 0xfc
76 struct remote_msg_bootloader_t
83 struct remote_msg_boot_config_t
87 uint16_t start_address
;
91 struct remote_msg_boot_data_t
95 uint8_t data
[REMOTE_MSG_LEN
-2];
98 struct remote_msg_boot_crc_check_t
107 struct remote_msg_boot_crc_flash_t