Skip to content
Browse files

invert I2S CLK output to clock out data on rising edge

  • Loading branch information...
Louis Beaudoin
Louis Beaudoin committed Sep 30, 2019
1 parent cb0f538 commit ebf12e4fa3d212ded543970450ad4bc1742ad3fd
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/esp32_i2s_parallel.c
@@ -128,6 +128,13 @@ static void gpio_setup_out(int gpio, int sig) {
gpio_matrix_out(gpio, sig, false, false);

static void gpio_setup_out_invert(int gpio, int sig) {
if (gpio==-1) return;
gpio_set_direction(gpio, GPIO_MODE_DEF_OUTPUT);
gpio_matrix_out(gpio, sig, true, false);

static void dma_reset(i2s_dev_t *dev) {
dev->lc_conf.in_rst=1; dev->lc_conf.in_rst=0;
@@ -284,8 +291,9 @@ void i2s_parallel_setup_without_malloc(i2s_dev_t *dev, const i2s_parallel_config
for (int x=0; x<cfg->bits; x++) {
gpio_setup_out(cfg->gpio_bus[x], sig_data_base+x);
//ToDo: Clk/WS may need inversion?
gpio_setup_out(cfg->gpio_clk, sig_clk);

// invert CLK output to clock out data on rising edge
gpio_setup_out_invert(cfg->gpio_clk, sig_clk);

//Power on dev
if (dev==&I2S0) {

0 comments on commit ebf12e4

Please sign in to comment.
You can’t perform that action at this time.