<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="it">
	<id>https://www.raspibo.org/wiki/index.php?action=history&amp;feed=atom&amp;title=GPIO_aggiuntivi_MCP23x17</id>
	<title>GPIO aggiuntivi MCP23x17 - Cronologia</title>
	<link rel="self" type="application/atom+xml" href="https://www.raspibo.org/wiki/index.php?action=history&amp;feed=atom&amp;title=GPIO_aggiuntivi_MCP23x17"/>
	<link rel="alternate" type="text/html" href="https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;action=history"/>
	<updated>2026-05-08T21:29:28Z</updated>
	<subtitle>Cronologia della pagina su questo sito</subtitle>
	<generator>MediaWiki 1.35.5</generator>
	<entry>
		<id>https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=4119&amp;oldid=prev</id>
		<title>Dave4rp il 13:10, 17 mar 2015</title>
		<link rel="alternate" type="text/html" href="https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=4119&amp;oldid=prev"/>
		<updated>2015-03-17T13:10:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;amp;diff=4119&amp;amp;oldid=811&quot;&gt;Mostra modifiche&lt;/a&gt;</summary>
		<author><name>Dave4rp</name></author>
	</entry>
	<entry>
		<id>https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=811&amp;oldid=prev</id>
		<title>Aldus il 00:13, 23 mag 2013</title>
		<link rel="alternate" type="text/html" href="https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=811&amp;oldid=prev"/>
		<updated>2013-05-23T00:13:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;it&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versione meno recente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versione delle 00:13, 23 mag 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l283&quot; &gt;Riga 283:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Riga 283:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* DEFVAL: è il registro con cui viene fatto il confronto con GPIOA per scatenare gli interrupts&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* DEFVAL: è il registro con cui viene fatto il confronto con GPIOA per scatenare gli interrupts&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* GPINTENA: abilita gli interrupt sul port A&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* GPINTENA: abilita gli interrupt sul port A&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* INTCONA: sceglie con quale modalità far scattare gli &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;interrupt&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;cioè &lt;/del&gt;confrontando GPIOA con DEFVAL;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* INTCONA: sceglie con quale modalità far scattare gli &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;interrupts&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;se il bit è a 1 &lt;/ins&gt;confrontando GPIOA con DEFVAL &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;se a 0 solo nei cambi di stato (nel nostro caso erano tutti a 0 quindi l'interrupt scattava una volta quando veniva premuto uno dei tasti e una volta quando veniva rilasciato)&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l424&quot; &gt;Riga 424:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Riga 424:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writeByte(GPPUA, 0xFF); // &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;set port B &lt;/del&gt;pullups &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;on&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writeByte(GPPUA, 0xFF); // &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;setto &lt;/ins&gt;pullups &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sul PORTA&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	writeByte(IODIRA, 0xFF); // setto &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;port A tutti input&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	writeByte(IODIRA, 0xFF); // setto &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;PORTA come ingressi&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writeByte(GPINTENA,0xFF); //Abilita &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;l'interrupt &lt;/del&gt;sul &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;portB&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writeByte(GPINTENA,0xFF); //Abilita &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;gli interrupts &lt;/ins&gt;sul &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;PORTA&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writeByte(DEFVALA,0xFF); //Setta il valore di default &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;dei pin &lt;/del&gt;del &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;port B se un un pin non Ã¨ a uno emette interrupt&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;//&lt;/ins&gt;writeByte(DEFVALA,0xFF); //Setta il valore di default del &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;PORTA (usato per la configurazione alternativa)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writeByte(INTCONA,0x00);  //Setta il &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;valore di &lt;/del&gt;per &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;il confronto se a 1 compara con il valore di DEFVAL altrimenti controlla le &lt;/del&gt;variazioni di stato&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writeByte(INTCONA,0x00);  //Setta il &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;registro &lt;/ins&gt;per &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;far scattare interrupt alle &lt;/ins&gt;variazioni di stato&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writeByte(GPIOA,0x00); //setto a zero tutti i bit del port A, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;anche se &lt;/del&gt;probabilmente non è mportante essendo il pullup a on&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;//&lt;/ins&gt;writeByte(GPIOA,0x00); //setto a zero tutti i bit del port A, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;probabilmente non è mportante essendo il pullup a on&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	writeByte(IODIRB,0x00); // setto &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;il port b &lt;/del&gt;come &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;output&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	writeByte(IODIRB,0x00); // setto &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;PORTB &lt;/ins&gt;come &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;uscite&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         while (1)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         while (1)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Aldus</name></author>
	</entry>
	<entry>
		<id>https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=810&amp;oldid=prev</id>
		<title>Dancast78 il 21:43, 22 mag 2013</title>
		<link rel="alternate" type="text/html" href="https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=810&amp;oldid=prev"/>
		<updated>2013-05-22T21:43:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;it&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versione meno recente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versione delle 21:43, 22 mag 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l265&quot; &gt;Riga 265:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Riga 265:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Ulteriori esempi qui: [https://github.com/dcast78/MCP23x17/ su github]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La seguente è una versione di codice funzionante per MCP23017, basata sul codice soprastante, essenzialmente sono stati reimplementati solo i metodi per la scrittura/lettura sul bus i2c.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La seguente è una versione di codice funzionante per MCP23017, basata sul codice soprastante, essenzialmente sono stati reimplementati solo i metodi per la scrittura/lettura sul bus i2c.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dancast78</name></author>
	</entry>
	<entry>
		<id>https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=806&amp;oldid=prev</id>
		<title>Aldus il 17:50, 19 mag 2013</title>
		<link rel="alternate" type="text/html" href="https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=806&amp;oldid=prev"/>
		<updated>2013-05-19T17:50:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;amp;diff=806&amp;amp;oldid=721&quot;&gt;Mostra modifiche&lt;/a&gt;</summary>
		<author><name>Aldus</name></author>
	</entry>
	<entry>
		<id>https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=721&amp;oldid=prev</id>
		<title>Dancast78 il 11:22, 24 apr 2013</title>
		<link rel="alternate" type="text/html" href="https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=721&amp;oldid=prev"/>
		<updated>2013-04-24T11:22:14Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;it&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versione meno recente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versione delle 11:22, 24 apr 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l215&quot; &gt;Riga 215:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Riga 215:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writeByte(GPPUA, 0xFF); // set port A pullups on&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writeByte(GPPUA, 0xFF); // set port A pullups on&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writeByte(GPPUB, 0xFF); // set port B pullups on&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writeByte(GPPUB, 0xFF); // set port B pullups on&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	writeByte (IODIRB, 0xFF) ;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	writeByte (IODIRB, 0xFF) ;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	writeByte (GPINTENB,0xFF); //Abilita l'interrupt sul portB&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	writeByte (GPINTENB,0xFF); //Abilita l'interrupt sul portB&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	writeByte (DEFVALB,0xFF); //Setta il valore di default dei pin del port B se un un pin non è a uno emette interrupt&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	writeByte (DEFVALB,0xFF); //Setta il valore di default dei pin del port B se un un pin non è a uno emette interrupt&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dancast78</name></author>
	</entry>
	<entry>
		<id>https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=720&amp;oldid=prev</id>
		<title>Dancast78: Aggiunto setup pullps port altrimenti non funziona la lettura degli ingressi</title>
		<link rel="alternate" type="text/html" href="https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=720&amp;oldid=prev"/>
		<updated>2013-04-24T11:21:43Z</updated>

		<summary type="html">&lt;p&gt;Aggiunto setup pullps port altrimenti non funziona la lettura degli ingressi&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;it&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versione meno recente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versione delle 11:21, 24 apr 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l213&quot; &gt;Riga 213:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Riga 213:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	// Port A -&amp;gt; Outputs&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	// Port A -&amp;gt; Outputs&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	writeByte (GPIOA, 0x00) ;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	writeByte (GPIOA, 0x00) ;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 	//&lt;/del&gt;writeByte (&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IPOLB&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;0x01&lt;/del&gt;) ; // &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;invert lsb&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;        &lt;/ins&gt;writeByte(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;GPPUA&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;0xFF&lt;/ins&gt;); // &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;set port A pullups on&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 	//&lt;/del&gt;writeByte (GPPUB, 0xFF) ; // &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;enable &lt;/del&gt;pullups&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;        &lt;/ins&gt;writeByte(GPPUB, 0xFF); // &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;set port B &lt;/ins&gt;pullups &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;on&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 	&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	writeByte (IODIRB, 0xFF) ;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	writeByte (IODIRB, 0xFF) ;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dancast78</name></author>
	</entry>
	<entry>
		<id>https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=654&amp;oldid=prev</id>
		<title>Dancast78 il 11:46, 9 apr 2013</title>
		<link rel="alternate" type="text/html" href="https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=654&amp;oldid=prev"/>
		<updated>2013-04-09T11:46:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;it&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versione meno recente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versione delle 11:46, 9 apr 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l241&quot; &gt;Riga 241:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Riga 241:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                  tv.tv_sec = 0;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                  tv.tv_sec = 0;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                  tv.tv_usec = 50000;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                  tv.tv_usec = 50000;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                  val = select(0, NULL, NULL, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;set&lt;/del&gt;, &amp;amp;tv);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                  val = select(0, NULL, NULL, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;NULL&lt;/ins&gt;, &amp;amp;tv);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                  /* fine antirimbalzo */   &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                  /* fine antirimbalzo */   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;               &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;               &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dancast78</name></author>
	</entry>
	<entry>
		<id>https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=648&amp;oldid=prev</id>
		<title>Dancast78: Creata pagina con 'E’ possibile collegare dei GPIO aggiuntivi al Raspberry Pi in modo da aumentare il numero di pin comandabili.  Ad esempio si possono collegare i chip [http://ww1.microchip.c...'</title>
		<link rel="alternate" type="text/html" href="https://www.raspibo.org/wiki/index.php?title=GPIO_aggiuntivi_MCP23x17&amp;diff=648&amp;oldid=prev"/>
		<updated>2013-04-08T17:19:28Z</updated>

		<summary type="html">&lt;p&gt;Creata pagina con &amp;#039;E’ possibile collegare dei GPIO aggiuntivi al Raspberry Pi in modo da aumentare il numero di pin comandabili.  Ad esempio si possono collegare i chip [http://ww1.microchip.c...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nuova pagina&lt;/b&gt;&lt;/p&gt;&lt;div&gt;E’ possibile collegare dei GPIO aggiuntivi al Raspberry Pi in modo da aumentare il numero di pin comandabili.&lt;br /&gt;
&lt;br /&gt;
Ad esempio si possono collegare i chip [http://ww1.microchip.com/downloads/en/devicedoc/21952b.pdf MCP23x17]:&lt;br /&gt;
&lt;br /&gt;
-MCP23017 che usa il protocollo I2C &lt;br /&gt;
&lt;br /&gt;
-MCP23S17 con protocollo SPI.&lt;br /&gt;
&lt;br /&gt;
Questi integrati hanno due PORT con 8 pin ciascuno, una porta di comunicazione I2C o SPI secondo il modello, alimentazione, reset e 2 pin per la gestione degli interrupt.&lt;br /&gt;
&lt;br /&gt;
Possono essere collegati sul bus assieme ad altri chip dello stesso tipo indirizzandoli con tre bit, quindi se ne possono collegare fino ad 8, questo permette di arrivare a comandadare fino 128 pin di input/output.&lt;br /&gt;
&lt;br /&gt;
I pin non hanno funzioni particolari, possono essere solo ingressi o uscite ed è possibile settarne il pullup, ma non ci sono ad esempio funzioni di pwn o altro.&lt;br /&gt;
&lt;br /&gt;
Per la configurazione bisogna settare alcuni registri sul chip per indicare la configurazione delle porte, ingressi, uscite, pullup, interrupt come riportato in questa [https://gist.github.com/ChickenProp/3183960 pagina] oltre che sul datasheet riportato sopra.&lt;br /&gt;
&lt;br /&gt;
I due bus a cui possono essere collegati questi integrati si basano su una configurazione di tipo master-slave, perciò normalmente vengono usati in polling, questo non comporta molto dispendio di CPU però se le variazioni sui pin sono veloci si rischia di perderne.&lt;br /&gt;
 &lt;br /&gt;
In questo [http://www.retrosemi.co.uk/mcp23s17/Getting_started_with_the_mcp23s17.pdf documento] viene illustrato come interagire dialogando sul bus SPI ed utilizzando un programmino in c. &lt;br /&gt;
&lt;br /&gt;
Non vengono utilizzate però le possibilità di utilizzo degli interrupt. &lt;br /&gt;
&lt;br /&gt;
Volendo ottimizzare l’uso di risorse della CPU ci sembrava utile riuscire a sfruttare questa funzione.&lt;br /&gt;
&lt;br /&gt;
In pratica si tratta di collegare uno o due pin dell’integrato ad un pin del GPIO di Raspberry Pi per scatenare la lettura del porta in input quando si verifica un evento. Questo può essere fatto praticamente settando tre registri del MCP23X17.&lt;br /&gt;
&lt;br /&gt;
Le possibilità sono diverse:&lt;br /&gt;
&lt;br /&gt;
- Sulle porte settate come ingressi, ogni singolo pin può generare interrupt, si può settare uno stato predefinito a cui si deve trovare il pin (questo però spesso non é l’ideale, vedi sotto).&lt;br /&gt;
&lt;br /&gt;
- In alternativa é possibile settare i registri in modo che venga emesso un interrupt ad ogni variazione sui pin dichiarati.&lt;br /&gt;
&lt;br /&gt;
La gestione degli interrupt é leggermenre diversa da quanto avviene in altri circuiti, infatti il registro degli interrupt viene resettato appena viene letto il registro degli interrupt oppure il port. &lt;br /&gt;
&lt;br /&gt;
Questo significa che un settaggio come indicato al primo punto genera interrupt a raffica se sul pin arrivano segnali stabili nel tempo e li leggiamo subito.&lt;br /&gt;
&lt;br /&gt;
Per questi test abbiamo utilizzato una scheda [http://pi.cs.man.ac.uk/interface.htm Pi-Face] nella versione già assemblata venduta da Farnell in modo da velocizzare i test.&lt;br /&gt;
&lt;br /&gt;
Qui sotto il codice creato, probabilmente non ancora definitivo: per utilizzarlo salvarlo su un file di testo (es piface.c) e compilare ad esempio con: &lt;br /&gt;
&lt;br /&gt;
 gcc piface.c -o piface &lt;br /&gt;
&lt;br /&gt;
poi lanciarlo con&lt;br /&gt;
&lt;br /&gt;
 ./piface /dev/spi0.0&lt;br /&gt;
&lt;br /&gt;
 /****************************************&lt;br /&gt;
  * basic SPI demo for mcp23s17&lt;br /&gt;
  *&lt;br /&gt;
  *****************************************/&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;sys/ioctl.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/spi/spidev.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;sys/mman.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
 #define CMD_WRITE	0x40&lt;br /&gt;
 #define CMD_READ 	0x41&lt;br /&gt;
 static char	*spiDevice = &amp;quot;/dev/spidev0.0&amp;quot; ;&lt;br /&gt;
 static uint8_t spiMode = 0 ;&lt;br /&gt;
 static uint8_t spiBPW = 8 ;&lt;br /&gt;
 static uint32_t spiSpeed = 5000000 ;&lt;br /&gt;
 static uint16_t spiDelay = 0;&lt;br /&gt;
 // MCP23S17 Registers&lt;br /&gt;
 #define IOCON	0x0A&lt;br /&gt;
 #define IODIRA	0x00&lt;br /&gt;
 #define IPOLA	0x02&lt;br /&gt;
 #define GPINTENA 0x04&lt;br /&gt;
 #define DEFVALA	 0x06&lt;br /&gt;
 #define INTCONA	 0x08&lt;br /&gt;
 #define GPPUA    0x0C&lt;br /&gt;
 #define INTFA    0x0E&lt;br /&gt;
 #define INTCAPA  0x10&lt;br /&gt;
 #define GPIOA	 0x12&lt;br /&gt;
 #define OLATA	 0x14&lt;br /&gt;
 #define IODIRB   0x01&lt;br /&gt;
 #define IPOLB    0x03&lt;br /&gt;
 #define GPINTENB 0x05&lt;br /&gt;
 #define DEFVALB  0x07&lt;br /&gt;
 #define INTCONB  0x09&lt;br /&gt;
 #define GPPUB    0x0D&lt;br /&gt;
 #define INTFB    0x0F&lt;br /&gt;
 #define INTCAPB  0x11&lt;br /&gt;
 #define GPIOB    0x13&lt;br /&gt;
 #define OLATB    0x15&lt;br /&gt;
 &lt;br /&gt;
 int spi_fd;&lt;br /&gt;
 &lt;br /&gt;
 int readconf() &lt;br /&gt;
 {&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int pinsetup ()&lt;br /&gt;
 {&lt;br /&gt;
   int fd = 0;&lt;br /&gt;
 &lt;br /&gt;
   fd = open(&amp;quot;/sys/class/gpio/export&amp;quot;,O_WRONLY);&lt;br /&gt;
   write(fd,&amp;quot;25\n&amp;quot;,3);&lt;br /&gt;
   close(fd);&lt;br /&gt;
 &lt;br /&gt;
   fd = open(&amp;quot;/sys/class/gpio/gpio25/direction&amp;quot;,O_WRONLY);&lt;br /&gt;
   write(fd,&amp;quot;in\n&amp;quot;,3);&lt;br /&gt;
   close(fd);&lt;br /&gt;
 &lt;br /&gt;
   fd = open(&amp;quot;/sys/class/gpio/gpio25/edge&amp;quot;,O_RDWR);  &lt;br /&gt;
   write(fd,&amp;quot;falling\n&amp;quot;,8);				// i valori possibili sono rising/falling/both/none consigliato falling&lt;br /&gt;
   close(fd);&lt;br /&gt;
   &lt;br /&gt;
   fd = open(&amp;quot;/sys/class/gpio/gpio25/value&amp;quot;,O_RDWR);&lt;br /&gt;
   &lt;br /&gt;
   return fd;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 static uint8_t readByte (uint8_t reg)&lt;br /&gt;
 {&lt;br /&gt;
 	uint8_t tx [4] ;&lt;br /&gt;
 	uint8_t rx [4] ;&lt;br /&gt;
 	struct spi_ioc_transfer spi ;&lt;br /&gt;
 &lt;br /&gt;
 	tx [0] = CMD_READ ;&lt;br /&gt;
 	tx [1] = reg ;&lt;br /&gt;
 	tx [2] = 0 ;&lt;br /&gt;
 &lt;br /&gt;
 	spi.tx_buf =(unsigned long)tx ;&lt;br /&gt;
 	spi.rx_buf =(unsigned long)rx ;&lt;br /&gt;
 	spi.len =3;&lt;br /&gt;
 	spi.delay_usecs = spiDelay ;&lt;br /&gt;
 	spi.speed_hz = spiSpeed ;&lt;br /&gt;
 	spi.bits_per_word = spiBPW ;&lt;br /&gt;
 	ioctl (spi_fd, SPI_IOC_MESSAGE(1), &amp;amp;spi) ;&lt;br /&gt;
 	return rx [2] ;&lt;br /&gt;
 }&lt;br /&gt;
 static void writeByte (uint8_t reg, uint8_t data)&lt;br /&gt;
 {&lt;br /&gt;
 	uint8_t spiBufTx [3] ;&lt;br /&gt;
 	uint8_t spiBufRx [3] ;&lt;br /&gt;
 	struct spi_ioc_transfer spi ;&lt;br /&gt;
 	spiBufTx [0] = CMD_WRITE ;&lt;br /&gt;
 	spiBufTx [1] = reg ;&lt;br /&gt;
 	spiBufTx [2] = data ;&lt;br /&gt;
 	spi.tx_buf&lt;br /&gt;
 		= (unsigned long)spiBufTx ;&lt;br /&gt;
 	spi.rx_buf&lt;br /&gt;
 		= (unsigned long)spiBufRx ;&lt;br /&gt;
 	spi.len&lt;br /&gt;
 		=3;&lt;br /&gt;
 	spi.delay_usecs = spiDelay ;&lt;br /&gt;
 	spi.speed_hz = spiSpeed ;&lt;br /&gt;
 	spi.bits_per_word = spiBPW ;&lt;br /&gt;
 	ioctl (spi_fd, SPI_IOC_MESSAGE(1), &amp;amp;spi) ;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 static void ruota_led()&lt;br /&gt;
 {&lt;br /&gt;
         uint8_t leds;&lt;br /&gt;
         leds = readByte (GPIOA) ;&lt;br /&gt;
         if (leds==4 || leds==0) {&lt;br /&gt;
                 writeByte(GPIOA,128);&lt;br /&gt;
         } else {&lt;br /&gt;
                 writeByte(GPIOA,leds/2);&lt;br /&gt;
         }&lt;br /&gt;
 }&lt;br /&gt;
 /*spi_open&lt;br /&gt;
  *&lt;br /&gt;
  - Open the given SPI channel and configures it.&lt;br /&gt;
  *&lt;br /&gt;
  - there are normally two SPI devices on your PI:&lt;br /&gt;
  *&lt;br /&gt;
  /dev/spidev0.0: activates the CS0 pin during transfer&lt;br /&gt;
  *&lt;br /&gt;
  /dev/spidev0.1: activates the CS1 pin during transfer&lt;br /&gt;
  *&lt;br /&gt;
  */&lt;br /&gt;
 int spi_open(char* dev)&lt;br /&gt;
 {&lt;br /&gt;
 	if((spi_fd = open(dev, O_RDWR)) &amp;lt; 0){&lt;br /&gt;
 		printf(&amp;quot;error opening %s\n&amp;quot;,dev);&lt;br /&gt;
 		return -1;&lt;br /&gt;
 	}&lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
 int main(int argc, char* argv[])&lt;br /&gt;
 {&lt;br /&gt;
     unsigned char data = 0xAF;&lt;br /&gt;
     struct timeval tv;&lt;br /&gt;
     int pin25;&lt;br /&gt;
     fd_set set, setbackup;&lt;br /&gt;
     char pin25buf[1024];&lt;br /&gt;
     &lt;br /&gt;
     pin25 = pinsetup();&lt;br /&gt;
     FD_ZERO(&amp;amp;set);&lt;br /&gt;
     FD_SET(pin25,&amp;amp;set);&lt;br /&gt;
     setbackup = set;&lt;br /&gt;
     &lt;br /&gt;
     int val;	&lt;br /&gt;
 	if(argc &amp;lt;= 1){&lt;br /&gt;
 		printf(&amp;quot;too few args, try %s /dev/spidev0.0\n&amp;quot;,argv[0]);&lt;br /&gt;
 		return -1;&lt;br /&gt;
 	}&lt;br /&gt;
 	// open and configure SPI channel. (/dev/spidev0.0 for example)&lt;br /&gt;
 	if(spi_open(argv[1]) &amp;lt; 0){&lt;br /&gt;
 		printf(&amp;quot;spi_open failed\n&amp;quot;);&lt;br /&gt;
 		return -1;&lt;br /&gt;
 	}&lt;br /&gt;
 	writeByte (IODIRA, 0x00) ;&lt;br /&gt;
 	// Port A -&amp;gt; Outputs&lt;br /&gt;
 	writeByte (GPIOA, 0x00) ;&lt;br /&gt;
 	//writeByte (IPOLB, 0x01) ; // invert lsb&lt;br /&gt;
 	//writeByte (GPPUB, 0xFF) ; // enable pullups.&lt;br /&gt;
 	&lt;br /&gt;
 	writeByte (IODIRB, 0xFF) ;&lt;br /&gt;
 &lt;br /&gt;
 	writeByte (GPINTENB,0xFF); //Abilita l'interrupt sul portB&lt;br /&gt;
 	writeByte (DEFVALB,0xFF); //Setta il valore di default dei pin del port B se un un pin non è a uno emette interrupt&lt;br /&gt;
 	writeByte (INTCONB,0x00);  //Setta il valore di per il confronto se a 1 compara con il valore di DEFVAL altrimenti controlla le variazioni di stato&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
         while (1)&lt;br /&gt;
         {&lt;br /&gt;
             tv.tv_sec = 30;&lt;br /&gt;
             tv.tv_usec = 0;&lt;br /&gt;
 &lt;br /&gt;
             val = select(pin25+1, NULL, NULL, &amp;amp;set, &amp;amp;tv);&lt;br /&gt;
 &lt;br /&gt;
         &lt;br /&gt;
             set = setbackup;&lt;br /&gt;
             if(val &amp;gt; 0)&lt;br /&gt;
             {&lt;br /&gt;
               if(FD_ISSET(pin25,&amp;amp;set))&lt;br /&gt;
               {&lt;br /&gt;
                 write(1,&amp;quot;evento su pin 25\n&amp;quot;,17);&lt;br /&gt;
                 &lt;br /&gt;
                 /* antirimbalzo */&lt;br /&gt;
                 tv.tv_sec = 0;&lt;br /&gt;
                 tv.tv_usec = 50000;&lt;br /&gt;
                 val = select(0, NULL, NULL, &amp;amp;set, &amp;amp;tv);&lt;br /&gt;
                 /* fine antirimbalzo */  &lt;br /&gt;
             &lt;br /&gt;
 &lt;br /&gt;
                 lseek(pin25,0,SEEK_SET);&lt;br /&gt;
                 read(pin25,pin25buf,1024);&lt;br /&gt;
               }&lt;br /&gt;
               else write(1,&amp;quot;???\n&amp;quot;,4);&lt;br /&gt;
              }&lt;br /&gt;
             else&lt;br /&gt;
             if(val &amp;lt; 0) write(1,&amp;quot;SIGNAL NON BLOCCATO\n&amp;quot;,20);&lt;br /&gt;
             else write(1,&amp;quot;TIMEOUT\n&amp;quot;,8);&lt;br /&gt;
             &lt;br /&gt;
             &lt;br /&gt;
                      // Port B -&amp;gt; Inputs&lt;br /&gt;
          data = readByte (GPIOB) ;&lt;br /&gt;
          printf(&amp;quot;RECEIVED: %.2X\n&amp;quot;,data);&lt;br /&gt;
 	 &lt;br /&gt;
 	 //ruota_led();&lt;br /&gt;
                         &lt;br /&gt;
             &lt;br /&gt;
          }&lt;br /&gt;
          close(spi_fd);&lt;br /&gt;
          return 0;&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Dancast78</name></author>
	</entry>
</feed>