flinklib
flinklib: flink C library for Linux
ain.c File Reference

flink userspace library, subdevice function "analog input". More...

#include "flinklib.h"
#include "types.h"
#include "error.h"
#include "log.h"
#include <stdint.h>
Include dependency graph for ain.c:

Go to the source code of this file.

Functions

int flink_analog_in_get_resolution (flink_subdev *subdev, uint32_t *resolution)
 Reads the resolution of a analog input subdevice. More...
 
int flink_analog_in_get_value (flink_subdev *subdev, uint32_t channel, uint32_t *value)
 Reads an analog input channel. More...
 

Detailed Description

flink userspace library, subdevice function "analog input".

Contains the high-level functions for a flink subdevice which realizes the function "analog input".

Author
Martin Züger

Definition in file ain.c.

Function Documentation

int flink_analog_in_get_resolution ( flink_subdev subdev,
uint32_t *  resolution 
)

Reads the resolution of a analog input subdevice.

Parameters
subdevSubdevice.
resolutionContains the resolution in number of resolvable steps.
Returns
int: 0 on success, -1 in case of failure.

Definition at line 37 of file ain.c.

int flink_analog_in_get_value ( flink_subdev subdev,
uint32_t  channel,
uint32_t *  value 
)

Reads an analog input channel.

Parameters
subdevSubdevice containing the channel.
channelChannel number.
valueContains the digitized value of the channel input.
Returns
int: 0 on success, -1 in case of failure.

Definition at line 55 of file ain.c.