-
Notifications
You must be signed in to change notification settings - Fork 4
/
amcmd.h
54 lines (47 loc) · 1.94 KB
/
amcmd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Amiigo commands and configs
*
* @date March 9, 2014
* @author: dashesy
* @copyright Amiigo Inc.
*/
#ifndef AMCMD_H
#define AMCMD_H
#include "amidefs.h"
typedef enum _AMIIGO_CMD {
AMIIGO_CMD_NONE = 0, // Just to do a connection status test
AMIIGO_CMD_FWUPDATE, // Firmware update
AMIIGO_CMD_RESET_LOGS, // Reset log buffer
AMIIGO_CMD_RESET_CPU, // Reset CPU
AMIIGO_CMD_RESET_CONFIGS, // Reset configurations to default
AMIIGO_CMD_DOWNLOAD, // Download all the logs
AMIIGO_CMD_CONFIGLS, // Configure light sensors
AMIIGO_CMD_CONFIGACCEL, // Configure acceleration sensors
AMIIGO_CMD_CONFIGTEMP, // Configure temperature sensor
AMIIGO_CMD_BLINK, // Configure a single blink
AMIIGO_CMD_DEEPSLEEP, // Go to deep sleep until double tap
AMIIGO_CMD_I2C_READ, // Read i2c address and register
AMIIGO_CMD_I2C_WRITE, // Write to i2c address and register
AMIIGO_CMD_RENAME, // Rename the WED
AMIIGO_CMD_TAG, // Write a tag
AMIIGO_CMD_TEST_SEQ, // Accel test sequence command
AMIIGO_CMD_EXTSTATUS, // Extended status
} AMIIGO_CMD;
#define MAX_DEV_COUNT 10 // Maximum number of devices to work with
typedef struct amiigo_config {
WEDDebugI2CCmd i2c; // i2c debugging
WEDConfigLS config_ls; // Light configuration
WEDConfigAccel config_accel; // Acceleration sensors configuration
WEDConfigTemp config_temp; // Temperature sensor configuration
WEDConfigName name; // WED name
WEDMaintLED maint_led; // Blink command
WEDConfigGeneral general; // For tags
uint8 test_mode; // accel test mode
// Device and interface to use
int count_dst;
char * dst[MAX_DEV_COUNT];
} amcfg_t;
extern AMIIGO_CMD g_cmd;
// Parsed config that goes with the command
extern amcfg_t g_cfg;
#endif // include guard