![]() |
LibDriver MCP4725
|
mcp4725 base driver modules More...
Data Structures | |
| struct | mcp4725_handle_s |
| mcp4725 handle structure definition More... | |
| struct | mcp4725_info_s |
| mcp4725 information structure definition More... | |
Typedefs | |
| typedef struct mcp4725_handle_s | mcp4725_handle_t |
| mcp4725 handle structure definition | |
| typedef struct mcp4725_info_s | mcp4725_info_t |
| mcp4725 information structure definition | |
Enumerations | |
| enum | mcp4725_address_t { MCP4725_ADDR_A0_GND = 0x00 , MCP4725_ADDR_A0_VCC = 0x01 } |
| mcp4725 address enumeration definition More... | |
| enum | mcp4725_mode_t { MCP4725_MODE_DAC = 0x00 , MCP4725_MODE_EEPROM = 0x03 } |
| mcp4725 mode enumeration definition More... | |
| enum | mcp4725_power_down_mode_t { MCP4725_POWER_DOWN_MODE_NORMAL = 0x00 , MCP4725_POWER_DOWN_MODE_1K_GND = 0x01 , MCP4725_POWER_DOWN_MODE_100K_GND = 0x02 , MCP4725_POWER_DOWN_MODE_500K_GND = 0x03 } |
| mcp4725 power down enumeration definition More... | |
Functions | |
| uint8_t | mcp4725_info (mcp4725_info_t *info) |
| get chip's information | |
| uint8_t | mcp4725_set_addr_pin (mcp4725_handle_t *handle, mcp4725_address_t addr_pin) |
| set the chip address pin | |
| uint8_t | mcp4725_get_addr_pin (mcp4725_handle_t *handle, mcp4725_address_t *addr_pin) |
| get the chip address pin | |
| uint8_t | mcp4725_init (mcp4725_handle_t *handle) |
| initialize the chip | |
| uint8_t | mcp4725_deinit (mcp4725_handle_t *handle) |
| close the chip | |
| uint8_t | mcp4725_write (mcp4725_handle_t *handle, uint16_t value) |
| write the dac value | |
| uint8_t | mcp4725_read (mcp4725_handle_t *handle, uint16_t *value) |
| read the dac value | |
| uint8_t | mcp4725_convert_to_register (mcp4725_handle_t *handle, float s, uint16_t *reg) |
| convert the dac value to the register data | |
| uint8_t | mcp4725_convert_to_data (mcp4725_handle_t *handle, uint16_t reg, float *s) |
| convert the register data to the dac value | |
| uint8_t | mcp4725_set_mode (mcp4725_handle_t *handle, mcp4725_mode_t mode) |
| set the chip mode | |
| uint8_t | mcp4725_get_mode (mcp4725_handle_t *handle, mcp4725_mode_t *mode) |
| get the chip mode | |
| uint8_t | mcp4725_set_power_mode (mcp4725_handle_t *handle, mcp4725_power_down_mode_t mode) |
| set the chip power mode | |
| uint8_t | mcp4725_get_power_mode (mcp4725_handle_t *handle, mcp4725_power_down_mode_t *mode) |
| get the chip power mode | |
| uint8_t | mcp4725_set_reference_voltage (mcp4725_handle_t *handle, float ref_voltage) |
| set the chip reference voltage | |
| uint8_t | mcp4725_get_reference_voltage (mcp4725_handle_t *handle, float *ref_voltage) |
| get the chip reference voltage | |
mcp4725 base driver modules
| typedef struct mcp4725_handle_s mcp4725_handle_t |
mcp4725 handle structure definition
| typedef struct mcp4725_info_s mcp4725_info_t |
mcp4725 information structure definition
| enum mcp4725_address_t |
mcp4725 address enumeration definition
| Enumerator | |
|---|---|
| MCP4725_ADDR_A0_GND | A0 pin connected to GND |
| MCP4725_ADDR_A0_VCC | A0 pin connected to VCC |
Definition at line 63 of file driver_mcp4725.h.
| enum mcp4725_mode_t |
mcp4725 mode enumeration definition
| Enumerator | |
|---|---|
| MCP4725_MODE_DAC | DAC mode |
| MCP4725_MODE_EEPROM | EEPROM mode |
Definition at line 72 of file driver_mcp4725.h.
mcp4725 power down enumeration definition
Definition at line 81 of file driver_mcp4725.h.
| uint8_t mcp4725_convert_to_data | ( | mcp4725_handle_t * | handle, |
| uint16_t | reg, | ||
| float * | s ) |
convert the register data to the dac value
| [in] | *handle | pointer to an mcp4725 handle structure |
| [in] | reg | register data |
| [out] | *s | pointer to a converted dac value buffer |
Definition at line 508 of file driver_mcp4725.c.
| uint8_t mcp4725_convert_to_register | ( | mcp4725_handle_t * | handle, |
| float | s, | ||
| uint16_t * | reg ) |
convert the dac value to the register data
| [in] | *handle | pointer to an mcp4725 handle structure |
| [in] | s | converted dac value |
| [out] | *reg | pointer to a register data buffer |
Definition at line 474 of file driver_mcp4725.c.
| uint8_t mcp4725_deinit | ( | mcp4725_handle_t * | handle | ) |
close the chip
| [in] | *handle | pointer to an mcp4725 handle structure |
Definition at line 125 of file driver_mcp4725.c.
| uint8_t mcp4725_get_addr_pin | ( | mcp4725_handle_t * | handle, |
| mcp4725_address_t * | addr_pin ) |
get the chip address pin
| [in] | *handle | pointer to an mcp4725 handle structure |
| [out] | *addr_pin | pointer to an address pin buffer |
Definition at line 177 of file driver_mcp4725.c.
| uint8_t mcp4725_get_mode | ( | mcp4725_handle_t * | handle, |
| mcp4725_mode_t * | mode ) |
get the chip mode
| [in] | *handle | pointer to an mcp4725 handle structure |
| [out] | *mode | pointer to a chip mode buffer |
Definition at line 232 of file driver_mcp4725.c.
| uint8_t mcp4725_get_power_mode | ( | mcp4725_handle_t * | handle, |
| mcp4725_power_down_mode_t * | mode ) |
get the chip power mode
| [in] | *handle | pointer to an mcp4725 handle structure |
| [out] | *mode | pointer to a chip power down mode buffer |
Definition at line 284 of file driver_mcp4725.c.
| uint8_t mcp4725_get_reference_voltage | ( | mcp4725_handle_t * | handle, |
| float * | ref_voltage ) |
get the chip reference voltage
| [in] | *handle | pointer to an mcp4725 handle structure |
| [out] | *ref_voltage | pointer to a chip reference voltage buffer |
Definition at line 336 of file driver_mcp4725.c.
| uint8_t mcp4725_info | ( | mcp4725_info_t * | info | ) |
get chip's information
| [out] | *info | pointer to an mcp4725 info structure |
Definition at line 584 of file driver_mcp4725.c.
| uint8_t mcp4725_init | ( | mcp4725_handle_t * | handle | ) |
initialize the chip
| [in] | *handle | pointer to an mcp4725 handle structure |
Definition at line 63 of file driver_mcp4725.c.
| uint8_t mcp4725_read | ( | mcp4725_handle_t * | handle, |
| uint16_t * | value ) |
read the dac value
| [in] | *handle | pointer to an mcp4725 handle structure |
| [out] | *value | pointer to a dac buffer |
Definition at line 363 of file driver_mcp4725.c.
| uint8_t mcp4725_set_addr_pin | ( | mcp4725_handle_t * | handle, |
| mcp4725_address_t | addr_pin ) |
set the chip address pin
| [in] | *handle | pointer to an mcp4725 handle structure |
| [in] | addr_pin | address pin |
Definition at line 156 of file driver_mcp4725.c.
| uint8_t mcp4725_set_mode | ( | mcp4725_handle_t * | handle, |
| mcp4725_mode_t | mode ) |
set the chip mode
| [in] | *handle | pointer to an mcp4725 handle structure |
| [in] | mode | chip mode |
Definition at line 206 of file driver_mcp4725.c.
| uint8_t mcp4725_set_power_mode | ( | mcp4725_handle_t * | handle, |
| mcp4725_power_down_mode_t | mode ) |
set the chip power mode
| [in] | *handle | pointer to an mcp4725 handle structure |
| [in] | mode | chip power down mode |
Definition at line 258 of file driver_mcp4725.c.
| uint8_t mcp4725_set_reference_voltage | ( | mcp4725_handle_t * | handle, |
| float | ref_voltage ) |
set the chip reference voltage
| [in] | *handle | pointer to an mcp4725 handle structure |
| [in] | ref_voltage | chip reference voltage |
Definition at line 310 of file driver_mcp4725.c.
| uint8_t mcp4725_write | ( | mcp4725_handle_t * | handle, |
| uint16_t | value ) |
write the dac value
| [in] | *handle | pointer to an mcp4725 handle structure |
| [in] | value | dac value |
Definition at line 414 of file driver_mcp4725.c.