no-OS
|
Header file of AD799x Driver. More...
Go to the source code of this file.
Classes | |
struct | ad799x_dev |
struct | ad799x_init_param |
Macros | |
#define | AD799X_CHANNEL(ch) ((1 << ch) << 4) |
#define | AD799X_REF_SEL (1 << 3) |
#define | AD799X_FLTR (1 << 2) |
#define | AD799X_BIT_TRIAL_DELAY (1 << 1) |
#define | AD799X_SAMPLE_DELAY (1 << 0) |
Enumerations | |
enum | ad799x_type { AD7991, AD7995, AD7999 } |
Functions | |
int8_t | ad799x_init (struct ad799x_dev **device, struct ad799x_init_param init_param) |
Initializes I2C. More... | |
int32_t | ad799x_remove (struct ad799x_dev *dev) |
Free the resources allocated by ad799x_init(). More... | |
void | ad799x_set_configuration_reg (struct ad799x_dev *dev, uint8_t register_value) |
Writes data into the Configuration Register. More... | |
void | ad799x_get_conversion_result (struct ad799x_dev *dev, int16_t *conv_value, int8_t *channel) |
Reads the High byte and the Low byte of the conversion. More... | |
float | ad799x_convert_to_volts (struct ad799x_dev *dev, int16_t raw_sample, float v_ref) |
Converts a raw sample to volts. More... | |
Header file of AD799x Driver.
Copyright 2012(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AD799X_BIT_TRIAL_DELAY (1 << 1) |
#define AD799X_CHANNEL | ( | ch | ) | ((1 << ch) << 4) |
#define AD799X_FLTR (1 << 2) |
#define AD799X_REF_SEL (1 << 3) |
#define AD799X_SAMPLE_DELAY (1 << 0) |
enum ad799x_type |
float ad799x_convert_to_volts | ( | struct ad799x_dev * | dev, |
int16_t | raw_sample, | ||
float | v_ref | ||
) |
Converts a raw sample to volts.
Converts a raw sample to volts.
dev | - The device structure. |
raw_sample | - The data sample. |
v_ref | - The value of the voltage reference used by the device. |
void ad799x_get_conversion_result | ( | struct ad799x_dev * | dev, |
int16_t * | conv_value, | ||
int8_t * | channel | ||
) |
Reads the High byte and the Low byte of the conversion.
Reads the High byte and the Low byte of the conversion.
dev | - The device structure. |
conv_value | - It is used to store the conversion value. |
channel | - Stores the channel number for the current conversion. |
int8_t ad799x_init | ( | struct ad799x_dev ** | device, |
struct ad799x_init_param | init_param | ||
) |
Initializes I2C.
Initializes I2C.
device | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
int32_t ad799x_remove | ( | struct ad799x_dev * | dev | ) |
Free the resources allocated by ad799x_init().
Free the resources allocated by ad799x_init().
dev | - The device structure. |
void ad799x_set_configuration_reg | ( | struct ad799x_dev * | dev, |
uint8_t | register_value | ||
) |
Writes data into the Configuration Register.
Writes data into the Configuration Register.
dev | - The device structure. |
register_value | - Data value to write. |