<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    I did some tests myself, it turned out there was more to do here.<br>
    <br>
    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.<br>
    <br>
    Fix is pushed. I've also added an "egpio input" shell command.<br>
    <br>
    Regards,<br>
    Michael<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 09.07.19 um 20:00 schrieb Michael
      Balzer:<br>
    </div>
    <blockquote type="cite"
      cite="mid:c080d2e1-9fb4-cf86-d516-6a6b375d2392@expeedo.de">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      Thomas,<br>
      <br>
      there may be a bug in the max7317 component:<br>
      <blockquote><tt>uint8_t max7317::Input(uint8_t port)</tt><br>
        <tt>…</tt><br>
        <tt>  uint8_t* p = m_spibus->spi_cmd(m_spi, buf, 1, 1, port +
          0x80);</tt><br>
      </blockquote>
      According to the max7317 specsheet the read operation needs a
      second (dummy) byte. So this should be…<br>
      <blockquote><tt>  uint8_t* p = m_spibus->spi_cmd(m_spi, buf, 1,
          2, port + 0x80, 0);</tt><br>
      </blockquote>
      Please try & report.<br>
      <br>
      Regards,<br>
      Michael<br>
      <br>
      <br>
      <div class="moz-cite-prefix">Am 09.07.19 um 13:10 schrieb - -:<br>
      </div>
      <blockquote type="cite"
        cite="mid:102947694.457239.1562670612610@email.ionos.de">
        <meta http-equiv="content-type" content="text/html;
          charset=UTF-8">
        <meta charset="UTF-8">
        <p>Hello,<br>
        </p>
        <p>How can I read inputs from max7317.<br>
          when I try to log ESP_LOGD(TAG,"EGPIO5 input: %d",
          MyPeripherals->m_max7317->Input(MAX7317_EGPIO_5));<br>
        </p>
        <p>i get allways 0 when i put the egpio pin to GND or 3.3v<br>
          do i somthing wrong or does it not work.<br>
        </p>
        <p>Regards Thomas<br>
        </p>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <pre class="moz-quote-pre" wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.openvehicles.com" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" moz-do-not-send="true">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="160">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="160">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
  </body>
</html>