![]() |
LibDriver PCF8591
|
pcf8591 base driver modules More...
Data Structures | |
| struct | pcf8591_handle_s |
| pcf8591 handle structure definition More... | |
| struct | pcf8591_info_s |
| pcf8591 information structure definition More... | |
Typedefs | |
| typedef struct pcf8591_handle_s | pcf8591_handle_t |
| pcf8591 handle structure definition | |
| typedef struct pcf8591_info_s | pcf8591_info_t |
| pcf8591 information structure definition | |
Enumerations | |
| enum | pcf8591_address_t { PCF8591_ADDRESS_A000 = 0 , PCF8591_ADDRESS_A001 = 1 , PCF8591_ADDRESS_A010 = 2 , PCF8591_ADDRESS_A011 = 3 , PCF8591_ADDRESS_A100 = 4 , PCF8591_ADDRESS_A101 = 5 , PCF8591_ADDRESS_A110 = 6 , PCF8591_ADDRESS_A111 = 7 } |
| pcf8591 address enumeration definition More... | |
| enum | pcf8591_bool_t { PCF8591_BOOL_FALSE = 0x00 , PCF8591_BOOL_TRUE = 0x01 } |
| pcf8591 bool enumeration definition More... | |
| enum | pcf8591_channel_t { PCF8591_CHANNEL_0 = 0x00 , PCF8591_CHANNEL_1 = 0x01 , PCF8591_CHANNEL_2 = 0x02 , PCF8591_CHANNEL_3 = 0x03 } |
| pcf8591 channel definition More... | |
| enum | pcf8591_mode_t { PCF8591_MODE_AIN0123_GND = 0x00 , PCF8591_MODE_AIN012_AIN3 = 0x01 , PCF8591_MODE_AIN0_GND_AND_AIN1_GND_AND_AIN2_AIN3 = 0x02 , PCF8591_MODE_AIN0_AIN1_AND_ANI2_AIN3 = 0x03 } |
| pcf8591 mode definition More... | |
Functions | |
| uint8_t | pcf8591_info (pcf8591_info_t *info) |
| get chip's information | |
| uint8_t | pcf8591_set_addr_pin (pcf8591_handle_t *handle, pcf8591_address_t addr_pin) |
| set the address pin | |
| uint8_t | pcf8591_get_addr_pin (pcf8591_handle_t *handle, pcf8591_address_t *addr_pin) |
| get the address pin | |
| uint8_t | pcf8591_init (pcf8591_handle_t *handle) |
| initialize the chip | |
| uint8_t | pcf8591_deinit (pcf8591_handle_t *handle) |
| close the chip | |
| uint8_t | pcf8591_read (pcf8591_handle_t *handle, int16_t *raw, float *adc) |
| read data from the chip | |
| uint8_t | pcf8591_multiple_read (pcf8591_handle_t *handle, int16_t *raw, float *adc, uint8_t *len) |
| read the multiple channel data from the chip | |
| uint8_t | pcf8591_write (pcf8591_handle_t *handle, uint8_t data) |
| write to the dac | |
| uint8_t | pcf8591_dac_convert_to_register (pcf8591_handle_t *handle, float dac, uint8_t *reg) |
| convert a dac value to a register raw data | |
| uint8_t | pcf8591_set_reference_voltage (pcf8591_handle_t *handle, float ref_voltage) |
| set the adc reference voltage | |
| uint8_t | pcf8591_get_reference_voltage (pcf8591_handle_t *handle, float *ref_voltage) |
| get the adc reference voltage | |
| uint8_t | pcf8591_set_channel (pcf8591_handle_t *handle, pcf8591_channel_t channel) |
| set the adc channel | |
| uint8_t | pcf8591_get_channel (pcf8591_handle_t *handle, pcf8591_channel_t *channel) |
| get the adc channel | |
| uint8_t | pcf8591_set_mode (pcf8591_handle_t *handle, pcf8591_mode_t mode) |
| set the adc mode | |
| uint8_t | pcf8591_get_mode (pcf8591_handle_t *handle, pcf8591_mode_t *mode) |
| get the adc mode | |
| uint8_t | pcf8591_set_auto_increment (pcf8591_handle_t *handle, pcf8591_bool_t enable) |
| set the adc auto increment read mode | |
| uint8_t | pcf8591_get_auto_increment (pcf8591_handle_t *handle, pcf8591_bool_t *enable) |
| get the adc auto increment read mode | |
pcf8591 base driver modules
| typedef struct pcf8591_handle_s pcf8591_handle_t |
pcf8591 handle structure definition
| typedef struct pcf8591_info_s pcf8591_info_t |
pcf8591 information structure definition
| enum pcf8591_address_t |
pcf8591 address enumeration definition
Definition at line 63 of file driver_pcf8591.h.
| enum pcf8591_bool_t |
pcf8591 bool enumeration definition
| Enumerator | |
|---|---|
| PCF8591_BOOL_FALSE | disable function |
| PCF8591_BOOL_TRUE | enable function |
Definition at line 78 of file driver_pcf8591.h.
| enum pcf8591_channel_t |
pcf8591 channel definition
| Enumerator | |
|---|---|
| PCF8591_CHANNEL_0 | channel 0 |
| PCF8591_CHANNEL_1 | channel 1 |
| PCF8591_CHANNEL_2 | channel 2 |
| PCF8591_CHANNEL_3 | channel 3 |
Definition at line 87 of file driver_pcf8591.h.
| enum pcf8591_mode_t |
pcf8591 mode definition
Definition at line 98 of file driver_pcf8591.h.
| uint8_t pcf8591_dac_convert_to_register | ( | pcf8591_handle_t * | handle, |
| float | dac, | ||
| uint8_t * | reg ) |
convert a dac value to a register raw data
| [in] | *handle | pointer to a pcf8591 handle structure |
| [in] | dac | converted dac value |
| [out] | *reg | pointer to a register raw buffer |
Definition at line 511 of file driver_pcf8591.c.
| uint8_t pcf8591_deinit | ( | pcf8591_handle_t * | handle | ) |
close the chip
| [in] | *handle | pointer to a pcf8591 handle structure |
Definition at line 425 of file driver_pcf8591.c.
| uint8_t pcf8591_get_addr_pin | ( | pcf8591_handle_t * | handle, |
| pcf8591_address_t * | addr_pin ) |
get the address pin
| [in] | *handle | pointer to a pcf8591 handle structure |
| [out] | *addr_pin | pointer to a chip address pins buffer |
Definition at line 83 of file driver_pcf8591.c.
| uint8_t pcf8591_get_auto_increment | ( | pcf8591_handle_t * | handle, |
| pcf8591_bool_t * | enable ) |
get the adc auto increment read mode
| [in] | *handle | pointer to a pcf8591 handle structure |
| [out] | *enable | pointer to a bool value buffer |
Definition at line 285 of file driver_pcf8591.c.
| uint8_t pcf8591_get_channel | ( | pcf8591_handle_t * | handle, |
| pcf8591_channel_t * | channel ) |
get the adc channel
| [in] | *handle | pointer to a pcf8591 handle structure |
| [out] | *channel | pointer to an adc channel buffer |
Definition at line 145 of file driver_pcf8591.c.
| uint8_t pcf8591_get_mode | ( | pcf8591_handle_t * | handle, |
| pcf8591_mode_t * | mode ) |
get the adc mode
| [in] | *handle | pointer to a pcf8591 handle structure |
| [out] | *mode | pointer to an adc mode buffer |
Definition at line 211 of file driver_pcf8591.c.
| uint8_t pcf8591_get_reference_voltage | ( | pcf8591_handle_t * | handle, |
| float * | ref_voltage ) |
get the adc reference voltage
| [in] | *handle | pointer to a pcf8591 handle structure |
| [out] | *ref_voltage | pointer to an adc reference voltage buffer |
Definition at line 337 of file driver_pcf8591.c.
| uint8_t pcf8591_info | ( | pcf8591_info_t * | info | ) |
get chip's information
| [out] | *info | pointer to a pcf8591 info structure |
Definition at line 949 of file driver_pcf8591.c.
| uint8_t pcf8591_init | ( | pcf8591_handle_t * | handle | ) |
initialize the chip
| [in] | *handle | pointer to a pcf8591 handle structure |
Definition at line 363 of file driver_pcf8591.c.
| uint8_t pcf8591_multiple_read | ( | pcf8591_handle_t * | handle, |
| int16_t * | raw, | ||
| float * | adc, | ||
| uint8_t * | len ) |
read the multiple channel data from the chip
| [in] | *handle | pointer to a pcf8591 handle structure |
| [out] | *raw | pointer to a raw adc buffer |
| [out] | *adc | pointer to a converted adc buffer |
| [in,out] | *len | pointer to an adc length buffer |
Definition at line 736 of file driver_pcf8591.c.
| uint8_t pcf8591_read | ( | pcf8591_handle_t * | handle, |
| int16_t * | raw, | ||
| float * | adc ) |
read data from the chip
| [in] | *handle | pointer to a pcf8591 handle structure |
| [out] | *raw | pointer to a raw adc buffer |
| [out] | *adc | pointer to a converted adc buffer |
Definition at line 539 of file driver_pcf8591.c.
| uint8_t pcf8591_set_addr_pin | ( | pcf8591_handle_t * | handle, |
| pcf8591_address_t | addr_pin ) |
set the address pin
| [in] | *handle | pointer to a pcf8591 handle structure |
| [in] | addr_pin | chip address pins |
Definition at line 61 of file driver_pcf8591.c.
| uint8_t pcf8591_set_auto_increment | ( | pcf8591_handle_t * | handle, |
| pcf8591_bool_t | enable ) |
set the adc auto increment read mode
| [in] | *handle | pointer to a pcf8591 handle structure |
| [in] | enable | bool value |
Definition at line 238 of file driver_pcf8591.c.
| uint8_t pcf8591_set_channel | ( | pcf8591_handle_t * | handle, |
| pcf8591_channel_t | channel ) |
set the adc channel
| [in] | *handle | pointer to a pcf8591 handle structure |
| [in] | channel | adc channel |
Definition at line 106 of file driver_pcf8591.c.
| uint8_t pcf8591_set_mode | ( | pcf8591_handle_t * | handle, |
| pcf8591_mode_t | mode ) |
set the adc mode
| [in] | *handle | pointer to a pcf8591 handle structure |
| [in] | mode | adc mode |
Definition at line 172 of file driver_pcf8591.c.
| uint8_t pcf8591_set_reference_voltage | ( | pcf8591_handle_t * | handle, |
| float | ref_voltage ) |
set the adc reference voltage
| [in] | *handle | pointer to a pcf8591 handle structure |
| [in] | ref_voltage | adc reference voltage |
Definition at line 311 of file driver_pcf8591.c.
| uint8_t pcf8591_write | ( | pcf8591_handle_t * | handle, |
| uint8_t | data ) |
write to the dac
| [in] | *handle | pointer to a pcf8591 handle structure |
| [in] | data | dac value |
Definition at line 471 of file driver_pcf8591.c.