333 uint16_t on_count, off_count;
driver pca9685 basic header file
uint8_t pca9685_pwm_convert_to_register(pca9685_handle_t *handle, float delay_percent, float high_duty_cycle_percent, uint16_t *on_count, uint16_t *off_count)
convert the pwm to the register raw data
uint8_t pca9685_set_prescaler(pca9685_handle_t *handle, uint8_t prescaler)
set the clock pres cale
uint8_t pca9685_write_channel(pca9685_handle_t *handle, pca9685_channel_t channel, uint16_t on_count, uint16_t off_count)
write led channels
pca9685_address_t
pca9685 address enumeration definition
uint8_t pca9685_set_respond_all_call(pca9685_handle_t *handle, pca9685_bool_t enable)
enable or disable respond all call
uint8_t pca9685_init(pca9685_handle_t *handle)
initialize the chip
uint8_t pca9685_set_active(pca9685_handle_t *handle, pca9685_bool_t enable)
set the chip active
uint8_t pca9685_set_addr_pin(pca9685_handle_t *handle, pca9685_address_t addr_pin)
set the address pin
uint8_t pca9685_set_output_driver(pca9685_handle_t *handle, pca9685_output_driver_t driver)
set the output driver type
uint8_t pca9685_set_respond_subaddress_2(pca9685_handle_t *handle, pca9685_bool_t enable)
enable or disable respond sub address 2
uint8_t pca9685_set_output_disable_type(pca9685_handle_t *handle, pca9685_output_disable_type_t type)
set the output disable type
uint8_t pca9685_set_subaddress_2(pca9685_handle_t *handle, uint8_t addr)
set the sub address 2
uint8_t pca9685_output_frequency_convert_to_register(pca9685_handle_t *handle, uint32_t oscillator, uint16_t output_freq, uint8_t *reg)
convert the output frequency to the register raw data
uint8_t pca9685_set_register_auto_increment(pca9685_handle_t *handle, pca9685_bool_t enable)
enable or disable the register auto increment
uint8_t pca9685_set_respond_subaddress_3(pca9685_handle_t *handle, pca9685_bool_t enable)
enable or disable respond sub address 3
uint8_t pca9685_set_output_invert(pca9685_handle_t *handle, pca9685_bool_t enable)
enable or disable output invert
pca9685_channel_t
pca9685 channel enumeration definition
uint8_t pca9685_set_subaddress_1(pca9685_handle_t *handle, uint8_t addr)
set the sub address 1
#define PCA9685_OSCILLATOR_INTERNAL_FREQUENCY
pca9685 internal oscillator frequency
uint8_t pca9685_set_sleep_mode(pca9685_handle_t *handle, pca9685_bool_t enable)
enable or disable the sleep mode
uint8_t pca9685_set_external_clock_pin(pca9685_handle_t *handle, pca9685_bool_t enable)
enable or disable the external clock pin
uint8_t pca9685_deinit(pca9685_handle_t *handle)
close the chip
uint8_t pca9685_set_respond_subaddress_1(pca9685_handle_t *handle, pca9685_bool_t enable)
enable or disable respond sub address 1
uint8_t pca9685_set_subaddress_3(pca9685_handle_t *handle, uint8_t addr)
set the sub address 3
uint8_t pca9685_set_all_call_address(pca9685_handle_t *handle, uint8_t addr)
set the all call address
uint8_t pca9685_set_output_change(pca9685_handle_t *handle, pca9685_output_change_t change)
set the output change type
@ PCA9685_OUTPUT_DISABLE_TYPE_HIGH_IMPEDANCE
#define PCA9685_BASIC_DEFAULT_SUBADDRESS_1
#define PCA9685_BASIC_DEFAULT_ALL_CALL_ADDRESS
#define PCA9685_BASIC_DEFAULT_RESPOND_ALL_CALL
#define PCA9685_BASIC_DEFAULT_OUTPUT_DRIVER
#define PCA9685_BASIC_DEFAULT_RESPOND_SUBADDRESS_1
pca9685 basic example default definition
#define PCA9685_BASIC_DEFAULT_OUTPUT_INVERT
uint8_t pca9685_basic_deinit(void)
basic example deinit
#define PCA9685_BASIC_DEFAULT_SUBADDRESS_3
#define PCA9685_BASIC_DEFAULT_SUBADDRESS_2
#define PCA9685_BASIC_DEFAULT_OUTPUT_CHANGE
uint8_t pca9685_basic_init(pca9685_address_t addr, uint16_t hz)
basic example init
uint8_t pca9685_basic_write(pca9685_channel_t channel, float delay_percent, float high_duty_cycle_percent)
basic example write
#define PCA9685_BASIC_DEFAULT_RESPOND_SUBADDRESS_2
void pca9685_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t pca9685_interface_oe_deinit(void)
interface oe deinit
uint8_t pca9685_interface_oe_init(void)
interface oe init
uint8_t pca9685_interface_iic_deinit(void)
interface iic bus deinit
uint8_t pca9685_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
uint8_t pca9685_interface_iic_init(void)
interface iic bus init
void pca9685_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t pca9685_interface_oe_write(uint8_t value)
interface oe write
uint8_t pca9685_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
#define DRIVER_PCA9685_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_PCA9685_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_PCA9685_LINK_IIC_READ(HANDLE, FUC)
link iic_read function
#define DRIVER_PCA9685_LINK_OE_GPIO_INIT(HANDLE, FUC)
link oe_gpio_init function
#define DRIVER_PCA9685_LINK_INIT(HANDLE, STRUCTURE)
initialize pca9685_handle_t structure
#define DRIVER_PCA9685_LINK_OE_GPIO_DEINIT(HANDLE, FUC)
link oe_gpio_deinit function
#define DRIVER_PCA9685_LINK_OE_GPIO_WRITE(HANDLE, FUC)
link oe_gpio_write function
#define DRIVER_PCA9685_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_PCA9685_LINK_IIC_WEITE(HANDLE, FUC)
link iic_write function
#define DRIVER_PCA9685_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
pca9685 handle structure definition