![UUGear PiGear Nano Скачать руководство пользователя страница 37](http://html1.mh-extra.com/html/uugear/pigear-nano/pigear-nano_user-manual_1065765037.webp)
34
Bit
7
6
5
4
3
2
1
0
Value
0 / 1
0 / 1
0 / 1
0 / 1
X
X
X
X
Pin
DIO-4
DIO-3
DIO-2
DIO-1
N/A
N/A
N/A
N/A
Remarks
: GPIO-23 (BCM naming) will be pulled down when new data is available on inputs, and
you can monitor GPIO-23 and know when to query the new data.
10.7.3 Configuration 3 (DIO-1 and DIO-2 as outputs; DIO-3 and DIO-4 as inputs):
In order to set DIO-1 and DIO-2 as outputs, while DIO-3 and DIO-4 as inputs, you need to set the
register in I2C-1 to 0xC0, set the register in I2C-6 to 0xF4 and then 0xF6. This way you give bit 2 a
raising edge to make the change take effect.
Bus
Address
Register Index
Set to Value
I2C-1
0x20
omitted
0xC0 (B11000000)
I2C-6
0x20
omitted
0xF4 (B11110100)
and then
0xF6 (B11110110)
Then you can inquire the pin status via I2C-1 (address=0x20, omitting register index), and the pin
status are stored in bit 6 and 7 in the register. You can also set the bit 4 and 5 to change the output
state on DIO-1 and DIO-2.
Bit
7
6
5
4
3
2
1
0
Value
0 / 1
0 / 1
0 / 1
0 / 1
X
X
X
X
Pin
DIO-4
DIO-3
DIO-2
DIO-1
N/A
N/A
N/A
N/A
Remarks
: GPIO-23 (BCM naming) will be pulled down when new data is available on inputs, and
you can monitor GPIO-23 and know when to query the new data.
Содержание PiGear Nano
Страница 5: ...2...