|
2 | 2 | title: EV3 I2C |
3 | 3 | --- |
4 | 4 |
|
5 | | -The [AM1808 SoC](ev3-processor) has 2 hardware [Inter-Integrated Circuit](https://en.wikipedia.org/wiki/I2c) (I2C) controllers. Additionally, there are 4 software controllers implemented using [fast interrupts](../ev3-fiq) (FIQs). |
| 5 | +The [AM1808 SoC](../ev3-processor) has 2 hardware [Inter-Integrated Circuit][i2c] |
| 6 | +(I2C) controllers. Additionally, there are 4 software controllers implemented using |
| 7 | +[fast interrupts](../ev3-fiq) (FIQs). |
6 | 8 |
|
7 | 9 | ## Usage |
8 | 10 |
|
9 | 11 | __I2C0__: [Boot EEPROM](../ev3-eeprom) @400kHz |
10 | 12 |
|
11 | 13 | __I2C1__: Not used/connected |
12 | 14 |
|
13 | | -__[FIQ](ev3-fiq) I2C__: Input ports 1-4 @10kHz |
| 15 | +__[FIQ](../ev3-fiq) I2C__: Input ports 1-4 @10kHz |
14 | 16 |
|
15 | 17 | ## Device Drivers |
16 | 18 |
|
17 | | -The Linux kernel has a well established [framework for I2C drivers](https://www.kernel.org/doc/Documentation/i2c/). |
| 19 | +The Linux kernel has a well established [framework for I2C drivers]. |
18 | 20 |
|
19 | | -The SoC I2C uses the existing driver at [drivers/i2c/busses/i2c-davinci.c](https://github.com/ev3dev/ev3dev-kernel/blob/master/drivers/i2c/busses/i2c-davinci.c) as a backend. |
| 21 | +The SoC I2C uses the existing driver at [drivers/i2c/busses/i2c-davinci.c] as a backend. |
20 | 22 |
|
21 | | -Since there are not enough I2C controllers on the SoC, LEGO chose to implement the I2C buses for the four input ports using GPIOs. A secondary reason for this is that the NXT Ultrasonic sensors does not work well with standard I2C masters. It requires an extra clock pulse between the stop and the next start. (TODO: add references here.) |
| 23 | +Since there are not enough I2C controllers on the SoC, LEGO chose to implement |
| 24 | +the I2C buses for the four input ports using GPIOs. A secondary reason for this |
| 25 | +is that the NXT Ultrasonic sensors does not work well with standard I2C masters. |
| 26 | +It requires an extra clock pulse between the stop and the next start. (TODO: add |
| 27 | +references here.) |
22 | 28 |
|
23 | | -This Linux kernel has an existing GPIO i2c driver, but in order to get the performance needed, we have to use [fast interrupts](EV3 FIQ) (FIQs). (Be sure to follow the link for some interesting reading.) So, the really low level stuff is done in [arch/arm/mach-davinci/legoev3-fiq.c](https://github.com/ev3dev/ev3dev-kernel/blob/master/arch/arm/mach-davinci/legoev3-fiq.c) and the rest is in [drivers/i2c/busses/i2c-legoev3.c](https://github.com/ev3dev/ev3dev-kernel/blob/master/drivers/i2c/busses/i2c-legoev3.c). |
| 29 | +This Linux kernel has an existing GPIO i2c driver, but in order to get the |
| 30 | +performance needed, we have to use [fast interrupts](../ev3-fiq) (FIQs). (Be sure |
| 31 | +to follow the link for some interesting reading.) So, the really low level stuff |
| 32 | +is done in [arch/arm/mach-davinci/legoev3-fiq.c] and the rest is in |
| 33 | +[drivers/i2c/busses/i2c-legoev3.c]. |
24 | 34 |
|
25 | 35 | ## I2C Addressing |
26 | 36 |
|
27 | | -See [I2C Sensor Addressing]({{ github.site.url }}/docs/sensors/i2c-sensor-addressing/). |
| 37 | +See [I2C Sensor Addressing](/docs/sensors/i2c-sensor-addressing/). |
| 38 | + |
| 39 | +[i2c]: https://en.wikipedia.org/wiki/I2c |
| 40 | +[framework for I2C drivers]: https://www.kernel.org/doc/Documentation/i2c/ |
| 41 | +[drivers/i2c/busses/i2c-davinci.c]: https://github.com/ev3dev/ev3-kernel/blob/ev3dev-jessie/drivers/i2c/busses/i2c-davinci.c |
| 42 | +[arch/arm/mach-davinci/legoev3-fiq.c]: https://github.com/ev3dev/ev3-kernel/blob/ev3dev-jessie/arch/arm/mach-davinci/legoev3-fiq.c |
| 43 | +[drivers/i2c/busses/i2c-legoev3.c]: https://github.com/ev3dev/lego-linux-drivers/blob/master/ev3/legoev3_i2c.c |
0 commit comments