no-OS
Loading...
Searching...
No Matches
ad5259.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 ad5259.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ad5259_dpot_init_param
 ad5259 digital potentiometer init parameters. More...
 
struct  ad5259_dpot_dev
 ad5259 digital potentiometer device descriptor parameters. More...
 

Functions

int ad5259_dpot_init (struct dpot_init_param *init_params, struct dpot_dev **desc)
 Initialize the ad5259 digital potentiometer.
 
int ad5259_dpot_remove (struct dpot_dev *desc)
 Free the memory allocated by ad5259_dpot_init().
 
int ad5259_dpot_chn_read (struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
 Read the ad5259 digital potentiometer channel.
 
int ad5259_dpot_chn_write (struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
 Write to the digital potentiometer channel.
 
int ad5259_dpot_nvm_read (struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
 Read the NVM (non-volatile) memory data.
 
int ad5259_dpot_nvm_write (struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
 Write data to NVM (non-volatile) memory.
 
int ad5259_dpot_copy_rdac_to_nvm (struct dpot_dev *desc, enum dpot_chn_type chn)
 Copy RDAC register to NVM/EEPROM.
 
int ad5259_dpot_copy_nvm_to_rdac (struct dpot_dev *desc, enum dpot_chn_type chn)
 Copy NVM/EEPROM data to RDAC.
 

Function Documentation

◆ ad5259_dpot_chn_read()

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

Read the ad5259 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.

◆ ad5259_dpot_chn_write()

int ad5259_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.

◆ ad5259_dpot_copy_nvm_to_rdac()

int ad5259_dpot_copy_nvm_to_rdac ( struct dpot_dev * desc,
enum dpot_chn_type chn )

Copy NVM/EEPROM data to RDAC.

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

◆ ad5259_dpot_copy_rdac_to_nvm()

int ad5259_dpot_copy_rdac_to_nvm ( struct dpot_dev * desc,
enum dpot_chn_type chn )

Copy RDAC register to NVM/EEPROM.

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

◆ ad5259_dpot_init()

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

Initialize the ad5259 digital potentiometer.

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

◆ ad5259_dpot_nvm_read()

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

Read the NVM (non-volatile) memory data.

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

◆ ad5259_dpot_nvm_write()

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

Write data to NVM (non-volatile) memory.

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

◆ ad5259_dpot_remove()

int ad5259_dpot_remove ( struct dpot_dev * desc)

Free the memory allocated by ad5259_dpot_init().

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