![]() |
LibDriver PCA9685
|
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 | |
| #define | DRIVER_PCA9685_LINK_INIT(HANDLE, STRUCTURE) |
| initialize pca9685_handle_t structure | |
| #define | DRIVER_PCA9685_LINK_IIC_INIT(HANDLE, FUC) |
| link iic_init function | |
| #define | DRIVER_PCA9685_LINK_IIC_DEINIT(HANDLE, FUC) |
| link iic_deinit function | |
| #define | DRIVER_PCA9685_LINK_IIC_READ(HANDLE, FUC) |
| link iic_read function | |
| #define | DRIVER_PCA9685_LINK_IIC_WEITE(HANDLE, FUC) |
| link iic_write function | |
| #define | DRIVER_PCA9685_LINK_OE_GPIO_INIT(HANDLE, FUC) |
| link oe_gpio_init function | |
| #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_DELAY_MS(HANDLE, FUC) |
| link delay_ms function | |
| #define | DRIVER_PCA9685_LINK_DEBUG_PRINT(HANDLE, FUC) |
| link debug_print function | |
Typedefs | |
| typedef struct pca9685_handle_s | pca9685_handle_t |
| pca9685 handle structure definition | |
| typedef struct pca9685_info_s | pca9685_info_t |
| pca9685 information structure definition | |
Functions | |
| uint8_t | pca9685_info (pca9685_info_t *info) |
| get chip's information | |
| uint8_t | pca9685_set_addr_pin (pca9685_handle_t *handle, pca9685_address_t addr_pin) |
| set the address pin | |
| uint8_t | pca9685_get_addr_pin (pca9685_handle_t *handle, pca9685_address_t *addr_pin) |
| get the address pin | |
| uint8_t | pca9685_set_addr (pca9685_handle_t *handle, uint8_t addr) |
| set the address | |
| uint8_t | pca9685_get_addr (pca9685_handle_t *handle, uint8_t *addr) |
| get the address | |
| uint8_t | pca9685_init (pca9685_handle_t *handle) |
| initialize the chip | |
| uint8_t | pca9685_deinit (pca9685_handle_t *handle) |
| close the chip | |
| uint8_t | pca9685_write_channel (pca9685_handle_t *handle, pca9685_channel_t channel, uint16_t on_count, uint16_t off_count) |
| write led channels | |
| uint8_t | pca9685_read_channel (pca9685_handle_t *handle, pca9685_channel_t channel, uint16_t *on_count, uint16_t *off_count) |
| read led channels | |
| uint8_t | pca9685_write_all_channel (pca9685_handle_t *handle, uint16_t on_count, uint16_t off_count) |
| write all led channels | |
| 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_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 | |
| uint8_t | pca9685_set_active (pca9685_handle_t *handle, pca9685_bool_t enable) |
| set the chip active | |
| uint8_t | pca9685_set_prescaler (pca9685_handle_t *handle, uint8_t prescaler) |
| set the clock pres cale | |
| uint8_t | pca9685_get_prescaler (pca9685_handle_t *handle, uint8_t *prescaler) |
| get the clock pre scale | |
| 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_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 | |
| uint8_t | pca9685_set_restart (pca9685_handle_t *handle, pca9685_bool_t enable) |
| enable or disable restart | |
| uint8_t | pca9685_get_restart (pca9685_handle_t *handle, pca9685_bool_t *enable) |
| get the restart status | |
| 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_get_external_clock_pin (pca9685_handle_t *handle, pca9685_bool_t *enable) |
| get the external clock pin status | |
| 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_get_register_auto_increment (pca9685_handle_t *handle, pca9685_bool_t *enable) |
| get the register auto increment status | |
| uint8_t | pca9685_set_sleep_mode (pca9685_handle_t *handle, pca9685_bool_t enable) |
| enable or disable the sleep mode | |
| uint8_t | pca9685_get_sleep_mode (pca9685_handle_t *handle, pca9685_bool_t *enable) |
| get the sleep mode status | |
| 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_get_respond_subaddress_1 (pca9685_handle_t *handle, pca9685_bool_t *enable) |
| get the respond sub address 1 status | |
| 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_get_respond_subaddress_2 (pca9685_handle_t *handle, pca9685_bool_t *enable) |
| get the respond sub address 2 status | |
| 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_get_respond_subaddress_3 (pca9685_handle_t *handle, pca9685_bool_t *enable) |
| get the respond sub address 3 status | |
| uint8_t | pca9685_set_respond_all_call (pca9685_handle_t *handle, pca9685_bool_t enable) |
| enable or disable respond all call | |
| uint8_t | pca9685_get_respond_all_call (pca9685_handle_t *handle, pca9685_bool_t *enable) |
| get the respond all call status | |
| uint8_t | pca9685_set_output_invert (pca9685_handle_t *handle, pca9685_bool_t enable) |
| enable or disable output invert | |
| uint8_t | pca9685_get_output_invert (pca9685_handle_t *handle, pca9685_bool_t *enable) |
| get the output invert status | |
| uint8_t | pca9685_set_output_change (pca9685_handle_t *handle, pca9685_output_change_t change) |
| set the output change type | |
| uint8_t | pca9685_get_output_change (pca9685_handle_t *handle, pca9685_output_change_t *change) |
| get the output change type | |
| uint8_t | pca9685_set_output_driver (pca9685_handle_t *handle, pca9685_output_driver_t driver) |
| set the output driver type | |
| uint8_t | pca9685_get_output_driver (pca9685_handle_t *handle, pca9685_output_driver_t *driver) |
| get the output driver type | |
| 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_get_output_disable_type (pca9685_handle_t *handle, pca9685_output_disable_type_t *type) |
| get the output disable type | |
| uint8_t | pca9685_set_subaddress_1 (pca9685_handle_t *handle, uint8_t addr) |
| set the sub address 1 | |
| uint8_t | pca9685_get_subaddress_1 (pca9685_handle_t *handle, uint8_t *addr) |
| get the sub address 1 | |
| uint8_t | pca9685_set_subaddress_2 (pca9685_handle_t *handle, uint8_t addr) |
| set the sub address 2 | |
| uint8_t | pca9685_get_subaddress_2 (pca9685_handle_t *handle, uint8_t *addr) |
| get the sub address 2 | |
| uint8_t | pca9685_set_subaddress_3 (pca9685_handle_t *handle, uint8_t addr) |
| set the sub address 3 | |
| uint8_t | pca9685_get_subaddress_3 (pca9685_handle_t *handle, uint8_t *addr) |
| get 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_get_all_call_address (pca9685_handle_t *handle, uint8_t *addr) |
| set the all call address | |
| uint8_t | pca9685_set_reg (pca9685_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
| set the chip register | |
| uint8_t | pca9685_get_reg (pca9685_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
| get the chip register | |
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.