#ifndef PCA9685_H
#define PCA9685_H

#include "driver/i2c.h"
#include <stdint.h>

// 定义寄存器地址
#define MODE1       0x00
#define MODE1_RESTART 0x80
#define MODE1_AI    0x20
#define MODE1_SLEEP 0x10
#define MODE1_ALLCALL 0x01
#define PRESCALE    0xFE
#define LED0_ON_L   0x06
#define ALL_LED_OFF_H 0xFD

void pca9685_init(i2c_port_t i2c_num, uint8_t addr);
void pca9685_set_pwm_freq(i2c_port_t i2c_num, uint8_t addr, float freq);
void pca9685_set_angle(i2c_port_t i2c_num, uint8_t addr, uint8_t channel, float angle);

void pca9685_set_angles(i2c_port_t i2c_num, uint8_t addr,uint8_t start_ch, uint8_t count,const float *angles);

#endif