Skip to content

Commit 5739934

Browse files
committed
Fix README render on GitHub
1 parent 6f2ce13 commit 5739934

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

i2c_manager/README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,38 @@ I2C support in the LVGL ESP drivers is provided exclusively by the files in this
4343
4444
### Using I2C in an LVGL driver, a multi-step guide
4545
46-
Step 1
46+
<dl>
4747
48-
: The Kconfig entries for your driver only need to specify that you will be using I2C. This is done by adding `select LV_I2C_DISPLAY` or `select LV_I2C_TOUCH`.
48+
<dt>Step 1</dt>
4949
50-
Step 2
50+
<dd>
51+
The Kconfig entries for your driver only need to specify that you will be using I2C. This is done by adding `select LV_I2C_DISPLAY` or `select LV_I2C_TOUCH`.
52+
</dd>
5153
52-
: To use the I2C port in your code you would do something like:
5354
54-
```c
55-
#include "i2c_manager/i2c_manager.h"
55+
<dt>Step 2</dt>
5656
57-
uint8_t data[2];
58-
lvgl_i2c_read(CONFIG_LV_I2C_TOUCH_PORT, 0x23, 0x42, &data, 2);
59-
```
57+
<dd>
58+
To use the I2C port in your code you would do something like:
6059
61-
This causes a touch driver to read two bytes at register `0x42` from the IC at address `0x23`. Replace `CONFIG_LV_I2C_TOUCH_PORT` by `CONFIG_LV_I2C_DISPLAY_PORT` when this is a display instead of a touch driver. `lvgl_i2c_write` works much the same way, except it writes the bytes from the buffer instead of reading them. _(It's ignored above but these functions return `esp_err_t` so you can check if the I2C communication worked.)_
60+
61+
```c
62+
#include "i2c_manager/i2c_manager.h"
63+
64+
uint8_t data[2];
65+
lvgl_i2c_read(CONFIG_LV_I2C_TOUCH_PORT, 0x23, 0x42, &data, 2);
66+
```
67+
68+
This causes a touch driver to read two bytes at register `0x42` from the IC at address `0x23`. Replace `CONFIG_LV_I2C_TOUCH_PORT` by `CONFIG_LV_I2C_DISPLAY_PORT` when this is a display instead of a touch driver. `lvgl_i2c_write` works much the same way, except it writes the bytes from the buffer instead of reading them. _(It's ignored above but these functions return `esp_err_t` so you can check if the I2C communication worked.)_
69+
</dd>
70+
71+
<dt>Step 3</dt>
6272

63-
Step 3
73+
<dd>
74+
There is no step 3, you are already done.
75+
</dd>
6476

65-
: There is no step 3, you are already done.
77+
</dl>
6678

6779

6880
### Meanwhile, behind the scenes ...

0 commit comments

Comments
 (0)