no-OS
Loading...
Searching...
No Matches
adis_internals.h File Reference

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

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)
 
#define ADIS_READ_REG(reg)
 

Functions

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

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.

SPDX-License-Identifier: BSD-3-Clause

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)
Value:
((reg) & NO_OS_GENMASK(6,0))
#define NO_OS_GENMASK(h, l)
Definition no_os_util.h:60

◆ ADIS_REG_PAGE_ID

#define ADIS_REG_PAGE_ID   0x00

◆ ADIS_WRITE_REG

#define ADIS_WRITE_REG ( reg)
Value:
((NO_OS_BIT(7) | (reg)))
#define NO_OS_BIT(x)
Definition no_os_util.h:23

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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.