Loading...
Searching...
No Matches
lp5562_reg.h
1#pragma once
2
3#if defined(BITS_BIG_ENDIAN) && BITS_BIG_ENDIAN == 1
4#error Bit structures defined in this file are not portable to BE
5#endif
6
7#define LP5562_ADDRESS 0x60
8#define LP5562_I2C_TIMEOUT 50
9
10#define LP5562_CHANNEL_RED_CURRENT_REGISTER 0x07
11#define LP5562_CHANNEL_GREEN_CURRENT_REGISTER 0x06
12#define LP5562_CHANNEL_BLUE_CURRENT_REGISTER 0x05
13#define LP5562_CHANNEL_WHITE_CURRENT_REGISTER 0x0F
14
15#define LP5562_CHANNEL_RED_VALUE_REGISTER 0x04
16#define LP5562_CHANNEL_GREEN_VALUE_REGISTER 0x03
17#define LP5562_CHANNEL_BLUE_VALUE_REGISTER 0x02
18#define LP5562_CHANNEL_WHITE_VALUE_REGISTER 0x0E
19
20typedef enum {
21 EngExecHold = 0b00,
22 EngExecStep = 0b01,
23 EngExecRun = 0b10,
24 EngExecPC = 0b11,
25} EngExec;
26
27typedef struct {
28 EngExec ENG3_EXEC : 2;
29 EngExec ENG2_EXEC : 2;
30 EngExec ENG1_EXEC : 2;
31 bool CHIP_EN : 1;
32 bool LOG_EN : 1;
34
35typedef enum {
36 EngModeDisable = 0b00,
37 EngModeLoad = 0b01,
38 EngModeRun = 0b10,
39 EngModeDirect = 0b11,
40} EngMode;
41
42typedef struct {
43 EngMode ENG3_MODE : 2;
44 EngMode ENG2_MODE : 2;
45 EngMode ENG1_MODE : 2;
46 uint8_t reserved : 2;
48
49typedef struct {
50 bool INT_CLK_EN : 1;
51 bool CLK_DET_EN : 1;
52 uint8_t reserved0 : 3;
53 bool PS_EN : 1;
54 bool PWM_HF : 1;
55 uint8_t reserved1 : 1;
57
58typedef struct {
59 uint8_t pc : 3;
60 uint8_t reserved : 5;
62
63typedef struct {
64 uint8_t pc : 3;
65 uint8_t reserved : 5;
67
68typedef struct {
69 uint8_t pc : 3;
70 uint8_t reserved : 5;
72
73typedef struct {
74 bool ENG3_INT : 1;
75 bool ENG2_INT : 1;
76 bool ENG1_INT : 1;
77 bool EXT_CLK_USED : 1;
78 uint8_t reserved : 5;
80
81typedef struct {
82 uint8_t value;
84
85typedef enum {
86 EngSelectI2C = 0b00,
87 EngSelectEngine1 = 0b01,
88 EngSelectEngine2 = 0b10,
89 EngSelectEngine3 = 0b11,
90} EngSelect;
91
92typedef struct {
93 EngSelect blue : 2;
94 EngSelect green : 2;
95 EngSelect red : 2;
96 EngSelect white : 2;
Definition lp5562_reg.h:27
Definition lp5562_reg.h:42
Definition lp5562_reg.h:49
Definition lp5562_reg.h:58
Definition lp5562_reg.h:63
Definition lp5562_reg.h:68
Definition lp5562_reg.h:73
Definition lp5562_reg.h:81
Definition lp5562_reg.h:92