Linux Kernel
3.7.1
|
Go to the source code of this file.
Data Structures | |
struct | ad_sd_calib_data |
struct | ad_sigma_delta_info |
struct | ad_sigma_delta |
Macros | |
#define | __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, _storagebits, _shift, _extend_name, _type) |
#define | AD_SD_DIFF_CHANNEL(_si, _channel1, _channel2, _address, _bits, _storagebits, _shift) |
#define | AD_SD_SHORTED_CHANNEL(_si, _channel, _address, _bits, _storagebits, _shift) |
#define | AD_SD_CHANNEL(_si, _channel, _address, _bits, _storagebits, _shift) |
#define | AD_SD_TEMP_CHANNEL(_si, _address, _bits, _storagebits, _shift) |
#define | AD_SD_SUPPLY_CHANNEL(_si, _channel, _address, _bits, _storagebits, _shift) |
Enumerations | |
enum | ad_sigma_delta_mode { AD_SD_MODE_CONTINUOUS = 0, AD_SD_MODE_SINGLE = 1, AD_SD_MODE_IDLE = 2, AD_SD_MODE_POWERDOWN = 3 } |
Functions | |
void | ad_sd_set_comm (struct ad_sigma_delta *sigma_delta, uint8_t comm) |
int | ad_sd_write_reg (struct ad_sigma_delta *sigma_delta, unsigned int reg, unsigned int size, unsigned int val) |
int | ad_sd_read_reg (struct ad_sigma_delta *sigma_delta, unsigned int reg, unsigned int size, unsigned int *val) |
int | ad_sigma_delta_single_conversion (struct iio_dev *indio_dev, const struct iio_chan_spec *chan, int *val) |
int | ad_sd_calibrate_all (struct ad_sigma_delta *sigma_delta, const struct ad_sd_calib_data *cd, unsigned int n) |
int | ad_sd_init (struct ad_sigma_delta *sigma_delta, struct iio_dev *indio_dev, struct spi_device *spi, const struct ad_sigma_delta_info *info) |
int | ad_sd_setup_buffer_and_trigger (struct iio_dev *indio_dev) |
void | ad_sd_cleanup_buffer_and_trigger (struct iio_dev *indio_dev) |
int | ad_sd_validate_trigger (struct iio_dev *indio_dev, struct iio_trigger *trig) |
Variables | |
enum ad_sigma_delta_mode | __attribute__ |
#define __AD_SD_CHANNEL | ( | _si, | |
_channel1, | |||
_channel2, | |||
_address, | |||
_bits, | |||
_storagebits, | |||
_shift, | |||
_extend_name, | |||
_type | |||
) |
Definition at line 126 of file ad_sigma_delta.h.
#define AD_SD_CHANNEL | ( | _si, | |
_channel, | |||
_address, | |||
_bits, | |||
_storagebits, | |||
_shift | |||
) |
Definition at line 159 of file ad_sigma_delta.h.
#define AD_SD_DIFF_CHANNEL | ( | _si, | |
_channel1, | |||
_channel2, | |||
_address, | |||
_bits, | |||
_storagebits, | |||
_shift | |||
) |
Definition at line 149 of file ad_sigma_delta.h.
#define AD_SD_SHORTED_CHANNEL | ( | _si, | |
_channel, | |||
_address, | |||
_bits, | |||
_storagebits, | |||
_shift | |||
) |
Definition at line 154 of file ad_sigma_delta.h.
#define AD_SD_SUPPLY_CHANNEL | ( | _si, | |
_channel, | |||
_address, | |||
_bits, | |||
_storagebits, | |||
_shift | |||
) |
Definition at line 168 of file ad_sigma_delta.h.
#define AD_SD_TEMP_CHANNEL | ( | _si, | |
_address, | |||
_bits, | |||
_storagebits, | |||
_shift | |||
) |
Definition at line 164 of file ad_sigma_delta.h.
enum ad_sigma_delta_mode |
Definition at line 12 of file ad_sigma_delta.h.
int ad_sd_calibrate_all | ( | struct ad_sigma_delta * | sigma_delta, |
const struct ad_sd_calib_data * | cb, | ||
unsigned int | n | ||
) |
ad_sd_calibrate_all() - Performs channel calibration : The sigma delta device : Array of channels and calibration type to perform
: Number of items in cb
Returns 0 on success, an error code otherwise.
Definition at line 223 of file ad_sigma_delta.c.
ad_sd_cleanup_buffer_and_trigger() - : The IIO device
Definition at line 528 of file ad_sigma_delta.c.
int ad_sd_init | ( | struct ad_sigma_delta * | sigma_delta, |
struct iio_dev * | indio_dev, | ||
struct spi_device * | spi, | ||
const struct ad_sigma_delta_info * | info | ||
) |
ad_sd_init() - Initializes a ad_sigma_delta struct : The ad_sigma_delta device : The IIO device which the Sigma Delta device is used for : The SPI device for the ad_sigma_delta device : Device specific callbacks and options
This function needs to be called before any other operations are performed on the ad_sigma_delta struct.
Definition at line 545 of file ad_sigma_delta.c.
int ad_sd_read_reg | ( | struct ad_sigma_delta * | sigma_delta, |
unsigned int | reg, | ||
unsigned int | size, | ||
unsigned int * | val | ||
) |
ad_sd_read_reg() - Read a register
: The sigma delta device : Address of the register : Size of the register (1-4) : Read value
Returns 0 on success, an error code otherwise.
Definition at line 146 of file ad_sigma_delta.c.
void ad_sd_set_comm | ( | struct ad_sigma_delta * | sigma_delta, |
uint8_t | comm | ||
) |
ad_sd_set_comm() - Set communications register
: The sigma delta device : New value for the communications register
Definition at line 40 of file ad_sigma_delta.c.
ad_sd_setup_buffer_and_trigger() - : The IIO device
Definition at line 505 of file ad_sigma_delta.c.
int ad_sd_validate_trigger | ( | struct iio_dev * | indio_dev, |
struct iio_trigger * | trig | ||
) |
ad_sd_validate_trigger() - validate_trigger callback for ad_sigma_delta devices : The IIO device : The new trigger
Returns: 0 if the 'trig' matches the trigger registered by the ad_sigma_delta device, -EINVAL otherwise.
Definition at line 431 of file ad_sigma_delta.c.
int ad_sd_write_reg | ( | struct ad_sigma_delta * | sigma_delta, |
unsigned int | reg, | ||
unsigned int | size, | ||
unsigned int | val | ||
) |
ad_sd_write_reg() - Write a register
: The sigma delta device : Address of the register : Size of the register (0-3) : Value to write to the register
Returns 0 on success, an error code otherwise.
Definition at line 58 of file ad_sigma_delta.c.
int ad_sigma_delta_single_conversion | ( | struct iio_dev * | indio_dev, |
const struct iio_chan_spec * | chan, | ||
int * | val | ||
) |
ad_sigma_delta_single_conversion() - Performs a single data conversion : The IIO device : The conversion is done for this channel : Pointer to the location where to store the read value
Returns: 0 on success, an error value otherwise.
Definition at line 247 of file ad_sigma_delta.c.