Skip to content

Commit

Permalink
move-I2C-reset-via-GPIO9-from-python-into-tildagon_i2c
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDick committed May 30, 2024
1 parent 9e18277 commit d8f4731
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions drivers/tildagon_i2c/tildagon_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

#include "driver/i2c.h"
#include "hal/i2c_ll.h"
#include "driver/gpio.h"

#include "tildagon_i2c.h"

Expand Down Expand Up @@ -85,6 +86,9 @@ void tildagon_i2c_init() {
int timeout = I2C_SCLK_FREQ / 1000000 * TILDAGON_HOST_I2C_TIMEOUT;
i2c_set_timeout(TILDAGON_HOST_I2C_PORT, (timeout > I2C_LL_MAX_TIMEOUT) ? I2C_LL_MAX_TIMEOUT : timeout);
i2c_driver_install(TILDAGON_HOST_I2C_PORT, I2C_MODE_MASTER, 0, 0, 0);
// reset I2C
gpio_set_direction(GPIO_NUM_9, GPIO_MODE_OUTPUT);
gpio_set_level(GPIO_NUM_9, 1);
}


Expand Down
2 changes: 0 additions & 2 deletions modules/tildagonos.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

class _tildagonos:
def __init__(self):
self.pin_reset_i2c = Pin(9, Pin.OUT)
self.pin_reset_i2c.on()
self.system_i2c = I2C(7)
self.init_gpio()
self.leds = neopixel.NeoPixel(Pin(21), 19)
Expand Down

0 comments on commit d8f4731

Please sign in to comment.