Date: Tue, 24 Jan 2023 11:58:31 -0500 From: Karl Denninger <karl@denninger.net> To: freebsd-arm@freebsd.org Subject: Re: GPIO inputs on Pis? Message-ID: <fec41ff8-b658-36c8-615d-e3ae63dd9b37@denninger.net> In-Reply-To: <01070185e4732fd8-c0bede0b-d9df-4557-a174-cb237fa4bfaf-000000@eu-central-1.amazonses.com> References: <0b235f83-7cb3-1d14-7c64-aee7c1c0c23d@denninger.net> <01070185e46b1a6e-ee34b885-1215-45c7-ac18-83320c02cac2-000000@eu-central-1.amazonses.com> <a9b00748-1a11-3806-1103-ac2e6ad6bf43@denninger.net> <01070185e4732fd8-c0bede0b-d9df-4557-a174-cb237fa4bfaf-000000@eu-central-1.amazonses.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a cryptographically signed message in MIME format. --------------ms090701070402000207070901 Content-Type: multipart/alternative; boundary="------------ira0iM9tBNbzoOFDp1cpalau" --------------ira0iM9tBNbzoOFDp1cpalau Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/24/2023 10:43, Dr. Rolf Jansen wrote: > I sent an old ink to the thread on the mailing list, which does not > work anymore. Here ist the new link: > > https://lists.freebsd.org/pipermail/freebsd-arm/2020-November/022738.html > >> Am 24.01.2023 um 12:35 schrieb Karl Denninger <karl@denninger.net>: >> >> Thank you -- will check it out. >> >> On 1/24/2023 10:35, Dr. Rolf Jansen wrote: >>>> Am 23.01.2023 um 11:41 schrieb Karl Denninger <karl@denninger.net>: >>>> >>>> Is there support somewhere in the 13.x for other than "read current >>>> state" / "set current state"? >>>> >>>> Specifically, there is evidence in the sys/gpio.h header file that >>>> I can open up a file descriptor and then use select()/read() to >>>> grab the contents of a ring buffer of some size (presumably >>>> interrupt-posted) of events since last look, and determine if >>>> there's anything in there. Provided you're reasonably fast this >>>> might be enough to, for example, read an optical encoder that has a >>>> modest pulse rate. >>>> >>>> I see apparent review code at https://reviews.freebsd.org/D27398 >>>> from late 2020, but nothing else I can find digging around; an >>>> example (assuming it is actually implemented and works) would be >>>> helpful >>>> >>> See >>> >>> https://forums.freebsd.org/threads/gpio-api-general-orange-pi-h3.83950/post-556728 >>> >>> And the messages in that thread that follow the one linked above. >>> >>> There is a respective thread on this mailing list as well: >>> >>> Porting FreeBSD to ARM processors: User Space GPIO Interrupt >>> programming - GSoC-2018 >>> <https://lists.freebsd.org/archives/freebsd-arm/2020-November/022740.html> >> -- >> Karl Denninger >> karl@denninger.net >> /The Market Ticker/ >> /[S/MIME encrypted email preferred]/ > So the answer at this point appears to be "not in the codebase and no indication on when/if it might be, but there are patches that are in some state of development." Being able to read an encoder of some sort basically means being able to know how many events occurred between "looks"; for most purposes you don't need each event delivered exactly when it occurs, but missing some of the counts entirely is not acceptable. -- Karl Denninger karl@denninger.net /The Market Ticker/ /[S/MIME encrypted email preferred]/ --------------ira0iM9tBNbzoOFDp1cpalau Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <div class="moz-cite-prefix">On 1/24/2023 10:43, Dr. Rolf Jansen wrote:<br> </div> <blockquote type="cite" cite="mid:01070185e4732fd8-c0bede0b-d9df-4557-a174-cb237fa4bfaf-000000@eu-central-1.amazonses.com"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class=""> <div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I sent an old ink to the thread on the mailing list, which does not work anymore. Here ist the new link: <div class=""><br class=""> </div> <div class=""><a href="https://lists.freebsd.org/pipermail/freebsd-arm/2020-November/022738.html" class="moz-txt-link-freetext" moz-do-not-send="true">https://lists.freebsd.org/pipermail/freebsd-arm/2020-November/022738.html</a></div> <div class=""><br class=""> </div> <div class=""> <div class=""> <blockquote type="cite" class=""> <div class="">Am 24.01.2023 um 12:35 schrieb Karl Denninger <<a href="mailto:karl@denninger.net" class="moz-txt-link-freetext" moz-do-not-send="true">karl@denninger.net</a>>:</div> <br class="Apple-interchange-newline"> <div class=""> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class=""> <div class=""> <p class="">Thank you -- will check it out.<br class=""> </p> <div class="moz-cite-prefix">On 1/24/2023 10:35, Dr. Rolf Jansen wrote:<br class=""> </div> <blockquote type="cite" cite="mid:01070185e46b1a6e-ee34b885-1215-45c7-ac18-83320c02cac2-000000@eu-central-1.amazonses.com" class=""> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class=""> <div class=""> <blockquote type="cite" class=""> <div class="">Am 23.01.2023 um 11:41 schrieb Karl Denninger <<a href="mailto:karl@denninger.net" class="moz-txt-link-freetext" moz-do-not-send="true">karl@denninger.net</a>>:</div> <br class="Apple-interchange-newline"> <div class=""> <meta http-equiv="content-type" content="text/html; charset=UTF-8" class=""> <div class=""> <p class="">Is there support somewhere in the 13.x for other than "read current state" / "set current state"?</p> <p class="">Specifically, there is evidence in the sys/gpio.h header file that I can open up a file descriptor and then use select()/read() to grab the contents of a ring buffer of some size (presumably interrupt-posted) of events since last look, and determine if there's anything in there. Provided you're reasonably fast this might be enough to, for example, read an optical encoder that has a modest pulse rate.</p> <p class="">I see apparent review code at <a class="moz-txt-link-freetext" href="https://reviews.freebsd.org/D27398" moz-do-not-send="true">https://reviews.freebsd.org/D27398</a> from late 2020, but nothing else I can find digging around; an example (assuming it is actually implemented and works) would be helpful</p> </div> </div> </blockquote> </div> See <div class=""><br class=""> </div> <div class=""><a href="https://forums.freebsd.org/threads/gpio-api-general-orange-pi-h3.83950/post-556728" class="moz-txt-link-freetext" moz-do-not-send="true">https://forums.freebsd.org/threads/gpio-api-general-orange-pi-h3.83950/post-556728</a></div> <div class=""><br class=""> </div> <div class="">And the messages in that thread that follow the one linked above.</div> <div class=""><br class=""> </div> <div class="">There is a respective thread on this mailing list as well:</div> <div class=""><br class=""> </div> <div class=""><a href="https://lists.freebsd.org/archives/freebsd-arm/2020-November/022740.html" class="" moz-do-not-send="true">Porting FreeBSD to ARM processors: User Space GPIO Interrupt programming - GSoC-2018</a></div> </blockquote> <div class="moz-signature">-- <br class=""> Karl Denninger<br class=""> <a href="mailto:karl@denninger.net" class="moz-txt-link-freetext" moz-do-not-send="true">karl@denninger.net</a><br class=""> <i class="">The Market Ticker</i><br class=""> <font class="" size="-2"><i class="">[S/MIME encrypted email preferred]</i></font></div> </div> </div> </blockquote> </div> <br class=""> </div> </div> </blockquote> <p>So the answer at this point appears to be "not in the codebase and no indication on when/if it might be, but there are patches that are in some state of development."</p> <p>Being able to read an encoder of some sort basically means being able to know how many events occurred between "looks"; for most purposes you don't need each event delivered exactly when it occurs, but missing some of the counts entirely is not acceptable.<br> </p> <div class="moz-signature">-- <br> Karl Denninger<br> <a href="mailto:karl@denninger.net" class="moz-txt-link-freetext">karl@denninger.net</a><br> <i>The Market Ticker</i><br> <font size="-2"><i>[S/MIME encrypted email preferred]</i></font></div> </body> </html> --------------ira0iM9tBNbzoOFDp1cpalau-- --------------ms090701070402000207070901 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgMFADCABgkqhkiG9w0BBwEAAKCC DbowggagMIIEiKADAgECAhMA5EiKghDOXrvfxYxjITXYDdhIMA0GCSqGSIb3DQEBCwUAMIGL MQswCQYDVQQGEwJVUzEQMA4GA1UECAwHRmxvcmlkYTESMBAGA1UEBwwJTmljZXZpbGxlMRkw FwYDVQQKDBBDdWRhIFN5c3RlbXMgTExDMRgwFgYDVQQLDA9DdWRhIFN5c3RlbXMgQ0ExITAf BgNVBAMMGEN1ZGEgU3lzdGVtcyBMTEMgMjAxNyBDQTAeFw0xNzA4MTcxNjQyMTdaFw0yNzA4 MTUxNjQyMTdaMHsxCzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdGbG9yaWRhMRkwFwYDVQQKDBBD dWRhI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ECEgLG8yH4PQFdbd9x Ugmpzl1jXzANBgkqhkiG9w0BAQEFAASCAgAjxkh7mSiyPjJyfW/saNk6ckgdR+jIxDlqfzbe pjTZtz9XurdKD1xxYddfs4NDxwF1nhAACqU374tboikocd8eD2WI8pPDOsSM1/qXUyG6hvN1 u7kl3kwbh1o/eY8tJzUSmgPLPLjJJTCGfwxPV24cWyrfnroJDuxdhQMpOKl02HZR/KwOYoJq 6c18shYKbi8SZKmpgAlwTf83mGL22iy81mRnedsaWzbUx1UVCbBv9dwDMONRft6JEpqOoHqo Qat1ZPQb+5JesWuM1eYmM2Ic6L5Hrt7J284sd4iK1AKdhCfh+GRX3CJKOArNzkzJAvHHQu92 yK+lomHhJtyzq27qmYJ2y04WH0g7LTklaJ0AAENbjBqZ9GdwkCqZNN9TZ2zcqCSrGPK20bDl LGGnTdN+ozfxuPB+CR17QDRtxFh1R8Tp3tIsZpuzijcPV3gUWEb8wlv5miG1Og2uIw72L5LO rblkMtW1tvCIjPmSptwnOeaoq3VD3j9wsrrYYTqjgtioIta4oJ1lVTf9/ow/TxiCpSXOsmeR MEKrWcOsN5HKFP74SOycNwR7zZZQTSpODcn4ZoJMk6Ost8oJm1g2a3sVAUdQf4uz1sy0WPn8 ATmGkv42PBhV5wI8r1hHSWzj+1sOzISMdf8U0HfIJAWy+ZXrfLSr+wfSdF5tWWxZooHGQAAA AAAAAA== --------------ms090701070402000207070901--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fec41ff8-b658-36c8-615d-e3ae63dd9b37>