Go to the documentation of this file.
35 #ifndef __ADIS_INTERNALS_H__
36 #define __ADIS_INTERNALS_H__
38 #define ADIS_HAS_BURST32 NO_OS_BIT(0)
39 #define ADIS_HAS_BURST_DELTA_DATA NO_OS_BIT(1)
40 #define ADIS_HAS_FIFO NO_OS_BIT(2)
42 #define ADIS_READ_BURST_DATA_CMD_MSB 0x68
43 #define ADIS_READ_BURST_DATA_CMD_LSB 0x00
44 #define ADIS_READ_BURST_DATA_CMD_SIZE 2
46 #define ADIS_PAGE_SIZE 0x80
47 #define ADIS_REG_PAGE_ID 0x00
49 #define ADIS_WRITE_REG(reg) ((NO_OS_BIT(7) | (reg)))
50 #define ADIS_READ_REG(reg) ((reg) & NO_OS_GENMASK(6,0))
465 uint32_t *scale_m1, uint32_t *scale_m2,
475 bool burst32, uint8_t burst_sel,
bool fifo_pop,
bool crc_check);
507 uint32_t *field_val);
struct adis_field zg_bias
Definition: adis_internals.h:238
struct adis_field sync_mode
Definition: adis_internals.h:287
struct adis_field fir_en_xa
Definition: adis_internals.h:392
uint32_t diag_ext_5v_supply_err_mask
Definition: adis_internals.h:186
struct adis_field burst_sel
Definition: adis_internals.h:303
struct adis_field usr_scr_3
Definition: adis_internals.h:376
struct adis_field usr_scr_1
Definition: adis_internals.h:372
uint32_t field_mask
Definition: adis_internals.h:124
ADIS frequency limit for input synchronization clock.
Definition: adis_internals.h:100
uint32_t diag_gyro1_failure_mask
Definition: adis_internals.h:150
struct adis_field dr_selection
Definition: adis_internals.h:277
int adis_read_field_s32(struct adis_dev *adis, struct adis_field field, int32_t *field_val)
Read field to int32 value.
Definition: adis.c:425
const struct adis_init_param * ip
Definition: adis_internals.h:424
struct adis_field coeff_bank_b
Definition: adis_internals.h:412
uint32_t diag_snsr_failure_mask
Definition: adis_internals.h:144
int(* read_reg)(struct adis_dev *adis, uint32_t reg, uint32_t *val, uint32_t size)
Definition: adis_internals.h:468
struct adis_field sync_polarity
Definition: adis_internals.h:285
struct adis_field xg_bias
Definition: adis_internals.h:234
ADIS device field structure.
Definition: adis_internals.h:118
ADIS generic scale members structure.
Definition: adis_internals.h:110
struct adis_field xa_bias
Definition: adis_internals.h:240
ADIS device initialization parameters.
Definition: adis.h:306
ADIS chip timeouts.
Definition: adis_internals.h:55
uint32_t diag_int_proc_supply_err_mask
Definition: adis_internals.h:184
uint32_t diag_power_supply_failure_mask
Definition: adis_internals.h:176
struct adis_field z_accl
Definition: adis_internals.h:206
uint16_t filt_size_var_b_update_us
Definition: adis_internals.h:85
struct adis_field fifo_cnt
Definition: adis_internals.h:229
ADIS burst data structure.
Definition: adis.h:248
uint32_t min_freq
Definition: adis_internals.h:102
struct adis_field serial_num
Definition: adis_internals.h:367
bool has_paging
Definition: adis_internals.h:444
bool adis_validate_checksum(uint8_t *buffer, uint8_t size, uint8_t idx)
Check if the checksum for burst data is correct.
Definition: adis.c:490
int(* read_sync_mode)(struct adis_dev *adis, uint32_t *sync_mode)
Definition: adis_internals.h:481
struct adis_field y_deltvel
Definition: adis_internals.h:224
uint32_t diag_spi_comm_err_mask
Definition: adis_internals.h:140
uint16_t sens_bw_update_ms
Definition: adis_internals.h:94
struct adis_field fifo_overflow
Definition: adis_internals.h:262
struct adis_field z_gyro
Definition: adis_internals.h:200
adis_chan_type
Supported channels.
Definition: adis.h:114
uint32_t diag_y_axis_accl_failure_mask
Definition: adis_internals.h:164
struct adis_field fir_en_xg
Definition: adis_internals.h:386
struct adis_field dec_rate
Definition: adis_internals.h:318
uint32_t diag_y_axis_gyro_failure_mask
Definition: adis_internals.h:158
struct adis_field fls_mem_wr_cntr
Definition: adis_internals.h:381
struct adis_field bias_corr_en_xa
Definition: adis_internals.h:329
struct adis_field fls_mem_test
Definition: adis_internals.h:346
uint8_t fir_coef_idx_max
Definition: adis_internals.h:460
uint32_t diag_temp_err_mask
Definition: adis_internals.h:174
struct adis_field bias_corr_en_zg
Definition: adis_internals.h:327
struct adis_field bias_corr_update
Definition: adis_internals.h:338
struct adis_field sync_4khz
Definition: adis_internals.h:309
int(* write_reg)(struct adis_dev *adis, uint32_t reg, uint32_t val, uint32_t size)
Definition: adis_internals.h:471
struct adis_field alarm_selection
Definition: adis_internals.h:289
uint32_t diag_reg_nvm_err_mask
Definition: adis_internals.h:180
struct adis_field ya_scale
Definition: adis_internals.h:255
int adis_write_field_u32(struct adis_dev *adis, struct adis_field field, uint32_t field_val)
Write field from uint32 value.
Definition: adis.c:449
ADIS specific chip information structure.
Definition: adis_internals.h:422
uint16_t dec_rate_max
Definition: adis_internals.h:450
struct adis_field gpio_ctrl
Definition: adis_internals.h:295
struct adis_field fact_calib_restore
Definition: adis_internals.h:340
struct adis_field fir_bank_sel_za
Definition: adis_internals.h:408
struct adis_field gyro_meas_range
Definition: adis_internals.h:274
uint32_t diag_aduc_mcu_fault_mask
Definition: adis_internals.h:168
struct adis_field bias_corr_en_yg
Definition: adis_internals.h:325
struct adis_field fir_en_ya
Definition: adis_internals.h:394
struct adis_field y_gyro
Definition: adis_internals.h:198
ADIS device descriptor structure.
Definition: adis.h:270
bool has_lock
Definition: adis_internals.h:446
const struct adis_clk_freq_limit * sync_clk_freq_limits
Definition: adis_internals.h:428
uint32_t max_freq
Definition: adis_internals.h:104
struct adis_field ya_bias
Definition: adis_internals.h:242
const struct adis_data_field_map_def * field_map
Definition: adis_internals.h:426
uint32_t diag_int_snsr_supply_err_mask
Definition: adis_internals.h:188
struct adis_field fir_en_za
Definition: adis_internals.h:396
struct adis_field y_deltang
Definition: adis_internals.h:218
uint32_t ext_clk
Definition: adis.h:292
struct adis_field gyro_fir_enable
Definition: adis_internals.h:313
struct adis_field sync_selection
Definition: adis_internals.h:283
uint32_t scale_m2
Definition: adis_internals.h:112
struct adis_field fir_en_zg
Definition: adis_internals.h:390
struct adis_field x_deltvel
Definition: adis_internals.h:222
struct adis_field z_deltang
Definition: adis_internals.h:220
uint8_t reg_size
Definition: adis_internals.h:122
struct adis_field data_cntr
Definition: adis_internals.h:213
struct adis_field y_accl
Definition: adis_internals.h:204
struct adis_field up_scale
Definition: adis_internals.h:316
struct adis_field filt_size_var_b
Definition: adis_internals.h:271
struct adis_field usr_scr_4
Definition: adis_internals.h:378
struct adis_field sw_res
Definition: adis_internals.h:350
uint32_t diag_z_axis_gyro_failure_mask
Definition: adis_internals.h:160
uint16_t fact_calib_restore_ms
Definition: adis_internals.h:61
struct adis_field firm_rev
Definition: adis_internals.h:355
uint32_t write_delay
Definition: adis_internals.h:438
struct adis_field fifo_wm_int_en
Definition: adis_internals.h:264
int(* read_lpf)(struct adis_dev *adis, enum adis_chan_type chan, enum adis_axis_type axis, uint32_t *freq)
Definition: adis_internals.h:489
struct adis_field x_deltang
Definition: adis_internals.h:216
struct adis_field xa_scale
Definition: adis_internals.h:253
struct adis_field firm_m
Definition: adis_internals.h:359
void adis_update_diag_flags(struct adis_dev *adis, uint32_t diag_stat)
Update device diagnosis flags according to the received parameter.
Definition: adis.c:507
uint32_t cs_change_delay
Definition: adis_internals.h:440
struct adis_field write_lock
Definition: adis_internals.h:336
struct adis_field alarm_enable
Definition: adis_internals.h:293
uint16_t sw_reset_ms
Definition: adis_internals.h:77
struct adis_field zg_scale
Definition: adis_internals.h:251
uint32_t scale_m1
Definition: adis_internals.h:111
uint32_t fls_mem_wr_cntr_max
Definition: adis_internals.h:454
uint32_t diag_int_reg_err_mask
Definition: adis_internals.h:190
struct adis_field burst32
Definition: adis_internals.h:305
struct adis_field fifo_en
Definition: adis_internals.h:260
struct adis_field fls_mem_update
Definition: adis_internals.h:344
struct adis_field pt_of_perc_algnmt
Definition: adis_internals.h:299
uint16_t dec_rate_update_us
Definition: adis_internals.h:81
const uint32_t flags
Definition: adis_internals.h:434
int adis_read_field_u32(struct adis_dev *adis, struct adis_field field, uint32_t *field_val)
Read field to uint32 value.
Definition: adis.c:404
struct adis_field temp_out
Definition: adis_internals.h:208
uint32_t int_clk
Definition: adis_internals.h:462
struct adis_field fifo_flush
Definition: adis_internals.h:348
struct adis_field fir_bank_sel_yg
Definition: adis_internals.h:400
struct adis_field firm_y
Definition: adis_internals.h:361
const struct adis_timeout * timeouts
Definition: adis_internals.h:432
uint32_t diag_fls_mem_update_failure_mask
Definition: adis_internals.h:138
uint32_t diag_snsr_init_failure_mask
Definition: adis_internals.h:134
struct adis_field fifo_wm_lvl
Definition: adis_internals.h:268
struct adis_field lot_num
Definition: adis_internals.h:369
uint32_t diag_x_axis_gyro_failure_mask
Definition: adis_internals.h:156
void adis_update_temp_flags(struct adis_dev *adis, uint16_t temp_reg)
Update device temperature flags according to the received parameter.
Definition: adis.c:632
struct adis_field fifo_wm_int_pol
Definition: adis_internals.h:266
adis_axis_type
Supported axes.
Definition: adis.h:125
uint32_t diag_gyro2_failure_mask
Definition: adis_internals.h:152
struct adis_field za_scale
Definition: adis_internals.h:257
uint16_t reg_addr
Definition: adis_internals.h:120
int(* get_offset)(struct adis_dev *adis, int *offset, enum adis_chan_type chan_type)
Definition: adis_internals.h:477
struct adis_field time_stamp
Definition: adis_internals.h:211
struct adis_field usr_scr_2
Definition: adis_internals.h:374
struct adis_field proc_rev
Definition: adis_internals.h:353
struct adis_field linear_accl_comp
Definition: adis_internals.h:301
uint8_t sync_mode_max
Definition: adis_internals.h:452
struct adis_field alarm_polarity
Definition: adis_internals.h:291
struct adis_field z_deltvel
Definition: adis_internals.h:226
uint32_t diag_clk_err_mask
Definition: adis_internals.h:148
struct adis_field bias_corr_en_xg
Definition: adis_internals.h:323
uint16_t reset_ms
Definition: adis_internals.h:57
uint32_t read_delay
Definition: adis_internals.h:436
struct adis_field x_accl
Definition: adis_internals.h:202
int(* write_sync_mode)(struct adis_dev *adis, uint32_t sync_mode, uint32_t ext_clk)
Definition: adis_internals.h:483
struct adis_field coeff_bank_a
Definition: adis_internals.h:410
uint32_t diag_config_calib_crc_error_mask
Definition: adis_internals.h:170
struct adis_field yg_scale
Definition: adis_internals.h:249
struct adis_field bias_corr_tbc
Definition: adis_internals.h:321
ADIS filed map definition structure.
Definition: adis_internals.h:130
struct adis_field dr_enable
Definition: adis_internals.h:281
struct adis_field yg_bias
Definition: adis_internals.h:236
struct adis_field dr_polarity
Definition: adis_internals.h:279
struct adis_field firm_d
Definition: adis_internals.h:357
uint32_t diag_data_path_overrun_mask
Definition: adis_internals.h:136
struct adis_field fir_bank_sel_zg
Definition: adis_internals.h:402
int(* read_burst_data)(struct adis_dev *adis, struct adis_burst_data *data, bool burst32, uint8_t burst_sel, bool fifo_pop, bool crc_check)
Definition: adis_internals.h:474
struct adis_field temp_flags
Definition: adis_internals.h:193
int(* write_lpf)(struct adis_dev *adis, enum adis_chan_type chan, enum adis_axis_type axis, uint32_t freq)
Definition: adis_internals.h:486
int(* get_scale)(struct adis_dev *adis, uint32_t *scale_m1, uint32_t *scale_m2, enum adis_chan_type chan_type)
Definition: adis_internals.h:464
struct adis_field fir_bank_sel_xa
Definition: adis_internals.h:404
uint32_t diag_accl_failure_mask
Definition: adis_internals.h:154
struct adis_field coeff_bank_c
Definition: adis_internals.h:414
uint16_t msc_reg_update_us
Definition: adis_internals.h:89
uint32_t diag_boot_memory_failure_mask
Definition: adis_internals.h:178
struct adis_field snsr_self_test
Definition: adis_internals.h:342
struct adis_field coeff_c0
Definition: adis_internals.h:384
struct adis_field boot_rev
Definition: adis_internals.h:363
uint32_t diag_wdg_timer_flag_mask
Definition: adis_internals.h:182
struct adis_field bias_corr_en_za
Definition: adis_internals.h:333
uint32_t diag_overrange_mask
Definition: adis_internals.h:172
struct adis_field x_gyro
Definition: adis_internals.h:196
struct adis_field bias_corr_en_ya
Definition: adis_internals.h:331
struct adis_field fir_bank_sel_ya
Definition: adis_internals.h:406
struct adis_field xg_scale
Definition: adis_internals.h:247
struct adis_field fir_bank_sel_xg
Definition: adis_internals.h:398
struct adis_field accl_fir_enable
Definition: adis_internals.h:311
const struct adis_clk_freq_limit sampling_clk_limits
Definition: adis_internals.h:430
uint16_t fls_mem_test_ms
Definition: adis_internals.h:73
uint16_t filt_size_var_b_max
Definition: adis_internals.h:448
uint16_t fls_mem_update_ms
Definition: adis_internals.h:69
uint16_t self_test_ms
Definition: adis_internals.h:65
uint32_t diag_x_axis_accl_failure_mask
Definition: adis_internals.h:162
struct adis_field spi_chksum
Definition: adis_internals.h:231
struct adis_field diag_stat
Definition: adis_internals.h:132
uint32_t diag_mem_failure_mask
Definition: adis_internals.h:146
uint32_t diag_standby_mode_mask
Definition: adis_internals.h:142
struct adis_field timestamp32
Definition: adis_internals.h:307
uint8_t bias_corr_tbc_max
Definition: adis_internals.h:458
struct adis_field fir_en_yg
Definition: adis_internals.h:388
struct adis_field coeff_bank_d
Definition: adis_internals.h:416
struct adis_field prod_id
Definition: adis_internals.h:365
struct adis_field sens_bw
Definition: adis_internals.h:297
struct adis_field za_bias
Definition: adis_internals.h:244
uint32_t diag_z_axis_accl_failure_mask
Definition: adis_internals.h:166