![]() |
LibDriver PCA9685
1.0.0
PCA9685 full-featured driver
|
driver pca9685 header file More...
#include <stdio.h>
#include <stdint.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | pca9685_handle_s |
pca9685 handle structure definition More... | |
struct | pca9685_info_s |
pca9685 information structure definition More... | |
Macros | |
#define | PCA9685_OSCILLATOR_INTERNAL_FREQUENCY 25000000 |
pca9685 internal oscillator frequency More... | |
#define | DRIVER_PCA9685_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE)) |
initialize pca9685_handle_t structure More... | |
#define | DRIVER_PCA9685_LINK_IIC_INIT(HANDLE, FUC) (HANDLE)->iic_init = FUC |
link iic_init function More... | |
#define | DRIVER_PCA9685_LINK_IIC_DEINIT(HANDLE, FUC) (HANDLE)->iic_deinit = FUC |
link iic_deinit function More... | |
#define | DRIVER_PCA9685_LINK_IIC_READ(HANDLE, FUC) (HANDLE)->iic_read = FUC |
link iic_read function More... | |
#define | DRIVER_PCA9685_LINK_IIC_WEITE(HANDLE, FUC) (HANDLE)->iic_write = FUC |
link iic_write function More... | |
#define | DRIVER_PCA9685_LINK_OE_GPIO_INIT(HANDLE, FUC) (HANDLE)->oe_gpio_init = FUC |
link oe_gpio_init function More... | |
#define | DRIVER_PCA9685_LINK_OE_GPIO_DEINIT(HANDLE, FUC) (HANDLE)->oe_gpio_deinit = FUC |
link oe_gpio_deinit function More... | |
#define | DRIVER_PCA9685_LINK_OE_GPIO_WRITE(HANDLE, FUC) (HANDLE)->oe_gpio_write = FUC |
link oe_gpio_write function More... | |
#define | DRIVER_PCA9685_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC |
link delay_ms function More... | |
#define | DRIVER_PCA9685_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC |
link debug_print function More... | |
Typedefs | |
typedef struct pca9685_handle_s | pca9685_handle_t |
pca9685 handle structure definition More... | |
typedef struct pca9685_info_s | pca9685_info_t |
pca9685 information structure definition More... | |
Functions | |
uint8_t | pca9685_info (pca9685_info_t *info) |
get chip's information More... | |
uint8_t | pca9685_set_addr_pin (pca9685_handle_t *handle, pca9685_address_t addr_pin) |
set the address pin More... | |
uint8_t | pca9685_get_addr_pin (pca9685_handle_t *handle, pca9685_address_t *addr_pin) |
get the address pin More... | |
uint8_t | pca9685_set_addr (pca9685_handle_t *handle, uint8_t addr) |
set the address More... | |
uint8_t | pca9685_get_addr (pca9685_handle_t *handle, uint8_t *addr) |
get the address More... | |
uint8_t | pca9685_init (pca9685_handle_t *handle) |
initialize the chip More... | |
uint8_t | pca9685_deinit (pca9685_handle_t *handle) |
close the chip More... | |
uint8_t | pca9685_write_channel (pca9685_handle_t *handle, pca9685_channel_t channel, uint16_t on_count, uint16_t off_count) |
write led channels More... | |
uint8_t | pca9685_read_channel (pca9685_handle_t *handle, pca9685_channel_t channel, uint16_t *on_count, uint16_t *off_count) |
read led channels More... | |
uint8_t | pca9685_write_all_channel (pca9685_handle_t *handle, uint16_t on_count, uint16_t off_count) |
write all led channels More... | |
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 More... | |
uint8_t | pca9685_pwm_convert_to_data (pca9685_handle_t *handle, uint16_t on_count, uint16_t off_count, float *delay_percent, float *high_duty_cycle_percent) |
convert the register raw data to the pwm More... | |
uint8_t | pca9685_set_active (pca9685_handle_t *handle, pca9685_bool_t enable) |
set the chip active More... | |
uint8_t | pca9685_set_prescaler (pca9685_handle_t *handle, uint8_t prescaler) |
set the clock pres cale More... | |
uint8_t | pca9685_get_prescaler (pca9685_handle_t *handle, uint8_t *prescaler) |
get the clock pre scale More... | |
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 More... | |
uint8_t | pca9685_output_frequency_convert_to_data (pca9685_handle_t *handle, uint32_t oscillator, uint8_t reg, uint16_t *output_freq) |
convert the register raw data to the output frequency More... | |
uint8_t | pca9685_set_restart (pca9685_handle_t *handle, pca9685_bool_t enable) |
enable or disable restart More... | |
uint8_t | pca9685_get_restart (pca9685_handle_t *handle, pca9685_bool_t *enable) |
get the restart status More... | |
uint8_t | pca9685_set_external_clock_pin (pca9685_handle_t *handle, pca9685_bool_t enable) |
enable or disable the external clock pin More... | |
uint8_t | pca9685_get_external_clock_pin (pca9685_handle_t *handle, pca9685_bool_t *enable) |
get the external clock pin status More... | |
uint8_t | pca9685_set_register_auto_increment (pca9685_handle_t *handle, pca9685_bool_t enable) |
enable or disable the register auto increment More... | |
uint8_t | pca9685_get_register_auto_increment (pca9685_handle_t *handle, pca9685_bool_t *enable) |
get the register auto increment status More... | |
uint8_t | pca9685_set_sleep_mode (pca9685_handle_t *handle, pca9685_bool_t enable) |
enable or disable the sleep mode More... | |
uint8_t | pca9685_get_sleep_mode (pca9685_handle_t *handle, pca9685_bool_t *enable) |
get the sleep mode status More... | |
uint8_t | pca9685_set_respond_subaddress_1 (pca9685_handle_t *handle, pca9685_bool_t enable) |
enable or disable respond sub address 1 More... | |
uint8_t | pca9685_get_respond_subaddress_1 (pca9685_handle_t *handle, pca9685_bool_t *enable) |
get the respond sub address 1 status More... | |
uint8_t | pca9685_set_respond_subaddress_2 (pca9685_handle_t *handle, pca9685_bool_t enable) |
enable or disable respond sub address 2 More... | |
uint8_t | pca9685_get_respond_subaddress_2 (pca9685_handle_t *handle, pca9685_bool_t *enable) |
get the respond sub address 2 status More... | |
uint8_t | pca9685_set_respond_subaddress_3 (pca9685_handle_t *handle, pca9685_bool_t enable) |
enable or disable respond sub address 3 More... | |
uint8_t | pca9685_get_respond_subaddress_3 (pca9685_handle_t *handle, pca9685_bool_t *enable) |
get the respond sub address 3 status More... | |
uint8_t | pca9685_set_respond_all_call (pca9685_handle_t *handle, pca9685_bool_t enable) |
enable or disable respond all call More... | |
uint8_t | pca9685_get_respond_all_call (pca9685_handle_t *handle, pca9685_bool_t *enable) |
get the respond all call status More... | |
uint8_t | pca9685_set_output_invert (pca9685_handle_t *handle, pca9685_bool_t enable) |
enable or disable output invert More... | |
uint8_t | pca9685_get_output_invert (pca9685_handle_t *handle, pca9685_bool_t *enable) |
get the output invert status More... | |
uint8_t | pca9685_set_output_change (pca9685_handle_t *handle, pca9685_output_change_t change) |
set the output change type More... | |
uint8_t | pca9685_get_output_change (pca9685_handle_t *handle, pca9685_output_change_t *change) |
get the output change type More... | |
uint8_t | pca9685_set_output_driver (pca9685_handle_t *handle, pca9685_output_driver_t driver) |
set the output driver type More... | |
uint8_t | pca9685_get_output_driver (pca9685_handle_t *handle, pca9685_output_driver_t *driver) |
get the output driver type More... | |
uint8_t | pca9685_set_output_disable_type (pca9685_handle_t *handle, pca9685_output_disable_type_t type) |
set the output disable type More... | |
uint8_t | pca9685_get_output_disable_type (pca9685_handle_t *handle, pca9685_output_disable_type_t *type) |
get the output disable type More... | |
uint8_t | pca9685_set_subaddress_1 (pca9685_handle_t *handle, uint8_t addr) |
set the sub address 1 More... | |
uint8_t | pca9685_get_subaddress_1 (pca9685_handle_t *handle, uint8_t *addr) |
get the sub address 1 More... | |
uint8_t | pca9685_set_subaddress_2 (pca9685_handle_t *handle, uint8_t addr) |
set the sub address 2 More... | |
uint8_t | pca9685_get_subaddress_2 (pca9685_handle_t *handle, uint8_t *addr) |
get the sub address 2 More... | |
uint8_t | pca9685_set_subaddress_3 (pca9685_handle_t *handle, uint8_t addr) |
set the sub address 3 More... | |
uint8_t | pca9685_get_subaddress_3 (pca9685_handle_t *handle, uint8_t *addr) |
get the sub address 3 More... | |
uint8_t | pca9685_set_all_call_address (pca9685_handle_t *handle, uint8_t addr) |
set the all call address More... | |
uint8_t | pca9685_get_all_call_address (pca9685_handle_t *handle, uint8_t *addr) |
set the all call address More... | |
uint8_t | pca9685_set_reg (pca9685_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
set the chip register More... | |
uint8_t | pca9685_get_reg (pca9685_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
get the chip register More... | |
driver pca9685 header file
Copyright (c) 2015 - present LibDriver All rights reserved
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Date | Version | Author | Description |
---|---|---|---|
2022/02/20 | 1.0 | Shifeng Li | first upload |
Definition in file driver_pca9685.h.