8 static const float BL0906_WATT = 16 * 1.097 * 1.097 * (20000 + 20000 + 20000 + 20000 + 20000) /
9 (40.41259 * ((5.1 + 5.1) * 1000 / 2000) * 1 * 100 * 1 * 1000);
11 static const float BL0906_CF = 16 * 4194304 * 0.032768 * 16 /
13 (40.4125 * ((5.1 + 5.1) * 1000 / 2000) * 1 * 100 * 1 * 1000 /
14 (1.097 * 1.097 * (20000 + 20000 + 20000 + 20000 + 20000))));
16 static const float BL0906_FREF = 10000000;
18 static const float BL0906_TREF = 12.5 / 59 - 40;
20 static const float BL0906_IREF = 1.097 / (12875 * 1 * (5.1 + 5.1) * 1000 / 2000);
22 static const float BL0906_UREF = 1.097 * (20000 + 20000 + 20000 + 20000 + 20000) / (13162 * 1 * 100 * 1000);
24 static const float BL0906_PREF = 1.097 * 1.097 * (20000 + 20000 + 20000 + 20000 + 20000) /
25 (40.41259 * ((5.1 + 5.1) * 1000 / 2000) * 1 * 100 * 1 * 1000);
27 static const float BL0906_EREF = 4194304 * 0.032768 * 16 /
29 (40.4125 * ((5.1 + 5.1) * 1000 / 2000) * 1 * 100 * 1 * 1000 /
30 (1.097 * 1.097 * (20000 + 20000 + 20000 + 20000 + 20000))));
32 static const float BL0906_KI = 12875 * 1 * (5.1 + 5.1) * 1000 / 2000 / 1.097;
34 static const float BL0906_KP = 40.4125 * ((5.1 + 5.1) * 1000 / 2000) * 1 * 100 * 1 * 1000 / 1.097 / 1.097 /
35 (20000 + 20000 + 20000 + 20000 + 20000);
37 static const uint8_t USR_WRPROT_WITABLE[6] = {0xCA, 0x9E, 0x55, 0x55, 0x00, 0xB7};
38 static const uint8_t USR_WRPROT_ONLYREAD[6] = {0xCA, 0x9E, 0x00, 0x00, 0x00, 0x61};
40 static const uint8_t BL0906_READ_COMMAND = 0x35;
41 static const uint8_t BL0906_WRITE_COMMAND = 0xCA;
45 static const uint8_t BL0906_V_RMS = 0x16;
48 static const uint8_t BL0906_WATT_SUM = 0X2C;
51 static const uint8_t BL0906_I_1_RMS = 0x0D;
52 static const uint8_t BL0906_I_2_RMS = 0x0E;
53 static const uint8_t BL0906_I_3_RMS = 0x0F;
54 static const uint8_t BL0906_I_4_RMS = 0x10;
55 static const uint8_t BL0906_I_5_RMS = 0x13;
56 static const uint8_t BL0906_I_6_RMS = 0x14;
59 static const uint8_t BL0906_WATT_1 = 0X23;
60 static const uint8_t BL0906_WATT_2 = 0X24;
61 static const uint8_t BL0906_WATT_3 = 0X25;
62 static const uint8_t BL0906_WATT_4 = 0X26;
63 static const uint8_t BL0906_WATT_5 = 0X29;
64 static const uint8_t BL0906_WATT_6 = 0X2A;
67 static const uint8_t BL0906_CF_1_CNT = 0X30;
68 static const uint8_t BL0906_CF_2_CNT = 0X31;
69 static const uint8_t BL0906_CF_3_CNT = 0X32;
70 static const uint8_t BL0906_CF_4_CNT = 0X33;
71 static const uint8_t BL0906_CF_5_CNT = 0X36;
72 static const uint8_t BL0906_CF_6_CNT = 0X37;
75 static const uint8_t BL0906_CF_SUM_CNT = 0X39;
78 static const uint8_t BL0906_FREQUENCY = 0X4E;
81 static const uint8_t BL0906_TEMPERATURE = 0X5E;
85 static const uint8_t BL0906_RMSGN_1 = 0x6D;
86 static const uint8_t BL0906_RMSGN_2 = 0x6E;
87 static const uint8_t BL0906_RMSGN_3 = 0x6F;
88 static const uint8_t BL0906_RMSGN_4 = 0x70;
89 static const uint8_t BL0906_RMSGN_5 = 0x73;
90 static const uint8_t BL0906_RMSGN_6 = 0x74;
93 static const uint8_t BL0906_RMSOS_1 = 0x78;
94 static const uint8_t BL0906_RMSOS_2 = 0x79;
95 static const uint8_t BL0906_RMSOS_3 = 0x7A;
96 static const uint8_t BL0906_RMSOS_4 = 0x7B;
97 static const uint8_t BL0906_RMSOS_5 = 0x7E;
98 static const uint8_t BL0906_RMSOS_6 = 0x7F;
101 static const uint8_t BL0906_WATTGN_1 = 0xB7;
102 static const uint8_t BL0906_WATTGN_2 = 0xB8;
103 static const uint8_t BL0906_WATTGN_3 = 0xB9;
104 static const uint8_t BL0906_WATTGN_4 = 0xBA;
105 static const uint8_t BL0906_WATTGN_5 = 0xBD;
106 static const uint8_t BL0906_WATTGN_6 = 0xBE;
110 static const uint8_t BL0906_USR_WRPROT = 0x9E;
113 static const uint8_t BL0906_SOFT_RESET = 0x9F;
117 {BL0906_WRITE_COMMAND, BL0906_SOFT_RESET, 0x5A, 0x5A, 0x5A, 0x52},
119 {BL0906_WRITE_COMMAND, BL0906_USR_WRPROT, 0x55, 0x55, 0x00, 0xB7}};
const uint8_t BL0906_INIT[2][6]
Implementation of SPI Controller mode.