Feat: add dac ldac pin gpio setup

Refs: #8
pull/9/head
rkcf 2023-02-19 19:46:46 -06:00
parent e53dc953c4
commit 92e5de269e
1 changed files with 6 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#include <stdio.h>
#include "driver/gpio.h"
#include "driver/i2c.h"
#include "esp_err.h"
#include "esp_log.h"
@ -32,6 +33,11 @@ static void dac_init(void)
/* Install i2c driver */
ESP_ERROR_CHECK(i2c_driver_install(master_port, i2c_conf.mode, 0, 0, 0));
/* Setup LDAC pin with GPIO. Tied low */
gpio_reset_pin(DAC_LDAC_PIN);
gpio_set_direction(DAC_LDAC_PIN, GPIO_MODE_OUTPUT);
gpio_set_level(DAC_LDAC_PIN, 0);
}
void app_main(void)