no-OS
Loading...
Searching...
No Matches
ad5246.h File Reference
#include "../common/dpot.h"
#include "no_os_spi.h"
#include "no_os_i2c.h"
#include "no_os_gpio.h"
#include "no_os_util.h"
Include dependency graph for ad5246.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ad5246_dpot_init_param
 ad5246 digital potentiometer init parameters. More...
 
struct  ad5246_dpot_dev
 ad5246 digital potentiometer device descriptor parameters. More...
 

Functions

int ad5246_dpot_init (struct dpot_init_param *init_params, struct dpot_dev **desc)
 Initialize the ad5246 digital potentiometer.
 
int ad5246_dpot_remove (struct dpot_dev *desc)
 Free the memory allocated by ad5246_dpot_init().
 
int ad5246_dpot_chn_read (struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
 Read the ad5246 digital potentiometer channel.
 
int ad5246_dpot_chn_write (struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
 Write to the digital potentiometer channel.
 

Function Documentation

◆ ad5246_dpot_chn_read()

int ad5246_dpot_chn_read ( struct dpot_dev * desc,
enum dpot_chn_type chn,
uint8_t * data )

Read the ad5246 digital potentiometer channel.

Parameters
desc- digipot descriptor.
chn- digipot channel.
data- Channel data to be read.
Returns
0 in case of success, negative error code otherwise.

◆ ad5246_dpot_chn_write()

int ad5246_dpot_chn_write ( struct dpot_dev * desc,
enum dpot_chn_type chn,
uint8_t data )

Write to the digital potentiometer channel.

Parameters
desc- digipot descriptor.
chn- digipot channel.
data- Channel data to be written.
Returns
0 in case of success, negative error code otherwise.

◆ ad5246_dpot_init()

int ad5246_dpot_init ( struct dpot_init_param * param,
struct dpot_dev ** desc )

Initialize the ad5246 digital potentiometer.

Parameters
param- digipot init parameters.
desc- digipot descriptor.
Returns
0 in case of success, negative error code otherwise.

◆ ad5246_dpot_remove()

int ad5246_dpot_remove ( struct dpot_dev * desc)

Free the memory allocated by ad5246_dpot_init().

Parameters
desc- digipot descriptor.
Returns
0 in case of success, negative error code otherwise.