#ifndef __ADC_GPIO_H__
#define __ADC_GPIO_H__

#include "msystem.h"
#include "mthread.h"
#include "com_ttySx.h"

#include "mgpio.h"

#define EPWM_NAME "/sys/class/pwm/pwmchip19"

#define I2C0_0x5A "/sys/bus/iio/devices/iio:device0"
#define I2C0_0x55 "/sys/bus/iio/devices/iio:device1"
#define I2C0_0x59 "/sys/bus/iio/devices/iio:device2"

#define I2C1_0x48 "/sys/bus/iio/devices/iio:device3"

#define I2C2_0x48 "/sys/bus/iio/devices/iio:device4"
#define I2C2_0x49 "/sys/bus/iio/devices/iio:device5"

#define I2C3_0x5A "/sys/bus/iio/devices/iio:device6"
#define I2C3_0x55 "/sys/bus/iio/devices/iio:device7"
#define I2C3_0x59 "/sys/bus/iio/devices/iio:device8"

static void set_pwm_leds(int idx, int ratio)
{
    uint8_t buff[128];
    sprintf(buff, "echo %d > /sys/class/leds/mleds%d/brightness", ratio, idx);system(buff);
}
#endif//__ADC_GPIO_H__
