no-OS
Classes | Macros | Functions
adis_internals.h File Reference

Internal include file used for specific chip driver definitions, which are not useful for the user. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  adis_timeout
 ADIS chip timeouts. More...
 
struct  adis_clk_freq_limit
 ADIS frequency limit for input synchronization clock. More...
 
struct  adis_scale_members
 ADIS generic scale members structure. More...
 
struct  adis_field
 ADIS device field structure. More...
 
struct  adis_data_field_map_def
 ADIS filed map definition structure. More...
 
struct  adis_chip_info
 ADIS specific chip information structure. More...
 

Macros

#define ADIS_HAS_BURST32   NO_OS_BIT(0)
 
#define ADIS_HAS_BURST_DELTA_DATA   NO_OS_BIT(1)
 
#define ADIS_HAS_FIFO   NO_OS_BIT(2)
 
#define ADIS_READ_BURST_DATA_CMD_MSB   0x68
 
#define ADIS_READ_BURST_DATA_CMD_LSB   0x00
 
#define ADIS_READ_BURST_DATA_CMD_SIZE   2 /* in bytes */
 
#define ADIS_PAGE_SIZE   0x80
 
#define ADIS_REG_PAGE_ID   0x00
 
#define ADIS_WRITE_REG(reg)   ((NO_OS_BIT(7) | (reg)))
 
#define ADIS_READ_REG(reg)   ((reg) & NO_OS_GENMASK(6,0))
 

Functions

bool adis_validate_checksum (uint8_t *buffer, uint8_t size, uint8_t idx)
 Check if the checksum for burst data is correct. More...
 
void adis_update_diag_flags (struct adis_dev *adis, uint32_t diag_stat)
 Update device diagnosis flags according to the received parameter. More...
 
void adis_update_temp_flags (struct adis_dev *adis, uint16_t temp_reg)
 Update device temperature flags according to the received parameter. More...
 
int adis_write_field_u32 (struct adis_dev *adis, struct adis_field field, uint32_t field_val)
 Write field from uint32 value. More...
 
int adis_read_field_s32 (struct adis_dev *adis, struct adis_field field, int32_t *field_val)
 Read field to int32 value. More...
 
int adis_read_field_u32 (struct adis_dev *adis, struct adis_field field, uint32_t *field_val)
 Read field to uint32 value. More...
 

Detailed Description

Internal include file used for specific chip driver definitions, which are not useful for the user.

Author
RBolboac (ramon.nosp@m.a.gr.nosp@m.adnar.nosp@m.iu@a.nosp@m.nalog.nosp@m..com)

Copyright 2024(c) Analog Devices, Inc.

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.

Macro Definition Documentation

◆ ADIS_HAS_BURST32

#define ADIS_HAS_BURST32   NO_OS_BIT(0)

◆ ADIS_HAS_BURST_DELTA_DATA

#define ADIS_HAS_BURST_DELTA_DATA   NO_OS_BIT(1)

◆ ADIS_HAS_FIFO

#define ADIS_HAS_FIFO   NO_OS_BIT(2)

◆ ADIS_PAGE_SIZE

#define ADIS_PAGE_SIZE   0x80

◆ ADIS_READ_BURST_DATA_CMD_LSB

#define ADIS_READ_BURST_DATA_CMD_LSB   0x00

◆ ADIS_READ_BURST_DATA_CMD_MSB

#define ADIS_READ_BURST_DATA_CMD_MSB   0x68

◆ ADIS_READ_BURST_DATA_CMD_SIZE

#define ADIS_READ_BURST_DATA_CMD_SIZE   2 /* in bytes */

◆ ADIS_READ_REG

#define ADIS_READ_REG (   reg)    ((reg) & NO_OS_GENMASK(6,0))

◆ ADIS_REG_PAGE_ID

#define ADIS_REG_PAGE_ID   0x00

◆ ADIS_WRITE_REG

#define ADIS_WRITE_REG (   reg)    ((NO_OS_BIT(7) | (reg)))

Function Documentation

◆ adis_read_field_s32()

int adis_read_field_s32 ( struct adis_dev adis,
struct adis_field  field,
int32_t *  field_val 
)

Read field to int32 value.

Read adis 32-bit signed field.

Parameters
adis- The adis device.
field- The field structure to be read
field_val- The read field value.
Returns
0 in case of success, error code otherwise.
Here is the caller graph for this function:

◆ adis_read_field_u32()

int adis_read_field_u32 ( struct adis_dev adis,
struct adis_field  field,
uint32_t *  field_val 
)

Read field to uint32 value.

Read adis 32-bit unsigned field.

Parameters
adis- The adis device.
field- The field structure to be read
field_val- The read field value.
Returns
0 in case of success, error code otherwise.
Here is the caller graph for this function:

◆ adis_update_diag_flags()

void adis_update_diag_flags ( struct adis_dev adis,
uint32_t  diag_stat 
)

Update device diagnosis flags according to the received parameter.

Update device diagnosis flags according to the received parameter.

Parameters
adis- The adis device.
diag_stat- Diagnosis flags.
Here is the caller graph for this function:

◆ adis_update_temp_flags()

void adis_update_temp_flags ( struct adis_dev adis,
uint16_t  temp_reg 
)

Update device temperature flags according to the received parameter.

Update temperature flags.

Parameters
adis- The adis device.
temp_reg- Temperature flags register value.

◆ adis_validate_checksum()

bool adis_validate_checksum ( uint8_t *  buffer,
uint8_t  size,
uint8_t  idx 
)

Check if the checksum for burst data is correct.

Check if the checksum for burst data is correct.

Parameters
buffer- The received burst data buffer.
size- The size of the buffer.
idx- The start index in the buffer to check the checksum.
Returns
0 in case of success, error code otherwise.
Here is the caller graph for this function:

◆ adis_write_field_u32()

int adis_write_field_u32 ( struct adis_dev adis,
struct adis_field  field,
uint32_t  field_val 
)

Write field from uint32 value.

Write adis 32-bit unsigned field.

Parameters
adis- The adis device.
field- The field structure to be written.
field_val- The field value to be written.
Returns
0 in case of success, error code otherwise.
Here is the caller graph for this function: