no-OS
Functions
ad2s1210.c File Reference

Source file for the ad2s1210 driver. More...

#include <stdlib.h>
#include "ad2s1210.h"
#include "no_os_util.h"
#include "no_os_error.h"
#include "no_os_print_log.h"
#include "no_os_delay.h"
#include "no_os_alloc.h"
Include dependency graph for ad2s1210.c:

Functions

int ad2s1210_reg_write (struct ad2s1210_dev *dev, uint8_t addr, uint8_t val)
 
int ad2s1210_reg_read (struct ad2s1210_dev *dev, uint8_t addr, uint8_t *val)
 
int ad2s1210_reinit_excitation_frequency (struct ad2s1210_dev *dev, uint16_t fexcit)
 
int ad2s1210_get_excitation_frequency (struct ad2s1210_dev *dev, uint16_t *fexcit)
 
int ad2s1210_hysteresis_is_enabled (struct ad2s1210_dev *dev)
 
int ad2s1210_set_hysteresis (struct ad2s1210_dev *dev, bool enable)
 
int ad2s1210_init (struct ad2s1210_dev **dev, struct ad2s1210_init_param *init_param)
 
int ad2s1210_spi_single_conversion (struct ad2s1210_dev *dev, uint32_t active_mask, void *data, uint32_t size)
 Returns the result of a conversion. More...
 
int ad2s1210_remove (struct ad2s1210_dev *dev)
 Remove the driver's descriptor by freeing the associated resources. More...
 

Detailed Description

Source file for the ad2s1210 driver.

Author
Axel Haslam (ahasl.nosp@m.am@b.nosp@m.aylib.nosp@m.re.c.nosp@m.om)

Copyright (c) 2023 Analog Devices, Inc. Copyright (c) 2023 BayLibre, SAS.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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.

Function Documentation

◆ ad2s1210_get_excitation_frequency()

int ad2s1210_get_excitation_frequency ( struct ad2s1210_dev dev,
uint16_t *  fexcit 
)

◆ ad2s1210_hysteresis_is_enabled()

int ad2s1210_hysteresis_is_enabled ( struct ad2s1210_dev dev)

◆ ad2s1210_init()

int ad2s1210_init ( struct ad2s1210_dev **  dev,
struct ad2s1210_init_param init_param 
)

◆ ad2s1210_reg_read()

int ad2s1210_reg_read ( struct ad2s1210_dev dev,
uint8_t  addr,
uint8_t *  val 
)
Here is the caller graph for this function:

◆ ad2s1210_reg_write()

int ad2s1210_reg_write ( struct ad2s1210_dev dev,
uint8_t  addr,
uint8_t  val 
)
Here is the caller graph for this function:

◆ ad2s1210_reinit_excitation_frequency()

int ad2s1210_reinit_excitation_frequency ( struct ad2s1210_dev dev,
uint16_t  fexcit 
)

◆ ad2s1210_remove()

int ad2s1210_remove ( struct ad2s1210_dev dev)

Remove the driver's descriptor by freeing the associated resources.

Parameters
dev- Device descriptor.
Returns
Returns negative error code or 0 in case of success. Example: -EINVAL - Bad input parameters. 0 - No errors encountered.

◆ ad2s1210_set_hysteresis()

int ad2s1210_set_hysteresis ( struct ad2s1210_dev dev,
bool  enable 
)

◆ ad2s1210_spi_single_conversion()

int ad2s1210_spi_single_conversion ( struct ad2s1210_dev dev,
uint32_t  active_mask,
void *  data,
uint32_t  size 
)

Returns the result of a conversion.

Parameters
dev- The device structure.
active_mask- mask of active channels angle = bit 0, velocity = bit 1
data- Buffer to store sampled register data.
size- size in bytes of the data buffer
Returns
0 in case of success or negative error code.