Difference between revisions of "IoTGateway/BSP/Android/Gettingstarted/How to use GPIO"
From ESS-WIKI
| Line 3: | Line 3: | ||
==== Configuration ==== | ==== Configuration ==== | ||
| − | + | The i.MX 6 bank/bit notation for GPIOs must be formed as "GPIO<GPIO_bank>_IO<gpio_bit>" | |
| + | The numeric value of GPIO is calculated as follows: | ||
| + | <pre>32 x (gpio_bank- 1) + gpio_bit | ||
| + | </pre> | ||
| + | E.g. GPIO2_IO04 becomes 36 | ||
| − | ROM7420 | + | |
| + | |||
| + | ===== ROM-3421 ===== | ||
| + | |||
| + | ===== ROM7420 ===== | ||
{| border="1" cellspacing="1" cellpadding="1" style="width:500px;" | {| border="1" cellspacing="1" cellpadding="1" style="width:500px;" | ||
|- | |- | ||
| GPIO Number | | GPIO Number | ||
| − | | | + | | GPIO formed |
| + | | Numeric Representation | ||
|- | |- | ||
| GPIO0 | | GPIO0 | ||
| + | | GPIO6_IO11 | ||
| 171 | | 171 | ||
|- | |- | ||
| GPIO1<br/> | | GPIO1<br/> | ||
| + | | GPIO6_IO14 | ||
| 174 | | 174 | ||
|- | |- | ||
| GPIO2<br/> | | GPIO2<br/> | ||
| + | | GPIO6_IO15<br/> | ||
| 175 | | 175 | ||
|- | |- | ||
| GPIO3<br/> | | GPIO3<br/> | ||
| + | | GPIO6_IO16 | ||
| 176 | | 176 | ||
|- | |- | ||
| GPIO4<br/> | | GPIO4<br/> | ||
| + | | GPIO2_IO25<br/> | ||
| 57 | | 57 | ||
|- | |- | ||
| GPIO5<br/> | | GPIO5<br/> | ||
| + | | GPIO2_IO23<br/> | ||
| 55 | | 55 | ||
|- | |- | ||
| GPIO6<br/> | | GPIO6<br/> | ||
| + | | GPIO2_IO24<br/> | ||
| 56 | | 56 | ||
|- | |- | ||
| GPIO7<br/> | | GPIO7<br/> | ||
| + | | GPIO5_IO02<br/> | ||
| 130 | | 130 | ||
|} | |} | ||
Revision as of 07:35, 26 January 2017
Configuration/Test
Configuration
The i.MX 6 bank/bit notation for GPIOs must be formed as "GPIO<GPIO_bank>_IO<gpio_bit>"
The numeric value of GPIO is calculated as follows:
32 x (gpio_bank- 1) + gpio_bit
E.g. GPIO2_IO04 becomes 36
ROM-3421
ROM7420
| GPIO Number | GPIO formed | Numeric Representation |
| GPIO0 | GPIO6_IO11 | 171 |
| GPIO1 |
GPIO6_IO14 | 174 |
| GPIO2 |
GPIO6_IO15 |
175 |
| GPIO3 |
GPIO6_IO16 | 176 |
| GPIO4 |
GPIO2_IO25 |
57 |
| GPIO5 |
GPIO2_IO23 |
55 |
| GPIO6 |
GPIO2_IO24 |
56 |
| GPIO7 |
GPIO5_IO02 |
130 |