|
3 | 3 | #
|
4 | 4 | # SPDX-License-Identifier: MIT
|
5 | 5 |
|
| 6 | +# pylint: disable=too-many-public-methods |
| 7 | + |
6 | 8 | """
|
7 | 9 | `mcp23017`
|
8 | 10 | ====================================================
|
|
23 | 25 | _MCP23017_IODIRA = const(0x00)
|
24 | 26 | _MCP23017_IODIRB = const(0x01)
|
25 | 27 | _MCP23017_IPOLA = const(0x02)
|
| 28 | +_MCP23017_IPOLB = const(0x03) |
26 | 29 | _MCP23017_GPINTENA = const(0x04)
|
27 | 30 | _MCP23017_DEFVALA = const(0x06)
|
28 | 31 | _MCP23017_INTCONA = const(0x08)
|
@@ -162,6 +165,42 @@ def get_pin(self, pin):
|
162 | 165 | assert 0 <= pin <= 15
|
163 | 166 | return DigitalInOut(pin, self)
|
164 | 167 |
|
| 168 | + @property |
| 169 | + def ipol(self): |
| 170 | + """The raw IPOL output register. Each bit represents the |
| 171 | + polarity value of the associated pin (0 = normal, 1 = inverted), assuming that |
| 172 | + pin has been configured as an input previously. |
| 173 | + """ |
| 174 | + return self._read_u16le(_MCP23017_IPOLA) |
| 175 | + |
| 176 | + @ipol.setter |
| 177 | + def ipol(self, val): |
| 178 | + self._write_u16le(_MCP23017_IPOLA, val) |
| 179 | + |
| 180 | + @property |
| 181 | + def ipola(self): |
| 182 | + """The raw IPOL A output register. Each bit represents the |
| 183 | + polarity value of the associated pin (0 = normal, 1 = inverted), assuming that |
| 184 | + pin has been configured as an input previously. |
| 185 | + """ |
| 186 | + return self._read_u8(_MCP23017_IPOLA) |
| 187 | + |
| 188 | + @ipola.setter |
| 189 | + def ipola(self, val): |
| 190 | + self._write_u8(_MCP23017_IPOLA, val) |
| 191 | + |
| 192 | + @property |
| 193 | + def ipolb(self): |
| 194 | + """The raw IPOL B output register. Each bit represents the |
| 195 | + polarity value of the associated pin (0 = normal, 1 = inverted), assuming that |
| 196 | + pin has been configured as an input previously. |
| 197 | + """ |
| 198 | + return self._read_u8(_MCP23017_IPOLB) |
| 199 | + |
| 200 | + @ipolb.setter |
| 201 | + def ipolb(self, val): |
| 202 | + self._write_u8(_MCP23017_IPOLB, val) |
| 203 | + |
165 | 204 | @property
|
166 | 205 | def interrupt_configuration(self):
|
167 | 206 | """The raw INTCON interrupt control register. The INTCON register
|
|
0 commit comments