![]() |
LibDriver MCP3421
|
mcp3421 base driver modules More...
Data Structures | |
| struct | mcp3421_handle_s |
| mcp3421 handle structure definition More... | |
| struct | mcp3421_info_s |
| mcp3421 information structure definition More... | |
Typedefs | |
| typedef struct mcp3421_handle_s | mcp3421_handle_t |
| mcp3421 handle structure definition | |
| typedef struct mcp3421_info_s | mcp3421_info_t |
| mcp3421 information structure definition | |
Enumerations | |
| enum | mcp3421_bit_t { MCP3421_BIT_12 = 0x00 , MCP3421_BIT_14 = 0x01 , MCP3421_BIT_16 = 0x02 , MCP3421_BIT_18 = 0x03 } |
| mcp3421 bit enumeration definition More... | |
| enum | mcp3421_pga_t { MCP3421_PGA_1 = 0x00 , MCP3421_PGA_2 = 0x01 , MCP3421_PGA_4 = 0x02 , MCP3421_PGA_8 = 0x03 } |
| mcp3421 pga enumeration definition More... | |
Functions | |
| uint8_t | mcp3421_info (mcp3421_info_t *info) |
| get chip's information | |
| uint8_t | mcp3421_init (mcp3421_handle_t *handle) |
| initialize the chip | |
| uint8_t | mcp3421_deinit (mcp3421_handle_t *handle) |
| close the chip | |
| uint8_t | mcp3421_single_read (mcp3421_handle_t *handle, int32_t *raw, double *v) |
| read data from the chip once | |
| uint8_t | mcp3421_start_continuous_read (mcp3421_handle_t *handle) |
| start the chip reading | |
| uint8_t | mcp3421_stop_continuous_read (mcp3421_handle_t *handle) |
| stop the chip reading | |
| uint8_t | mcp3421_continuous_read (mcp3421_handle_t *handle, int32_t *raw, double *v) |
| read data from the chip continuously | |
| uint8_t | mcp3421_set_adc_bit (mcp3421_handle_t *handle, mcp3421_bit_t adc_bit) |
| set the adc bit | |
| uint8_t | mcp3421_get_adc_bit (mcp3421_handle_t *handle, mcp3421_bit_t *adc_bit) |
| get the adc bit | |
| uint8_t | mcp3421_set_pga (mcp3421_handle_t *handle, mcp3421_pga_t pga) |
| set the adc pga | |
| uint8_t | mcp3421_get_pga (mcp3421_handle_t *handle, mcp3421_pga_t *pga) |
| get the adc pga | |
mcp3421 base driver modules
| typedef struct mcp3421_handle_s mcp3421_handle_t |
mcp3421 handle structure definition
| typedef struct mcp3421_info_s mcp3421_info_t |
mcp3421 information structure definition
| enum mcp3421_bit_t |
mcp3421 bit enumeration definition
| Enumerator | |
|---|---|
| MCP3421_BIT_12 | 240 sps 12 bits |
| MCP3421_BIT_14 | 60 sps 14 bits |
| MCP3421_BIT_16 | 15 sps 16 bits |
| MCP3421_BIT_18 | 3.75 sps 18 bits |
Definition at line 62 of file driver_mcp3421.h.
| enum mcp3421_pga_t |
mcp3421 pga enumeration definition
| Enumerator | |
|---|---|
| MCP3421_PGA_1 | pga 1 |
| MCP3421_PGA_2 | pga 2 |
| MCP3421_PGA_4 | pga 4 |
| MCP3421_PGA_8 | pga 8 |
Definition at line 73 of file driver_mcp3421.h.
| uint8_t mcp3421_continuous_read | ( | mcp3421_handle_t * | handle, |
| int32_t * | raw, | ||
| double * | v ) |
read data from the chip continuously
| [in] | *handle | pointer to an mcp3421 handle structure |
| [out] | *raw | pointer to a raw adc buffer |
| [out] | *v | pointer to a converted adc buffer |
Definition at line 549 of file driver_mcp3421.c.
| uint8_t mcp3421_deinit | ( | mcp3421_handle_t * | handle | ) |
close the chip
| [in] | *handle | pointer to an mcp3421 handle structure |
Definition at line 174 of file driver_mcp3421.c.
| uint8_t mcp3421_get_adc_bit | ( | mcp3421_handle_t * | handle, |
| mcp3421_bit_t * | adc_bit ) |
get the adc bit
| [in] | *handle | pointer to an mcp3421 handle structure |
| [out] | *adc_bit | pointer to an adc bit buffer |
Definition at line 271 of file driver_mcp3421.c.
| uint8_t mcp3421_get_pga | ( | mcp3421_handle_t * | handle, |
| mcp3421_pga_t * | pga ) |
get the adc pga
| [in] | *handle | pointer to an mcp3421 handle structure |
| [out] | *pga | pointer to a pga buffer |
Definition at line 353 of file driver_mcp3421.c.
| uint8_t mcp3421_info | ( | mcp3421_info_t * | info | ) |
get chip's information
| [out] | *info | pointer to an mcp3421 info structure |
Definition at line 807 of file driver_mcp3421.c.
| uint8_t mcp3421_init | ( | mcp3421_handle_t * | handle | ) |
initialize the chip
| [in] | *handle | pointer to an mcp3421 handle structure |
Definition at line 111 of file driver_mcp3421.c.
| uint8_t mcp3421_set_adc_bit | ( | mcp3421_handle_t * | handle, |
| mcp3421_bit_t | adc_bit ) |
set the adc bit
| [in] | *handle | pointer to an mcp3421 handle structure |
| [in] | adc_bit | set adc bit |
Definition at line 226 of file driver_mcp3421.c.
| uint8_t mcp3421_set_pga | ( | mcp3421_handle_t * | handle, |
| mcp3421_pga_t | pga ) |
set the adc pga
| [in] | *handle | pointer to an mcp3421 handle structure |
| [in] | pga | set pga |
Definition at line 308 of file driver_mcp3421.c.
| uint8_t mcp3421_single_read | ( | mcp3421_handle_t * | handle, |
| int32_t * | raw, | ||
| double * | v ) |
read data from the chip once
| [in] | *handle | pointer to an mcp3421 handle structure |
| [out] | *raw | pointer to a raw adc buffer |
| [out] | *v | pointer to a converted adc buffer |
Definition at line 392 of file driver_mcp3421.c.
| uint8_t mcp3421_start_continuous_read | ( | mcp3421_handle_t * | handle | ) |
start the chip reading
| [in] | *handle | pointer to an mcp3421 handle structure |
Definition at line 668 of file driver_mcp3421.c.
| uint8_t mcp3421_stop_continuous_read | ( | mcp3421_handle_t * | handle | ) |
stop the chip reading
| [in] | *handle | pointer to an mcp3421 handle structure |
Definition at line 713 of file driver_mcp3421.c.