[Ovmsdev] max7317 input read
dexter at expeedo.de
Wed Jul 10 04:58:21 HKT 2019
I did some tests myself, it turned out there was more to do here.
First, the max7317 really needs 16 bits for every command. Second, the reads were done on the output level registers, inputs are mapped to bit fields in 0x0e &
0x0f. Third, the max7317 needs a deselect between the tx and the rx. No, really, I've tried even half duplex mode, the deselect really is necessary.
Fix is pushed. I've also added an "egpio input" shell command.
Am 09.07.19 um 20:00 schrieb Michael Balzer:
> there may be a bug in the max7317 component:
> uint8_t max7317::Input(uint8_t port)
> uint8_t* p = m_spibus->spi_cmd(m_spi, buf, 1, 1, port + 0x80);
> According to the max7317 specsheet the read operation needs a second (dummy) byte. So this should be…
> uint8_t* p = m_spibus->spi_cmd(m_spi, buf, 1, 2, port + 0x80, 0);
> Please try & report.
> Am 09.07.19 um 13:10 schrieb - -:
>> How can I read inputs from max7317.
>> when I try to log ESP_LOGD(TAG,"EGPIO5 input: %d", MyPeripherals->m_max7317->Input(MAX7317_EGPIO_5));
>> i get allways 0 when i put the egpio pin to GND or 3.3v
>> do i somthing wrong or does it not work.
>> Regards Thomas
>> OvmsDev mailing list
>> OvmsDev at lists.openvehicles.com
> Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
> Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OvmsDev