summaryrefslogtreecommitdiff
path: root/firmware/global.h
blob: 0098d3890e9d33c50241d88f98118ae3bb45d168 (plain)
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
#ifndef __GLOBAL_H__
#define __GLOBAL_H__

#define COLOR_SPEC_WHITE            0x00
#define COLOR_SPEC_SINGLE_COLOR     0x01
#define COLOR_SPEC_RGB              0x02
#define COLOR_SPEC_RGBW             0x03
#define COLOR_SPEC_COLD_WARM_WHITE  0x04
#define COLOR_SPEC_WWA              0x05 /* cold white/warm white/amber */

#define OLSNDOT_V1 0x01

#define FIRMWARE_VERSION 2
#define HARDWARE_VERSION 2

/* Maximum bit count supported by serial command protocol. The brightness data is assumed to be of this bit width, but
 * only the uppermost NBITS bits are used. */
#define MAX_BITS 16

/* Bit count of this device. Note that to change this you will also have to adapt the per-bit timer period lookup table
 * in main.c.  */
#define NBITS 14

#define NCHANNELS 8
#define CHANNEL_SPEC 'H'
#define COLOR_SPEC COLOR_SPEC_RGBW
#define DEVICE_TYPE OLSNDOT_V1

#define TS_CAL1 (*(uint16_t *)0x1FFFF7B8)
#define VREFINT_CAL (*(uint16_t *)0x1FFFF7BA)

extern uint32_t sys_time;
extern uint32_t sys_time_seconds;

#endif/*__GLOBAL_H__*/