45 uint16_t mmode = 0x422;
49 this->
write16_(ATM90E26_REGISTER_SOFTRESET, 0x789A);
50 this->
write16_(ATM90E26_REGISTER_FUNCEN,
52 uint16_t read = this->
read16_(ATM90E26_REGISTER_LASTDATA);
54 ESP_LOGW(TAG,
"Could not initialize ATM90E26 IC, check SPI settings: %d", read);
59 this->
write16_(ATM90E26_REGISTER_SAGTH, 0x17DD);
62 this->
write16_(ATM90E26_REGISTER_CALSTART, 0x5678);
65 this->
write16_(ATM90E26_REGISTER_MMODE, mmode);
72 this->
write16_(ATM90E26_REGISTER_LPHI, 0x0000);
73 this->
write16_(ATM90E26_REGISTER_NGAIN, 0x0000);
74 this->
write16_(ATM90E26_REGISTER_NPHI, 0x0000);
75 this->
write16_(ATM90E26_REGISTER_PSTARTTH, 0x08BD);
76 this->
write16_(ATM90E26_REGISTER_PNOLTH, 0x0000);
77 this->
write16_(ATM90E26_REGISTER_QSTARTTH, 0x0AEC);
78 this->
write16_(ATM90E26_REGISTER_QNOLTH, 0x0000);
91 this->
write16_(ATM90E26_REGISTER_CS1, cs);
92 ESP_LOGVV(TAG,
"Set CS1 to: 0x%04X", cs);
95 this->
write16_(ATM90E26_REGISTER_ADJSTART, 0x5678);
98 this->
write16_(ATM90E26_REGISTER_IGAINN, 0x7530);
99 this->
write16_(ATM90E26_REGISTER_UOFFSET, 0x0000);
100 this->
write16_(ATM90E26_REGISTER_IOFFSETL, 0x0000);
101 this->
write16_(ATM90E26_REGISTER_IOFFSETN, 0x0000);
102 this->
write16_(ATM90E26_REGISTER_POFFSETL, 0x0000);
103 this->
write16_(ATM90E26_REGISTER_QOFFSETL, 0x0000);
104 this->
write16_(ATM90E26_REGISTER_POFFSETN, 0x0000);
105 this->
write16_(ATM90E26_REGISTER_QOFFSETN, 0x0000);
110 this->
write16_(ATM90E26_REGISTER_CS2, cs);
111 ESP_LOGVV(TAG,
"Set CS2 to: 0x%04X", cs);
113 this->
write16_(ATM90E26_REGISTER_CALSTART,
115 this->
write16_(ATM90E26_REGISTER_ADJSTART,
118 const uint16_t sys_status = this->
read16_(ATM90E26_REGISTER_SYSSTATUS);
119 if (sys_status & 0xC000) {
121 ESP_LOGW(TAG,
"Could not initialize ATM90E26 IC: CS1 was incorrect, expected: 0x%04X",
122 this->
read16_(ATM90E26_REGISTER_CS1));
125 if (sys_status & 0x3000) {
126 ESP_LOGW(TAG,
"Could not initialize ATM90E26 IC: CS2 was incorrect, expected: 0x%04X",
127 this->
read16_(ATM90E26_REGISTER_CS2));