no-OS
Functions
adgs5412.c File Reference

Implementation of ADGS5412 Driver. More...

#include <stdio.h>
#include <stdlib.h>
#include "adgs5412.h"
#include "no-os/error.h"
Include dependency graph for adgs5412.c:

Functions

uint8_t adgs5412_compute_crc8 (uint8_t *data, uint8_t data_size)
 
int32_t adgs5412_spi_reg_read (adgs5412_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
 
int32_t adgs5412_spi_reg_write (adgs5412_dev *dev, uint8_t reg_addr, uint8_t reg_data)
 
int32_t adgs5412_spi_reg_read_mask (adgs5412_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t *data)
 
int32_t adgs5412_spi_reg_write_mask (adgs5412_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
 
int32_t adgs5412_do_soft_reset (adgs5412_dev *dev)
 
int32_t adgs5412_clear_err_flags (adgs5412_dev *dev)
 
int32_t adgs5412_enter_daisy_chain (adgs5412_dev *dev)
 
int32_t adgs5412_send_daisy_chain_cmds (adgs5412_dev *dev, uint8_t *cmds, uint8_t cmds_size)
 
int32_t adgs5412_init (adgs5412_dev **device, adgs5412_init_param init_param)
 
int32_t adgs5412_remove (adgs5412_dev *dev)
 Free the resources allocated by adgs5412_init(). More...
 

Detailed Description

Implementation of ADGS5412 Driver.

Author
DBogdan (drago.nosp@m.s.bo.nosp@m.gdan@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2016(c) Analog Devices, Inc.

All rights reserved.

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

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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

◆ adgs5412_clear_err_flags()

int32_t adgs5412_clear_err_flags ( adgs5412_dev dev)

Clear the Error Flags Register.

Parameters
dev- The device structure.
Returns
SUCCESS in case of success, negative error code otherwise.

◆ adgs5412_compute_crc8()

uint8_t adgs5412_compute_crc8 ( uint8_t *  data,
uint8_t  data_size 
)

Compute CRC8 checksum.

Parameters
data- The data buffer.
data_size- The size of the data buffer.
Returns
CRC8 checksum.
Here is the caller graph for this function:

◆ adgs5412_do_soft_reset()

int32_t adgs5412_do_soft_reset ( adgs5412_dev dev)

Do a software reset.

Parameters
dev- The device structure.
Returns
SUCCESS in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adgs5412_enter_daisy_chain()

int32_t adgs5412_enter_daisy_chain ( adgs5412_dev dev)

Enter Daisy-Chain Mode.

Parameters
dev- The device structure.
Returns
SUCCESS in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adgs5412_init()

int32_t adgs5412_init ( adgs5412_dev **  device,
adgs5412_init_param  init_param 
)

Initialize the device.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
SUCCESS in case of success, negative error code otherwise.

◆ adgs5412_remove()

int32_t adgs5412_remove ( adgs5412_dev dev)

Free the resources allocated by adgs5412_init().

Parameters
dev- The device structure.
Returns
SUCCESS in case of success, negative error code otherwise.

◆ adgs5412_send_daisy_chain_cmds()

int32_t adgs5412_send_daisy_chain_cmds ( adgs5412_dev dev,
uint8_t *  cmds,
uint8_t  cmds_size 
)

Send Daisy-Chain commands.

Parameters
dev- The device structure.
cmds- The commands to be sent.
cmds_size- The number of commands.
Returns
SUCCESS in case of success, negative error code otherwise.

◆ adgs5412_spi_reg_read()

int32_t adgs5412_spi_reg_read ( adgs5412_dev dev,
uint8_t  reg_addr,
uint8_t *  reg_data 
)

SPI register read from device.

Parameters
dev- The device structure.
reg_addr- The register address.
reg_data- The register data.
Returns
SUCCESS in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adgs5412_spi_reg_read_mask()

int32_t adgs5412_spi_reg_read_mask ( adgs5412_dev dev,
uint8_t  reg_addr,
uint8_t  mask,
uint8_t *  data 
)

SPI register read from device using a mask.

Parameters
dev- The device structure.
reg_addr- The register address.
mask- The mask.
data- The register data.
Returns
SUCCESS in case of success, negative error code otherwise.

◆ adgs5412_spi_reg_write()

int32_t adgs5412_spi_reg_write ( adgs5412_dev dev,
uint8_t  reg_addr,
uint8_t  reg_data 
)

SPI register write to device.

Parameters
dev- The device structure.
reg_addr- The register address.
reg_data- The register data.
Returns
SUCCESS in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adgs5412_spi_reg_write_mask()

int32_t adgs5412_spi_reg_write_mask ( adgs5412_dev dev,
uint8_t  reg_addr,
uint8_t  mask,
uint8_t  data 
)

SPI internal register write to device using a mask.

Parameters
dev- The device structure.
reg_addr- The register address.
mask- The mask.
data- The register data.
Returns
SUCCESS in case of success, negative error code otherwise.
Here is the caller graph for this function: