From 66dc6b6609e71ccff8ee19d99dc5de7066a7b99a Mon Sep 17 00:00:00 2001 From: George Mois Date: Mon, 15 Dec 2025 10:48:48 +0200 Subject: [PATCH 1/6] iio: adc: adrv903x: Add ADRV903X API Add the API Version 2.12.1.4 for ADRV903X. Signed-off-by: George Mois --- drivers/iio/adc/adrv903x/common/adi_common.h | 21 + .../adc/adrv903x/common/adi_common_macros.h | 54 + .../adc/adrv903x/common/adi_common_types.h | 117 + .../iio/adc/adrv903x/common/adi_common_user.h | 35 + .../common/adi_error/adi_common_error.c | 324 + .../common/adi_error/adi_common_error.h | 481 + .../common/adi_error/adi_common_error_types.h | 231 + .../adrv903x/common/adi_hal/adi_common_hal.c | 578 + .../adrv903x/common/adi_hal/adi_common_hal.h | 329 + .../common/adi_logging/adi_common_log.c | 184 + .../common/adi_logging/adi_common_log.h | 200 + .../common/adi_logging/adi_common_log_types.h | 16 + .../multiver/adi_adrv903x_all_types.h | 38 + .../adrv903x/multiver/adi_adrv903x_api.h | 47 + .../bf/adrv903x_bf_actrl_orx_west_regmap.c | 299 + .../bf/adrv903x_bf_actrl_orx_west_regmap.h | 56 + .../adrv903x_bf_actrl_orx_west_regmap_types.h | 50 + .../adrv903x/private/bf/adrv903x_bf_core.c | 22935 ++++++++++++++++ .../adrv903x/private/bf/adrv903x_bf_core.h | 2053 ++ .../private/bf/adrv903x_bf_core_types.h | 50 + .../private/bf/adrv903x_bf_error_types.h | 115 + .../private/bf/adrv903x_bf_jesd_common.c | 4360 +++ .../private/bf/adrv903x_bf_jesd_common.h | 414 + .../bf/adrv903x_bf_jesd_common_types.h | 24 + .../private/bf/adrv903x_bf_jrx_link.c | 2385 ++ .../private/bf/adrv903x_bf_jrx_link.h | 254 + .../private/bf/adrv903x_bf_jrx_link_types.h | 25 + .../private/bf/adrv903x_bf_jtx_link.c | 2703 ++ .../private/bf/adrv903x_bf_jtx_link.h | 277 + .../private/bf/adrv903x_bf_jtx_link_types.h | 26 + .../adrv903x/private/bf/adrv903x_bf_orx_dig.c | 2756 ++ .../adrv903x/private/bf/adrv903x_bf_orx_dig.h | 291 + .../private/bf/adrv903x_bf_orx_dig_types.h | 25 + .../private/bf/adrv903x_bf_pll_mem_map.c | 172 + .../private/bf/adrv903x_bf_pll_mem_map.h | 46 + .../bf/adrv903x_bf_pll_mem_map_types.h | 135 + .../adrv903x/private/bf/adrv903x_bf_rx_ddc.c | 4061 +++ .../adrv903x/private/bf/adrv903x_bf_rx_ddc.h | 340 + .../private/bf/adrv903x_bf_rx_ddc_types.h | 64 + .../adrv903x/private/bf/adrv903x_bf_rx_dig.c | 1614 ++ .../adrv903x/private/bf/adrv903x_bf_rx_dig.h | 167 + .../private/bf/adrv903x_bf_rx_dig_types.h | 31 + .../private/bf/adrv903x_bf_rx_funcs.c | 9544 +++++++ .../private/bf/adrv903x_bf_rx_funcs.h | 846 + .../private/bf/adrv903x_bf_rx_funcs_types.h | 31 + ...03x_bf_serdes_rxdig_8pack_regmap_core1p2.c | 221 + ...03x_bf_serdes_rxdig_8pack_regmap_core1p2.h | 52 + ..._serdes_rxdig_8pack_regmap_core1p2_types.h | 25 + ...v903x_bf_serdes_rxdig_phy_regmap_core1p2.c | 143 + ...v903x_bf_serdes_rxdig_phy_regmap_core1p2.h | 42 + ...bf_serdes_rxdig_phy_regmap_core1p2_types.h | 43 + ...v903x_bf_serdes_txdig_phy_regmap_core1p2.c | 313 + ...v903x_bf_serdes_txdig_phy_regmap_core1p2.h | 57 + ...bf_serdes_txdig_phy_regmap_core1p2_types.h | 33 + .../private/bf/adrv903x_bf_streamproc.c | 446 + .../private/bf/adrv903x_bf_streamproc.h | 61 + .../private/bf/adrv903x_bf_streamproc_types.h | 43 + .../private/bf/adrv903x_bf_tdr_dpath_top.c | 150 + .../private/bf/adrv903x_bf_tdr_dpath_top.h | 40 + .../bf/adrv903x_bf_tdr_dpath_top_types.h | 39 + .../private/bf/adrv903x_bf_tx_datapath.c | 500 + .../private/bf/adrv903x_bf_tx_datapath.h | 55 + .../bf/adrv903x_bf_tx_datapath_types.h | 31 + .../adrv903x/private/bf/adrv903x_bf_tx_dig.c | 2669 ++ .../adrv903x/private/bf/adrv903x_bf_tx_dig.h | 241 + .../private/bf/adrv903x_bf_tx_dig_types.h | 31 + .../private/bf/adrv903x_bf_tx_funcs.c | 6068 ++++ .../private/bf/adrv903x_bf_tx_funcs.h | 546 + .../private/bf/adrv903x_bf_tx_funcs_types.h | 31 + .../adrv903x/private/include/adrv903x_agc.h | 65 + .../private/include/adrv903x_binloader.h | 56 + .../adrv903x/private/include/adrv903x_cpu.h | 453 + .../include/adrv903x_cpu_archive_types.h | 41 + .../private/include/adrv903x_cpu_cmd.h | 298 + .../private/include/adrv903x_cpu_cmd_bkpt.h | 44 + .../include/adrv903x_cpu_cmd_cal_status.h | 85 + .../private/include/adrv903x_cpu_cmd_ctrl.h | 133 + .../private/include/adrv903x_cpu_cmd_debug.h | 90 + .../include/adrv903x_cpu_cmd_devtemp.h | 82 + .../private/include/adrv903x_cpu_cmd_efuse.h | 43 + .../adrv903x_cpu_cmd_enter_debug_mode.h | 43 + .../include/adrv903x_cpu_cmd_fast_attack.h | 48 + .../adrv903x_cpu_cmd_force_exception.h | 53 + .../include/adrv903x_cpu_cmd_getset_config.h | 133 + .../include/adrv903x_cpu_cmd_getset_lofreq.h | 171 + .../include/adrv903x_cpu_cmd_getset_nco.h | 142 + .../adrv903x_cpu_cmd_getset_txatten_phase.h | 66 + .../private/include/adrv903x_cpu_cmd_gpio.h | 98 + .../private/include/adrv903x_cpu_cmd_intf.h | 79 + ...drv903x_cpu_cmd_jesd_ser_lane_getset_cfg.h | 71 + .../private/include/adrv903x_cpu_cmd_log.h | 35 + .../private/include/adrv903x_cpu_cmd_mcs.h | 44 + .../private/include/adrv903x_cpu_cmd_ping.h | 43 + .../private/include/adrv903x_cpu_cmd_radio.h | 44 + .../private/include/adrv903x_cpu_cmd_ram.h | 74 + .../include/adrv903x_cpu_cmd_run_init.h | 65 + .../adrv903x_cpu_cmd_run_serdes_eye_sweep.h | 206 + .../include/adrv903x_cpu_cmd_ser_reset.h | 44 + .../include/adrv903x_cpu_cmd_sys_status.h | 80 + .../private/include/adrv903x_cpu_cmd_t.h | 24 + .../include/adrv903x_cpu_cmd_tracking_cals.h | 86 + .../adrv903x_cpu_cmd_tx_to_orx_mapping.h | 75 + .../include/adrv903x_cpu_debug_types.h | 23 + .../adrv903x_cpu_device_profile_jesd_types.h | 400 + .../adrv903x_cpu_device_profile_pfir_types.h | 53 + .../adrv903x_cpu_device_profile_types.h | 513 + .../include/adrv903x_cpu_error_codes_types.h | 3326 +++ .../include/adrv903x_cpu_error_tables.h | 2983 ++ .../adrv903x_cpu_error_tables_template.h | 39 + .../include/adrv903x_cpu_fw_rev_info_types.h | 43 + .../adrv903x_cpu_health_monitor_types.h | 41 + .../private/include/adrv903x_cpu_macros.h | 42 + .../private/include/adrv903x_cpu_memory.h | 171 + .../include/adrv903x_cpu_object_ids_types.h | 143 + .../include/adrv903x_cpu_scratch_registers.h | 340 + .../include/adrv903x_cpu_sw_bkpt_types.h | 43 + .../private/include/adrv903x_cpu_types.h | 28 + .../private/include/adrv903x_datainterface.h | 367 + .../adrv903x/private/include/adrv903x_gpio.h | 748 + .../private/include/adrv903x_gpio_types.h | 90 + .../adrv903x/private/include/adrv903x_init.h | 228 + .../include/adrv903x_platform_byte_order.h | 99 + .../private/include/adrv903x_platform_pack.h | 49 + .../private/include/adrv903x_radioctrl.h | 665 + .../include/adrv903x_radioctrl_types.h | 42 + .../include/adrv903x_reg_addr_macros.h | 481 + .../adrv903x/private/include/adrv903x_rx.h | 1290 + .../private/include/adrv903x_rx_types.h | 20 + .../adrv903x_shared_resource_manager.h | 290 + .../adrv903x_shared_resource_manager_types.h | 734 + .../include/adrv903x_stream_id_types.h | 58 + .../include/adrv903x_stream_proc_types.h | 80 + .../private/include/adrv903x_struct_endian.h | 25 + .../adrv903x/private/include/adrv903x_tx.h | 179 + .../adrv903x/private/src/adrv903x_agc.c | 689 + .../adrv903x/private/src/adrv903x_binloader.c | 427 + .../adrv903x/private/src/adrv903x_cpu.c | 1845 ++ .../private/src/adrv903x_datainterface.c | 1815 ++ .../adrv903x/private/src/adrv903x_gpio.c | 3751 +++ .../adrv903x/private/src/adrv903x_init.c | 1344 + .../adrv903x/private/src/adrv903x_radioctrl.c | 2086 ++ .../private/src/adrv903x_reg_addr_macros.c | 1900 ++ .../adrv903x/private/src/adrv903x_rx.c | 6033 ++++ .../src/adrv903x_shared_resource_manager.c | 671 + .../private/src/adrv903x_struct_endian.c | 132 + .../adrv903x/private/src/adrv903x_tx.c | 819 + .../public/include/adi_adrv903x_agc.h | 577 + .../public/include/adi_adrv903x_agc_types.h | 192 + .../public/include/adi_adrv903x_cals.h | 571 + .../include/adi_adrv903x_cals_structs.h | 47 + .../public/include/adi_adrv903x_cals_types.h | 287 + .../public/include/adi_adrv903x_core.h | 584 + .../public/include/adi_adrv903x_cpu.h | 646 + .../include/adi_adrv903x_cpu_cmd_dc_offset.h | 70 + .../include/adi_adrv903x_cpu_cmd_ecc_scrub.h | 50 + ...di_adrv903x_cpu_cmd_run_serdes_eye_sweep.h | 161 + .../adi_adrv903x_cpu_error_codes_types.h | 29 + .../adi_adrv903x_cpu_fw_rev_info_types.h | 31 + .../adi_adrv903x_cpu_health_monitor_types.h | 74 + .../include/adi_adrv903x_cpu_log_types.h | 78 + .../include/adi_adrv903x_cpu_radio_cmd.h | 22 + .../include/adi_adrv903x_cpu_sw_bkpt_types.h | 37 + .../include/adi_adrv903x_cpu_sys_types.h | 48 + .../public/include/adi_adrv903x_cpu_types.h | 105 + .../include/adi_adrv903x_datainterface.h | 1864 ++ .../adi_adrv903x_datainterface_types.h | 667 + .../include/adi_adrv903x_dev_temp_types.h | 85 + .../public/include/adi_adrv903x_error.h | 62 + .../include/adi_adrv903x_error_type_action.h | 49 + .../public/include/adi_adrv903x_error_types.h | 436 + .../public/include/adi_adrv903x_gpio.h | 637 + .../public/include/adi_adrv903x_gpio_types.h | 1021 + .../public/include/adi_adrv903x_hal.h | 387 + .../public/include/adi_adrv903x_hal_types.h | 70 + .../public/include/adi_adrv903x_lo_types.h | 50 + .../include/adi_adrv903x_platform_pack.h | 63 + .../public/include/adi_adrv903x_radioctrl.h | 1129 + .../include/adi_adrv903x_radioctrl_types.h | 355 + .../adrv903x/public/include/adi_adrv903x_rx.h | 809 + .../public/include/adi_adrv903x_rx_nco.h | 130 + .../public/include/adi_adrv903x_rx_types.h | 582 + .../adrv903x/public/include/adi_adrv903x_tx.h | 977 + .../public/include/adi_adrv903x_tx_nco.h | 134 + .../public/include/adi_adrv903x_tx_types.h | 355 + .../public/include/adi_adrv903x_types.h | 559 + .../public/include/adi_adrv903x_user.h | 229 + .../public/include/adi_adrv903x_utilities.h | 685 + .../include/adi_adrv903x_utilities_types.h | 256 + .../public/include/adi_adrv903x_version.h | 21 + .../include/adi_adrv903x_version_types.h | 29 + .../adrv903x/public/src/adi_adrv903x_agc.c | 2623 ++ .../adrv903x/public/src/adi_adrv903x_cals.c | 1791 ++ .../adrv903x/public/src/adi_adrv903x_core.c | 2043 ++ .../adrv903x/public/src/adi_adrv903x_cpu.c | 2075 ++ .../public/src/adi_adrv903x_datainterface.c | 7908 ++++++ .../adrv903x/public/src/adi_adrv903x_error.c | 394 + .../adrv903x/public/src/adi_adrv903x_gpio.c | 1937 ++ .../adrv903x/public/src/adi_adrv903x_hal.c | 2626 ++ .../public/src/adi_adrv903x_radioctrl.c | 4438 +++ .../adrv903x/public/src/adi_adrv903x_rx.c | 2835 ++ .../adrv903x/public/src/adi_adrv903x_tx.c | 4024 +++ .../public/src/adi_adrv903x_utilities.c | 7070 +++++ drivers/iio/adc/adrv903x/initdata.c | 940 + drivers/iio/adc/adrv903x/initdata.h | 26 + .../iio/adc/adrv903x/platforms/adi_library.c | 285 + .../iio/adc/adrv903x/platforms/adi_library.h | 129 + .../adrv903x/platforms/adi_library_types.h | 168 + .../iio/adc/adrv903x/platforms/adi_platform.c | 215 + .../iio/adc/adrv903x/platforms/adi_platform.h | 534 + .../adrv903x/platforms/adi_platform_impl.h | 20 + .../platforms/adi_platform_impl_types.h | 76 + .../adrv903x/platforms/adi_platform_types.h | 311 + .../adc/adrv903x/platforms/linux_platform.c | 995 + 213 files changed, 167656 insertions(+) create mode 100644 drivers/iio/adc/adrv903x/common/adi_common.h create mode 100644 drivers/iio/adc/adrv903x/common/adi_common_macros.h create mode 100644 drivers/iio/adc/adrv903x/common/adi_common_types.h create mode 100644 drivers/iio/adc/adrv903x/common/adi_common_user.h create mode 100644 drivers/iio/adc/adrv903x/common/adi_error/adi_common_error.c create mode 100644 drivers/iio/adc/adrv903x/common/adi_error/adi_common_error.h create mode 100644 drivers/iio/adc/adrv903x/common/adi_error/adi_common_error_types.h create mode 100644 drivers/iio/adc/adrv903x/common/adi_hal/adi_common_hal.c create mode 100644 drivers/iio/adc/adrv903x/common/adi_hal/adi_common_hal.h create mode 100644 drivers/iio/adc/adrv903x/common/adi_logging/adi_common_log.c create mode 100644 drivers/iio/adc/adrv903x/common/adi_logging/adi_common_log.h create mode 100644 drivers/iio/adc/adrv903x/common/adi_logging/adi_common_log_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/multiver/adi_adrv903x_all_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/multiver/adi_adrv903x_api.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_actrl_orx_west_regmap.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_actrl_orx_west_regmap.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_actrl_orx_west_regmap_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_core.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_core.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_core_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_error_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jesd_common.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jesd_common.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jesd_common_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jrx_link.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jrx_link.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jrx_link_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jtx_link.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jtx_link.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jtx_link_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_orx_dig.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_orx_dig.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_orx_dig_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_pll_mem_map.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_pll_mem_map.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_pll_mem_map_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_ddc.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_ddc.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_ddc_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_dig.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_dig.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_dig_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_funcs.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_funcs.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_funcs_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_streamproc.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_streamproc.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_streamproc_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tdr_dpath_top.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tdr_dpath_top.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tdr_dpath_top_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_datapath.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_datapath.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_datapath_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_dig.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_dig.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_dig_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_funcs.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_funcs.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_funcs_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_agc.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_binloader.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_archive_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_bkpt.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_cal_status.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ctrl.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_debug.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_devtemp.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_efuse.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_enter_debug_mode.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_fast_attack.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_force_exception.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_config.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_lofreq.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_nco.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_txatten_phase.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_gpio.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_intf.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_jesd_ser_lane_getset_cfg.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_log.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_mcs.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ping.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_radio.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ram.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_run_init.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_run_serdes_eye_sweep.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ser_reset.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_sys_status.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_t.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_tracking_cals.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_tx_to_orx_mapping.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_debug_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_device_profile_jesd_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_device_profile_pfir_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_device_profile_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_error_codes_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_error_tables.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_error_tables_template.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_fw_rev_info_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_health_monitor_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_macros.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_memory.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_object_ids_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_scratch_registers.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_sw_bkpt_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_datainterface.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_gpio.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_gpio_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_init.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_platform_byte_order.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_platform_pack.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_radioctrl.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_radioctrl_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_reg_addr_macros.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_rx.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_rx_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_shared_resource_manager.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_shared_resource_manager_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_stream_id_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_stream_proc_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_struct_endian.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_tx.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_agc.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_binloader.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_cpu.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_datainterface.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_gpio.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_init.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_radioctrl.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_reg_addr_macros.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_rx.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_shared_resource_manager.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_struct_endian.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_tx.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_agc.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_agc_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cals.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cals_structs.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cals_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_core.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_cmd_dc_offset.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_cmd_ecc_scrub.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_cmd_run_serdes_eye_sweep.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_error_codes_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_fw_rev_info_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_health_monitor_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_log_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_radio_cmd.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_sw_bkpt_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_sys_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_datainterface.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_datainterface_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_dev_temp_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_error.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_error_type_action.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_error_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_gpio.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_gpio_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_hal.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_hal_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_lo_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_platform_pack.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_radioctrl.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_radioctrl_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_rx.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_rx_nco.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_rx_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_tx.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_tx_nco.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_tx_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_user.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_utilities.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_utilities_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_version.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_version_types.h create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_agc.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_cals.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_core.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_cpu.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_datainterface.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_error.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_gpio.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_hal.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_radioctrl.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_rx.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_tx.c create mode 100644 drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_utilities.c create mode 100644 drivers/iio/adc/adrv903x/initdata.c create mode 100644 drivers/iio/adc/adrv903x/initdata.h create mode 100644 drivers/iio/adc/adrv903x/platforms/adi_library.c create mode 100644 drivers/iio/adc/adrv903x/platforms/adi_library.h create mode 100644 drivers/iio/adc/adrv903x/platforms/adi_library_types.h create mode 100644 drivers/iio/adc/adrv903x/platforms/adi_platform.c create mode 100644 drivers/iio/adc/adrv903x/platforms/adi_platform.h create mode 100644 drivers/iio/adc/adrv903x/platforms/adi_platform_impl.h create mode 100644 drivers/iio/adc/adrv903x/platforms/adi_platform_impl_types.h create mode 100644 drivers/iio/adc/adrv903x/platforms/adi_platform_types.h create mode 100644 drivers/iio/adc/adrv903x/platforms/linux_platform.c diff --git a/drivers/iio/adc/adrv903x/common/adi_common.h b/drivers/iio/adc/adrv903x/common/adi_common.h new file mode 100644 index 0000000000000..bbdb544dfd884 --- /dev/null +++ b/drivers/iio/adc/adrv903x/common/adi_common.h @@ -0,0 +1,21 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_common.h +* \brief Contains ADI common interface. +* +* ADI common lib Version: 0.0.2.1 +*/ + +#ifndef _ADI_COMMON_H_ +#define _ADI_COMMON_H_ + +#include "adi_common_error.h" +#include "adi_common_hal.h" +#include "adi_common_log.h" +#include "adi_common_types.h" + +#endif /* _ADI_COMMON_H_ */ diff --git a/drivers/iio/adc/adrv903x/common/adi_common_macros.h b/drivers/iio/adc/adrv903x/common/adi_common_macros.h new file mode 100644 index 0000000000000..df5f0d190567c --- /dev/null +++ b/drivers/iio/adc/adrv903x/common/adi_common_macros.h @@ -0,0 +1,54 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_common_macros.h +* \brief Contains ADI Transceiver general purpose macros. +* +* ADI common lib Version: 0.0.2.1 +*/ + +#ifndef _ADI_COMMON_MACROS_H_ +#define _ADI_COMMON_MACROS_H_ + +#define ADI_HARDRESET 1U +#define ADI_SOFTRESET 0U + +#define ADI_TRUE 1U +#define ADI_FALSE 0U + +#define ADI_ENABLE 1U +#define ADI_DISABLE 0U + +#define ADI_ON 1U +#define ADI_OFF 0U + +#define ADI_SUCCESS 1U +#define ADI_FAILURE 0U + +#define ADI_NO_VARIABLE 0 +#define ADI_NO_ERROR_MESSAGE "No Error Message" + +#define ADI_VERBOSE_OFF_MESSAGE "Verbose OFF: No String Messages Built in API Code" + +#define ADI_LOG_INDENT 4U + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +#ifndef ADI_API_EX + #ifdef __cplusplus + #define ADI_API_EX ADI_API + #else + #define ADI_API_EX ADI_API extern + #endif +#endif + +#endif /* _ADI_COMMON_MACROS_H_ */ diff --git a/drivers/iio/adc/adrv903x/common/adi_common_types.h b/drivers/iio/adc/adrv903x/common/adi_common_types.h new file mode 100644 index 0000000000000..5731044baea46 --- /dev/null +++ b/drivers/iio/adc/adrv903x/common/adi_common_types.h @@ -0,0 +1,117 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_common_types.h +* \brief Contains ADI common types. +* +* ADI common lib Version: 0.0.2.1 +*/ + +#ifndef _ADI_COMMON_TYPES_H_ +#define _ADI_COMMON_TYPES_H_ + +#include "adi_common_error_types.h" +#include "adi_platform_types.h" + +#define ADI_COMMON_DEVICE_BF_ENCODE(value, mask, shift) (((value) << (shift)) & (mask)) +#define ADI_COMMON_DEVICE_BF_DECODE(value, mask, shift) (((value) & (mask)) >> (shift)) +#define ADI_COMMON_DEVICE_BF_CLEAR(result, mask) (result = ((result) & ~(mask))) +#define ADI_COMMON_DEVICE_BF_SET(result, mask) (result = (result) | (mask)) +#define ADI_COMMON_DEVICE_BF_UPDATE(result, value, mask, shift) (result = ((result) & ~(mask)) | ( ((value) << (shift)) & (mask))) +#define ADI_COMMON_DEVICE_BF_EQUAL(value, mask) ((mask) == ((value) & (mask))) + +/* +* \brief Common File Abstractions +*/ +typedef enum +{ + ADI_COMMON_FILE_HAL = 0x0U, + ADI_COMMON_FILE_LOGGING +} adi_common_File_e; + +/* +* \brief ADI Common Device Information +*/ +typedef struct +{ + uint32_t type; /* Device Type */ + uint32_t id; /* Device Number */ + const char* name; /* Device Name */ +} adi_common_DeviceInfo_t; + +/** + * \brief Mask values to be used with adi_common_Device.state. + * + * Members are intended to populate a uint8_t bitfield so must not exceed 1 << 7. + */ +typedef enum +{ + ADI_COMMON_DEVICE_STATE_OPEN = 1U << 0U, /*!< Device has been opened successfully with HwOpen. */ + /** Device is in a time-critical state. May be used to suspend some logging etc. */ + ADI_COMMON_DEVICE_STATE_TC = 1U << 1U +} adi_common_DeviceState_e; + +/** + * \brief Values to be used with adi_common_hal_ApiEnter_vLogCtl + */ +typedef enum +{ + ADI_COMMON_DEVICE_LOGCTL_NORMAL = 1U << 0U, /*!< Log API entry/exit as normal */ + ADI_COMMON_DEVICE_LOGCTL_QUIET = 1U << 1U /*!< De-prioritize the logging of this entry/exit */ +}adi_common_LogCtl_e; + +/** +* \brief ADI common device structure +*/ +typedef struct adi_common_Device +{ + adi_common_DeviceInfo_t deviceInfo; /* Device Information */ + void* devHalInfo; /* Hardware Abstraction Layer Settings */ + adi_common_ErrData_t* errPtr; /* Error Memory Pointer */ + uint8_t wrOnly; /* !0 => device is in a SPI write-only state, 0 device is in normal read-write state */ + adi_hal_mutex_t mutex; /* Used to serialize device access from multi-threaded client applications */ + uint16_t lockCnt; /* Counts number of times lock acquired using adi_common_Lock() */ + const char* type; /*!< Human-readable string indicating the device type */ + uint16_t id; /*!< Identifies an instance of a particular device type */ + uint8_t state; /*!< Bitfield as per adi_common_DeviceState_e */ + uint16_t publicCnt; /*!< Public API Count in the Call Stack */ +} adi_common_Device_t; + +/** + * \brief Evaluates to non-zero if a device's IS_OPEN state is set. See adi_common_DeviceState_e. + * \param commonDev - adi_common_Device_t + */ +#define ADI_COMMON_DEVICE_STATE_IS_OPEN(commonDev) ADI_COMMON_DEVICE_BF_EQUAL((commonDev).state, ADI_COMMON_DEVICE_STATE_OPEN) + +/** + * \brief Sets a device's IS_OPEN state. See adi_common_DeviceState_e. + * \param commonDev - adi_common_Device_t + */ +#define ADI_COMMON_DEVICE_STATE_OPEN_SET(commonDev) ADI_COMMON_DEVICE_BF_SET((commonDev).state, ADI_COMMON_DEVICE_STATE_OPEN) + +/** + * \brief Clears a device's IS_OPEN state. See adi_common_DeviceState_e. + * \param commonDev - adi_common_Device_t + */ +#define ADI_COMMON_DEVICE_STATE_OPEN_CLR(commonDev) ADI_COMMON_DEVICE_BF_CLEAR((commonDev).state, ADI_COMMON_DEVICE_STATE_OPEN) + +/** + * \brief Evaluates to non-zero if a device's TC (time-critical) state is set. See adi_common_DeviceState_e. + * \param commonDev - adi_common_Device_t + */ +#define ADI_COMMON_DEVICE_STATE_IS_TC(commonDev) ADI_COMMON_DEVICE_BF_EQUAL((commonDev).state, ADI_COMMON_DEVICE_STATE_TC) +/** + * \brief Sets a device's TC (time-critical) state. See adi_common_DeviceState_e. + * \param commonDev - adi_common_Device_t + */ +#define ADI_COMMON_DEVICE_STATE_TC_SET(commonDev) ADI_COMMON_DEVICE_BF_SET((commonDev).state, ADI_COMMON_DEVICE_STATE_TC) +/** + * \brief Clears a device's TC (time-critical) state. See adi_common_DeviceState_e. + * \param commonDev - adi_common_Device_t + */ +#define ADI_COMMON_DEVICE_STATE_TC_CLR(commonDev) ADI_COMMON_DEVICE_BF_CLEAR((commonDev).state, ADI_COMMON_DEVICE_STATE_TC) + +#endif /* _ADI_COMMON_TYPES_H_ */ \ No newline at end of file diff --git a/drivers/iio/adc/adrv903x/common/adi_common_user.h b/drivers/iio/adc/adrv903x/common/adi_common_user.h new file mode 100644 index 0000000000000..972eda1a39e08 --- /dev/null +++ b/drivers/iio/adc/adrv903x/common/adi_common_user.h @@ -0,0 +1,35 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_common_user.h +* \brief Contains COMMON API macro definitions for user to override +* +* ADI common lib Version: 0.0.2.1 +*/ +#ifndef _ADI_COMMON_USER_H_ +#define _ADI_COMMON_USER_H_ + +#ifndef ADI_COMMON_VERBOSE + #define ADI_COMMON_VERBOSE 1 +#endif /* Verbose Flag (i.e. String Enable Flag) */ + +#ifndef ADI_COMMON_VARIABLE_USAGE + #define ADI_COMMON_VARIABLE_USAGE 1 +#endif /* Variable Name String Conversion Flag */ + +#ifndef ADI_COMMON_ERROR_VARIABLE_TYPE + #define ADI_COMMON_ERROR_VARIABLE_TYPE (int64_t) (intptr_t) +#endif /* Error Reporting Variable Data Type */ + +#ifndef ADI_COMMON_LOG_ERR_INDENT1 + #define ADI_COMMON_LOG_ERR_INDENT1 "\t\t\t\t\t" +#endif /* Log Error Indentation 1 */ + +#ifndef ADI_COMMON_LOG_ERR_INDENT2 + #define ADI_COMMON_LOG_ERR_INDENT2 "\t\t\t\t\t\t" +#endif /* Log Error Indentation 2 */ + +#endif /* _ADI_COMMON_USER_H_ */ \ No newline at end of file diff --git a/drivers/iio/adc/adrv903x/common/adi_error/adi_common_error.c b/drivers/iio/adc/adrv903x/common/adi_error/adi_common_error.c new file mode 100644 index 0000000000000..7d9d99c1e50ef --- /dev/null +++ b/drivers/iio/adc/adrv903x/common/adi_error/adi_common_error.c @@ -0,0 +1,324 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_common_error.c + * \brief Contains common API error handling functions implementations + * + * These functions are public to the customer for getting more details on + * errors and debugging. + * + * ADI common lib Version: 0.0.2.1 + */ + +#include "adi_common_error.h" +#include "adi_platform_types.h" + +#define ADI_ERROR_FRAME_PRINTF(errPtr, frameIdx) ADI_LIBRARY_PRINTF("Error Frame: %" PRIu32 "\n" \ + ADI_COMMON_LOG_ERR_INDENT1 "Recovery Action: %" PRId64 "\n" \ + ADI_COMMON_LOG_ERR_INDENT1 "Event Information:\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Error Code: 0x%" PRIX64"\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Error Source: 0x%" PRIX32 "\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Error Message: %s\n" \ + ADI_COMMON_LOG_ERR_INDENT1 "File Information:\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Line: %" PRIu32"\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Function: %s\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "File: %" PRIu32"\n" \ + ADI_COMMON_LOG_ERR_INDENT1 "Variable Information:\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Variable Name: %s\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Variable Data: 0x%" PRIX64 "\n\n", \ + frameIdx, \ + (int64_t)errPtr->stackTrace[frameIdx].action, \ + errPtr->stackTrace[frameIdx].errInfo.errCode, \ + errPtr->stackTrace[frameIdx].errInfo.errSrc, \ + errPtr->stackTrace[frameIdx].errInfo.errMsg, \ + errPtr->stackTrace[frameIdx].fileInfo.line, \ + errPtr->stackTrace[frameIdx].fileInfo.function, \ + errPtr->stackTrace[frameIdx].fileInfo.file, \ + errPtr->stackTrace[frameIdx].varInfo.varName, \ + errPtr->stackTrace[frameIdx].varInfo.varData); + +ADI_API adi_common_ErrAction_e adi_common_ErrReport(const adi_common_Device_t* const commonDev, + const uint32_t errSource, + const adi_common_ErrAction_e action, + const int64_t errCode, + const uint32_t lineNum, + const char* funcName, + const uint32_t fileName, + const char* varName, + const int64_t varData, + const char* errMsg) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + + ADI_NULL_COMMON_PTR_RETURN(commonDev); + + ADI_NULL_PTR_RETURN(commonDev->errPtr); + + /* Check if Trace Buffer is Full */ + if (ADI_COMMON_STACK_TRACE_SIZE > commonDev->errPtr->errDataInfo.stackIdx) + { + /* Recovery Action */ + commonDev->errPtr->stackTrace[commonDev->errPtr->errDataInfo.stackIdx].action = action; + /* Error Event Info */ + commonDev->errPtr->stackTrace[commonDev->errPtr->errDataInfo.stackIdx].errInfo.errCode = errCode; + commonDev->errPtr->stackTrace[commonDev->errPtr->errDataInfo.stackIdx].errInfo.errMsg = errMsg; + commonDev->errPtr->stackTrace[commonDev->errPtr->errDataInfo.stackIdx].errInfo.errSrc = errSource; + /* File Info */ + commonDev->errPtr->stackTrace[commonDev->errPtr->errDataInfo.stackIdx].fileInfo.line = lineNum; + commonDev->errPtr->stackTrace[commonDev->errPtr->errDataInfo.stackIdx].fileInfo.function = funcName; + commonDev->errPtr->stackTrace[commonDev->errPtr->errDataInfo.stackIdx].fileInfo.file = fileName; + /* Variable Information */ + commonDev->errPtr->stackTrace[commonDev->errPtr->errDataInfo.stackIdx].varInfo.varName = varName; + commonDev->errPtr->stackTrace[commonDev->errPtr->errDataInfo.stackIdx].varInfo.varData = varData; + /* Check Error Priority for Highest Recorded Action in Call Stack */ + if (action < commonDev->errPtr->errDebugInfo.highestPriorityAction) + { + commonDev->errPtr->errDebugInfo.highestPriorityAction = action; + } + + if (commonDev->errPtr->errDataInfo.stackIdx == 0U) + { + /* Copy Device Info @ 1st Error Frame */ + commonDev->errPtr->errDataInfo.errDeviceInfo.type = commonDev->deviceInfo.type; + commonDev->errPtr->errDataInfo.errDeviceInfo.id = commonDev->deviceInfo.id; + commonDev->errPtr->errDataInfo.errDeviceInfo.name = commonDev->deviceInfo.name; + } + + /* Update StackTrace Index for Next Entry */ + ++commonDev->errPtr->errDataInfo.stackIdx; + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + } + + return recoveryAction; +} + +ADI_API adi_common_ErrAction_e adi_common_ErrMsgReport( const adi_common_Device_t* const commonDev, + const char* errCausePtr, + const char* errActionMsgPtr) +{ + ADI_NULL_COMMON_PTR_RETURN(commonDev); + + ADI_NULL_PTR_RETURN(commonDev->errPtr); + + /* Report First Error Cause & Action Message */ + if ((NULL == commonDev->errPtr->errDebugInfo.errCause) && + (NULL == commonDev->errPtr->errDebugInfo.actionMsg)) + { + commonDev->errPtr->errDebugInfo.errCause = errCausePtr; + commonDev->errPtr->errDebugInfo.actionMsg = errActionMsgPtr; + } + + return ADI_COMMON_ERR_ACT_NONE; +} + +ADI_API void adi_common_ErrStandardOutputWrite(const adi_common_ErrData_t* const errData) +{ + uint32_t idx = 0U; + + if (errData != NULL) + { + if (errData->errDataInfo.stackIdx > 0) + { + for (idx = 0U; idx < errData->errDataInfo.stackIdx; ++idx) + { + ADI_ERROR_FRAME_PRINTF(errData, idx) + } + } + } +} + + +ADI_API adi_common_ErrData_t* adi_common_ErrCreate(void) +{ + adi_common_ErrData_t* errDataPtr = (adi_common_ErrData_t*)ADI_LIBRARY_CALLOC(1, sizeof(adi_common_ErrData_t)); + + if (NULL == errDataPtr) + { + return NULL; + } + + return errDataPtr; +} + +ADI_API adi_common_ErrAction_e adi_common_ErrAssign(adi_common_Device_t* const commonDev, + adi_common_ErrData_t* const errDataPtr) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + + if ((NULL != commonDev) && + (NULL != errDataPtr)) + { + commonDev->errPtr = errDataPtr; + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + } + + return recoveryAction; +} + +ADI_API adi_common_ErrAction_e adi_common_ErrDestroy(adi_common_ErrData_t* errDataPtr) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + + /* Validate Argument(s) */ + ADI_NULL_PTR_RETURN(errDataPtr); + + /* Free Memory */ + ADI_LIBRARY_FREE(errDataPtr); + errDataPtr = NULL; + + if (NULL == errDataPtr) + { + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + } + + return recoveryAction; +} + +ADI_API adi_common_ErrAction_e adi_common_ErrClear(adi_common_ErrData_t* const errDataPtr) +{ + uint32_t idx = 0U; + + /* Validate Argument(s) */ + ADI_NULL_PTR_RETURN(errDataPtr); + + for (idx = 0U; idx < ADI_COMMON_STACK_TRACE_SIZE; ++idx) + { + errDataPtr->stackTrace[idx].action = ADI_COMMON_ERR_ACT_NONE; + errDataPtr->stackTrace[idx].errInfo.errCode = 0; + errDataPtr->stackTrace[idx].errInfo.errMsg = NULL; + errDataPtr->stackTrace[idx].errInfo.errSrc = 0U; + errDataPtr->stackTrace[idx].fileInfo.line = 0U; + errDataPtr->stackTrace[idx].fileInfo.function = NULL; + errDataPtr->stackTrace[idx].fileInfo.file = 0U; + errDataPtr->stackTrace[idx].varInfo.varName = NULL; + errDataPtr->stackTrace[idx].varInfo.varData = 0; + } + /* Debug Info */ + errDataPtr->errDebugInfo.highestPriorityAction = ADI_COMMON_ERR_ACT_NONE; + errDataPtr->errDebugInfo.errCause = NULL; + errDataPtr->errDebugInfo.actionMsg = NULL; + + /* Error Data Info */ + errDataPtr->errDataInfo.errDeviceInfo.type = 0U; + errDataPtr->errDataInfo.errDeviceInfo.id = 0U; + errDataPtr->errDataInfo.errDeviceInfo.name = NULL; + errDataPtr->errDataInfo.stackIdx = 0U; + + return ADI_COMMON_ERR_ACT_NONE; +} + +ADI_API adi_common_ErrAction_e adi_common_ErrFrameGet( const adi_common_Device_t* const commonDev, + const adi_common_ErrFrameId_e frameId, + adi_common_ErrFrame_t* const errFrame) +{ + uint8_t idx = 0U; + + /* Validate Argument(s) */ + ADI_NULL_COMMON_PTR_RETURN(commonDev); + + ADI_NULL_PTR_RETURN(commonDev->errPtr); + + ADI_NULL_PTR_RETURN(errFrame); + + if (ADI_COMMON_ERRFRAME_MAX < frameId) + { + /* Frame Index Out of Range; ADI_COMMON_ERRFRAME_MAX / TOP is only non Index Allowed */ + return ADI_COMMON_ERR_ACT_CHECK_PARAM; + } + + if (ADI_COMMON_ERRFRAME_API == frameId) + { + if (ADI_COMMON_ERRFRAME_IDX_0 != commonDev->errPtr->errDataInfo.stackIdx) + { + /* Stack Index is configured for the next Error Entry; We want the last entry */ + idx = (commonDev->errPtr->errDataInfo.stackIdx - 1U); + } + } + else + { + idx = frameId; + } + + /* Shallow Copy */ + *errFrame = commonDev->errPtr->stackTrace[idx]; + + return ADI_COMMON_ERR_ACT_NONE; +} + +ADI_API adi_common_ErrAction_e adi_common_ErrorGet( const int64_t errCode, + const char** const errMsgPtr, + adi_common_ErrAction_e* const action) +{ + static const adi_common_api_errors_t adi_common_api_errors[] = + { + { ADI_COMMON_ERRCODE_NONE, ADI_STRING("No Error"), ADI_COMMON_ERR_ACT_NONE }, + { ADI_COMMON_ERRCODE_INVALID_PARAM, ADI_STRING("Invalid Parameter Value"), ADI_COMMON_ERR_ACT_CHECK_PARAM }, + { ADI_COMMON_ERRCODE_NULL_PTR, ADI_STRING("Null Pointer"), ADI_COMMON_ERR_ACT_CHECK_PARAM }, + { ADI_COMMON_ERRCODE_API, ADI_STRING("API Call Error"), ADI_COMMON_ERR_ACT_CHECK_PARAM }, + { ADI_COMMON_ERRCODE_ARRAY_SIZE, ADI_STRING("Invalid Array Size"), ADI_COMMON_ERR_ACT_CHECK_PARAM }, + { ADI_COMMON_ERRCODE_LOCK, ADI_STRING("Mutex (Un)Locking Problem"), ADI_COMMON_ERR_ACT_RESET_DEVICE }, + { ADI_COMMON_ERRCODE_FEATURE_NOT_IMPLEMENTED, ADI_STRING("Feature Not Implemented"), ADI_COMMON_ERR_ACT_CHECK_FEATURE }, + { ADI_COMMON_ERRCODE_TIMEOUT, ADI_STRING("Timeout"), ADI_COMMON_ERR_ACT_RESET_FEATURE }, + { ADI_COMMON_ERRCODE_BOOT_TIMEOUT, ADI_STRING("Boot Timeout"), ADI_COMMON_ERR_ACT_RESET_DEVICE } + }; + + uint32_t idx; + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + + ADI_NULL_PTR_RETURN(errMsgPtr); + + ADI_NULL_PTR_RETURN(action); + + for (idx = 0; (idx < (sizeof(adi_common_api_errors) / sizeof(adi_common_api_errors_t))); ++idx) + { + if (errCode == adi_common_api_errors[idx].errCode) + { + *errMsgPtr = adi_common_api_errors[idx].errMsg; + *action = adi_common_api_errors[idx].action; + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + break; + } + } + return recoveryAction; +} + + +ADI_API adi_common_ErrAction_e adi_common_ErrInfoGet( const adi_common_ErrSources_e errSrc, + const int64_t errCode, + const char** const errMsgPtr, + adi_common_ErrAction_e* const errAction) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + + ADI_NULL_PTR_RETURN(errMsgPtr); + + ADI_NULL_PTR_RETURN(errAction); + + /* Default Values */ + *errMsgPtr = NULL; + *errAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + + switch (errSrc) + { + case ADI_COMMON_ERRSRC_API: + case ADI_COMMON_ERRSRC_HAL: + case ADI_COMMON_ERRSRC_DEVICEHAL: + case ADI_COMMON_ERRSRC_DEVICEBF: + /* All Using Same Generic Error Codes */ + recoveryAction = adi_common_ErrorGet(errCode, errMsgPtr, errAction); + break; + + case ADI_COMMON_ERRSRC_NONE: + /* Fall Through */ + + default: + /* Invalid Error Source; No Lookup can be performed */ + recoveryAction = ADI_COMMON_ERR_ACT_CHECK_FEATURE; + break; + } + + return recoveryAction; +} diff --git a/drivers/iio/adc/adrv903x/common/adi_error/adi_common_error.h b/drivers/iio/adc/adrv903x/common/adi_error/adi_common_error.h new file mode 100644 index 0000000000000..287d45981f79c --- /dev/null +++ b/drivers/iio/adc/adrv903x/common/adi_error/adi_common_error.h @@ -0,0 +1,481 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_common_error.h + * \brief Contains Common API error handling function prototypes and macros + * that will be used by the API and will call functions in adi_common_error.c + * + * These functions are public to the customer for getting more details on + * errors and debugging. + * +* ADI common lib Version: 0.0.2.1 + */ + +#ifndef _ADI_COMMON_ERROR_H_ +#define _ADI_COMMON_ERROR_H_ + +#include "adi_common_types.h" +#include "adi_common_macros.h" +#include "adi_common_user.h" +#include "adi_common_error_types.h" +#include "adi_common_log.h" + + +/* +* ******************************* +* ADI Common error macros +* ******************************* +*/ + +/* +* \brief Macro to check for Null Device & Error Pointer +* +* \param devicePtr Device Pointer +*/ +#define ADI_NULL_DEVICE_PTR_RETURN(devicePtr) \ +if (devicePtr == NULL) \ +{ \ + return ADI_COMMON_ERR_ACT_CHECK_PARAM; \ +} + +/* +* \brief Macro to check for Null Common Device & Error Pointer +* +* \param commonDev Common Device Pointer, which also contains the Error Pointer +*/ +#define ADI_NULL_COMMON_PTR_RETURN(commonDev) \ +if ((commonDev == NULL) || \ + (commonDev->errPtr == NULL)) \ +{ \ + return ADI_COMMON_ERR_ACT_CHECK_PARAM; \ +} + +/* +* \brief Macro to check for Null Pointer +* +* \param ptr Pointer to be checked +*/ +#define ADI_NULL_PTR_RETURN(ptr) \ +if (ptr == NULL) \ +{ \ + return ADI_COMMON_ERR_ACT_CHECK_PARAM; \ +} +/* +* \brief Macro to perform the following: +* 1) Null Pointer Check +* 2) Report Null Pointer to Error Memory +* 3) Return ADI_COMMON_ERR_ACT_CHECK_PARAM from API + +* \param commonDev Pointer to the common Device Structure (contains a pointer to Error Memory) +* \param ptr Pointer to be checked +* +*/ +#define ADI_NULL_PTR_REPORT_RETURN(commonDev, ptr) \ +{ \ + if (ptr == NULL) \ + { \ + ADI_ERROR_REPORT( commonDev, \ + ADI_COMMON_ERRSRC_API, \ + ADI_COMMON_ERRCODE_NULL_PTR, \ + ADI_COMMON_ERR_ACT_CHECK_PARAM, \ + ptr, \ + "Null Pointer"); \ + \ + return ADI_COMMON_ERR_ACT_CHECK_PARAM; \ + } \ +} + +/* +* \brief Macro to perform the following: +* 1) Null Pointer Check +* 2) Report Null Pointer to Error Memory +* 3) GOTO label specified + +* \param commonDev Pointer to the common Device Structure (contains a pointer to Error Memory) +* \param ptr Pointer to be checked +* \param label Label for GOTO +* +*/ +#define ADI_NULL_PTR_REPORT_GOTO(commonDev, ptr, label) \ +{ \ + if (ptr == NULL) \ + { \ + ADI_ERROR_REPORT( commonDev, \ + ADI_COMMON_ERRSRC_API, \ + ADI_COMMON_ERRCODE_NULL_PTR, \ + ADI_COMMON_ERR_ACT_CHECK_PARAM, \ + ptr, \ + "Null Pointer"); \ + \ + goto label; \ + } \ +} + +#if ADI_COMMON_VERBOSE > 0 + #if ADI_COMMON_VARIABLE_USAGE > 0 + /* + * Macro to print variable name as a string, used in Error reporting facility + */ + #ifndef GET_VARIABLE_NAME + #define GET_VARIABLE_NAME(Variable) (#Variable) + #endif /* GET_VARIABLE_NAME(Variable) (#Variable) */ + #else + #ifndef GET_VARIABLE_NAME + #define GET_VARIABLE_NAME(Variable) (ADI_NO_ERROR_MESSAGE) + #endif /* GET_VARIABLE_NAME(Variable) (ADI_NO_ERROR_MESSAGE)*/ + #endif /* ADI_COMMON_VARIABLE_USAGE */ + + /** + * \brief Macro to be used for strings in code (Can be removed via ADI_COMMON_VERBOSE) + * + * \param string Error String + * + */ + #define ADI_STRING(string) string + +#else /* ADI_COMMON_VERBOSE OFF */ + #define ADI_STRING(string) ADI_VERBOSE_OFF_MESSAGE; +#endif /* ADI_COMMON_VERBOSE */ + +/* +* \brief Macro to perform Error Reporting to Memory & Error Logging to File + +* \param commonDev Pointer to the common Device Structure (contains a pointer to Error Memory) +* \param errSource Source of Error +* \param errAction Recovery Action to be taken from the current API +* \param errCode Error Code to be Logged +* \param variable Variable Name & Data that failed the parameter check, if applicable +* NOTE1: Explicit Type Conversion to int64_t for storage in Error Structure +* NOTE2: Passing of Pointers/String Literals will store Memory Address +* NOTE3: Capturing Entire Data Structures Not Supported +* NOTE4: Set to ADI_NO_VARIABLE if there is no variable related to the error +* \param errMsg Error Message +*/ +#define ADI_ERROR_REPORT( commonDev, \ + errSource, \ + errCode, \ + recoveryAction, \ + variable, \ + errMsg) \ + \ + (void)adi_common_ErrReport ( commonDev, \ + (uint32_t) errSource, /* Explicit Type Conversion; errSource stored as uint32_t */ \ + (adi_common_ErrAction_e) recoveryAction, /* Explicit Type Conversion;recoveryAction stored as adi_common_ErrAction_e */ \ + (int64_t) errCode, /* Explicit Type Conversion; errCode stored as int64_t */ \ + __LINE__, \ + __func__, \ + (uint32_t) ADI_FILE, /* Explicit Type Conversion; ADI_FILE stored as uint32_t */ \ + ADI_STRING(GET_VARIABLE_NAME(variable)), \ + ADI_COMMON_ERROR_VARIABLE_TYPE variable, /* Explicit Type Conversion; variable stored as int64_t via ADI_COMMON_ERROR_VARIABLE_TYPE */ \ + ADI_STRING(errMsg)); \ + \ + (void)adi_adrv903x_ErrLog ( commonDev, \ + (uint32_t) errSource, /* Explicit Type Conversion; errSource stored as uint32_t */ \ + (adi_common_ErrAction_e) recoveryAction, /* Explicit Type Conversion;recoveryAction stored as adi_common_ErrAction_e */ \ + (int64_t) errCode, /* Explicit Type Conversion; errCode stored as int64_t */ \ + __LINE__, \ + __func__, \ + (uint32_t) ADI_FILE, /* Explicit Type Conversion; ADI_FILE stored as uint32_t */ \ + ADI_STRING(GET_VARIABLE_NAME(variable)), \ + ADI_COMMON_ERROR_VARIABLE_TYPE variable, /* Explicit Type Conversion; variable stored as int64_t via ADI_COMMON_ERROR_VARIABLE_TYPE */ \ + ADI_STRING(errMsg)) +/* +* \brief Macro to perform Invalid Parameter Error Reporting to Memory & Error Logging to File + +* \param commonDev Pointer to the common Device Structure (contains a pointer to Error Memory) +* \param errAction Recovery Action to be taken from the current API +* \param variable Variable Name & Data that failed the parameter check, if applicable +* NOTE1: Passing of Pointers will store Memory Address +* NOTE2: Capturing Entire Data Structures Not Supported +* \param errMsg Error Message +*/ +#define ADI_PARAM_ERROR_REPORT( commonDev, \ + recoveryAction, \ + variable, \ + errMsg) \ + \ + ADI_ERROR_REPORT( commonDev, \ + ADI_COMMON_ERRSRC_API, \ + ADI_COMMON_ERRCODE_INVALID_PARAM, \ + recoveryAction, \ + variable, \ + errMsg); + +/* +* \brief Macro to perform API Error Reporting to Memory & Error Logging to File + +* \param commonDev Pointer to the common Device Structure (contains a pointer to Error Memory) +* \param errAction Recovery Action to be taken from the current API +* \param errMsg Error Message +*/ +#define ADI_API_ERROR_REPORT( commonDev, \ + recoveryAction, \ + errMsg) \ + \ + ADI_ERROR_REPORT( commonDev, \ + ADI_COMMON_ERRSRC_API, \ + ADI_COMMON_ERRCODE_API, \ + recoveryAction, \ + ADI_NO_VARIABLE, \ + errMsg) + + +/* +* \brief Macro to perform the following: +* 1) Write Message to Standard Output +*/ +#define ADI_APP_MESSAGE(...) ADI_LIBRARY_PRINTF(__VA_ARGS__); + + +/* +* \brief Macro to perform the following: +* 1) Write Error Data to Standard Output +*/ +#define ADI_APP_ERROR_OUTPUT(errPtr) adi_common_ErrStandardOutputWrite(errPtr); + +/* +* \brief Macro to perform Application Level Error Reporting to Memory & Error Logging to File + +* \param commonDev Pointer to the common Device Structure (contains a pointer to Error Memory) +* \param errCode Error Code (Mapped to ADI_COMMON_ERRSRC_APP) +* \param errAction Recovery Action to be taken from the current API +* \param variable Variable Name & Data that failed the parameter check, if applicable +* NOTE1: Passing of Pointers will store Memory Address +* NOTE2: Capturing Entire Data Structures Not Supported +* \param errMsg Error Message +*/ +#define ADI_APP_ERROR_REPORT( errCode, \ + recoveryAction, \ + variable, \ + errMsg) \ + \ +{ \ + adi_common_Device_t commonDev; \ + ADI_LIBRARY_MEMSET(&commonDev, 0, sizeof(adi_common_Device_t)); \ + \ + commonDev.errPtr = (adi_common_ErrData_t*) adrv903x_TlsGet(HAL_TLS_ERR); \ + \ + ADI_ERROR_REPORT( &commonDev, \ + ADI_COMMON_ERRSRC_APP, \ + errCode, \ + recoveryAction, \ + variable, \ + errMsg); \ +} + +/* +* \brief Macro to perform API Error Reporting to Memory & Error Logging to File + +* \param commonDev Pointer to the common Device Structure (contains a pointer to Error Memory) +* \param errAction Recovery Action to be taken from the current API +* \param errMsg Error Message +*/ +#define ADI_EXT_ERROR_REPORT( commonDev, \ + errCause, \ + errActionMsg) \ + \ + (void) adi_common_ErrMsgReport( commonDev, \ + errCause, \ + errActionMsg) + +/* +* \brief Macro to perform the following: +* 1) Report Feature Not Implemented +* 2) Return Common RecoveryAction (i.e. ADI_COMMON_ERR_ACT_CHECK_FEATURE) +*/ +#define ADI_API_NOT_IMPLEMENTED_REPORT_RETURN( commonDev) \ + \ + ADI_ERROR_REPORT( commonDev, \ + ADI_COMMON_ERRSRC_API, \ + ADI_COMMON_ERRCODE_FEATURE_NOT_IMPLEMENTED, \ + ADI_COMMON_ERR_ACT_CHECK_FEATURE, \ + ADI_NO_VARIABLE, \ + "Feature not implemented"); \ + return ADI_COMMON_ERR_ACT_CHECK_FEATURE; + +/* +* \brief Macro to perform the following: +* 1) Report Feature Not Implemented +* 2) GOTO label specified +*/ +#define ADI_API_NOT_IMPLEMENTED_REPORT_GOTO( commonDev, label) \ + \ + ADI_ERROR_REPORT( commonDev, \ + ADI_COMMON_ERRSRC_API, \ + ADI_COMMON_ERRCODE_FEATURE_NOT_IMPLEMENTED, \ + ADI_COMMON_ERR_ACT_CHECK_FEATURE, \ + ADI_NO_VARIABLE, \ + "Feature not implemented"); \ + goto label; + +/* +* \brief Macro to Create an Error Structure +* +* \param errDataPtr Pointer to Error Structure +*/ +#define ADI_CREATE_ERROR_MEMORY() adi_common_ErrCreate() + + +/* +* \brief Macro to Assign Error Pointer to Device Structure +* +* \param commonDev Pointer to Common Device +* \param errDataPtr Pointer to Error Structure +*/ +#define ADI_ASSIGN_ERROR_MEMORY(commonDev, errDataPtr) adi_common_ErrAssign(commonDev, errDataPtr) + +/* +* \brief Macro to Destroy an Error Structure +* +* \param errDataPtr Pointer to Error Structure +*/ +#define ADI_DESTROY_ERROR_MEMORY(errDataPtr) adi_common_ErrDestroy(errDataPtr) + +/* +* \brief Macro to clear an Error Structure +* +* \param errDataPtr Pointer to Error Structure +*/ +#define ADI_CLEAR_ERROR_MEMORY(errDataPtr) adi_common_ErrClear(errDataPtr) + +/* +* \brief Macro to Get Error Frame from Stack Trace +* +* \param commonDev Pointer to Common Device +* \param frameId Frame ID +* \param errDataPtr Pointer to Error Frame +*/ +#define ADI_ERROR_FRAME_GET(commonDev, frameId, framePtr) adi_common_ErrFrameGet(commonDev, frameId, framePtr) + +/* +* ******************************* +* ADI Common error functions +* ******************************* +*/ + +/* + * \brief Service to Report an Error + * + * \param[in] commonDev pointer to adi_common_Device_t + * \param[in] actionRequired RecoveryAction to be taken + * \param[in] lineNum line number of where the error was detected + * \param[in] funcName function name of the function where the error was detected + * \param[in] fileName file name of the file where the error was detected + * \param[in] detErr Detected Error Code + * \param[in] errCodeMsg Error Message + * \param[in] varName Variable name to be captured + * \param[in] varData Variable Data will be captured (Limitations Apply) + * \param[in] errMsg User Readable Error Message + */ +ADI_API adi_common_ErrAction_e adi_common_ErrReport(const adi_common_Device_t* const commonDev, + const uint32_t errSource, + const adi_common_ErrAction_e action, + const int64_t errCode, + const uint32_t lineNum, + const char* funcName, + const uint32_t fileName, + const char* varName, + const int64_t varData, + const char* errMsg); + +/* + * \brief Service to Report Additional Error Messages + * + * \param[in] commonDev pointer to adi_common_Device_t + * \param[in] errCausePtr Error Cause Message + * \param[in] errActionMsgPtr Recovery Action Message + */ +ADI_API adi_common_ErrAction_e adi_common_ErrMsgReport( const adi_common_Device_t* const commonDev, + const char* errCausePtr, + const char* errActionMsgPtr); + +/* +* \brief Service to Write Error to Standard Output +* +* \param[in] errData pointer to adi_common_Device_t Error Data +* +*/ +ADI_API void adi_common_ErrStandardOutputWrite(const adi_common_ErrData_t* const errData); + +/* + * \brief Create Error Structure in Memory + * + * \retval adi_common_ErrData_t* Non NULL Pointer to Error Structure is created + */ +ADI_API adi_common_ErrData_t* adi_common_ErrCreate(void); + +/* + * \brief Assign Error Structure in Memory to Common Device Structure + * + * \param[in] commonDev pointer to adi_common_Device_t + * \param[in] errDataPtr pointer to adi_common_ErrData_t + * + * \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if successfully assigned + */ +ADI_API adi_common_ErrAction_e adi_common_ErrAssign(adi_common_Device_t* const commonDev, + adi_common_ErrData_t* const errDataPtr); + +/* + * \brief Service to Parse an Stack Trace Frame from the Error Structure + * + * \param[in] commonDev pointer to adi_common_Device_t + * \param[in] frameId Frame ID to Parse + * \param[out] errFrame pointer to adi_common_ErrFrame_t that will be populated + * + * \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if successfully parsed + */ +ADI_API adi_common_ErrAction_e adi_common_ErrFrameGet( const adi_common_Device_t* const commonDev, + const adi_common_ErrFrameId_e frameId, + adi_common_ErrFrame_t* const errFrame); + +/* + * \brief Service to Parse a Common Error from a Lookup Table + * + * \param[in] errCode Error Code to be Looked Up + * \param[out] errMsgPtr Related Error Message + * \param[out] action Related Recovery Action + * + * \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if successfully parsed + */ +ADI_API adi_common_ErrAction_e adi_common_ErrorGet( const int64_t errCode, + const char** const errMsgPtr, + adi_common_ErrAction_e* const action); + +/* + * \brief Service to Get Error Information for a given Common Error Source + * + * \param[in] commonDev pointer to adi_common_Device_t + * \param[in] errSrc Error Source to be Looked Up + * \param[in] errCode Error Code to be Looked Up + * \param[out] errMsgPtr Related Error Message + * \param[out] action Related Recovery Action + * + * \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if successfully parsed + */ +ADI_API adi_common_ErrAction_e adi_common_ErrInfoGet( const adi_common_ErrSources_e errSrc, + const int64_t errCode, + const char** const errMsgPtr, + adi_common_ErrAction_e* const errAction); + +/** + * \brief Destroy an Error Structure in Memory + * + * \param[in] errDataPtr Pointer to adi_common_ErrData_t + * + * \retval ADI_COMMON_ERR_ACT_NONE if Memory is successfully deallocated + */ +ADI_API adi_common_ErrAction_e adi_common_ErrDestroy(adi_common_ErrData_t* errDataPtr); + +/** + * \brief Clear Error Structure + * + * \param[in] errDataPtr Pointer to adi_common_ErrData_t + * + * \retval ADI_COMMON_ERR_ACT_NONE if Error Data is marked clear + */ +ADI_API adi_common_ErrAction_e adi_common_ErrClear(adi_common_ErrData_t* const errDataPtr); + +#endif /* _ADI_COMMON_ERROR_H_ */ diff --git a/drivers/iio/adc/adrv903x/common/adi_error/adi_common_error_types.h b/drivers/iio/adc/adrv903x/common/adi_error/adi_common_error_types.h new file mode 100644 index 0000000000000..ea125323d4849 --- /dev/null +++ b/drivers/iio/adc/adrv903x/common/adi_error/adi_common_error_types.h @@ -0,0 +1,231 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_common_error_types.h +* \brief Contains common error data types for API Error messaging +* +* ADI common lib Version: 0.0.2.1 +*/ + +#ifndef _ADI_COMMON_ERROR_TYPES_H_ +#define _ADI_COMMON_ERROR_TYPES_H_ + +#include "adi_library.h" + +/* adi_common_ErrFrameId_e Defines Stack Trace Size because of how error frames can be accessed */ +#define ADI_COMMON_STACK_TRACE_SIZE ADI_COMMON_ERRFRAME_MAX + +/** +* \brief ADI Common Source Indexing +*/ +#define ADI_COMMON_ERRSRC_NONE_IDX 0U +#define ADI_COMMON_ERRSRC_API_IDX 1U +#define ADI_COMMON_ERRSRC_HAL_IDX 2U +#define ADI_COMMON_ERRSRC_DEVICEHAL_IDX 3U +#define ADI_COMMON_ERRSRC_DEVICEBF_IDX 4U +#define ADI_COMMON_ERRSRC_APP_IDX 5U + +#define ADI_COMMON_ERRSRC_RESERVED_IDX 99U + +/** +* \brief ADI Common Error Codes +*/ +#define ADI_COMMON_ERRCODE_NONE 0UL /* No Error */ +#define ADI_COMMON_ERRCODE_INVALID_PARAM 1UL /* Invalid Parameter */ +#define ADI_COMMON_ERRCODE_NULL_PTR 2UL /* Null Pointer */ +#define ADI_COMMON_ERRCODE_ARRAY_SIZE 4UL /* Array Size not correct */ +#define ADI_COMMON_ERRCODE_LOCK 5UL /* Lock Error */ +#define ADI_COMMON_ERRCODE_API 6UL /* API Call Error */ +#define ADI_COMMON_ERRCODE_FEATURE_NOT_IMPLEMENTED 7UL /* ADI Feature not implemented */ +#define ADI_COMMON_ERRCODE_TIMEOUT 8UL /* Timeout */ +#define ADI_COMMON_ERRCODE_BOOT_TIMEOUT 9UL /* Boot Timeout */ + +/** +* \brief ADI Common Sources +*/ +typedef enum adi_common_ErrSources +{ + ADI_COMMON_ERRSRC_NONE = ADI_COMMON_ERRSRC_NONE_IDX, /* No Error/Source */ + ADI_COMMON_ERRSRC_API = ADI_COMMON_ERRSRC_API_IDX, /* API Error */ + ADI_COMMON_ERRSRC_HAL = ADI_COMMON_ERRSRC_HAL_IDX, /* HAL Error */ + ADI_COMMON_ERRSRC_DEVICEHAL = ADI_COMMON_ERRSRC_DEVICEHAL_IDX, /* Device HAL Error */ + ADI_COMMON_ERRSRC_DEVICEBF = ADI_COMMON_ERRSRC_DEVICEBF_IDX, /* Device BF Error */ + ADI_COMMON_ERRSRC_APP = ADI_COMMON_ERRSRC_APP_IDX /* Application Error */ +} adi_common_ErrSources_e; + +/* +* \brief ADI Common Error Frame Indexing +*/ +typedef enum +{ + ADI_COMMON_ERRFRAME_IDX_0 = 0U, /* Error Frame Index 0 */ + ADI_COMMON_ERRFRAME_IDX_1 = 1U, /* Error Frame Index 1 */ + ADI_COMMON_ERRFRAME_IDX_2 = 2U, /* Error Frame Index 2 */ + ADI_COMMON_ERRFRAME_IDX_3 = 3U, /* Error Frame Index 3 */ + ADI_COMMON_ERRFRAME_IDX_4 = 4U, /* Error Frame Index 4 */ + ADI_COMMON_ERRFRAME_IDX_5 = 5U, /* Error Frame Index 5 */ + ADI_COMMON_ERRFRAME_IDX_6 = 6U, /* Error Frame Index 6 */ + ADI_COMMON_ERRFRAME_IDX_7 = 7U, /* Error Frame Index 7 */ + ADI_COMMON_ERRFRAME_IDX_8 = 8U, /* Error Frame Index 8 */ + ADI_COMMON_ERRFRAME_IDX_9 = 9U, /* Error Frame Index 9 */ + ADI_COMMON_ERRFRAME_EVENT = ADI_COMMON_ERRFRAME_IDX_0, /* Start of Array; Fixed */ + ADI_COMMON_ERRFRAME_END = ADI_COMMON_ERRFRAME_IDX_9, /* End of Array; Fixed */ + ADI_COMMON_ERRFRAME_MAX, /* Stack Trace Size */ + ADI_COMMON_ERRFRAME_API = ADI_COMMON_ERRFRAME_MAX /* Last Entry to Stack Trace; Variable */ +} adi_common_ErrFrameId_e; + +/* +* \brief ADI COMMON Recovery Actions +*/ +typedef enum +{ + ADI_COMMON_ERR_ACT_RESET_DEVICE = -500, /* Device NOK: HW/SW Reset Required */ + + /* All Reset Feature Unique Codes exist between -500 & -400 */ + ADI_COMMON_ERR_ACT_RESET_FEATURE = -400, /* API NOK: Feature Reset Required */ + + /* All Reset Interface Unique Codes exist between -400 & -300 */ + ADI_COMMON_ERR_ACT_RESET_INTERFACE = -300, /* API NOK: Interface Reset Required */ + + /* All Check Feature Unique Codes exist between -300 & -200 */ + ADI_COMMON_ERR_ACT_CHECK_FEATURE = -200, /* API OK; Feature is reporting an Error */ + + /* All Check Interface Unique Codes exist between -200 & -100 */ + ADI_COMMON_ERR_ACT_CHECK_INTERFACE = -100, /* API OK; Interface is reporting an Error */ + + /* All Development Unique Codes exist between -100 & -1 */ + ADI_COMMON_ERR_ACT_OPEN_DEVICE = -10, /* API OK; Device Not Open */ + ADI_COMMON_ERR_ACT_CHECK_PARAM = -1, /* API OK; Invalid Parameter passed to function */ + + /* No Error/Recovery Action */ + ADI_COMMON_ERR_ACT_NONE = 0 /* API OK; No Action Required */ +} adi_common_ErrAction_e; + +/* +* \brief ADI Common Error Action Union +*/ +typedef union +{ + adi_common_ErrAction_e commonAction; /* Common Error Action Type */ + int64_t rawValue; /* Raw Value */ +} adi_common_ErrAction_t; + +/* +* \brief ADI Error Event Information +*/ +typedef struct +{ + int64_t errCode; /* Error Code */ + const char* errMsg; /* Error Message */ + uint32_t errSrc; /* Error Source */ +} adi_common_ErrCodeInfo_t; + +/* +* \brief ADI Error File Information +*/ +typedef struct +{ + uint32_t line; /* Source File Line Number; Set via __LINE__ Std Macro */ + const char* function; /* Source File Function Name; Set via __func__ Std Macro */ + uint32_t file; /* Source File Name ID; Set via ADI_FILE */ +} adi_common_ErrFileInfo_t; + +/* +* \brief ADI Error Variable Information +*/ +typedef struct +{ + const char* varName; /* Variable Name */ + int64_t varData; /* Variable Data */ +} adi_common_ErrVarInfo_t; + +/* +* \brief ADI Common Error Frame Structure +*/ +typedef struct +{ + adi_common_ErrAction_e action; /* Recovery Action */ + adi_common_ErrCodeInfo_t errInfo; /* Error Event Information */ + adi_common_ErrFileInfo_t fileInfo; /* File Information */ + adi_common_ErrVarInfo_t varInfo; /* Variable Information */ +} adi_common_ErrFrame_t; + +/* +* \brief ADI Common Debug Information +*/ +typedef struct +{ + adi_common_ErrAction_e highestPriorityAction; /* Highest Priority Recovery Action Captured */ + const char* errCause; /* Error Cause Message */ + const char* actionMsg; /* Recovery Action Message */ +} adi_common_ErrDebugInfo_t; + +/* +* \brief ADI Common Error Device Information +*/ +typedef struct +{ + uint32_t type; /* Device Type */ + uint32_t id; /* Device Number */ + const char* name; /* Device Name */ +} adi_common_ErrDeviceInfo_t; + +/* +* \brief ADI Common Error Data Information +*/ +typedef struct +{ + adi_common_ErrDeviceInfo_t errDeviceInfo; /* Error Device Info */ + uint32_t stackIdx; /* Internal Array Indexing */ +} adi_common_ErrDataInfo_t; + +/* +* \brief ADI Common Error Data Structure +*/ +typedef struct +{ + adi_common_ErrDataInfo_t errDataInfo; /* Additional Error Data Information */ + adi_common_ErrFrame_t stackTrace[ADI_COMMON_STACK_TRACE_SIZE]; /* Stack Trace from API from when Error Detected */ + adi_common_ErrDebugInfo_t errDebugInfo; /* Additional Debug Information */ +} adi_common_ErrData_t; + +/* +* \brief ADI Common Error Table Row +*/ +typedef struct +{ + const int64_t errCode; + const char* const errMsg; + const adi_common_ErrAction_e action; +} adi_common_ErrTableRow_t; + +/* +* \brief ADI Common Device Specific Error Table Row +*/ +typedef struct +{ + const int64_t errCode; + const char* const errMsg; + const char* const errCause; + const adi_common_ErrAction_e actionCode; + const char* const actionMsg; +} adi_common_DeviceErrTableRow_t; + +/* +* \brief ADI Common Error Information +*/ +typedef struct +{ + int64_t errCode; + const char* errMsg; + const char* errCause; + adi_common_ErrAction_e actionCode; + const char* actionMsg; +} adi_common_ErrorInfo_t; + +typedef adi_common_ErrTableRow_t adi_common_api_errors_t; +#endif /* _ADI_COMMON_ERROR_TYPES_H_ */ + diff --git a/drivers/iio/adc/adrv903x/common/adi_hal/adi_common_hal.c b/drivers/iio/adc/adrv903x/common/adi_hal/adi_common_hal.c new file mode 100644 index 0000000000000..ee6609bfe3ba4 --- /dev/null +++ b/drivers/iio/adc/adrv903x/common/adi_hal/adi_common_hal.c @@ -0,0 +1,578 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_common_hal.c +* \brief Contains ADI Transceiver Hardware Abstraction functions +* Analog Devices maintains and provides updates to this code layer. +* The end user should not modify this file or any code in this directory. +* +* ADI common lib Version: 0.0.2.1 +*/ + +#include "adi_common_hal.h" +#include "adi_common_error.h" +#include "adi_platform.h" + +#define ADI_FILE ADI_COMMON_FILE_HAL + +ADI_API adi_common_ErrAction_e adi_common_hal_ErrCodeConvert(const adi_hal_Err_e halCode) +{ + adi_common_ErrAction_e action = ADI_COMMON_ERR_ACT_RESET_DEVICE; + + switch (halCode) + { + case ADI_HAL_ERR_OK: + action = ADI_COMMON_ERR_ACT_NONE; + break; + + case ADI_HAL_ERR_I2C: + case ADI_HAL_ERR_I2C_WRITE: + case ADI_HAL_ERR_I2C_READ: + case ADI_HAL_ERR_SPI: + case ADI_HAL_ERR_SPI_WRITE: + case ADI_HAL_ERR_SPI_READ: + case ADI_HAL_ERR_GPIO: + /* Fall Through */ + action = ADI_COMMON_ERR_ACT_CHECK_INTERFACE; + break; + + case ADI_HAL_ERR_SPI_CS: + action = ADI_COMMON_ERR_ACT_RESET_INTERFACE; + break; + + case ADI_HAL_ERR_BBICCTRL: + case ADI_HAL_ERR_BBICCTRL_CORE: + case ADI_HAL_ERR_BBICCTRL_RAM: + case ADI_HAL_ERR_BBICCTRL_SPI: + action = ADI_COMMON_ERR_ACT_RESET_FEATURE; + break; + + case ADI_HAL_ERR_PARAM: + case ADI_HAL_ERR_NULL_PTR: + /* Fall Through */ + action = ADI_COMMON_ERR_ACT_CHECK_PARAM; + break; + + case ADI_HAL_ERR_TIMER: + case ADI_HAL_ERR_NOT_IMPLEMENTED: + case ADI_HAL_ERR_LOG: + case ADI_HAL_ERR_MEMORY: + case ADI_HAL_ERR_LIBRARY: + case ADI_HAL_ERR_EEPROM_DATA: + /* Fall Through */ + + default: + /* Operating System Error Code */ + action = ADI_COMMON_ERR_ACT_CHECK_FEATURE; + break; + } + + return action; +} + +ADI_API adi_common_ErrAction_e adi_adrv903x_hal_HwOpen(adi_common_Device_t* const commonDev) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + adi_hal_Err_e halError = ADI_HAL_ERR_PARAM; + + ADI_NULL_PTR_RETURN(commonDev); + + halError = adrv903x_MutexInit(&commonDev->mutex); + if (ADI_HAL_ERR_OK != halError) + { + recoveryAction = adi_common_hal_ErrCodeConvert(halError); + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_HAL, + ADI_COMMON_ERRCODE_API, + recoveryAction, + halError, + "Device Mutex Cannot Be Initialized"); + return recoveryAction; + } + + halError = adrv903x_HwOpen(commonDev->devHalInfo); + if (ADI_HAL_ERR_OK == halError) + { + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + } + else + { + recoveryAction = adi_common_hal_ErrCodeConvert(halError); + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_HAL, + ADI_COMMON_ERRCODE_API, + recoveryAction, + halError, + "HAL Hardware Open Failed"); + } + + return recoveryAction; +} + +ADI_API adi_common_ErrAction_e adi_adrv903x_hal_HwClose(adi_common_Device_t* const commonDev) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + adi_hal_Err_e halError = ADI_HAL_ERR_PARAM; + + ADI_NULL_COMMON_PTR_RETURN(commonDev); + + halError = adrv903x_HwClose(commonDev->devHalInfo); + if (ADI_HAL_ERR_OK != halError) + { + recoveryAction = adi_common_hal_ErrCodeConvert(halError); + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_HAL, + ADI_COMMON_ERRCODE_API, + recoveryAction, + halError, + "HAL Hardware Close Failed"); + return recoveryAction; + } + + halError = adrv903x_MutexDestroy(&commonDev->mutex); + if (ADI_HAL_ERR_OK == halError) + { + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + } + else + { + recoveryAction = adi_common_hal_ErrCodeConvert(halError); + ADI_PARAM_ERROR_REPORT(commonDev, recoveryAction, &commonDev->publicCnt, "Public Count"); + ADI_PARAM_ERROR_REPORT(commonDev, recoveryAction, &commonDev->lockCnt, "Lock Count"); + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_HAL, + ADI_COMMON_ERRCODE_API, + recoveryAction, + halError, + "Device Mutex Cannot Be Destroyed"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_common_ErrAction_e adi_adrv903x_hal_HwReset(const adi_common_Device_t* const commonDev, const uint8_t pinLevel) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + adi_hal_Err_e halError = ADI_HAL_ERR_PARAM; + + ADI_NULL_COMMON_PTR_RETURN(commonDev); + + halError = adrv903x_HwReset(commonDev->devHalInfo, pinLevel); + + if (ADI_HAL_ERR_OK == halError) + { + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + } + else + { + recoveryAction = adi_common_hal_ErrCodeConvert(halError); + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_HAL, + ADI_COMMON_ERRCODE_API, + recoveryAction, + pinLevel, + "HAL HwReset Level Set Issue"); + } + + return recoveryAction; +} + +ADI_API adi_common_ErrAction_e adi_adrv903x_hal_Wait_us(const adi_common_Device_t* const commonDev, const uint32_t time_us) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + adi_hal_Err_e halError = ADI_HAL_ERR_PARAM; + + ADI_NULL_COMMON_PTR_RETURN(commonDev); + + halError = adrv903x_Wait_us(commonDev->devHalInfo, time_us); + + if (ADI_HAL_ERR_OK == halError) + { + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + } + else + { + recoveryAction = adi_common_hal_ErrCodeConvert(halError); + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_HAL, + ADI_COMMON_ERRCODE_API, + recoveryAction, + halError, + "HAL Wait(us) Failed"); + } + + return recoveryAction; +} + +ADI_API adi_common_ErrAction_e adi_adrv903x_hal_Wait_ms(const adi_common_Device_t* const commonDev, const uint32_t time_ms) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + adi_hal_Err_e halError = ADI_HAL_ERR_PARAM; + + ADI_NULL_COMMON_PTR_RETURN(commonDev); + + halError = adrv903x_Wait_us(commonDev->devHalInfo, (time_ms * 1000)); + + if (ADI_HAL_ERR_OK == halError) + { + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + } + else + { + recoveryAction = adi_common_hal_ErrCodeConvert(halError); + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_HAL, + ADI_COMMON_ERRCODE_API, + recoveryAction, + halError, + "HAL Wait(ms) Failed"); + } + + return recoveryAction; +} + +ADI_API adi_common_ErrAction_e adi_common_hal_Lock(adi_common_Device_t* const commonDev) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + adi_hal_Err_e halError = ADI_HAL_ERR_PARAM; + + /* Use NULL_DEVICE as NULL_COMMON_PTR also checks common->errPtr which is not set yet */ + ADI_NULL_DEVICE_PTR_RETURN(commonDev); + + halError = adrv903x_MutexLock(&commonDev->mutex); + if (ADI_HAL_ERR_OK == halError) + { + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + } + else + { + recoveryAction = adi_common_hal_ErrCodeConvert(halError); + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_HAL, + ADI_COMMON_ERRCODE_LOCK, + recoveryAction, + halError, + "HAL Mutex Lock Failed"); + } + + ++commonDev->lockCnt; + if (commonDev->lockCnt == 0U) + { + recoveryAction = ADI_COMMON_ERR_ACT_RESET_DEVICE; + /* Range of lockCnt type exceeded. Do not check unlock return */ + (void) adrv903x_MutexUnlock(&commonDev->mutex); + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_HAL, + ADI_COMMON_ERRCODE_LOCK, + recoveryAction, + ADI_NO_VARIABLE, + "Lock Count Overflow"); + } + + return recoveryAction; +} + +ADI_API adi_common_ErrAction_e adi_common_hal_Unlock(adi_common_Device_t* const commonDev) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + adi_hal_Err_e halError = ADI_HAL_ERR_PARAM; + + ADI_NULL_COMMON_PTR_RETURN(commonDev); + + if (commonDev->lockCnt == 0U) + { + recoveryAction = ADI_COMMON_ERR_ACT_RESET_DEVICE; + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_API, + ADI_COMMON_ERRCODE_LOCK, + recoveryAction, + commonDev->lockCnt, + "Lock Never Used"); + return recoveryAction; + } + --commonDev->lockCnt; + + halError = adrv903x_MutexUnlock(&commonDev->mutex); + if (ADI_HAL_ERR_OK == halError) + { + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + } + else + { + ++commonDev->lockCnt; + recoveryAction = adi_common_hal_ErrCodeConvert(halError); + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_API, + ADI_COMMON_ERRCODE_LOCK, + recoveryAction, + halError, + "Unlock Failed"); + } + + return recoveryAction; +} + +ADI_API adi_common_ErrAction_e adi_common_hal_ApiEnter_vLogCtl(adi_common_Device_t* const commonDev, + const char* const fnName, + const uint32_t doLocking, + const adi_common_LogCtl_e logCtl) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + + /* Device Not Locked & Error Pointer is Not Set in Common Device Structure */ + + ADI_NULL_DEVICE_PTR_RETURN(commonDev); + + ADI_NULL_PTR_REPORT_RETURN(commonDev, fnName); + + switch (doLocking) + { + case ADI_TRUE: + /* Initialized Device Mutex Required for Locking */ + if (ADI_FALSE == ADI_COMMON_DEVICE_STATE_IS_OPEN(*commonDev)) + { + recoveryAction = ADI_COMMON_ERR_ACT_OPEN_DEVICE; + + if ( NULL != adrv903x_TlsGet(HAL_TLS_ERR)) + { + /* Bypass Common Device Structure for Error Reporting if TLS has Error Pointer */ + adi_common_Device_t dummyDev; + + ADI_LIBRARY_MEMSET(&dummyDev, 0, sizeof(adi_common_Device_t)); + + dummyDev.errPtr = (adi_common_ErrData_t*) adrv903x_TlsGet(HAL_TLS_ERR); + + ADI_ERROR_REPORT( &dummyDev, + ADI_COMMON_ERRSRC_API, + ADI_COMMON_ERRCODE_INVALID_PARAM, + recoveryAction, + ADI_COMMON_DEVICE_STATE_IS_OPEN(*commonDev), + "Device Requires HwOpen"); + } + + return recoveryAction; + } + + /* Lock Device */ + recoveryAction = adi_common_hal_Lock(commonDev); + break; + + case ADI_FALSE: + /* Fall Through */ + + default: + /* No Locking Required */ + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + break; + } + + if (ADI_COMMON_ERR_ACT_NONE != recoveryAction) + { + /* Device Locking Failed */ + if (NULL != adrv903x_TlsGet(HAL_TLS_ERR)) + { + /* Bypass Common Device Structure for Error Reporting if TLS has Error Pointer */ + adi_common_Device_t dummyDev; + + ADI_LIBRARY_MEMSET(&dummyDev, 0, sizeof(adi_common_Device_t)); + + dummyDev.errPtr = (adi_common_ErrData_t*) adrv903x_TlsGet(HAL_TLS_ERR); + + ADI_ERROR_REPORT( &dummyDev, + ADI_COMMON_ERRSRC_API, + ADI_COMMON_ERRCODE_LOCK, + recoveryAction, + commonDev->lockCnt, /* Snapshot of Locking History */ + "Device Locking Issue"); + } + + return recoveryAction; + } + + /* Device is now locked or else locking was not requested. */ + ++commonDev->publicCnt; + + /* Log API entry */ + if (commonDev->publicCnt > 1U && logCtl == ADI_COMMON_DEVICE_LOGCTL_QUIET) + { + /* Recursive public function entry detected; Change from Public to Private Logging Level */ + if (ADI_FALSE == ADI_COMMON_DEVICE_STATE_IS_TC(*commonDev)) + { + /* Time Critical Mode Off - All adi_adrv903x_LogWrite(), bar error logging, are gated by this check to avoid unnecessary adrv903x_LogWrite() calls */ + adi_adrv903x_LogWrite(commonDev, ADI_HAL_LOG_API_PRIV, "-> %s()", fnName); + } + } + else + { + /* Normal case - just log the entry at Public API level */ + if (ADI_FALSE == ADI_COMMON_DEVICE_STATE_IS_TC(*commonDev)) + { + /* Time Critical Mode Off - All adi_adrv903x_LogWrite(), bar error logging, are gated by this check to avoid unnecessary adrv903x_LogWrite() calls */ + adi_adrv903x_LogWrite(commonDev, ADI_HAL_LOG_API, "-> %s()", fnName); + } + } + + if (NULL != adrv903x_TlsGet(HAL_TLS_ERR)) + { + /* Assume using TLS for Error Reporting */ + commonDev->errPtr = (adi_common_ErrData_t*) adrv903x_TlsGet(HAL_TLS_ERR); + } + else + { + /* Do Nothing; Assuming Application is Managing Device Error Structure(s) Directly. + * If Multi Threaded, Application is required to provide its own Mutual Exclusion Mechanism for the Error Structure. + */ + } + + /* Assume Error Structure Pointer Assigned to Current Device at this Point (i.e. using TLS or Externally Managed) */ + + if (commonDev->publicCnt == 1U) + { + /* Clear Error Memory on First Entry into Public API Only + * - This is to allow further error reporting from subsequent Public API calls during an Error State + */ + (void) ADI_CLEAR_ERROR_MEMORY(commonDev->errPtr); + } + + /* Assume Error Memory has been cleared at this point */ + + return recoveryAction; +} + +ADI_API adi_common_ErrAction_e adi_common_hal_ApiExit_vLogCtl(adi_common_Device_t* const commonDev, + const char* const fnName, + const uint32_t doLocking, + const adi_common_LogCtl_e logCtl) + +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + + ADI_NULL_COMMON_PTR_RETURN(commonDev); + + ADI_NULL_PTR_REPORT_RETURN(commonDev, fnName); + + /* Log API exit */ + if (commonDev->publicCnt > 1U && logCtl == ADI_COMMON_DEVICE_LOGCTL_QUIET) + { + /* Recursive public function exit detected; Change from Public to Private Logging Level */ + if (ADI_FALSE == ADI_COMMON_DEVICE_STATE_IS_TC(*commonDev)) + { + /* Time Critical Mode Off - All adi_adrv903x_LogWrite(), bar error logging, are gated by this check to avoid unnecessary adrv903x_LogWrite() calls */ + adi_adrv903x_LogWrite(commonDev, ADI_HAL_LOG_API_PRIV, "<- %s()", fnName); + } + } + else + { + /* Normal case - just log the exit at Public API level */ + if (ADI_FALSE == ADI_COMMON_DEVICE_STATE_IS_TC(*commonDev)) + { + /* Time Critical Mode Off - All adi_adrv903x_LogWrite(), bar error logging, are gated by this check to avoid unnecessary adrv903x_LogWrite() calls */ + adi_adrv903x_LogWrite(commonDev, ADI_HAL_LOG_API, "<- %s()", fnName); + } + } + + if (commonDev->publicCnt == 0U) + { + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_API, + ADI_COMMON_ERRCODE_LOCK, + recoveryAction, + commonDev->publicCnt, + "Check API Device Locking Mechanism"); + return recoveryAction; + } + + --commonDev->publicCnt; + + switch (doLocking) + { + case ADI_TRUE: + /* Unlock Device */ + recoveryAction = adi_common_hal_Unlock(commonDev); + if (ADI_COMMON_ERR_ACT_NONE != recoveryAction) + { + /* Device Locked Up */ + recoveryAction = ADI_COMMON_ERR_ACT_RESET_DEVICE; + } + break; + + case ADI_FALSE: + /* Fall Through */ + + default: + /* No Unlocking Required */ + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + break; + } + + if (ADI_COMMON_ERR_ACT_NONE != recoveryAction) + { + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_API, + ADI_COMMON_ERRCODE_LOCK, + recoveryAction, + ADI_NO_VARIABLE, + "Device Unlocking Issue"); + return recoveryAction; + } + + /* Assume Device Unlocked at this Point */ + + return recoveryAction; +} + + +ADI_API adi_common_ErrAction_e adi_common_hal_ApiEnter( adi_common_Device_t* const commonDev, + const char* const fnName, + const uint32_t doLocking) +{ + return adi_common_hal_ApiEnter_vLogCtl(commonDev, fnName, doLocking, ADI_COMMON_DEVICE_LOGCTL_NORMAL); +} + +ADI_API adi_common_ErrAction_e adi_common_hal_ApiExit( adi_common_Device_t* const commonDev, + const char* const fnName, + const uint32_t doLocking) +{ + return adi_common_hal_ApiExit_vLogCtl(commonDev, fnName, doLocking, ADI_COMMON_DEVICE_LOGCTL_NORMAL); +} + +ADI_API adi_common_ErrAction_e adi_common_hal_PlatformFunctionCheck(adi_common_Device_t* const commonDev) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_NONE; + + ADI_NULL_COMMON_PTR_RETURN(commonDev); + + if ((adrv903x_HwOpen == NULL) || + (adrv903x_HwClose == NULL) || + (adrv903x_HwReset == NULL) || + (adrv903x_SpiWrite == NULL) || + (adrv903x_SpiRead == NULL) || + (adrv903x_LogFileOpen == NULL) || + (adrv903x_LogLevelSet == NULL) || + (adrv903x_LogLevelGet == NULL) || + (adrv903x_LogWrite == NULL) || + (adrv903x_Wait_us == NULL) || + (adrv903x_Wait_ms == NULL) || + (adrv903x_MutexInit == NULL) || + (adrv903x_MutexLock == NULL) || + (adrv903x_MutexUnlock == NULL) || + (adrv903x_MutexDestroy == NULL) || + (adrv903x_TlsSet == NULL) || + (adrv903x_TlsGet == NULL)) + { + recoveryAction = adi_common_hal_ErrCodeConvert(ADI_HAL_ERR_NOT_IMPLEMENTED); + ADI_ERROR_REPORT( commonDev, + ADI_COMMON_ERRSRC_HAL, + ADI_HAL_ERR_NOT_IMPLEMENTED, + recoveryAction, + ADI_NO_VARIABLE, + "All HAL Function Pointers Not Configured"); + return recoveryAction; + } + + return recoveryAction; +} diff --git a/drivers/iio/adc/adrv903x/common/adi_hal/adi_common_hal.h b/drivers/iio/adc/adrv903x/common/adi_hal/adi_common_hal.h new file mode 100644 index 0000000000000..14b4472463f7e --- /dev/null +++ b/drivers/iio/adc/adrv903x/common/adi_hal/adi_common_hal.h @@ -0,0 +1,329 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_common_hal.h + * \brief Contains ADI Hardware Abstraction layer function prototypes and type definitions for adi_common_hal.c + * + * ADI common lib Version: 0.0.2.1 + */ + +#ifndef _ADI_COMMON_HAL_H_ +#define _ADI_COMMON_HAL_H_ + +#include "adi_common_types.h" +#include "adi_common_macros.h" +#include "adi_common_user.h" +#include "adi_common_error.h" +#include "adi_common_log.h" + +/** + * /brief Convenience macro for public API functions to call adi_common_hal_ApiEnter + */ +#define ADI_API_ENTER_RTN(commonDev) \ +{ \ + adi_common_ErrAction_e _recoveryAction = adi_common_hal_ApiEnter((commonDev), __func__, ADI_TRUE); \ + \ + if(ADI_COMMON_ERR_ACT_NONE != _recoveryAction) \ + { \ + ADI_API_ERROR_REPORT(&device->common, _recoveryAction, "API Enter Issue"); \ + return _recoveryAction; \ + } \ +} + +/** + * /brief Convenience macro for public API functions to call adi_common_hal_ApiEnter + * and return. Always causes a return from the calling function. + * + * If the supplied recovery action indicates an error then any failure in ApiExit is ignored. + * The recovery action from ApiExit is only used as the function's recovery action if the + * supplied recovery action indicates no error. + * + * \param commonDev Pointer to the common structure of type adi_common_Device_t + * + * \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful + */ +#define ADI_API_EXIT(commonDev, recoveryAction) \ +{ \ + adi_common_ErrAction_e _recoveryAction = adi_common_hal_ApiExit((commonDev), __func__, ADI_TRUE); \ + \ + if (ADI_COMMON_ERR_ACT_NONE != _recoveryAction) \ + { \ + ADI_API_ERROR_REPORT(&device->common, _recoveryAction, "API Exit Issue"); \ + } \ + \ + if(ADI_COMMON_ERR_ACT_NONE != recoveryAction) \ + { \ + return recoveryAction; \ + } \ + return _recoveryAction; \ +} + + +/** +* \brief Service to Convert HAL Error Code to Recovery Action +* +* \param[in] halCode Hal Error Code to be converted +* +* \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful +*/ +ADI_API adi_common_ErrAction_e adi_common_hal_ErrCodeConvert(const adi_hal_Err_e halCode); + +/** + * \brief Used to initialise the HAL hardware. + * + * This function must be called before any of the other adi_common_ functions are + * called for the same \param commonDevice. This function must be called only + * once for each value of \param commonDevice. + * + * Applications do not need to call this function directly as it is called by a + * device-specific HwOpen call. + * + * Each ADI device contains a adi_common_Device_t. The device_specific HwOpen + * function must be the first function to be called for any device. One of the + * tasks carried out by the device-specific HwOpen is to call this function + * to prepare the common-device layer part of the device. + * + * Unlike the other common device functions HwOpen and HwClose are not thread-safe. + * This is because it is during these functions that the thread-safety mechanisms + * relied on by the other functions are initialized and finalized. Therefore + * the mechanisms are not available for use within HwOpen/Close to enforce + * serialization. As device-specific HwOpen/Close functions use the common + * HwOpen/Close the same restriction applies to the device-specific HwOpen/Close + * functions. Applications therefore are responsible to ensure that there is no + * contention between threads for device access when HwOpen/Close is called. For + * instance an application could carry out all HwOpens in a single thread and + * ensure all worker threads have stopped (or at least stopped using the API) + * before calling HwClose on all devices from a single thread. + * + * \dep_begin + * \dep{device->common} + * \dep_end + * + * \param[in] commonDev Pointer to the common structure of type adi_common_Device_t + * + * \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful + */ +ADI_API adi_common_ErrAction_e adi_adrv903x_hal_HwOpen(adi_common_Device_t* const commonDev); + +/** +* \brief Used to close the HAL hardware. +* +* Must be called when the \param commonDev is no longer required so that any resources in +* the common device layer can be released. Must only be called on a common device +* that has been previously opened. Once closed no other functions may be called +* on a common device and it cannot be re-opened. +* +* Each ADI device contains a adi_common_Device_t. The device_specific HwClose +* function must be the last function to be called for any device. One of the +* tasks carried out by the device-specific HwClose is to call this function +* to release the common-device layer part of the device. +* +* Applications do not need to call this function directly as it is called by a +* device-specific HwClose call. +* +* Applications must ensure that all threads have finished with the device before calling +* the device-specific HwClose. See HwOpen for further thread-safety considerations. +* +* +* \pre The device must have been previously opened using adi_adrv903x_hal_HwOpen. +* +* \dep_begin +* \dep{device->common} +* \dep_end +* +* \param[in] commonDev Pointer to the common structure of type adi_common_Device_t +* +* \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful +*/ +ADI_API adi_common_ErrAction_e adi_adrv903x_hal_HwClose(adi_common_Device_t* const commonDev); + +/** +* \brief Service to control HwReset Signal via a Logic Level +* +* Caller is responsible for handling triggering (i.e. Level or Edge) +* +* \pre The device must have been previously opened using adi_adrv903x_hal_HwOpen. +* +* \dep_begin +* \dep{device->common} +* \dep_end +* +* \param[in] commonDev Pointer to the common structure of type adi_common_Device_t +* \param[in] pinLevel Pin level = 1 will hold the reset line high, 0 will hold the reset line low +* +* \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful +*/ +ADI_API adi_common_ErrAction_e adi_adrv903x_hal_HwReset( const adi_common_Device_t* const commonDev, + const uint8_t pinLevel); + +/** +* \brief Used to sleep for a given number of microSeconds. +* +* \dep_begin +* \dep{device->common} +* \dep_end +* +* \param[in] commonDev Pointer to the common structure of type adi_common_Device_t +* \param[in] time_us The number of micro seconds to sleep +* +* \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful +*/ +ADI_API adi_common_ErrAction_e adi_adrv903x_hal_Wait_us( const adi_common_Device_t* const commonDev, + const uint32_t time_us); + +/** +* \brief Used to sleep for a given number of milliSeconds. +* +* +* \dep_begin +* \dep{device->common} +* \dep_end +* +* \param commonDev Pointer to the common structure of type adi_common_Device_t +* \param time_ms The number of milli seconds to sleep. +* +* \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful +*/ +ADI_API adi_common_ErrAction_e adi_adrv903x_hal_Wait_ms( const adi_common_Device_t* const commonDev, + const uint32_t time_ms); + +/** +* \brief Acquires the device so that it can only be used only in the context of the calling +* thread until such time as adi_common_hal_Unlock is called on the device. +* +* Blocks until the device is acquired. There is no timeout mechanism in the API although +* the underlying HAL may choose to timeout and return an error. +* +* Attempting to explicitly acquire a device that has already been acquired by the calling thread +* results in undefined behaviour. +* +* +* \dep_begin +* \dep{device->common} +* \dep_end +* +* \param commonDev Pointer to the common structure of type adi_common_Device_t +* +* \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful +*/ +ADI_API adi_common_ErrAction_e adi_common_hal_Lock(adi_common_Device_t* const commonDev); + +/** +* \brief Releases a device previously acquired by the calling thread. +* +* Only the thread that acquired the device can release the device. Attempting to release a device +* that has not been acquired by the calling thread results in undefined behaviour. +* +* Similar to public API calls on ADI devices the return value is a +* Recovery Action and is also written to commonDev->error.newAction. +* +* \dep_begin +* \dep{device->common} +* \dep_end +* +* \param commonDev Pointer to the common structure of type adi_common_Device_t +* +* \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful +*/ +ADI_API adi_common_ErrAction_e adi_common_hal_Unlock(adi_common_Device_t* const commonDev); + +/** + * /brief A convenience function that performs the tasks that must be preformed at the start + * of every public API function call. + * + * - Log the API call + * - Lock the device + * - Assign the TLS err struct to the device for the duration of the call + * - Reset the err struct + * - Check device has been opened + * + * Should only be called from a device's public API functions. + * + * \param commonDev Pointer to the common structure of type adi_common_Device_t + * \param fnName The name of the calling function + * \param doLocking If set to ADI_TRUE acquire the device lock otherwise do not. + * + * /post On successful completion the device is locked, the calling thread's error struct has been + * assigned as the device's error struct and the struct has been set to indicate no error. + * Otherwise the correct error structure has been assigned and has been set to indicate the error + * that occurred. + * The device is only locked on a successful return. + * + * \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful + */ +ADI_API adi_common_ErrAction_e adi_common_hal_ApiEnter( adi_common_Device_t* const commonDev, + const char* const fnName, + const uint32_t doLocking); + + +/** + * /brief A convenience function that performs the tasks that must be performed before returning + * from every public API function call. + * + * - Log the API return + * - Unlock the device + * + * Should only be called from a device's public API functions. + * + * \param commonDev Pointer to the common structure of type adi_common_Device_t + * \param fnName The name of the calling function + * \param doLocking If set to ADI_TRUE release the device lock otherwise do not. + * + * /post On successful completion the device is unlocked. Otherwise the device's error structure has been + * set to indicate the error that occurred. + * + * \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful + */ +ADI_API adi_common_ErrAction_e adi_common_hal_ApiExit( adi_common_Device_t* const commonDev, + const char* const fnName, + const uint32_t doLocking); + +/** + * /brief Allows greater control over the logging of entry to the API than adi_common_hal_ApiEnter. + * + * Refer to the documentation for the otherwise identical adi_common_hal_ApiEnter. + * + * \param commonDev Pointer to the common structure of type adi_common_Device_t + * \param fnName The name of the calling function + * \param doLocking If set to ADI_TRUE acquire the device lock otherwise do not. + * \param logCtl If set to QUIET the logging of the entry is de-prioritized. + * + * \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful + */ +ADI_API adi_common_ErrAction_e adi_common_hal_ApiEnter_vLogCtl(adi_common_Device_t* const commonDev, + const char* const fnName, + const uint32_t doLocking, + const adi_common_LogCtl_e logCtl); + +/** + * /brief Allows greater control over the logging of exit from the API than adi_common_hal_ApiExit. + * + * Refer to the documentation for the otherwise identical adi_common_hal_ApiExit. + * + * \param commonDev Pointer to the common structure of type adi_common_Device_t + * \param fnName The name of the calling function + * \param doLocking If set to ADI_TRUE acquire the device lock otherwise do not. + * \param logCtl If set to QUIET the logging of the entry is de-prioritized. + * + * \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful + */ +ADI_API adi_common_ErrAction_e adi_common_hal_ApiExit_vLogCtl(adi_common_Device_t* const commonDev, + const char* const fnName, + const uint32_t doLocking, + const adi_common_LogCtl_e logCtl); + +/** +* /brief A convenience function that performs HAL Function Pointer Checks +* +* Should only be called from a device's public API functions. +* +* \param commonDev Pointer to the common structure of type adi_common_Device_t +* +* \retval adi_common_ErrAction_e - ADI_COMMON_ERR_ACT_NONE if Successful +*/ +ADI_API adi_common_ErrAction_e adi_common_hal_PlatformFunctionCheck(adi_common_Device_t* const commonDev); + +#endif diff --git a/drivers/iio/adc/adrv903x/common/adi_logging/adi_common_log.c b/drivers/iio/adc/adrv903x/common/adi_logging/adi_common_log.c new file mode 100644 index 0000000000000..631de7c05f9e1 --- /dev/null +++ b/drivers/iio/adc/adrv903x/common/adi_logging/adi_common_log.c @@ -0,0 +1,184 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_common_log.c +* \brief Contains ADI Transceiver Logging functions +* Analog Devices maintains and provides updates to this code layer. +* The end user should not modify this file or any code in this directory. +* +* ADI common lib Version: 0.0.2.1 +*/ + +/* Intermediate platform HAL layer maintained by Analog Devices */ +#include "adi_common_log.h" +#include "adi_common_hal.h" +#include "adi_platform.h" +#include "adi_common_error_types.h" +#include "adi_common_types.h" + +#define ADI_FILE ADI_COMMON_FILE_LOGGING + +ADI_API void adi_adrv903x_LogWrite( const adi_common_Device_t* const commonDev, + const adi_hal_LogLevel_e logLevel, + const char* comment, + ...) +{ + va_list argp; + uint8_t indent = 0U; + + if ((NULL != commonDev) && + (NULL != commonDev->devHalInfo)) + { + if (commonDev->publicCnt > 1U) + { + indent = ADI_LOG_INDENT; + } + + ADI_LIBRARY_VA_START(argp, comment); + /* ADI Logging Feature Reports Errors via own HAL Data Structure */ + (void) adrv903x_LogWrite(commonDev->devHalInfo, logLevel, indent, comment, argp); + ADI_LIBRARY_VA_END(argp); + } +} + +ADI_API void adi_adrv903x_LogLevelSet(const adi_common_Device_t* const commonDev, + const uint32_t logMask) +{ + if ((NULL != commonDev) && + (NULL != commonDev->devHalInfo)) + { + /* ADI Logging Feature Reports Errors via own HAL Data Structure */ + (void) adrv903x_LogLevelSet(commonDev->devHalInfo, logMask); + + if (logMask == 0U) + { + ADI_COMMON_DEVICE_STATE_TC_SET(*(adi_common_Device_t*)commonDev); + } + else + { + ADI_COMMON_DEVICE_STATE_TC_CLR(*(adi_common_Device_t*)commonDev); + } + } +} + +ADI_API void adi_adrv903x_LogLevelGet(const adi_common_Device_t* const commonDev, + uint32_t* const logMask) +{ + if ((NULL != commonDev) && + (NULL != commonDev->devHalInfo) && + (NULL != logMask)) + { + /* ADI Logging Feature Reports Errors via own HAL Data Structure */ + (void) adrv903x_LogLevelGet(commonDev->devHalInfo, logMask); + } +} + +ADI_API adi_common_ErrAction_e adi_adrv903x_LogStatusGet( const adi_common_Device_t* const commonDev, + adi_hal_LogStatusGet_t* const logStatus) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + + ADI_NULL_COMMON_PTR_RETURN(commonDev); + + ADI_NULL_PTR_RETURN(commonDev->devHalInfo); + + ADI_NULL_PTR_RETURN(logStatus); + + (void) ADI_LIBRARY_MEMSET(logStatus, 0, sizeof(adi_hal_LogStatusGet_t)); + + if (ADI_HAL_ERR_OK == adi_hal_LogStatusGet(commonDev->devHalInfo, logStatus)) + { + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + } + + return recoveryAction; +} + +ADI_API void adi_adrv903x_LogConsoleSet(const adi_common_Device_t* const commonDev, adi_hal_LogConsole_e logConsoleFlag) +{ + if ((NULL != commonDev) && + (NULL != commonDev->devHalInfo)) + { + /* ADI Logging Feature Reports Errors via own HAL Data Structure */ + (void) adi_hal_LogConsoleSet(commonDev->devHalInfo, logConsoleFlag); + } +} + +ADI_API void adi_adrv903x_LogFileOpen(const adi_common_Device_t* const commonDev, + const char* const fileName) +{ + if ((NULL != commonDev) && + (NULL != commonDev->devHalInfo) && + (NULL != fileName)) + { + /* ADI Logging Feature Reports Errors via own HAL Data Structure */ + (void) adrv903x_LogFileOpen(commonDev->devHalInfo, fileName); + } +} + +ADI_API void adi_adrv903x_LogFileClose(const adi_common_Device_t* const commonDev) +{ + if ((NULL != commonDev) && + (NULL != commonDev->devHalInfo)) + { + /* ADI Logging Feature Reports Errors via own HAL Data Structure */ + (void) adrv903x_LogFileClose(commonDev->devHalInfo); + } +} + +ADI_API adi_common_ErrAction_e adi_adrv903x_ErrLog( const adi_common_Device_t* const commonDev, + const uint32_t errSource, + const adi_common_ErrAction_e action, + const int64_t errCode, + const uint32_t lineNum, + const char* funcName, + const uint32_t fileName, + const char* varName, + const int64_t varData, + const char* errMsg) +{ + adi_common_ErrAction_e recoveryAction = ADI_COMMON_ERR_ACT_CHECK_PARAM; + + adi_common_ErrData_t localSave; + + ADI_NULL_COMMON_PTR_RETURN(commonDev); + + ADI_LIBRARY_MEMSET(&localSave, 0, sizeof(adi_common_ErrData_t)); + + /* All Log Writing Errors will be passed to the Log Data Structure */ + + /* Parse Data for Logging */ + localSave.stackTrace->action = action; + + /* Device Information */ + localSave.errDataInfo.errDeviceInfo.type = commonDev->deviceInfo.type; + localSave.errDataInfo.errDeviceInfo.id = commonDev->deviceInfo.id; + localSave.errDataInfo.errDeviceInfo.name = commonDev->deviceInfo.name; + + /* Error Event */ + localSave.stackTrace->errInfo.errCode = errCode; + localSave.stackTrace->errInfo.errMsg = errMsg; + localSave.stackTrace->errInfo.errSrc = errSource; + + /* File Info */ + localSave.stackTrace->fileInfo.line = lineNum; + localSave.stackTrace->fileInfo.function = funcName; + localSave.stackTrace->fileInfo.file = fileName; + + /* Variable Information */ + localSave.stackTrace->varInfo.varName = varName; + localSave.stackTrace->varInfo.varData = varData; + + /* Debug Information */ + localSave.errDebugInfo.highestPriorityAction = commonDev->errPtr->errDebugInfo.highestPriorityAction; + + ADI_ERROR_LOG(commonDev, localSave); + + recoveryAction = ADI_COMMON_ERR_ACT_NONE; + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/common/adi_logging/adi_common_log.h b/drivers/iio/adc/adrv903x/common/adi_logging/adi_common_log.h new file mode 100644 index 0000000000000..0221bb21d4bdd --- /dev/null +++ b/drivers/iio/adc/adrv903x/common/adi_logging/adi_common_log.h @@ -0,0 +1,200 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_common_log.h +* \brief Contains ADI Hardware Abstraction layer function prototypes and type definitions for adi_common_log.c +* +* ADI common lib Version: 0.0.2.1 +*/ + +#ifndef _ADI_COMMON_LOG_H_ +#define _ADI_COMMON_LOG_H_ + +#include "adi_common_types.h" +#include "adi_common_macros.h" +#include "adi_common_user.h" +#include "adi_common_log_types.h" +#include "adi_common_error_types.h" +#include "adi_common_types.h" + +/** +* \brief Macro to Log API function entry +* +* This macro will call adi_adrv903x_LogWrite function with the __func__ preprocessor. +* +* However, if the device is in time-critical mode the logging is ignored. +* +* \param[in] commonDev pointer to adi_common_Device_t +* \param[in] logLevel Logging Level +*/ + +#define ADI_FUNCTION_ENTRY_LOG(commonDev, logLevel) \ + if (!ADI_COMMON_DEVICE_STATE_IS_TC(*(commonDev))) \ + { \ + adi_adrv903x_LogWrite((commonDev), \ + (adi_hal_LogLevel_e) (logLevel), \ + "%s(...)", \ + __func__); \ + } + + +/** +* \brief Macro to Log Message with Variadic Arguments +* +* However, if the device is in time-critical mode the logging is ignored. +* +* \param[in] commonDev pointer to adi_common_Device_t +* \param[in] logLevel Log Level +* \param[in] message Message to be Logged +* \param[in] ... variable argument(s) passed to adi_common_Logwrite +*/ +#define ADI_VARIABLE_LOG(commonDev, logLevel, message, ...) \ + if (!ADI_COMMON_DEVICE_STATE_IS_TC(*(commonDev))) \ + { \ + adi_adrv903x_LogWrite((commonDev), \ + (adi_hal_LogLevel_e) (logLevel), \ + message, \ + ##__VA_ARGS__); \ + } + +/** +* \brief Macro to log error structure +* +* This macro will call adi_adrv903x_LogWrite function with the required string for logging the error. +* +* \param[in] commonDev pointer to adi_common_Device_t +* \param[in] err pointer to the error structure +*/ +#define ADI_ERROR_LOG(commonDev, err) adi_adrv903x_LogWrite(commonDev, \ + ADI_HAL_LOG_ERR, \ + "Device Information: Type: %" PRIX32 ", ID: %" PRIX32 ", Name: %s\n" \ + ADI_COMMON_LOG_ERR_INDENT1 "Recovery Action: 0x%" PRIX64 "\n" \ + ADI_COMMON_LOG_ERR_INDENT1 "Event Information:\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Error Code: 0x%" PRIX64"\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Error Source: 0x%" PRIX32 "\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Error Message: %s\n" \ + ADI_COMMON_LOG_ERR_INDENT1 "File Information:\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Line: %" PRIu32"\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Function: %s\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "File: %" PRIu32"\n" \ + ADI_COMMON_LOG_ERR_INDENT1 "Variable Information:\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Variable Name: %s\n" \ + ADI_COMMON_LOG_ERR_INDENT2 "Variable Data: 0x%" PRIX64 "\n", \ + err.errDataInfo.errDeviceInfo.type, \ + err.errDataInfo.errDeviceInfo.id, \ + err.errDataInfo.errDeviceInfo.name, \ + err.stackTrace->action, \ + err.stackTrace->errInfo.errCode, \ + err.stackTrace->errInfo.errSrc, \ + err.stackTrace->errInfo.errMsg, \ + err.stackTrace->fileInfo.line, \ + err.stackTrace->fileInfo.function, \ + err.stackTrace->fileInfo.file, \ + err.stackTrace->varInfo.varName, \ + err.stackTrace->varInfo.varData); +/** +* \brief Function to Set the Logging Level +* +* Used to set the log level mask of what types of messages to log +* +* \param[in] commonDev Pointer to adi_common_Device_t +* \param[in] logMask Logging Mask +* +*/ +ADI_API void adi_adrv903x_LogLevelSet(const adi_common_Device_t* const commonDev, + const uint32_t logMask); + +/** +* \brief Function to Get the Logging Level +* +* Used to read the log level mask of what types of messages are able to be logged. +* +* \param[in] commonDev Pointer to adi_common_Device_t +* \param[out] logMask Logging Mask +* +*/ +ADI_API void adi_adrv903x_LogLevelGet(const adi_common_Device_t* const commonDev, + uint32_t* const logMask); + +/** +* \brief Function to Get Logging Status +* +* \param[in] commonDev Pointer to adi_common_Device_t +* \param[out] logStatus Pointer to Logging Status Information +* +*/ +ADI_API adi_common_ErrAction_e adi_adrv903x_LogStatusGet( const adi_common_Device_t* const commonDev, + adi_hal_LogStatusGet_t* const logStatus); + +/** +* \brief Function to Configure Logging to Console +* +* \param[in] commonDev Pointer to adi_common_Device_t +* \param[out] logConsoleFlag Flag Status to be Set +* +*/ +ADI_API void adi_adrv903x_LogConsoleSet(const adi_common_Device_t* const commonDev, adi_hal_LogConsole_e logConsoleFlag); + +/** +* \brief Function to write to log with a selected comment +* +* \param[in] commonDev Pointer to adi_common_Device_t +* \param[in] logLevel Logging Level +* \param[in] comment Message Pointer +* \param[in] ... variable(s) argument passed to adi_common_Logwrite +* +*/ +ADI_API void adi_adrv903x_LogWrite( const adi_common_Device_t* const commonDev, + const adi_hal_LogLevel_e logLevel, + const char* comment, + ...); + +/** +* \brief Function to open the log file associated to the log +* +* Used to open the log file that is stored in the platform +* +* \param[in] commonDev pointer to adi_common_Device_t +* \param[in] fileName file name to be open, if null default name in the devHalInfo structure will be used +* +*/ +ADI_API void adi_adrv903x_LogFileOpen( const adi_common_Device_t* const commonDev, + const char* const fileName); + +/** +* \brief Function to close the log file associated to the log in the platform +* +* \param[in] commonDev pointer to adi_common_Device_t +* +*/ +ADI_API void adi_adrv903x_LogFileClose(const adi_common_Device_t* const commonDev); + +/* + * \brief Service to Log an Error + * + * \param[in] commonDev pointer to adi_common_Device_t + * \param[in] actionRequired RecoveryAction to be taken + * \param[in] lineNum line number of where the error was detected + * \param[in] funcName function name of the function where the error was detected + * \param[in] fileName file name of the file where the error was detected + * \param[in] detErr Detected Error Code + * \param[in] errCodeMsg Error Message + * \param[in] varName Variable name to be captured + * \param[in] varData Variable Data will be captured (Limitations Apply) + * \param[in] errMsg User Readable Error Message + */ +ADI_API adi_common_ErrAction_e adi_adrv903x_ErrLog( const adi_common_Device_t* const commonDev, + const uint32_t errSource, + const adi_common_ErrAction_e action, + const int64_t errCode, + const uint32_t lineNum, + const char* funcName, + const uint32_t fileName, + const char* varName, + const int64_t varData, + const char* errMsg); + +#endif /* _ADI_COMMON_LOG_H_ */ diff --git a/drivers/iio/adc/adrv903x/common/adi_logging/adi_common_log_types.h b/drivers/iio/adc/adrv903x/common/adi_logging/adi_common_log_types.h new file mode 100644 index 0000000000000..c03986c60ee22 --- /dev/null +++ b/drivers/iio/adc/adrv903x/common/adi_logging/adi_common_log_types.h @@ -0,0 +1,16 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_common_log_types.h +* \brief Contains ADI common log types. +* +* ADI common lib Version: 0.0.2.1 +*/ + +#ifndef _ADI_COMMON_LOG_TYPES_H_ +#define _ADI_COMMON_LOG_TYPES_H_ + +#endif /* _ADI_COMMON_LOG_TYPES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/multiver/adi_adrv903x_all_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/multiver/adi_adrv903x_all_types.h new file mode 100644 index 0000000000000..4a48232151c35 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/multiver/adi_adrv903x_all_types.h @@ -0,0 +1,38 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/*! +* \file adi_adrv903x_all_types.h +* \brief A convenience header that includes all adrv903x _types header files. +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef ADI_ADRV903X_ALL_TYPES_H +#define ADI_ADRV903X_ALL_TYPES_H +#include "adi_adrv903x_agc_types.h" +#include "adi_adrv903x_cals_types.h" +#include "adi_adrv903x_cpu_error_codes_types.h" +#include "adi_adrv903x_cpu_fw_rev_info_types.h" +#include "adi_adrv903x_cpu_health_monitor_types.h" +#include "adi_adrv903x_cpu_log_types.h" +#include "adi_adrv903x_cpu_sw_bkpt_types.h" +#include "adi_adrv903x_cpu_sys_types.h" +#include "adi_adrv903x_cpu_types.h" +#include "adi_adrv903x_datainterface_types.h" +#include "adi_adrv903x_dev_temp_types.h" +#include "adi_adrv903x_error_types.h" +#include "adi_adrv903x_gpio_types.h" +#include "adi_adrv903x_hal_types.h" +#include "adi_adrv903x_lo_types.h" +#include "adi_adrv903x_radioctrl_types.h" +#include "adi_adrv903x_rx_types.h" +#include "adi_adrv903x_tx_types.h" +#include "adi_adrv903x_types.h" +#include "adi_adrv903x_utilities_types.h" +#include "adi_adrv903x_version_types.h" +#include "adi_adrv903x_cpu_cmd_run_serdes_eye_sweep.h" +#include "adi_adrv903x_cpu_cmd_dc_offset.h" +#endif diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/multiver/adi_adrv903x_api.h b/drivers/iio/adc/adrv903x/devices/adrv903x/multiver/adi_adrv903x_api.h new file mode 100644 index 0000000000000..e905a0e9858cf --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/multiver/adi_adrv903x_api.h @@ -0,0 +1,47 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/*! +* \file adi_adrv903x_api.h +* \brief A convenience header that includes all adrv903x header files. +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef ADI_ADRV903X_API_H +#define ADI_ADRV903X_API_H + +/* Regardless of single or multi-version all applications need the API types. */ +#include "adi_adrv903x_all_types.h" + +#ifdef ADI_ADRV903X_MULTIVERSION +/* The application will load a specific API version at run-time using api_ver_init(); Include the function pointer + * declarations for the redirection table. */ +#include "adi_adrv903x_ver_redirect.h" +#else +/* The application will compile in or statically link to a single API version; Include the standard function decls */ +#include "adi_adrv903x_agc.h" +#include "adi_adrv903x_cals.h" +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_cpu.h" +#include "adi_adrv903x_cpu_cmd_dc_offset.h" +#include "adi_adrv903x_cpu_cmd_run_serdes_eye_sweep.h" +#include "adi_adrv903x_datainterface.h" +#include "adi_adrv903x_error.h" +#include "adi_adrv903x_error_type_action.h" +#include "adi_adrv903x_gpio.h" +#include "adi_adrv903x_hal.h" +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_radioctrl.h" +#include "adi_adrv903x_rx.h" +#include "adi_adrv903x_rx_nco.h" +#include "adi_adrv903x_tx.h" +#include "adi_adrv903x_tx_nco.h" +#include "adi_adrv903x_user.h" +#include "adi_adrv903x_utilities.h" +#include "adi_adrv903x_version.h" +#endif + +#endif diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_actrl_orx_west_regmap.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_actrl_orx_west_regmap.c new file mode 100644 index 0000000000000..b46f0835c8475 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_actrl_orx_west_regmap.c @@ -0,0 +1,299 @@ +/** + * \file adrv903x_bf_actrl_orx_west_regmap.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_actrl_orx_west_regmap.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_ACTRL_ORX_WEST_REGMAP + +ADI_API adi_adrv903x_ErrAction_e adrv903x_ActrlOrxWestRegmap_TrmAtten_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfActrlOrxWestRegmapChanAddr_e baseAddr, + const adrv903x_Bf_ActrlOrxWestRegmap_TrmAtten_e bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ( + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_0DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_1DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_2DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_3DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_4DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_5DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_6DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_7DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_8DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_9DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_10DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_11DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_12DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_13DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_14DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_15DB ) && + (bfValue != ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_16DB ) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_ActrlOrxWestRegmap_TrmAtten_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_ActrlOrxWestRegmap_TrmAtten_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3F0U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_ActrlOrxWestRegmap_TrmAtten_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfActrlOrxWestRegmapChanAddr_e baseAddr, + adrv903x_Bf_ActrlOrxWestRegmap_TrmAtten_e* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (adrv903x_Bf_ActrlOrxWestRegmap_TrmAtten_e) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_ActrlOrxWestRegmap_TrmAtten_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3F0U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (adrv903x_Bf_ActrlOrxWestRegmap_TrmAtten_e) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_ActrlOrxWestRegmap_TrmAttenCmCapEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfActrlOrxWestRegmapChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_ActrlOrxWestRegmap_TrmAttenCmCapEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_ActrlOrxWestRegmap_TrmAttenCmCapEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3F1U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_ActrlOrxWestRegmap_TrmAttenPd_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfActrlOrxWestRegmapChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_ActrlOrxWestRegmap_TrmAttenPd_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_ActrlOrxWestRegmap_TrmAttenPd_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3F1U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_ActrlOrxWestRegmap_TrmAttenSpare2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfActrlOrxWestRegmapChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 63U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_ActrlOrxWestRegmap_TrmAttenSpare2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_ActrlOrxWestRegmap_TrmAttenSpare2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3F1U), + ((uint32_t) bfValue << 2), + 0xFCU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_actrl_orx_west_regmap.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_actrl_orx_west_regmap.h new file mode 100644 index 0000000000000..238e123f51d39 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_actrl_orx_west_regmap.h @@ -0,0 +1,56 @@ +/** + * \file adrv903x_bf_actrl_orx_west_regmap.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_H_ +#define _ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_actrl_orx_west_regmap_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_ActrlOrxWestRegmap_TrmAtten_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfActrlOrxWestRegmapChanAddr_e baseAddr, + const adrv903x_Bf_ActrlOrxWestRegmap_TrmAtten_e bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_ActrlOrxWestRegmap_TrmAtten_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfActrlOrxWestRegmapChanAddr_e baseAddr, + adrv903x_Bf_ActrlOrxWestRegmap_TrmAtten_e* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_ActrlOrxWestRegmap_TrmAttenCmCapEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfActrlOrxWestRegmapChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_ActrlOrxWestRegmap_TrmAttenPd_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfActrlOrxWestRegmapChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_ActrlOrxWestRegmap_TrmAttenSpare2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfActrlOrxWestRegmapChanAddr_e baseAddr, + const uint8_t bfValue); + +#endif // _ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_actrl_orx_west_regmap_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_actrl_orx_west_regmap_types.h new file mode 100644 index 0000000000000..c563f041578d2 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_actrl_orx_west_regmap_types.h @@ -0,0 +1,50 @@ +/** + * \file adrv903x_bf_actrl_orx_west_regmap_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TYPES_H_ +#define _ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TYPES_H_ + +typedef enum adrv903x_BfActrlOrxWestRegmapChanAddr +{ + ADRV903X_BF_SLICE_ORX_0__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP = 0x6106A400, + ADRV903X_BF_SLICE_ORX_1__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP = 0x6116A400 +} adrv903x_BfActrlOrxWestRegmapChanAddr_e; + +/** + * \brief Enumeration for trmAtten + */ + +typedef enum adrv903x_Bf_ActrlOrxWestRegmap_TrmAtten +{ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_0DB = 0, /*!< 0dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_1DB = 1, /*!< 1dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_2DB = 2, /*!< 2dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_3DB = 3, /*!< 3dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_4DB = 4, /*!< 4dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_5DB = 5, /*!< 5dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_6DB = 6, /*!< 6dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_7DB = 7, /*!< 7dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_8DB = 8, /*!< 8dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_9DB = 9, /*!< 9dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_10DB = 10, /*!< 10dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_11DB = 11, /*!< 11dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_12DB = 12, /*!< 12dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_13DB = 13, /*!< 13dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_14DB = 14, /*!< 14dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_15DB = 15, /*!< 15dB Attenuation */ + ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_16DB = 16 /*!< 16dB Attenuation */ +} adrv903x_Bf_ActrlOrxWestRegmap_TrmAtten_e; + +#endif // _ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_core.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_core.c new file mode 100644 index 0000000000000..71b6be320c40b --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_core.c @@ -0,0 +1,22935 @@ +/** + * \file adrv903x_bf_core.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_core.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_CORE + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_AhbSpiBridgeEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_AhbSpiBridgeEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_AhbSpiBridgeEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1FU), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm0M3Run_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Arm0M3Run_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Arm0M3Run_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x21U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm0M3Run_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Arm0M3Run_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x21U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm0MemHrespMask_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Arm0MemHrespMask_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Arm0MemHrespMask_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x21U), + ((uint32_t) bfValue << 3), + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm0Spi0Command_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 63U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Arm0Spi0Command_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Arm0Spi0Command_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x63U), + (uint32_t) bfValue, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm0Spi0CommandBusy_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Arm0Spi0CommandBusy_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x63U), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm0Spi0ExtCmdByte1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Arm0Spi0ExtCmdByte1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Arm0Spi0ExtCmdByte1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x64U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm1Spi0CommandBusy_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Arm1Spi0CommandBusy_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xF4U), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ArmClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_ArmClkDivideRatio_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_ArmClkDivideRatio_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x17U), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ArmClkDivideRatioDevClk_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_ArmClkDivideRatioDevClk_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_ArmClkDivideRatioDevClk_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x17U), + ((uint32_t) bfValue << 3), + 0x18U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ArmClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_ArmClkEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_ArmClkEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x17U), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x866), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x87E), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x867), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x87F), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel10_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel10_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x870), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x888), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel11_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel11_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x871), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x889), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel12_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel12_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x872), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x88A), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel13_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel13_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x873), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x88B), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel14_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel14_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x874), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x88C), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel15_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel15_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x875), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x88D), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel16_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel16_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x876), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x88E), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel17_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel17_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x877), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x88F), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel18_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel18_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x878), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x890), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel19_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel19_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x879), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x891), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x868), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x880), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel20_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel20_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x87A), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x892), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel21_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel21_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x87B), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x893), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel22_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel22_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x87C), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x894), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel23_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel23_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x87D), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x895), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel3_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel3_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x869), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x881), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel4_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel4_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x86A), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x882), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel5_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel5_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x86B), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x883), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel6_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel6_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x86C), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x884), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel7_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel7_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x86D), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x885), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel8_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel8_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x86E), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x886), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DataFromControlOutSel9_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DataFromControlOutSel9_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x86F), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x887), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DevclkBufferEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DevclkBufferEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DevclkBufferEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x32FU), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DevclkBuffTermEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DevclkBuffTermEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DevclkBuffTermEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x32FU), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DevclkDividerMcsResetb_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DevclkDividerMcsResetb_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DevclkDividerMcsResetb_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x32DU), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DevclkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DevclkDivideRatio_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DevclkDivideRatio_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x32EU), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DigitalClockDividerSyncEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DigitalClockDividerSyncEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DigitalClockDividerSyncEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x19U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DigitalClockPowerUp_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_DigitalClockPowerUp_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_DigitalClockPowerUp_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x19U), + ((uint32_t) bfValue << 6), + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_EfuseProductId_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_EfuseProductId_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_EfuseProductIdReady_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_EfuseProductIdReady_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x13U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_EfuseReadData_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint32_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint32_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_EfuseReadData_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x193U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 24); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x194U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 16); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x195U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x196U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_EfuseReadDataValid_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_EfuseReadDataValid_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x191U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_EfuseReadState_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_EfuseReadState_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x191U), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogFromMaster_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogFromMaster_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4C0U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4C1U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogFromMasterClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 65535U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogFromMasterClear_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogFromMasterClear_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4C4), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4C5), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogFromMasterToggle_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 65535U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogFromMasterToggle_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogFromMasterToggle_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4E0), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4E1), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4C8U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4C8U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4C8U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4C8U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl10_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl10_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CDU), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl10_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl10_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4CDU), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl11_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl11_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CDU), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl11_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl11_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4CDU), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl12_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl12_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CEU), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl12_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl12_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4CEU), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl13_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl13_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CEU), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl13_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl13_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4CEU), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl14_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl14_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CFU), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl14_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl14_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4CFU), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl15_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl15_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CFU), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl15_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl15_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4CFU), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4C9U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl2_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4C9U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl3_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl3_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4C9U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl3_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4C9U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl4_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl4_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CAU), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl4_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4CAU), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl5_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl5_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CAU), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl5_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4CAU), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl6_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl6_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CBU), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl6_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4CBU), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl7_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl7_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CBU), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl7_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4CBU), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl8_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl8_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CCU), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl8_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl8_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4CCU), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControl9_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl9_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CCU), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl9_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControl9_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4CCU), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControlOverride_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 65535U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioAnalogSourceControlOverride_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControlOverride_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4D5), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4D6), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControlOverride_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSourceControlOverride_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4D5U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4D6U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSpiRead_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioAnalogSpiRead_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4C6U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4C7U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioFromMaster_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint32_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint32_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioFromMaster_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x837U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x838U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x839U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 16); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioFromMasterClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint32_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 16777215U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioFromMasterClear_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioFromMasterClear_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x899), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x89A), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x89B), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioFromMasterToggle_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint32_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 16777215U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioFromMasterToggle_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioFromMasterToggle_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x89C), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x89D), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x89E), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x83FU), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x83FU), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x83FU), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x83FU), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl10_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl10_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x844U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl10_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl10_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x844U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl11_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl11_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x844U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl11_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl11_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x844U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl12_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl12_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x845U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl12_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl12_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x845U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl13_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl13_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x845U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl13_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl13_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x845U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl14_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl14_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x846U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl14_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl14_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x846U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl15_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl15_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x846U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl15_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl15_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x846U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl16_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl16_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x847U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl16_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl16_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x847U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl17_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl17_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x847U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl17_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl17_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x847U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl18_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl18_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x848U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl18_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl18_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x848U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl19_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl19_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x848U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl19_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl19_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x848U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x840U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl2_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x840U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl20_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl20_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x849U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl20_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl20_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x849U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl21_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl21_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x849U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl21_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl21_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x849U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl22_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl22_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84AU), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl22_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl22_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x84AU), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl23_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl23_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84AU), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl23_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl23_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x84AU), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl3_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl3_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x840U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl3_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x840U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl4_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl4_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x841U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl4_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x841U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl5_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl5_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x841U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl5_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x841U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl6_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl6_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x842U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl6_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x842U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl7_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl7_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x842U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl7_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x842U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl8_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl8_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x843U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl8_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl8_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x843U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControl9_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl9_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x843U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl9_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControl9_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x843U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControlOverride_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint32_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 16777215U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceControlOverride_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControlOverride_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x833), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x834), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x835), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControlOverride_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint32_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint32_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceControlOverride_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x833U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x834U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x835U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 16); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x863U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x863U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl10_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl10_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x864U), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl11_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl11_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x864U), + ((uint32_t) bfValue << 3), + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl12_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl12_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x864U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl13_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl13_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x864U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl14_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl14_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x864U), + ((uint32_t) bfValue << 6), + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl15_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl15_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x864U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl16_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl16_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x865U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl17_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl17_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x865U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl18_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl18_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x865U), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl19_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl19_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x865U), + ((uint32_t) bfValue << 3), + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x863U), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl20_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl20_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x865U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl21_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl21_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x865U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl22_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl22_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x865U), + ((uint32_t) bfValue << 6), + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl23_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl23_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x865U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl3_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl3_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x863U), + ((uint32_t) bfValue << 3), + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl4_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl4_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x863U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl5_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl5_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x863U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl6_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl6_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x863U), + ((uint32_t) bfValue << 6), + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl7_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl7_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x863U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl8_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl8_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x864U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceOrxControl9_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceOrxControl9_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x864U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84BU), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84BU), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl10_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl10_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x850U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl11_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl11_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x850U), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl12_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl12_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x851U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl13_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl13_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x851U), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl14_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl14_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x852U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl15_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl15_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x852U), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl16_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl16_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x853U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl17_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl17_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x853U), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl18_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl18_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x854U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl19_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl19_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x854U), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84CU), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl20_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl20_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x855U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl21_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl21_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x855U), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl22_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl22_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x856U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl23_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl23_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x856U), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl3_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl3_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84CU), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl4_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl4_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84DU), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl5_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl5_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84DU), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl6_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl6_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84EU), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl7_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl7_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84EU), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl8_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl8_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84FU), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceRxControl9_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceRxControl9_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84FU), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x857U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x857U), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl10_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl10_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x85CU), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl11_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl11_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x85CU), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl12_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl12_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x85DU), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl13_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl13_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x85DU), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl14_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl14_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x85EU), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl15_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl15_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x85EU), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl16_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl16_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x85FU), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl17_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl17_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x85FU), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl18_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl18_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x860U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl19_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl19_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x860U), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x858U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl20_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl20_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x861U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl21_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl21_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x861U), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl22_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl22_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x862U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl23_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl23_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x862U), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl3_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl3_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x858U), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl4_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl4_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x859U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl5_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl5_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x859U), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl6_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl6_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x85AU), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl7_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl7_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x85AU), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl8_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl8_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x85BU), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpioSourceTxControl9_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSourceTxControl9_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x85BU), + ((uint32_t) bfValue << 3), + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSpiRead_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint32_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint32_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpioSpiRead_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x83BU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x83CU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x83DU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 16); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsLevelPulseBLowerWord_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 281474976710655U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpInterruptsLevelPulseBLowerWord_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsLevelPulseBLowerWord_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x176), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x177), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x178), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x179), + bfValue >> 24, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x17A), + bfValue >> 32, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x17B), + bfValue >> 40, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsLevelPulseBLowerWord_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint64_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsLevelPulseBLowerWord_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x176U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x177U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x178U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 16); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x179U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 24); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x17AU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 32); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x17BU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 40); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsLevelPulseBUpperWord_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 281474976710655U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpInterruptsLevelPulseBUpperWord_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsLevelPulseBUpperWord_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x17C), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x17D), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x17E), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x17F), + bfValue >> 24, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x180), + bfValue >> 32, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x181), + bfValue >> 40, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsLevelPulseBUpperWord_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint64_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsLevelPulseBUpperWord_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x17CU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x17DU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x17EU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 16); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x17FU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 24); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x180U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 32); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x181U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 40); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskLowerWordPin0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 281474976710655U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpInterruptsMaskLowerWordPin0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsMaskLowerWordPin0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x152), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x153), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x154), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x155), + bfValue >> 24, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x156), + bfValue >> 32, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x157), + bfValue >> 40, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskLowerWordPin0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint64_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsMaskLowerWordPin0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x152U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x153U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x154U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 16); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x155U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 24); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x156U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 32); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x157U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 40); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskLowerWordPin1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 281474976710655U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpInterruptsMaskLowerWordPin1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsMaskLowerWordPin1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x146), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x147), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x148), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x149), + bfValue >> 24, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x14A), + bfValue >> 32, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x14B), + bfValue >> 40, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskLowerWordPin1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint64_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsMaskLowerWordPin1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x146U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x147U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x148U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 16); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x149U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 24); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x14AU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 32); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x14BU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 40); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 281474976710655U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x158), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x159), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x15A), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x15B), + bfValue >> 24, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x15C), + bfValue >> 32, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x15D), + bfValue >> 40, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint64_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x158U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x159U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x15AU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 16); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x15BU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 24); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x15CU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 32); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x15DU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 40); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 281474976710655U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x14C), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x14D), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x14E), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x14F), + bfValue >> 24, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x150), + bfValue >> 32, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x151), + bfValue >> 40, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint64_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x14CU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x14DU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x14EU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 16); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x14FU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 24); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x150U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 32); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x151U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 40); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsStatusLowerWord_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 281474976710655U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpInterruptsStatusLowerWord_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsStatusLowerWord_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x16A), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x16B), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x16C), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x16D), + bfValue >> 24, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x16E), + bfValue >> 32, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x16F), + bfValue >> 40, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsStatusLowerWord_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint64_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsStatusLowerWord_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x16AU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x16BU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x16CU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 16); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x16DU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 24); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x16EU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 32); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x16FU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 40); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsStatusUpperWord_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 281474976710655U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_GpInterruptsStatusUpperWord_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsStatusUpperWord_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x170), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x171), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x172), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x173), + bfValue >> 24, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x174), + bfValue >> 32, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x175), + bfValue >> 40, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsStatusUpperWord_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint64_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_GpInterruptsStatusUpperWord_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x170U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x171U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x172U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 16); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x173U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 24); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x174U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 32); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x175U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint64_t) bfValueTmp << 40); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MaskRevisionMajor_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_MaskRevisionMajor_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x5U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MaskRevisionMinor_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_MaskRevisionMinor_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x5U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MasterBiasClkDivRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_MasterBiasClkDivRatio_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_MasterBiasClkDivRatio_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x18U), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MbiasBgCtat_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_MbiasBgCtat_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_MbiasBgCtat_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_MbiasBgCtat_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x351 + channelId * 12U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MbiasBgPtat_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 63U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_MbiasBgPtat_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_MbiasBgPtat_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_MbiasBgPtat_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x353 + channelId * 12U), + (uint32_t) bfValue, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MbiasIgenPd_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_MbiasIgenPd_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_MbiasIgenPd_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_MbiasIgenPd_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x350 + channelId * 12U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MbiasRtrimResetb_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_MbiasRtrimResetb_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_MbiasRtrimResetb_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_MbiasRtrimResetb_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x357 + channelId * 12U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MbiasTrimCompPd_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_MbiasTrimCompPd_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_MbiasTrimCompPd_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_MbiasTrimCompPd_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x350 + channelId * 12U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_McsStatus_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_McsStatus_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_McsStatus_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x54FU), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_McsStatus_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_McsStatus_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x54FU), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 63U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_PadDs0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_PadDs0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_PadDs0_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x550 + channelId * 8U), + (uint32_t) bfValue, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_PadDs0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_PadDs0_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x550 + channelId * 8U), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 63U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_PadDs1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_PadDs1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_PadDs1_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x590 + channelId * 8U), + (uint32_t) bfValue, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_PadDs1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_PadDs1_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x590 + channelId * 8U), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 63U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_PadDs2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_PadDs2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_PadDs2_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x5D0 + channelId * 8U), + (uint32_t) bfValue, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_PadDs2_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_PadDs2_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x5D0 + channelId * 8U), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 63U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_PadDs3_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_PadDs3_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_PadDs3_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x610 + channelId * 7U), + (uint32_t) bfValue, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_PadDs3_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_PadDs3_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x610 + channelId * 7U), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadSt_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 63U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_PadSt_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_PadSt_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_PadSt_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x648 + channelId * 7U), + (uint32_t) bfValue, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadSt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_PadSt_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_PadSt_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x648 + channelId * 7U), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrx0Map_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceOrx0Map_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x505U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrx1Map_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceOrx1Map_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x505U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxonReadback_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceOrxonReadback_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x50AU), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxArmModeSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceOrxArmModeSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x520U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxArmModeSelClr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceOrxArmModeSelClr_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceOrxArmModeSelClr_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x522U), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxSpiEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceOrxSpiEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceOrxSpiEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x51BU), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxSpiEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceOrxSpiEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x51BU), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxSpiModeSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceOrxSpiModeSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceOrxSpiModeSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x51CU), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxSpiModeSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceOrxSpiModeSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x51CU), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxonReadback_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxonReadback_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x508U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxAntEnPin0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4FBU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4FBU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxAntEnPin1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4FCU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4FCU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxAntEnPin2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4FDU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin2_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4FDU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxAntEnPin3_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin3_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4FEU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin3_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4FEU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxAntEnPin4_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin4_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4FFU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin4_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4FFU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxAntEnPin5_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin5_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x500U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin5_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x500U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxAntEnPin6_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin6_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x501U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin6_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x501U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxAntEnPin7_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin7_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x502U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxAntEnPin7_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x502U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxArmModeSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxArmModeSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x518U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxArmModeSelClr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxArmModeSelClr_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxArmModeSelClr_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x51AU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxEnPin0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4F3U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4F3U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxEnPin1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4F4U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4F4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxEnPin2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4F5U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin2_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4F5U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxEnPin3_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin3_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4F6U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin3_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4F6U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxEnPin4_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin4_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4F7U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin4_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4F7U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxEnPin5_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin5_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4F8U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin5_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4F8U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxEnPin6_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin6_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4F9U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin6_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4F9U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxEnPin7_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin7_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4FAU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxEnPin7_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4FAU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxSpiEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxSpiEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxSpiEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x513U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxSpiEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxSpiEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x513U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxSpiModeSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceRxSpiModeSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxSpiModeSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x514U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxSpiModeSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceRxSpiModeSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x514U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxonReadback_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxonReadback_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x506U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxAntEnPin0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4EBU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4EBU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxAntEnPin1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4ECU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4ECU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxAntEnPin2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4EDU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin2_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4EDU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxAntEnPin3_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin3_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4EEU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin3_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4EEU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxAntEnPin4_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin4_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4EFU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin4_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4EFU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxAntEnPin5_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin5_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4F0U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin5_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4F0U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxAntEnPin6_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin6_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4F1U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin6_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4F1U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxAntEnPin7_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin7_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4F2U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxAntEnPin7_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4F2U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxArmModeSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxArmModeSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x510U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxArmModeSelClr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxArmModeSelClr_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxArmModeSelClr_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x512U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxEnPin0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4E3U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4E3U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxEnPin1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4E4U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4E4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxEnPin2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4E5U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin2_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4E5U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxEnPin3_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin3_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4E6U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin3_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4E6U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxEnPin4_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin4_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4E7U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin4_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4E7U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxEnPin5_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin5_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4E8U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin5_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4E8U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxEnPin6_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin6_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4E9U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin6_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4E9U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxEnPin7_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin7_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4EAU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxEnPin7_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4EAU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxSpiEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxSpiEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxSpiEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x50BU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxSpiEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxSpiEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x50BU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxSpiModeSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_RadioControlInterfaceTxSpiModeSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxSpiModeSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x50CU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxSpiModeSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_RadioControlInterfaceTxSpiModeSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x50CU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ScratchPadWord_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_ScratchPadWord_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_ScratchPadWord_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xAU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ScratchPadWord_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_ScratchPadWord_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xAU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ScratchReg_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_ScratchReg_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_ScratchReg_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) && + (channelId != 0x8) && + (channelId != 0x9) && + (channelId != 0xA) && + (channelId != 0xB) && + (channelId != 0xC) && + (channelId != 0xD) && + (channelId != 0xE) && + (channelId != 0xF) && + (channelId != 0x10) && + (channelId != 0x11) && + (channelId != 0x12) && + (channelId != 0x13) && + (channelId != 0x14) && + (channelId != 0x15) && + (channelId != 0x16) && + (channelId != 0x17) && + (channelId != 0x18) && + (channelId != 0x19) && + (channelId != 0x1A) && + (channelId != 0x1B) && + (channelId != 0x1C) && + (channelId != 0x1D) && + (channelId != 0x1E) && + (channelId != 0x1F) && + (channelId != 0x20) && + (channelId != 0x21) && + (channelId != 0x22) && + (channelId != 0x23) && + (channelId != 0x24) && + (channelId != 0x25) && + (channelId != 0x26) && + (channelId != 0x27) && + (channelId != 0x28) && + (channelId != 0x29) && + (channelId != 0x2A) && + (channelId != 0x2B) && + (channelId != 0x2C) && + (channelId != 0x2D) && + (channelId != 0x2E) && + (channelId != 0x2F) && + (channelId != 0x30) && + (channelId != 0x31) && + (channelId != 0x32) && + (channelId != 0x33) && + (channelId != 0x34) && + (channelId != 0x35) && + (channelId != 0x36) && + (channelId != 0x37) && + (channelId != 0x38) && + (channelId != 0x39) && + (channelId != 0x3A) && + (channelId != 0x3B) && + (channelId != 0x3C) && + (channelId != 0x3D) && + (channelId != 0x3E) && + (channelId != 0x3F) && + (channelId != 0x40) && + (channelId != 0x41) && + (channelId != 0x42) && + (channelId != 0x43) && + (channelId != 0x44) && + (channelId != 0x45) && + (channelId != 0x46) && + (channelId != 0x47) && + (channelId != 0x48) && + (channelId != 0x49) && + (channelId != 0x4A) && + (channelId != 0x4B) && + (channelId != 0x4C) && + (channelId != 0x4D) && + (channelId != 0x4E) && + (channelId != 0x4F) && + (channelId != 0x50) && + (channelId != 0x51) && + (channelId != 0x52) && + (channelId != 0x53) && + (channelId != 0x54) && + (channelId != 0x55) && + (channelId != 0x56) && + (channelId != 0x57) && + (channelId != 0x58) && + (channelId != 0x59) && + (channelId != 0x5A) && + (channelId != 0x5B) && + (channelId != 0x5C) && + (channelId != 0x5D) && + (channelId != 0x5E) && + (channelId != 0x5F) && + (channelId != 0x60) && + (channelId != 0x61) && + (channelId != 0x62) && + (channelId != 0x63) && + (channelId != 0x64) && + (channelId != 0x65) && + (channelId != 0x66) && + (channelId != 0x67) && + (channelId != 0x68) && + (channelId != 0x69) && + (channelId != 0x6A) && + (channelId != 0x6B) && + (channelId != 0x6C) && + (channelId != 0x6D) && + (channelId != 0x6E) && + (channelId != 0x6F) && + (channelId != 0x70) && + (channelId != 0x71) && + (channelId != 0x72) && + (channelId != 0x73) && + (channelId != 0x74) && + (channelId != 0x75) && + (channelId != 0x76) && + (channelId != 0x77) && + (channelId != 0x78) && + (channelId != 0x79) && + (channelId != 0x7A) && + (channelId != 0x7B) && + (channelId != 0x7C) && + (channelId != 0x7D) && + (channelId != 0x7E) && + (channelId != 0x7F) && + (channelId != 0x80) && + (channelId != 0x81) && + (channelId != 0x82) && + (channelId != 0x83) && + (channelId != 0x84) && + (channelId != 0x85) && + (channelId != 0x86) && + (channelId != 0x87) && + (channelId != 0x88) && + (channelId != 0x89) && + (channelId != 0x8A) && + (channelId != 0x8B) && + (channelId != 0x8C) && + (channelId != 0x8D) && + (channelId != 0x8E) && + (channelId != 0x8F) && + (channelId != 0x90) && + (channelId != 0x91) && + (channelId != 0x92) && + (channelId != 0x93) && + (channelId != 0x94) && + (channelId != 0x95) && + (channelId != 0x96) && + (channelId != 0x97) && + (channelId != 0x98) && + (channelId != 0x99) && + (channelId != 0x9A) && + (channelId != 0x9B) && + (channelId != 0x9C) && + (channelId != 0x9D) && + (channelId != 0x9E) && + (channelId != 0x9F) && + (channelId != 0xA0) && + (channelId != 0xA1) && + (channelId != 0xA2) && + (channelId != 0xA3) && + (channelId != 0xA4) && + (channelId != 0xA5) && + (channelId != 0xA6) && + (channelId != 0xA7) && + (channelId != 0xA8) && + (channelId != 0xA9) && + (channelId != 0xAA) && + (channelId != 0xAB) && + (channelId != 0xAC) && + (channelId != 0xAD) && + (channelId != 0xAE) && + (channelId != 0xAF) && + (channelId != 0xB0) && + (channelId != 0xB1) && + (channelId != 0xB2) && + (channelId != 0xB3) && + (channelId != 0xB4) && + (channelId != 0xB5) && + (channelId != 0xB6) && + (channelId != 0xB7) && + (channelId != 0xB8) && + (channelId != 0xB9) && + (channelId != 0xBA) && + (channelId != 0xBB) && + (channelId != 0xBC) && + (channelId != 0xBD) && + (channelId != 0xBE) && + (channelId != 0xBF) && + (channelId != 0xC0) && + (channelId != 0xC1) && + (channelId != 0xC2) && + (channelId != 0xC3) && + (channelId != 0xC4) && + (channelId != 0xC5) && + (channelId != 0xC6) && + (channelId != 0xC7) && + (channelId != 0xC8) && + (channelId != 0xC9) && + (channelId != 0xCA) && + (channelId != 0xCB) && + (channelId != 0xCC) && + (channelId != 0xCD) && + (channelId != 0xCE) && + (channelId != 0xCF) && + (channelId != 0xD0) && + (channelId != 0xD1) && + (channelId != 0xD2) && + (channelId != 0xD3) && + (channelId != 0xD4) && + (channelId != 0xD5) && + (channelId != 0xD6) && + (channelId != 0xD7) && + (channelId != 0xD8) && + (channelId != 0xD9) && + (channelId != 0xDA) && + (channelId != 0xDB) && + (channelId != 0xDC) && + (channelId != 0xDD) && + (channelId != 0xDE) && + (channelId != 0xDF) && + (channelId != 0xE0) && + (channelId != 0xE1) && + (channelId != 0xE2) && + (channelId != 0xE3) && + (channelId != 0xE4) && + (channelId != 0xE5) && + (channelId != 0xE6) && + (channelId != 0xE7) && + (channelId != 0xE8) && + (channelId != 0xE9) && + (channelId != 0xEA) && + (channelId != 0xEB) && + (channelId != 0xEC) && + (channelId != 0xED) && + (channelId != 0xEE) && + (channelId != 0xEF) && + (channelId != 0xF0) && + (channelId != 0xF1) && + (channelId != 0xF2) && + (channelId != 0xF3) && + (channelId != 0xF4) && + (channelId != 0xF5) && + (channelId != 0xF6) && + (channelId != 0xF7) && + (channelId != 0xF8) && + (channelId != 0xF9) && + (channelId != 0xFA) && + (channelId != 0xFB) && + (channelId != 0xFC) && + (channelId != 0xFD) && + (channelId != 0xFE) && + (channelId != 0xFF) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_ScratchReg_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x200 + channelId * 1U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ScratchReg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_ScratchReg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) && + (channelId != 0x8) && + (channelId != 0x9) && + (channelId != 0xA) && + (channelId != 0xB) && + (channelId != 0xC) && + (channelId != 0xD) && + (channelId != 0xE) && + (channelId != 0xF) && + (channelId != 0x10) && + (channelId != 0x11) && + (channelId != 0x12) && + (channelId != 0x13) && + (channelId != 0x14) && + (channelId != 0x15) && + (channelId != 0x16) && + (channelId != 0x17) && + (channelId != 0x18) && + (channelId != 0x19) && + (channelId != 0x1A) && + (channelId != 0x1B) && + (channelId != 0x1C) && + (channelId != 0x1D) && + (channelId != 0x1E) && + (channelId != 0x1F) && + (channelId != 0x20) && + (channelId != 0x21) && + (channelId != 0x22) && + (channelId != 0x23) && + (channelId != 0x24) && + (channelId != 0x25) && + (channelId != 0x26) && + (channelId != 0x27) && + (channelId != 0x28) && + (channelId != 0x29) && + (channelId != 0x2A) && + (channelId != 0x2B) && + (channelId != 0x2C) && + (channelId != 0x2D) && + (channelId != 0x2E) && + (channelId != 0x2F) && + (channelId != 0x30) && + (channelId != 0x31) && + (channelId != 0x32) && + (channelId != 0x33) && + (channelId != 0x34) && + (channelId != 0x35) && + (channelId != 0x36) && + (channelId != 0x37) && + (channelId != 0x38) && + (channelId != 0x39) && + (channelId != 0x3A) && + (channelId != 0x3B) && + (channelId != 0x3C) && + (channelId != 0x3D) && + (channelId != 0x3E) && + (channelId != 0x3F) && + (channelId != 0x40) && + (channelId != 0x41) && + (channelId != 0x42) && + (channelId != 0x43) && + (channelId != 0x44) && + (channelId != 0x45) && + (channelId != 0x46) && + (channelId != 0x47) && + (channelId != 0x48) && + (channelId != 0x49) && + (channelId != 0x4A) && + (channelId != 0x4B) && + (channelId != 0x4C) && + (channelId != 0x4D) && + (channelId != 0x4E) && + (channelId != 0x4F) && + (channelId != 0x50) && + (channelId != 0x51) && + (channelId != 0x52) && + (channelId != 0x53) && + (channelId != 0x54) && + (channelId != 0x55) && + (channelId != 0x56) && + (channelId != 0x57) && + (channelId != 0x58) && + (channelId != 0x59) && + (channelId != 0x5A) && + (channelId != 0x5B) && + (channelId != 0x5C) && + (channelId != 0x5D) && + (channelId != 0x5E) && + (channelId != 0x5F) && + (channelId != 0x60) && + (channelId != 0x61) && + (channelId != 0x62) && + (channelId != 0x63) && + (channelId != 0x64) && + (channelId != 0x65) && + (channelId != 0x66) && + (channelId != 0x67) && + (channelId != 0x68) && + (channelId != 0x69) && + (channelId != 0x6A) && + (channelId != 0x6B) && + (channelId != 0x6C) && + (channelId != 0x6D) && + (channelId != 0x6E) && + (channelId != 0x6F) && + (channelId != 0x70) && + (channelId != 0x71) && + (channelId != 0x72) && + (channelId != 0x73) && + (channelId != 0x74) && + (channelId != 0x75) && + (channelId != 0x76) && + (channelId != 0x77) && + (channelId != 0x78) && + (channelId != 0x79) && + (channelId != 0x7A) && + (channelId != 0x7B) && + (channelId != 0x7C) && + (channelId != 0x7D) && + (channelId != 0x7E) && + (channelId != 0x7F) && + (channelId != 0x80) && + (channelId != 0x81) && + (channelId != 0x82) && + (channelId != 0x83) && + (channelId != 0x84) && + (channelId != 0x85) && + (channelId != 0x86) && + (channelId != 0x87) && + (channelId != 0x88) && + (channelId != 0x89) && + (channelId != 0x8A) && + (channelId != 0x8B) && + (channelId != 0x8C) && + (channelId != 0x8D) && + (channelId != 0x8E) && + (channelId != 0x8F) && + (channelId != 0x90) && + (channelId != 0x91) && + (channelId != 0x92) && + (channelId != 0x93) && + (channelId != 0x94) && + (channelId != 0x95) && + (channelId != 0x96) && + (channelId != 0x97) && + (channelId != 0x98) && + (channelId != 0x99) && + (channelId != 0x9A) && + (channelId != 0x9B) && + (channelId != 0x9C) && + (channelId != 0x9D) && + (channelId != 0x9E) && + (channelId != 0x9F) && + (channelId != 0xA0) && + (channelId != 0xA1) && + (channelId != 0xA2) && + (channelId != 0xA3) && + (channelId != 0xA4) && + (channelId != 0xA5) && + (channelId != 0xA6) && + (channelId != 0xA7) && + (channelId != 0xA8) && + (channelId != 0xA9) && + (channelId != 0xAA) && + (channelId != 0xAB) && + (channelId != 0xAC) && + (channelId != 0xAD) && + (channelId != 0xAE) && + (channelId != 0xAF) && + (channelId != 0xB0) && + (channelId != 0xB1) && + (channelId != 0xB2) && + (channelId != 0xB3) && + (channelId != 0xB4) && + (channelId != 0xB5) && + (channelId != 0xB6) && + (channelId != 0xB7) && + (channelId != 0xB8) && + (channelId != 0xB9) && + (channelId != 0xBA) && + (channelId != 0xBB) && + (channelId != 0xBC) && + (channelId != 0xBD) && + (channelId != 0xBE) && + (channelId != 0xBF) && + (channelId != 0xC0) && + (channelId != 0xC1) && + (channelId != 0xC2) && + (channelId != 0xC3) && + (channelId != 0xC4) && + (channelId != 0xC5) && + (channelId != 0xC6) && + (channelId != 0xC7) && + (channelId != 0xC8) && + (channelId != 0xC9) && + (channelId != 0xCA) && + (channelId != 0xCB) && + (channelId != 0xCC) && + (channelId != 0xCD) && + (channelId != 0xCE) && + (channelId != 0xCF) && + (channelId != 0xD0) && + (channelId != 0xD1) && + (channelId != 0xD2) && + (channelId != 0xD3) && + (channelId != 0xD4) && + (channelId != 0xD5) && + (channelId != 0xD6) && + (channelId != 0xD7) && + (channelId != 0xD8) && + (channelId != 0xD9) && + (channelId != 0xDA) && + (channelId != 0xDB) && + (channelId != 0xDC) && + (channelId != 0xDD) && + (channelId != 0xDE) && + (channelId != 0xDF) && + (channelId != 0xE0) && + (channelId != 0xE1) && + (channelId != 0xE2) && + (channelId != 0xE3) && + (channelId != 0xE4) && + (channelId != 0xE5) && + (channelId != 0xE6) && + (channelId != 0xE7) && + (channelId != 0xE8) && + (channelId != 0xE9) && + (channelId != 0xEA) && + (channelId != 0xEB) && + (channelId != 0xEC) && + (channelId != 0xED) && + (channelId != 0xEE) && + (channelId != 0xEF) && + (channelId != 0xF0) && + (channelId != 0xF1) && + (channelId != 0xF2) && + (channelId != 0xF3) && + (channelId != 0xF4) && + (channelId != 0xF5) && + (channelId != 0xF6) && + (channelId != 0xF7) && + (channelId != 0xF8) && + (channelId != 0xF9) && + (channelId != 0xFA) && + (channelId != 0xFB) && + (channelId != 0xFC) && + (channelId != 0xFD) && + (channelId != 0xFE) && + (channelId != 0xFF) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_Core_ScratchReg_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x200 + channelId * 1U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Spi1En_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Spi1En_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Spi1En_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x15U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Spi1En_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Spi1En_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x15U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SpDbgGlobalResume_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_SpDbgGlobalResume_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_SpDbgGlobalResume_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x300U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_StreamProcGpioPinMask_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint32_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 16777215U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_StreamProcGpioPinMask_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_StreamProcGpioPinMask_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x317), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x318), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x319), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_StreamProcGpioPinMask_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint32_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint32_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_StreamProcGpioPinMask_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x317U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x318U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x319U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 16); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SyncInLvdsPnInvert_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_SyncInLvdsPnInvert_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x183U), + &bfValueTmp, + 0x38U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 3); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SyncInLvdsSelectCmosUnselect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_SyncInLvdsSelectCmosUnselect_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x183U), + &bfValueTmp, + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SyncOut0CmosTxDriveStrength_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_SyncOut0CmosTxDriveStrength_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x186U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SyncOut1CmosTxDriveStrength_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_SyncOut1CmosTxDriveStrength_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x186U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SyncOutLvdsAndCmosEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_SyncOutLvdsAndCmosEnable_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x185U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SyncOutLvdsPnInvert_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_SyncOutLvdsPnInvert_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x185U), + &bfValueTmp, + 0xCU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx0AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx0AttenS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx0AttenS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1B3), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1B4), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx0AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx0AttenS0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1B3U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1B4U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx0AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx0AttenS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx0AttenS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1B5), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1B6), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx0AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx0AttenS1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1B5U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1B6U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx0AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx0AttenUpdateS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx0AttenUpdateS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D3U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx0AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx0AttenUpdateS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx0AttenUpdateS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D4U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx1AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx1AttenS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx1AttenS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1B7), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1B8), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx1AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx1AttenS0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1B7U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1B8U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx1AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx1AttenS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx1AttenS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1B9), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1BA), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx1AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx1AttenS1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1B9U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1BAU), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx1AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx1AttenUpdateS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx1AttenUpdateS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D3U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx1AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx1AttenUpdateS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx1AttenUpdateS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D4U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx2AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx2AttenS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx2AttenS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1BB), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1BC), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx2AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx2AttenS0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1BBU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1BCU), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx2AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx2AttenS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx2AttenS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1BD), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1BE), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx2AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx2AttenS1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1BDU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1BEU), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx2AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx2AttenUpdateS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx2AttenUpdateS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D3U), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx2AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx2AttenUpdateS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx2AttenUpdateS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D4U), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx3AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx3AttenS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx3AttenS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1BF), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1C0), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx3AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx3AttenS0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1BFU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1C0U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx3AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx3AttenS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx3AttenS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1C1), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1C2), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx3AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx3AttenS1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1C1U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1C2U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx3AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx3AttenUpdateS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx3AttenUpdateS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D3U), + ((uint32_t) bfValue << 3), + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx3AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx3AttenUpdateS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx3AttenUpdateS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D4U), + ((uint32_t) bfValue << 3), + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx4AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx4AttenS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx4AttenS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1C3), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1C4), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx4AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx4AttenS0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1C3U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1C4U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx4AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx4AttenS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx4AttenS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1C5), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1C6), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx4AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx4AttenS1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1C5U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1C6U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx4AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx4AttenUpdateS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx4AttenUpdateS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D3U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx4AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx4AttenUpdateS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx4AttenUpdateS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D4U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx5AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx5AttenS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx5AttenS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1C7), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1C8), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx5AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx5AttenS0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1C7U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1C8U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx5AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx5AttenS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx5AttenS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1C9), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1CA), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx5AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx5AttenS1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1C9U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1CAU), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx5AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx5AttenUpdateS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx5AttenUpdateS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D3U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx5AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx5AttenUpdateS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx5AttenUpdateS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D4U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx6AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx6AttenS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx6AttenS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1CB), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1CC), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx6AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx6AttenS0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1CBU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1CCU), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx6AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx6AttenS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx6AttenS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1CD), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1CE), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx6AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx6AttenS1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1CDU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1CEU), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx6AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx6AttenUpdateS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx6AttenUpdateS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D3U), + ((uint32_t) bfValue << 6), + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx6AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx6AttenUpdateS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx6AttenUpdateS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D4U), + ((uint32_t) bfValue << 6), + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx7AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx7AttenS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx7AttenS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1CF), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D0), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx7AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx7AttenS0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1CFU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1D0U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx7AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx7AttenS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx7AttenS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D1), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D2), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx7AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx7AttenS1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1D1U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1D2U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx7AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx7AttenUpdateS0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx7AttenUpdateS0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D3U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx7AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_Tx7AttenUpdateS1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_Tx7AttenUpdateS1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1D4U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_TxAttenUpdCoreSpi_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_TxAttenUpdCoreSpi_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_TxAttenUpdCoreSpi_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1E7U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_TxAttenUpdCoreSpiEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_TxAttenUpdCoreSpiEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_TxAttenUpdCoreSpiEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1E6U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_TxAttenUpdCoreSpiEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_TxAttenUpdCoreSpiEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1E6U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_UseDeviceClkAsHsdigclk_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Core_UseDeviceClkAsHsdigclk_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_UseDeviceClkAsHsdigclk_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x19U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_VendorId_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Core_VendorId_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xCU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xDU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_core.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_core.h new file mode 100644 index 0000000000000..6089953951c8a --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_core.h @@ -0,0 +1,2053 @@ +/** + * \file adrv903x_bf_core.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_CORE_H_ +#define _ADRV903X_BF_CORE_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_core_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_AhbSpiBridgeEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm0M3Run_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm0M3Run_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm0MemHrespMask_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm0Spi0Command_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm0Spi0CommandBusy_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm0Spi0ExtCmdByte1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Arm1Spi0CommandBusy_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ArmClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ArmClkDivideRatioDevClk_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ArmClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DataFromControlOutSel9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DevclkBufferEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DevclkBuffTermEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DevclkDividerMcsResetb_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DevclkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DigitalClockDividerSyncEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_DigitalClockPowerUp_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_EfuseProductId_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_EfuseProductIdReady_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_EfuseReadData_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint32_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_EfuseReadDataValid_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_EfuseReadState_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogFromMaster_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogFromMasterClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogFromMasterToggle_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl10_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl11_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl12_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl13_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl14_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl15_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl8_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControl9_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControlOverride_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSourceControlOverride_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioAnalogSpiRead_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioFromMaster_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint32_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioFromMasterClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint32_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioFromMasterToggle_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint32_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl10_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl11_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl12_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl13_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl14_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl15_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl16_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl17_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl18_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl19_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl20_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl21_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl22_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl23_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl8_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControl9_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControlOverride_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint32_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceControlOverride_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint32_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceOrxControl9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceRxControl9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSourceTxControl9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpioSpiRead_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint32_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsLevelPulseBLowerWord_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsLevelPulseBLowerWord_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsLevelPulseBUpperWord_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsLevelPulseBUpperWord_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskLowerWordPin0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskLowerWordPin0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskLowerWordPin1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskLowerWordPin1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsStatusLowerWord_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsStatusLowerWord_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsStatusUpperWord_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint64_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_GpInterruptsStatusUpperWord_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint64_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MaskRevisionMajor_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MaskRevisionMinor_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MasterBiasClkDivRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MbiasBgCtat_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MbiasBgPtat_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MbiasIgenPd_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MbiasRtrimResetb_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_MbiasTrimCompPd_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_McsStatus_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_McsStatus_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadDs3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadSt_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_PadSt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrx0Map_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrx1Map_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxonReadback_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxArmModeSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxArmModeSelClr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxSpiEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxSpiEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxSpiModeSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceOrxSpiModeSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxonReadback_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxAntEnPin7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxArmModeSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxArmModeSelClr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxEnPin7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxSpiEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxSpiEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxSpiModeSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceRxSpiModeSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxonReadback_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxAntEnPin7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxArmModeSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxArmModeSelClr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxEnPin7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxSpiEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxSpiEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxSpiModeSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_RadioControlInterfaceTxSpiModeSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ScratchPadWord_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ScratchPadWord_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ScratchReg_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_ScratchReg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Spi1En_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Spi1En_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SpDbgGlobalResume_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_StreamProcGpioPinMask_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint32_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_StreamProcGpioPinMask_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint32_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SyncInLvdsPnInvert_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SyncInLvdsSelectCmosUnselect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SyncOut0CmosTxDriveStrength_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SyncOut1CmosTxDriveStrength_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SyncOutLvdsAndCmosEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_SyncOutLvdsPnInvert_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx0AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx0AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx0AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx0AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx0AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx0AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx1AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx1AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx1AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx1AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx1AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx1AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx2AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx2AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx2AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx2AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx2AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx2AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx3AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx3AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx3AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx3AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx3AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx3AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx4AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx4AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx4AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx4AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx4AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx4AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx5AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx5AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx5AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx5AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx5AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx5AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx6AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx6AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx6AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx6AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx6AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx6AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx7AttenS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx7AttenS0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx7AttenS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx7AttenS1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx7AttenUpdateS0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_Tx7AttenUpdateS1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_TxAttenUpdCoreSpi_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_TxAttenUpdCoreSpiEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_TxAttenUpdCoreSpiEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_UseDeviceClkAsHsdigclk_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Core_VendorId_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +#endif // _ADRV903X_BF_CORE_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_core_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_core_types.h new file mode 100644 index 0000000000000..16128fb2193f6 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_core_types.h @@ -0,0 +1,50 @@ +/** + * \file adrv903x_bf_core_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_CORE_TYPES_H_ +#define _ADRV903X_BF_CORE_TYPES_H_ + +typedef enum adrv903x_BfCoreChanAddr +{ + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS = 0x47000000 +} adrv903x_BfCoreChanAddr_e; + +/** + * \brief Enumeration for l1mem0SharedBankDiv + */ + +typedef enum adrv903x_Bf_Core_L1mem0SharedBankDiv +{ + ADRV903X_BF_CORE_L1MEM0_SHARED_BANK_DIV_ENUM000 = 0, /*!< IRAM_288K DRAM_288K */ + ADRV903X_BF_CORE_L1MEM0_SHARED_BANK_DIV_ENUM001 = 1, /*!< IRAM_224K DRAM_352K */ + ADRV903X_BF_CORE_L1MEM0_SHARED_BANK_DIV_ENUM002 = 2, /*!< IRAM_256K DRAM_320K */ + ADRV903X_BF_CORE_L1MEM0_SHARED_BANK_DIV_ENUM003 = 3, /*!< IRAM_320K DRAM_256K */ + ADRV903X_BF_CORE_L1MEM0_SHARED_BANK_DIV_ENUM004 = 4 /*!< IRAM_352K DRAM_224K */ +} adrv903x_Bf_Core_L1mem0SharedBankDiv_e; + +/** + * \brief Enumeration for l1mem1SharedBankDiv + */ + +typedef enum adrv903x_Bf_Core_L1mem1SharedBankDiv +{ + ADRV903X_BF_CORE_L1MEM1_SHARED_BANK_DIV_ENUM000 = 0, /*!< IRAM_288K DRAM_288K */ + ADRV903X_BF_CORE_L1MEM1_SHARED_BANK_DIV_ENUM001 = 1, /*!< IRAM_224K DRAM_352K */ + ADRV903X_BF_CORE_L1MEM1_SHARED_BANK_DIV_ENUM002 = 2, /*!< IRAM_256K DRAM_320K */ + ADRV903X_BF_CORE_L1MEM1_SHARED_BANK_DIV_ENUM003 = 3, /*!< IRAM_320K DRAM_256K */ + ADRV903X_BF_CORE_L1MEM1_SHARED_BANK_DIV_ENUM004 = 4 /*!< IRAM_352K DRAM_224K */ +} adrv903x_Bf_Core_L1mem1SharedBankDiv_e; + +#endif // _ADRV903X_BF_CORE_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_error_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_error_types.h new file mode 100644 index 0000000000000..3b7f451fc0f39 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_error_types.h @@ -0,0 +1,115 @@ +/** + * \file adrv903x_bf_error_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_ERROR_TYPES_H_ +#define _ADRV903X_BF_ERROR_TYPES_H_ + +typedef enum +{ + ADI_ADRV903X_FILE_PRIVATE_BF_TOP = 200U, + ADI_ADRV903X_FILE_PRIVATE_BF_ARM_MEM = 201U, + ADI_ADRV903X_FILE_PRIVATE_BF_TIMER = 202U, + ADI_ADRV903X_FILE_PRIVATE_BF_DIGITAL_CORE = 203U, + ADI_ADRV903X_FILE_PRIVATE_BF_WATCHDOG_TIMER = 204U, + ADI_ADRV903X_FILE_PRIVATE_BF_SPI_PM_KEY = 205U, + ADI_ADRV903X_FILE_PRIVATE_BF_INTERRUPT_AGGREGATOR = 206U, + ADI_ADRV903X_FILE_PRIVATE_BF_MAILBOX = 207U, + ADI_ADRV903X_FILE_PRIVATE_BF_C2C_MAILBOX_SRC = 208U, + ADI_ADRV903X_FILE_PRIVATE_BF_C2C_MAILBOX_DST = 209U, + ADI_ADRV903X_FILE_PRIVATE_BF_UARTFIFO = 210U, + ADI_ADRV903X_FILE_PRIVATE_BF_UART = 211U, + ADI_ADRV903X_FILE_PRIVATE_BF_SPI_MASTER = 212U, + ADI_ADRV903X_FILE_PRIVATE_BF_ITM = 213U, + ADI_ADRV903X_FILE_PRIVATE_BF_TELEMETRY = 214U, + ADI_ADRV903X_FILE_PRIVATE_BF_SEMAPHORE = 215U, + ADI_ADRV903X_FILE_PRIVATE_BF_SNOOPER = 216U, + ADI_ADRV903X_FILE_PRIVATE_BF_INTERRUPT_TRANSMUTER = 217U, + ADI_ADRV903X_FILE_PRIVATE_BF_AHB_ARM_DAP_REGS = 218U, + ADI_ADRV903X_FILE_PRIVATE_BF_STREAMPROC = 219U, + ADI_ADRV903X_FILE_PRIVATE_BF_CORE = 220U, + ADI_ADRV903X_FILE_PRIVATE_BF_PLL_MEM_MAP = 221U, + ADI_ADRV903X_FILE_PRIVATE_BF_RC_TUNER_ANALOG = 222U, + ADI_ADRV903X_FILE_PRIVATE_BF_JESD_COMMON = 223U, + ADI_ADRV903X_FILE_PRIVATE_BF_JESD = 224U, + ADI_ADRV903X_FILE_PRIVATE_BF_JRX_LINK = 225U, + ADI_ADRV903X_FILE_PRIVATE_BF_JTX_LINK = 226U, + ADI_ADRV903X_FILE_PRIVATE_BF_SERDES_TXDIG_PHY_REGMAP_CORE1P2 = 227U, + ADI_ADRV903X_FILE_PRIVATE_BF_SERIALIZER = 228U, + ADI_ADRV903X_FILE_PRIVATE_BF_SERDES_TXDIG_DCC_REGMAP_CORE1P2 = 229U, + ADI_ADRV903X_FILE_PRIVATE_BF_SERDES_RXDIG_PHY_REGMAP_CORE1P2 = 230U, + ADI_ADRV903X_FILE_PRIVATE_BF_DESERIALIZER = 231U, + ADI_ADRV903X_FILE_PRIVATE_BF_SERDES_RXDIG_8PACK_REGMAP_CORE1P2 = 232U, + ADI_ADRV903X_FILE_PRIVATE_BF_MPU_REGS = 233U, + ADI_ADRV903X_FILE_PRIVATE_BF_MPU_NCO_SUBSYS_REGS = 234U, + ADI_ADRV903X_FILE_PRIVATE_BF_NCO_CTRL_REGS = 235U, + ADI_ADRV903X_FILE_PRIVATE_BF_KFA_CLF_REGS = 236U, + ADI_ADRV903X_FILE_PRIVATE_BF_KFA_TOP_REGS = 237U, + ADI_ADRV903X_FILE_PRIVATE_BF_RX_SLICE = 238U, + ADI_ADRV903X_FILE_PRIVATE_BF_RX_SLICE_AHB = 239U, + ADI_ADRV903X_FILE_PRIVATE_BF_STREAMPROC_CHANNEL = 240U, + ADI_ADRV903X_FILE_PRIVATE_BF_RX_FUNCS = 241U, + ADI_ADRV903X_FILE_PRIVATE_BF_RX_DIG = 242U, + ADI_ADRV903X_FILE_PRIVATE_BF_RX_RFDC = 243U, + ADI_ADRV903X_FILE_PRIVATE_BF_RX_DDC = 244U, + ADI_ADRV903X_FILE_PRIVATE_BF_RX_ANALOG_FE = 245U, + ADI_ADRV903X_FILE_PRIVATE_BF_TDR_ANA_REGMAP = 246U, + ADI_ADRV903X_FILE_PRIVATE_BF_TDR_8B_TOP = 247U, + ADI_ADRV903X_FILE_PRIVATE_BF_TDR_STGV_SHARED = 248U, + ADI_ADRV903X_FILE_PRIVATE_BF_TDR_STG1_SHARED = 249U, + ADI_ADRV903X_FILE_PRIVATE_BF_TDR_DPATH_TOP = 250U, + ADI_ADRV903X_FILE_PRIVATE_BF_TDR_DIG_MISC = 251U, + ADI_ADRV903X_FILE_PRIVATE_BF_TDR_VCO_CAL = 252U, + ADI_ADRV903X_FILE_PRIVATE_BF_TDR_32B_TOP = 253U, + ADI_ADRV903X_FILE_PRIVATE_BF_TX_SLICE = 254U, + ADI_ADRV903X_FILE_PRIVATE_BF_TX_SLICE_AHB = 255U, + ADI_ADRV903X_FILE_PRIVATE_BF_TX_DIG = 256U, + ADI_ADRV903X_FILE_PRIVATE_BF_TX_DATAPATH = 257U, + ADI_ADRV903X_FILE_PRIVATE_BF_TX_FUNCS = 258U, + ADI_ADRV903X_FILE_PRIVATE_BF_TX_BAND_DUC = 259U, + ADI_ADRV903X_FILE_PRIVATE_BF_TX_LOOPBACK = 260U, + ADI_ADRV903X_FILE_PRIVATE_BF_TX_LOL = 261U, + ADI_ADRV903X_FILE_PRIVATE_BF_TX_FSC = 262U, + ADI_ADRV903X_FILE_PRIVATE_BF_TX_ANALOG = 263U, + ADI_ADRV903X_FILE_PRIVATE_BF_TX_ANALOG_DAC = 264U, + ADI_ADRV903X_FILE_PRIVATE_BF_TX_ANALOG_LO_GEN = 265U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_TXLB_DCAL_REGMAP = 266U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_TXLB_REG32_TOP = 267U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_TXLB_SCAL_REGMAP_BROADCAST = 268U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_TXLB_SCAL_REGMAP = 269U, + ADI_ADRV903X_FILE_PRIVATE_BF_ACTRL_TXLB_SLICE_REGMAP_BROADCAST = 270U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_TXLB_REG8_TOP = 271U, + ADI_ADRV903X_FILE_PRIVATE_BF_ACTRL_TXLB_SLICE_REGMAP = 272U, + ADI_ADRV903X_FILE_PRIVATE_BF_ACTRL_TXLB_WEST_REGMAP = 273U, + ADI_ADRV903X_FILE_PRIVATE_BF_ACTRL_TXLB_EAST_REGMAP = 274U, + ADI_ADRV903X_FILE_PRIVATE_BF_ORX_SLICE = 275U, + ADI_ADRV903X_FILE_PRIVATE_BF_ORX_SLICE_AHB = 276U, + ADI_ADRV903X_FILE_PRIVATE_BF_ORX_DIG = 277U, + ADI_ADRV903X_FILE_PRIVATE_BF_ORX_LOL = 278U, + ADI_ADRV903X_FILE_PRIVATE_BF_ACTRL_ORX_SLICE_REGMAP_BROADCAST = 279U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_ORX_REG8_TOP = 280U, + ADI_ADRV903X_FILE_PRIVATE_BF_ACTRL_ORX_SLICE_REGMAP = 281U, + ADI_ADRV903X_FILE_PRIVATE_BF_ACTRL_ORX_WEST_REGMAP = 282U, + ADI_ADRV903X_FILE_PRIVATE_BF_ACTRL_ORX_EAST_REGMAP = 283U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_ORX_DCAL_REGMAP = 284U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_ORX_REG32_TOP = 285U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_ORX_SCAL_REGMAP_BROADCAST = 286U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_ORX_SCAL_REGMAP = 287U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_ORX_FCAL_REGMAP_BROADCAST = 288U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_ORX_FCAL_REGMAP = 289U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_ORX_ICAL_REGMAP_BROADCAST = 290U, + ADI_ADRV903X_FILE_PRIVATE_BF_VENUS_ORX_ICAL_REGMAP = 291U +} adrv903x_File_e; + +#endif // _ADRV903X_BF_ERROR_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jesd_common.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jesd_common.c new file mode 100644 index 0000000000000..e3424a2a5dd00 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jesd_common.c @@ -0,0 +1,4360 @@ +/** + * \file adrv903x_bf_jesd_common.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_jesd_common.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_JESD_COMMON + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxCrcErrCntThreshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxCrcErrCntThreshold_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxCrcErrCntThreshold_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x116U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bBde_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bBde_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bBde_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3A0 + channelId * 4U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bBdCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bBdCnt_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bBdCnt_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3A1 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bCgs_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bCgs_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bCgs_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3A0 + channelId * 4U), + &bfValueTmp, + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 1); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bCks_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bCks_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bCks_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3A0 + channelId * 4U), + &bfValueTmp, + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEcntEna_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxDl204bEcntEna_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bEcntEna_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bEcntEna_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x320 + channelId * 4U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEcntEna_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bEcntEna_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bEcntEna_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x320 + channelId * 4U), + &bfValueTmp, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEcntRst_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxDl204bEcntRst_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bEcntRst_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bEcntRst_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x320 + channelId * 4U), + ((uint32_t) bfValue << 4), + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEcntTch_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxDl204bEcntTch_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bEcntTch_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bEcntTch_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x321 + channelId * 4U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEcntTch_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bEcntTch_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bEcntTch_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x321 + channelId * 4U), + &bfValueTmp, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEofEvent_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bEofEvent_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bEofEvent_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x423 + channelId * 4U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEomfEvent_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bEomfEvent_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bEomfEvent_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x423 + channelId * 4U), + &bfValueTmp, + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 1); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEth_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxDl204bEth_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bEth_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x11CU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bFs_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bFs_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bFs_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3A0 + channelId * 4U), + &bfValueTmp, + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 3); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bFsLost_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bFsLost_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bFsLost_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x423 + channelId * 4U), + &bfValueTmp, + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bIld_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bIld_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bIld_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3A0 + channelId * 4U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bIls_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bIls_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bIls_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3A0 + channelId * 4U), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bIrqClr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxDl204bIrqClr_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bIrqClr_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x11A), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x11B), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bIrqClr_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bIrqClr_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x11AU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x11BU), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bIrqVec_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bIrqVec_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bIrqVec_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4A0 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4A1 + channelId * 4U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg0_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x120 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg1_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg1_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x121 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg10_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg10_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg10_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x222 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg13_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg13_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg13_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x2A1 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg2_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg2_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x122 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg3_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg3_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x123 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg4_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg4_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1A0 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg5_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg5_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1A1 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg6_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg6_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1A2 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg7_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg7_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1A3 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg8_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg8_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg8_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x220 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg9_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg9_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bL0Rxcfg9_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x221 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bNit_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bNit_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bNit_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3A0 + channelId * 4U), + &bfValueTmp, + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bNitCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bNitCnt_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bNitCnt_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3A3 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bSyncN_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bSyncN_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bSyncN_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x423 + channelId * 4U), + &bfValueTmp, + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 3); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bUek_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bUek_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bUek_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3A0 + channelId * 4U), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bUekCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bUekCnt_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bUekCnt_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3A2 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bUserData_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204bUserData_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204bUserData_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x423 + channelId * 4U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cClrErrCnt_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxDl204cClrErrCnt_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204cClrErrCnt_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x520U), + ((uint32_t) bfValue << 3), + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cCrcErrCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204cCrcErrCnt_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204cCrcErrCnt_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x5A9 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cEmbErrCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204cEmbErrCnt_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204cEmbErrCnt_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x5AA + channelId * 4U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cHoldErrCnt_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxDl204cHoldErrCnt_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204cHoldErrCnt_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x520U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cMbErrCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204cMbErrCnt_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204cMbErrCnt_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x5AA + channelId * 4U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cShErrCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204cShErrCnt_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204cShErrCnt_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x52A + channelId * 4U), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cState_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxDl204cState_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxDl204cState_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x529 + channelId * 4U), + &bfValueTmp, + 0xE0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxLaneLoopback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxLaneLoopback_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxLaneLoopback_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x114U), + ((uint32_t) bfValue << 3), + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxLinkEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxLinkEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxLinkEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x114U), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxLinkEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxLinkEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x114U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxSampleLoopback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxSampleLoopback_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxSampleLoopback_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x114U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxSampleLoopback_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxSampleLoopback_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x114U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestLaneClearErrors_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxTestLaneClearErrors_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestLaneClearErrors_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xCU), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestLaneErrorCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint32_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint32_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestLaneErrorCount_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxTestLaneErrorCount_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x11 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x12 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x13 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 16); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestLaneErrorFlag_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestLaneErrorFlag_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxTestLaneErrorFlag_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x10 + channelId * 4U), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestLaneInv_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestLaneInv_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxTestLaneInv_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x10 + channelId * 4U), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestLaneInvalidDataFlag_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestLaneInvalidDataFlag_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JesdCommon_JrxTestLaneInvalidDataFlag_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x10 + channelId * 4U), + &bfValueTmp, + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestLaneUpdateErrorCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxTestLaneUpdateErrorCount_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestLaneUpdateErrorCount_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xCU), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxTestMode_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestMode_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xEU), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestMode_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xEU), + &bfValueTmp, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestSampleClearErrors_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestSampleClearErrors_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xCU), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestSampleErrorCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestSampleErrorCount_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xDU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestSampleErrorFlag_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestSampleErrorFlag_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xCU), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestSampleUpdateErrorCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxTestSampleUpdateErrorCount_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestSampleUpdateErrorCount_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xCU), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestSource_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JrxTestSource_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestSource_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xEU), + ((uint32_t) bfValue << 3), + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestSource_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JrxTestSource_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xEU), + &bfValueTmp, + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 3); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JtxLinkEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JtxLinkEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JtxLinkEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x5F0U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JtxLinkEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JtxLinkEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x5F0U), + &bfValueTmp, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JtxSampleLoopback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JesdCommon_JtxSampleLoopback_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JtxSampleLoopback_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x5F0U), + ((uint32_t) bfValue << 4), + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JtxSampleLoopback_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JesdCommon_JtxSampleLoopback_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x5F0U), + &bfValueTmp, + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jesd_common.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jesd_common.h new file mode 100644 index 0000000000000..5b654166a126d --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jesd_common.h @@ -0,0 +1,414 @@ +/** + * \file adrv903x_bf_jesd_common.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_JESD_COMMON_H_ +#define _ADRV903X_BF_JESD_COMMON_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_jesd_common_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxCrcErrCntThreshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bBde_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bBdCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bCgs_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bCks_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEcntEna_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEcntEna_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEcntRst_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEcntTch_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEcntTch_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEofEvent_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEomfEvent_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bEth_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bFs_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bFsLost_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bIld_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bIls_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bIrqClr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bIrqClr_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bIrqVec_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg1_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg10_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg13_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg2_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg3_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg4_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg5_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg6_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg7_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg8_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bL0Rxcfg9_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bNit_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bNitCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bSyncN_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bUek_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bUekCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204bUserData_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cClrErrCnt_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cCrcErrCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cEmbErrCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cHoldErrCnt_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cMbErrCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cShErrCnt_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxDl204cState_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxLaneLoopback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxLinkEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxLinkEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxSampleLoopback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxSampleLoopback_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestLaneClearErrors_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestLaneErrorCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint32_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestLaneErrorFlag_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestLaneInv_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestLaneInvalidDataFlag_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestLaneUpdateErrorCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestSampleClearErrors_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestSampleErrorCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestSampleErrorFlag_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestSampleUpdateErrorCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestSource_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JrxTestSource_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JtxLinkEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JtxLinkEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JtxSampleLoopback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JesdCommon_JtxSampleLoopback_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJesdCommonChanAddr_e baseAddr, + uint8_t* const bfValue); + +#endif // _ADRV903X_BF_JESD_COMMON_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jesd_common_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jesd_common_types.h new file mode 100644 index 0000000000000..89334807665dc --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jesd_common_types.h @@ -0,0 +1,24 @@ +/** + * \file adrv903x_bf_jesd_common_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_JESD_COMMON_TYPES_H_ +#define _ADRV903X_BF_JESD_COMMON_TYPES_H_ + +typedef enum adrv903x_BfJesdCommonChanAddr +{ + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON = 0x48000000 +} adrv903x_BfJesdCommonChanAddr_e; + +#endif // _ADRV903X_BF_JESD_COMMON_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jrx_link.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jrx_link.c new file mode 100644 index 0000000000000..fe3afb36b6d02 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jrx_link.c @@ -0,0 +1,2385 @@ +/** + * \file adrv903x_bf_jrx_link.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_jrx_link.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_JRX_LINK + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreBufDepth_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreBufDepth_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xA5U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreChksumCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreChksumCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JrxLink_JrxCoreChksumCfg_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xD4 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreClearSyncNeCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JrxLink_JrxCoreClearSyncNeCount_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreClearSyncNeCount_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x0U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreConvSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 127U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JrxLink_JrxCoreConvSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreConvSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) && + (channelId != 0x8) && + (channelId != 0x9) && + (channelId != 0xA) && + (channelId != 0xB) && + (channelId != 0xC) && + (channelId != 0xD) && + (channelId != 0xE) && + (channelId != 0xF) && + (channelId != 0x10) && + (channelId != 0x11) && + (channelId != 0x12) && + (channelId != 0x13) && + (channelId != 0x14) && + (channelId != 0x15) && + (channelId != 0x16) && + (channelId != 0x17) && + (channelId != 0x18) && + (channelId != 0x19) && + (channelId != 0x1A) && + (channelId != 0x1B) && + (channelId != 0x1C) && + (channelId != 0x1D) && + (channelId != 0x1E) && + (channelId != 0x1F) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JrxLink_JrxCoreConvSel_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4 + channelId * 4U), + (uint32_t) bfValue, + 0x7FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreConvSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreConvSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) && + (channelId != 0x8) && + (channelId != 0x9) && + (channelId != 0xA) && + (channelId != 0xB) && + (channelId != 0xC) && + (channelId != 0xD) && + (channelId != 0xE) && + (channelId != 0xF) && + (channelId != 0x10) && + (channelId != 0x11) && + (channelId != 0x12) && + (channelId != 0x13) && + (channelId != 0x14) && + (channelId != 0x15) && + (channelId != 0x16) && + (channelId != 0x17) && + (channelId != 0x18) && + (channelId != 0x19) && + (channelId != 0x1A) && + (channelId != 0x1B) && + (channelId != 0x1C) && + (channelId != 0x1D) && + (channelId != 0x1E) && + (channelId != 0x1F) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JrxLink_JrxCoreConvSel_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4 + channelId * 4U), + &bfValueTmp, + 0x7FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreCsCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreCsCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xD1U), + &bfValueTmp, + 0xC0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreDidCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreDidCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xACU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreDscrCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreDscrCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xADU), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreECfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreECfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xF5U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreFCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreFCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xAEU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreHdCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreHdCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xD1U), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreJesdvCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreJesdvCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xD3U), + &bfValueTmp, + 0xE0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreKCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreKCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xAFU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreLaneSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreLaneSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JrxLink_JrxCoreLaneSel_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x84 + channelId * 4U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreLidCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreLidCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JrxLink_JrxCoreLidCfg_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xB0 + channelId * 4U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreLCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreLCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xADU), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreMCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreMCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xD0U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreNpCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreNpCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xD2U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreNCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreNCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xD1U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePclkErrorClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JrxLink_JrxCorePclkErrorClear_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCorePclkErrorClear_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x0U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePclkErrorClear_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCorePclkErrorClear_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x0U), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePclkFastError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCorePclkFastError_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JrxLink_JrxCorePclkFastError_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x84 + channelId * 4U), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePclkSlowError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCorePclkSlowError_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JrxLink_JrxCorePclkSlowError_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x84 + channelId * 4U), + &bfValueTmp, + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePhaseAdjust_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 65535U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JrxLink_JrxCorePhaseAdjust_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCorePhaseAdjust_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePhaseAdjust_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCorePhaseAdjust_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x2U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePhaseDiff_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCorePhaseDiff_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xA6U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xA7U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSubclassvCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSubclassvCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xD2U), + &bfValueTmp, + 0xE0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSyncNeCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSyncNeCount_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xA4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSyncNSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSyncNSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefClrPhaseErr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JrxLink_JrxCoreSysrefClrPhaseErr_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSysrefClrPhaseErr_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xA8U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefClrPhaseErr_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSysrefClrPhaseErr_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xA8U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JrxLink_JrxCoreSysrefEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSysrefEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xA8U), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSysrefEnable_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xA8U), + &bfValueTmp, + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefForRelink_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSysrefForRelink_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x0U), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefForStartup_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSysrefForStartup_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x0U), + &bfValueTmp, + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefIgnoreWhenLinked_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSysrefIgnoreWhenLinked_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xA8U), + &bfValueTmp, + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 1); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefNShotCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSysrefNShotCount_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xA9U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefNShotEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSysrefNShotEnable_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xA9U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefRcvd_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSysrefRcvd_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xAAU), + &bfValueTmp, + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreSCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xD3U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreUsrDataRdy_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxCoreUsrDataRdy_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xAAU), + &bfValueTmp, + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 1); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxLinkType_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxLinkType_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x0U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxTplBufDepth_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JrxLink_JrxTplBufDepth_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JrxLink_JrxTplBufDepth_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x87 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jrx_link.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jrx_link.h new file mode 100644 index 0000000000000..490b8270aab5d --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jrx_link.h @@ -0,0 +1,254 @@ +/** + * \file adrv903x_bf_jrx_link.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_JRX_LINK_H_ +#define _ADRV903X_BF_JRX_LINK_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_jrx_link_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreBufDepth_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreChksumCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreClearSyncNeCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreConvSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreConvSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreCsCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreDidCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreDscrCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreECfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreFCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreHdCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreJesdvCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreKCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreLaneSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreLidCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreLCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreMCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreNpCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreNCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePclkErrorClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePclkErrorClear_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePclkFastError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePclkSlowError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePhaseAdjust_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePhaseAdjust_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCorePhaseDiff_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSubclassvCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSyncNeCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSyncNSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefClrPhaseErr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefClrPhaseErr_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefForRelink_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefForStartup_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefIgnoreWhenLinked_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefNShotCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefNShotEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSysrefRcvd_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreSCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxCoreUsrDataRdy_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxLinkType_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxLink_JrxTplBufDepth_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJrxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +#endif // _ADRV903X_BF_JRX_LINK_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jrx_link_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jrx_link_types.h new file mode 100644 index 0000000000000..a66ba4d64230d --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jrx_link_types.h @@ -0,0 +1,25 @@ +/** + * \file adrv903x_bf_jrx_link_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_JRX_LINK_TYPES_H_ +#define _ADRV903X_BF_JRX_LINK_TYPES_H_ + +typedef enum adrv903x_BfJrxLinkChanAddr +{ + ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_ = 0x48010000, + ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_ = 0x48020000 +} adrv903x_BfJrxLinkChanAddr_e; + +#endif // _ADRV903X_BF_JRX_LINK_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jtx_link.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jtx_link.c new file mode 100644 index 0000000000000..b026165a9a99b --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jtx_link.c @@ -0,0 +1,2703 @@ +/** + * \file adrv903x_bf_jtx_link.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_jtx_link.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_JTX_LINK + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxBidCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxBidCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x141U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxConvSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 127U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JtxLink_JtxConvSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxConvSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) && + (channelId != 0x8) && + (channelId != 0x9) && + (channelId != 0xA) && + (channelId != 0xB) && + (channelId != 0xC) && + (channelId != 0xD) && + (channelId != 0xE) && + (channelId != 0xF) && + (channelId != 0x10) && + (channelId != 0x11) && + (channelId != 0x12) && + (channelId != 0x13) && + (channelId != 0x14) && + (channelId != 0x15) && + (channelId != 0x16) && + (channelId != 0x17) && + (channelId != 0x18) && + (channelId != 0x19) && + (channelId != 0x1A) && + (channelId != 0x1B) && + (channelId != 0x1C) && + (channelId != 0x1D) && + (channelId != 0x1E) && + (channelId != 0x1F) && + (channelId != 0x20) && + (channelId != 0x21) && + (channelId != 0x22) && + (channelId != 0x23) && + (channelId != 0x24) && + (channelId != 0x25) && + (channelId != 0x26) && + (channelId != 0x27) && + (channelId != 0x28) && + (channelId != 0x29) && + (channelId != 0x2A) && + (channelId != 0x2B) && + (channelId != 0x2C) && + (channelId != 0x2D) && + (channelId != 0x2E) && + (channelId != 0x2F) && + (channelId != 0x30) && + (channelId != 0x31) && + (channelId != 0x32) && + (channelId != 0x33) && + (channelId != 0x34) && + (channelId != 0x35) && + (channelId != 0x36) && + (channelId != 0x37) && + (channelId != 0x38) && + (channelId != 0x39) && + (channelId != 0x3A) && + (channelId != 0x3B) && + (channelId != 0x3C) && + (channelId != 0x3D) && + (channelId != 0x3E) && + (channelId != 0x3F) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JtxLink_JtxConvSel_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x0 + channelId * 4U), + (uint32_t) bfValue, + 0x7FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxConvSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxConvSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) && + (channelId != 0x8) && + (channelId != 0x9) && + (channelId != 0xA) && + (channelId != 0xB) && + (channelId != 0xC) && + (channelId != 0xD) && + (channelId != 0xE) && + (channelId != 0xF) && + (channelId != 0x10) && + (channelId != 0x11) && + (channelId != 0x12) && + (channelId != 0x13) && + (channelId != 0x14) && + (channelId != 0x15) && + (channelId != 0x16) && + (channelId != 0x17) && + (channelId != 0x18) && + (channelId != 0x19) && + (channelId != 0x1A) && + (channelId != 0x1B) && + (channelId != 0x1C) && + (channelId != 0x1D) && + (channelId != 0x1E) && + (channelId != 0x1F) && + (channelId != 0x20) && + (channelId != 0x21) && + (channelId != 0x22) && + (channelId != 0x23) && + (channelId != 0x24) && + (channelId != 0x25) && + (channelId != 0x26) && + (channelId != 0x27) && + (channelId != 0x28) && + (channelId != 0x29) && + (channelId != 0x2A) && + (channelId != 0x2B) && + (channelId != 0x2C) && + (channelId != 0x2D) && + (channelId != 0x2E) && + (channelId != 0x2F) && + (channelId != 0x30) && + (channelId != 0x31) && + (channelId != 0x32) && + (channelId != 0x33) && + (channelId != 0x34) && + (channelId != 0x35) && + (channelId != 0x36) && + (channelId != 0x37) && + (channelId != 0x38) && + (channelId != 0x39) && + (channelId != 0x3A) && + (channelId != 0x3B) && + (channelId != 0x3C) && + (channelId != 0x3D) && + (channelId != 0x3E) && + (channelId != 0x3F) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JtxLink_JtxConvSel_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x0 + channelId * 4U), + &bfValueTmp, + 0x7FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDidCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxDidCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x140U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bClearSyncNeCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JtxLink_JtxDl204bClearSyncNeCount_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxDl204bClearSyncNeCount_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x173U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bState_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxDl204bState_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x174U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bSyncN_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxDl204bSyncN_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x176U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bSyncNeCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxDl204bSyncNeCount_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x175U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bSyncNForceEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JtxLink_JtxDl204bSyncNForceEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxDl204bSyncNForceEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x173U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bSyncNForceEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxDl204bSyncNForceEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x173U), + &bfValueTmp, + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 1); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bSyncNForceVal_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JtxLink_JtxDl204bSyncNForceVal_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxDl204bSyncNForceVal_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x173U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204cSysrefRcvd_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxDl204cSysrefRcvd_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1A4U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxECfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxECfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1A0U), + &bfValueTmp, + 0xF8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 3); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxForceLanePd_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxForceLanePd_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JtxLink_JtxForceLanePd_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x104 + channelId * 4U), + &bfValueTmp, + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxFCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxFCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x144U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxKCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxKCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x145U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxLaneInv_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JtxLink_JtxLaneInv_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxLaneInv_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JtxLink_JtxLaneInv_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x104 + channelId * 4U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxLaneInv_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxLaneInv_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JtxLink_JtxLaneInv_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x104 + channelId * 4U), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxLaneSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxLaneSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_JtxLink_JtxLaneSel_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x104 + channelId * 4U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxLidCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxLidCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x142U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxLinkType_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxLinkType_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x100U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxMCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxMCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x146U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxNpCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxNpCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x148U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxPclkErrorClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JtxLink_JtxPclkErrorClear_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxPclkErrorClear_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1ACU), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxPclkErrorClear_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxPclkErrorClear_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1ACU), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxPclkFastError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxPclkFastError_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1ACU), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxPclkSlowError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxPclkSlowError_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1ADU), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxScrCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxScrCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x143U), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxSyncNSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxSyncNSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x102U), + &bfValueTmp, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxSysrefForRelink_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxSysrefForRelink_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x100U), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxSysrefForStartup_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxSysrefForStartup_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x100U), + &bfValueTmp, + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxSCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxSCfg_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x149U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTestGenMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JtxLink_JtxTestGenMode_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTestGenMode_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x101U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTestGenMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTestGenMode_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x101U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTestGenSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JtxLink_JtxTestGenSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTestGenSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x101U), + ((uint32_t) bfValue << 4), + 0x30U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTestGenSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTestGenSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x101U), + &bfValueTmp, + 0x30U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplCfgInvalid_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTplCfgInvalid_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x139U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplPhaseAdjust_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 65535U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JtxLink_JtxTplPhaseAdjust_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTplPhaseAdjust_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x134), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x135), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplPhaseAdjust_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTplPhaseAdjust_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x134U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x135U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefClrPhaseErr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JtxLink_JtxTplSysrefClrPhaseErr_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTplSysrefClrPhaseErr_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x131U), + ((uint32_t) bfValue << 6), + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefClrPhaseErr_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTplSysrefClrPhaseErr_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x131U), + &bfValueTmp, + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefIgnoreWhenLinked_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTplSysrefIgnoreWhenLinked_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x131U), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefMask_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_JtxLink_JtxTplSysrefMask_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTplSysrefMask_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x131U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefMask_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTplSysrefMask_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x131U), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefNShotCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTplSysrefNShotCount_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x133U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefNShotEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTplSysrefNShotEnable_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x133U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefPhaseErr_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTplSysrefPhaseErr_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x139U), + &bfValueTmp, + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefRcvd_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_JtxLink_JtxTplSysrefRcvd_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x139U), + &bfValueTmp, + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 1); + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jtx_link.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jtx_link.h new file mode 100644 index 0000000000000..fa0932e7ed821 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jtx_link.h @@ -0,0 +1,277 @@ +/** + * \file adrv903x_bf_jtx_link.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_JTX_LINK_H_ +#define _ADRV903X_BF_JTX_LINK_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_jtx_link_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxBidCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxConvSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxConvSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDidCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bClearSyncNeCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bState_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bSyncN_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bSyncNeCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bSyncNForceEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bSyncNForceEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204bSyncNForceVal_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxDl204cSysrefRcvd_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxECfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxForceLanePd_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxFCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxKCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxLaneInv_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxLaneInv_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxLaneSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxLidCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxLinkType_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxMCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxNpCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxPclkErrorClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxPclkErrorClear_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxPclkFastError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxPclkSlowError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxScrCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxSyncNSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxSysrefForRelink_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxSysrefForStartup_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxSCfg_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTestGenMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTestGenMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTestGenSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTestGenSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplCfgInvalid_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplPhaseAdjust_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplPhaseAdjust_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefClrPhaseErr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefClrPhaseErr_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefIgnoreWhenLinked_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefMask_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefMask_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefNShotCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefNShotEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefPhaseErr_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JtxLink_JtxTplSysrefRcvd_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfJtxLinkChanAddr_e baseAddr, + uint8_t* const bfValue); + +#endif // _ADRV903X_BF_JTX_LINK_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jtx_link_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jtx_link_types.h new file mode 100644 index 0000000000000..0f90c015cf8a7 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_jtx_link_types.h @@ -0,0 +1,26 @@ +/** + * \file adrv903x_bf_jtx_link_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_JTX_LINK_TYPES_H_ +#define _ADRV903X_BF_JTX_LINK_TYPES_H_ + +typedef enum adrv903x_BfJtxLinkChanAddr +{ + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_ = 0x48030000, + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_ = 0x48040000, + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_ = 0x48050000 +} adrv903x_BfJtxLinkChanAddr_e; + +#endif // _ADRV903X_BF_JTX_LINK_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_orx_dig.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_orx_dig.c new file mode 100644 index 0000000000000..d8965aa2c2348 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_orx_dig.c @@ -0,0 +1,2756 @@ +/** + * \file adrv903x_bf_orx_dig.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_orx_dig.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_ORX_DIG + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_AdcPdN_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_AdcPdN_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_AdcPdN_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xA0U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_CptBusy_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_CptBusy_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xD4U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_CptTrigger_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_CptTrigger_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_CptTrigger_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xD0U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_Decpwr_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_Decpwr_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x36U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_DecpwrCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_DecpwrCount_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_DecpwrCount_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x34U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_DecpwrCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_DecpwrCount_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x34U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_DecpwrValueReadback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_DecpwrValueReadback_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_DecpwrValueReadback_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x34U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_Hb1OutClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_Hb1OutClkDivideRatio_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x6U), + &bfValueTmp, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_Hb2InClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_Hb2InClkDivideRatio_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x5U), + &bfValueTmp, + 0xCU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_Hb2OutClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_Hb2OutClkDivideRatio_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x5U), + &bfValueTmp, + 0x30U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_IntDataFormat_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_IntDataFormat_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_IntDataFormat_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x29U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_IntDataFormat_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_IntDataFormat_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x29U), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_IntDataResolution_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_IntDataResolution_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_IntDataResolution_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x29U), + ((uint32_t) bfValue << 6), + 0xC0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_IntDataResolution_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_IntDataResolution_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x29U), + &bfValueTmp, + 0xC0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_ObsCapMemClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_ObsCapMemClkDivideRatio_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_ObsCapMemClkDivideRatio_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x8U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_ObsCapMemClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_ObsCapMemClkDivideRatio_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x8U), + &bfValueTmp, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x70U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x70U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection10_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection10_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x75U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection11_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection11_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x75U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection12_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection12_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x76U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection13_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection13_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x76U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection14_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection14_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x77U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection15_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection15_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x77U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection16_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection16_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x78U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection17_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection17_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x78U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection18_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection18_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x79U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection19_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection19_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x79U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x71U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection20_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection20_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x7AU), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection21_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection21_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x7AU), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection22_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection22_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x7BU), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection23_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection23_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x7BU), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection3_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection3_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x71U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection4_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection4_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x72U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection5_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection5_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x72U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection6_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection6_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x73U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection7_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection7_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x73U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection8_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection8_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x74U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OrxGpioSourceSelection9_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OrxGpioSourceSelection9_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x74U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OverloadCountTh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OverloadCountTh_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OverloadCountTh_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2DU), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OverloadDurationCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OverloadDurationCount_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OverloadDurationCount_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2CU), + ((uint32_t) bfValue << 3), + 0xF8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OverloadEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OverloadEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OverloadEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2CU), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OverloadPowerMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OverloadPowerMode_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OverloadPowerMode_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2CU), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OverloadThHigh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 16383U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OverloadThHigh_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OverloadThHigh_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x32), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x33), + bfValue >> 8, + 0x3F); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OverloadThPre_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 16383U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_OverloadThPre_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_OverloadThPre_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2D), + bfValue << 7, + 0x80); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2E), + bfValue >> 1, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2F), + bfValue >> 9, + 0x1F); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_PnpClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_PnpClkDivideRatio_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_PnpClkDivideRatio_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x9U), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_PwrMeasEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_PwrMeasEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_PwrMeasEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x9U), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_PwrMeasEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_PwrMeasEnable_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x9U), + &bfValueTmp, + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_PwrMeasInputSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_PwrMeasInputSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_PwrMeasInputSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2DU), + ((uint32_t) bfValue << 4), + 0x30U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_PwrMeasInputSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_PwrMeasInputSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x2DU), + &bfValueTmp, + 0x30U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_StreamprocPnpClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_OrxDig_StreamprocPnpClkEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_ORX_0__ORX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__ORX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_OrxDig_StreamprocPnpClkEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x5DU), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_orx_dig.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_orx_dig.h new file mode 100644 index 0000000000000..20fca512ec519 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_orx_dig.h @@ -0,0 +1,291 @@ +/** + * \file adrv903x_bf_orx_dig.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_ORX_DIG_H_ +#define _ADRV903X_BF_ORX_DIG_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_orx_dig_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_AdcPdN_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_CptBusy_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_CptTrigger_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_Decpwr_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_DecpwrCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_DecpwrCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_DecpwrValueReadback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_Hb1OutClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_Hb2InClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_Hb2OutClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_IntDataFormat_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_IntDataFormat_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_IntDataResolution_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_IntDataResolution_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_ObsCapMemClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_ObsCapMemClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OrxGpioSourceSelection9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OverloadCountTh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OverloadDurationCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OverloadEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OverloadPowerMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OverloadThHigh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_OverloadThPre_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_PnpClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_PwrMeasEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_PwrMeasEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_PwrMeasInputSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_PwrMeasInputSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDig_StreamprocPnpClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfOrxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +#endif // _ADRV903X_BF_ORX_DIG_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_orx_dig_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_orx_dig_types.h new file mode 100644 index 0000000000000..74a2a805f9cc8 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_orx_dig_types.h @@ -0,0 +1,25 @@ +/** + * \file adrv903x_bf_orx_dig_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_ORX_DIG_TYPES_H_ +#define _ADRV903X_BF_ORX_DIG_TYPES_H_ + +typedef enum adrv903x_BfOrxDigChanAddr +{ + ADRV903X_BF_SLICE_ORX_0__ORX_DIG = 0x61050000, + ADRV903X_BF_SLICE_ORX_1__ORX_DIG = 0x61150000 +} adrv903x_BfOrxDigChanAddr_e; + +#endif // _ADRV903X_BF_ORX_DIG_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_pll_mem_map.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_pll_mem_map.c new file mode 100644 index 0000000000000..3d1f6bdb8444a --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_pll_mem_map.c @@ -0,0 +1,172 @@ +/** + * \file adrv903x_bf_pll_mem_map.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_pll_mem_map.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_PLL_MEM_MAP + +ADI_API adi_adrv903x_ErrAction_e adrv903x_PllMemMap_SelRxLo_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfPllMemMapChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_EAST_RFPLL) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_WEST_RFPLL) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERDES_PLL) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_CLKPLL)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_PllMemMap_SelRxLo_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x6CU), + &bfValueTmp, + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_PllMemMap_SelTxLo_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfPllMemMapChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_EAST_RFPLL) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_WEST_RFPLL) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERDES_PLL) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_CLKPLL)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_PllMemMap_SelTxLo_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x6CU), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_PllMemMap_SynLock_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfPllMemMapChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_EAST_RFPLL) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_WEST_RFPLL) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERDES_PLL) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_CLKPLL)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_PllMemMap_SynLock_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x26U), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_pll_mem_map.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_pll_mem_map.h new file mode 100644 index 0000000000000..d44654a4e00d3 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_pll_mem_map.h @@ -0,0 +1,46 @@ +/** + * \file adrv903x_bf_pll_mem_map.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_PLL_MEM_MAP_H_ +#define _ADRV903X_BF_PLL_MEM_MAP_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_pll_mem_map_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_PllMemMap_SelRxLo_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfPllMemMapChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_PllMemMap_SelTxLo_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfPllMemMapChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_PllMemMap_SynLock_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfPllMemMapChanAddr_e baseAddr, + uint8_t* const bfValue); + +#endif // _ADRV903X_BF_PLL_MEM_MAP_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_pll_mem_map_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_pll_mem_map_types.h new file mode 100644 index 0000000000000..b9d23fd0ec56d --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_pll_mem_map_types.h @@ -0,0 +1,135 @@ +/** + * \file adrv903x_bf_pll_mem_map_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_PLL_MEM_MAP_TYPES_H_ +#define _ADRV903X_BF_PLL_MEM_MAP_TYPES_H_ + +typedef enum adrv903x_BfPllMemMapChanAddr +{ + ADRV903X_BF_DIGITAL_CORE_EAST_RFPLL = 0x47300000, + ADRV903X_BF_DIGITAL_CORE_WEST_RFPLL = 0x47400000, + ADRV903X_BF_DIGITAL_CORE_JESD_SERDES_PLL = 0x48060000, + ADRV903X_BF_DIGITAL_CORE_JESD_CLKPLL = 0x48090000 +} adrv903x_BfPllMemMapChanAddr_e; + +/** + * \brief Enumeration for calper + */ + +typedef enum adrv903x_Bf_PllMemMap_Calper +{ + ADRV903X_BF_PLL_MEM_MAP_CALPER_CALPER1 = 0, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALPER_CALPER2 = 1, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALPER_CALPER4 = 2, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALPER_CALPER8 = 3, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALPER_CALPER16 = 4, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALPER_CALPER32 = 5, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALPER_CALPER64 = 6, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALPER_CALPER128 = 7 /*!< No description provided */ +} adrv903x_Bf_PllMemMap_Calper_e; + +/** + * \brief Enumeration for caltyp + */ + +typedef enum adrv903x_Bf_PllMemMap_Caltyp +{ + ADRV903X_BF_PLL_MEM_MAP_CALTYP_IDLE = 0, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALTYP_ICAL = 1, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALTYP_TCAL = 2, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALTYP_CTCAL = 3, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALTYP_CRCAL = 4, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALTYP_ICALC = 5, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALTYP_TCALC = 6, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_CALTYP_CTCALC = 7 /*!< No description provided */ +} adrv903x_Bf_PllMemMap_Caltyp_e; + +/** + * \brief Enumeration for icalwait + */ + +typedef enum adrv903x_Bf_PllMemMap_Icalwait +{ + ADRV903X_BF_PLL_MEM_MAP_ICALWAIT_ICALWAIT_1K = 0, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_ICALWAIT_ICALWAIT_2K = 1, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_ICALWAIT_ICALWAIT_4K = 2, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_ICALWAIT_ICALWAIT_8K = 3 /*!< No description provided */ +} adrv903x_Bf_PllMemMap_Icalwait_e; + +/** + * \brief Enumeration for qthr + */ + +typedef enum adrv903x_Bf_PllMemMap_Qthr +{ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR0 = 0, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR1 = 1, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR2 = 2, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR3 = 3, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR4 = 4, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR5 = 5, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR6 = 6, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR7 = 7, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR8 = 8, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR9 = 9, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR10 = 10, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR11 = 11, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR12 = 12, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR13 = 13, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR14 = 14, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_QTHR_QTHR15 = 15 /*!< No description provided */ +} adrv903x_Bf_PllMemMap_Qthr_e; + +/** + * \brief Enumeration for tsprsc + */ + +typedef enum adrv903x_Bf_PllMemMap_Tsprsc +{ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_1 = 0, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_2 = 1, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_4 = 2, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_8 = 3, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_16 = 4, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_32 = 5, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_64 = 6, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_128 = 7, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_256 = 8, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_512 = 9, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_1K = 10, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_2K = 11, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_4K = 12, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_8K = 13, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_16K = 14, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_TSPRSC_TPRSC_32K = 15 /*!< No description provided */ +} adrv903x_Bf_PllMemMap_Tsprsc_e; + +/** + * \brief Enumeration for vcoCalInitDel + */ + +typedef enum adrv903x_Bf_PllMemMap_VcoCalInitDel +{ + ADRV903X_BF_PLL_MEM_MAP_VCO_CAL_INIT_DEL_VCOCCAL_DEL_1K = 0, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_VCO_CAL_INIT_DEL_VCOCCAL_DEL_2K = 1, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_VCO_CAL_INIT_DEL_VCOCCAL_DEL_4K = 2, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_VCO_CAL_INIT_DEL_VCOCCAL_DEL_8K = 3, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_VCO_CAL_INIT_DEL_VCOCCAL_DEL_16K = 4, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_VCO_CAL_INIT_DEL_VCOCCAL_DEL_32K = 5, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_VCO_CAL_INIT_DEL_VCOCCAL_DEL_64K = 6, /*!< No description provided */ + ADRV903X_BF_PLL_MEM_MAP_VCO_CAL_INIT_DEL_VCOCCAL_DEL_128K = 7 /*!< No description provided */ +} adrv903x_Bf_PllMemMap_VcoCalInitDel_e; + +#endif // _ADRV903X_BF_PLL_MEM_MAP_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_ddc.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_ddc.c new file mode 100644 index 0000000000000..79c3461994944 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_ddc.c @@ -0,0 +1,4061 @@ +/** + * \file adrv903x_bf_rx_ddc.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_rx_ddc.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_RX_DDC + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_DecPowerEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_DecPowerEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x75U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_DecPowerEnable_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x75U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerEnSpiOrAgcSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_DecPowerEnSpiOrAgcSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_DecPowerEnSpiOrAgcSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x75U), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerEnSpiOrAgcSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_DecPowerEnSpiOrAgcSelect_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x75U), + &bfValueTmp, + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerMeasurementDuration_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_DecPowerMeasurementDuration_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_DecPowerMeasurementDuration_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x76U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerMeasurementDuration_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_DecPowerMeasurementDuration_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x76U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerStartDelayCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 65535U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_DecPowerStartDelayCounter_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_DecPowerStartDelayCounter_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x78), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x79), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerTddModeEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_DecPowerTddModeEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_DecPowerTddModeEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x7AU), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerValue_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_DecPowerValue_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x74U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerValueReadback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_DecPowerValueReadback_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_DecPowerValueReadback_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x75U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DigitalGainEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_DigitalGainEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_DigitalGainEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x20U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_ExternalSlicerPinControlStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_ExternalSlicerPinControlStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x33U), + &bfValueTmp, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_FpEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x35U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x35U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpExponentBits_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const adrv903x_Bf_RxDdc_FpExponentBits_e bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ( + (bfValue != ADRV903X_BF_RX_DDC_FP_EXPONENT_BITS_RX1_EXP_2 ) && + (bfValue != ADRV903X_BF_RX_DDC_FP_EXPONENT_BITS_RX1_EXP_3 ) && + (bfValue != ADRV903X_BF_RX_DDC_FP_EXPONENT_BITS_RX1_EXP_4 ) && + (bfValue != ADRV903X_BF_RX_DDC_FP_EXPONENT_BITS_RX1_EXP_5 ) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_FpExponentBits_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpExponentBits_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x39U), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpExponentBits_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + adrv903x_Bf_RxDdc_FpExponentBits_e* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (adrv903x_Bf_RxDdc_FpExponentBits_e) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpExponentBits_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x39U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (adrv903x_Bf_RxDdc_FpExponentBits_e) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpFloatDataFormat_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_FpFloatDataFormat_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpFloatDataFormat_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x31U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpFloatDataFormat_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpFloatDataFormat_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x31U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpHideLeadingOnes_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_FpHideLeadingOnes_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpHideLeadingOnes_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x34U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpHideLeadingOnes_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpHideLeadingOnes_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x34U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpIntDataAtten_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_FpIntDataAtten_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpIntDataAtten_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x36U), + ((uint32_t) bfValue << 4), + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpIntDataAtten_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpIntDataAtten_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x36U), + &bfValueTmp, + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpNanEncEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_FpNanEncEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpNanEncEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3AU), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpNanEncEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpNanEncEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3AU), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpRoundMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const adrv903x_Bf_RxDdc_FpRoundMode_e bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ( + (bfValue != ADRV903X_BF_RX_DDC_FP_ROUND_MODE_ROUNDTIESTOEVEN ) && + (bfValue != ADRV903X_BF_RX_DDC_FP_ROUND_MODE_ROUNDTOWARDSPOSITIVE ) && + (bfValue != ADRV903X_BF_RX_DDC_FP_ROUND_MODE_ROUNDTOWARDSNEGATIVE ) && + (bfValue != ADRV903X_BF_RX_DDC_FP_ROUND_MODE_ROUNDTOWARDSZERO ) && + (bfValue != ADRV903X_BF_RX_DDC_FP_ROUND_MODE_ROUNDTIESTOAWAY ) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_FpRoundMode_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpRoundMode_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x33U), + ((uint32_t) bfValue << 4), + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpRoundMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + adrv903x_Bf_RxDdc_FpRoundMode_e* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (adrv903x_Bf_RxDdc_FpRoundMode_e) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_FpRoundMode_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x33U), + &bfValueTmp, + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (adrv903x_Bf_RxDdc_FpRoundMode_e) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_GainCompEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_GainCompEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_GainCompEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x21U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_GainCompEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_GainCompEnable_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x21U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_GainCompForExtGain_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_GainCompForExtGain_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_GainCompForExtGain_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x22U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_GainCompForExtGain_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_GainCompForExtGain_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x22U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_GainCompForTempGain_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_GainCompForTempGain_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_GainCompForTempGain_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x27U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_GainCompForTempGain_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_GainCompForTempGain_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x27U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntDataFormat_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_IntDataFormat_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntDataFormat_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x40U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntDataFormat_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntDataFormat_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x40U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntDataResolution_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_IntDataResolution_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntDataResolution_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x40U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntDataResolution_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntDataResolution_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x40U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEmbedSlicer_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_IntEmbedSlicer_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntEmbedSlicer_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x39U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEmbedSlicer_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntEmbedSlicer_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x39U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEmbedSlicerNumber_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_IntEmbedSlicerNumber_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntEmbedSlicerNumber_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x32U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEmbedSlicerNumber_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntEmbedSlicerNumber_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x32U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEmbedSlicerPos_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_IntEmbedSlicerPos_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntEmbedSlicerPos_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x32U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEmbedSlicerPos_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntEmbedSlicerPos_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x32U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEvenParity_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_IntEvenParity_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntEvenParity_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x37U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEvenParity_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntEvenParity_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x37U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntParitySupport_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_IntParitySupport_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntParitySupport_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x41U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntParitySupport_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntParitySupport_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x41U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntSlicerLsbOnQ_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_IntSlicerLsbOnQ_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntSlicerLsbOnQ_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x35U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntSlicerLsbOnQ_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_IntSlicerLsbOnQ_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x35U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_MaxSlicer_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_MaxSlicer_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_MaxSlicer_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2AU), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_MaxSlicerOverride_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_MaxSlicerOverride_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_MaxSlicerOverride_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x27U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_RxMonFormatI_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_RxMonFormatI_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_RxMonFormatI_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_RxDdc_RxMonFormatI_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x44 + channelId * 4U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_RxMonFormatI_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_RxMonFormatI_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_RxDdc_RxMonFormatI_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x44 + channelId * 4U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_RxMonFormatQ_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_RxMonFormatQ_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_RxMonFormatQ_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_RxDdc_RxMonFormatQ_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x46 + channelId * 4U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_RxMonFormatQ_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_RxMonFormatQ_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_RxDdc_RxMonFormatQ_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x46 + channelId * 4U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_RxTempGainComp_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 127U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_RxTempGainComp_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_RxTempGainComp_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x24U), + (uint32_t) bfValue, + 0x7FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_RxTempGainComp_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_RxTempGainComp_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x24U), + &bfValueTmp, + 0x7FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_SlicerPinControlMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_SlicerPinControlMode_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_SlicerPinControlMode_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x42U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_SlicerPinControlMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_SlicerPinControlMode_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x42U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_SlicerPinControlStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_SlicerPinControlStep_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_SlicerPinControlStep_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x38U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_SlicerPinControlStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_SlicerPinControlStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x38U), + &bfValueTmp, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_Static3bitSlicerModeEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDdc_Static3bitSlicerModeEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DDC_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DDC_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDdc_Static3bitSlicerModeEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x31U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_ddc.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_ddc.h new file mode 100644 index 0000000000000..4bc6c0bde3239 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_ddc.h @@ -0,0 +1,340 @@ +/** + * \file adrv903x_bf_rx_ddc.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_RX_DDC_H_ +#define _ADRV903X_BF_RX_DDC_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_rx_ddc_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerEnSpiOrAgcSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerEnSpiOrAgcSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerMeasurementDuration_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerMeasurementDuration_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerStartDelayCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerTddModeEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerValue_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DecPowerValueReadback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_DigitalGainEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_ExternalSlicerPinControlStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpExponentBits_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const adrv903x_Bf_RxDdc_FpExponentBits_e bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpExponentBits_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + adrv903x_Bf_RxDdc_FpExponentBits_e* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpFloatDataFormat_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpFloatDataFormat_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpHideLeadingOnes_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpHideLeadingOnes_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpIntDataAtten_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpIntDataAtten_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpNanEncEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpNanEncEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpRoundMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const adrv903x_Bf_RxDdc_FpRoundMode_e bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_FpRoundMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + adrv903x_Bf_RxDdc_FpRoundMode_e* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_GainCompEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_GainCompEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_GainCompForExtGain_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_GainCompForExtGain_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_GainCompForTempGain_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_GainCompForTempGain_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntDataFormat_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntDataFormat_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntDataResolution_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntDataResolution_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEmbedSlicer_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEmbedSlicer_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEmbedSlicerNumber_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEmbedSlicerNumber_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEmbedSlicerPos_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEmbedSlicerPos_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEvenParity_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntEvenParity_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntParitySupport_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntParitySupport_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntSlicerLsbOnQ_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_IntSlicerLsbOnQ_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_MaxSlicer_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_MaxSlicerOverride_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_RxMonFormatI_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_RxMonFormatI_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_RxMonFormatQ_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_RxMonFormatQ_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t channelId, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_RxTempGainComp_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_RxTempGainComp_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_SlicerPinControlMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_SlicerPinControlMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_SlicerPinControlStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_SlicerPinControlStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdc_Static3bitSlicerModeEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDdcChanAddr_e baseAddr, + const uint8_t bfValue); + +#endif // _ADRV903X_BF_RX_DDC_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_ddc_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_ddc_types.h new file mode 100644 index 0000000000000..96ce0eb99cd38 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_ddc_types.h @@ -0,0 +1,64 @@ +/** + * \file adrv903x_bf_rx_ddc_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_RX_DDC_TYPES_H_ +#define _ADRV903X_BF_RX_DDC_TYPES_H_ + +typedef enum adrv903x_BfRxDdcChanAddr +{ + ADRV903X_BF_SLICE_RX_0__RX_DDC_0_ = 0x60060000, + ADRV903X_BF_SLICE_RX_0__RX_DDC_1_ = 0x60070000, + ADRV903X_BF_SLICE_RX_1__RX_DDC_0_ = 0x60160000, + ADRV903X_BF_SLICE_RX_1__RX_DDC_1_ = 0x60170000, + ADRV903X_BF_SLICE_RX_2__RX_DDC_0_ = 0x60260000, + ADRV903X_BF_SLICE_RX_2__RX_DDC_1_ = 0x60270000, + ADRV903X_BF_SLICE_RX_3__RX_DDC_0_ = 0x60360000, + ADRV903X_BF_SLICE_RX_3__RX_DDC_1_ = 0x60370000, + ADRV903X_BF_SLICE_RX_4__RX_DDC_0_ = 0x60460000, + ADRV903X_BF_SLICE_RX_4__RX_DDC_1_ = 0x60470000, + ADRV903X_BF_SLICE_RX_5__RX_DDC_0_ = 0x60560000, + ADRV903X_BF_SLICE_RX_5__RX_DDC_1_ = 0x60570000, + ADRV903X_BF_SLICE_RX_6__RX_DDC_0_ = 0x60660000, + ADRV903X_BF_SLICE_RX_6__RX_DDC_1_ = 0x60670000, + ADRV903X_BF_SLICE_RX_7__RX_DDC_0_ = 0x60760000, + ADRV903X_BF_SLICE_RX_7__RX_DDC_1_ = 0x60770000 +} adrv903x_BfRxDdcChanAddr_e; + +/** + * \brief Enumeration for fpExponentBits + */ + +typedef enum adrv903x_Bf_RxDdc_FpExponentBits +{ + ADRV903X_BF_RX_DDC_FP_EXPONENT_BITS_RX1_EXP_2 = 0, /*!< No description provided */ + ADRV903X_BF_RX_DDC_FP_EXPONENT_BITS_RX1_EXP_3 = 1, /*!< No description provided */ + ADRV903X_BF_RX_DDC_FP_EXPONENT_BITS_RX1_EXP_4 = 2, /*!< No description provided */ + ADRV903X_BF_RX_DDC_FP_EXPONENT_BITS_RX1_EXP_5 = 3 /*!< No description provided */ +} adrv903x_Bf_RxDdc_FpExponentBits_e; + +/** + * \brief Enumeration for fpRoundMode + */ + +typedef enum adrv903x_Bf_RxDdc_FpRoundMode +{ + ADRV903X_BF_RX_DDC_FP_ROUND_MODE_ROUNDTIESTOEVEN = 0, /*!< No description provided */ + ADRV903X_BF_RX_DDC_FP_ROUND_MODE_ROUNDTOWARDSPOSITIVE = 1, /*!< No description provided */ + ADRV903X_BF_RX_DDC_FP_ROUND_MODE_ROUNDTOWARDSNEGATIVE = 2, /*!< No description provided */ + ADRV903X_BF_RX_DDC_FP_ROUND_MODE_ROUNDTOWARDSZERO = 3, /*!< No description provided */ + ADRV903X_BF_RX_DDC_FP_ROUND_MODE_ROUNDTIESTOAWAY = 4 /*!< No description provided */ +} adrv903x_Bf_RxDdc_FpRoundMode_e; + +#endif // _ADRV903X_BF_RX_DDC_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_dig.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_dig.c new file mode 100644 index 0000000000000..fa4851bc9ddc9 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_dig.c @@ -0,0 +1,1614 @@ +/** + * \file adrv903x_bf_rx_dig.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_rx_dig.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_RX_DIG + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestClkSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_AdcTestClkSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AdcTestClkSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x109U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestClkSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AdcTestClkSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x109U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenEnSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_AdcTestGenEnSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AdcTestGenEnSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x10CU), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenEnSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AdcTestGenEnSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x10CU), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenEnSpi_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_AdcTestGenEnSpi_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AdcTestGenEnSpi_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x10DU), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenEnSpi_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AdcTestGenEnSpi_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x10DU), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_AdcTestGenSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AdcTestGenSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x10AU), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AdcTestGenSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x10AU), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenSineFreq_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_AdcTestGenSineFreq_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AdcTestGenSineFreq_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x10DU), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenSineFreq_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AdcTestGenSineFreq_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x10DU), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AgcDecGainGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_AgcDecGainGpioSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AgcDecGainGpioSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x105U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AgcGainChangeGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_AgcGainChangeGpioSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AgcGainChangeGpioSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x104U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AgcIncGainGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_AgcIncGainGpioSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AgcIncGainGpioSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x106U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AgcManualGainLockGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_AgcManualGainLockGpioSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AgcManualGainLockGpioSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x100U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AgcSlowloopFreezeEnableGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_AgcSlowloopFreezeEnableGpioSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_AgcSlowloopFreezeEnableGpioSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x101U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_Ddc1Hb1OutClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_Ddc1Hb1OutClkDivideRatio_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_Ddc1Hb1OutClkDivideRatio_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x12U), + ((uint32_t) bfValue << 4), + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_DecpwrClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_DecpwrClkDivideRatio_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_DecpwrClkDivideRatio_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xFU), + ((uint32_t) bfValue << 4), + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_DecpwrClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_DecpwrClkEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_DecpwrClkEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x15U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_Hb2OutClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_Hb2OutClkDivideRatio_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x14U), + &bfValueTmp, + 0x30U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_PeakDetectClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_PeakDetectClkDivideRatio_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_PeakDetectClkDivideRatio_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1CU), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_PeakDetectClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_PeakDetectClkEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_PeakDetectClkEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x8U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_ReferenceClockCycles_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_ReferenceClockCycles_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1EU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_RoutClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_RoutClkDivideRatio_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4U), + &bfValueTmp, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_RssiEnableGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_RssiEnableGpioSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_RssiEnableGpioSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x102U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_RxGpioSourceSelection_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_RxGpioSourceSelection_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_RxGpioSourceSelection_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) && + (channelId != 0x8) && + (channelId != 0x9) && + (channelId != 0xA) && + (channelId != 0xB) && + (channelId != 0xC) && + (channelId != 0xD) && + (channelId != 0xE) && + (channelId != 0xF) && + (channelId != 0x10) && + (channelId != 0x11) && + (channelId != 0x12) && + (channelId != 0x13) && + (channelId != 0x14) && + (channelId != 0x15) && + (channelId != 0x16) && + (channelId != 0x17) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_RxDig_RxGpioSourceSelection_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xA0 + channelId * 4U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_StreamprocDdc1Hb1OutClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_StreamprocDdc1Hb1OutClkEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_StreamprocDdc1Hb1OutClkEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x94U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_TestGenEnGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxDig_TestGenEnGpioSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxDig_TestGenEnGpioSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x10BU), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_dig.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_dig.h new file mode 100644 index 0000000000000..a61c349d97cb3 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_dig.h @@ -0,0 +1,167 @@ +/** + * \file adrv903x_bf_rx_dig.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_RX_DIG_H_ +#define _ADRV903X_BF_RX_DIG_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_rx_dig_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestClkSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestClkSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenEnSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenEnSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenEnSpi_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenEnSpi_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenSineFreq_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AdcTestGenSineFreq_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AgcDecGainGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AgcGainChangeGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AgcIncGainGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AgcManualGainLockGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_AgcSlowloopFreezeEnableGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_Ddc1Hb1OutClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_DecpwrClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_DecpwrClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_Hb2OutClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_PeakDetectClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_PeakDetectClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_ReferenceClockCycles_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_RoutClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_RssiEnableGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_RxGpioSourceSelection_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + uint8_t channelId, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_StreamprocDdc1Hb1OutClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDig_TestGenEnGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +#endif // _ADRV903X_BF_RX_DIG_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_dig_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_dig_types.h new file mode 100644 index 0000000000000..a32a3e6a69f18 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_dig_types.h @@ -0,0 +1,31 @@ +/** + * \file adrv903x_bf_rx_dig_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_RX_DIG_TYPES_H_ +#define _ADRV903X_BF_RX_DIG_TYPES_H_ + +typedef enum adrv903x_BfRxDigChanAddr +{ + ADRV903X_BF_SLICE_RX_0__RX_DIG = 0x60040000, + ADRV903X_BF_SLICE_RX_1__RX_DIG = 0x60140000, + ADRV903X_BF_SLICE_RX_2__RX_DIG = 0x60240000, + ADRV903X_BF_SLICE_RX_3__RX_DIG = 0x60340000, + ADRV903X_BF_SLICE_RX_4__RX_DIG = 0x60440000, + ADRV903X_BF_SLICE_RX_5__RX_DIG = 0x60540000, + ADRV903X_BF_SLICE_RX_6__RX_DIG = 0x60640000, + ADRV903X_BF_SLICE_RX_7__RX_DIG = 0x60740000 +} adrv903x_BfRxDigChanAddr_e; + +#endif // _ADRV903X_BF_RX_DIG_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_funcs.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_funcs.c new file mode 100644 index 0000000000000..0136ed42872e1 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_funcs.c @@ -0,0 +1,9544 @@ +/** + * \file adrv903x_bf_rx_funcs.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_rx_funcs.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_RX_FUNCS + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcovrgHigh_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAdcovrgHigh_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x34U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcovrgLow_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAdcovrgLow_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xDU), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcovrgLowInt0Counter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcAdcovrgLowInt0Counter_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAdcovrgLowInt0Counter_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x58U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcovrgLowInt0Counter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAdcovrgLowInt0Counter_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x58U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcovrgLowInt1Counter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcAdcovrgLowInt1Counter_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAdcovrgLowInt1Counter_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x5EU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcovrgLowInt1Counter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAdcovrgLowInt1Counter_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x5EU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcHighOvrgExceededCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcAdcHighOvrgExceededCounter_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAdcHighOvrgExceededCounter_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x71U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcHighOvrgExceededCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAdcHighOvrgExceededCounter_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x71U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcLowOvrgExceededCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcAdcLowOvrgExceededCounter_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAdcLowOvrgExceededCounter_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x49U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcLowOvrgExceededCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAdcLowOvrgExceededCounter_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x49U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcResetGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcAdcResetGainStep_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAdcResetGainStep_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x38U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcResetGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAdcResetGainStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x38U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAttackDelay_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 63U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcAttackDelay_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAttackDelay_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x8U), + (uint32_t) bfValue, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAttackDelay_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcAttackDelay_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x8U), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcChangeGainIfAdcovrgHigh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcChangeGainIfAdcovrgHigh_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcChangeGainIfAdcovrgHigh_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x67U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcChangeGainIfAdcovrgHigh_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcChangeGainIfAdcovrgHigh_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x67U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcChangeGainIfUlbthHigh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcChangeGainIfUlbthHigh_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcChangeGainIfUlbthHigh_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x66U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcChangeGainIfUlbthHigh_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcChangeGainIfUlbthHigh_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x66U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDelayCounterBaseRate_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcDelayCounterBaseRate_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDelayCounterBaseRate_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcDualbandEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x33U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandEnable_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x33U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandExtTableLowerIndex_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcDualbandExtTableLowerIndex_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandExtTableLowerIndex_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x72U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandExtTableLowerIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandExtTableLowerIndex_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x72U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandExtTableUpperIndex_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcDualbandExtTableUpperIndex_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandExtTableUpperIndex_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2BU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandExtTableUpperIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandExtTableUpperIndex_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x2BU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandHighLnaThreshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcDualbandHighLnaThreshold_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandHighLnaThreshold_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x70U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandHighLnaThreshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandHighLnaThreshold_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x70U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandLnaStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcDualbandLnaStep_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandLnaStep_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4FU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandLnaStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandLnaStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4FU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandLowLnaThreshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcDualbandLowLnaThreshold_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandLowLnaThreshold_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x61U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandLowLnaThreshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandLowLnaThreshold_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x61U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandMaxIndex_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcDualbandMaxIndex_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandMaxIndex_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x5BU), + ((uint32_t) bfValue << 4), + 0x30U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandMaxIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandMaxIndex_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x5BU), + &bfValueTmp, + 0x30U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandPwrMargin_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcDualbandPwrMargin_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandPwrMargin_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x53U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandPwrMargin_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcDualbandPwrMargin_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x53U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcEnableFastRecoveryLoop_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcEnableFastRecoveryLoop_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcEnableFastRecoveryLoop_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x6DU), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcEnableFastRecoveryLoop_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcEnableFastRecoveryLoop_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x6DU), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcEnableGainIndexUpdate_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcEnableGainIndexUpdate_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x74U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcEnableSyncPulseForGainCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcEnableSyncPulseForGainCounter_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcEnableSyncPulseForGainCounter_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3FU), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcEnableSyncPulseForGainCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcEnableSyncPulseForGainCounter_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3FU), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcGainIndex_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcGainIndex_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcGainIndex_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x7AU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcGainIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcGainIndex_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x7AU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcGainUpdateCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint32_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 4194303U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcGainUpdateCounter_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcGainUpdateCounter_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x18), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x19), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1A), + bfValue >> 16, + 0x3F); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcGainUpdateCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint32_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint32_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcGainUpdateCounter_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x18U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x19U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1AU), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 16); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLlbGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcLlbGainStep_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLlbGainStep_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x79U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLlbGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLlbGainStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x79U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLlbThresholdExceededCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcLlbThresholdExceededCounter_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLlbThresholdExceededCounter_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x29U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLlbThresholdExceededCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLlbThresholdExceededCounter_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x29U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLlBlocker_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLlBlocker_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xBU), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLockLevel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 127U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcLockLevel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLockLevel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1EU), + (uint32_t) bfValue, + 0x7FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLockLevel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLockLevel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1EU), + &bfValueTmp, + 0x7FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower0Threshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 127U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcLower0Threshold_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLower0Threshold_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x78U), + (uint32_t) bfValue, + 0x7FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower0Threshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLower0Threshold_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x78U), + &bfValueTmp, + 0x7FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower0ThresholdExceededGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcLower0ThresholdExceededGainStep_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLower0ThresholdExceededGainStep_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x23U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower0ThresholdExceededGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLower0ThresholdExceededGainStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x23U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower1Threshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcLower1Threshold_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLower1Threshold_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x39U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower1Threshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLower1Threshold_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x39U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower1ThresholdExceededGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcLower1ThresholdExceededGainStep_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLower1ThresholdExceededGainStep_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x75U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower1ThresholdExceededGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLower1ThresholdExceededGainStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x75U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLowThsPreventGainInc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcLowThsPreventGainInc_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLowThsPreventGainInc_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x74U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLowThsPreventGainInc_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcLowThsPreventGainInc_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x74U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcManualGainIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcManualGainIndex_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x51U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcManualGainPinControl_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcManualGainPinControl_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcManualGainPinControl_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x65U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcMaximumGainIndex_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcMaximumGainIndex_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcMaximumGainIndex_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3CU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcMaximumGainIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcMaximumGainIndex_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3CU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcMinimumGainIndex_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcMinimumGainIndex_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcMinimumGainIndex_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x48U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcMinimumGainIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcMinimumGainIndex_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x48U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgHighGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcOvrgHighGainStep_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcOvrgHighGainStep_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x21), + bfValue << 4, + 0xF0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x22), + bfValue >> 4, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgHighGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcOvrgHighGainStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x21U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint8_t) bfValueTmp >> 4); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x22U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint8_t) bfValueTmp << 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgLowGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcOvrgLowGainStep_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcOvrgLowGainStep_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x25), + bfValue << 4, + 0xF0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x26), + bfValue >> 4, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgLowGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcOvrgLowGainStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x25U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint8_t) bfValueTmp >> 4); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x26U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint8_t) bfValueTmp << 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgLowInt0GainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcOvrgLowInt0GainStep_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcOvrgLowInt0GainStep_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x0U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgLowInt0GainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcOvrgLowInt0GainStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x0U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgLowInt1GainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcOvrgLowInt1GainStep_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcOvrgLowInt1GainStep_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x47U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgLowInt1GainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcOvrgLowInt1GainStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x47U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgResetpdHighCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcOvrgResetpdHighCount_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcOvrgResetpdHighCount_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2CU), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcPeakThresholdGainControlMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcPeakThresholdGainControlMode_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcPeakThresholdGainControlMode_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x25U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcPeakThresholdGainControlMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcPeakThresholdGainControlMode_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x25U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcPeakWaitTime_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcPeakWaitTime_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcPeakWaitTime_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x20U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcPeakWaitTime_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcPeakWaitTime_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x20U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcResetCounters_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcResetCounters_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcResetCounters_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x59U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcResetOnRxon_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcResetOnRxon_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcResetOnRxon_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x42U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcResetOnRxon_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcResetOnRxon_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x42U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSetup_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcSetup_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcSetup_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x27U), + ((uint32_t) bfValue << 4), + 0x30U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSetup_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcSetup_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x27U), + &bfValueTmp, + 0x30U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSlowloopFreezeEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcSlowloopFreezeEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcSlowloopFreezeEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x21U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSlowloopFreezeEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcSlowloopFreezeEnable_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x21U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSlowLoopSettlingDelay_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcSlowLoopSettlingDelay_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcSlowLoopSettlingDelay_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x68U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSlowLoopSettlingDelay_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcSlowLoopSettlingDelay_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x68U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSoftReset_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcSoftReset_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcSoftReset_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x15U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUlbGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcUlbGainStep_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUlbGainStep_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x17U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUlbGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUlbGainStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x17U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUlbThresholdExceededCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcUlbThresholdExceededCounter_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUlbThresholdExceededCounter_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x7FU), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUlbThresholdExceededCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUlbThresholdExceededCounter_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x7FU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUlBlocker_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUlBlocker_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x2U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUpper0ThresholdExceededGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcUpper0ThresholdExceededGainStep_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUpper0ThresholdExceededGainStep_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x44), + bfValue << 4, + 0xF0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x45), + bfValue >> 4, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUpper0ThresholdExceededGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUpper0ThresholdExceededGainStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x44U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint8_t) bfValueTmp >> 4); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x45U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint8_t) bfValueTmp << 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUpper1Threshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcUpper1Threshold_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUpper1Threshold_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x57U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUpper1Threshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUpper1Threshold_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x57U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUpper1ThresholdExceededGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcUpper1ThresholdExceededGainStep_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUpper1ThresholdExceededGainStep_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x73U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUpper1ThresholdExceededGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUpper1ThresholdExceededGainStep_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x73U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUrangeInterval0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 65535U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcUrangeInterval0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUrangeInterval0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x10), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x11), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUrangeInterval0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUrangeInterval0_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x10U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x11U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUrangeInterval1Mult_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 63U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcUrangeInterval1Mult_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUrangeInterval1Mult_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4U), + (uint32_t) bfValue, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUrangeInterval1Mult_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUrangeInterval1Mult_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4U), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUrangeInterval2Mult_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 63U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcUrangeInterval2Mult_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUrangeInterval2Mult_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2AU), + (uint32_t) bfValue, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUrangeInterval2Mult_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUrangeInterval2Mult_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x2AU), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUseCountersForMgc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_AgcUseCountersForMgc_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_AgcUseCountersForMgc_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x6EU), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_ApdHighSrcSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_ApdHighSrcSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_ApdHighSrcSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x45U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_ApdHighSrcSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_ApdHighSrcSelect_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x45U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_ApdLowSrcSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_ApdLowSrcSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_ApdLowSrcSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x62U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_ApdLowSrcSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_ApdLowSrcSelect_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x62U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_BbdcTrackingEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_BbdcTrackingEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_BbdcTrackingEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xBFU), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_BbdcTrackingEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_BbdcTrackingEnable_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xBFU), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerDataSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_DecPowerDataSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DecPowerDataSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84U), + ((uint32_t) bfValue << 2), + 0xCU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerDataSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DecPowerDataSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x84U), + &bfValueTmp, + 0xCU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_DecPowerEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DecPowerEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DecPowerEnable_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x84U), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerEnSpiOrAgcSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_DecPowerEnSpiOrAgcSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DecPowerEnSpiOrAgcSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x84U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerEnSpiOrAgcSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DecPowerEnSpiOrAgcSelect_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x84U), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerMeasurementDuration_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_DecPowerMeasurementDuration_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DecPowerMeasurementDuration_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x85U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerMeasurementDuration_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DecPowerMeasurementDuration_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x85U), + &bfValueTmp, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerReadback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_DecPowerReadback_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DecPowerReadback_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x87U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerStartDelayCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 65535U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_DecPowerStartDelayCounter_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DecPowerStartDelayCounter_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x88), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x89), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerTddModeEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_DecPowerTddModeEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DecPowerTddModeEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x8AU), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerValue_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DecPowerValue_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x86U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DualbandControlBandA_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DualbandControlBandA_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x12U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DualbandControlBandB_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_DualbandControlBandB_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1BU), + &bfValueTmp, + 0x30U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_Hb2HighSrcSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_Hb2HighSrcSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_Hb2HighSrcSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xBU), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_Hb2HighSrcSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_Hb2HighSrcSelect_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xBU), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_Hb2LowSrcSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_Hb2LowSrcSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_Hb2LowSrcSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x64U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_Hb2LowSrcSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_Hb2LowSrcSelect_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x64U), + &bfValueTmp, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_Hb2OverloadUseHb2In_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_Hb2OverloadUseHb2In_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_Hb2OverloadUseHb2In_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x91U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_Hb2OverloadUseHb2In_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_Hb2OverloadUseHb2In_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x91U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_InvertApdLow_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_InvertApdLow_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_InvertApdLow_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x22U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_InvertApdLow_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_InvertApdLow_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x22U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_InvertHb2Low_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_InvertHb2Low_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_InvertHb2Low_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4AU), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_InvertHb2Low_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_InvertHb2Low_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4AU), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadEnAgc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_OverloadEnAgc_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_OverloadEnAgc_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xABU), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadEnAgc_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_OverloadEnAgc_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xABU), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadPowerModeAgc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_OverloadPowerModeAgc_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_OverloadPowerModeAgc_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x93U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadPowerModeAgc_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_OverloadPowerModeAgc_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x93U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcHigh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 16383U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_OverloadThAgcHigh_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_OverloadThAgcHigh_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x96), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x97), + bfValue >> 8, + 0x3F); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcHigh_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_OverloadThAgcHigh_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x96U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x97U), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcInt0Low_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 16383U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_OverloadThAgcInt0Low_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_OverloadThAgcInt0Low_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xAC), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xAD), + bfValue >> 8, + 0x3F); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcInt0Low_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_OverloadThAgcInt0Low_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xACU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xADU), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcInt1Low_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 16383U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_OverloadThAgcInt1Low_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_OverloadThAgcInt1Low_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xA0), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xA1), + bfValue >> 8, + 0x3F); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcInt1Low_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_OverloadThAgcInt1Low_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xA0U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xA1U), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcLow_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 16383U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_OverloadThAgcLow_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_OverloadThAgcLow_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xAE), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xAF), + bfValue >> 8, + 0x3F); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcLow_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_OverloadThAgcLow_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xAEU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xAFU), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcPre_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 16383U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_OverloadThAgcPre_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_OverloadThAgcPre_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xA5), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xA6), + bfValue >> 8, + 0x3F); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakCountExpirationAgc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint32_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 33554431U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_PeakCountExpirationAgc_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_PeakCountExpirationAgc_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xB4), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xB5), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xB6), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xB7), + bfValue >> 24, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakCountSpacingAgcHigh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_PeakCountSpacingAgcHigh_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_PeakCountSpacingAgcHigh_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xB0U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakCountSpacingAgcLow_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_PeakCountSpacingAgcLow_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_PeakCountSpacingAgcLow_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xB1U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakCountThresholdAgcHigh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_PeakCountThresholdAgcHigh_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_PeakCountThresholdAgcHigh_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xB2U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakCountThresholdAgcLow_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_PeakCountThresholdAgcLow_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_PeakCountThresholdAgcLow_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xB3U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakSampleCountAgc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_PeakSampleCountAgc_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_PeakSampleCountAgc_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x91U), + ((uint32_t) bfValue << 4), + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakSampleCountAgc_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_PeakSampleCountAgc_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x91U), + &bfValueTmp, + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakWindowSizeAgc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 63U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_PeakWindowSizeAgc_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_PeakWindowSizeAgc_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x90U), + (uint32_t) bfValue, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakWindowSizeAgc_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_PeakWindowSizeAgc_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x90U), + &bfValueTmp, + 0x3FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_ReadGainTable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_ReadGainTable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_ReadGainTable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x62U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_RxdpSlicerPosition_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_RxdpSlicerPosition_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x8CU), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_TiaValidOverride_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_RxFuncs_TiaValidOverride_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__RX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__RX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_RxFuncs_TiaValidOverride_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x6U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_funcs.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_funcs.h new file mode 100644 index 0000000000000..292b380340d0a --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_funcs.h @@ -0,0 +1,846 @@ +/** + * \file adrv903x_bf_rx_funcs.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_RX_FUNCS_H_ +#define _ADRV903X_BF_RX_FUNCS_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_rx_funcs_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcovrgHigh_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcovrgLow_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcovrgLowInt0Counter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcovrgLowInt0Counter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcovrgLowInt1Counter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcovrgLowInt1Counter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcHighOvrgExceededCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcHighOvrgExceededCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcLowOvrgExceededCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcLowOvrgExceededCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcResetGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAdcResetGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAttackDelay_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcAttackDelay_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcChangeGainIfAdcovrgHigh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcChangeGainIfAdcovrgHigh_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcChangeGainIfUlbthHigh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcChangeGainIfUlbthHigh_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDelayCounterBaseRate_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandExtTableLowerIndex_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandExtTableLowerIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandExtTableUpperIndex_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandExtTableUpperIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandHighLnaThreshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandHighLnaThreshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandLnaStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandLnaStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandLowLnaThreshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandLowLnaThreshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandMaxIndex_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandMaxIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandPwrMargin_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcDualbandPwrMargin_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcEnableFastRecoveryLoop_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcEnableFastRecoveryLoop_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcEnableGainIndexUpdate_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcEnableSyncPulseForGainCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcEnableSyncPulseForGainCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcGainIndex_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcGainIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcGainUpdateCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint32_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcGainUpdateCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint32_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLlbGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLlbGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLlbThresholdExceededCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLlbThresholdExceededCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLlBlocker_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLockLevel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLockLevel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower0Threshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower0Threshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower0ThresholdExceededGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower0ThresholdExceededGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower1Threshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower1Threshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower1ThresholdExceededGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLower1ThresholdExceededGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLowThsPreventGainInc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcLowThsPreventGainInc_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcManualGainIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcManualGainPinControl_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcMaximumGainIndex_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcMaximumGainIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcMinimumGainIndex_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcMinimumGainIndex_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgHighGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgHighGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgLowGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgLowGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgLowInt0GainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgLowInt0GainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgLowInt1GainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgLowInt1GainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcOvrgResetpdHighCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcPeakThresholdGainControlMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcPeakThresholdGainControlMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcPeakWaitTime_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcPeakWaitTime_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcResetCounters_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcResetOnRxon_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcResetOnRxon_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSetup_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSetup_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSlowloopFreezeEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSlowloopFreezeEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSlowLoopSettlingDelay_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSlowLoopSettlingDelay_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcSoftReset_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUlbGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUlbGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUlbThresholdExceededCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUlbThresholdExceededCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUlBlocker_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUpper0ThresholdExceededGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUpper0ThresholdExceededGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUpper1Threshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUpper1Threshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUpper1ThresholdExceededGainStep_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUpper1ThresholdExceededGainStep_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUrangeInterval0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUrangeInterval0_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUrangeInterval1Mult_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUrangeInterval1Mult_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUrangeInterval2Mult_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUrangeInterval2Mult_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_AgcUseCountersForMgc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_ApdHighSrcSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_ApdHighSrcSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_ApdLowSrcSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_ApdLowSrcSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_BbdcTrackingEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_BbdcTrackingEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerDataSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerDataSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerEnSpiOrAgcSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerEnSpiOrAgcSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerMeasurementDuration_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerMeasurementDuration_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerReadback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerStartDelayCounter_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerTddModeEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DecPowerValue_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DualbandControlBandA_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_DualbandControlBandB_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_Hb2HighSrcSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_Hb2HighSrcSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_Hb2LowSrcSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_Hb2LowSrcSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_Hb2OverloadUseHb2In_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_Hb2OverloadUseHb2In_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_InvertApdLow_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_InvertApdLow_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_InvertHb2Low_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_InvertHb2Low_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadEnAgc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadEnAgc_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadPowerModeAgc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadPowerModeAgc_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcHigh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcHigh_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcInt0Low_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcInt0Low_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcInt1Low_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcInt1Low_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcLow_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcLow_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_OverloadThAgcPre_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakCountExpirationAgc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint32_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakCountSpacingAgcHigh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakCountSpacingAgcLow_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakCountThresholdAgcHigh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakCountThresholdAgcLow_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakSampleCountAgc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakSampleCountAgc_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakWindowSizeAgc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_PeakWindowSizeAgc_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_ReadGainTable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_RxdpSlicerPosition_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncs_TiaValidOverride_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfRxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +#endif // _ADRV903X_BF_RX_FUNCS_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_funcs_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_funcs_types.h new file mode 100644 index 0000000000000..f5b794ef531c3 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_rx_funcs_types.h @@ -0,0 +1,31 @@ +/** + * \file adrv903x_bf_rx_funcs_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_RX_FUNCS_TYPES_H_ +#define _ADRV903X_BF_RX_FUNCS_TYPES_H_ + +typedef enum adrv903x_BfRxFuncsChanAddr +{ + ADRV903X_BF_SLICE_RX_0__RX_FUNCS = 0x60030000, + ADRV903X_BF_SLICE_RX_1__RX_FUNCS = 0x60130000, + ADRV903X_BF_SLICE_RX_2__RX_FUNCS = 0x60230000, + ADRV903X_BF_SLICE_RX_3__RX_FUNCS = 0x60330000, + ADRV903X_BF_SLICE_RX_4__RX_FUNCS = 0x60430000, + ADRV903X_BF_SLICE_RX_5__RX_FUNCS = 0x60530000, + ADRV903X_BF_SLICE_RX_6__RX_FUNCS = 0x60630000, + ADRV903X_BF_SLICE_RX_7__RX_FUNCS = 0x60730000 +} adrv903x_BfRxFuncsChanAddr_e; + +#endif // _ADRV903X_BF_RX_FUNCS_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.c new file mode 100644 index 0000000000000..434061063e084 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.c @@ -0,0 +1,221 @@ +/** + * \file adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.c Automatically generated file with generator ver + * 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_SERDES_RXDIG_8PACK_REGMAP_CORE1P2 + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesRxdig8packRegmapCore1p2_CtrlIbiasFix_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesRxdig8packRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_SerdesRxdig8packRegmapCore1p2_CtrlIbiasFix_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_SerdesRxdig8packRegmapCore1p2_CtrlIbiasFix_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3U), + ((uint32_t) bfValue << 4), + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesRxdig8packRegmapCore1p2_CtrlIbiasFix_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesRxdig8packRegmapCore1p2ChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_SerdesRxdig8packRegmapCore1p2_CtrlIbiasFix_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3U), + &bfValueTmp, + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesRxdig8packRegmapCore1p2_RxdesPdCh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesRxdig8packRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_SerdesRxdig8packRegmapCore1p2_RxdesPdCh_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_SerdesRxdig8packRegmapCore1p2_RxdesPdCh_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x0U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesRxdig8packRegmapCore1p2_RxdesPdCh_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesRxdig8packRegmapCore1p2ChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_SerdesRxdig8packRegmapCore1p2_RxdesPdCh_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x0U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.h new file mode 100644 index 0000000000000..2de49ec727c90 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.h @@ -0,0 +1,52 @@ +/** + * \file adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.h Automatically generated file with generator ver + * 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_SERDES_RXDIG_8PACK_REGMAP_CORE1P2_H_ +#define _ADRV903X_BF_SERDES_RXDIG_8PACK_REGMAP_CORE1P2_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesRxdig8packRegmapCore1p2_CtrlIbiasFix_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesRxdig8packRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesRxdig8packRegmapCore1p2_CtrlIbiasFix_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesRxdig8packRegmapCore1p2ChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesRxdig8packRegmapCore1p2_RxdesPdCh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesRxdig8packRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesRxdig8packRegmapCore1p2_RxdesPdCh_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesRxdig8packRegmapCore1p2ChanAddr_e baseAddr, + uint8_t* const bfValue); + +#endif // _ADRV903X_BF_SERDES_RXDIG_8PACK_REGMAP_CORE1P2_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2_types.h new file mode 100644 index 0000000000000..244977e17b880 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2_types.h @@ -0,0 +1,25 @@ +/** + * \file adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2_types.h Automatically generated file with generator + * ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_SERDES_RXDIG_8PACK_REGMAP_CORE1P2_TYPES_H_ +#define _ADRV903X_BF_SERDES_RXDIG_8PACK_REGMAP_CORE1P2_TYPES_H_ + +typedef enum adrv903x_BfSerdesRxdig8packRegmapCore1p2ChanAddr +{ + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK = 0x48088000 +} adrv903x_BfSerdesRxdig8packRegmapCore1p2ChanAddr_e; + +#endif // _ADRV903X_BF_SERDES_RXDIG_8PACK_REGMAP_CORE1P2_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2.c new file mode 100644 index 0000000000000..5d7b6d3db400e --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2.c @@ -0,0 +1,143 @@ +/** + * \file adrv903x_bf_serdes_rxdig_phy_regmap_core1p2.c Automatically generated file with generator ver + * 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_SERDES_RXDIG_PHY_REGMAP_CORE1P2 + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesRxdigPhyRegmapCore1p2_AfePdVcm_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesRxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_SerdesRxdigPhyRegmapCore1p2_AfePdVcm_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_2_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_3_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_4_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_5_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_6_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_7_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_ALL)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_SerdesRxdigPhyRegmapCore1p2_AfePdVcm_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesRxdigPhyRegmapCore1p2_RxdesAmuxSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesRxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_SerdesRxdigPhyRegmapCore1p2_RxdesAmuxSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_2_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_3_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_4_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_5_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_6_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_7_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_ALL)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_SerdesRxdigPhyRegmapCore1p2_RxdesAmuxSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xEU), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2.h new file mode 100644 index 0000000000000..2d4c5c34b96c9 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2.h @@ -0,0 +1,42 @@ +/** + * \file adrv903x_bf_serdes_rxdig_phy_regmap_core1p2.h Automatically generated file with generator ver + * 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_SERDES_RXDIG_PHY_REGMAP_CORE1P2_H_ +#define _ADRV903X_BF_SERDES_RXDIG_PHY_REGMAP_CORE1P2_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesRxdigPhyRegmapCore1p2_AfePdVcm_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesRxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesRxdigPhyRegmapCore1p2_RxdesAmuxSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesRxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue); + +#endif // _ADRV903X_BF_SERDES_RXDIG_PHY_REGMAP_CORE1P2_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2_types.h new file mode 100644 index 0000000000000..3706df6c13f3f --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2_types.h @@ -0,0 +1,43 @@ +/** + * \file adrv903x_bf_serdes_rxdig_phy_regmap_core1p2_types.h Automatically generated file with generator ver + * 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_SERDES_RXDIG_PHY_REGMAP_CORE1P2_TYPES_H_ +#define _ADRV903X_BF_SERDES_RXDIG_PHY_REGMAP_CORE1P2_TYPES_H_ + +typedef enum adrv903x_BfSerdesRxdigPhyRegmapCore1p2ChanAddr +{ + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_0_ = 0x48080000, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_1_ = 0x48080800, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_2_ = 0x48081000, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_3_ = 0x48081800, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_4_ = 0x48082000, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_5_ = 0x48082800, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_6_ = 0x48083000, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_7_ = 0x48083800, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_ALL = 0x48084000 +} adrv903x_BfSerdesRxdigPhyRegmapCore1p2ChanAddr_e; + +/** + * \brief Enumeration for softreset + */ + +typedef enum adrv903x_Bf_SerdesRxdigPhyRegmapCore1p2_Softreset +{ + ADRV903X_BF_SERDES_RXDIG_PHY_REGMAP_CORE1P2_SOFTRESET_SOFT_RESETB = 0, /*!< Deassert Soft Reset. */ + ADRV903X_BF_SERDES_RXDIG_PHY_REGMAP_CORE1P2_SOFTRESET_SOFT_RESET = 1 /*!< Assert Soft Reset. */ +} adrv903x_Bf_SerdesRxdigPhyRegmapCore1p2_Softreset_e; + +#endif // _ADRV903X_BF_SERDES_RXDIG_PHY_REGMAP_CORE1P2_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2.c new file mode 100644 index 0000000000000..c5eedd2bb4edd --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2.c @@ -0,0 +1,313 @@ +/** + * \file adrv903x_bf_serdes_txdig_phy_regmap_core1p2.c Automatically generated file with generator ver + * 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_SERDES_TXDIG_PHY_REGMAP_CORE1P2 + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesTxdigPhyRegmapCore1p2_ClkoffsetSerRc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_SerdesTxdigPhyRegmapCore1p2_ClkoffsetSerRc_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_2_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_3_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_4_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_5_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_6_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_7_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_ALL)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_SerdesTxdigPhyRegmapCore1p2_ClkoffsetSerRc_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x7U), + (uint32_t) bfValue, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesTxdigPhyRegmapCore1p2_FifoStartAddr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_SerdesTxdigPhyRegmapCore1p2_FifoStartAddr_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_2_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_3_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_4_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_5_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_6_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_7_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_ALL)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_SerdesTxdigPhyRegmapCore1p2_FifoStartAddr_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x20U), + ((uint32_t) bfValue << 4), + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesTxdigPhyRegmapCore1p2_PdSer_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_SerdesTxdigPhyRegmapCore1p2_PdSer_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_2_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_3_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_4_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_5_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_6_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_7_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_ALL)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_SerdesTxdigPhyRegmapCore1p2_PdSer_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x0U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesTxdigPhyRegmapCore1p2_PdSer_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_2_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_3_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_4_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_5_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_6_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_7_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_ALL)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_SerdesTxdigPhyRegmapCore1p2_PdSer_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x0U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesTxdigPhyRegmapCore1p2_SerEnRc_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_0_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_1_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_2_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_3_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_4_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_5_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_6_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_7_) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_ALL)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_SerdesTxdigPhyRegmapCore1p2_SerEnRc_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2.h new file mode 100644 index 0000000000000..ae6671562b800 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2.h @@ -0,0 +1,57 @@ +/** + * \file adrv903x_bf_serdes_txdig_phy_regmap_core1p2.h Automatically generated file with generator ver + * 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_SERDES_TXDIG_PHY_REGMAP_CORE1P2_H_ +#define _ADRV903X_BF_SERDES_TXDIG_PHY_REGMAP_CORE1P2_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesTxdigPhyRegmapCore1p2_ClkoffsetSerRc_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesTxdigPhyRegmapCore1p2_FifoStartAddr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesTxdigPhyRegmapCore1p2_PdSer_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesTxdigPhyRegmapCore1p2_PdSer_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SerdesTxdigPhyRegmapCore1p2_SerEnRc_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e baseAddr, + uint8_t* const bfValue); + +#endif // _ADRV903X_BF_SERDES_TXDIG_PHY_REGMAP_CORE1P2_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2_types.h new file mode 100644 index 0000000000000..4fbff9c7eca28 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2_types.h @@ -0,0 +1,33 @@ +/** + * \file adrv903x_bf_serdes_txdig_phy_regmap_core1p2_types.h Automatically generated file with generator ver + * 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_SERDES_TXDIG_PHY_REGMAP_CORE1P2_TYPES_H_ +#define _ADRV903X_BF_SERDES_TXDIG_PHY_REGMAP_CORE1P2_TYPES_H_ + +typedef enum adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr +{ + ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_0_ = 0x48070000, + ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_1_ = 0x48070800, + ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_2_ = 0x48071000, + ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_3_ = 0x48071800, + ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_4_ = 0x48072000, + ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_5_ = 0x48072800, + ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_6_ = 0x48073000, + ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_7_ = 0x48073800, + ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_ALL = 0x48074000 +} adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e; + +#endif // _ADRV903X_BF_SERDES_TXDIG_PHY_REGMAP_CORE1P2_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_streamproc.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_streamproc.c new file mode 100644 index 0000000000000..ea4931d2e9e42 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_streamproc.c @@ -0,0 +1,446 @@ +/** + * \file adrv903x_bf_streamproc.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_streamproc.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_STREAMPROC + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Streamproc_DbgRdbkMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfStreamprocChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Streamproc_DbgRdbkMode_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_MAIN_STREAM_PROC) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_KFA_STREAM_PROC_REGS) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_ORX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__SLICE_AHB_STREAM_PROC)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Streamproc_DbgRdbkMode_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x5U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Streamproc_ErroredStreamNumber_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfStreamprocChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 255U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Streamproc_ErroredStreamNumber_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_MAIN_STREAM_PROC) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_KFA_STREAM_PROC_REGS) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_ORX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__SLICE_AHB_STREAM_PROC)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Streamproc_ErroredStreamNumber_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x14U), + (uint32_t) bfValue, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Streamproc_ErroredStreamNumber_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfStreamprocChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_MAIN_STREAM_PROC) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_KFA_STREAM_PROC_REGS) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_ORX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__SLICE_AHB_STREAM_PROC)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Streamproc_ErroredStreamNumber_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x14U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Streamproc_RdbkErrorVal_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfStreamprocChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_MAIN_STREAM_PROC) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_KFA_STREAM_PROC_REGS) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_ORX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__SLICE_AHB_STREAM_PROC)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Streamproc_RdbkErrorVal_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x24U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x25U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Streamproc_StreamError_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfStreamprocChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_Streamproc_StreamError_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_MAIN_STREAM_PROC) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_KFA_STREAM_PROC_REGS) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_ORX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__SLICE_AHB_STREAM_PROC)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Streamproc_StreamError_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Streamproc_StreamError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfStreamprocChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_DIGITAL_CORE_MAIN_STREAM_PROC) && + (baseAddr != ADRV903X_BF_DIGITAL_CORE_KFA_STREAM_PROC_REGS) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_ORX_0__SLICE_AHB_STREAM_PROC) && + (baseAddr != ADRV903X_BF_SLICE_ORX_1__SLICE_AHB_STREAM_PROC)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_Streamproc_StreamError_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3U), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_streamproc.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_streamproc.h new file mode 100644 index 0000000000000..e970a68a2a713 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_streamproc.h @@ -0,0 +1,61 @@ +/** + * \file adrv903x_bf_streamproc.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_STREAMPROC_H_ +#define _ADRV903X_BF_STREAMPROC_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_streamproc_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Streamproc_DbgRdbkMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfStreamprocChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Streamproc_ErroredStreamNumber_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfStreamprocChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Streamproc_ErroredStreamNumber_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfStreamprocChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Streamproc_RdbkErrorVal_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfStreamprocChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Streamproc_StreamError_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfStreamprocChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Streamproc_StreamError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfStreamprocChanAddr_e baseAddr, + uint8_t* const bfValue); + +#endif // _ADRV903X_BF_STREAMPROC_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_streamproc_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_streamproc_types.h new file mode 100644 index 0000000000000..6daa5f3df99cf --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_streamproc_types.h @@ -0,0 +1,43 @@ +/** + * \file adrv903x_bf_streamproc_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_STREAMPROC_TYPES_H_ +#define _ADRV903X_BF_STREAMPROC_TYPES_H_ + +typedef enum adrv903x_BfStreamprocChanAddr +{ + ADRV903X_BF_DIGITAL_CORE_MAIN_STREAM_PROC = 0x46B00000, + ADRV903X_BF_DIGITAL_CORE_KFA_STREAM_PROC_REGS = 0x4C080000, + ADRV903X_BF_SLICE_RX_0__SLICE_AHB_STREAM_PROC = 0x60022000, + ADRV903X_BF_SLICE_RX_1__SLICE_AHB_STREAM_PROC = 0x60122000, + ADRV903X_BF_SLICE_RX_2__SLICE_AHB_STREAM_PROC = 0x60222000, + ADRV903X_BF_SLICE_RX_3__SLICE_AHB_STREAM_PROC = 0x60322000, + ADRV903X_BF_SLICE_RX_4__SLICE_AHB_STREAM_PROC = 0x60422000, + ADRV903X_BF_SLICE_RX_5__SLICE_AHB_STREAM_PROC = 0x60522000, + ADRV903X_BF_SLICE_RX_6__SLICE_AHB_STREAM_PROC = 0x60622000, + ADRV903X_BF_SLICE_RX_7__SLICE_AHB_STREAM_PROC = 0x60722000, + ADRV903X_BF_SLICE_TX_0__SLICE_AHB_STREAM_PROC = 0x60822000, + ADRV903X_BF_SLICE_TX_1__SLICE_AHB_STREAM_PROC = 0x60922000, + ADRV903X_BF_SLICE_TX_2__SLICE_AHB_STREAM_PROC = 0x60A22000, + ADRV903X_BF_SLICE_TX_3__SLICE_AHB_STREAM_PROC = 0x60B22000, + ADRV903X_BF_SLICE_TX_4__SLICE_AHB_STREAM_PROC = 0x60C22000, + ADRV903X_BF_SLICE_TX_5__SLICE_AHB_STREAM_PROC = 0x60D22000, + ADRV903X_BF_SLICE_TX_6__SLICE_AHB_STREAM_PROC = 0x60E22000, + ADRV903X_BF_SLICE_TX_7__SLICE_AHB_STREAM_PROC = 0x60F22000, + ADRV903X_BF_SLICE_ORX_0__SLICE_AHB_STREAM_PROC = 0x61022000, + ADRV903X_BF_SLICE_ORX_1__SLICE_AHB_STREAM_PROC = 0x61122000 +} adrv903x_BfStreamprocChanAddr_e; + +#endif // _ADRV903X_BF_STREAMPROC_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tdr_dpath_top.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tdr_dpath_top.c new file mode 100644 index 0000000000000..71146fd35ac66 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tdr_dpath_top.c @@ -0,0 +1,150 @@ +/** + * \file adrv903x_bf_tdr_dpath_top.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_tdr_dpath_top.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_TDR_DPATH_TOP + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TdrDpathTop_FlashThresh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTdrDpathTopChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TdrDpathTop_FlashThresh_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TdrDpathTop_FlashThresh_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x330U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TdrDpathTop_FlashThresh_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTdrDpathTopChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_RX_0__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_0__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_1__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_2__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_3__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_4__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_5__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_6__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_) && + (baseAddr != ADRV903X_BF_SLICE_RX_7__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TdrDpathTop_FlashThresh_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x330U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tdr_dpath_top.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tdr_dpath_top.h new file mode 100644 index 0000000000000..8a92c383131d0 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tdr_dpath_top.h @@ -0,0 +1,40 @@ +/** + * \file adrv903x_bf_tdr_dpath_top.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_TDR_DPATH_TOP_H_ +#define _ADRV903X_BF_TDR_DPATH_TOP_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_tdr_dpath_top_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TdrDpathTop_FlashThresh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTdrDpathTopChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TdrDpathTop_FlashThresh_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTdrDpathTopChanAddr_e baseAddr, + uint8_t* const bfValue); +#endif // _ADRV903X_BF_TDR_DPATH_TOP_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tdr_dpath_top_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tdr_dpath_top_types.h new file mode 100644 index 0000000000000..0d600ea8a6582 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tdr_dpath_top_types.h @@ -0,0 +1,39 @@ +/** + * \file adrv903x_bf_tdr_dpath_top_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_TDR_DPATH_TOP_TYPES_H_ +#define _ADRV903X_BF_TDR_DPATH_TOP_TYPES_H_ + +typedef enum adrv903x_BfTdrDpathTopChanAddr +{ + ADRV903X_BF_SLICE_RX_0__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_ = 0x600D0000, + ADRV903X_BF_SLICE_RX_0__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_ = 0x600D0800, + ADRV903X_BF_SLICE_RX_1__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_ = 0x601D0000, + ADRV903X_BF_SLICE_RX_1__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_ = 0x601D0800, + ADRV903X_BF_SLICE_RX_2__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_ = 0x602D0000, + ADRV903X_BF_SLICE_RX_2__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_ = 0x602D0800, + ADRV903X_BF_SLICE_RX_3__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_ = 0x603D0000, + ADRV903X_BF_SLICE_RX_3__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_ = 0x603D0800, + ADRV903X_BF_SLICE_RX_4__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_ = 0x604D0000, + ADRV903X_BF_SLICE_RX_4__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_ = 0x604D0800, + ADRV903X_BF_SLICE_RX_5__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_ = 0x605D0000, + ADRV903X_BF_SLICE_RX_5__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_ = 0x605D0800, + ADRV903X_BF_SLICE_RX_6__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_ = 0x606D0000, + ADRV903X_BF_SLICE_RX_6__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_ = 0x606D0800, + ADRV903X_BF_SLICE_RX_7__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_ = 0x607D0000, + ADRV903X_BF_SLICE_RX_7__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_ = 0x607D0800 +} adrv903x_BfTdrDpathTopChanAddr_e; + +#endif // _ADRV903X_BF_TDR_DPATH_TOP_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_datapath.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_datapath.c new file mode 100644 index 0000000000000..859aa653336b6 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_datapath.c @@ -0,0 +1,500 @@ +/** + * \file adrv903x_bf_tx_datapath.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_tx_datapath.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_TX_DATAPATH + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDatapath_PfirCoeffDataI_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDatapathChanAddr_e baseAddr, + uint8_t channelId, + const uint32_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 4294967295U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDatapath_PfirCoeffDataI_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DATAPATH)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDatapath_PfirCoeffDataI_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) && + (channelId != 0x8) && + (channelId != 0x9) && + (channelId != 0xA) && + (channelId != 0xB) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_TxDatapath_PfirCoeffDataI_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x18 + channelId * 4), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x19 + channelId * 4), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1A + channelId * 4), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1B + channelId * 4), + bfValue >> 24, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDatapath_PfirCoeffDataI_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDatapathChanAddr_e baseAddr, + uint8_t channelId, + uint32_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint32_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DATAPATH)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDatapath_PfirCoeffDataI_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) && + (channelId != 0x8) && + (channelId != 0x9) && + (channelId != 0xA) && + (channelId != 0xB) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_TxDatapath_PfirCoeffDataI_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x18 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x19 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1A + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 16); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1B + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 24); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDatapath_PfirCoeffDataQ_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDatapathChanAddr_e baseAddr, + uint8_t channelId, + const uint32_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 4294967295U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDatapath_PfirCoeffDataQ_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DATAPATH)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDatapath_PfirCoeffDataQ_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) && + (channelId != 0x8) && + (channelId != 0x9) && + (channelId != 0xA) && + (channelId != 0xB) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_TxDatapath_PfirCoeffDataQ_BfSet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x48 + channelId * 4), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x49 + channelId * 4), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4A + channelId * 4), + bfValue >> 16, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4B + channelId * 4), + bfValue >> 24, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDatapath_PfirCoeffDataQ_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDatapathChanAddr_e baseAddr, + uint8_t channelId, + uint32_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint32_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DATAPATH) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DATAPATH)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDatapath_PfirCoeffDataQ_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + +#if ADRV903X_CHANNELID_CHECK > 0 + if ( + (channelId != 0x0) && + (channelId != 0x1) && + (channelId != 0x2) && + (channelId != 0x3) && + (channelId != 0x4) && + (channelId != 0x5) && + (channelId != 0x6) && + (channelId != 0x7) && + (channelId != 0x8) && + (channelId != 0x9) && + (channelId != 0xA) && + (channelId != 0xB) + ) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + channelId, + "Invalid adrv903x_TxDatapath_PfirCoeffDataQ_BfGet Channel ID"); + return recoveryAction; + } +#endif /* ADRV903X_CHANNEL_ID_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x48 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x49 + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 8); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4A + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 16); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4B + channelId * 4U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint32_t) bfValueTmp << 24); + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_datapath.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_datapath.h new file mode 100644 index 0000000000000..bb38ae31fd38c --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_datapath.h @@ -0,0 +1,55 @@ +/** + * \file adrv903x_bf_tx_datapath.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_TX_DATAPATH_H_ +#define _ADRV903X_BF_TX_DATAPATH_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_tx_datapath_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDatapath_PfirCoeffDataI_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDatapathChanAddr_e baseAddr, + uint8_t channelId, + const uint32_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDatapath_PfirCoeffDataI_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDatapathChanAddr_e baseAddr, + uint8_t channelId, + uint32_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDatapath_PfirCoeffDataQ_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDatapathChanAddr_e baseAddr, + uint8_t channelId, + const uint32_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDatapath_PfirCoeffDataQ_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDatapathChanAddr_e baseAddr, + uint8_t channelId, + uint32_t* const bfValue); + +#endif // _ADRV903X_BF_TX_DATAPATH_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_datapath_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_datapath_types.h new file mode 100644 index 0000000000000..f918e21901d79 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_datapath_types.h @@ -0,0 +1,31 @@ +/** + * \file adrv903x_bf_tx_datapath_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_TX_DATAPATH_TYPES_H_ +#define _ADRV903X_BF_TX_DATAPATH_TYPES_H_ + +typedef enum adrv903x_BfTxDatapathChanAddr +{ + ADRV903X_BF_SLICE_TX_0__TX_DATAPATH = 0x60838000, + ADRV903X_BF_SLICE_TX_1__TX_DATAPATH = 0x60938000, + ADRV903X_BF_SLICE_TX_2__TX_DATAPATH = 0x60A38000, + ADRV903X_BF_SLICE_TX_3__TX_DATAPATH = 0x60B38000, + ADRV903X_BF_SLICE_TX_4__TX_DATAPATH = 0x60C38000, + ADRV903X_BF_SLICE_TX_5__TX_DATAPATH = 0x60D38000, + ADRV903X_BF_SLICE_TX_6__TX_DATAPATH = 0x60E38000, + ADRV903X_BF_SLICE_TX_7__TX_DATAPATH = 0x60F38000 +} adrv903x_BfTxDatapathChanAddr_e; + +#endif // _ADRV903X_BF_TX_DATAPATH_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_dig.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_dig.c new file mode 100644 index 0000000000000..9296a071594eb --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_dig.c @@ -0,0 +1,2669 @@ +/** + * \file adrv903x_bf_tx_dig.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_tx_dig.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_TX_DIG + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_DtxForceGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_DtxForceGpioSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_DtxForceGpioSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x38U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_DtxStatus_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_DtxStatus_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x50U), + &bfValueTmp, + 0xC0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_DtxZeroCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_DtxZeroCounter_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x52U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x53U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_RadClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 7U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_RadClkDivideRatio_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_RadClkDivideRatio_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0xEU), + ((uint32_t) bfValue << 4), + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_RadClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_RadClkDivideRatio_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0xEU), + &bfValueTmp, + 0x70U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_Spi2TxAttenGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_Spi2TxAttenGpioSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_Spi2TxAttenGpioSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x38), + bfValue << 5, + 0xE0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x39), + bfValue >> 3, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_Spi2TxAttenGpioSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_Spi2TxAttenGpioSelect_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x38U), + &bfValueTmp, + 0xE0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint8_t) bfValueTmp >> 5); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x39U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint8_t) bfValueTmp << 3); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_StreamprocDuc0Hb3OutClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_StreamprocDuc0Hb3OutClkEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_StreamprocDuc0Hb3OutClkEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1EU), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_StreamprocPfirClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_StreamprocPfirClkEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_StreamprocPfirClkEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1CU), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TpcDecrAttenGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TpcDecrAttenGpioSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TpcDecrAttenGpioSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x39U), + ((uint32_t) bfValue << 2), + 0x7CU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TpcIncrAttenGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TpcIncrAttenGpioSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TpcIncrAttenGpioSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x39), + bfValue << 7, + 0x80); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3A), + bfValue >> 1, + 0xF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxAttenClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxAttenClkDivideRatio_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4U), + &bfValueTmp, + 0x7U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxAttenClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxAttenClkEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxAttenClkEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x7U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxAttenUpdGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxAttenUpdGpioSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxAttenUpdGpioSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3A), + bfValue << 4, + 0xF0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3B), + bfValue >> 4, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxAttenUpdGpioSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxAttenUpdGpioSelect_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3AU), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint8_t) bfValueTmp >> 4); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3BU), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint8_t) bfValueTmp << 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxCptBusy_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxCptBusy_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x58U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxCptTrigger_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxCptTrigger_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxCptTrigger_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x54U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxDuc0TssiPinEnableSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxDuc0TssiPinEnableSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxDuc0TssiPinEnableSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3CU), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection0_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection0_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x40U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection1_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection1_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x40), + bfValue << 5, + 0xE0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x41), + bfValue >> 3, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection10_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection10_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x46), + bfValue << 4, + 0xF0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x47), + bfValue >> 4, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection11_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection11_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x47U), + ((uint32_t) bfValue << 1), + 0x3EU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection12_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection12_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x48U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection13_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection13_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x48), + bfValue << 5, + 0xE0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x49), + bfValue >> 3, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection14_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection14_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x49U), + ((uint32_t) bfValue << 2), + 0x7CU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection15_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection15_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x49), + bfValue << 7, + 0x80); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4A), + bfValue >> 1, + 0xF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection16_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection16_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4A), + bfValue << 4, + 0xF0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4B), + bfValue >> 4, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection17_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection17_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4BU), + ((uint32_t) bfValue << 1), + 0x3EU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection18_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection18_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4CU), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection19_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection19_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4C), + bfValue << 5, + 0xE0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4D), + bfValue >> 3, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection2_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection2_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x41U), + ((uint32_t) bfValue << 2), + 0x7CU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection20_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection20_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4DU), + ((uint32_t) bfValue << 2), + 0x7CU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection21_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection21_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4D), + bfValue << 7, + 0x80); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4E), + bfValue >> 1, + 0xF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection22_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection22_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4E), + bfValue << 4, + 0xF0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4F), + bfValue >> 4, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection23_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection23_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x4FU), + ((uint32_t) bfValue << 1), + 0x3EU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection3_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection3_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x41), + bfValue << 7, + 0x80); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x42), + bfValue >> 1, + 0xF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection4_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection4_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x42), + bfValue << 4, + 0xF0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x43), + bfValue >> 4, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection5_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection5_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x43U), + ((uint32_t) bfValue << 1), + 0x3EU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection6_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection6_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x44U), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection7_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection7_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x44), + bfValue << 5, + 0xE0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x45), + bfValue >> 3, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection8_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection8_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x45U), + ((uint32_t) bfValue << 2), + 0x7CU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxDig_TxGpioSourceSelection9_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_DIG) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_DIG)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxDig_TxGpioSourceSelection9_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x45), + bfValue << 7, + 0x80); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x46), + bfValue >> 1, + 0xF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_dig.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_dig.h new file mode 100644 index 0000000000000..b1f30bf8ca791 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_dig.h @@ -0,0 +1,241 @@ +/** + * \file adrv903x_bf_tx_dig.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_TX_DIG_H_ +#define _ADRV903X_BF_TX_DIG_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_tx_dig_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_DtxForceGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_DtxStatus_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_DtxZeroCounter_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_RadClkDivideRatio_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_RadClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_Spi2TxAttenGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_Spi2TxAttenGpioSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_StreamprocDuc0Hb3OutClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_StreamprocPfirClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TpcDecrAttenGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TpcIncrAttenGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxAttenClkDivideRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxAttenClkEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxAttenUpdGpioSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxAttenUpdGpioSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxCptBusy_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxCptTrigger_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxDuc0TssiPinEnableSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection0_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection1_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection10_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection11_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection12_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection13_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection14_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection15_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection16_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection17_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection18_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection19_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection2_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection20_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection21_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection22_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection23_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection3_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection4_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection5_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection6_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection7_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection8_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDig_TxGpioSourceSelection9_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxDigChanAddr_e baseAddr, + const uint8_t bfValue); + +#endif // _ADRV903X_BF_TX_DIG_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_dig_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_dig_types.h new file mode 100644 index 0000000000000..ecad5179bad6d --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_dig_types.h @@ -0,0 +1,31 @@ +/** + * \file adrv903x_bf_tx_dig_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_TX_DIG_TYPES_H_ +#define _ADRV903X_BF_TX_DIG_TYPES_H_ + +typedef enum adrv903x_BfTxDigChanAddr +{ + ADRV903X_BF_SLICE_TX_0__TX_DIG = 0x60830000, + ADRV903X_BF_SLICE_TX_1__TX_DIG = 0x60930000, + ADRV903X_BF_SLICE_TX_2__TX_DIG = 0x60A30000, + ADRV903X_BF_SLICE_TX_3__TX_DIG = 0x60B30000, + ADRV903X_BF_SLICE_TX_4__TX_DIG = 0x60C30000, + ADRV903X_BF_SLICE_TX_5__TX_DIG = 0x60D30000, + ADRV903X_BF_SLICE_TX_6__TX_DIG = 0x60E30000, + ADRV903X_BF_SLICE_TX_7__TX_DIG = 0x60F30000 +} adrv903x_BfTxDigChanAddr_e; + +#endif // _ADRV903X_BF_TX_DIG_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_funcs.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_funcs.c new file mode 100644 index 0000000000000..1eee23fcb5140 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_funcs.c @@ -0,0 +1,6068 @@ +/** + * \file adrv903x_bf_tx_funcs.c Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../private/bf/adrv903x_bf_tx_funcs.h" +#include "adi_common_error.h" +#include "adi_adrv903x_error.h" + +#include "adrv903x_bf_error_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BF_TX_FUNCS + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_AnaRampHoldSampleEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_AnaRampHoldSampleEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_AnaRampHoldSampleEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2U), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_AnaRampHoldSampleEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_AnaRampHoldSampleEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x2U), + &bfValueTmp, + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_JesdDfrmMask_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_JesdDfrmMask_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_JesdDfrmMask_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2U), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_JesdDfrmMask_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_JesdDfrmMask_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x2U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAprEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionAprEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAprEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x34U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAprEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAprEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x34U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAverageDur_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionAverageDur_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAverageDur_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x31U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAverageErrorPower_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAverageErrorPower_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4CU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4DU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAveragePeakRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAveragePeakRatio_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x44U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x45U), + &bfValueTmp, + 0x7FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAveragePower_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAveragePower_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x40U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x41U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAverageThreshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 65535U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionAverageThreshold_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAverageThreshold_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x32), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x33), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAverageThreshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAverageThreshold_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x32U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x33U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionAvgpowerEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAvgpowerEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x30U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAvgpowerEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x30U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAvgpowerError_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x48U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerErrorClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionAvgpowerErrorClear_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAvgpowerErrorClear_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x48U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerErrorClearRequired_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionAvgpowerErrorClearRequired_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAvgpowerErrorClearRequired_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x30U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerErrorClearRequired_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAvgpowerErrorClearRequired_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x30U), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerIrqEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionAvgpowerIrqEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAvgpowerIrqEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x30U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerIrqEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAvgpowerIrqEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x30U), + &bfValueTmp, + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 1); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerRdnEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionAvgpowerRdnEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAvgpowerRdnEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x30U), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerRdnEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionAvgpowerRdnEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x30U), + &bfValueTmp, + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionGainRampUpEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionGainRampUpEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionGainRampUpEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x48U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionInputSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionInputSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionInputSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x30U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionInputSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionInputSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x30U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionOverloadCountTh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionOverloadCountTh_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionOverloadCountTh_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3BU), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionOverloadThPre_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 511U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionOverloadThPre_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionOverloadThPre_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x38), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x39), + bfValue >> 8, + 0x1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionOverloadWindowSize_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionOverloadWindowSize_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionOverloadWindowSize_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3AU), + (uint32_t) bfValue, + 0x1FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionPeakpowerEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakpowerEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x34U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakpowerEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x34U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakpowerError_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x48U), + &bfValueTmp, + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerErrorClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionPeakpowerErrorClear_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakpowerErrorClear_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x48U), + ((uint32_t) bfValue << 3), + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerErrorClearRequired_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionPeakpowerErrorClearRequired_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakpowerErrorClearRequired_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x34U), + ((uint32_t) bfValue << 3), + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerErrorClearRequired_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakpowerErrorClearRequired_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x34U), + &bfValueTmp, + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 3); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerIrqEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionPeakpowerIrqEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakpowerIrqEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x34U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerIrqEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakpowerIrqEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x34U), + &bfValueTmp, + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 1); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerRdnEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionPeakpowerRdnEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakpowerRdnEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x34U), + ((uint32_t) bfValue << 2), + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerRdnEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakpowerRdnEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x34U), + &bfValueTmp, + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 63U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionPeakCount_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakCount_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x34), + bfValue << 6, + 0xC0); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x35), + bfValue >> 2, + 0xF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakCount_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x34U), + &bfValueTmp, + 0xC0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint8_t) bfValueTmp >> 6); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x35U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint8_t) bfValueTmp << 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakDur_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionPeakDur_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakDur_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x35U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakDur_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakDur_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x35U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakErrorPower_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakErrorPower_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4EU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x4FU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakPower_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakPower_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x42U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x43U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakThreshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 65535U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionPeakThreshold_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakThreshold_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x36), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x37), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakThreshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionPeakThreshold_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x36U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x37U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionRampMaxAttenuation_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 127U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionRampMaxAttenuation_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionRampMaxAttenuation_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3CU), + (uint32_t) bfValue, + 0x7FU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionRampStepDuration_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionRampStepDuration_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionRampStepDuration_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3DU), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionRampStepSize_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionRampStepSize_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionRampStepSize_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3DU), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionReadbackUpdate_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PaProtectionReadbackUpdate_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PaProtectionReadbackUpdate_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x45U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PllJesdProtClr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PllJesdProtClr_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PllJesdProtClr_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2U), + ((uint32_t) bfValue << 6), + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PllJesdProtClrReqd_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PllJesdProtClrReqd_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PllJesdProtClrReqd_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x2U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PllJesdProtClrReqd_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PllJesdProtClrReqd_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x2U), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PllJesdProtEvent_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PllJesdProtEvent_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x2U), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PllUnlockMask_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_PllUnlockMask_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PllUnlockMask_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1U), + (uint32_t) bfValue, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PllUnlockMask_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_PllUnlockMask_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x1U), + &bfValueTmp, + 0xFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdArvEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_SrdArvEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdArvEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x68U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdArvEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdArvEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x68U), + &bfValueTmp, + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 7); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdArvTxonQual_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_SrdArvTxonQual_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdArvTxonQual_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x69U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdArvTxonQual_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdArvTxonQual_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x69U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdArvWait_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 15U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_SrdArvWait_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdArvWait_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x69U), + ((uint32_t) bfValue << 4), + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdArvWait_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdArvWait_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x69U), + &bfValueTmp, + 0xF0U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdDinSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_SrdDinSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdDinSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x68U), + ((uint32_t) bfValue << 6), + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdDinSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdDinSel_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x68U), + &bfValueTmp, + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdDisAnalogDelay_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_SrdDisAnalogDelay_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdDisAnalogDelay_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_SrdEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x68U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x68U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdError_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x69U), + &bfValueTmp, + 0x4U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdErrorClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_SrdErrorClear_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdErrorClear_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x69U), + ((uint32_t) bfValue << 3), + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdIrqEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_SrdIrqEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdIrqEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x68U), + ((uint32_t) bfValue << 4), + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdIrqEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdIrqEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x68U), + &bfValueTmp, + 0x10U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdRdnEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_SrdRdnEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdRdnEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x68U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdRdnEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdRdnEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x68U), + &bfValueTmp, + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 5); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdSlewOffset_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 65535U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_SrdSlewOffset_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdSlewOffset_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x6A), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x6B), + bfValue >> 8, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdSlewOffset_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdSlewOffset_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x6AU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x6BU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdStat_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdStat_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x6CU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x6DU), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdStatEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_SrdStatEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdStatEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x68U), + ((uint32_t) bfValue << 1), + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdStatEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdStatEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x68U), + &bfValueTmp, + 0x2U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 1); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdStatMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_SrdStatMode_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdStatMode_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x68U), + ((uint32_t) bfValue << 2), + 0xCU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdStatMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_SrdStatMode_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x68U), + &bfValueTmp, + 0xCU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 2); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenuation_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint16_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1023U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_TxAttenuation_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxAttenuation_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x8), + bfValue, + 0xFF); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x9), + bfValue >> 8, + 0x3); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenuation_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint16_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxAttenuation_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x8U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp); + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x9U), + &bfValueTmp, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue |= ((uint16_t) bfValueTmp << 8); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenConfig_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_TxAttenConfig_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxAttenConfig_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x0U), + ((uint32_t) bfValue << 4), + 0x30U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenConfig_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxAttenConfig_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x0U), + &bfValueTmp, + 0x30U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 4); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_TxAttenMode_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxAttenMode_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x0U), + (uint32_t) bfValue, + 0x3U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenPapDisAnalogDelay_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_TxAttenPapDisAnalogDelay_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxAttenPapDisAnalogDelay_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x1U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenUpdGpioEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_TxAttenUpdGpioEn_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxAttenUpdGpioEn_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x6U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenUpdGpioEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxAttenUpdGpioEn_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x6U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenUpdTrgSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_TxAttenUpdTrgSel_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxAttenUpdTrgSel_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3U), + ((uint32_t) bfValue << 5), + 0x20U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPeakToPowerMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_TxPeakToPowerMode_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxPeakToPowerMode_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x70U), + ((uint32_t) bfValue << 3), + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPeakToPowerMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxPeakToPowerMode_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x70U), + &bfValueTmp, + 0x8U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 3); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPower_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxPower_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x74U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerInputSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 3U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_TxPowerInputSelect_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxPowerInputSelect_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x70U), + ((uint32_t) bfValue << 1), + 0x6U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerInputSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxPowerInputSelect_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x70U), + &bfValueTmp, + 0x6U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 1); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerLargestPeak_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxPowerLargestPeak_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x78U), + &bfValueTmp, + 0xFFU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerMeasurementDuration_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 31U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_TxPowerMeasurementDuration_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxPowerMeasurementDuration_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x73U), + ((uint32_t) bfValue << 1), + 0x3EU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerMeasurementDuration_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxPowerMeasurementDuration_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x73U), + &bfValueTmp, + 0x3EU); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 1); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerMeasurementEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_TxPowerMeasurementEnable_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxPowerMeasurementEnable_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x70U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerMeasurementEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxPowerMeasurementEnable_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x70U), + &bfValueTmp, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) bfValueTmp; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerMeasurementReadback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_TxPowerMeasurementReadback_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_TxPowerMeasurementReadback_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x75U), + (uint32_t) bfValue, + 0x1U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_UseAttenWordS1ViaGpioPin_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_UseAttenWordS1ViaGpioPin_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_UseAttenWordS1ViaGpioPin_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3U), + ((uint32_t) bfValue << 6), + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_UseAttenWordS1ViaGpioPin_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t bfValueTmp = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_NULL_CHECK > 0 + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, bfValue); +#endif /* ADRV903X_BITFIELD_NULL_CHECK */ + + *bfValue = (uint8_t) 0; + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_UseAttenWordS1ViaGpioPin_BfGet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Read(device, + spiCache, + (uint32_t) (baseAddr + 0x3U), + &bfValueTmp, + 0x40U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Read Issue"); + return recoveryAction; + } + + *bfValue = (uint8_t) (bfValueTmp >> 6); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_UseSliceAttenValue_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_BF); + +#if ADRV903X_BITFIELD_VALUE_CHECK > 0 + if ((bfValue < 0) || + (bfValue > 1U)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + bfValue, + "Invalid BitField Value in adrv903x_TxFuncs_UseSliceAttenValue_BfSet"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_VALUE_CHECK */ + +#if ADRV903X_BITFIELD_ADDR_CHECK > 0 + if ((baseAddr != ADRV903X_BF_SLICE_TX_0__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_1__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_2__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_3__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_4__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_5__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_6__TX_FUNCS) && + (baseAddr != ADRV903X_BF_SLICE_TX_7__TX_FUNCS)) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_DEVICEBF, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + baseAddr, + "Invalid adrv903x_TxFuncs_UseSliceAttenValue_BfSet Address"); + return recoveryAction; + } +#endif /* ADRV903X_BITFIELD_ADDR_CHECK */ + + recoveryAction = adi_adrv903x_Register32Write(device, + spiCache, + ((uint32_t) baseAddr + 0x3U), + ((uint32_t) bfValue << 7), + 0x80U); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register32Write Issue"); + return recoveryAction; + } + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_funcs.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_funcs.h new file mode 100644 index 0000000000000..40771c7bf18cb --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_funcs.h @@ -0,0 +1,546 @@ +/** + * \file adrv903x_bf_tx_funcs.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_TX_FUNCS_H_ +#define _ADRV903X_BF_TX_FUNCS_H_ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_tx_funcs_types.h" + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_AnaRampHoldSampleEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_AnaRampHoldSampleEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_JesdDfrmMask_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_JesdDfrmMask_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAprEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAprEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAverageDur_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAverageErrorPower_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAveragePeakRatio_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAveragePower_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAverageThreshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAverageThreshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerErrorClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerErrorClearRequired_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerErrorClearRequired_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerIrqEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerIrqEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerRdnEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionAvgpowerRdnEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionGainRampUpEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionInputSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionInputSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionOverloadCountTh_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionOverloadThPre_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionOverloadWindowSize_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerErrorClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerErrorClearRequired_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerErrorClearRequired_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerIrqEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerIrqEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerRdnEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakpowerRdnEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakCount_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakCount_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakDur_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakDur_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakErrorPower_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakPower_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakThreshold_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionPeakThreshold_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionRampMaxAttenuation_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionRampStepDuration_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionRampStepSize_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PaProtectionReadbackUpdate_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PllJesdProtClr_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PllJesdProtClrReqd_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PllJesdProtClrReqd_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PllJesdProtEvent_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PllUnlockMask_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_PllUnlockMask_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdArvEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdArvEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdArvTxonQual_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdArvTxonQual_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdArvWait_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdArvWait_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdDinSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdDinSel_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdDisAnalogDelay_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdError_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdErrorClear_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdIrqEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdIrqEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdRdnEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdRdnEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdSlewOffset_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdSlewOffset_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdStat_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdStatEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdStatEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdStatMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_SrdStatMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenuation_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint16_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenuation_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint16_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenConfig_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenConfig_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenPapDisAnalogDelay_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenUpdGpioEn_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenUpdGpioEn_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxAttenUpdTrgSel_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPeakToPowerMode_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPeakToPowerMode_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPower_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerInputSelect_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerInputSelect_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerLargestPeak_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerMeasurementDuration_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerMeasurementDuration_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerMeasurementEnable_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerMeasurementEnable_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_TxPowerMeasurementReadback_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_UseAttenWordS1ViaGpioPin_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_UseAttenWordS1ViaGpioPin_BfGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + uint8_t* const bfValue); + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncs_UseSliceAttenValue_BfSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfTxFuncsChanAddr_e baseAddr, + const uint8_t bfValue); + +#endif // _ADRV903X_BF_TX_FUNCS_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_funcs_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_funcs_types.h new file mode 100644 index 0000000000000..1fc00cc09c99f --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/bf/adrv903x_bf_tx_funcs_types.h @@ -0,0 +1,31 @@ +/** + * \file adrv903x_bf_tx_funcs_types.h Automatically generated file with generator ver 0.0.13.0. + * + * \brief Contains BitField functions to support ADRV903X transceiver device. + * + * ADRV903X BITFIELD VERSION: 0.0.0.8 + * + * Disclaimer Legal Disclaimer + * + * Copyright 2015 - 2025 Analog Devices Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_BF_TX_FUNCS_TYPES_H_ +#define _ADRV903X_BF_TX_FUNCS_TYPES_H_ + +typedef enum adrv903x_BfTxFuncsChanAddr +{ + ADRV903X_BF_SLICE_TX_0__TX_FUNCS = 0x60840000, + ADRV903X_BF_SLICE_TX_1__TX_FUNCS = 0x60940000, + ADRV903X_BF_SLICE_TX_2__TX_FUNCS = 0x60A40000, + ADRV903X_BF_SLICE_TX_3__TX_FUNCS = 0x60B40000, + ADRV903X_BF_SLICE_TX_4__TX_FUNCS = 0x60C40000, + ADRV903X_BF_SLICE_TX_5__TX_FUNCS = 0x60D40000, + ADRV903X_BF_SLICE_TX_6__TX_FUNCS = 0x60E40000, + ADRV903X_BF_SLICE_TX_7__TX_FUNCS = 0x60F40000 +} adrv903x_BfTxFuncsChanAddr_e; + +#endif // _ADRV903X_BF_TX_FUNCS_TYPES_H_ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_agc.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_agc.h new file mode 100644 index 0000000000000..c7f534f523141 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_agc.h @@ -0,0 +1,65 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_agc.h + * \brief Contains ADRV903X AGC related private function prototypes for + * adrv903x_agc.c which helps adi_adrv903x_agc.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_AGC_H_ +#define _ADRV903X_AGC_H_ + +#include "adi_adrv903x_error.h" +#include "adi_adrv903x_agc_types.h" + +/** +* \brief Range check a given AGC configuration +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] agcCfg Pointer to AGC configuration to be range checked +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_AgcCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_AgcCfg_t * const agcCfg); + +/** +* \brief Range check a given AGC gain range configuration +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] agcGainRangeCfg Pointer to AGC gain range configuration to be range checked +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_AgcGainRangeCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_AgcGainRange_t * const agcGainRangeCfg); + + +/** +* \brief Range check a given dual band AGC configuration +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] agcDualBandCfg Pointer to dual band AGC configuration to be range checked +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_AgcDualBandCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_AgcDualBandCfg_t * const agcDualBandCfg); +#endif diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_binloader.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_binloader.h new file mode 100644 index 0000000000000..3c9d55c490807 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_binloader.h @@ -0,0 +1,56 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_binloader.h + * \brief Contains ADRV903X binary loader related private function prototypes for + * adrv903x_binloader.c which helps adi_adrv903x_utilities.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_BINLOADER_H_ +#define _ADRV903X_BINLOADER_H_ + +#include "adi_adrv903x_error.h" + +/** +* \brief This function loads ADRV903X api version, firmware and stream versions, +* ADRV903X Init and PostMcsInit data structures from the Binary Image that also has the profile. +* +* This function reads the CPU Binary Image file from a specified location(e.g.SD card) +* and, if it contains more information than the profile, populates the structs adi_adrv903x_Version_t for +* the api version, adi_adrv903x_CpuFwVersion_t for the firmware version, adi_adrv903x_Version_t for +* the stream version, adi_adrv903x_Init_t init structure and adi_adrv903x_PostMcsInit_t postMcsInit structures. +* +* If profile.bin contains these structures, this function must be called before +* adi_adrv903x_PreMcsInit, adi_adrv903x_PreMcsInit_NonBroadcast and adi_adrv903x_PostMcsInit +* as these functions require the structures to be already populated. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in,out] file Pointer to Binary file +* \param[out] apiVer Pointer to the ADRV903X api version data structure to be populated +* \param[out] fwVer Pointer to the ADRV903X firmware version data structure to be populated +* \param[out] streamVer Pointer to the ADRV903X stream version data structure to be populated +* \param[out] init Pointer to the ADRV903X Init data structure to be populated +* \param[out] postMcsInit Pointer to the ADRV903X PostMcsInit data structure to be populated +* \param[in] fileOffset Offset to be applied in the binary file to jump to structures of interest +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoadBinFile(adi_adrv903x_Device_t* const device, + FILE* const file, + adi_adrv903x_Version_t* const apiVer, + adi_adrv903x_CpuFwVersion_t* const fwVer, + adi_adrv903x_Version_t* const streamVer, + adi_adrv903x_Init_t* const initStruct, + adi_adrv903x_PostMcsInit_t* const postMcsInitStruct, + const uint32_t fileOffset); + +#endif diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu.h new file mode 100644 index 0000000000000..01c5566e63aae --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu.h @@ -0,0 +1,453 @@ + +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_cpu.h + * \brief Contains ADRV903X CPU related private function prototypes for + * adrv903x_cpu.c which helps adi_adrv903x_cpu.c + * + * ADRV903X API Version: 2.12.1.4 + */ +#ifndef _ADRV903X_CPU_H_ +#define _ADRV903X_CPU_H_ + +#include "adrv903x_cpu_types.h" +#include "adrv903x_cpu_macros.h" +#include "adrv903x_cpu_health_monitor_types.h" +#include "adrv903x_cpu_cmd.h" +#include "../../private/bf/adrv903x_bf_core.h" + +#include "adi_adrv903x_cpu_types.h" +#include "adi_adrv903x_error_types.h" +#include "adi_adrv903x_error.h" + +#define ADI_ADRV903X_CPU_CMD_RESP_CHECK_RETURN(cmdStatusErrorCode, cmdStatus, cpuErrorCode, recoveryAction) \ + \ +if (cmdStatus == ADRV903X_CPU_CMD_STATUS_CMD_FAILED) \ +{ \ + cpuErrorCode = ADRV903X_CTOHL(cmdStatusErrorCode); \ + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU_RUNTIME, \ + cpuErrorCode, \ + cmdStatus, \ + recoveryAction); \ + return recoveryAction; \ +} \ +else \ +{ \ + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, \ + ADI_ADRV903X_ERRCODE_CPU_CMD_RESPONSE, \ + cmdStatus, \ + recoveryAction); \ + return recoveryAction; \ +} \ + +#define ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdStatusErrorCode, cmdStatus, cpuErrorCode, recoveryAction, label) \ + \ +if (cmdStatus == ADRV903X_CPU_CMD_STATUS_CMD_FAILED) \ +{ \ + cpuErrorCode = ADRV903X_CTOHL(cmdStatusErrorCode); \ + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU_RUNTIME, \ + cpuErrorCode, \ + cmdStatus, \ + recoveryAction); \ + goto label; \ +} \ +else \ +{ \ + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, \ + ADI_ADRV903X_ERRCODE_CPU_CMD_RESPONSE, \ + cmdStatus, \ + recoveryAction); \ + goto label; \ +} \ + +typedef adi_adrv903x_ErrAction_e(*adrv903xCoreBfSet8FnPtr_t)( adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +typedef adi_adrv903x_ErrAction_e(*adrv903xCoreBfGet8FnPtr_t)( adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint8_t* const bfValue); + +typedef adi_adrv903x_ErrAction_e(*adrv903xCoreBfSet16FnPtr_t)( adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint16_t bfValue); + +typedef adi_adrv903x_ErrAction_e(*adrv903xCoreBfGet16FnPtr_t)( adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t* const bfValue); + +/** +* \brief Function used by ADRV903X API to test API/FW Ping +* +* This function sends a Ping command through the CPU Mailbox interface to see if the CPU is functioning +* +* \pre This function may be called any time after device initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to the ADRV903X device data structure containing settings +* \param[in] cpuType Selection of the desired CPU processor to execute this command on. +* \param[in] writeData data write to CPU. +* \param[out] readData data read from CPU. +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuPing(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const uint32_t writeData, + uint32_t* const readData); + +/** +* \brief Reads back efuse data from CPU +* +* \pre This function is called after the device is initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to the ADRV903X device data structure containing settings +* \param[in] address efuse address. +* \param[out] value pointer to a memory location of retuning efuse data. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuEfuseGet(adi_adrv903x_Device_t* const device, + const uint32_t address, + uint32_t* const value); + +/** +* \brief Function used by ADRV903X API to test API/FW CPU Force Exception +* +* This function sends a Force Exception command through the CPU Mailbox Command interface to force a CPU exception +* +* \pre This function may be called any time after device initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to the ADRV903X device data structure containing settings +* \param[in] cpuType Selection of the desired CPU processor to execute this command on. +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuForceException(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType); + +/** +* \brief Read the M4 ECC scrubbing enable state +* +* \pre This function is called after the device is initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] eccEnable M4 ECC enable state (0 = disabled, !0 = enabled) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_EccEnableGet(adi_adrv903x_Device_t* const device, + uint8_t* const eccEnable); + +/** +* \brief Read the M4 ECC scrubbing enable state +* +* \pre This function is called after the device is initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] eccEnable M4 ECC enable state to set (0 = disabled, !0 = enabled) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_EccEnableSet(adi_adrv903x_Device_t* const device, + uint8_t const eccEnable); + +#ifndef CLIENT_IGNORE +/** +* \brief Private Helper function to initialize cpu's data structure +* +* This is a private function and is automatically called by the API. +* +* \param[in,out] device Structure pointer to the ADRV903X data structure containing settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuInitialize(adi_adrv903x_Device_t* const device); + +/** +* \brief Private Helper function to get a CPU's key addresses +* +* This is a private function and is automatically called by the API. +* +* \param[in] cpu Structure pointer to the ADRV903X's CPU data structure containing settings +* \param[in] cpuType type of cpu +* +* \retval adi_adrv903x_CpuAddr_t* for the requested CPU's or NULL if not found. +*/ +ADI_API adi_adrv903x_CpuAddr_t* adrv903x_CpuAddrGet(adi_adrv903x_Cpu_t* const cpu, + const adi_adrv903x_CpuType_e cpuType); + + +/** +* \brief Private Helper function to get a uint32_t from binary array +* +* This is a private function and is automatically called by the API. +* +* \param[in] buf Structure pointer to buffer array +* \param[in] size number of bytes to convert to uint32_t +* +* \retval uint32_t return uint32_t from buffer +*/ +ADI_API uint32_t adrv903x_CpuIntFromBytesGet(const uint8_t* const buf, const uint8_t size); + +/** +* \brief Low level helper function used by ADRV903X API to write CPU Command +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param device Structure pointer to the ADRV903X data structure containing settings +* \param cpuType Selection of the desired CPU processor to execute this command on. +* \param linkId Selection of the desired Link for the command. +* \param cmdId To Identify a Command. +* \param cmd Contain command buffer. +* \param payloadSize Number of bytes in the cmd payload +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuCmdWrite(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const adrv903x_LinkId_e linkId, + const adrv903x_CpuCmdId_t cmdId, + adrv903x_CpuCmd_t* const cmd, + const uint32_t payloadSize); + +/** +* \brief Low level helper function used by ADRV903X API to read CPU Command Response +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param device Structure pointer to the ADRV903X data structure containing settings +* \param cpuType Selection of the desired CPU processor to execute this command on. +* \param linkId Selection of the desired Link for the command. +* \param *cmdId To Identify a Command. +* \param cmdRsp Contain command response buffer. +* \param payloadSize Size of expected payload, in bytes +* \param[out] status Status of command response. Optional. Set to NULL if not needed. +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuCmdRespRead(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const adrv903x_LinkId_e linkId, + adrv903x_CpuCmdId_t*const cmdId, + adrv903x_CpuCmdResp_t* const cmdRsp, + const uint32_t payloadSize, + adrv903x_CpuCmdStatus_e*const status); + +/** +* \brief Send a command to a given CPU and receive a command response +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param device Structure pointer to the ADRV903X data structure containing settings +* \param cpuType ID of the desired CPU to execute this command on +* \param linkId ID of the desired CPU's link for the command +* \param cmdId ID of the command to send +* \param pCmdPayload Pointer to the data payload to send with this command. Optional. Set to NULL if not needed. +* \param cmdPayloadSize Size of data payload, in bytes. Set to zero if pCmdPayload is set to NULL. +* \param[out] pRespPayload Pointer to buffer in which command response payload should be placed. Optional. Set to NULL if not needed. +* \param respPayloadSz Amount of data to copy into pRespPayload, in bytes. Set to zero if pRespPayload is set to NULL. +* \param[out] status Status of command response. Optional. Set to NULL if not needed. +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuCmdSend(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const adrv903x_LinkId_e linkId, + const adrv903x_CpuCmdId_t cmdId, + void* const pCmdPayload, + const size_t cmdPayloadSz, + void* const pRespPayload, + const size_t respPayloadSz, + adrv903x_CpuCmdStatus_e* const status); + +/** +* \brief Get the CPU assigned to a particular channel +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X data structure containing settings +* \param[in] channel channel number +* \param[in] objId object ID +* \param[out] cpuType CPU assigned to requested channel number +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuChannelMappingGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Channels_e channel, + const adrv903x_CpuObjectId_e objId, + adi_adrv903x_CpuType_e* const cpuType); + +/** +* \brief Start a capture RAM access (obtain exclusive lock) +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device structure pointer to the ADRV903X data structure containing settings +* \param[in] captureRamType type of capture RAM to lock +* \param[in] channelNumber channel number of capture RAM to lock (one channel, NOT a mask of multiple channels) +* \param[out] success 1 if successfully locked, 0 otherwise +* +* \retval ADI_COMMON_ACT_NO_ACTION if no unexpected failure was encountered (failure other than lock failure). +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuRamAccessStart(adi_adrv903x_Device_t* const device, + const adrv903x_CpuCmd_CaptureRamType_e captureRamType, + const adi_adrv903x_Channels_e channelNumber, + uint8_t* const success); + +/** +* \brief Stop a capture RAM access (release exclusive lock) +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device structure pointer to the ADRV903X data structure containing settings +* \param[in] captureRamType type of capture RAM to unlock +* \param[in] channelNumber channel number of capture RAM to unlock (one channel, NOT a mask of multiple channels) +* \param[out] success 1 if successfully unlocked, 0 otherwise +* +* \retval ADI_COMMON_ACT_NO_ACTION if no unexpected failure was encountered (failure other than unlock failure). +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuRamAccessStop( adi_adrv903x_Device_t* const device, + const adrv903x_CpuCmd_CaptureRamType_e captureRamType, + const adi_adrv903x_Channels_e channelNumber, + uint8_t* const success); + + + + +/** +* \brief Run Cyclic Redundancy Check on the specified block of memory in chunk. +* +* This function was based on the Crc32 function but can be used on chunk of memory block. +* The function can be call multiple times. +* The first call, set seedCrc to 0, finalCrc to 0. +* The return CRC is use as seedCrc for the next call. +* The last call, set finalCrc to 1. +* +* \details CRC32 algorithm, operating on 8-bit words +* +* Parameters: +* \param[in] buf - array of bytes on which CRC is run +* \param[in] bufLen - length of the input array in bytes +* \param[in] seedCrc - Seed for the next block of memory, use 0 for initial seedCrc. +* \param[in] finalCrc - 0: return the CRC use for seedSrc. 1: return the final CRC32. +* +* \retval 32-bit checksum +*/ +ADI_API uint32_t adrv903x_Crc32ForChunk(const uint8_t buf[], + const uint32_t bufLen, + const uint32_t seedCrc, + const uint8_t finalCrc); + +/** +* \brief Reads back private health monitoring status of the CPUs +* +* \pre This function is called after the device is initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] healthMonitorStatus Pointer to memory location where private health monitor CPU status readback data will be written +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_HealthMonitorPrivateCpuStatusGet( adi_adrv903x_Device_t* const device, + adrv903x_HealthMonitorPrivateCpuStatus_t* const healthMonitorStatus); + +/** +* \brief Configures the GPIO signal for both CPUs +* +* \pre This function is called after the device is initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] gpioSelect GPIO selection for the CPU signal +* \param[in] cpuGpioSignal CPU GPIO signal selection +* \param[in] isInput Needs to be set to 1:If selected signal is input to CPU 0:If selected signal is output from CPU +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuGpioSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpioSelect, + const adrv903x_CpuCmd_GpioSignal_e cpuGpioSignal, + const uint8_t isInput); + +/** +* \brief Read the GPIO pin for a given CPU GPIO signal +* +* \pre This function is called after the device is initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] gpioSelect Readback GPIO pin for the given CPU signal +* \param[in] cpuGpioSignal CPU GPIO signal selection +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuGpioGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioPinSel_e * const gpioSelect, + const adrv903x_CpuCmd_GpioSignal_e cpuGpioSignal); + + +/** +* \brief Service to debug cpu after runtime error +* +* \pre This function is called after the cpu has errored +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* +*/ +ADI_API void adrv903x_CpuErrorDebugCheck(adi_adrv903x_Device_t* const device); + +#endif //CLIENT_IGNORE + + + +#endif /* _ADRV903X_CPU_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_archive_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_archive_types.h new file mode 100644 index 0000000000000..2e5f4905bbf2f --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_archive_types.h @@ -0,0 +1,41 @@ + /** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + + /** + * \file adrv903x_cpu_archive_types.h + * + * \brief Contains CPU archive type definitions + * + * \details Contains CPU archive type definitions + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_CPU_ARCHIVE_TYPES_H__ +#define __ADRV903X_CPU_ARCHIVE_TYPES_H__ + +#include "adi_adrv903x_platform_pack.h" + +/* Magic number to indicate ADRV903X CPU archive file */ +#define ADRV903X_CPU_ARCHIVE_MAGIC_NUM (0xAD100001U) + +/* CPU archive format revision 1 identifier */ +#define ADRV903X_CPU_ARCHIVE_REV_1 (0x00000001U) + +/** +* \brief Data structure to hold CPU archive header +*/ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuArchiveHeader +{ + uint32_t magicNum; + uint32_t formatRev; + uint32_t xsum; +} adrv903x_CpuArchiveHeader_t;) + +#endif /* __ADRV903X_CPU_ARCHIVE_TYPES_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd.h new file mode 100644 index 0000000000000..71dbf9d1f196b --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd.h @@ -0,0 +1,298 @@ +/** + * \file adrv903x_cpu_cmd.h + * + * \brief Contains device-specific command definitions + * + * \details Contains device-specific command definitions + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_H__ +#define __ADRV903X_CPU_CMD_H__ + +#include "adrv903x_cpu_cmd_intf.h" +#include "adrv903x_cpu_cmd_ping.h" +#include "adrv903x_cpu_cmd_run_init.h" +#include "adrv903x_cpu_cmd_tracking_cals.h" +#include "adrv903x_cpu_cmd_cal_status.h" +#include "adrv903x_cpu_cmd_getset_lofreq.h" +#include "adrv903x_cpu_cmd_getset_nco.h" +#include "adrv903x_cpu_cmd_mcs.h" +#include "adrv903x_cpu_cmd_devtemp.h" +#include "adrv903x_cpu_cmd_ram.h" +#include "adrv903x_cpu_cmd_force_exception.h" +#include "adrv903x_cpu_cmd_getset_config.h" +#include "adrv903x_cpu_cmd_enter_debug_mode.h" +#include "adrv903x_cpu_cmd_bkpt.h" +#include "adrv903x_cpu_cmd_ctrl.h" +#include "adrv903x_cpu_cmd_log.h" +#include "adrv903x_cpu_cmd_debug.h" +#include "adrv903x_cpu_cmd_sys_status.h" +#include "adi_adrv903x_cpu_cmd_dc_offset.h" +#include "adrv903x_cpu_cmd_getset_txatten_phase.h" +#include "adrv903x_cpu_cmd_run_serdes_eye_sweep.h" +#include "adrv903x_cpu_cmd_tx_to_orx_mapping.h" +#include "adrv903x_cpu_cmd_jesd_ser_lane_getset_cfg.h" +#include "adrv903x_cpu_cmd_gpio.h" +#include "adrv903x_cpu_cmd_t.h" +#include "adrv903x_cpu_cmd_efuse.h" +/** + * \brief CPU command ID enumeration + */ +typedef enum adrv903x_CpuCmdId +{ + ADRV903X_CPU_CMD_ID_PING = 0x0u, /*!< PING: Ping the CPU */ + + /* Initial calibration commands */ + ADRV903X_CPU_CMD_ID_RUN_INIT = 0x1u, /*!< RUN_INIT: Run initial calibrations */ + ADRV903X_CPU_CMD_ID_RUN_INIT_GET_COMPLETION_STATUS = 0x2u, /*!< RUN_INIT_GET_COMPLETION_STATUS: Get the completion status of initial calibrations */ + ADRV903X_CPU_CMD_ID_RUN_INIT_GET_DETAILED_STATUS = 0x3u, /*!< RUN_INIT_GET_DETAILED_STATUS: Get detailed status information on initial calibrations */ + ADRV903X_CPU_CMD_ID_RUN_INIT_ABORT = 0x4u, /*!< RUN_INIT_ABORT: Abort any in progress initial calibrations */ + + /* Tracking calibration commands */ + ADRV903X_CPU_CMD_ID_SET_ENABLED_TRACKING_CALS = 0x5u, /*!< SET_ENABLED_TRACKING_CALS: Set the set of enabled tracking cals */ + ADRV903X_CPU_CMD_ID_GET_ENABLED_TRACKING_CALS = 0x6u, /*!< GET_ENABLED_TRACKING_CALS: Get the set of enabled tracking cals */ + ADRV903X_CPU_CMD_ID_GET_TRACKING_CAL_STATE = 0x7u, /*!< GET_TRACKING_CAL_STATE: Get detailed state information for all tracking cals */ + + /* Calibration status commands */ + ADRV903X_CPU_CMD_ID_GET_CAL_STATUS = 0x8u, /*!< GET_CAL_STATUS: Get calibration status information */ + + /* System status commands */ + ADRV903X_CPU_CMD_ID_GET_SYS_STATUS = 0x9u, /*!< GET_SYS_STATUS: Get system status information */ + + /* LO frequency commands */ + ADRV903X_CPU_CMD_ID_GET_LO_FREQUENCY = 0xAu, /*!< GET_LO_FREQUENCY: Get Lo Frequency value */ + ADRV903X_CPU_CMD_ID_SET_LO_FREQUENCY = 0xBu, /*!< SET_LO_FREQUENCY: Set Lo Frequency value */ + + /* LO loopfilter commands */ + ADRV903X_CPU_CMD_ID_GET_LOOPFILTER = 0xCu, /*!< GET_LOOPFILTER: Get LO Loopfilter value */ + ADRV903X_CPU_CMD_ID_SET_LOOPFILTER = 0xDu, /*!< SET_LOOPFILTER: Set LO Loopfilter value */ + + /* DC Offset commands */ + ADRV903X_CPU_CMD_ID_GET_DCOFFSET = 0xEu, /*!< GET_DCOFFSET: Get DC Offset parameters */ + ADRV903X_CPU_CMD_ID_SET_DCOFFSET = 0xFu, /*!< SET_DCOFFSET: Set DC Offset parameters */ + + /* Get Rx/TxLO commands */ + ADRV903X_CPU_CMD_ID_GET_RXTXLOFREQ = 0x10u, /*!< GET_RXTXLOFREQ: Get LO value for all of Rx/Tx channels */ + + /* NCO commands */ + ADRV903X_CPU_CMD_ID_SET_RX_NCO = 0x11u, /*!< SET_RX_NCO: Set/Configure the Rx NCO */ + ADRV903X_CPU_CMD_ID_GET_RX_NCO = 0x12u, /*!< GET_RX_NCO: Get configuration from the Rx NCO */ + ADRV903X_CPU_CMD_ID_SET_ORX_NCO = 0x13u, /*!< SET_ORX_NCO: Set/Configure the Rx NCO */ + ADRV903X_CPU_CMD_ID_GET_ORX_NCO = 0x14u, /*!< GET_ORX_NCO: Get configuration from the ORx NCO */ + ADRV903X_CPU_CMD_ID_SET_TX_TEST_NCO = 0x15u, /*!< SET_TX_TEST_NCO: Set/Configure one of two Tx Test NCOs */ + ADRV903X_CPU_CMD_ID_GET_TX_TEST_NCO = 0x16u, /*!< GET_TX_TEST_NCO: Get configuration for one of the two Tx Test NCOs */ + ADRV903X_CPU_CMD_ID_SET_TX_MIX_NCO = 0x17u, /*!< SET_TX_MIXER_NCO: Set/Configure the Tx Mixer NCO */ + ADRV903X_CPU_CMD_ID_GET_TX_MIX_NCO = 0x18u, /*!< GET_TX_MIXER_NCO: Get configuration from the Tx Mixer NCO */ + + /* MCS commands */ + ADRV903X_CPU_CMD_ID_START_MCS = 0x19u, /*!< START_MCS: Start Multichip Sync procedure */ + ADRV903X_CPU_CMD_ID_MCS_COMPLETE = 0x1Au, /*!< MCS_COMPLETE: Notification that MCS is complete */ + + /* Temperature commands */ + ADRV903X_CPU_CMD_ID_GET_DEVICE_TEMPERATURE = 0x1Bu, /*!< GET_DEVICE_TEMPERATURE: Get device temperature information */ + ADRV903X_CPU_CMD_ID_GET_ENABLED_TEMPSENSORS = 0x1Cu, /*!< GET_ENABLED_TEMPSENSORS Get enabled temp sensor */ + ADRV903X_CPU_CMD_ID_SET_ENABLED_TEMPSENSORS = 0x1Du, /*!< SET_ENABLED_TEMPSENSORS Set enabled temp sensor */ + + /* RAM capture commands */ + ADRV903X_CPU_CMD_ID_RAM_ACCESS_START = 0x1Eu, /*!< RAM_ACCESS_START: Lock a capture RAM for exclusive access */ + ADRV903X_CPU_CMD_ID_RAM_ACCESS_STOP = 0x1Fu, /*!< RAM_ACCESS_STOP: Unlock exclusive access to a capture RAM */ + + /* Config commands */ + ADRV903X_CPU_CMD_ID_UNLOCK_CONFIG = 0x20u, /*!< UNLOCK_CONFIG: Unlock the configuration for changing */ + ADRV903X_CPU_CMD_ID_SET_CONFIG = 0x21u, /*!< SET_CONFIG: Set system or calibration configuration */ + ADRV903X_CPU_CMD_ID_GET_CONFIG = 0x22u, /*!< GET_CONFIG: Get system or calibration configuration */ + + /* Ctrl command */ + ADRV903X_CPU_CMD_ID_SET_CTRL = 0x23u, /*!< SET_CTRL: Set system or calibration ctrl */ + + /* Debug commands */ + ADRV903X_CPU_CMD_ID_ENTER_DEBUG_MODE = 0x24u, /*!< ENTER_DEBUG_MODE: Enter debug mode */ + ADRV903X_CPU_CMD_ID_DEBUG = 0x25u, /*!< DEBUG: Generic debug command */ + + /* CPU log commands */ + ADRV903X_CPU_CMD_ID_SET_LOG_FILTERS = 0x26u, /*!< SET_LOG_FILTERS: Set CPU log filters */ + + /* SW Breakpoint commands */ + ADRV903X_CPU_CMD_ID_RESUME_BKPT = 0x27u, /*!< RESUME_BKPT: Resume task(s) suspended due breakpoint */ + ADRV903X_CPU_CMD_ID_SET_BKPT_GPIO = 0x28u, /*!< SET_BKPT_GPIO: Set breakpoint GPIOs */ + + /* Tx Atten Phase commands */ + ADRV903X_CPU_CMD_ID_GET_TX_ATTEN_PHASE = 0x29u, /*!< GET_TX_ATTEN_PHASE: Get Tx Atten Phase array */ + ADRV903X_CPU_CMD_ID_SET_TX_ATTEN_PHASE = 0x2Au, /*!< SET_TX_ATTEN_PHASE: Set Tx Atten Phase array */ + + /* Tx to Orx Mapping Preset commands */ + ADRV903X_CPU_CMD_ID_SET_TX_TO_ORX_PRESET_ATTEN = 0x2Bu, /*!< SET_TX_TO_ORX_PRESET_ATTEN: Set Tx to Orx Mapping Preset values for Orx Atten */ + ADRV903X_CPU_CMD_ID_SET_TX_TO_ORX_PRESET_NCO = 0x2Cu, /*!< SET_TX_TO_ORX_PRESET_NCO: Set Tx to Orx Mapping Preset values for Orx NCO */ + + /* Run SERDES Eye Sweep command */ + ADRV903X_CPU_CMD_ID_RUN_SERDES_EYE_SWEEP = 0x2Du, /*!< RUN_SERDES_EYE_SWEEP: Run SERDES eye sweep */ + + /* JESD Serializer Lane configuration commands */ + ADRV903X_CPU_CMD_ID_JESD_SER_LANE_GET_CFG = 0x2Eu, /*!< JESD_SER_LANE_GET_CFG: Get Serializer Lane configuration */ + ADRV903X_CPU_CMD_ID_JESD_SER_LANE_SET_CFG = 0x2Fu, /*!< JESD_SER_LANE_SET_CFG: Set Serializer Lane configuration */ + + /* Run SERDES Eye Sweep command */ + ADRV903X_CPU_CMD_ID_RUN_SERDES_VERT_EYE_SWEEP = 0x30u, /*!< RUN_SERDES_VERT_EYE_SWEEP: Run SERDES vertical eye sweep */ + + /* GPIO Pin configuration commands */ + ADRV903X_CPU_CMD_ID_SET_GPIO = 0x31u, /*!< SET_GPIO: Set GPIO pin configuration */ + ADRV903X_CPU_CMD_ID_GET_GPIO = 0x32u, /*!< GET_GPIO: Get GPIO pin configuration */ + + /* EFUSE command */ + ADRV903X_CPU_CMD_ID_EFUSE_GET = 0x33u, /*!< EFUSE_GET: Read EFUSE address */ + + /* Tracking calibration V2 commands */ + ADRV903X_CPU_CMD_ID_SET_ENABLED_TRACKING_CALS_V2 = 0x34u, /*!< SET_ENABLED_TRACKING_CALS_V2: Set the set of enabled tracking cals */ + + /* JESD Serializer reset and cal commands */ + ADRV903X_CPU_CMD_ID_JESD_SER_RESET = 0x35u, /*!< JESD_SER_RESET: request pulsed srst reset */ + + /* Set Cals in Fast attack mode */ + ADRV903X_CPU_CMD_ID_ENABLE_FAST_ATTACK = 0x36u, /*!< ENABLE_FAST_ATTACK: Set Cals in Fast attack mode */ + + /* RAM-ECC commands */ + ADRV903X_CPU_CMD_ID_UPDATE_ECC = 0x37u, /*!< Force an ECC update */ + + /* Reprogram PLL */ + ADRV903X_CPU_CMD_ID_REPROGRAM_PLL = 0x38u, /*!< REPROGRAM_PLL: Run PLL Program Sequence */ + + /* NCO commands pt. 2*/ + ADRV903X_CPU_CMD_ID_SET_ORX_NCO_V2 = 0x39u, /*!< SET_RX_NCO: Set/Configure the Rx NCO pt. 2*/ + + ADRV903X_CPU_CMD_ID_SET_ENABLE_ECC_SCRUB = 0x3Au, /*!< SET_ENABLE_ECC; set enable for ECC scrubbing */ + ADRV903X_CPU_CMD_ID_GET_ENABLE_ECC_SCRUB = 0x3Bu, /*!< GET_ENABLE_ECC; get enable state for ECC scrubbing */ + /* Get SERDES Metrics */ + ADRV903X_CPU_CMD_ID_GET_SERDES_FG_METRICS = 0x3Cu, /*!< GET_SERDES_FG_METRICS: Fetch SERDES-in init cal state for debug purposes */ + ADRV903X_CPU_CMD_ID_GET_SERDES_BG_METRICS = 0x3Du, /*!< GET_SERDES_BG_METRICS: Fetch SERDES-in tracking cal state for debug purposes */ + ADRV903X_CPU_CMD_ID_SET_CHAN_TO_PLLS = 0x3Eu, /*!< SET_CHAN_TO_PLLS: Set LO assignemnts during runtime > */ + + ADRV903X_CPU_CMD_ID_JESD_TX_LANE_POWER = 0x3Fu, /*!< Power up or down Serdes lanes */ + + ADRV903X_CPU_CMD_ID_JESD_GET_RX_LANE_SINT_CODES = 0x40u, /*!< Get Serdes lane SINT Codes */ + + ADRV903X_CPU_CMD_RX_SPUR_BASE_BAND_FREQ_SET = 0x41u, /*!< Rx SPUR Frequency Configuration TPGSWE-17029 */ + ADRV903X_CPU_CMD_RX_SPUR_BASE_BAND_FREQ_GET = 0x42u, /*!< Rx SPUR Frequency Configuration TPGSWE-17029 */ + + ADRV903X_CPU_CMD_ID_NUM_CMDS = 0x43u /*!< Number of command IDs. Must be last. */ + +} adrv903x_CpuCmdId_e; + +/** + * \brief CPU command payload union. + * Used to determine the maximum command payload size. + * \note Not instantiated. Only for size calculations. + */ +typedef union adrgven6_CpuCmdPayloadMaxSize +{ + adrv903x_CpuCmd_Ping_t pingCmd; + adrv903x_CpuCmd_RunInit_t runInitCmd; + adrv903x_CpuCmd_GetCalStatus_t getCalStatusCmd; + adrv903x_CpuCmd_GetSysStatus_t getSysStatusCmd; + adrv903x_CpuCmd_SetLoFreq_t setLoFreqCmd; + adrv903x_CpuCmd_GetLoFreq_t getLoFreqCmd; + adrv903x_CpuCmd_ChanCtrlToPlls_t setchanCtrlToPllsCmd; + adrv903x_CpuCmd_SetLoopfilter_t setLooopfilterCmd; + adrv903x_CpuCmd_GetLoopfilter_t getLooopfilterCmd; + adi_adrv903x_CpuCmd_SetDcOffset_t setDcOffsetCmd; + adi_adrv903x_CpuCmd_GetDcOffset_t getDcOffsetCmd; + adrv903x_CpuCmd_GetDevTemp_t getDevTempCmd; + adi_adrv903x_RxNcoConfig_t setRxNcoCmd; + adrv903x_RxNcoConfigReadback_t getRxNcoCmd; + adi_adrv903x_ORxNcoConfig_t setOrxNcoCmd; + adrv903x_ORxNcoConfigReadback_t getOrxNcoCmd; + adi_adrv903x_TxNcoMixConfig_t setTxMixNcoCmd; + adrv903x_TxNcoMixConfigReadback_t getTxMixNcoCmd; + adi_adrv903x_TxTestNcoConfig_t setTxTestNcoCmd; + adrv903x_TxTestNcoConfigReadback_t getTxTestNcoCmd; + adrv903x_CpuCmd_RamAccessStart_t ramAccessStartCmd; + adrv903x_CpuCmd_RamAccessStop_t ramAccessStopCmd; + adrv903x_CpuCmd_EnterDebugMode_t enterDebugModeCmd; + adrv903x_CpuCmd_UnlockConfig_t unlockConfigCmd; + adrv903x_CpuCmd_SetConfigMaxSize_t setConfigMaxSize; + adrv903x_CpuCmd_SetCtrlMaxSize_t setCtrlMaxSize; + adrv903x_CpuCmd_DebugMaxSize_t debugMaxSize; + adrv903x_CpuCmd_SetEnabledTrackingCals_t setEnabledTrackingCalsCmd; + adrv903x_CpuCmd_SetTxAttenPhase_t getTxAttenPhase; + adrv903x_CpuCmd_GetTxAttenPhase_t setTxAttenPhase; + adrv903x_CpuCmd_RunEyeSweep_t runEyeSweepCmd; + adrv903x_CpuCmd_GetSintCodes_t getSintCodesCmd; + adrv903x_CpuCmd_SetTxToOrxPresetAtten_t setTxToOrxPresetAttenCmd; + adrv903x_CpuCmd_SetTxToOrxPresetNco_t setTxToOrxPresetNcoCmd; + adrv903x_CpuCmd_GetJesdSerLaneCfg_t getJesdSerLaneCfgCmd; + adrv903x_CpuCmd_SetJesdSerLaneCfg_t setJesdSerLaneCfgCmd; + adrv903x_CpuCmd_SetGpio_t setGpioCmd; + adrv903x_CpuCmd_GetGpio_t getGpioCmd; + adrv903x_CpuCmd_EfuseGet_t efuseGetCmd; +} adrgven6_CpuCmdPayloadMaxSize_t; + +/** + * \brief CPU command response payload union. + * Used to determine the maximum command response payload size. + * \note Not instantiated. Only for size calculations. + */ +typedef union adrgven6_CpuCmdRespPayloadMaxSize +{ + adrv903x_CpuCmd_PingResp_t pingCmdResp; + adrv903x_CpuCmd_RunInitResp_t runInitCmdResp; + adrv903x_CpuCmd_RunInitGetCompletionStatusResp_t runInitGetCompletionStatusCmdResp; + adrv903x_CpuCmd_RunInitGetDetailedStatusResp_t runInitGetDetailedStatusCmdResp; + adrv903x_CpuCmd_SetLoFreqResp_t setLoFreqCmdResp; + adrv903x_CpuCmd_GetLoFreqResp_t getLoFreqCmdResp; + adrv903x_CpuCmd_ChanCtrlToPllsResp_t setChanCtrlToPllsResp; + adrv903x_CpuCmd_GetRxTxLoFreqResp_t getRxTxLoCmdResp; + adrv903x_CpuCmd_SetLoopfilter_t setLoopfilterCmdResp; + adrv903x_CpuCmd_GetLoopfilter_t getLoopfilterCmdResp; + adrv903x_CpuCmd_GetDevTempResp_t getDevTempCmdResp; + adrv903x_CpuCmd_GetCalStatusMaxSize_t getCalStatusMaxSize; + adrv903x_CpuCmd_GetSysStatusMaxSize_t getSysStatusMaxSize; + adrv903x_CpuCmd_StartMcsResp_t startMcsCmdResp; + adrv903x_RxNcoConfigResp_t setRxNcoCmdResp; + adi_adrv903x_RxNcoConfigReadbackResp_t getRxNcoCmdResp; + adrv903x_ORxNcoConfigResp_t setOrxNcoCmdResp; + adi_adrv903x_ORxNcoConfigReadbackResp_t getOrxNcoCmdResp; + adrv903x_TxNcoMixConfigResp_t setTxMixNcoCmdResp; + adi_adrv903x_TxNcoMixConfigReadbackResp_t getTxMixNcoCmdResp; + adrv903x_TxTestNcoConfigResp_t setTxTestNcoCmdResp; + adi_adrv903x_TxTestNcoConfigReadbackResp_t getTxTestNcoCmdResp; + adrv903x_CpuCmd_RamAccessStartResp_t ramAccessStartCmdResp; + adrv903x_CpuCmd_RamAccessStopResp_t ramAccessStopCmdResp; + adrv903x_CpuCmd_EnterDebugModeResp_t enterDebugModeResp; + adrv903x_CpuCmd_UnlockConfigResp_t unlockConfigResp; + adrv903x_CpuCmd_GetConfigMaxSize_t getConfigMaxSize; + adrv903x_CpuCmd_SetCtrlRespMaxSize_t setCtrlRespMaxSize; + adrv903x_CpuCmd_DebugRespMaxSize_t debugRespMaxSize; + adrv903x_CpuCmd_SetEnabledTrackingCalsResp_t setEnabledTrackingCalsCmdResp; + adrv903x_CpuCmd_GetTxAttenPhaseResp_t getTxAttenPhaseResp; + adrv903x_CpuCmd_SetTxAttenPhaseResp_t setTxAttenPhaseResp; + adrv903x_CpuCmd_RunEyeSweepResp_t runEyeSweepResp; + adrv903x_CpuCmd_SetTxToOrxPresetAttenResp_t setTxToOrxPresetAttenResp; + adrv903x_CpuCmd_SetTxToOrxPresetNcoResp_t setTxToOrxPresetNcoResp; + adrv903x_CpuCmd_GetJesdSerLaneCfgResp_t getJesdSerLaneCfgResp; + adrv903x_CpuCmd_SetJesdSerLaneCfgResp_t setJesdSerLaneCfgResp; + uint8_t serdesPvtStatuBufSize[SERDES_PVT_BUFFER_SIZE]; + adrv903x_CpuCmd_SetGpioResp_t setGpioResp; + adrv903x_CpuCmd_GetGpioResp_t getGpioResp; + adrv903x_CpuCmd_EfuseGetResp_t efuseGetResp; +} adrgven6_CpuCmdRespPayloadMaxSize_t; + +/** + * Size of the largest CPU command, including header, in bytes. + */ +#define ADRV903X_CPU_CMD_MAX_SIZE_BYTES (sizeof(adrv903x_CpuCmd_t) + sizeof(adrgven6_CpuCmdPayloadMaxSize_t)) + +/** + * Size of the largest CPU command response, including header, in bytes. + */ +#define ADRV903X_CPU_CMD_RESP_MAX_SIZE_BYTES (sizeof(adrv903x_CpuCmdResp_t) + sizeof(adrgven6_CpuCmdRespPayloadMaxSize_t)) + +#endif /* __ADRV903X_CPU_CMD_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_bkpt.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_bkpt.h new file mode 100644 index 0000000000000..5a40acba6e772 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_bkpt.h @@ -0,0 +1,44 @@ +/** + * \file adrv903x_cpu_cmd_bkpt.h + * + * \brief Command definitions for SW breakpoints. + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_BKPT_H__ +#define __ADRV903X_CPU_CMD_BKPT_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" + + +/** + * \brief RESUME_BKTPT command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_ResumeBkpt +{ + uint32_t objectID; + uint8_t chanMask; + uint8_t bResumeAll; +} adrv903x_CpuCmd_ResumeBkpt_t;) + + +/** + * \brief RESUME_BKTPT command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_ResumeBkptResp +{ + adrv903x_CpuErrorCode_e cmdStatus; /*!< Command status */ +} adrv903x_CpuCmd_ResumeBkptResp_t;) + +#endif /* __ADRV903X_CPU_CMD_RESUME_BKPT_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_cal_status.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_cal_status.h new file mode 100644 index 0000000000000..d67e11063a530 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_cal_status.h @@ -0,0 +1,85 @@ +/** + * \file adrv903x_cpu_cmd_cal_status.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_GET_CAL_STATUS + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_CAL_STATUS_H__ +#define __ADRV903X_CPU_CMD_CAL_STATUS_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" +#include "adrv903x_cpu_object_ids_types.h" +#include "adi_adrv903x_cals_types.h" + +/** + * \brief Calibration status type enumeration + */ +typedef enum adrv903x_CpuCmd_CalStatusType +{ + ADRV903X_CPU_CMD_CAL_STATUS_COMMON, /*!< Common calibration status */ + ADRV903X_CPU_CMD_CAL_STATUS_SPECIFIC, /*!< Calibration-specific status */ + ADRV903X_CPU_CMD_CAL_STATUS_PRIVATE /*!< Private calibration-specific status */ +} adrv903x_CpuCmd_CalStatusType_e; +typedef uint8_t adrv903x_CpuCmd_CalStatusType_t; + + +/** + * \brief GET_CAL_STATUS command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetCalStatus +{ + adrv903x_CpuCmd_CalStatusType_t type; /*!< Calibration status type to be retrieved */ + adrv903x_CpuObjectId_t calObjId; /*!< Object ID of calibration */ + uint32_t channelNum; /*!< Channel number (0 for channel 1, 1 for channel 2, etc.) */ +} adrv903x_CpuCmd_GetCalStatus_t;) + + +/** + * \brief GET_CAL_STATUS command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetCalStatusResp +{ + adrv903x_CpuErrorCode_e cmdStatus; /*!< Command status */ + + /* Cal status payload follows command header. + * This can't be declared here due to the API's use of the -Wpedantic compiler option. + * void* calStatus[]; + */ +} adrv903x_CpuCmd_GetCalStatusResp_t;) + + +/** + * \brief Calibration status payload union. + * Used to determine the maximum cal status payload size. + * \note Not instantiated. Only for size calculations. + */ +typedef union adrgven6_CalStatusMaxSize +{ + adi_adrv903x_CalStatus_t calStatus; +} adrgven6_CalStatusMaxSize_t; + + +/** + * \brief Status payload size struct. + * Used to determine the maximum cal status payload size. + * \note Not instantiated. Only for size calculations. + */ +typedef struct adrv903x_CpuCmd_GetCalStatusMaxSize +{ + adrv903x_CpuCmd_GetCalStatusResp_t getCalStatusCmdResp; + adrgven6_CalStatusMaxSize_t calStatusMaxSize; +} adrv903x_CpuCmd_GetCalStatusMaxSize_t; + +#endif /* __ADRV903X_CPU_CMD_CAL_STATUS_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ctrl.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ctrl.h new file mode 100644 index 0000000000000..011bc43a3c680 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ctrl.h @@ -0,0 +1,133 @@ +/** + * \file adrv903x_cpu_cmd_cal_ctrl.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_SET_CTRL + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_CTRL_H__ +#define __ADRV903X_CPU_CMD_CTRL_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" +#include "adrv903x_cpu_object_ids_types.h" +#include "adi_adrv903x_cals_types.h" + +/** + * \brief Maximum ctrl payload size + */ +#define MAX_CTRL_DATA_SIZE (256u) + +/** + * \brief Maximum ctrl response size + */ +#define MAX_CTRL_RESP_SIZE (256u) + +#ifndef CLIENT_IGNORE +/** + * \brief SET_CTRL command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetCtrl +{ + adrv903x_CpuObjectId_t objId; /*!< Object ID of the cal or system component */ + uint16_t ctrlCmd; /*!< Command to be executed */ + uint32_t channelNum; /*!< Channel number (0 for channel 1, 1 for channel 2, etc.) */ + uint16_t length; /*!< Length of the control data in bytes */ + + /* Control data payload follows command header. + * This can't be declared here due to the API's use of the -Wpedantic compiler option. + * uint8_t ctrlData[]; + */ +} adrv903x_CpuCmd_SetCtrl_t;) + + +/** + * \brief SET_CTRL command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetCtrlResp +{ + adrv903x_CpuErrorCode_e cmdStatus; /*!< Command status */ + uint16_t length; /*!< Length of the control command response in bytes */ + + /* Control data response payload follows command header. + * This can't be declared here due to the API's use of the -Wpedantic compiler option. + * uint8_t ctrlResp[]; + */ +} adrv903x_CpuCmd_SetCtrlResp_t;) + +/** + * \brief Ctrl payload size struct. + * Used to determine the maximum ctrl payload size. + * \note Not instantiated. Only for size calculations. + */ +typedef struct adrv903x_CpuCmd_SetCtrlMaxSize +{ + adrv903x_CpuCmd_SetCtrl_t setCtrlCmd; + uint8_t ctrlData[MAX_CTRL_DATA_SIZE]; /*!< Ctrl data */ +} adrv903x_CpuCmd_SetCtrlMaxSize_t; + +/** + * \brief Ctrl payload size struct. + * Used to determine the maximum ctrl payload size. + * \note Not instantiated. Only for size calculations. + */ +typedef struct adrv903x_CpuCmd_SetCtrlRespMaxSize +{ + adrv903x_CpuCmd_SetCtrlResp_t setCtrlCmdResp; + uint8_t ctrlResp[MAX_CTRL_RESP_SIZE]; /*!< Ctrl response */ +} adrv903x_CpuCmd_SetCtrlRespMaxSize_t; + +/** + * \brief ADC cal control commands + * \note Not instantiated. + */ +typedef enum adrv903x_CpuCmd_AdcCtrlCmd +{ + ADC_CTRL_GET_SW_VERSION = 0u, + ADC_CTRL_INIT = 1u, + ADC_CTRL_SET_FSM_CMD = 2u, + ADC_CTRL_GET_FSM_STATE = 3u, + ADC_CTRL_GET_DATA_SIZES = 4u, + ADC_CTRL_GET_DATA_ADDRS = 5u, + ADC_CTRL_RUN_CMD = 6u, + ADC_CTRL_CMD_INVALID = 7u +} adrv903x_CpuCmd_AdcCtrlCmd_e; + +typedef enum adrv903x_CpuCmd_AdcCtrlFsmCmd +{ + ADC_FSM_CMD_IDLE_CAL = 0u, + ADC_FSM_CMD_INIT_CAL = 1u, + ADC_FSM_CMD_RUN_FG_CAL = 2u, + ADC_FSM_CMD_RUN_BG_CAL = 3u, + ADC_FSM_CMD_FREEZE_CAL = 4u, + ADC_FSM_CMD_ABORT_CAL = 5u, + ADC_FSM_CMD_WARM_BOOT_CAL = 6u +} adrv903x_CpuCmd_AdcCtrlFsmCmd_e; +#endif /* CLIENT_IGNORE */ + +/** + * \brief ADC cal get channel object data sizes and addresses + * + * \note + */ +typedef struct adrv903x_CpuCmd_GetAdcSizeAddrs +{ + uint32_t obj; + uint32_t init; + uint32_t config; + uint32_t calObj; + uint32_t calState; + uint32_t calData; +} adrv903x_CpuCmd_GetAdcSizeAddrs_t; + +#endif /* __ADRV903X_CPU_CMD_CTRL_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_debug.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_debug.h new file mode 100644 index 0000000000000..d43ca9e6d69c4 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_debug.h @@ -0,0 +1,90 @@ +/** + * \file adrv903x_cpu_cmd_debug.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_DEBUG + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2020 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_DEBUG_H__ +#define __ADRV903X_CPU_CMD_DEBUG_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" +#include "adrv903x_cpu_object_ids_types.h" +#include "adrv903x_cpu_debug_types.h" + +/** + * \brief Maximum debug payload size + */ +#define MAX_DEBUG_DATA_SIZE (256u) + +/** + * \brief Maximum debug response size + */ +#define MAX_DEBUG_RESP_SIZE (256u) + +/** + * \brief DEBUG command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_Debug +{ + adrv903x_CpuObjectId_t objId; /*!< Object ID of the cal or system component */ + uint16_t debugCmd; /*!< Command to be executed */ + uint32_t channelNum; /*!< Channel number (0 for channel 1, 1 for channel 2, etc.) */ + uint16_t length; /*!< Length of the debug data payload in bytes */ + + /* Debug data payload follows command header. + * This can't be declared here due to the API's use of the -Wpedantic compiler option. + * uint8_t dbgData[]; + */ +} adrv903x_CpuCmd_Debug_t;) + + +/** + * \brief DEBUG command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_DebugResp +{ + adrv903x_CpuErrorCode_e cmdStatus; /*!< Command status */ + uint16_t length; /*!< Length of the response data in bytes */ + + /* Debug data response payload follows command header. + * This can't be declared here due to the API's use of the -Wpedantic compiler option. + * uint8_t respData[]; + */ +} adrv903x_CpuCmd_DebugResp_t;) + +/** + * \brief Debug payload size struct. + * Used to determine the maximum debug payload size. + * \note Not instantiated. Only for size calculations. + */ +typedef struct adrv903x_CpuCmd_DebugMaxSize +{ + adrv903x_CpuCmd_Debug_t setDebugCmd; + uint8_t debugData[MAX_DEBUG_DATA_SIZE]; /*!< Debug data */ +} adrv903x_CpuCmd_DebugMaxSize_t; + +/** + * \brief Debug payload size struct. + * Used to determine the maximum debug payload size. + * \note Not instantiated. Only for size calculations. + */ +typedef struct adrv903x_CpuCmd_DebugRespMaxSize +{ + adrv903x_CpuCmd_DebugResp_t setDebugCmdResp; + uint8_t debugResp[MAX_DEBUG_RESP_SIZE]; /*!< Debug response */ +} adrv903x_CpuCmd_DebugRespMaxSize_t; + + +#endif /* __ADRV903X_CPU_CMD_DEBUG_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_devtemp.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_devtemp.h new file mode 100644 index 0000000000000..cf3b189f60497 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_devtemp.h @@ -0,0 +1,82 @@ +/** + * \file adrv903x_cpu_cmd_devtemp.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_GET_DEVICE_TEMPERATURE, + * ADRV903X_CPU_CMD_ID_GET_ENABLED_TEMPSENSORS, + * ADRV903X_CPU_CMD_ID_SET_ENABLED_TEMPSENSORS + * + * \details Command definition for ADRV903X_CPU_CMD_ID_GET_DEVICE_TEMPERATURE, + * ADRV903X_CPU_CMD_ID_GET_ENABLED_TEMPSENSORS, + * ADRV903X_CPU_CMD_ID_SET_ENABLED_TEMPSENSORS + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_DEVTEMP_H__ +#define __ADRV903X_CPU_CMD_DEVTEMP_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_dev_temp_types.h" +#include "adrv903x_cpu_error_codes_types.h" + +/** + * \brief ADRV903X_CPU_CMD_ID_GET_DEVICE_TEMPERATURE command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetDevTemp +{ + uint16_t avgMask; /*!< Bitmask of adi_adrv903x_DevTempSensorMask_e values indicating + which temperature sensor readings should be averaged. See + definition of adi_adrv903x_DevTempData_t. */ +} adrv903x_CpuCmd_GetDevTemp_t;) + +/** + * \brief ADRV903X_CPU_CMD_ID_GET_DEVICE_TEMPERATURE command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetDevTempResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + adi_adrv903x_DevTempData_t tempData; /*!< Temperature data returned by CPU */ +} adrv903x_CpuCmd_GetDevTempResp_t;) + +/** + * \brief ADRV903X_CPU_CMD_ID_GET_ENABLED_TEMPSENSORS command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetDevTempSnsEnResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + uint16_t tempEnData; /*!< Bitmask of adi_adrv903x_DevTempSensorMask_e values indicating + Temperature sensor enable bitfield returned by CPU */ +} adrv903x_CpuCmd_GetDevTempSnsEnResp_t;) + +/** + * \brief ADRV903X_CPU_CMD_ID_GET_DEVICE_TEMPERATURE command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetDevTempSnsEn +{ + uint16_t tempEnData; /*!< Bitmask of adi_adrv903x_DevTempSensorMask_e values indicating + which temperature sensors to enable/disable. */ +} adrv903x_CpuCmd_SetDevTempSnsEn_t;) + +/** + * \brief ADRV903X_CPU_CMD_ID_SET_ENABLED_TEMPSENSORS command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetDevTempSnsEnResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + uint16_t tempEnData; /*!< Bitmask of adi_adrv903x_DevTempSensorMask_e values indicating + which temperature sensors are actually enabled/disabled. */ +} adrv903x_CpuCmd_SetDevTempSnsEnResp_t;) + +#endif /* __ADRV903X_CPU_CMD_DEVTEMP_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_efuse.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_efuse.h new file mode 100644 index 0000000000000..290e7539a3925 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_efuse.h @@ -0,0 +1,43 @@ +/** + * \file adrv903x_cpu_cmd_efuse.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_EFUSE_GET + * + * \details Command definition for ADRV903X_CPU_CMD_ID_EFUSE_GET + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2020 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_EFUSE_H__ +#define __ADRV903X_CPU_CMD_EFUSE_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" + +/** + * \brief EFUSE get command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_EfuseGet +{ + uint32_t addr; /*!< Address to read from */ +} adrv903x_CpuCmd_EfuseGet_t;) + +/** + * \brief EFUSE get command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_EfuseGetResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + uint32_t value; /*!< data read from EFUSE address */ +} adrv903x_CpuCmd_EfuseGetResp_t;) + +#endif /* __ADRV903X_CPU_CMD_EFUSE_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_enter_debug_mode.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_enter_debug_mode.h new file mode 100644 index 0000000000000..220006502cb48 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_enter_debug_mode.h @@ -0,0 +1,43 @@ +/** + * \file adrv903x_cpu_cmd_enter_debug_mode.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_ENTER_DEBUG_MODE + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_ENTER_DEBUG_MODE_H__ +#define __ADRV903X_CPU_CMD_ENTER_DEBUG_MODE_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" + + +/** + * \brief ENTER_DEBUG_MODE command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_EnterDebugMode +{ + uint32_t debugModeKey; +} adrv903x_CpuCmd_EnterDebugMode_t;) + + +/** + * \brief ENTER_DEBUG_MODE command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_EnterDebugModeResp +{ + adrv903x_CpuErrorCode_e cmdStatus; /*!< Command status */ +} adrv903x_CpuCmd_EnterDebugModeResp_t;) + + +#endif /* __ADRV903X_CPU_CMD_ENTER_DEBUG_MODE_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_fast_attack.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_fast_attack.h new file mode 100644 index 0000000000000..b2a995a84c33e --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_fast_attack.h @@ -0,0 +1,48 @@ +/** + * \file adrv903x_cpu_cmd_fast_attack.h + * + * \brief Command definition for ADRV903X_CPU_CMD_FAST_ATTACK + * + * \details Command definition for ADRV903X_CPU_CMD_FAST_ATTACK + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_FAST_ATTACK_H__ +#define __ADRV903X_CPU_CMD_FAST_ATTACK_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cpu_error_codes_types.h" + +#define ADRV903X_RX_ADC_FAST_ATTACK_STATUS_IDX (11u) +#define ADRV903X_ORX_ADC_FAST_ATTACK_STATUS_IDX (6u) +#define ADRV903X_TXLB_ADC_FAST_ATTACK_STATUS_IDX (6u) + +/** + * \brief Fast Attack command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_EnFastAttack +{ + uint32_t calMask; /*!< Cals to be set in Fast Attack mode */ +} adrv903x_CpuCmd_EnFastAttack_t;) + +/** + * \brief ast Attack command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_EnFastAttackResp +{ + adi_adrv903x_CpuErrorCode_t status; /*!< CPU error status code */ + uint32_t failedCalMask; /*!< Cals failed to be set in Fast Attack mode */ +} adrv903x_CpuCmd_EnFastAttackResp_t;) + +#endif /* __ADRV903X_CPU_CMD_FAST_ATTACK__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_force_exception.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_force_exception.h new file mode 100644 index 0000000000000..a1a8d6f8e07ff --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_force_exception.h @@ -0,0 +1,53 @@ +/** + * \file adrv903x_cpu_cmd_force_exception.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_FORCE_EXCEPTION + * + * \details Command definition for ADRV903X_CPU_CMD_ID_FORCE_EXCEPTION + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_FORCE_EXCEPTION_H__ +#define __ADRV903X_CPU_CMD_FORCE_EXCEPTION_H__ + +#include "adi_adrv903x_platform_pack.h" + +/** + * NOTE: Unlike other commands, the force exception command will be indicated by + * the hardware mailbox opcode value, which is used as the link id for other + * commands. + */ + + +/** \var Force exception opcode/link id */ +typedef uint8_t adrv903x_MailboxOpcodes_t; + +/** + * \brief Force exception opcode/link id enumeration + */ +typedef enum adrv903x_MailboxOpcodes +{ + ADRV903X_MAILBOX_FORCE_EXCEPTION = 0x3FU /*!< 0x3F - Force exception */ +} adrv903x_MailboxOpcodes_e; + + +/* Type and enumeration for CPU exception status */ +typedef uint32_t adrv903x_CpuExceptionFlag_t; + +typedef enum adrv903x_CpuExceptionFlag +{ + ADRV903X_CPU_NO_EXCEPTION = 0u, /*!< 0x00000000 - CPU running normally */ + ADRV903X_CPU_EXCEPTION_ENTERED = 0x11111111u, /*!< 0x11111111 - Exception handler entered, no snapshot data */ + ADRV903X_CPU_EXCEPTION_COMPLETED = 0x33333333u /*!< 0x33333333 - Exception handler complete, valid snapshot data */ +} adrv903x_CpuExceptionFlag_e; + +#endif /* __ADRV903X_CPU_CMD_FORCE_EXCEPTION_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_config.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_config.h new file mode 100644 index 0000000000000..c792521178a45 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_config.h @@ -0,0 +1,133 @@ +/** + * \file adrv903x_cpu_cmd_config.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_SET_CONFIG + * and ADRV903X_CPU_CMD_ID_GET_CONFIG + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_CONFIG_H__ +#define __ADRV903X_CPU_CMD_CONFIG_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" +#include "adrv903x_cpu_object_ids_types.h" + +#ifndef ADI_ADRV903X_FW +#include "adi_adrv903x_user.h" +#endif + +/** + * \brief Maximum configuration payload size + */ +#define MAX_CONFIG_DATA_SIZE (256u) + + +/** + * \brief UNLOCK_CONFIG command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_UnlockConfig +{ + uint32_t configKey; +} adrv903x_CpuCmd_UnlockConfig_t;) + + +/** + * \brief UNLOCK_CONFIG command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_UnlockConfigResp +{ + adrv903x_CpuErrorCode_e cmdStatus; /*!< Command status */ +} adrv903x_CpuCmd_UnlockConfigResp_t;) + + +/** + * \brief SET_CONFIG command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetConfig +{ + adrv903x_CpuObjectId_t objId; /*!< Object ID of calibration or system component */ + uint16_t offset; /*!< Offset into the configuration structure */ + uint16_t length; /*!< Length of the configuration in bytes */ + + /* Config data payload follows command header. + * This can't be declared here due to the API's use of the -Wpedantic compiler option. + * uint8_t configData[]; + */ +} adrv903x_CpuCmd_SetConfig_t;) + + +/** + * \brief SET_CONFIG command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetConfigResp +{ + adrv903x_CpuErrorCode_e cmdStatus; /*!< Command status */ +} adrv903x_CpuCmd_SetConfigResp_t;) + + +/** + * \brief GET_CONFIG command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetConfig +{ + adrv903x_CpuObjectId_t objId; /*!< Object ID of calibration or system component */ + uint16_t offset; /*!< Offset into the configuration structure */ + uint16_t length; /*!< Length of the configuration in bytes */ +} adrv903x_CpuCmd_GetConfig_t;) + + +/** + * \brief GET_CONFIG command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetConfigResp +{ + adrv903x_CpuErrorCode_e cmdStatus; /*!< Command status */ + + /* Config data payload follows command header. + * This can't be declared here due to the API's use of the -Wpedantic compiler option. + * uint8_t configData[]; + */ +} adrv903x_CpuCmd_GetConfigResp_t;) + + +/** + * \brief Configuration payload size struct. + * Used to determine the maximum configuration payload size. + * \note Not instantiated. Only for size calculations. + */ +typedef struct adrv903x_CpuCmd_SetConfigMaxSize +{ + adrv903x_CpuCmd_SetConfig_t setConfigCmd; + uint8_t configData[MAX_CONFIG_DATA_SIZE]; /*!< Configuration data */ +} adrv903x_CpuCmd_SetConfigMaxSize_t; + +#ifndef ADI_ADRV903X_FW +#endif + +/** + * \brief Configuration payload size struct. + * Used to determine the maximum configuration payload size. + * \note Not instantiated. Only for size calculations. + */ +typedef struct adrv903x_CpuCmd_GetConfigMaxSize +{ + adrv903x_CpuCmd_GetConfigResp_t getConfigCmdResp; + uint8_t configData[MAX_CONFIG_DATA_SIZE]; /*!< Configuration data */ +} adrv903x_CpuCmd_GetConfigMaxSize_t; + +#endif /* __ADRV903X_CPU_CMD_CONFIG_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_lofreq.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_lofreq.h new file mode 100644 index 0000000000000..1968dc90cd1d9 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_lofreq.h @@ -0,0 +1,171 @@ +/** + * \file adrv903x_cpu_cmd_getset_lofreq.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_GET_LOFREQ, + * ADRV903X_CPU_CMD_ID_SET_LOFREQ, ADRV903X_CPU_CMD_ID_GET_LOOPFILTER, + * ADRV903X_CPU_CMD_ID_SET_LOOPFILTER and ADRV903X_CPU_CMD_ID_GET_RXTXLOFREQ + * + * \details Command definition for ADRV903X_CPU_CMD_ID_GET_LOFREQ, + * ADRV903X_CPU_CMD_ID_SET_LOFREQ, ADRV903X_CPU_CMD_ID_GET_LOOPFILTER, + * ADRV903X_CPU_CMD_ID_SET_LOOPFILTER and ADRV903X_CPU_CMD_ID_GET_RXTXLOFREQ + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_GETSET_LOFREQ_H__ +#define __ADRV903X_CPU_CMD_GETSET_LOFREQ_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_lo_types.h" +#include "adrv903x_cpu_error_codes_types.h" +#include "adrv903x_cpu_device_profile_types.h" + +typedef uint8_t adi_adrv903x_LoName_t; /* associates with adi_adrv903x_LoName_e */ +typedef uint32_t adi_adrv903x_LoOption_t; /* associates with adi_adrv903x_LoOption_e */ +typedef uint32_t adi_adrv903x_LoMcsOption_t; /* associates with adi_adrv903x_LoMcsOption_e */ + +/* + * \brief lofreq set command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetLoFreq +{ + adi_adrv903x_LoName_t loName; /*!< Select the target RF LO source */ + uint64_t loFrequency_Hz; /*!< Desired RF LO frequency in Hz */ + adi_adrv903x_LoOption_t loConfigSel; /*!< Select for LO config */ + adi_adrv903x_LoMcsOption_t loMcsType; /*!< Select the type of MCS for RF PLL. For Debug */ + uint8_t disableBleedCal; /*!< Disable bleed ramp cal (1) */ + uint8_t enablePfdOverride; /*!< Enable PFD override (1) */ + uint32_t pfdSetting; /*!< PFD override value when enablePfdOverride is set*/ +} adrv903x_CpuCmd_SetLoFreq_t;) + +/** + * \brief lofreq set command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetLoFreqResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ +} adrv903x_CpuCmd_SetLoFreqResp_t;) + +/** + * \brief lofreq get command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetLoFreq +{ + adi_adrv903x_LoName_t loName; /*!< Select the target RF LO source to read back */ +} adrv903x_CpuCmd_GetLoFreq_t;) + +/** + * \brief lofreq set command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetLoFreqResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + uint64_t loFrequency_Hz; /*!< RF LO frequency in Hz */ +} adrv903x_CpuCmd_GetLoFreqResp_t;) + + +/** + * \brief loopfilter set command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetLoopfilter +{ + adi_adrv903x_LoName_t loName; /*!< Select the target RF LO source */ + uint32_t phaseMargin; /*!< Phase margin in degrees */ + uint32_t loopBandwidth; /*!< Loop bandwidth in hz*/ +} adrv903x_CpuCmd_SetLoopfilter_t;) + +/** + * \brief loopfilter set command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetLoopfilterResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ +} adrv903x_CpuCmd_SetLoopfilterResp_t;) + +/** + * \brief loopfilter get command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetLoopfilter +{ + adi_adrv903x_LoName_t loName; /*!< Select the target RF LO source to read back */ +} adrv903x_CpuCmd_GetLoopfilter_t;) + +/** + * \brief loopfilter set command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetLoopfilterResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + uint32_t phaseMargin; /*!< Phase margin in degrees */ + uint32_t loopBandwidth; /*!< Loop bandwidth in hz*/ +} adrv903x_CpuCmd_GetLoopfilterResp_t;) + +/** + * \brief loopfilter RX/TX LO command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetRxTxLoFreqResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + adi_adrv903x_LoName_t rxLoName[ADRV903X_RX_CHAN_LEN]; /*!< PLL number of Rx Channels */ + uint32_t rxFreq[ADRV903X_RX_CHAN_LEN]; /*!< Freq of Rx Channels */ + adi_adrv903x_LoName_t txLoName[ADRV903X_TX_CHAN_LEN]; /*!< PLL number of Tx Channels */ + uint32_t txFreq[ADRV903X_TX_CHAN_LEN]; /*!< Freq of Tx Channels */ +} adrv903x_CpuCmd_GetRxTxLoFreqResp_t;) + +/** + * \brief Data structure to hold the Channel Controls to the PLL's. + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_ChanCtrlToPlls +{ + uint8_t rf0MuxTx0_3; /* If set to 1 East Tx channels (Tx0-3) are connected to PLL0 (East PLL). If set to 0 Tx0-3 are connected to PLL1 (West PLL). */ + uint8_t rf0MuxTx4_7; /* If set to 1 West Tx channels (Tx4-7) are connected to PLL0 (East PLL). If set to 0 Tx4-7 are connected to PLL1 (West PLL). */ + uint8_t rf0MuxRx0_3; /* If set to 1 East Rx channels (Rx0-3) are connected to PLL0 (East PLL). If set to 0 Rx0-3 are connected to PLL1 (West PLL). */ + uint8_t rf0MuxRx4_7; /* If set to 1 West Rx channels (Rx4-7) are connected to PLL0 (East PLL). If set to 0 Rx4-7 are connected to PLL1 (West PLL). */ +} adrv903x_CpuCmd_ChanCtrlToPlls_t;) + +/** + * \brief Data structure to hold the Channel Controls to the PLL's. + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_ChanCtrlToPllsResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ +} adrv903x_CpuCmd_ChanCtrlToPllsResp_t;) + +/** + * \brief Reprogram PLL command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_ReprogramPll +{ + uint8_t pllSel; /*!< PLL to be Reprogrammed according to adi_adrv903x_Pll_e */ +} adrv903x_CpuCmd_ReprogramPll_t;) + +/** + * \brief Reprogram PLL command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_ReprogramPllResp +{ + adi_adrv903x_CpuErrorCode_t status; /*!< CPU error status code */ +} adrv903x_CpuCmd_ReprogramPllResp_t;) + +#endif /* __ADRV903X_CPU_CMD_GETSET_LOFREQ_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_nco.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_nco.h new file mode 100644 index 0000000000000..1f1c7641f53ce --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_nco.h @@ -0,0 +1,142 @@ +/** + * \file adrv903x_cpu_cmd_getset_nco.h + * + * \brief Command definition for: + * ADRV903X_CPU_CMD_ID_GET_RX_NCO, + * ADRV903X_CPU_CMD_ID_SET_RX_NCO, + * ADRV903X_CPU_CMD_ID_GET_ORX_NCO, + * ADRV903X_CPU_CMD_ID_SET_ORX_NCO, + * ADRV903X_CPU_CMD_ID_GET_TX_MIX_NCO, + * ADRV903X_CPU_CMD_ID_SET_TX_MIX_NCO, + * ADRV903X_CPU_CMD_ID_GET_TX_TEST_NCO, + * ADRV903X_CPU_CMD_ID_SET_TX_TEST_NCO + * + * \details Command definition for: + * ADRV903X_CPU_CMD_ID_GET_RX_NCO, + * ADRV903X_CPU_CMD_ID_SET_RX_NCO, + * ADRV903X_CPU_CMD_ID_GET_ORX_NCO, + * ADRV903X_CPU_CMD_ID_SET_ORX_NCO, + * ADRV903X_CPU_CMD_ID_GET_TX_MIX_NCO, + * ADRV903X_CPU_CMD_ID_SET_TX_MIX_NCO, + * ADRV903X_CPU_CMD_ID_GET_TX_TEST_NCO, + * ADRV903X_CPU_CMD_ID_SET_TX_TEST_NCO + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_GETSET_NCO_H__ +#define __ADRV903X_CPU_CMD_GETSET_NCO_H__ + +#include "adi_adrv903x_rx_nco.h" +#include "adi_adrv903x_tx_nco.h" +#include "adrv903x_cpu_error_codes_types.h" + +/* SET_RX_NCO command structure is defined in adi_adrv903x_rx_nco.h */ + +/** + * \brief SET_RX_NCO command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_RxNcoConfigResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + uint8_t chanSelect; /*!< Channel mask of channels set */ +} adrv903x_RxNcoConfigResp_t;) + +/** + * \brief GET_RX_NCO command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_RxNcoConfigReadback +{ + uint8_t chanSelect; /*!< Rx channel (bit mapped) */ + adi_adrv903x_DdcNumber_t bandSelect; /*!< which band */ +} adrv903x_RxNcoConfigReadback_t;) + +/* GET_RX_NCO command response structure is defined in adi_adrv903x_rx_nco.h */ + +/* SET_ORX_NCO command structure is defined in adi_adrv903x_rx_nco.h */ + +/** + * \brief SET_ORX_NCO command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_ORxNcoConfigResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + uint8_t chanSelect; /*!< Rx channel (bit mapped) */ +} adrv903x_ORxNcoConfigResp_t;) + +/** + * \brief GET_ORX_NCO command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_ORxNcoConfigReadback +{ + uint8_t chanSelect; /*!< Select ORx channel (bit mapped) */ + uint8_t ncoSelect; /*!< Select ORx NCO, 0 = DDC, 1 = datapath */ +} adrv903x_ORxNcoConfigReadback_t;) + +/* GET_ORX_NCO command response structure is defined in adi_adrv903x_rx_nco.h */ + +/* SET_TX_MIX_NCO command structure is defined in adi_adrv903x_tx_nco.h */ + +/** + * \brief SET_TX_MIX_NCO command response structure + */ +ADI_ADRV903X_PACK_START +typedef struct adrv903x_TxNcoMixConfigResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + uint8_t chanSelect; /*!< Tx channel (bit mapped) */ +} adrv903x_TxNcoMixConfigResp_t; +ADI_ADRV903X_PACK_FINISH + +/** + * \brief GET_TX_MIX_NCO command structure + */ +ADI_ADRV903X_PACK_START +typedef struct adrv903x_TxNcoMixConfigReadback +{ + uint8_t chanSelect; /*!< Select the Tx channel (bit mapped) to get (only one channel at a time) */ +} adrv903x_TxNcoMixConfigReadback_t; +ADI_ADRV903X_PACK_FINISH + +/* GET_TX_MIX_NCO command response structure is defined in adi_adrv903x_tx_nco.h */ + +/* SET_TX_TEST_NCO command structure is defined in adi_adrv903x_tx_nco.h */ + +/** + * \brief SET_TX_TEST_NCO command response structure + */ +ADI_ADRV903X_PACK_START +typedef struct adrv903x_TxTestNcoConfigResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + uint8_t chanSelect; /*!< Tx channel (bit mapped) */ +} adrv903x_TxTestNcoConfigResp_t; +ADI_ADRV903X_PACK_FINISH + + +/** + * \brief GET_TX_TEST_NCO command structure + */ +ADI_ADRV903X_PACK_START +typedef struct adrv903x_TxTestNcoConfigReadback +{ + uint8_t chanSelect; /*!< Select Tx channel (bit mapped) */ + adi_adrv903x_TxTestNcoSelect_t ncoSelect; /*!< 0 or 1 */ +} adrv903x_TxTestNcoConfigReadback_t; +ADI_ADRV903X_PACK_FINISH + +/* GET_TX_TEST_NCO command response structure is defined in adi_adrv903x_tx_nco.h */ + +#endif /* __ADRV903X_CPU_CMD_GETSET_NCO_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_txatten_phase.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_txatten_phase.h new file mode 100644 index 0000000000000..2ce7bc4979fc0 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_getset_txatten_phase.h @@ -0,0 +1,66 @@ +/** + * \file adrv903x_cpu_cmd_getset_txatten_phase.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_GET_TXATTEN_PHASE, + * + * \details Command definition for ADRV903X_CPU_CMD_ID_SET_TXATTEN_PHASE, + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_GETSET_TXATTEN_PHASE_H__ +#define __ADRV903X_CPU_CMD_GETSET_TXATTEN_PHASE_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" +#include "adrv903x_cpu_device_profile_types.h" +#include "adi_adrv903x_tx_nco.h" + +/** + * \brief tx atten phase set command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetTxAttenPhase +{ + uint8_t chanSelect; /*!< Tx channel (bit mapped) */ + int16_t txAttenPhase[ADI_ADRV903X_TX_ATTEN_PHASE_SIZE]; /*!< Tx atten phase values */ +} adrv903x_CpuCmd_SetTxAttenPhase_t;) + +/** + * \brief tx atten phase set command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetTxAttenPhaseResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ +} adrv903x_CpuCmd_SetTxAttenPhaseResp_t;) + +/** + * \brief tx atten phase get command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetTxAttenPhase +{ + uint8_t chanSelect; /*!< Tx channel (bit mapped) */ +} adrv903x_CpuCmd_GetTxAttenPhase_t;) + +/** + * \brief tx atten phase get command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetTxAttenPhaseResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + int16_t txAttenPhase[ADI_ADRV903X_TX_ATTEN_PHASE_SIZE]; /*!< Tx atten phase values */ +} adrv903x_CpuCmd_GetTxAttenPhaseResp_t;) + + + +#endif /* __ADRV903X_CPU_CMD_GETSET_TXATTEN_PHASE_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_gpio.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_gpio.h new file mode 100644 index 0000000000000..cb0a8320339fd --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_gpio.h @@ -0,0 +1,98 @@ +/** + * \file adrv903x_cpu_cmd_gpio.h + * + * \brief Command definitions for GPIO. + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_GPIO_H__ +#define __ADRV903X_CPU_CMD_GPIO_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cpu_error_codes_types.h" + +/** + * \brief ARM controlled GPIO pin control enumeration + */ +typedef enum adrv903x_CpuCmd_GpioPinCtrl +{ + ADRV903X_CPU_CMD_GPIO_PIN_DISABLE, /*!< Disable pin for a given signal */ + ADRV903X_CPU_CMD_GPIO_PIN_ENABLE, /*!< Enable pin for a signal */ +} adrv903x_CpuCmd_GpioPinCtrl_e; + +typedef uint8_t adrv903x_CpuCmd_GpioPinCtrl_t; + +/** + * \brief ARM controlled GPIO signal enumeration + */ +typedef enum adrv903x_CpuCmd_GpioSignal +{ + ADRV903X_CPU_CMD_GPIO_SIGNAL_SWBKPT_BKPT_HIT, /*!< SW breakpoint was hit signal */ + ADRV903X_CPU_CMD_GPIO_SIGNAL_SWBKPT_RESUME_FROM_BKPT, /*!< Resume from SW breakpoint signal */ +} adrv903x_CpuCmd_GpioSignal_e; + +typedef uint8_t adrv903x_CpuCmd_GpioSignal_t; + +/** + * \brief ARM controlled GPIO pin polarity enumeration + */ +typedef enum adrv903x_CpuCmd_GpioPinPolarity +{ + ADRV903X_CPU_CMD_GPIO_PIN_POLARITY_NORMAL, /*!< Normal pin polarity */ + ADRV903X_CPU_CMD_GPIO_PIN_POLARITY_INVERTED, /*!< Inverted pin polarity */ +} adrv903x_CpuCmd_GpioPinPolarity_e; + +typedef uint8_t adrv903x_CpuCmd_GpioPinPolarity_t; + +/** + * \brief SET_GPIO command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetGpio +{ + adrv903x_CpuCmd_GpioSignal_t signal; + uint8_t pin; + adrv903x_CpuCmd_GpioPinPolarity_t polarity; + adrv903x_CpuCmd_GpioPinCtrl_t enable; +} adrv903x_CpuCmd_SetGpio_t;) + +/** + * \brief SET_GPIO command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetGpioResp +{ + adrv903x_CpuErrorCode_e cmdStatus; /*!< Command status */ +} adrv903x_CpuCmd_SetGpioResp_t;) + +/** + * \brief GET_GPIO command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetGpio +{ + adrv903x_CpuCmd_GpioSignal_t signal; +} adrv903x_CpuCmd_GetGpio_t;) + + +/** + * \brief GET_GPIO command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetGpioResp +{ + uint8_t pin; + adrv903x_CpuCmd_GpioPinPolarity_t polarity; + adrv903x_CpuErrorCode_e cmdStatus; /*!< Command status */ +} adrv903x_CpuCmd_GetGpioResp_t;) + + +#endif /* __ADRV903X_CPU_CMD_GPIO_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_intf.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_intf.h new file mode 100644 index 0000000000000..90cb313187ec2 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_intf.h @@ -0,0 +1,79 @@ +/** + * \file adrv903x_cpu_cmd_interface.h + * + * \brief Contains device command interface definition + * + * \details Contains device command interface definition + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_INTF_H__ +#define __ADRV903X_CPU_CMD_INTF_H__ + +#include "adi_adrv903x_platform_pack.h" +#ifndef ADI_ADRV903X_FW +#include "adrv903x_platform_byte_order.h" +#endif + +/** \var CPU command ID type */ +typedef uint16_t adrv903x_CpuCmdId_t; + +/** \var CPU command transaction ID type */ +typedef uint16_t adrv903x_CpuCmdTransactionId_t; + +/** \var CPU command status type */ +typedef uint16_t adrv903x_CpuCmdStatus_t; + +/** + * \brief CPU command status enumeration + */ +typedef enum adrv903x_CpuCmdStatus +{ + ADRV903X_CPU_CMD_STATUS_NO_ERROR, /*!< No error */ + ADRV903X_CPU_CMD_STATUS_GENERIC, /*!< Unspecified/unknown error */ + ADRV903X_CPU_CMD_STATUS_LINK_ERROR, /*!< Link (lower level) error */ + ADRV903X_CPU_CMD_STATUS_UNEXPECTED_TRANSACTION_ID, /*!< Unexpected/invalid transaction ID received */ + ADRV903X_CPU_CMD_STATUS_CMD_FAILED, /*!< Command-specific failure. See command-specific response for details. */ + ADRV903X_CPU_CMD_STATUS_CMD_ID_INVALID /*!< Invalid command ID */ +} adrv903x_CpuCmdStatus_e; + +/** +* \brief Common CPU command structure +*/ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd +{ + adrv903x_CpuCmdId_t cmdId; /*!< Command ID. Value is from adrv903x_CpuCmdId_e enumeration. */ + adrv903x_CpuCmdTransactionId_t tId; /*!< Transaction ID. Unique ID for a command/response pair. */ + + /* Command payload follows command header. + * This can't be declared here due to the API's use of the -Wpedantic compiler option. + * void* payload[]; + */ +} adrv903x_CpuCmd_t;) + +/** +* \brief Common CPU command response structure +*/ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmdResp +{ + adrv903x_CpuCmdId_t cmdId; /*!< Command ID. Value is from adrv903x_CpuCmdId_e enumeration. */ + adrv903x_CpuCmdTransactionId_t tId; /*!< Transaction ID. Unique ID for a command/response pair. */ + adrv903x_CpuCmdStatus_t status; /*!< Command status. Value is from adrv903x_CpuCmdStatus_e enumeration. */ + + /* Command response payload follows command header. + * This can't be declared here due to the API's use of the -Wpedantic compiler option. + * void* payload[]; + */ +} adrv903x_CpuCmdResp_t;) + +#endif /* __ADRV903X_CPU_CMD_INTF_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_jesd_ser_lane_getset_cfg.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_jesd_ser_lane_getset_cfg.h new file mode 100644 index 0000000000000..5128a3469a91e --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_jesd_ser_lane_getset_cfg.h @@ -0,0 +1,71 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adrv903x_cpu_cmd_jesd_ser_lane_getset_cfg.h + * + * \brief Contains ADRV903X JESD Serializer lane data structures. + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADI_ADRV903X_CPU_CMD_JESD_SER_LANE_GETSET_CFG_H__ +#define __ADI_ADRV903X_CPU_CMD_JESD_SER_LANE_GETSET_CFG_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" + +/** + * \brief Serializer lane get configuration command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetJesdSerLaneCfg +{ + uint8_t lane; /*!< Serializer lane number */ +} adrv903x_CpuCmd_GetJesdSerLaneCfg_t;) + + +/** + * \brief Serializer lane get configuration response command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetJesdSerLaneCfgResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + uint8_t lane; /*!< Serializer lane number */ + uint8_t outputDriveSwing; /*!< Serializer Lane output swing level */ + uint8_t preEmphasis; /*!< Serializer Lane pre-emphasis */ + uint8_t postEmphasis; /*!< Serializer Lane post-emphasis */ +} adrv903x_CpuCmd_GetJesdSerLaneCfgResp_t;) + + +/** + * \brief Serializer lane set configuration command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetJesdSerLaneCfg +{ + uint8_t lane; /*!< Serializer lane number */ + uint8_t outputDriveSwing; /*!< Serializer Lane output swing level */ + uint8_t preEmphasis; /*!< Serializer Lane pre-emphasis */ + uint8_t postEmphasis; /*!< Serializer Lane post-emphasis */ +} adrv903x_CpuCmd_SetJesdSerLaneCfg_t;) + + +/** + * \brief Serializer lane set configuration response command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetJesdSerLaneCfgResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ +} adrv903x_CpuCmd_SetJesdSerLaneCfgResp_t;) + + + +#endif /* __ADI_ADRV903X_CPU_CMD_JESD_SER_LANE_GETSET_CFG_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_log.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_log.h new file mode 100644 index 0000000000000..52cd6909744ca --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_log.h @@ -0,0 +1,35 @@ +/** + * \file adrv903x_cpu_cmd_log.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_SET_LOG_FILTERS + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_LOG_H__ +#define __ADRV903X_CPU_CMD_LOG_H__ + +#include "adi_adrv903x_cpu_log_types.h" +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cpu_error_codes_types.h" + + +/** + * \brief SET_LOG_FILTERS command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetLogFilters +{ + adi_adrv903x_CpuLogEvent_t logEventFilter; + adi_adrv903x_CpuLogCpuId_t cpuIdFilter; + adi_adrv903x_CpuLogObjIdFilter_t objIdFilter; +} adrv903x_CpuCmd_SetLogFilters_t;) + +#endif /* __ADRV903X_CPU_CMD_LOG_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_mcs.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_mcs.h new file mode 100644 index 0000000000000..781aea98f56fd --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_mcs.h @@ -0,0 +1,44 @@ +/** + * \file adrv903x_cpu_cmd_mcs.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_START_MCS, + * ADRV903X_CPU_CMD_ID_MCS_COMPLETE + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_MCS_H__ +#define __ADRV903X_CPU_CMD_MCS_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" + +/* START_MCS command has no payload */ +/** + * \brief START_MCS command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_StartMcsResp +{ + adrv903x_CpuErrorCode_e status; /*!< Error status code. CPU_NO_ERROR if MCS successfully started. */ +} adrv903x_CpuCmd_StartMcsResp_t;) + +/* MCS_COMPLETE command has no payload */ +/* MCS_COMPLETE command response structure */ +/** + * \brief MCS_COMPLETEcommand response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_McsCompleteResp +{ + adrv903x_CpuErrorCode_e status; /*!< Error status code. CPU_NO_ERROR if MCS successfully started. */ +} adrv903x_CpuCmd_McsCompleteResp_t;) + +#endif /* __ADRV903X_CPU_CMD_MCS_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ping.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ping.h new file mode 100644 index 0000000000000..13d39e05e2632 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ping.h @@ -0,0 +1,43 @@ +/** + * \file adrv903x_cpu_cmd_ping.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_PING + * + * \details Command definition for ADRV903X_CPU_CMD_ID_PING + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_PING_H__ +#define __ADRV903X_CPU_CMD_PING_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" + +/** + * \brief PING command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_Ping +{ + uint32_t echoData; /*!< Data to be echoed back by CPU */ +} adrv903x_CpuCmd_Ping_t;) + +/** + * \brief PING command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_PingResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + uint32_t echoData; /*!< Echoed data from CPU */ +} adrv903x_CpuCmd_PingResp_t;) + +#endif /* __ADRV903X_CPU_CMD_PING_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_radio.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_radio.h new file mode 100644 index 0000000000000..b6acdd22a8341 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_radio.h @@ -0,0 +1,44 @@ +/** + * \file adrv903x_cpu_cmd_radio.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_RADIO + * + * \details Command definition for ADRV903X_CPU_CMD_ID_RADIO + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2022 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_RADIO_H__ +#define __ADRV903X_CPU_CMD_RADIO_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" + +/** + * \brief Enum of radio subcommands + */ +typedef enum adrv903x_CpuCmd_RadioSubcommand +{ + ADI_ADRV903X_RADIO_PING = 0, /*!< Radio ping command */ + ADI_ADRV903X_RADIO_TXLOL_GET_PARAMS = 1, /*!< Radio TxLOL get correction parameters */ +} adrv903x_CpuCmd_RadioSubcommand_e; + +/** + * \brief Radio TxLOL parameters get command structure + */ +ADI_ADRV903X_PACK_START +typedef struct adrv903x_CpuCmd_RadioTxLolParamsGet +{ + uint8_t txChan; /*!< Tx channel (0 - 7) */ + uint8_t hpAtten; /*!< Tx attenuation (1 - 64) */ +} adrv903x_CpuCmd_RadioTxLolParamsGet_t; +ADI_ADRV903X_PACK_FINISH + +#endif /* __ADRV903X_CPU_CMD_RADIO_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ram.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ram.h new file mode 100644 index 0000000000000..1feaf22d831ef --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ram.h @@ -0,0 +1,74 @@ +/** + * \file adrv903x_cpu_cmd_ram.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_RAM_ACCESS_START, + * ADRV903X_CPU_CMD_ID_RAM_ACCESS_STOP + * + * \details Command definition for ADRV903X_CPU_CMD_ID_RAM_ACCESS_START, + * ADRV903X_CPU_CMD_ID_RAM_ACCESS_STOP + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_RAM_H__ +#define __ADRV903X_CPU_CMD_RAM_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" + +/** + * \brief Capture RAM type enumeration + */ +typedef enum adrv903x_CpuCmd_CaptureRamType +{ + ADRV903X_CPU_CMD_CAP_RAM_TYPE_DPD, /*!< DPD capture RAM */ + ADRV903X_CPU_CMD_CAP_RAM_TYPE_ORX /*!< ORx capture RAM */ +} adrv903x_CpuCmd_CaptureRamType_e; +typedef uint8_t adrv903x_CpuCmd_CaptureRamType_t; + +/** + * \brief RAM_ACCESS_START command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_RamAccessStart +{ + adrv903x_CpuCmd_CaptureRamType_t captureRamType; /*!< Type of the capture RAM to lock */ + uint32_t channelNumber; /*!< Channel number of the capture RAM to lock */ +} adrv903x_CpuCmd_RamAccessStart_t;) + +/** + * \brief RAM_ACCESS_START command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_RamAccessStartResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ +} adrv903x_CpuCmd_RamAccessStartResp_t;) + +/** + * \brief RAM_ACCESS_STOP command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_RamAccessStop +{ + adrv903x_CpuCmd_CaptureRamType_t captureRamType; /*!< Type of the capture RAM to unlock */ + uint32_t channelNumber; /*!< Channel number of the capture RAM to unlock */ +} adrv903x_CpuCmd_RamAccessStop_t;) + +/** + * \brief RAM_ACCESS_STOP command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_RamAccessStopResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ +} adrv903x_CpuCmd_RamAccessStopResp_t;) + +#endif /* __ADRV903X_CPU_CMD_RAM_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_run_init.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_run_init.h new file mode 100644 index 0000000000000..4da1d6abbd3e0 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_run_init.h @@ -0,0 +1,65 @@ +/** + * \file adrv903x_cpu_cmd_run_init.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_RUN_INIT, + * ADRV903X_CPU_CMD_ID_RUN_INIT_GET_COMPLETION_STATUS, + * ADRV903X_CPU_CMD_ID_RUN_INIT_GET_DETAILED_STATUS, + * ADRV903X_CPU_CMD_ID_RUN_INIT_ABORT + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_RUN_INIT_H__ +#define __ADRV903X_CPU_CMD_RUN_INIT_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cals_types.h" +#include "adrv903x_cpu_error_codes_types.h" +#include "adrv903x_cpu_object_ids_types.h" + +/** + * \brief RUN_INIT command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_RunInit +{ + adi_adrv903x_InitCals_t config; /*!< Initial calibrations configuration structure */ +} adrv903x_CpuCmd_RunInit_t;) + +/** + * \brief RUN_INIT command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_RunInitResp +{ + adrv903x_CpuErrorCode_e status; /*!< Error status code. CPU_NO_ERROR if initial calibration was successfully started. */ +} adrv903x_CpuCmd_RunInitResp_t;) + +/** + * \brief RUN_INIT_GET_COMPLETION_STATUS command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_RunInitGetCompletionStatusResp +{ + uint8_t inProgress; /*!< Init cal progress flag. Will be set to 1 if an initial calibration run is currently in progress. Set to 0 otherwise. */ + uint8_t success; /*!< Init cal success/failure status. Set to 1 if all cals completed successfully. Set to 0 otherwise. Only valid when + inProgress equals 0. Issue ADRV903X_CPU_CMD_ID_RUN_INIT_GET_DETAILED_STATUS for detailed error info. */ +} adrv903x_CpuCmd_RunInitGetCompletionStatusResp_t;) + +/** + * \brief RUN_INIT_GET_DETAILED_STATUS command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_RunInitGetDetailedStatusResp +{ + adi_adrv903x_InitCalStatus_t status; /*!< Structure containing init cal detailed status */ +} adrv903x_CpuCmd_RunInitGetDetailedStatusResp_t;) + +#endif /* __ADRV903X_CPU_CMD_RUN_INIT_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_run_serdes_eye_sweep.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_run_serdes_eye_sweep.h new file mode 100644 index 0000000000000..b4c2a0328407a --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_run_serdes_eye_sweep.h @@ -0,0 +1,206 @@ +/** + * \file adrv903x_cpu_cmd_run_serdes_eye_sweep.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_RUN_SERDES_EYE_SWEEP + * + * \details Command definition for ADRV903X_CPU_CMD_ID_RUN_SERDES_EYE_SWEEP + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_RUN_SERDES_EYE_SWEEP_H__ +#define __ADRV903X_CPU_CMD_RUN_SERDES_EYE_SWEEP_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cpu_cmd_run_serdes_eye_sweep.h" +#include "adrv903x_cpu_error_codes_types.h" + +typedef uint8_t adrv903x_CpuCmd_DeserializerLane_t; +typedef uint8_t adrv903x_CpuCmd_PrbsPattern_t; + +/** + * \brief Serdes FSM State + */ +typedef enum adrv903x_Serdes_FsmState +{ + ADRV903X_SERDES_TEST_CMD_RUN = 14u, /*!< test cmd running. */ + ADRV903X_SERDES_TEST_CMD_DONE = 15u, /*!< test cmd complete. */ +} adrv903x_Serdes_FsmState_e; + +/** + * \brief Serdes FSM Command Enumerations + */ +typedef enum adrv903x_Serdes_FsmCmd +{ + ADRV903X_SERDES_TEST_CMD = 7u, /*!< Serdes test commands */ + /*!< Not used */ +} adrv903x_Serdes_FsmCmd_e; + +/** + * \brief Serdes Calibration Command Enumerations + */ +typedef enum adrv903x_Serdes_CalCmd +{ + ADRV903X_SERDES_TEST_HORIZ_EYE_SWEEP = 12u, /*!< Horizontal Eye Sweep */ + ADRV903X_SERDES_TEST_VERT_EYE_SWEEP = 13u, /*!< Vertical Eye Sweep */ + ADRV903X_SERDES_TEST_SET_PHY_REG = 24u, /*!< Set PHY Register */ + ADRV903X_SERDES_TEST_SET_VCM_SWC = 27u, /*!< Set the VCM SwC config */ +} adrv903x_Serdes_CalCmd_e; + +/** + * \brief Serdes Control Commands Enumerations + */ +typedef enum adrv903x_Serdes_CtrlCmd +{ + ADRV903X_SERDES_CTRL_CMD_INVALID = 0u, /*!< Invalid Control Command */ + ADRV903X_SERDES_CTRL_CMD_OK = 1u, + ADRV903X_SERDES_CTRL_RUN = 2u, /*!< Call phylib run */ + ADRV903X_SERDES_CTRL_SET_FSM_CMD = 3u, /*!< call phylib fsm */ + ADRV903X_SERDES_CTRL_GET_FSM_STATE = 4u, /*!< call phylib fsm */ +} adrv903x_Serdes_CtrlCmd_e; + +/** + * Size of the Serdes Horizontal Eye Sweep Control Command + */ +#define ADRV903X_SERDES_HORIZ_EYE_SWEEP_CMD_SIZE_BYTES 16U +/** + * Size of the Serdes Vertical Eye Sweep Control Command + */ +#define ADRV903X_SERDES_VERT_EYE_SWEEP_CMD_SIZE_BYTES 6U +/** + * Size of the Serdes FSM response command header + */ +#define ADRV903X_SERDES_CTRL_FSM_CMD_RSP_HDR_SIZE_BYTES 4U + +/** + * \brief RUN_SERDES_EYE_SWEEP command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_RunEyeSweep +{ + adrv903x_CpuCmd_DeserializerLane_t lane; /*!< Deserializer lane number */ + adrv903x_CpuCmd_PrbsPattern_t prbsPattern; /*!< PRBS pattern */ + uint8_t forceUsingOuter; /*!< Flag indicating 'outer' should be used for phase detection + 0 (default) - do not use outer for phase detection, + 1 - - use outer for phase detection */ + uint32_t prbsCheckDuration_ms; /*!< Duration of PRBS check in [ms] */ +} adrv903x_CpuCmd_RunEyeSweep_t;) + +/** + * \brief RUN_SERDES_EYE_SWEEP command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_RunEyeSweepResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + int8_t spoLeft; /*!< SPO Left value */ + int8_t spoRight; /*!< SPO Right value */ +} adrv903x_CpuCmd_RunEyeSweepResp_t;) + +/** + * \brief RUN_SERDES_VERT_EYE_SWEEP command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_RunVertEyeSweep +{ + adrv903x_CpuCmd_DeserializerLane_t lane; /*!< Deserializer lane number */ + } adrv903x_CpuCmd_RunVertEyeSweep_t;) + +/** + * \brief RUN_SERDES_VERT_EYE_SWEEP command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_RunVertiEyeSweepResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + int8_t eyeHeightsAtSpo[512]; /* Store the upper and lower eye height for 16 SPOs. Only elements 0-65 are populated. */ +} adrv903x_CpuCmd_RunVertEyeSweepResp_t;) + +/** + * \brief RUN_SERDES_VERT_EYE_SWEEP command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_RunPerCompEyeSweep +{ + uint8_t lane; + uint8_t slice; /* the slice number of the comparator of which the eye is measured */ + uint8_t flash; /* the flash number of the comparator of which the eye is measured*/ + uint8_t stopMeasEyeHeightThresh; /* + * When the measured eye height is + * below this value, we stop moving + * spo and measuring the eye height. + */ + } adrv903x_CpuCmd_RunPerCompEyeSweep_t;) + +/** + * \brief RUN_SERDES_VERT_EYE_SWEEP command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_JtxLanePower +{ + uint8_t jtxLaneMask; /*!< Bitfield indicating the lanes to affected by the cmd. If bitN is not set then lane N power status is not changed. */ + uint8_t jtxLanePower; /*!< If corresponding bit in laneMask is set then if bitN is set/unset lane N is to be powered up/down. Bit 0 is the least-significant bit.*/ +} adrv903x_CpuCmd_JtxLanePower_t;) + +/** + * \brief RUN_SERDES_VERT_EYE_SWEEP command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_PerCompEyeSweepResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + int8_t perEyeHeightsAtSpo[512]; +} adrv903x_CpuCmd_PerCompEyeSweepResp_t;) + +/** + * \brief JESD_GET_RX_LANE_SINT_CODES command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetSintCodes +{ + uint8_t lane; /*!< Serdes lane id */ +} adrv903x_CpuCmd_GetSintCodes_t;) + +/** + * \brief JESD_GET_RX_LANE_SINT_CODES command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetSintCodesResp +{ + adrv903x_CpuErrorCode_e cpuErrorCode; /*!< CPU error status code */ + adi_adrv903x_CpuCmd_GetRxLaneSintCodesResp_t details; +} adrv903x_CpuCmd_GetSintCodesResp_t;) + +/** + * \brief GET_SERDES_FG_METRICS, GET_SERDES_BG_METRICS command structure. + * + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SerdesCalStatusGet +{ + uint8_t lane; /*!< Serdes lane id */ +} adrv903x_CpuCmd_SerdesCalStatusGet_t;) +ADI_ADRV903X_PACKED( +typedef struct adrv903x_SerdesInitCalStatusCmdResp +{ + adi_adrv903x_SerdesInitCalStatus_t details; /*!< Serdes init cal status details */ + uint32_t cpuErrorCode; /*!< Cmd success/fail */ +} adrv903x_SerdesInitCalStatusCmdResp_t;) + +ADI_ADRV903X_PACKED( +typedef struct adrv903x_SerdesTrackingCalStatusCmdResp +{ + adi_adrv903x_SerdesTrackingCalStatus_t details; /*!< Serdes tracking cal status details */ + uint32_t cpuErrorCode; /*!< Cmd success/fail */ +} adrv903x_SerdesTrackingCalStatusCmdResp_t;) + + +#endif /* __ADRV903X_CPU_CMD_RUN_SERDES_EYE_SWEEP_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ser_reset.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ser_reset.h new file mode 100644 index 0000000000000..a7d361720515b --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_ser_reset.h @@ -0,0 +1,44 @@ +/** + * \file adi_adrv903x_cpu_cmd_ser_reset.h + * + * \brief Command definition for ADI_ADRV903X_CPU_CMD_ID_SER_RESET + * + * \details Command definition for ADI_ADRV903X_CPU_CMD_ID_SER_RESET + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2021 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADI_ADRV903X_CPU_CMD_SER_RESET_H__ +#define __ADI_ADRV903X_CPU_CMD_SER_RESET_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" + +/** + * \brief SER_RESET command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SerReset +{ + uint32_t serResetParm; /*!< Serializer reset parameter */ +} adrv903x_CpuCmd_SerReset_t;) + +/** + * \brief SER_RESET command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SerResetResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + uint32_t serResetResults; /*!< Ser Reset results CPU */ +} adrv903x_CpuCmd_SerResetResp_t;) + +#endif /* __ADI_ADRV903X_CPU_CMD_SER_RESET_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_sys_status.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_sys_status.h new file mode 100644 index 0000000000000..b888bac206fb8 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_sys_status.h @@ -0,0 +1,80 @@ +/** + * \file adrv903x_cpu_cmd_sys_status.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_GET_SYS_STATUS + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2020 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_SYS_STATUS_H__ +#define __ADRV903X_CPU_CMD_SYS_STATUS_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" +#include "adrv903x_cpu_object_ids_types.h" + +/** + * \brief System status type enumeration + */ +typedef enum adrv903x_CpuCmd_SysStatusType +{ + ADRV903X_CPU_CMD_SYS_STATUS_PUBLIC, /*!< Public System status */ + ADRV903X_CPU_CMD_SYS_STATUS_PRIVATE /*!< Private System status */ +} adrv903x_CpuCmd_SysStatusType_e; +typedef uint8_t adrv903x_CpuCmd_SysStatusType_t; + + +/** + * \brief GET_SYS_STATUS command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetSysStatus +{ + adrv903x_CpuCmd_SysStatusType_t type; /*!< System status type to be retrieved */ + adrv903x_CpuObjectId_t sysObjId; /*!< Object ID of system component */ + uint32_t channelNum; /*!< Channel number (0 for channel 1, 1 for channel 2, etc.) */ +} adrv903x_CpuCmd_GetSysStatus_t;) + + +/** + * \brief GET_SYS_STATUS command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetSysStatusResp +{ + adi_adrv903x_CpuErrorCode_t cmdStatus; /*!< Command status */ + /* System status payload follows command header. + * This can't be declared here due to the API's use of the -Wpedantic compiler option. + * void* sysStatus[]; + */ +} adrv903x_CpuCmd_GetSysStatusResp_t;) + +/** + * \brief System status payload union. + * Used to determine the maximum system status payload size. + * \note Not instantiated. Only for size calculations. + */ +typedef union adrgven6_SysStatusMaxSize +{ + uint8_t sysStatusMax[256]; /*!< Sys response */ +} adrgven6_SysStatusMaxSize_t; + +/** + * \brief Status payload size struct. + * Used to determine the maximum cal status payload size. + * \note Not instantiated. Only for size calculations. + */ +typedef struct adrv903x_CpuCmd_GetSysStatusMaxSize +{ + adrv903x_CpuCmd_GetSysStatusResp_t getSysStatusCmdResp; + adrgven6_SysStatusMaxSize_t sysStatusMaxSize; +} adrv903x_CpuCmd_GetSysStatusMaxSize_t; + +#endif /* __ADRV903X_CPU_CMD_SYS_STATUS_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_t.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_t.h new file mode 100644 index 0000000000000..c772b55c932c4 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_t.h @@ -0,0 +1,24 @@ +/** + * \file adrv903x_cpu_cmd_t.h + * + * \brief Contains device-specific command definitions + * + * \details Contains device-specific command definitions + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_T_H__ +#define __ADRV903X_CPU_CMD_T_H__ + +#define SERDES_PVT_BUFFER_SIZE (1018u) + +#endif /* __ADRV903X_CPU_CMD_T_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_tracking_cals.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_tracking_cals.h new file mode 100644 index 0000000000000..0d9661eb92b7a --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_tracking_cals.h @@ -0,0 +1,86 @@ +/** + * \file adrv903x_cpu_cmd_tracking_cals.h + * + * \brief Command definition for: ADRV903X_CPU_CMD_ID_SET_ENABLED_TRACKING_CALS, + * ADRV903X_CPU_CMD_ID_GET_ENABLED_TRACKING_CALS, + * ADRV903X_CPU_CMD_ID_GET_TRACKING_CAL_STATE + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_TRACKING_CALS_H__ +#define __ADRV903X_CPU_CMD_TRACKING_CALS_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cals_types.h" +#include "adrv903x_cpu_error_codes_types.h" +#include "adrv903x_cpu_object_ids_types.h" + +typedef uint8_t adrv903x_TrackingCalEnableDisable_t; + +/** + * \brief SET_ENABLED_TRACKING_CALS command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetEnabledTrackingCals +{ + adi_adrv903x_TrackingCalibrationMask_t calMask; + uint32_t channelMask; + adrv903x_TrackingCalEnableDisable_t enableDisable; +} adrv903x_CpuCmd_SetEnabledTrackingCals_t;) + +/** + * \brief SET_ENABLED_TRACKING_CALS_V2 command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetEnabledTrackingCals_v2 +{ + adi_adrv903x_TrackingCalibrationMask_t calMask; + uint32_t rxChannel; + uint32_t orxChannel; + uint32_t txChannel; + uint32_t laneSerdes; + adrv903x_TrackingCalEnableDisable_t enableDisable; +} adrv903x_CpuCmd_SetEnabledTrackingCals_v2_t;) + +/** + * \brief SET_ENABLED_TRACKING_CALS command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetEnabledTrackingCalsResp +{ + adrv903x_CpuErrorCode_e status; +} adrv903x_CpuCmd_SetEnabledTrackingCalsResp_t;) + +/** + * \brief GET_ENABLED_TRACKING_CALS command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetEnabledTrackingCalsResp +{ + adrv903x_CpuErrorCode_e status; + adi_adrv903x_TrackingCalEnableMasks_t enableMasks; +} adrv903x_CpuCmd_GetEnabledTrackingCalsResp_t;) + +/** + * \brief GET_TRACKING_CAL_STATE command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_GetTrackingCalStateResp +{ + adrv903x_CpuErrorCode_e status; + adi_adrv903x_TrackingCalState_t calState; +} adrv903x_CpuCmd_GetTrackingCalStateResp_t;) + +#ifdef __ICCARM__ +#pragma diag_default=Pm009 +#endif /* __ICCARM__ */ + +#endif /* __ADRV903X_CPU_CMD_TRACKING_CALS_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_tx_to_orx_mapping.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_tx_to_orx_mapping.h new file mode 100644 index 0000000000000..cd3dcb42aa348 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_cmd_tx_to_orx_mapping.h @@ -0,0 +1,75 @@ +/** + * \file adrv903x_cpu_cmd_tx_to_orx_mapping.h + * + * \brief Command definition for ADRV903X_CPU_CMD_ID_SET_TX_TO_ORX_PRESET_ATTEN, + * ADRV903X_CPU_CMD_ID_SET_TX_TO_ORX_PRESET_NCO + * + * \details Command definition for ADRV903X_CPU_CMD_ID_SET_TX_TO_ORX_PRESET_ATTEN, + * ADRV903X_CPU_CMD_ID_SET_TX_TO_ORX_PRESET_NCO + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_CMD_TX_TO_ORX_MAPPING_H__ +#define __ADRV903X_CPU_CMD_TX_TO_ORX_MAPPING_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_error_codes_types.h" + +/* Flag to indicate the extended mapping is used */ +#define TX_TO_ORX_EXTENDED_MAPPING_FLAG (0x0000100UL) + +/** + * \brief SET_TX_TO_ORX_PRESET_ATTEN command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetTxToOrxPresetAtten +{ + uint8_t chanSelect; /*!< Select the Tx channels (bit mapped) */ + uint8_t extendedMappingFlag; /*!< Extended Mapping Flag */ + uint8_t presetAtten_dB; /*!< Orx Atten Preset value (0-16) */ + uint8_t immediateUpdate; /*!< Enable/disable flag to update Orx Atten ctrl regs for Orx channels that can observe selected Tx channels */ +} adrv903x_CpuCmd_SetTxToOrxPresetAtten_t;) + +/** + * \brief SET_TX_TO_ORX_PRESET_ATTEN command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetTxToOrxPresetAttenResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ +} adrv903x_CpuCmd_SetTxToOrxPresetAttenResp_t;) + + + +/** + * \brief SET_TX_TO_ORX_PRESET_NCO command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetTxToOrxPresetNco +{ + uint8_t chanSelect; /*!< Select the Tx channels (bit mapped) */ + uint8_t extendedMappingFlag; /*!< Extended Mapping Flag */ + uint32_t ncoFreqAdc_Khz; /*!< Orx ADC NCO Frequency (kHz) Preset value */ + uint32_t ncoFreqDatapath_Khz; /*!< Orx Datapath NCO Frequency (kHz) Preset value */ + uint8_t immediateUpdate; /*!< Enable/disable flag to update Orx NCO ctrl regs for Orx channels that can observe selected Tx channels */ +} adrv903x_CpuCmd_SetTxToOrxPresetNco_t;) + +/** + * \brief SET_TX_TO_ORX_PRESET_NCO command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuCmd_SetTxToOrxPresetNcoResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ +} adrv903x_CpuCmd_SetTxToOrxPresetNcoResp_t;) + + +#endif /* __ADRV903X_CPU_CMD_TX_TO_ORX_MAPPING_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_debug_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_debug_types.h new file mode 100644 index 0000000000000..1f347d037aa2c --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_debug_types.h @@ -0,0 +1,23 @@ + /** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + + /** + * \file adrv903x_cpu_debug_types.h + * + * \brief Contains CPU debug definitions + * + * \details Contains CPU debug definitions + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_CPU_DEBUG_TYPES_H__ +#define __ADRV903X_CPU_DEBUG_TYPES_H__ + + +#endif /* __ADI_ADRV903X_CPU_DEBUG_TYPES_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_device_profile_jesd_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_device_profile_jesd_types.h new file mode 100644 index 0000000000000..511dfa707c5d0 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_device_profile_jesd_types.h @@ -0,0 +1,400 @@ +/** + * \file adrv903x_cpu_device_profile_jesd_types.h + * + * \brief Contains ADRV903X Device Profile JESD type definitions + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_DEVICE_PROFILE_JESD_TYPES_H__ +#define __ADRV903X_CPU_DEVICE_PROFILE_JESD_TYPES_H__ + +#include "adi_adrv903x_platform_pack.h" + + +#define ADRV903X_JESD_MAX_DESERIALIZER_LANES (8u) +#define ADRV903X_JESD_MAX_SERIALIZER_LANES (8u) +#define ADRV903X_JESD_MAX_FRM_SAMPLE_XBAR_IDX (64u) +#define ADRV903X_JESD_MAX_DFRM_SAMPLE_XBAR_IDX (32u) +#define ADRV903X_JESD_MAX_LKSH_SAMPLE_XBAR_IDX (32u) +/* ADRV903X_JESD_NUM_TXRX_CHAN == ADRV903X_NUM_TXRX_CHAN */ +#define ADRV903X_JESD_NUM_TXRX_CHAN (8u) + +typedef enum adrv903x_JesdVersion +{ + ADRV903X_JESD_204B = 0u, + ADRV903X_JESD_204C = 1u, + ADRV903X_JESD_LAST_VALID_MODE = ADRV903X_JESD_204C +} adrv903x_JesdVersion_e; + +typedef uint8_t adrv903x_JesdVersion_t; + +/*!< List of Framers */ +typedef enum adrv903x_JesdFramer +{ + ADRV903X_JESD_FRAMER_0 = 0u, /*!< Framer 0 selection */ + ADRV903X_JESD_FRAMER_1 = 1u, /*!< Framer 1 selection */ + ADRV903X_JESD_FRAMER_2 = 2u, /*!< Framer 2 selection */ + ADRV903X_JESD_FRAMER_NUM = 3u +} adrv903x_JesdFramer_e; + +/*!< List of Deframers */ +typedef enum adrv903x_JesdDeframer +{ + ADRV903X_JESD_DEFRAMER_0 = 0u, /*!< Deframer 0 selection */ + ADRV903X_JESD_DEFRAMER_1 = 1u, /*!< Deframer 1 selection */ + ADRV903X_JESD_DEFRAMER_NUM = 2u +} adrv903x_JesdDeframer_e; + +/*!< List of Deframers */ +typedef enum adrv903x_JesdLkShSwitcher +{ + ADRV903X_JESD_LKSH_SWITCHER_0 = 0u, /*!< Link Sharing Switcher 0 selection */ + ADRV903X_JESD_LKSH_SWITCHER_1 = 1u, /*!< Link Sharing Switcher 1 selection */ + ADRV903X_JESD_LKSH_SWITCHER_NUM = 2u +} adrv903x_JesdLkShSwitcher_e; + +/*!< List of DAC Sample Xbar options */ +typedef enum adrv903x_JesdDeframerSampleXbarSelect +{ + ADRV903X_JESD_DFRM_SPLXBAR_TX0_BAND_0_DATA_I = 0u, + ADRV903X_JESD_DFRM_SPLXBAR_TX0_BAND_0_DATA_Q = 1u, + ADRV903X_JESD_DFRM_SPLXBAR_TX1_BAND_0_DATA_I = 2u, + ADRV903X_JESD_DFRM_SPLXBAR_TX1_BAND_0_DATA_Q = 3u, + ADRV903X_JESD_DFRM_SPLXBAR_TX2_BAND_0_DATA_I = 4u, + ADRV903X_JESD_DFRM_SPLXBAR_TX2_BAND_0_DATA_Q = 5u, + ADRV903X_JESD_DFRM_SPLXBAR_TX3_BAND_0_DATA_I = 6u, + ADRV903X_JESD_DFRM_SPLXBAR_TX3_BAND_0_DATA_Q = 7u, + ADRV903X_JESD_DFRM_SPLXBAR_TX4_BAND_0_DATA_I = 8u, + ADRV903X_JESD_DFRM_SPLXBAR_TX4_BAND_0_DATA_Q = 9u, + ADRV903X_JESD_DFRM_SPLXBAR_TX5_BAND_0_DATA_I = 10u, + ADRV903X_JESD_DFRM_SPLXBAR_TX5_BAND_0_DATA_Q = 11u, + ADRV903X_JESD_DFRM_SPLXBAR_TX6_BAND_0_DATA_I = 12u, + ADRV903X_JESD_DFRM_SPLXBAR_TX6_BAND_0_DATA_Q = 13u, + ADRV903X_JESD_DFRM_SPLXBAR_TX7_BAND_0_DATA_I = 14u, + ADRV903X_JESD_DFRM_SPLXBAR_TX7_BAND_0_DATA_Q = 15u, + ADRV903X_JESD_DFRM_SPLXBAR_TX0_BAND_1_DATA_I = 16u, + ADRV903X_JESD_DFRM_SPLXBAR_TX0_BAND_1_DATA_Q = 17u, + ADRV903X_JESD_DFRM_SPLXBAR_TX1_BAND_1_DATA_I = 18u, + ADRV903X_JESD_DFRM_SPLXBAR_TX1_BAND_1_DATA_Q = 19u, + ADRV903X_JESD_DFRM_SPLXBAR_TX2_BAND_1_DATA_I = 20u, + ADRV903X_JESD_DFRM_SPLXBAR_TX2_BAND_1_DATA_Q = 21u, + ADRV903X_JESD_DFRM_SPLXBAR_TX3_BAND_1_DATA_I = 22u, + ADRV903X_JESD_DFRM_SPLXBAR_TX3_BAND_1_DATA_Q = 23u, + ADRV903X_JESD_DFRM_SPLXBAR_TX4_BAND_1_DATA_I = 24u, + ADRV903X_JESD_DFRM_SPLXBAR_TX4_BAND_1_DATA_Q = 25u, + ADRV903X_JESD_DFRM_SPLXBAR_TX5_BAND_1_DATA_I = 26u, + ADRV903X_JESD_DFRM_SPLXBAR_TX5_BAND_1_DATA_Q = 27u, + ADRV903X_JESD_DFRM_SPLXBAR_TX6_BAND_1_DATA_I = 28u, + ADRV903X_JESD_DFRM_SPLXBAR_TX6_BAND_1_DATA_Q = 29u, + ADRV903X_JESD_DFRM_SPLXBAR_TX7_BAND_1_DATA_I = 30u, + ADRV903X_JESD_DFRM_SPLXBAR_TX7_BAND_1_DATA_Q = 31u, + ADRV903X_JESD_DFRM_SPLXBAR_LAST_VALID = ADRV903X_JESD_DFRM_SPLXBAR_TX7_BAND_1_DATA_Q, + ADRV903X_JESD_DFRM_SPLXBAR_INVALID = 0x7Fu +} adrv903x_JesdDeframerSampleXbarSelect_e; + +/*!< List of ADC Sample Xbar options */ +typedef enum adrv903x_JesdFramerSampleXbarSelect +{ + ADRV903X_JESD_FRM_SPLXBAR_RX0_BAND_0_DATA_I = 0u, + ADRV903X_JESD_FRM_SPLXBAR_RX0_BAND_0_DATA_Q = 1u, + ADRV903X_JESD_FRM_SPLXBAR_RX0_BAND_1_DATA_I = 2u, + ADRV903X_JESD_FRM_SPLXBAR_RX0_BAND_1_DATA_Q = 3u, + ADRV903X_JESD_FRM_SPLXBAR_RX1_BAND_0_DATA_I = 4u, + ADRV903X_JESD_FRM_SPLXBAR_RX1_BAND_0_DATA_Q = 5u, + ADRV903X_JESD_FRM_SPLXBAR_RX1_BAND_1_DATA_I = 6u, + ADRV903X_JESD_FRM_SPLXBAR_RX1_BAND_1_DATA_Q = 7u, + ADRV903X_JESD_FRM_SPLXBAR_RX2_BAND_0_DATA_I = 8u, + ADRV903X_JESD_FRM_SPLXBAR_RX2_BAND_0_DATA_Q = 9u, + ADRV903X_JESD_FRM_SPLXBAR_RX2_BAND_1_DATA_I = 10u, + ADRV903X_JESD_FRM_SPLXBAR_RX2_BAND_1_DATA_Q = 11u, + ADRV903X_JESD_FRM_SPLXBAR_RX3_BAND_0_DATA_I = 12u, + ADRV903X_JESD_FRM_SPLXBAR_RX3_BAND_0_DATA_Q = 13u, + ADRV903X_JESD_FRM_SPLXBAR_RX3_BAND_1_DATA_I = 14u, + ADRV903X_JESD_FRM_SPLXBAR_RX3_BAND_1_DATA_Q = 15u, + + ADRV903X_JESD_FRM_SPLXBAR_RX4_BAND_0_DATA_I = 16u, + ADRV903X_JESD_FRM_SPLXBAR_RX4_BAND_0_DATA_Q = 17u, + ADRV903X_JESD_FRM_SPLXBAR_RX4_BAND_1_DATA_I = 18u, + ADRV903X_JESD_FRM_SPLXBAR_RX4_BAND_1_DATA_Q = 19u, + ADRV903X_JESD_FRM_SPLXBAR_RX5_BAND_0_DATA_I = 20u, + ADRV903X_JESD_FRM_SPLXBAR_RX5_BAND_0_DATA_Q = 21u, + ADRV903X_JESD_FRM_SPLXBAR_RX5_BAND_1_DATA_I = 22u, + ADRV903X_JESD_FRM_SPLXBAR_RX5_BAND_1_DATA_Q = 23u, + ADRV903X_JESD_FRM_SPLXBAR_RX6_BAND_0_DATA_I = 24u, + ADRV903X_JESD_FRM_SPLXBAR_RX6_BAND_0_DATA_Q = 25u, + ADRV903X_JESD_FRM_SPLXBAR_RX6_BAND_1_DATA_I = 26u, + ADRV903X_JESD_FRM_SPLXBAR_RX6_BAND_1_DATA_Q = 27u, + ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_0_DATA_I = 28u, + ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_0_DATA_Q = 29u, + ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_1_DATA_I = 30u, + ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_1_DATA_Q = 31u, + ADRV903X_JESD_FRM_SPLXBAR_LAST_VALID_NO_INT = ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_1_DATA_Q, /* With no interleaving enabled */ + + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_0 = 32u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_1 = 33u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_2 = 34u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_3 = 35u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_4 = 36u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_5 = 37u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_6 = 38u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_7 = 39u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_0 = 40u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_1 = 41u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_2 = 42u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_3 = 43u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_4 = 44u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_5 = 45u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_6 = 46u, + ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_7 = 47u, + + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_0 = 48u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_1 = 49u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_2 = 50u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_3 = 51u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_4 = 52u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_5 = 53u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_6 = 54u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_7 = 55u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_0 = 56u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_1 = 57u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_2 = 58u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_3 = 59u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_4 = 60u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_5 = 61u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_6 = 62u, + ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_7 = 63u, + ADRV903X_JESD_FRM_SPLXBAR_LAST_VALID = ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_7, + ADRV903X_JESD_FRM_SPLXBAR_INVALID = 0x7Fu +} adrv903x_JesdFramerSampleXbarSelect_e; + +/*!< List of Jesd Frame Sync options */ +typedef enum adrv903x_JesdFrmSyncbMode +{ + ADRV903X_JESD_FRM_SYNCB_PIN_MODE = 0u, + ADRV903X_JESD_FRM_SYNCB_SPI_MODE = 1u +} adrv903x_JesdFrmSyncbMode_e; + +/*!< List of Jesd Frame Pad options */ +typedef enum adrv903x_JesdFrmSyncPadReq +{ + ADRV903X_JESD_FRM_PWR_ON_SYNC_PAD1 = 0u, + ADRV903X_JESD_FRM_PWR_ON_SYNC_PAD2 = 1u, + ADRV903X_JESD_FRM_PWR_ON_SYNC_PAD3 = 2u, + ADRV903X_JESD_FRM_PWR_OFF_ALL_SYNC_PADS = 3u +} adrv903x_JesdFrmSyncPadReq_e; + +typedef enum adrv903x_JesdFrmSyncbInSelect +{ + ADRV903X_JESD_FRM_SYNCB_CMOS = 0u, + ADRV903X_JESD_FRM_SYNCB_LVDS_WITH_INTL_TERM = 1u, + ADRV903X_JESD_FRM_SYNCB_LVDS_NO_INTL_TERM = 2u, +} adrv903x_JesdFrmSyncbInSelect_e; + +typedef enum adrv903x_JesdDfrmSyncPadReq +{ + ADRV903X_JESD_DFRM_PWR_ON_SYNC_PAD1 = 0u, + ADRV903X_JESD_DFRM_PWR_ON_SYNC_PAD2 = 1u, + ADRV903X_JESD_DFRM_PWR_ON_ALL_SYNC_PADS = 2u, + ADRV903X_JESD_DFRM_PWR_OFF_ALL_SYNC_PADS = 3u +} adrv903x_JesdDfrmSyncPadReq_e; + +typedef enum adrv903x_JesdJtxOutputDriveSwing +{ + ADRV903X_JESD_DRIVE_SWING_VTT_100 = 0u, + ADRV903X_JESD_DRIVE_SWING_VTT_85 = 1u, + ADRV903X_JESD_DRIVE_SWING_VTT_75 = 2u, + ADRV903X_JESD_DRIVE_SWING_VTT_50 = 3u, + ADRV903X_JESD_DRIVE_SWING_LAST_VALID = ADRV903X_JESD_DRIVE_SWING_VTT_50 +} adrv903x_JesdJtxOutputDriveSwing_e; + +typedef enum adrv903x_JesdJtxPreEmphasis +{ + ADRV903X_JESD_PRE_TAP_LEVEL_0_DB = 0u, + ADRV903X_JESD_PRE_TAP_LEVEL_3_DB = 1u, + ADRV903X_JESD_PRE_TAP_LEVEL_6_DB = 2u, + ADRV903X_JESD_PRE_TAP_LEVEL_LAST_VALID = ADRV903X_JESD_PRE_TAP_LEVEL_6_DB +} adrv903x_JesdJtxPreEmphasis_e; + +typedef enum adrv903x_JesdJtxPostEmphasis +{ + ADRV903X_JESD_POST_TAP_LEVEL_0_DB = 0u, + ADRV903X_JESD_POST_TAP_LEVEL_3_DB = 1u, + ADRV903X_JESD_POST_TAP_LEVEL_6_DB = 2u, + ADRV903X_JESD_POST_TAP_LEVEL_9_DB = 3u, + ADRV903X_JESD_POST_TAP_LEVEL_12_DB = 4u, + ADRV903X_JESD_POST_TAP_LEVEL_LAST_VALID = ADRV903X_JESD_POST_TAP_LEVEL_12_DB +} adrv903x_JesdJtxPostEmphasis_e; + +typedef enum adrv903x_JesdConvClockMode +{ + ADRV903X_JESD_NO_RESAMPLE_FIR = 0u, + ADRV903X_JESD_2_3_RESAMPLE_FIR, + ADRV903X_JESD_3_4_RESAMPLE_FIR +} adrv903x_JesdConvClockMode_e; + +/* Bit macros for newSysref byte in Framer and Deframer structures */ +#define ADRV903X_JESD_BITM_SYSREF_FOR_RELINK (0x1U) +#define ADRV903X_JESD_BITP_SYSREF_FOR_RELINK (0x0U) + +#define ADRV903X_JESD_BITM_SYSREF_FOR_STARTUP (0x2U) +#define ADRV903X_JESD_BITP_SYSREF_FOR_STARTUP (0x1U) + +#define ADRV903X_JESD_BITM_SYSREF_N_SHOT_COUNT (0x3CU) +#define ADRV903X_JESD_BITP_SYSREF_N_SHOT_COUNT (0x2U) + +#define ADRV903X_JESD_BITM_SYSREF_N_SHOT_ENABLE (0x40U) +#define ADRV903X_JESD_BITP_SYSREF_N_SHOT_ENABLE (0x6U) + +#define ADRV903X_JESD_BITM_SYSREF_IGNORE_WHEN_LINKED (0x80U) +#define ADRV903X_JESD_BITP_SYSREF_IGNORE_WHEN_LINKED (0x7U) + +ADI_ADRV903X_PACK_START +typedef struct adrv903x_JesdFramerConfig +{ + uint8_t mode; /*!< 0 = 204B, 1 = 204C */ + uint8_t E; /*!< Blocks in Multi-block for 204C */ + uint8_t bankId; /*!< Bank ID extension to Device ID (0-15)*/ + uint8_t deviceId; /*!< Device ID link identification number (0-255) */ + uint8_t lane0Id; /*!< Starting Lane ID (0-31) */ + uint8_t M; /*!< Number of ADCs/converters (0,2,4,8, 16) */ + uint8_t Kminus1; /*!< Number of frames in a multiframe - 1 (0 - 255) */ + uint8_t F; /*!< Number of bytes (octets) per frame. (1,2,4,8) */ + uint8_t Np; /*!< Converter sample resolution in bits (12,16,24) */ + uint8_t S; /*!< Number of samples per converter per frame */ + uint8_t scramble; /*!< Scrambling enable */ + uint8_t serializerLanesEnabled; /*!< Serializer lane select bit field */ + uint8_t lmfcOffset[2]; /*!< LMFC offset value for deterministic latency setting */ + /*!< lmfcOffset[0] - Bits [7:0] of PhaseAdjust */ + /*!< lmfcOffset[1] - Bits [18:8] of PhaseAdjust */ + uint8_t newSysref; /*!< Flags for SYSREF control. */ + uint8_t syncbInSPIMode; /*!< SYNCb SPI/Pin Mode selection */ + uint8_t syncbInSelect; /*!< SYNCb input source */ + uint8_t syncbInLvdsMode; /*!< SYNCb LVDS mode enable: 0=CMOS mode, + * 1=LVDS mode, + * 2=LVDS mode with no internal termination */ + uint8_t syncbInLvdsPnInvert; /*!< SYNCb LVDS PN inverted */ + uint8_t laneXbar[ADRV903X_JESD_MAX_SERIALIZER_LANES]; /*!< Lane crossbar selection */ + uint8_t sampleXBar[ADRV903X_JESD_MAX_FRM_SAMPLE_XBAR_IDX]; /*!< Converter sample crossbar selection */ + uint8_t reserved[2]; /*!< Reserved */ + uint32_t iqRate_kHz; /*!< Framer I/Q rate */ + uint32_t laneRate_kHz; /*!< Framer Lane rate */ + uint8_t subclass; /*!< Framer subclass setting */ + uint8_t convClockMode; /*!< Conv clock mode: 0 - No resampling fir used */ + /*!< 1 - 2/3 resampling fir used */ + /*!< 2 - 3/4 resampling fir used */ + + uint8_t reserved1[5]; /*!< Reserved */ +} adrv903x_JesdFramerConfig_t; +ADI_ADRV903X_PACK_FINISH + + ADI_ADRV903X_PACK_START +typedef struct adrv903x_JesdDeframerConfig +{ + uint8_t mode; /*!< 0 = 204B, 1 = 204C */ + uint8_t E; /*!< Blocks in Multiblock for 204C */ + uint8_t bankId; /*!< Bank ID extension to Device ID */ + uint8_t deviceId; /*!< Device ID link identification number */ + uint8_t lane0Id; /*!< Starting Lane ID */ + uint8_t M; /*!< Number of ADCs */ + uint8_t Kminus1; /*!< Number of frames in a multiframe - 1 (0 - 255) */ + uint8_t F; /*!< Number of bytes (octets) per frame. (1,2,4,8) */ + uint8_t Np; /*!< Converter sample resolution in bits (12,16,24) */ + uint8_t S; /*!< Number of samples per converter per frame */ + uint8_t scramble; /*!< Scrambling enable */ + uint8_t deserializerLanesEnabled; /*!< Deserializer lane select bit field */ + uint8_t lmfcOffset[2]; /*!< LMFC offset value for deterministic latency setting. */ + /*!< lmfcOffset[0] - Bits [7:0] of PhaseAdjust */ + /*!< lmfcOffset[1] - Bits [18:8] of PhaseAdjust */ + uint8_t newSysref; /*!< Flags for SYSREF control. */ + uint8_t syncbOutSelect; /*!< Selects deframer SYNCBOUT pin. */ + uint8_t syncbOutLvdsMode; /*!< SYNCb LVDS mode enable */ + uint8_t syncbOutLvdsPnInvert; /*!< SYNCb LVDS PN Invert enable */ + uint8_t syncbOutCmosDriveLevel; /*!< SYNCb CMOS drive_strength */ + uint8_t laneXbar[ADRV903X_JESD_MAX_DESERIALIZER_LANES]; /*!< Lane crossbar selection */ + uint8_t sampleXBar[ADRV903X_JESD_MAX_DFRM_SAMPLE_XBAR_IDX]; /*!< Converter sample crossbar selection */ + uint8_t reserved[1]; /*!< Reserved */ + uint32_t iqRate_kHz; /*!< Deframer I/Q rate */ + uint32_t laneRate_kHz; /*!< Deframer Lane rate */ + uint8_t subclass; /*!< Deframer subclass setting */ + uint8_t convClockMode; /*!< Conv clock mode: 0 - No resampling fir used */ + /*!< 1 - 2/3 resampling fir used */ + /*!< 2 - 3/4 resampling fir used */ + + uint8_t interleavingEnabled; /*!< Interleaving enabled for a deframer */ + uint8_t reserved1[1]; /*!< Reserved */ +} adrv903x_JesdDeframerConfig_t; +ADI_ADRV903X_PACK_FINISH + + ADI_ADRV903X_PACK_START +typedef struct adrv903x_JesdSerializerLane +{ + uint8_t serAmplitude; /*!< Serializer lane amplitude */ + uint8_t serPreEmphasis; /*!< Serializer lane pre-emphasis */ + uint8_t serPostEmphasis; /*!< Serializer lane post-emphasis */ + uint8_t serInvertLanePolarity; /*!< Serializer lane PN inversion select: 0 = do not invert. 1 = invert */ + uint8_t bitRepeatLog2; /*!< Log2 of bit repeat ratio */ + uint8_t reserved[3]; /*!< Reserved bytes for alignment */ +} adrv903x_JesdSerializerLane_t; +ADI_ADRV903X_PACK_FINISH + + ADI_ADRV903X_PACK_START +typedef struct adrv903x_JesdDeserializerLane +{ + uint8_t highBoost; /*!< High Boost enabled flag */ + uint8_t desInvertLanePolarity; /*!< Deserializer Lane PN inversion select: 0 = do not invert. 1 = invert */ + uint8_t bitSplitLog2; /*!< Log2 of bit split ratio */ + uint8_t cpuId; /*!< Cpu Number to run on - 255 not used */ + uint32_t configOption[10]; /*!< For future use */ +} adrv903x_JesdDeserializerLane_t; +ADI_ADRV903X_PACK_FINISH + + ADI_ADRV903X_PACK_START +typedef struct adrv903x_JesdLinkSharingConfig +{ + uint8_t linkSharingEnabled; /*!< 0 = link sharing disabled, 1 = link sharing enabled */ + uint8_t M; /*!< Number of ADCs */ + uint8_t Kminus1; /*!< Number of frames in a multiframe - 1 (0 - 255) */ + uint8_t F; /*!< Number of bytes (octets) per frame. (1,2,4,8) */ + uint8_t Np; /*!< Converter sample resolution in bits (12,16,24) */ + uint8_t S; /*!< Number of samples per converter per frame */ + uint8_t sampleXBar[ADRV903X_JESD_MAX_LKSH_SAMPLE_XBAR_IDX]; /*!< Converter sample crossbar selection */ + uint8_t convClockMode; /*!< Conv clock mode: 0 - No resampling fir used */ + /*!< 1 - 2/3 resampling fir used */ + /*!< 2 - 3/4 resampling fir used */ + uint32_t iqRate_kHz; /*!< Deframer I/Q rate */ +} adrv903x_JesdLinkSharingConfig_t; +ADI_ADRV903X_PACK_FINISH + + ADI_ADRV903X_PACK_START +typedef struct adrv903x_JesdSettings +{ + adrv903x_JesdFramerConfig_t framer[ADRV903X_JESD_FRAMER_NUM]; /*!< Framer configuration structure */ + adrv903x_JesdDeframerConfig_t deframer[ADRV903X_JESD_DEFRAMER_NUM]; /*!< Deframer configuration structure */ + adrv903x_JesdSerializerLane_t serializerLane[ADRV903X_JESD_MAX_SERIALIZER_LANES]; /*!< Serializer configuration structure */ + adrv903x_JesdDeserializerLane_t deserializerLane[ADRV903X_JESD_MAX_DESERIALIZER_LANES]; /*!< Deserializer configuration structure */ + adrv903x_JesdLinkSharingConfig_t linkSharingCfg[ADRV903X_JESD_LKSH_SWITCHER_NUM]; /*!< Link Sharing Switcher structure */ + uint8_t jrxAuxSysrefMode; /*!< JRX SYSREF mode {0|1} */ + uint8_t jrxAuxSysrefClkDivideRatio; /*!< JRX aux sysref clk divide ratio */ + uint16_t jrxAuxSysrefK; /*!< JRX aux sysref K */ + uint8_t jrxAuxSysrefDevClkRatio; /*!< JRX aux sysref dev clk ratio */ + uint8_t jtxAuxSysrefMode; /*!< JTX SYSREF mode {0|1} */ + uint8_t jtxAuxSysrefClkDivideRatio; /*!< JTX aux sysref clk divide ratio */ + uint16_t jtxAuxSysrefK; /*!< JTX aux sysref K */ + uint8_t jtxAuxSysrefDevClkRatio; /*!< JTX aux sysref dev clk ratio */ + uint8_t rxdesQhfrate; /*!< DESER mode settings */ + uint8_t txserTxPathClkDiv; /*!< SER mode settings */ + uint16_t devClkKminus1; /*!< Number of multiframe in terms of dev_clk clock period minus 1 */ + uint8_t reserved[2]; /*!< Reserved bytes for alignment */ +} adrv903x_JesdSettings_t; +ADI_ADRV903X_PACK_FINISH + +#endif /* __ADRV903X_CPU_DEVICE_PROFILE_JESD_TYPES_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_device_profile_pfir_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_device_profile_pfir_types.h new file mode 100644 index 0000000000000..2b222785df27e --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_device_profile_pfir_types.h @@ -0,0 +1,53 @@ +/** + * \file adrv903x_cpu_device_profile_pfir_types.h + * + * \brief Contains ADRV903X Device Profile PFIR type definitions + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_DEVICE_PROFILE_PFIR_TYPES_H__ +#define __ADRV903X_CPU_DEVICE_PROFILE_PFIR_TYPES_H__ + +#include "adi_adrv903x_platform_pack.h" + +#define ADRV903X_NUM_PFIR_COEF (24u) + +typedef enum adrv903x_PfirGain +{ + ADRV903X_PFIR_GAIN_MINUS_12_DB = 0u, + ADRV903X_PFIR_GAIN_MINUS_6_DB = 1u, + ADRV903X_PFIR_GAIN_0_DB = 2u, + ADRV903X_PFIR_GAIN_PLUS_6_DB = 3u +} adrv903x_PfirGain_e; + +ADI_ADRV903X_PACK_START +typedef struct adrv903x_RxPfirData +{ + uint8_t enable; + uint8_t gain; + uint8_t sym; + int16_t pfirCoef[ADRV903X_NUM_PFIR_COEF]; +} adrv903x_RxPfirData_t; +ADI_ADRV903X_PACK_FINISH + + ADI_ADRV903X_PACK_START +typedef struct adrv903x_TxPfirData +{ + uint8_t enable; + uint8_t gain; + uint8_t sym; + uint8_t reserved; + int16_t pfirCoefI[ADRV903X_NUM_PFIR_COEF]; + int16_t pfirCoefQ[ADRV903X_NUM_PFIR_COEF]; +} adrv903x_TxPfirData_t; +ADI_ADRV903X_PACK_FINISH + +#endif /* __ADRV903X_CPU_DEVICE_PROFILE_PFIR_TYPES_H__*/ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_device_profile_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_device_profile_types.h new file mode 100644 index 0000000000000..ff1a8b0a5ac0c --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_device_profile_types.h @@ -0,0 +1,513 @@ +/** + * \file adrv903x_cpu_device_profile_types.h + * + * \brief Contains ADRV903X Device Profile type definitions + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_DEVICE_PROFILE_TYPES_H__ +#define __ADRV903X_CPU_DEVICE_PROFILE_TYPES_H__ + +#include "adrv903x_cpu_device_profile_jesd_types.h" +#include "adrv903x_cpu_device_profile_pfir_types.h" +#include "adi_adrv903x_version_types.h" +#include "adi_adrv903x_platform_pack.h" + +#define ADRV903X_PROFILE_TX_CHAN_MASK (0x000000FFU) +#define ADRV903X_PROFILE_TX_CHAN_POS (0U) + +#define ADRV903X_PROFILE_RX_CHAN_MASK (0x0000FF00U) +#define ADRV903X_PROFILE_RX_CHAN_POS (8U) + +#define ADRV903X_PROFILE_ORX_CHAN_MASK (0x00030000U) +#define ADRV903X_PROFILE_ORX_CHAN_POS (16U) + +#define ADRV903X_PROFILE_CHAN_CONFIG_MASK (ADRV903X_PROFILE_TX_CHAN_MASK \ + | ADRV903X_PROFILE_RX_CHAN_MASK \ + | ADRV903X_PROFILE_ORX_CHAN_MASK) + +/* Channel types used throughout the system */ +typedef enum adrv903x_ChannelType +{ + ADRV903X_CH_TYPE_RX, + ADRV903X_CH_TYPE_TX, + ADRV903X_CH_TYPE_ORX, + ADRV903X_CH_TYPE_LOOPBACK, + ADRV903X_CH_TYPE_MAX +} adrv903x_ChannelType_e; + +/* Enumeration for DDC modes, Rx and Orx */ +typedef enum adrv903x_RxDdc +{ + ADRV903X_RXDDC_BYPASS = 0u, /*!< No Half Band Enabled */ + ADRV903X_RXDDC_FILTERONLY, /*!< Half Band Filters only */ + ADRV903X_RXDDC_INT2, /*!< Half Band Interpolation by 2 */ + ADRV903X_RXDDC_DEC2, /*!< Half Band Decimate by 2 */ + ADRV903X_RXDDC_BYPASS_REALIF, /*!< No Half Band Enabled (Real I/F MODE)*/ + ADRV903X_RXDDC_FILTERONLY_REALIF, /*!< Half Band Filters only (Real I/F MODE) */ + ADRV903X_RXDDC_INT2_REALIF, /*!< Half Band Interpolation by 2 (Real I/F MODE) */ + ADRV903X_RXDDC_DEC2_REALIF /*!< Half Band Decimate by 2 (Real I/F MODE) */ +} adrv903x_RxDdc_e; + +/* Enumeration for RX channel numbers - DO NOT CHANGE VALUE OR ORDER !!! */ +typedef enum adrv903x_RxChannelNum +{ + ADRV903X_RX_CH_1 = 0u, /*!< Rx channel # 1 index */ + ADRV903X_RX_CH_2, /*!< Rx channel # 2 index */ + ADRV903X_RX_CH_3, /*!< Rx channel # 3 index */ + ADRV903X_RX_CH_4, /*!< Rx channel # 4 index */ + ADRV903X_RX_CH_5, /*!< Rx channel # 5 index */ + ADRV903X_RX_CH_6, /*!< Rx channel # 6 index */ + ADRV903X_RX_CH_7, /*!< Rx channel # 7 index */ + ADRV903X_RX_CH_8, /*!< Rx channel # 8 index */ + ADRV903X_RX_CHAN_LEN /*!< Total number of Rx Channels supported */ +} adrv903x_RxChannelNum_e; + +/* Enumeration for TX channel numbers - DO NOT CHANGE VALUE OR ORDER !!! */ +typedef enum adrv903x_TxChannelNum +{ + ADRV903X_TX_CH_1 = 0u, /*!< Tx channel # 1 index */ + ADRV903X_TX_CH_2, /*!< Tx channel # 2 index */ + ADRV903X_TX_CH_3, /*!< Tx channel # 3 index */ + ADRV903X_TX_CH_4, /*!< Tx channel # 4 index */ + ADRV903X_TX_CH_5, /*!< Tx channel # 5 index */ + ADRV903X_TX_CH_6, /*!< Tx channel # 6 index */ + ADRV903X_TX_CH_7, /*!< Tx channel # 7 index */ + ADRV903X_TX_CH_8, /*!< Tx channel # 8 index */ + ADRV903X_TX_CHAN_LEN /*!< Total number of Tx Channels supported */ +} adrv903x_TxChannelNum_e; + +/* Enumeration for ORX channel numbers - DO NOT CHANGE VALUE OR ORDER !!! */ +typedef enum adrv903x_OrxChannelNum +{ + ADRV903X_ORX_CH_1 = 0u, /*!< Orx channel # 1 index */ + ADRV903X_ORX_CH_2, /*!< Orx channel # 2 index */ + ADRV903X_ORX_CHAN_LEN /*!< Total number of Orx Channels supported */ +} adrv903x_OrxChannelNum_e; + +/* Enumeration for RX channel indices - DO NOT CHANGE VALUE OR ORDER !!! */ +typedef enum adrv903x_RxChannelIdx +{ + ADRV903X_RX_CH_IDX_0 = 0u, /*!< Rx channel index # 0 */ + ADRV903X_RX_CH_IDX_1, /*!< Rx channel index # 1 */ + ADRV903X_RX_CH_IDX_2, /*!< Rx channel index # 2 */ + ADRV903X_RX_CH_IDX_3, /*!< Rx channel index # 3 */ + ADRV903X_RX_CH_IDX_4, /*!< Rx channel index # 4 */ + ADRV903X_RX_CH_IDX_5, /*!< Rx channel index # 5 */ + ADRV903X_RX_CH_IDX_6, /*!< Rx channel index # 6 */ + ADRV903X_RX_CH_IDX_7, /*!< Rx channel index # 7 */ + ADRV903X_RX_CHAN_IDX_LEN /*!< Total number of Rx Channels supported */ +} adrv903x_RxChannelIdx_e; + +/* Enumeration for TX channel indices - DO NOT CHANGE VALUE OR ORDER !!! */ +typedef enum adrv903x_TxChannelIdx +{ + ADRV903X_TX_CH_IDX_0 = 0u, /*!< Tx channel index # 0 */ + ADRV903X_TX_CH_IDX_1, /*!< Tx channel index # 1 */ + ADRV903X_TX_CH_IDX_2, /*!< Tx channel index # 2 */ + ADRV903X_TX_CH_IDX_3, /*!< Tx channel index # 3 */ + ADRV903X_TX_CH_IDX_4, /*!< Tx channel index # 4 */ + ADRV903X_TX_CH_IDX_5, /*!< Tx channel index # 5 */ + ADRV903X_TX_CH_IDX_6, /*!< Tx channel index # 6 */ + ADRV903X_TX_CH_IDX_7, /*!< Tx channel index # 7 */ + ADRV903X_TX_CHAN_IDX_LEN /*!< Total number of Tx Channels supported */ +} adrv903x_TxChannelIdx_e; + +/* Enumeration for ORX channel indices - DO NOT CHANGE VALUE OR ORDER !!! */ +typedef enum adrv903x_OrxChannelIdx +{ + ADRV903X_ORX_CH_IDX_0 = 0u, /*!< Orx channel index # 0 */ + ADRV903X_ORX_CH_IDX_1, /*!< Orx channel index # 1 */ + ADRV903X_ORX_CHAN_IDX_LEN /*!< Total number of Orx Channels supported */ +} adrv903x_OrxChannelIdx_e; + +/* Enumeration for serdes lane numbers - DO NOT CHANGE VALUE OR ORDER !!! */ +typedef enum adrv903x_SerDesLaneNum +{ + ADRV903X_SERDES_LANE_1 = 0u, /*!< SERDES LANE # 1 index */ + ADRV903X_SERDES_LANE_2, /*!< SERDES LANE # 2 index */ + ADRV903X_SERDES_LANE_3, /*!< SERDES LANE # 3 index */ + ADRV903X_SERDES_LANE_4, /*!< SERDES LANE # 4 index */ + ADRV903X_SERDES_LANE_5, /*!< SERDES LANE # 5 index */ + ADRV903X_SERDES_LANE_6, /*!< SERDES LANE # 6 index */ + ADRV903X_SERDES_LANE_7, /*!< SERDES LANE # 7 index */ + ADRV903X_SERDES_LANE_8, /*!< SERDES LANE # 8 index */ + ADRV903X_SERDES_LANE_LEN /*!< Total number of SerDes Lanes supported */ +} adrv903x_SerdesLaneNum_e; + +#define ADRV903X_RX_CHAN_LEN_CPU (ADRV903X_RX_CHAN_LEN / 2u) +#define ADRV903X_TX_CHAN_LEN_CPU (ADRV903X_TX_CHAN_LEN / 2u) +#define ADRV903X_ORX_CHAN_LEN_CPU (ADRV903X_ORX_CHAN_LEN / 2u) +#define ADRV903X_SERDES_LANE_LEN_CPU (ADRV903X_SERDES_LANE_LEN / 2u) + +/* Map human-readable symbols to the the register values use in the hardware and + * required in adrv903x_DeviceProfile_t struct. + * Note not all values are supported by all ClkGen instances. */ +#define ADRV903X_CLKGEN_DIV1_OFF 0u +#define ADRV903X_CLKGEN_DIV1_DIVBY2 1u +#define ADRV903X_CLKGEN_DIV1_DIVBY3 2u +#define ADRV903X_CLKGEN_DIV1_DIVBY4 3u +#define ADRV903X_CLKGEN_DIV1_DIVBY5 4u + +/* Enumeration for EXT LO Select Device Profile def'n */ +typedef enum +{ + ADRV903X_LOGEN_SEL_TX = 0x01u, /*!< Set the PLL to Tx channels */ + ADRV903X_LOGEN_SEL_RX = 0x02u /*!< Set the PLL to Rx channels */ +} adrv903x_LogenRxTxSel_e; + + +typedef enum +{ + ADRV903X_LOGEN_INTERNAL_IN = 0x01u, /*!< Set Logen to internal mode */ + ADRV903X_LOGEN_EXTERNAL_IN = 0x02u, /*!< Set Logen to external IN mode */ + ADRV903X_LOGEN_EXTERNAL_OUT = 0x04u /*!< Set Logen to external OUT mode */ +} adrv903x_LogenInOutSel_e; + + +/* Enumeration for DUC channel number */ +typedef enum adrv903x_DucNumber +{ + ADRV903X_DUC_BAND_0 = 0u, /*!< DUC channel 0 */ + ADRV903X_DUC_NUM_BAND +} adrv903x_DucNumber_e; + +/* Enumeration for DDC channel number */ +typedef enum adrv903x_DdcNumber +{ + ADRV903X_DDC_BAND_0 = 0u, /*!< DDC channel 0 */ + ADRV903X_DDC_BAND_1, /*!< DDC channel 1 */ + ADRV903X_DDC_NUM_BAND +} adrv903x_DdcNumber_e; + +/* profiles */ +#define ADRV903X_NUM_RX_PROFILES (4u) +#define ADRV903X_NUM_TX_PROFILES (4u) +#define ADRV903X_NUM_ORX_PROFILES (2u) +/* slices */ +#define ADRV903X_NUM_TXRX_CHAN (8u) +#define ADRV903X_NUM_ORX_CHAN (2u) + +/**************************************************************************** +* PLL structure. +****************************************************************************/ +ADI_ADRV903X_PACK_START +typedef struct adrv903x_PllConfig +{ + uint64_t freqHz; /*!< Internal PLL Freq Setting in Hz */ + uint64_t vcoFreqHz; /*!< Internal PLL VCO Setting in Hz */ + uint8_t loDiv; /*!< Internal LO Divider 1 to 64 */ + uint8_t divRange; /*!< Serdes only Div Range */ + uint8_t div2; /*!< Serdes only Div 2 */ + uint64_t extLoInFreqHz; /*!< External LO Frequency IN in Hz */ + uint8_t extLoOutDiv; /*!< External LO Out Divider */ + uint8_t selInternalExt; /*!< Internal or External LO */ + uint8_t power; /*!< PLL Power setting */ + uint8_t phaseMargin; /*!< PLL Phase Margin */ + uint32_t loopBandwidth; /*!< PLL Loop bandwidth */ + uint32_t refClock_kHz; /*!< PLL ref clock in kHz */ + uint8_t refClkDiv; /*!< PLL ref clock divider */ + uint8_t iBleedEnb; /*!< PLL bleed ramp enable */ + uint8_t reserved[2]; /*!< Reserve */ +} adrv903x_PllConfig_t; +ADI_ADRV903X_PACK_FINISH + +/**************************************************************************** +* PLL structure. +****************************************************************************/ + ADI_ADRV903X_PACK_START +typedef struct adrv903x_ClkGenConfig +{ + uint8_t div1enb; /*!< div 1 (sample clk) enable setting */ + uint8_t div3enb; /*!< div 3 enable setting */ + uint8_t intDiv; /*!< interface clk divider register setting */ + uint8_t clkDiv; /*!< sample clk divider register setting */ + uint8_t reserved[4]; /*!< Reserved */ +} adrv903x_ClkGenConfig_t; +ADI_ADRV903X_PACK_FINISH + +/**************************************************************************** +* NCO Shifter structure. +****************************************************************************/ + ADI_ADRV903X_PACK_START +typedef struct adrv903x_NcoShifter +{ + uint8_t ncoEnabled; /*!< NCO enabled */ + uint32_t totalDecimation; /*!< Total DDC decimation */ + int32_t ncoFreqin_kHz; /*!< NCO Frequency */ + int64_t ncoFtw; /*!< NCO tuning word */ + uint32_t tinClockFreq_kHz; /*!< NCO TIN freq in kHz */ + uint8_t hb3Enable; /*!< HB3 Enable */ + uint8_t hb2Enable; /*!< HB2 Enable */ + uint8_t hb1Enable; /*!< HB1 Enable */ + uint8_t hb3OutputClkDiv; /*!< HB3 output clock rate divider */ + uint8_t hb2OutputClkDiv; /*!< HB2 output clock rate divider*/ + uint8_t hb1OutputClkDiv; /*!< HB1 output clock rate divider */ + uint8_t hb3DpClkDiv; /*!< HB3 DP clock rate divider */ + uint8_t hb2DpClkDiv; /*!< HB2 DP clock rate divider */ + uint8_t hb1DpClkDiv; /*!< HB1 DP clock rate divider*/ + uint8_t tinClkDiv; /*!< HB1 Tin clock rate */ + uint8_t rxBandEnb; /*!< rx band enable */ + uint8_t resampleMode; /*!< Resampling filter mode */ + uint32_t rfCenterFreq_kHz; /*!< RF center frequency */ + uint32_t instBw_kHz; /*!< instantaneous signal bandwidth */ + uint32_t inputSigBw_kHz; /*!< input signal bandwidth */ + uint8_t rxGainDelay; /*!< Rx gain delay */ + uint8_t reserved[4]; /*!< Reserve */ +} adrv903x_NcoShifter_t; +ADI_ADRV903X_PACK_FINISH + +/**************************************************************************** +* FSC structure. +****************************************************************************/ +ADI_ADRV903X_PACK_START +/*!< adrv903x_FscConfig: structure of Fsc configuration parameters */ +typedef struct adrv903x_FscConfig +{ + uint8_t lbn; /*!< Tx loopback samples per FSC clock - numerator */ + uint8_t lbd; /*!< Tx loopback samples per FSC clock - denominator exponent */ + uint8_t lbw; /*!< Tx loopback samples per FSC clock - denominator weight */ + uint8_t txn; /*!< Tx samples per FSC clock - numerator */ + uint8_t txd; /*!< Tx samples per FSC clock - denominator exponent */ + uint8_t txw; /*!< Tx samples per FSC clock - denominator weight */ + uint8_t rxn; /*!< Rx samples per FSC clock - numerator */ + uint8_t rxd; /*!< Rx samples per FSC clock - denominator exponent */ + uint8_t rxw; /*!< Rx samples per FSC clock - denominator weight */ + uint8_t fastClkDiv; /*!< Fast clock divider */ + uint8_t slowClkDiv; /*!< Slow clock divider */ + uint32_t fastClk_kHz; /*!< Fast clock in kHz */ + uint32_t slowClk_kHz; /*!< Slow clock in kHz */ +} adrv903x_FscConfig_t; +ADI_ADRV903X_PACK_FINISH + +/**************************************************************************** +* Profile information that will define the Receiver channel. +****************************************************************************/ + ADI_ADRV903X_PACK_START +typedef struct adrv903x_RxConfig +{ + uint32_t ibw_kHz; /*!< Rx instantaneous bandwidth in kHz. */ + uint32_t ibwCenterFreq_kHz; /*!< Rx instantaneous center freq in kHz. */ + uint32_t tia1dB_Bw_kHz; /*!< Rx TIA bandwith (1db) in kHz. */ + uint32_t tia3dB_Bw_kHz; /*!< Rx TIA bandwith (3db) in kHz. */ + uint32_t adcClockRate_kHz; /*!< ADC clock rate in kHz */ + uint32_t iQRate_kHz; /*!< I/Q data rate at RxQEC in kHz */ + uint32_t rxOutputRate_kHz; /*!< Output data rate in kHz */ + uint32_t pfirOutputRate_kHz; /*!< Output data at the Pfir in kHz */ + uint32_t routRate_kHz; /*!< ROUT in kHz */ + uint8_t totalDecimation; /*!< Total RX decimation */ + adrv903x_NcoShifter_t rxddc[ADRV903X_DDC_NUM_BAND]; /*!< NCO Shifter */ + uint8_t dpFilterSel; /*!< Selectes Dec Mode */ + uint8_t reserved1; /*!< Reserved */ + uint8_t hb2Enable; /*!< HB 2 enable setting */ + uint8_t rxRinClkDiv; /*!< Rx RIN clock divider setting */ + uint8_t rxAgcClkDiv; /*!< Rx AGC clock setting*/ + uint8_t rxDcOffsetDiv; /*!< Rx DC Offset setting */ + uint8_t rxFir1InClkDiv; /*!< Rx FIR1 clock divider setting */ + uint8_t rxFir2InClkDiv; /*!< Rx FIR2 clock divider setting */ + uint8_t rxHb2InClkDiv; /*!< Rx HB2 in clock divider setting */ + uint8_t rxHb2OutClkDiv; /*!< Rx HB2 out clock divider setting */ + uint32_t rxHb2OutClk_kHz; /*!< Rx HB2 out clock setting */ + uint8_t routClkDiv; /*!< Rx ROUT out clock divider setting */ + adrv903x_RxPfirData_t rxPfirBank; /*!< Rx PFIR Bank */ + adrv903x_ClkGenConfig_t clkGenConfig; /*!< Rx clock gen settings */ + uint8_t loLeafDiv; /*!< LO Leaf Divider /1 /2 /4 */ + uint8_t clkdiv1p5enable; /*!< Resampling clock enable 1p5 */ + uint8_t clkdiv1p3enable; /*!< Resampling clock enable 1p3 */ + + uint8_t reserved[10]; /*!< Reserved */ +} adrv903x_RxConfig_t; +ADI_ADRV903X_PACK_FINISH + + +/**************************************************************************** +* Profile information that will define the Transmitter channel. +****************************************************************************/ + ADI_ADRV903X_PACK_START +typedef struct adrv903x_TxConfig +{ + uint32_t ibw_kHz; /*!< Tx instantaneous bandwidth in kHz. */ + uint32_t ibwCenterFreq_kHz; /*!< Tx instantaneous center freq in kHz. */ + uint32_t butterFilter_kHz; /*!< Tx butter filter BW for TxBBF in kHz */ + uint32_t txDacRate_kHz; /*!< Tx dac rate in kHz*/ + uint32_t txOutputRate_kHz; /*!< Tx output rate in kHz*/ + adrv903x_NcoShifter_t txduc[ADRV903X_DUC_NUM_BAND]; /*!< ncoShifterA NCO Shifter */ + uint8_t txFir1Enable; /*!< Transmitter FIR 1 setting. */ + uint8_t txFir2Enable; /*!< Transmitter FIR 2 setting. */ + uint8_t txFir3Enable; /*!< Transmitter FIR 3 setting. */ + uint8_t txInt3Enable; /*!< Transmitter interpolate by 3 setting. */ + uint8_t txPfirClkDiv; /*!< PFIR Clock Divider setting */ + uint32_t txPfirClk_kHz; /*!< PFIR Clock setting in kHz*/ + uint8_t txDacClkDiv; /*!< Tx DAC Clock Divider setting */ + uint8_t txToutClockDiv; /*!< Clock divider for output clock rate of Tx datapath (to DAC input) */ + uint8_t txFir2OutClkDiv; /*!< FIR2 output rate clock divider value */ + uint8_t txFir1InClkDiv; /*!< FIR1 input rate clock divider value */ + uint8_t txFir2InClkDiv; /*!< FIR1 input rate clock divider value */ + uint8_t txFir1OutClkDiv; /*!< FIR1 output rate clock divider value */ + uint8_t txAttenClkDiv; /*!< Tx Atten clock divider */ + uint8_t lpbkHb1OutClkDiv; /*!< Loopback HB1 divider setting */ + uint32_t lpbkHb1OutRate_kHz; /*!< Loopback HB1 Output rate in kHz*/ + uint8_t lpbkHb1enb; /*!< Loopback 1 enable */ + uint8_t lpbkReSampleEnb; /*!< Resample filter enable */ + int16_t lbbkResampFilter[10]; /*!< Resample filter Coef */ + int32_t lpbkCoarseNcoFtw; /*!< Loopback course NCO setting */ + uint32_t lpbkAdcClkRate_kHz; /*!< Loopback ADC clock setting in kHz*/ + adrv903x_ClkGenConfig_t txClkGenConfig; /*!< Tx clock gen settings */ + adrv903x_ClkGenConfig_t lpbkClkGenConfig; /*! Loopback clock gen settings */ + uint8_t overloadHb1ThresPre; /*! The pre-threshold value to be compared with magnitude. */ + uint8_t overloadHb1Thres; /*! The threshold value to be compared with I^2+Q^2 when in power mode, after pre_threshold met. */ + uint8_t overloadMode; /*! When this bit is set, the I^2+Q^2 power is compared with the threshold(power mode) */ + uint8_t overloadEn; /*! When this bit is set, the overload detector at output of lpbk hb1 is enabled. */ + uint8_t peakCountThresHb1; /*! The threshold value used to be compared with the peak counter. */ + uint8_t peakCountSpacing; /*! Defines the spacing between two peaks counted towards the peak count threshold. */ + uint8_t peakWinSize; /*! Defines the window of measurement size(number of cycles) */ + uint8_t peakCount; /*! With in the peak_window_size_hb1, this bitfield defines the minimum number of peaks need */ + uint8_t peakExperation; /*! Peak counter is cleared every peak count expiration period */ + adrv903x_FscConfig_t fscConfig; /*!< FSC config settings */ + uint8_t loLeafDiv; /*!< LO Leaf Divider /1 /2 /4 */ + uint8_t quadDiv; /*!< /2 or /4 HRM mixer divider */ + uint8_t dacPowerDownDiv_i; /*!< DAC PowerDown divider I */ + uint8_t dacPowerDownDiv_q; /*!< DAC PowerDown divider Q */ + uint8_t dacPowerUpDiv_i; /*!< DAC PowerUp divider I */ + uint8_t dacPowerUpDiv_q; /*!< DAC PowerUp divider Q */ + uint32_t maxTxSynBw_kHz; /*!< Maximum Tx synthesis bandwidth */ + uint32_t maxTxInstBw_kHz; /*!< Maximum Tx instantaneous bandwidth */ + uint32_t maxTxTestToneBw_kHz; /*!< Maximum BW over which a test tonne can be transmitted */ + uint8_t txAttenDelay; /*!< Tx atten delay */ + uint8_t lowNoiseModeEnb; /*!< Low noise mode operation state */ + + uint8_t reserved[2]; /*!< Reserved */ +} adrv903x_TxConfig_t; +ADI_ADRV903X_PACK_FINISH + +/**************************************************************************** +* Profile information that will define the Observation Receiver channel. +****************************************************************************/ + ADI_ADRV903X_PACK_START +typedef struct adrv903x_OrxConfig +{ + uint32_t sbw_kHz; /*!< Orx instantaneous bandwidth in kHz. */ + uint32_t sbwCenterFreq_kHz; /*!< Orx instantaneous center freq in kHz. */ + uint32_t adcClockRate_kHz; /*!< ADC Clock rate in kHz */ + uint32_t iQRate_kHz; /*!< I/Q Sample rate in kHz */ + uint32_t orxOutputRate_kHz; /*!< Orx Output Rate in kHz. */ + uint32_t orxRinClockRate_kHz; /*!< Orx RIN Clock Rate in kHz */ + uint32_t orxHb2OutRate_kHz; /*!< Orx HB2 effective output rate (sample rate, not clock rate) */ + uint32_t orxHb1OutRate_kHz; /*!< Orx HB1 effective output rate */ + uint8_t totalDecimation; /*!< Total Orx decimation */ + uint8_t dec3Enable; /*!< Decimation 3 enable setting (NOT SURE IF THESE ARE NEEDED) */ + uint8_t stageMode; /*!< Stage Mode */ + uint8_t fir2Enable; /*!< Fir2 enable (NOT SURE IF THESE ARE NEEDED) */ + uint8_t fir1Enable; /*!< Fir 1 enable (NOT SURE IF THESE ARE NEEDED)*/ + uint8_t hb2Enable; /*!< HB2 enable setting. */ + uint8_t hb1Enable; /*!< HB1 enable setting. */ + uint8_t rinEnable; /*!< RIN enable setting. */ + uint8_t orxRinClkDiv; /*!< ORX Rin clock divider */ + uint8_t orxRoutClkDiv; /*!< ORX Rout clock divider */ + uint8_t orxFir1ClkDiv; /*!< ORX Fir in clock divider */ + uint8_t orxHb2OutClkDiv; /*!< ORX HB2 out clock divider */ + uint8_t orxHb2InClkDiv; /*!< ORX HB2 in clock divider */ + uint8_t stageModeClkDiv; /*!< ORX Stage Mode clock divider */ + uint8_t orxHb1OutClkDiv; /*!< ORX HB1 out clock divider */ + int32_t orxAdcOutNcoFreq_kHz; /*!< Default Orx ADC output NCO frequency in KHz */ + int32_t orxDpNcoFreq_khz; /*!< Default Orx Datapath NCO frequency in KHz */ + int32_t orxAdcOutNcoFreqArray_kHz[ADRV903X_NUM_TX_PROFILES]; /*!< Orx ADC output NCO frequency in KHz, per Tx Profile */ + int32_t orxDpNcoFreqArray_kHz[ADRV903X_NUM_TX_PROFILES]; /*!< Orx Datapath NCO frequency in KHz, per Tx Profile */ + uint8_t orxLolPathDelayHb2Out[ADRV903X_NUM_TX_PROFILES]; /*!< Tx-to-ORx path delay used by LOL cal (in samples at the Tx PFIR/LOL rate) */ + uint8_t orxLolPathDelayHb1Out[ADRV903X_NUM_TX_PROFILES]; /*!< Tx-to-ORx path delay used by LOL cal (in samples at the Tx PFIR/LOL rate) */ + adrv903x_ClkGenConfig_t clkGenConfig; /*!< Orx clock gen settings */ + uint8_t reserved[9]; /*!< Reserved */ +} adrv903x_OrxConfig_t; +ADI_ADRV903X_PACK_FINISH + + +/**************************************************************************** +* Profile information that will define the Radio Configuration +* Profile struct holds clock rates, divider ratios, sampling rates, etc. +****************************************************************************/ + ADI_ADRV903X_PACK_START +typedef struct adrv903x_RadioProfile +{ + adrv903x_Version_t deviceProfileVersion; /*!< Device Profile version. Use for easy checking between Configurator and API */ + uint32_t hsDigFreq_kHz; /*!< System HS Dig clock setting calculated by the API in kHz. */ + uint32_t deviceClkFreq_kHz; /*!< System device clock setting, in multiples of 61.44 in kHz. */ + uint32_t deviceClkScaledFreq_kHz; /*!< System device clock scaled setting */ + uint32_t refClkFreq_kHz; /*!< Reference clock frequency in kHz */ + uint32_t armClkFreq_kHz; /*!< ARM clock frequency in kHz */ + uint8_t padDiv; /*!< Pad divider */ + uint8_t armClkDiv; /*!< ARM clock Divider */ + uint8_t armClkDivDevClk; /*!< ARM clock Divider when on DevClk */ + uint8_t hsDigDiv; /*!< HS Dig h/w divider */ + uint8_t ncoGoldenClkDiv; /*!< NCO Golden counter divider value */ + uint8_t clkGenSel; /*!< PLL select (Serdes or ClkPLL). Typically ClkPll will be selected but for debug it will be possible to use Serdes. */ + adrv903x_ClkGenConfig_t clkGenConfig; /*!< System clock gen settings */ + uint8_t loPhaseSync; /*!< 0 = Dont Sync; 1 = Run Init and sync; 2 = Run init and Continuous tracking */ + adrv903x_PllConfig_t clkPll; /*!< Clock PLL structure */ + adrv903x_PllConfig_t rf0Pll; /*!< RF0 PLL structure (EAST) */ + adrv903x_PllConfig_t rf1Pll; /*!< RF1 PLL structure (WEST) */ + uint8_t rf0MuxEastTx; /*!< RF0 (East) is connect to Tx when set. */ + uint8_t rf0MuxWestTx; /*!< RF0 (West) is connect to Tx when set. */ + uint8_t rf0MuxEastRx; /*!< RF0 (East) is connect to Rx when set. */ + uint8_t rf0MuxWestRx; /*!< RF0 (West) is connect to Rx when set. */ + uint32_t chanConfig; /*!< Channel config. B0=Tx0, B1=Tx1,--- B7=Tx7, B8=Rx0, B9=Rx1 -- B15=Rx7, B16=Orx0, B17=Orx1 */ + uint8_t chanAssign[ADRV903X_NUM_TXRX_CHAN]; /*!< This is used to reference a channel to a rx/tx profile def'n in rxConfig/txConfig */ + adrv903x_RxConfig_t rxConfig[ADRV903X_NUM_RX_PROFILES]; /*!< Receiver profile for 0-3 */ + adrv903x_TxConfig_t txConfig[ADRV903X_NUM_TX_PROFILES]; /*!< Transmitter profile for 0-3 */ + adrv903x_TxPfirData_t txPfirBank[ADRV903X_NUM_TXRX_CHAN]; /*!< Tx PFIR Bank */ + uint8_t rxTxCpuConfig[ADRV903X_NUM_TXRX_CHAN]; /*!< Defines which CPU each channel is assigned to */ + adrv903x_OrxConfig_t orxConfig[ADRV903X_NUM_ORX_PROFILES]; /*!< Observation Receiever profile for channels 0-1 */ + uint8_t orxCpuConfig[ADRV903X_NUM_ORX_PROFILES]; /*!< This defines which cpu an Orx channel is allocated to. */ + adrv903x_PllConfig_t serdesPll; /*!< Serdes PLL structure */ + adrv903x_JesdSettings_t jesdProfile; /*!< Jesd configuration */ + uint8_t pid; /*!< PID */ + uint8_t productId[20]; /*!< Product ID */ + uint8_t featureMask[16]; /*!< 128 bits of Feature Mask */ + uint8_t reserved[8]; /*!< Reserved (adjust so Device profile size is multiple of 4 bytes) */ + uint32_t profileChecksum; /*!< Checksum of the entire profile excluding ADC profiles, Using the CRC32 algorithm */ +} adrv903x_RadioProfile_t; +ADI_ADRV903X_PACK_FINISH + +/**************************************************************************** +* Profile information provided by BBIC at init via CONFIG command +****************************************************************************/ +ADI_ADRV903X_PACK_START +typedef struct adrv903x_DeviceProfile +{ + adrv903x_RadioProfile_t radioProfile; /*!< Radio configuration parameters */ +} adrv903x_DeviceProfile_t; +ADI_ADRV903X_PACK_FINISH + +#define ADRV903X_DEVICE_PROFILE_SIZE_BYTES sizeof(adrv903x_DeviceProfile_t) /* about 2440 bytes */ +#define ADRV903X_RADIO_PROFILE_SIZE_BYTES sizeof(adrv903x_RadioProfile_t) +/* Constant for adrv903x_RuntimeProfile_t signature1 field */ +#define ADRV903X_RUNTIME_PROFILE_SIGNATURE1 (0x55AADD11UL) + +ADI_ADRV903X_PACK_START +typedef struct adrv903x_RuntimeProfile +{ + uint32_t signature1; /*!< Magic number to indicate that profile data is valid */ + uint32_t hsDigFreq_kHz; /*!< System HS Dig clock setting in kHz */ + uint32_t txPfirSampleRate_kHz[ADRV903X_NUM_TXRX_CHAN]; /*!< DUC sampling rate for Tx in kHz */ + uint32_t txNcoMixerSampleRate_kHz[ADRV903X_NUM_TXRX_CHAN]; /*!< DUC NCO sampling rate for Tx in kHz */ + uint32_t orxOutputRate_kHz[ADRV903X_NUM_ORX_CHAN]; /*!< Orx output sample rate */ + uint32_t orxHb1OutRate_kHz[ADRV903X_NUM_ORX_CHAN]; /*!< Orx HB1 effective output sample rate */ + uint32_t orxHb2OutRate_kHz[ADRV903X_NUM_ORX_CHAN]; /*!< Orx HB2 effective output sample rate */ + int32_t orxDpNcoFreqArray_kHz[ADRV903X_NUM_ORX_CHAN]; /*!< Orx NCO freqency in khz */ + uint32_t txLo0Freq_kHz; /*!< Tx Lo0 frequency in kHz */ + uint32_t txLo1Freq_kHz; /*!< Tx Lo1 frequency in kHz */ + uint32_t txChanConfig; /*!< Tx Channel enable/disable bitmask */ + uint32_t rxChanConfig; /*!< Rx Channel enable/disable bitmask */ + uint32_t orxChanConfig; /*!< ORx Channel enable/disable bitmask */ +} adrv903x_RuntimeProfile_t; +ADI_ADRV903X_PACK_FINISH + +#endif /* ADRV903X_CPU_DEVICE_PROFILE_TYPES_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_error_codes_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_error_codes_types.h new file mode 100644 index 0000000000000..9883d6a3804a2 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_error_codes_types.h @@ -0,0 +1,3326 @@ + /** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + + /** + * \file adrv903x_cpu_error_codes_types.h + * + * \brief Contains CPU Error code definitions + * + * \details Contains CPU Error code definitions + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_CPU_ERROR_CODES_TYPES_H__ +#define __ADRV903X_CPU_ERROR_CODES_TYPES_H__ + +#include "adrv903x_cpu_object_ids_types.h" +#include "adi_adrv903x_platform_pack.h" + +#define ADRV903X_CPU_SYSTEM_ERROR_CODE_START 0xFF00u /*!< 0xFF00 - Starting System Related Error codes */ + +#define ADRV903X_CPU_RC_TUNER_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_RC_TUNER << 8u) /*!< 0x0000 - Starting RC Tuner Error code */ +#define ADRV903X_CPU_DC_OFFSET_RX_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_RX_DC_OFFSET << 8u) /*!< 0x0100 - Starting DC Offset Rx Error code */ +#define ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_ADC_RX << 8u) /*!< 0x0200 - Starting RX ADC Error code */ +#define ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_ADC_ORX << 8u) /*!< 0x0300 - Starting ORX ADC Error code */ +#define ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_ADC_TXLB << 8u) /*!< 0x0400 - Starting TxLB ADC Error code */ +#define ADRV903X_CPU_TXDAC_CAL_ERROR_START (ADRV903X_CPU_OBJID_IC_TXDAC << 8u) /*!< 0x0500 - Starting TxDAC Error code */ +#define ADRV903X_CPU_BBF_TX_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_TXBBF << 8u) /*!< 0x0600 - Starting BBF Tx Error code */ +#define ADRV903X_CPU_PATH_DLY_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_TXLB_PATH_DLY << 8u) /*!< 0x0700 - Starting Pathdelay Error code */ +#define ADRV903X_CPU_TX_ATTEN_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_TX_ATTEN_CAL << 8u) /*!< 0x0800 - Starting TxAtten Error code */ +#define ADRV903X_CPU_HRM_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_HRM << 8u) /*!< 0x0900 - Starting HRM Error code */ +#define ADRV903X_CPU_TXLOL_INIT_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_TXLOL << 8u) /*!< 0x0B00 - Starting TxLOL Error code */ +#define ADRV903X_CPU_SERDES_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_SERDES << 8u) /*!< 0x0C00 - Starting SERDES Error code */ +#define ADRV903X_CPU_TXLB_FILTER_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_TXLB_FILTER << 8u) /*!< 0x1000 - Starting TxLB Filter Error code */ +#define ADRV903X_CPU_TXRX_PHASE_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_TXRX_PHASE << 8u) /*!< 0x1100 - Starting Tx/Rx Phase Error code */ +#define ADRV903X_CPU_RXSPUR_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_IC_RXSPUR << 8u) /*!< 0x1200 - Starting RxSpur Filter Error code */ +#define ADRV903X_CPU_RXQEC_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_TC_RXQEC << 8u) /*!< 0x3000 - Starting RX QEC Error code */ +#define ADRV903X_CPU_TXLOL_TRACK_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_TC_TX_LOL << 8u) /*!< 0x3100 - Starting TX LOL Error code */ +#define ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START (ADRV903X_CPU_OBJID_TC_TXQEC << 8u) /*!< 0x3200 - Starting TX QEC Error code */ + +#define ADRV903X_CPU_CFG_DEVICE_PROFILE_ERROR_CODE_START (ADRV903X_CPU_OBJID_CFG_DEVICE_PROFILE << 8u) /*!< 0x8000 - Starting Device Profile Error code */ +#define ADRV903X_CPU_CFG_PARITY_ERROR_CODE_START (ADRV903X_CPU_OBJID_CFG_PARITY_ERROR_CHECK << 8u)/*!< 0x8500 - Starting Parity Error codes*/ +#define ADRV903X_CPU_NCO_DRV_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_NCO << 8u) /*!< 0xB000 - Starting NCO driver Error code */ +#define ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_STREAM << 8u) /*!< 0xB100 - Starting Stream driver Error codes */ +#define ADRV903X_CPU_FSC_DRV_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_FSC << 8u) /*!< 0xB200 - Starting FSC driver Error codes */ +#define ADRV903X_CPU_MASTER_BIAS_DRV_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_MASTER_BIAS << 8u) /*!< 0xB300 - Starting Master Bias driver Error codes */ +#define ADRV903X_CPU_LDO_DRV_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_LDO << 8u) /*!< 0xB400 - Starting LDO driver Error code */ +#define ADRV903X_CPU_DWT_DRV_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_DWT << 8u) /*!< 0xB500 - Starting DWT driver Error code */ +#define ADRV903X_CPU_TEMP_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_TEMP << 8u) /*!< 0xB600 - Starting Temperature driver Error code */ +#define ADRV903X_CPU_PLL_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_PLL << 8u) /*!< 0xB700 - Starting PLL driver Error code */ +#define ADRV903X_CPU_JESD_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_JESD << 8u) /*!< 0xB800 - Starting JESD driver Error code */ +#define ADRV903X_CPU_UART_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_UART << 8u) /*!< 0xB900 - Starting UART driver Error code */ +#define ADRV903X_CPU_TXATTEN_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_TXATTEN << 8u) /*!< 0xBA00 - Starting TXatten driver Error code */ +#define ADRV903X_CPU_TXLOL_DRV_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_TXLOL << 8u) /*!< 0xBB00 - Starting TX LOL Accumulator driver Error codes */ +#define ADRV903X_CPU_GPIO_DRV_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_GPIO << 8u) /*!< 0xBD00 - Starting GPIO driver Error codes */ + +#define ADRV903X_CPU_DDCC_DRV_ERROR_CODE_START (ADRV903X_CPU_OBJID_DRV_DDCC << 8u) /*!< 0xF100 - Starting DDCC driver Error codes */ + +#ifndef CLIENT_IGNORE +typedef enum adrv903x_CpuErrorCode +{ + + ADRV903X_CPU_NO_ERROR = 0UL, /*!<@errcode: 0x0000 + @desc: No Error + @maincause: Operation Successful + @mainrecovenum: ADI_ADRV903X_ERR_ACT_NONE + @mainrecovtext: No Action Required + @cause: + @recovenum: + @recovtext: + */ + + /*!< ----- Object ID = ADRV903X_CPU_OBJID_IC_RC_TUNER Section Base Error Code = 0x0000 ------ @errcode: 0x0000 + @desc: RC Tuner Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_RC_TUNER_CAL_TIMEOUT_ERROR = (ADRV903X_CPU_RC_TUNER_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x0001 + @desc: RC Tuner: Calibration Timeout + @maincause: Timeout Waiting for RCAL and/or CCAL to Finish + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Re-program Device and re-run RC Tuner Calibration + @cause: Tuner clock not Enabled (RCAL and CCAL) and/or master bias is not up (CCAL) + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: + */ + ADRV903X_CPU_RC_TUNER_CAL_SELFTEST_ERROR = (ADRV903X_CPU_RC_TUNER_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x0002 + @desc: RC Tuner: Self-Test Error + @maincause: RCAL/CCAL Results violate +/-25% limits (from Nominal) + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Re-program Device and re-run RC Tuner Calibration + @cause: Master bias output is incorrect (RCAL and CCAL) and/or tuner clock Frequency is incorrect (CCAL). + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: + */ + + /*!< -------- Object ID = ADRV903X_CPU_OBJID_IC_RX_DC_OFFSET Section Base Error Code = 0x0100 ------ @errcode: 0x0100 + @desc: DC Offset Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_DC_OFFSET_CAL_RX_ABORT_ERROR = (ADRV903X_CPU_DC_OFFSET_RX_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x0101 + @desc: DC Offset: Calibration was aborted while collecting data + @maincause: Rx going low or higher priority Calibration aborting the current capture + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run the Calibration + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_DC_OFFSET_CAL_RX_TIMEOUT_ERROR = (ADRV903X_CPU_DC_OFFSET_RX_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x0102 + @desc: DC Offset: Calibration Timed out due to Error in Data Capture + @maincause: Hardware was unable to capture enough data within time limit + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run the Calibration + @cause: Hardware was unable to capture enough data within time limit + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: Resetting Hardware to make Data Capture finish within time + */ + ADRV903X_CPU_DC_OFFSET_CAL_RX_FSC_DATACAP_ERROR = (ADRV903X_CPU_DC_OFFSET_RX_CAL_CODE_ERROR_START + 3u), /*!<@errcode: 0x0103 + @desc: DC Offset: Internal Test to verify if Calibration was successful + @maincause: FSC was unable to capture data required to confirm Calibration completion + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Perform Soft Reset to complete Data Capture + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_DC_OFFSET_CAL_RX_UNDEF_API_FN_ERROR = (ADRV903X_CPU_DC_OFFSET_RX_CAL_CODE_ERROR_START + 4u), /*!<@errcode: 0x0104 + @desc: DC Offset: Undefined control Command + @maincause: Invalid control Command used for tracking Calibration + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Control Command is Valid + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_DC_OFFSET_CAL_RX_CONVERGENCE_ERROR = (ADRV903X_CPU_DC_OFFSET_RX_CAL_CODE_ERROR_START + 5u), /*!<@errcode: 0x0105 + @desc: DC Offset: Calibration was unable to converge + @maincause: The residual DC Offset was higher than threshold + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + + /*!< -------- Object ID = ADRV903X_CPU_OBJID_IC_ADC_RX Section Base Error Code = 0x0200 ------ @errcode: 0x0200 + @desc: ADC Rx Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_ADC_RX_STAGE1_OBJ_ERROR = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x0201 + @desc: ADC Rx: Stage 1 Error + @maincause: Calibration may have saturated + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_RX_STAGEV_OBJ_ERROR = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x0202 + @desc: ADC Rx: Stage V Error + @maincause: Calibration may have saturated + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_RX_DRF_OBJ_ERROR = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 3u), /*!<@errcode: 0x0203 + @desc: ADC Rx: DRF Error + @maincause: Calibration may have saturated + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_RX_FSMCMD_ERROR = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 4u), /*!<@errcode: 0x0204 + @desc: ADC Rx: Invalid FSM Command + @maincause: Invalid FSM Command passed to ADC Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_RX_TRACKING_NEEDS_INIT = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 5u), /*!<@errcode: 0x0205 + @desc: ADC Rx: Run ADC Rx Initial Calibration before Tracking Calibration + @maincause: Initial ADC Rx Calibration has not completed successfully yet + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_RX_CAL_TIMEOUT_ERROR = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 6u), /*!<@errcode: 0x0206 + @desc: ADC Rx: Calibration Timeout + @maincause: Calibration did not finish in expected time + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_RX_HW_STARTUP_ERROR = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 7u), /*!<@errcode: 0x0207 + @desc: ADC Rx:HW start-up Error + @maincause: Unexpected HW behavior: start-up Error; report to ADI + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_RX_CONFIG_INVALID_PARAM = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 8u), /*!<@errcode: 0x0208 + @desc: ADC Rx: Invalid Configuration Parameter + @maincause: Invalid Configuration Parameter Passed to ADC Rx Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_RX_UNKNOWN_ERROR = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 9u), /*!<@errcode: 0x0209 + @desc: ADC Rx: Unknown Error + @maincause: Unspecified Error Detected in ADC Rx Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_RX_CTRL_FUNC_NOT_SUPPORTED = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 11u), /*!<@errcode: 0x020A + @desc: ADC Rx: Invalid Control Command + @maincause: Invalid Control Command provided to ADC Rx Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Control Command is Supported + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_RX_ALREADY_RUNNING_CAL = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 11u), /*!<@errcode: 0x020B + @desc: ADC Rx: Busy + @maincause: A Calibration is currently Running + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Wait for Current Calibration Running to Complete + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_RX_CMD_NEEDS_DEBUG_MODE = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 12u), /*!<@errcode: 0x020C + @desc: ADC Rx: Control Command Requires Debug Mode + @maincause: Debug Mode is not Supported + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: Debug Mode is not Enabled + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @recovtext: Check Control Command & Mode of Operation + */ + ADRV903X_CPU_ADC_RX_HW_REG_VERIFY = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 13u), /*!<@errcode: 0x020D + @desc: ADC Rx: Register Map Verification Failed + @maincause: ADC Rx Module not Configured as Expected + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_RX_TRACKING_CAL_TIMEOUT = (ADRV903X_CPU_ADC_RX_CAL_CODE_ERROR_START + 14u), /*!<@errcode: 0x020E + @desc: ADC Rx: Tracking Calibration Timeout + @maincause: Timeout due to Disabled Rx + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Enable Rx before Timeout + @cause: Internal Error Not Handled Correctly + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + /*!< -------- Object ID = ADRV903X_CPU_OBJID_IC_ADC_ORX Section Base Error Code = 0x0300 ------ @errcode: 0x0300 + @desc: ADC ORx Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_ADC_ORX_SCAL_OBJ_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x0301 + @desc: ADC ORx: Slice Calibration Object Error + @maincause: Calibration may have Saturated + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_SCAL_IRQ_STATUS_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x0302 + @desc: ADC ORx: Slice Calibration Interrupt Status Error + @maincause: Interrupt Pin Caused Error, but Status was OK + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_ADC_ORX_SCAL_IRQ_TIMEOUT_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 3u), /*!<@errcode: 0x0303 + @desc: ADC ORx: Slice Calibration Interrupt Timeout + @maincause: Interrupt Timer has Expired + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_SCAL_FG_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 4u), /*!<@errcode: 0x0304 + @desc: ADC ORx: Slice Initialization Calibration Interrupt Error + @maincause: Unexpected Interrupt Received + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_SCAL_BG_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 5u), /*!<@errcode: 0x0305 + @desc: ADC ORx: Slice Tracking Calibration Interrupt Error + @maincause: Unexpected Interrupt Received + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_FCAL_OBJ_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 6u), /*!<@errcode: 0x0306 + @desc: ADC ORx: Front-End Calibration Object Error + @maincause: Calibration may have Saturated + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_FCAL_IRQ_STATUS_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 7u), /*!<@errcode: 0x0307 + @desc: ADC ORx: Front-End Calibration Interrupt Status Error + @maincause: Interrupt Pin caused Error, but status was OK + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_FCAL_IRQ_TIMEOUT_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 8u), /*!<@errcode: 0x0308 + @desc: ADC ORx: Front-End Calibration Interrupt Timeout Error + @maincause: Interrupt Timer has Expired + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_FCAL_FG_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 9u), /*!<@errcode: 0x0309 + @desc: ADC ORx: Front-End Initialization Calibration Interrupt Error + @maincause: Unexpected Interrupt Received + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_FCAL_BG_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 10u), /*!<@errcode: 0x030A + @desc: ADC ORx: Front-End Tracking Calibration Interrupt Error + @maincause: Unexpected Interrupt Received + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_ICAL_OBJ_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 11u), /*!<@errcode: 0x030B + @desc: ADC ORx: Interleaving Timing Calibration Object Error + @maincause: Calibration may have Saturated + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_ICAL_IRQ_STATUS_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 12u), /*!<@errcode: 0x030C + @desc: ADC ORx: Interleaving Timing Calibration Interrupt Status Error + @maincause: Interrupt Pin caused Error, but Status was OK + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_ICAL_IRQ_TIMEOUT_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 13u), /*!<@errcode: 0x030D + @desc: ADC ORx: Interleaving Timing Calibration Interrupt Timeout Error + @maincause: Interrupt Timer has Expired + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_ICAL_FG_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 14u), /*!<@errcode: 0x030E + @desc: ADC ORx: Interleaving Timing Initialization Calibration Interrupt Error + @maincause: Unexpected Interrupt Received + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_ICAL_BG_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 15u), /*!<@errcode: 0x030F + @desc: ADC ORx: Interleaving Timing Tracking Calibration Interrupt Error + @maincause: Unexpected Interrupt Received + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_CMD_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 16u), /*!<@errcode: 0x0310 + @desc: ADC ORx: Invalid Control Command + @maincause: Invalid Control Command passed to ADC ORx Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_QUEUE_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 17u), /*!<@errcode: 0x0311 + @desc: ADC ORx: Control Command Queue Error + @maincause: Unexpected Behaviour in ADC ORx Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_SLICE_INIT_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 18u), /*!<@errcode: 0x0312 + @desc: ADC ORx: Hardware Slice Initialization Error + @maincause: Unexpected Behaviour in ADC ORx Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_TRACK_INIT_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 19u), /*!<@errcode: 0x0313 + @desc: ADC ORx: Hardware Track & Hold Initialization Error + @maincause: Unexpected Behaviour in ADC ORx Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_HW_STARTUP_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 20u), /*!<@errcode: 0x0314 + @desc: ADC ORx: Hardware Start-Up Error + @maincause: Unexpected Behaviour in ADC ORx Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_CAL_TIMEOUT_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 21u), /*!<@errcode: 0x0315 + @desc: ADC ORx: Calibration Timeout Error + @maincause: Calibration did not Finish in Expected Time + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_CONFIG_INVALID_PARAM = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 22u), /*!<@errcode: 0x0316 + @desc: ADC ORx: Invalid Configuration Parameter + @maincause: Invalid Configuration Parameter Used in Command to ADC ORx Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Parameters and try again. Contact ADI if the problem persists + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_UNKNOWN_ERROR = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 23u), /*!<@errcode: 0x0317 + @desc: ADC ORx: Unknown Error + @maincause: Unspecified Error in ADC ORx Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_CTRL_FUNC_NOT_SUPPORTED = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 24u), /*!<@errcode: 0x0318 + @desc: ADC ORx: Control Command Not Supported + @maincause: Invalid Control Command + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Control Command is Supported + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_ALREADY_RUNNING_CAL = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 25u), /*!<@errcode: 0x0319 + @desc: ADC ORx: Busy + @maincause: A Calibration is Currently Running + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Wait for Current Calibration Running to Complete + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_CMD_NEEDS_DEBUG_MODE = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 26u), /*!<@errcode: 0x031A + @desc: ADC ORx: Control Command Requires Debug Mode + @maincause: Debug Mode Not Enabled + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Check Command & Mode of Operation + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_TRACKING_NEEDS_INIT = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 27u), /*!<@errcode: 0x031B + @desc: ADC ORx: Run ADC ORx Initial Calibration before Tracking Calibration + @maincause: Initial ADC ORx Calibration has not completed successfully yet + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_INIT_DAC_NOT_RUNNING = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 28u), /*!<@errcode: 0x031C + @desc: ADC ORx: DAC Stream Write Error + @maincause: Stream DAC has stopped Writing + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_HW_REG_VERIFY = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 29u), /*!<@errcode: 0x031D + @desc: ADC ORx: Register Map Verification Failed + @maincause: ADC ORx Module not Configured as Expected + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_ORX_TRACKING_CAL_TIMEOUT = (ADRV903X_CPU_ADC_ORX_CAL_CODE_ERROR_START + 30u), /*!<@errcode: 0x031E + @desc: ADC ORx: Tracking Calibration Timeout + @maincause: Timeout Due to Disabled ORx + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Enable ORx before Timeout + @cause: Internal Error Not Handled Correctly + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + /*!< -------- Object ID = ADRV903X_CPU_OBJID_IC_ADC_TXLB Section Base Error Code = 0x0400 ------ @errcode: 0x0400 + @desc: ADC TxLb Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_ADC_TXLB_SCAL_OBJ_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x0401 + @desc: ADC TxLb: Slice Calibration Object Error + @maincause: Calibration may have Saturated + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_SCAL_IRQ_STATUS_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x0402 + @desc: ADC TxLb: Slice Calibration Interrupt Status Error + @maincause: Interrupt Pin caused Error, but Status was OK + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_SCAL_IRQ_TIMEOUT_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 3u), /*!<@errcode: 0x0403 + @desc: ADC TxLb: Slice Calibration Interrupt Timeout Error + @maincause: Interrupt Timer has Expired + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_SCAL_FG_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 4u), /*!<@errcode: 0x0404 + @desc: ADC TxLb: Slice Initialization Calibration Interrupt Error + @maincause: Unexpected Interrupt Received + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_SCAL_BG_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 5u), /*!<@errcode: 0x0405 + @desc: ADC TxLb: Slice Tracking Calibration Interrupt Error + @maincause: Unexpected Interrupt Received + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_FCAL_OBJ_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 6u), /*!<@errcode: 0x0406 + @desc: ADC TxLb: Front-End Calibration Object Error + @maincause: Calibration may have Saturated + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_FCAL_IRQ_STATUS_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 7u), /*!<@errcode: 0x0407 + @desc: ADC TxLb: Front-End Calibration Interrupt Status Error + @maincause: Interrupt Pin caused Error, but Status was OK + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_FCAL_IRQ_TIMEOUT_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 8u), /*!<@errcode: 0x0408 + @desc: ADC TxLb: Front-End Calibration Interrupt Timeout Error + @maincause: Interrupt Timer has Expired + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_FCAL_FG_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 9u), /*!<@errcode: 0x0409 + @desc: ADC TxLb: Front-End Initialization Calibration Interrupt Error + @maincause: Unexpected Interrupt Received + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_FCAL_BG_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 10u), /*!<@errcode: 0x040A + @desc: ADC TxLb: Front-End Tracking Calibration Interrupt Error + @maincause: Unexpected Interrupt Received + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_CMD_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 11u), /*!<@errcode: 0x040B + @desc: ADC TxLb: Invalid Control Command + @maincause: Invalid Control Command passed to ADC TxLb Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_QUEUE_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 12u), /*!<@errcode: 0x040C + @desc: ADC TxLb: Control Command Queue Error + @maincause: Unexpected Behaviour in ADC TxLb Module + @mainrecovenum:ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_SLICE_INIT_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 13u), /*!<@errcode: 0x040D + @desc: ADC TxLb: Hardware Slice Initialization Error + @maincause: Unexpected Behaviour in ADC TxLb Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_HW_STARTUP_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 14u), /*!<@errcode: 0x040E + @desc: ADC TxLb: Hardware Start-Up Error + @maincause: Unexpected Behaviour in ADC TxLb Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_TRACK_INIT_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 15u), /*!<@errcode: 0x040F + @desc: ADC TxLb: Hardware Track & Hold Initialization Error + @maincause: Unexpected Behaviour in ADC TxLb Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_CAL_TIMEOUT_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 16u), /*!<@errcode: 0x0410 + @desc: ADC TxLb: Calibration Timeout + @maincause: Calibration did not Finish in Expected Time + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_CONFIG_INVALID_PARAM = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 17u), /*!<@errcode: 0x0411 + @desc: ADC TxLb: Invalid Parameter + @maincause: Invalid Configuration Parameter passed to ADC TxLb Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_UNKNOWN_ERROR = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 18u), /*!<@errcode: 0x0412 + @desc: ADC TxLb: Unknown Error + @maincause: Unspecified Error in ADC TxLb Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_CTRL_FUNC_NOT_SUPPORTED = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 19u), /*!<@errcode: 0x0413 + @desc: ADC TxLb: Control Command Not Supported + @maincause: Invalid Control Command passed to ADC TxLb Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Control Command is Supported + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_ALREADY_RUNNING_CAL = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 20u), /*!<@errcode: 0x0414 + @desc: ADC Txlb: Busy + @maincause: A Calibration is Currently Running + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Wait Until Current Calibration Finishes + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_CMD_NEEDS_DEBUG_MODE = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 21u), /*!<@errcode: 0x0415 + @desc: ADC Txlb: Control Command Requires Debug Mode + @maincause: Debug Mode is not Supported + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: Debug Mode is not Enabled + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @recovtext: Check Control Command & Mode of Operation + */ + ADRV903X_CPU_ADC_TXLB_TRACKING_NEEDS_INIT = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 22u), /*!<@errcode: 0x0416 + @desc: ADC Txlb: Run ADC ORx Initial Calibration before Tracking Calibration + @maincause: Initial ADC TxLb Calibration has not completed successfully yet + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_INIT_DAC_NOT_RUNNING = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 23u), /*!<@errcode: 0x0417 + @desc: ADC Txlb: DAC Stream Write Error + @maincause: Stream DAC has stopped Writing + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_HW_REG_VERIFY = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 24u), /*!<@errcode: 0x0418 + @desc: ADC Txlb: Register Map Verification Failed + @maincause: ADC TxLb Module not Configured as Expected + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_ADC_TXLB_TRACKING_CAL_TIMEOUT = (ADRV903X_CPU_ADC_TXLB_CAL_CODE_ERROR_START + 25u), /*!<@errcode: 0x0419 + @desc: ADC Txlb: Tracking Calibration Timeout + @maincause: Timeout due to Disabled Tx + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Enable ORx before Timeout + @cause: Internal Error Not Handled Correctly + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + /*!< -------- Object ID = ADRV903X_CPU_OBJID_IC_TXDAC Section Base Error Code = 0x0500 ------ @errcode: 0x0500 + @desc: Tx DAC Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + /* TODO: TPGSWE-2335, API functionality to read power status and PLL lock bits in debug mode */ + ADRV903X_CPU_TXDAC_CAL_CHAN_I_NOT_POWERED_UP_ERROR = (ADRV903X_CPU_TXDAC_CAL_ERROR_START + 1u), /*!<@errcode: 0x0501 + @desc: Tx DAC: DAC Channel I not Powered Up + @maincause: Supplies not Ready or Clock is not on + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Verify Supply Ready Flags and PLL Ready Flags are Set, if the problem persists acquire a Memory Dump and contact ADI + @cause: TxDAC clock has incorrect Configuration + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Verify dacPowerDownDiv_i/q, dacPowerUpDiv_i/q, and txDacClkDiv have Correct Configuration + */ + ADRV903X_CPU_TXDAC_CAL_CHAN_Q_NOT_POWERED_UP_ERROR = (ADRV903X_CPU_TXDAC_CAL_ERROR_START + 2u), /*!<@errcode: 0x0502 + @desc: Tx DAC: DAC Channel Q not Powered Up + @maincause: Supplies not Ready or Clock is not on + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Verify Supply Ready Flags and PLL Ready Flags are Set, if the problem persists acquire a Memory Dump and contact ADI + @cause: TxDAC clock has incorrect Configuration + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Verify dacPowerDownDiv_i/q, dacPowerUpDiv_i/q, and txDacClkDiv have Correct Configuration + */ + ADRV903X_CPU_TXDAC_CAL_CHAN_I_NOT_FINISHED_ERROR = (ADRV903X_CPU_TXDAC_CAL_ERROR_START + 3u), /*!<@errcode: 0x0503 + @desc: Tx DAC: DAC Channel I Initial Calibration didn't finish + @maincause: DAC Clock not on + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Verify PLL Ready Flags are Set, if the problem persists acquire a Memory Dump and contact ADI + @cause: TxDAC clock has incorrect Configuration + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Verify dacPowerDownDiv_i/q, dacPowerUpDiv_i/q, and txDacClkDiv have Correct Configuration + */ + ADRV903X_CPU_TXDAC_CAL_CHAN_Q_NOT_FINISHED_ERROR = (ADRV903X_CPU_TXDAC_CAL_ERROR_START + 4u), /*!<@errcode: 0x0504 + @desc: Tx DAC: DAC Channel Q Initial Calibration didn't finish + @maincause: DAC Clock not on + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Verify PLL Ready Flags are Set, if the problem persists acquire a Memory Dump and contact ADI + @cause: TxDAC Clock has Incorrect Configuration + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Verify CLKDIV has Correct Configuration + */ + ADRV903X_CPU_TXDAC_CAL_CHAN_I_SATURATED_ERROR = (ADRV903X_CPU_TXDAC_CAL_ERROR_START + 5u), /*!<@errcode: 0x0505 + @desc: Tx DAC: DAC Channel I Saturated during Initial Calibration + @maincause: Not Enough Range during TxDAC Initial Calibration + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Possibly not Enough Range, acquire a Memory Dump and contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_TXDAC_CAL_CHAN_Q_SATURATED_ERROR = (ADRV903X_CPU_TXDAC_CAL_ERROR_START + 6u), /*!<@errcode: 0x0506 + @desc: Tx DAC: DAC Channel Q Saturated during Initial Calibration + @maincause: Not Enough Range during TxDAC Initial Calibration + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Possibly not Enough Range, acquire a Memory Dump and contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_TXDAC_CAL_CHAN_I_NOT_POWERED_DOWN_ERROR = (ADRV903X_CPU_TXDAC_CAL_ERROR_START + 7u), /*!<@errcode: 0x0507 + @desc: Tx DAC: DAC Channel I not Powered Down + @maincause: Supplies not Ready or Clock is not on + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Verify Supply Ready Flags and PLL Ready Flags are Set, if the problem persists acquire a Memory Dump and contact ADI + @cause: TxDAC clock has Incorrect Configuration + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Verify dacPowerDownDiv_i/q, dacPowerUpDiv_i/q, and txDacClkDiv have Correct Configuration + */ + ADRV903X_CPU_TXDAC_CAL_CHAN_Q_NOT_POWERED_DOWN_ERROR = (ADRV903X_CPU_TXDAC_CAL_ERROR_START + 8u), /*!<@errcode: 0x0508 + @desc: Tx DAC: DAC Channel Q not Powered Down + @maincause: Supplies not Ready or Clock is not on + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: verify supply ready flags and PLL ready flags are set, if the problem persists acquire a Memory Dump and contact ADI @cause: TxDAC clock has incorrect Configuration + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Verify dacPowerDownDiv_i/q, dacPowerUpDiv_i/q, and txDacClkDiv have Correct Configuration + */ + ADRV903X_CPU_TXDAC_CAL_CHAN_I_NOT_IN_STANDBY = (ADRV903X_CPU_TXDAC_CAL_ERROR_START + 9u) , /*!<@errcode: 0x0509 + @desc: Tx DAC: DAC Channel I not in Standby + @maincause: Supplies not Ready or Clock is not on + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Verify Supply Ready Flags and PLL Ready Flags are Set, if the problem persists acquire a Memory Dump and contact ADI + @cause: TxDAC clock has incorrect Configuration + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Verify dacPowerDownDiv_i/q, dacPowerUpDiv_i/q, and txDacClkDiv have Correct Configuration + */ + ADRV903X_CPU_TXDAC_CAL_CHAN_Q_NOT_IN_STANDBY = (ADRV903X_CPU_TXDAC_CAL_ERROR_START + 10u), /*!<@errcode: 0x050A + @desc: Tx DAC: DAC Channel Q not in Standby + @maincause: Supplies not Ready or Clock is not on + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: verify supply ready flags and PLL ready flags are set, if the problem persists acquire a Memory Dump and contact ADI @cause: TxDAC clock has incorrect Configuration + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Verify dacPowerDownDiv_i/q, dacPowerUpDiv_i/q, and txDacClkDiv have Correct Configuration + */ + ADRV903X_CPU_TXDAC_CAL_CHAN_INVALID_DIV = (ADRV903X_CPU_TXDAC_CAL_ERROR_START + 11u), /*!<@errcode: 0x050B + @desc: Tx DAC: Invalid Clock Divider + @maincause: Invalid Clock Divider Value + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Verify dacPowerDownDiv_i/q, dacPowerUpDiv_i/q, and txDacClkDiv have correct Configuration + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_TXDAC_CAL_DAC_CLOCK_FREQ_OUT_OF_RANGE_ERROR = (ADRV903X_CPU_TXDAC_CAL_ERROR_START + 12u), /*!<@errcode: 0x050C + @desc: Tx DAC: DAC Sample Clock out of Operating Frequency Range + @maincause: Sample clock should be between 1.5 - 3GHz + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Sample Clock Rate + @cause: + @recovenum: + @recovtext: + */ + + /*!< -------- Object ID = ADRV903X_CPU_OBJID_IC_TXBBF Section Base Error Code = 0x0600------ @errcode: 0x0600 + @desc: BBF Tx Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_BBF_CAL_TX_ABORT_ERROR = (ADRV903X_CPU_BBF_TX_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x0601 + @desc: BBF Tx: Calibration Data Capture Aborted + @maincause: Tx Going Lower or Higher Priority + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Calibration + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_BBF_CAL_TX_LPBK_DIS_ERROR = (ADRV903X_CPU_BBF_TX_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x0602 + @desc: BBF Tx: Insufficient Power measured at Loopback path + @maincause: Insufficient power measured at Loopback path + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_BBF_CAL_TX_FLATNESS_ERROR = (ADRV903X_CPU_BBF_TX_CAL_CODE_ERROR_START + 3u), /*!<@errcode: 0x0603 + @desc: BBF Tx: Base Band Filter was not Tuned to Achieve Flatness + @maincause: Algorithm unable to converge on Tuning Capacitor Values + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Rerun the Initial Calibration again. Contact ADI if the problem persists + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_BBF_CAL_TX_CAL_RESULTS_INVALID = (ADRV903X_CPU_BBF_TX_CAL_CODE_ERROR_START + 4u), /*!<@errcode: 0x0604 + @desc: BBF Tx: Invalid Data Captured by FSC Hardware + @maincause: FSC Hardware unable to Capture Correct Data + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Rerun the Initial Calibration again. Contact ADI if the problem persists + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_BBF_CAL_TX_CTRL_CMD_NOT_SUPPORTED = (ADRV903X_CPU_BBF_TX_CAL_CODE_ERROR_START + 5u), /*!<@errcode: 0x0605 + @desc: BBF Tx: Control Command Not Supported + @maincause: Invalid Control Command passed to BBF Tx Module + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Control Command is Supported + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_BBF_CAL_TX_CAP_ESTIMATE_HIGH = (ADRV903X_CPU_BBF_TX_CAL_CODE_ERROR_START + 6u), /*!<@errcode: 0x0606 + @desc: BBF Tx: Capacitor Estimate Higher than Threshold + @maincause: Calibration unable to Converge on Tuning Capacitor Values + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Calibration + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_BBF_CAL_TX_CAP_ESTIMATE_LOW = (ADRV903X_CPU_BBF_TX_CAL_CODE_ERROR_START + 7u), /*!<@errcode: 0x0607 + @desc: BBF Tx: Capacitor Estimate Lower than Threshold + @maincause: Calibration unable to Converge on Tuning Capacitor Values + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Calibration + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_BBF_CAL_TX_DATACAP_ERROR = (ADRV903X_CPU_BBF_TX_CAL_CODE_ERROR_START + 8u), /*!<@errcode: 0x0608 + @desc: BBF Tx: Hardware unable to Schedule/Complete Data Capture + @maincause: FSC Hardware unable to Capture Correct Data + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Calibration + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_BBF_CAL_TX_RANGE_ERROR = (ADRV903X_CPU_BBF_TX_CAL_CODE_ERROR_START + 9u), /*!<@errcode: 0x0609 + @desc: BBF Tx: Test Mode Range Error + @maincause: Tx Input Range is Out of Range + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Sample Clock Rate + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_BBF_CAL_CPU_SYNC_ERROR = (ADRV903X_CPU_BBF_TX_CAL_CODE_ERROR_START + 10u), /*!<@errcode: 0x060A + @desc: BBF Tx: CPU Synchronization Error + @maincause: Timeout Waiting for the Other CPU to Synchronize + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Whether Both Cores are Running + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_BBF_CAL_INVALID_FREQ_ADJUST_ERROR = (ADRV903X_CPU_BBF_TX_CAL_CODE_ERROR_START + 11u), /*!<@errcode: 0x060B + @desc: BBF Tx: Error adjusting invalid frequency + @maincause: Unable to adjust LO or Fbb by adjust value + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Re-run the Initial Calibration. Contact ADI if the problem persists + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_BBF_CAL_TX_CAP_NOT_FOUND = (ADRV903X_CPU_BBF_TX_CAL_CODE_ERROR_START + 12u), /*!<@errcode: 0x060C + @desc: BBF Tx: Unable to find capacitor for proper attenuation + @maincause: Calibration unable to Converge on Tuning Capacitor Values + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Calibration + @cause: + @recovenum: + @recovtext: + */ + + /*!< -------- Object ID = ADRV903X_CPU_OBJID_IC_TXLB_PATH_DLY Section Base Error Code = 0x0700 ------ @errcode: 0x0700 + @desc: Path Delay Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_PATH_DLY_CAL_USE_CASE_ERROR = (ADRV903X_CPU_PATH_DLY_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x0701 + @desc: Path Delay: Use case is not Currently Supported + @maincause: unsupported use case + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Check Use Case is Currently Supported + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_PATH_DLY_CAL_SELFCHECK_ERROR = (ADRV903X_CPU_PATH_DLY_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x0702 + @desc: Path Delay: Self Check Failure + @maincause: Estimated Delay Exceeds Margin + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_PATH_DLY_CAL_LIMIT_OBS_ERROR = (ADRV903X_CPU_PATH_DLY_CAL_CODE_ERROR_START + 3u), /*!<@errcode: 0x0703 + @desc: Path Delay:Number of observations more than the limit set + @maincause: Adjust algorithm Configuration Parameters to handle Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_PATH_DLY_CAL_XCORR_WAIT_TIMEOUT = (ADRV903X_CPU_PATH_DLY_CAL_CODE_ERROR_START + 4u), /*!<@errcode: 0x0704 + @desc: Path Delay: Cross-Correlation Timeout + @maincause: FSC was unable to Capture Data + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_PATH_DLY_CAL_XCORR_WAIT_ERROR = (ADRV903X_CPU_PATH_DLY_CAL_CODE_ERROR_START + 5u), /*!<@errcode: 0x0705 + @desc: Path Delay: Cross-Correlation Error + @maincause: FSC was unable to capture data + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Calibration + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_PATH_DLY_CAL_XCORR_GET_RESULTS_ERROR = (ADRV903X_CPU_PATH_DLY_CAL_CODE_ERROR_START + 6u), /*!<@errcode: 0x0706 + @desc: Path Delay: Cross-Correlation Get Results Error + @maincause: Unable to Get FSC Capture Results + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: + @recovenum: + @recovtext: + */ + + /*!< -------- Object ID = ADRV903X_CPU_OBJID_IC_TX_ATTEN_CAL Section Base Error Code = 0x0800 ------ @errcode: 0x0800 + @desc: TxAtten Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + + /*!< -------- Object ID = ADRV903X_CPU_OBJID_IC_HRM Section Base Error Code = 0x0900 ------ @errcode: 0x0900 + @desc: Tx HRM Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_TXHRM_CAL_NOT_RUN = (ADRV903X_CPU_HRM_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x0901 + @desc: Tx HRM: Warm Boot Error + @maincause: Initial Calibration must run successfully at least once before Warm Boot + @mainrecovenum:ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Tx HRM Initial Calibration + @cause: Unspecified HW Error occurred + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_TXHRM_CAL_DATACAP_ERROR = (ADRV903X_CPU_HRM_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x0902 + @desc: Tx HRM: Correlation Capture Error + @maincause: Timeout waiting for Data Capture to Complete + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Tx HRM Initial Calibration + @cause: FSC is in a bad state + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_TXHRM_CAL_CORR_WAIT_TIMEOUT = (ADRV903X_CPU_HRM_CAL_CODE_ERROR_START + 3u), /*!<@errcode: 0x0903 + @desc: Tx HRM: Auto-Correlation Timeout + @maincause: FSC was unable to Capture Data + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Tx HRM Initial Calibration + @cause: FSC is in a bad state + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_TXHRM_CAL_CORR_GET_RESULTS_ERROR = (ADRV903X_CPU_HRM_CAL_CODE_ERROR_START + 4u), /*!<@errcode: 0x0904 + @desc: Tx HRM: Auto-correlation Get Results + @maincause: Unable to Get FSC Capture Results + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Tx HRM Initial Calibration + @cause: FSC is in a bad state + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_TXHRM_CAL_INVALID_SEARCH_PARAM_ERROR = (ADRV903X_CPU_HRM_CAL_CODE_ERROR_START + 5u), /*!<@errcode: 0x0905 + @desc: Tx HRM: Invalid Delay Parameter + @maincause: Delay Parameter being searched does not exist + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Tx HRM Initial Calibration. Contact ADI if the problem persists + @cause: Invalid Delay Control Parameter + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Check Parameters and try again. Contact ADI if the problem persists + */ + ADRV903X_CPU_TXHRM_CAL_SEARCH_PARAM_OUT_OF_RANGE_ERROR = (ADRV903X_CPU_HRM_CAL_CODE_ERROR_START + 6u), /*!<@errcode: 0x0906 + @desc: Tx HRM: Delay Parameter Value is Out of Range + @maincause: Delay Parameter being searched is outside Min/Max limits specified + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Tx HRM Initial Calibration + @cause: Invalid Delay Control Data + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Check Parameters and try again. Contact ADI if the problem persists + */ + ADRV903X_CPU_TXHRM_CAL_SEARCH_ERROR = (ADRV903X_CPU_HRM_CAL_CODE_ERROR_START + 7u), /*!<@errcode: 0x0907 + @desc: Tx HRM: Delay Parameter search Error + @maincause: Did not find optimum value for delay Parameter. Target Performance not Achieved + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Tx HRM Initial Calibration + @cause: Invalid Delay Control Data + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Check Parameters and try again. Contact ADI if the problem persists + */ + ADRV903X_CPU_TXHRM_CAL_POWER_MEAS_ERROR = (ADRV903X_CPU_HRM_CAL_CODE_ERROR_START + 8u), /*!<@errcode: 0x0908 + @desc: Tx HRM: Fundamental Power Measurement Error + @maincause: Fundamental Power Measured is too Low + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Tx HRM Initial Calibration + @cause: Invalid Threshold Parameters + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Check Parameters and try again. Contact ADI if the problem persists + */ + ADRV903X_CPU_TXHRM_CAL_ZEROING_NO_FDAC_DETECTED = (ADRV903X_CPU_HRM_CAL_CODE_ERROR_START + 9u), /*!<@errcode: 0x0909 + @desc: Tx HRM: Zeroing Cal Error + @maincause: No optimum FDACP/FDACN detected + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Tx HRM Initial Calibration + @cause: Invalid parameters + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Check Parameters and try again. Contact ADI if the problem persists + */ + ADRV903X_CPU_TXHRM_CAL_BAD_CTRL_DATA_SZ = (ADRV903X_CPU_HRM_CAL_CODE_ERROR_START + 10u), /*!<@errcode: 0x090A + @desc: Tx HRM: Incorrect Number of bytes supplied to HRM Control Function + @maincause: API function supplied incorrect number of bytes to HRM Control Function + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check API call that supplied the parameters + @cause: Invalid parameters + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Check Parameters and try again. Contact ADI if the problem persists + */ + ADRV903X_CPU_TXHRM_CAL_CHAN_ERR = (ADRV903X_CPU_HRM_CAL_CODE_ERROR_START + 11u), /*!<@errcode: 0x090B + @desc: Tx HRM: Must choose only 1 channel for HRM Control Function + @maincause: API function supplied chnnel mask with more than one channel to HRM Control Function + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check API call that supplied the parameters + @cause: Invalid parameters + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Check Parameters and try again. Contact ADI if the problem persists + */ + /*!< -------- Object ID = ADRV903X_CPU_OBJID_IC_TXLOL Section Base Error Code = 0x0B00 ------ @errcode: 0x0B00 + @desc: Tx LOL Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_TXLOL_INIT_CAL_FSC_DATACAP_ERROR = ADRV903X_CPU_TXLOL_INIT_CAL_CODE_ERROR_START + 1u, /*!<@errcode: 0x0B01 + @desc: TxLol:Hardware unable to schedule/complete Data Capture + @maincause: FSC was unable to capture data + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Power measured at output is below threshold. Reset Device + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_TXLOL_CORE_INVALID_OBS_MODE_ERROR = ADRV903X_CPU_TXLOL_INIT_CAL_CODE_ERROR_START + 4u, /*! 16.22Ghz + @maincause: Incorrect Profile Configuration + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reconfigure Device to use at least 2 Lanes + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_SERDES_FG_CTLE_CLOSED_EYE = (ADRV903X_CPU_SERDES_CODE_ERROR_START + 18u), /*!<@errcode: 0x0C12 + @desc: SERDES: Initialization Calibration didn't find a Suitable CTLE Setting with an open eye + @maincause: Check serial Link integrity - No serial traffic present + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset JESD Link or Device, re-run Calibration, if the problem persists contact ADI + @cause: + @recovenum: + @recovtext: + */ + ADRV903X_CPU_FG_OFF_CTLE_ODAC_EXTREME = (ADRV903X_CPU_SERDES_CODE_ERROR_START + 19u), /*!<@errcode: 0x0C13 + @desc: SERDES: CTLE Offset DACs reached its limits + @maincause: Exceeded operating temperature Range or unexpected Hardware behavior + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device in a supported temperature region, if the problem persists contact ADI + @cause: + @recovenum: + @recovtext: + */ + + ADRV903X_CPU_SERDES_CAL_SEM_CREATE_FAILED = (ADRV903X_CPU_SERDES_CODE_ERROR_START + 20u), /*!<@errcode: 0x0C14 + @desc: SERDES: Semaphore Create Failed + @maincause: SERDES Internal OS Error failing to create the SERDES semaphore + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device and re-initialize the SERDES + @cause: + @recovenum: + @recovtext: + */ + /*!< -------- Object ID = ADRV903X_CPU_OBJID_IC_TXLB_FILTER Section Base Error Code = 0x0E00 ------ @errcode: 0x0E00 + @desc: TxLb Filter Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_TXLB_FILTER_CAL_RANGE_ERROR = (ADRV903X_CPU_TXLB_FILTER_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x0E01 + @desc: TxLb Filter: No Valid Capacitor Code Found + @maincause: Capacitor Code Range exceeded due to unexpected power measurement failures + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Reduce observed power measurement BW and re-run Calibration + */ + ADRV903X_CPU_TXLB_FILTER_CAL_DATACAP_ERROR = (ADRV903X_CPU_TXLB_FILTER_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x0E02 + @desc: TxLb Filter: Unexpected Data Capture Error + @maincause: Timed out Waiting for Data Capture to complete + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run TxLb Filter Calibration + */ + ADRV903X_CPU_TXLB_FILTER_CAL_NOT_RUN = (ADRV903X_CPU_TXLB_FILTER_CAL_CODE_ERROR_START + 3u), /*!<@errcode: 0x0E03 + @desc: TxLb Filter: Calibration not completed for this Channel + @maincause: User did not run TxLb Filter Calibration + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Run TxLb Filter Calibration for the desired channels + */ + + /*!< -------- Object ID = ADRV903X_CPU_OBJID_IC_TXRX_PHASE Section Base Error Code = 0x1100 ------ @errcode: 0x1100 + @desc: Tx/Rx Phase Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_TXRX_PHASE_XCORR_ERROR_1 = (ADRV903X_CPU_TXRX_PHASE_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x1101 + @desc: Tx/Rx Phase Calibration: Error performing phase measurement + @maincause: Unknown data capture error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Calibration + */ + ADRV903X_CPU_TXRX_PHASE_XCORR_ERROR_2 = (ADRV903X_CPU_TXRX_PHASE_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x1102 + @desc: Tx/Rx Phase Calibration: Error performing phase measurement + @maincause: Unknown data capture error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Calibration + */ + ADRV903X_CPU_TXRX_PHASE_WRONG_LO_COMBINATION = (ADRV903X_CPU_TXRX_PHASE_CAL_CODE_ERROR_START + 3u), /*!<@errcode: 0x1103 + @desc: Tx/Rx Phase Calibration: All the channels of the same CPU must either use the internal UHB LO or the external LO + @maincause: Follow guidelines for selecting the LO source + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Use the same LO source (internal or external) for all the channels + */ + /*!< -------- Object ID = ADRV903X_CPU_OBJID_IC_RXSPUR Section Base Error Code = 0x1200 ------ @errcode: 0x1200 + @desc: Rx ADC Spur Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_RXSPUR_CAL_RANGE_ERROR = (ADRV903X_CPU_RXSPUR_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x1201 + @desc: RxSpur: No Valid Actuator configuration found + @maincause: Rx Spur Actuator capbility exceeded + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: + */ + ADRV903X_CPU_RXSPUR_CAL_DATACAP_TIMEOUT_ERROR = (ADRV903X_CPU_RXSPUR_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x1202 + @desc: RxSpur: Data Capture Timeout Error + @maincause: Timed out Waiting for Data Capture to complete + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run RxSpur Calibration + */ + ADRV903X_CPU_RXSPUR_CAL_DATACAP_RESULT_ERROR = (ADRV903X_CPU_RXSPUR_CAL_CODE_ERROR_START + 3u), /*!<@errcode: 0x1203 + @desc: RxSpur: Unexpected Data Capture Error + @maincause: Failure to retrieve result of data capture + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run RxSpur Calibration + */ + ADRV903X_CPU_RXSPUR_INIT_CAL_NOT_RUN = (ADRV903X_CPU_RXSPUR_CAL_CODE_ERROR_START + 4u), /*!<@errcode: 0x1204 + @desc: RxSpur: Init Calibration not completed for this Channel + @maincause: User did not run RxSpur Init Calibration + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Run RxSpur Init Calibration for the desired channels + */ + ADRV903X_CPU_RXSPUR_CAL_NOT_SUPPORTED_ON_HW = (ADRV903X_CPU_RXSPUR_CAL_CODE_ERROR_START + 5u), /*!<@errcode: 0x1205 + @desc: RxSpur: Calibration not supported on current hardware + @maincause: Hardware revision does not support Rx Spur + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Do not execute RxSpur Calibration on current hardware + */ + ADRV903X_CPU_RXSPUR_NO_SPUR_FREQ = (ADRV903X_CPU_RXSPUR_CAL_CODE_ERROR_START + 6u), /*!<@errcode: 0x1206 + @desc: RxSpur: No spur frequency to cancel + @maincause: No spur frequency in passband + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Do not execute RxSpur Calibration on current profile channel + */ + ADRV903X_CPU_RXSPUR_IC_VARIANCE_ERR = (ADRV903X_CPU_RXSPUR_CAL_CODE_ERROR_START + 7u), /*!<@errcode: 0x1207 + @desc: RxSpur: Large variation detected in phase offset measurement + @maincause: Incorrect measurement + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run RxSpur Calibration + */ + ADRV903X_CPU_RXSPUR_INVALID_CUSTOM_SPUR_FREQ = (ADRV903X_CPU_RXSPUR_CAL_CODE_ERROR_START + 8u), /*!<@errcode: 0x1208 + @desc: RxSpur: Invalid custom spur frequency + @maincause: Custom spur frequency not in passband + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Configure custom spur frequency within passband + */ + ADRV903X_CPU_RXSPUR_FSC_UNLOCK_ERROR = (ADRV903X_CPU_RXSPUR_CAL_CODE_ERROR_START + 9u), /*!<@errcode: 0x1209 + @desc: RxSpur: Error sharing FSC hardware resources + @maincause: Unexpected Resource Sharing Error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Initialization Calibration before attempting to run tracking Calibration + */ + /*!< ----- Object ID = ADRV903X_CPU_OBJID_TC_RXQEC Section Base Error Code = 0x3000 ---- @errcode: 0x3000 + @desc: Rx QEC Tracking Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_RXQEC_CAL_SEARCH_ERROR = (ADRV903X_CPU_RXQEC_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x3001 + @desc: Rx QEC: Error during Signal Search + @maincause: Persistent signal-search HW unexpected Error when completing search + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Issue a CTRL RESET Command and re-run the Calibration + */ + ADRV903X_CPU_RXQEC_CAL_DATACAP_ERROR = (ADRV903X_CPU_RXQEC_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x3002 + @desc: Rx QEC: Error during Data Capture + @maincause: Persistent data-capture HW unexpected Error when completing capture + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Issue a CTRL RESET Command and re-run the Calibration + */ + ADRV903X_CPU_RXQEC_CAL_UPDATE_ERROR = (ADRV903X_CPU_RXQEC_CAL_CODE_ERROR_START + 3u), /*!<@errcode: 0x3003 + @desc: Rx QEC: Error during Core Update + @maincause: Persistent core computation unexpected Error when completing update + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Issue a CTRL RESET Command and re-run the Calibration + */ + ADRV903X_CPU_RXQEC_CAL_REFRESH_ERROR = (ADRV903X_CPU_RXQEC_CAL_CODE_ERROR_START + 4u), /*!<@errcode: 0x3004 + @desc: Rx QEC:Error during QEC filter refresh + @maincause: Persistent filter computation unexpected Error when completing QEC refresh + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Issue a CTRL RESET Command and re-run the Calibration + */ + + ADRV903X_CPU_RXQEC_CAL_SEARCH_BW_ERROR = (ADRV903X_CPU_RXQEC_CAL_CODE_ERROR_START + 5u), /*!<@errcode: 0x3005 + @desc: Rx QEC: Unsupported Use Case Error + @maincause: Number of Frequency bins per search band exceeds the maximum (32) supported by HW + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check the bandwidth Parameters in the use case or change the use case + */ + ADRV903X_CPU_RXQEC_CAL_GAIN_TABLE_ERROR = (ADRV903X_CPU_RXQEC_CAL_CODE_ERROR_START + 6u), /*!<@errcode: 0x3006 + @desc: Rx QEC: Unsupported Use Case Error + @maincause: Unable to support the Rx Gain table that was loaded on boot + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Change the Rx Gain table or update the firmware + */ + ADRV903X_CPU_RXQEC_CAL_DCN_SDELAY_ERROR = (ADRV903X_CPU_RXQEC_CAL_CODE_ERROR_START + 7u), /*!<@errcode: 0x3007 + @desc: Rx QEC: DC Notch Filter Start Delay too large + @maincause: Unsupported Configuration Parameters for DC notch filter + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check DC notch Configuration or update the firmware + */ + /*!< ----- Object ID = ADRV903X_CPU_OBJID_TC_TX_LOL Section Base Error Code = 0x3100 ---- @errcode: 0x3100 + @desc: Tx Lol Tracking Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_TXLOL_TRACK_CAL_NO_INIT = (ADRV903X_CPU_TXLOL_TRACK_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x3101 + @desc: Tx Lol: Cannot run Tracking Calibration without previously running Initialization Calibration + @maincause: Initialization Calibration was not run during initialization + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Run Initialization Calibration before attempting to run tracking Calibration + */ + ADRV903X_CPU_TXLOL_TRACK_CAL_RESOURCE_ERROR = (ADRV903X_CPU_TXLOL_TRACK_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x3102 + @desc: Tx Lol: Error sharing resources with Tx QEC Calibration + @maincause: Unexpected Resource Sharing Error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Initialization Calibration before attempting to run tracking Calibration + */ + ADRV903X_CPU_TXLOL_TRACK_CAL_FSC_DATACAP_ERROR = (ADRV903X_CPU_TXLOL_TRACK_CAL_CODE_ERROR_START + 3u), /*!<@errcode: 0x3103 + @desc: Tx Lol: Error capturing FSC data + @maincause: Unexpected Data Capture Error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Initialization Calibration before attempting to run tracking Calibration + */ + ADRV903X_CPU_TXLOL_TRACK_CAL_DATACAP_ABORT_ERROR = (ADRV903X_CPU_TXLOL_TRACK_CAL_CODE_ERROR_START + 4u), /*!<@errcode: 0x3104 + @desc: Tx Lol: Error capturing FSC data + @maincause: Data capture aborted due AGC over Range Error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Initialization Calibration before attempting to run tracking Calibration + */ + ADRV903X_CPU_TXLOL_TRACK_CAL_EXT_DATACAP_ERROR = (ADRV903X_CPU_TXLOL_TRACK_CAL_CODE_ERROR_START + 5u), /*!<@errcode: 0x3105 + @desc: Tx Lol: Error capturing data from External Tx LOL accumulator + @maincause: Unexpected Data Capture Error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Initialization Calibration before attempting to run tracking Calibration + */ + ADRV903X_CPU_TXLOL_TRACK_CAL_EXT_PATHDELAY_ERROR = (ADRV903X_CPU_TXLOL_TRACK_CAL_CODE_ERROR_START + 6u), /*!<@errcode: 0x3106 + @desc: Tx Lol: Invalid Tx-to-ORx Path Delay passed to External Tx LOL accumulator + @maincause: Unsupported use case, Invalid Configurator output, or Invalid user Configuration + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Ensure combined Configurator and user-adjusted Path Delay is between 0 and 250 + */ + ADRV903X_CPU_TXLOL_TRACK_CAL_EXT_NCO_ERROR = (ADRV903X_CPU_TXLOL_TRACK_CAL_CODE_ERROR_START + 7u), /*!<@errcode: 0x3107 + @desc: Tx Lol: ORx LOL NCO not configured properly to mix Tx LO to DC at accumulator Input + @maincause: LOL NCO not reconfigured properly when Tx LO or ORx NCO Frequency changed at run-time + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Disable LOL tracking Calibration, re-issue Tx LO and/or ORx NCO Frequency change Command, then re-enable LOL tracking Calibration + */ + ADRV903X_CPU_TXLOL_CAL_INVALID_LO_FREQUENCY_ERROR = (ADRV903X_CPU_TXLOL_TRACK_CAL_CODE_ERROR_START + 8u), /*!<@errcode: 0x3108 + @desc: Tx Lol: Lo Frequency violates Frequency planning conditions + @maincause: Lo Frequency coincides with Loopback/ORx Sampling frequencies + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Change Lo Frequency to avoid Overlap on Loopback/ORx bandwidth edge + */ + ADRV903X_CPU_TXLOL_CORE_CONVERGENCE_ERROR = (ADRV903X_CPU_TXLOL_TRACK_CAL_CODE_ERROR_START + 9u), /*!<@errcode: 0x3109 + @desc: Tx Lol: Model does not agree with incoming observation data, indicating the Calibration has diverged + @maincause: Unexpected Calibration divergence can occur when observation data is corrupted (e.g. External Loopback disconnected) + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Initialization Calibration before attempting to run tracking Calibration + */ + ADRV903X_CPU_TXLOL_CHANNEL_GAIN_ERROR = (ADRV903X_CPU_TXLOL_TRACK_CAL_CODE_ERROR_START + 10u), /*!<@errcode: 0x310A + @desc: Tx Lol: Tx-to-ORx channel gain estimate falls outside expected range + @maincause: Typically a Tx-to-ORx mapping problem (not observing the expected Tx channel) + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Fix external observation path, issue LOL channel reset command, and re-enable LOL tracking cal + */ + ADRV903X_CPU_TXLOL_LEAKAGE_ERROR = (ADRV903X_CPU_TXLOL_TRACK_CAL_CODE_ERROR_START + 11u), /*!<@errcode: 0x310B + @desc: Tx Lol: estimate leakage is too large or NaN, or estimate leakage variance is too small or NaN + @maincause: Typically an observation problem + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Fix external observation path, issue LOL channel reset command, and re-enable LOL tracking cal + */ + + + /*!< ----- Object ID = ADRV903X_CPU_OBJID_TC_TXQEC Section Base Error Code = 0x3200 ---- @errcode: 0x3200 + @desc: TxQEC Tracking Calibration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_TXQEC_CAL_DATACAP_ERROR = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 1u), /*!<@errcode: 0x3201 + @desc: Tx QEC: Correlation Capture Error + @maincause: Timed out waiting for Data Capture to complete + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Calibration + @cause: FSC is stuck + @recovenum: + */ + ADRV903X_CPU_TXQEC_CAL_NO_INIT_ERROR = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 2u), /*!<@errcode: 0x3202 + @desc: Tx QEC: Initial Calibration not done + @maincause: At least one of the required Initial Calibrations was not run + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Ensure that all required Initial Calibrations are run without Error + @cause: At least one of the Initial Calibrations was in Error + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Re-run the Initial Calibration in Error / Perform Warm Boot + */ + ADRV903X_CPU_TXQEC_CAL_SEARCH_ERROR = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 3u), /*!< @errcode: 0x3203 + @desc: Tx QEC: Error Initializing Frequency mask for signal search + @maincause: Some other Calibration is conflicting with Tx QEC signal search + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run TxQEC Tracking Calibration + @cause: Unspecified HW Error occurred during search + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @recovtext: Re-run TxQEC Tracking Calibration + */ + ADRV903X_CPU_TXQEC_CAL_SEARCH_BW_ERROR = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 4u), /*!< @errcode: 0x3204 + @desc: Tx QEC: Error Initializing Frequency mask for signal search + @maincause: Signal search mask overflow due to unsupported Configurator Parameters + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Current firmware doesn't support this Profile/use case, contact ADI for FW update + */ + ADRV903X_CPU_TXQEC_CAL_TOO_MANY_BANDS_ERROR = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 5u), /*!< @errcode: 0x3205 + @desc: Tx QEC: Error configuring Tx QEC to work over specified Tx bands + @maincause: Unsupported Configurator Parameters + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Current firmware doesn't support this Profile/use case, contact ADI for FW update + */ + ADRV903X_CPU_TXQEC_CAL_ACTUATOR_RANGE_ERROR = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 6u), /*!< @errcode: 0x3206 + @desc: Tx QEC: Error configuring Tx QEC actuator, not enough correction Range + @maincause: The current firmware can not correct quadrature Error of this Device as it is different than expected + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Contact ADI for a firmware update + @cause: Configurator output provides Invalid bandwidths, LO and Sampling Rate information + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @recovtext: Check Configurator output + */ + ADRV903X_CPU_TXQEC_CAL_DLY_CHECK__ERROR = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 7u), /*!< @errcode: 0x3207 + @desc: Tx QEC: Self Check Error, new coefficients increases group delay + @maincause: Data capture returning unexpected results + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Re-run the algorithm + @cause: Configuration Parameter not set correctly + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Check Configuration Parameters + */ + ADRV903X_CPU_TXQEC_CAL_INSUFFICIENT_TONE_POWER = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 8u), /*!< @errcode: 0x3208 + @desc: Low Tx tone power, possibly due to wrong tone Frequency or some other errors on Tx path + @maincause: TxQEC Initialization, insufficient tone power + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE + @mainrecovtext: TXQEC Initialization Re-Run, contact ADI for FW debug, if Error repeats + */ + ADRV903X_CPU_TXQEC_CAL_TOO_MANY_INTERFERERS_ERROR = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 9u), /*!< @errcode: 0x3209 + @desc: Detected too many potential interfering/aliasing signals in the LB path + @maincause: Number of significant interferences exceeds FW Setting. ADI anticipated this Error to not occur in field + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Contact ADI to disable reporting this Error, Calibration performance maybe reduced + @cause: This Error is Enabled from within FW + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE + @recovtext: ADI needs to change FW to increase Calibration performance, if customer is required to continue to operate under current carrier configurations + */ + ADRV903X_CPU_TXQEC_CAL_INVALID_LO_FREQUENCY_ERROR = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 10u), /*!<@errcode: 0x320A + @desc: Detected user programmed LO Frequency too close to one of interfering harmonic in the LB path + @maincause: User has changed the LO Frequency Setting at runtime. ADI anticipated this Error to occur less frequently + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Use formula provided by ADI to compute a valid LO Frequency, otherwise Calibration performance maybe severely reduced + */ + ADRV903X_CPU_TXQEC_CAL_LARGE_DC_NOTCH_SETTLE_TIME = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 11u), /*!<@errcode: 0x320B + @desc: Tx QEC:DC notch settling time too large + @maincause: Unsupported Configurator Parameters + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Current firmware doesn't support this Configuration, contact ADI for FW update + */ + ADRV903X_CPU_TXQEC_CAL_INNOV_CHECK_ERROR = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 12u), /*!<@errcode: 0x320C + @desc: Tx QEC:Calibration detected that the QEC model does not agree with the incoming observation data + @maincause: Calibration detected divergence due to a bad observation + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Perform QEC reset, or re-run Initialization Calibration, before re-enabling QEC tracking Calibration + */ + + ADRV903X_CPU_TXQEC_CAL_NAN_ERROR = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 13u), /*!<@errcode: 0x320D + @desc: Tx QEC:Calibration detected NaN in critical state data + @maincause: Unexpected NaN, possibly due to divide-by-zero + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Perform QEC reset, or re-run Initialization Calibration, before re-enabling QEC tracking Calibration + */ + ADRV903X_CPU_TXQEC_CAL_DAC_LB_TUNING_ERROR = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 14u), /*!<@errcode: 0x320E + @desc: Tx QEC:Error tuning LB filter bandwidth prior to DAC image tuning + @maincause: LB observation error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Initialization Calibration, before re-enabling QEC tracking Calibration + */ + ADRV903X_CPU_TXQEC_LBDC_AUTOCORR_ERROR_1 = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 15u), /*!<@errcode: 0x320F + @desc: LB DC tune: Error waiting for auto-corr capture + @maincause: Error in capturing the required data + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Calibration + */ + ADRV903X_CPU_TXQEC_LBDC_AUTOCORR_ERROR_2 = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 16u), /*!<@errcode: 0x3210 + @desc: LB DC tune: Error in getting auto-corr results + @maincause: Error in capturing the required data + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Re-run Calibration + */ + ADRV903X_CPU_TXQEC_LBDC_TIMEOUT_ERROR = (ADRV903X_CPU_TXQEC_CAL_CODE_ERROR_START + 17u), /*!<@errcode: 0x3211 + @desc: LB DC tune: Timeout waiting for the auto-corr capture to be done + @maincause: The data capture HW cannot collect the required data within a specific time interval + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: The cal will re-run automatically + */ + /*!< ---- Object ID = ADRV903X_CPU_OBJID_CFG_DEVICE_PROFILE Section Base Error Code = 0x8000 ---- @errcode: 0x8000 + @desc: Device Profile Configuration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_CFG_DEVICE_PROFILE_CRC_ERROR = (ADRV903X_CPU_CFG_DEVICE_PROFILE_ERROR_CODE_START + 1u),/*!<@errcode: 0x8001 + @desc: Device Profile: Failed CRC verification + @maincause: Programmed image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reprogram the Device Profile Image + */ + /*!< ---- Object ID = ADRV903X_CPU_OBJID_CFG_PARITY_ERROR_CHECK Section Base Error Code = 0x8500 ---- @errcode: 0x8500 + @desc: Device Profile Configuration + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_CFG_PARITY_DOUBLE_BIT_ERROR = (ADRV903X_CPU_CFG_PARITY_ERROR_CODE_START + 1u), /*!<@errcode: 0x8501 + @desc: Parity: Fatal 2bit Error + @maincause: Memory data is corrupted. Uncorrectable error. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: + */ + + /*!< ----- Object ID = ADRV903X_CPU_OBJID_DRV_NCO Section Base Error Code = 0xB000 ---- @errcode: 0xB000 + @desc: NCO + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_NCO_DRV_INVALID_FREQ = (ADRV903X_CPU_NCO_DRV_ERROR_CODE_START + 1u), /*!<@errcode: 0xB001 + @desc: NCO: Invalid Frequency Parameters + @maincause: Frequency not supported for Sampling Rate + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and NCO Frequency settings + */ + ADRV903X_CPU_NCO_DRV_INVALID_PHASE = (ADRV903X_CPU_NCO_DRV_ERROR_CODE_START + 2u), /*!<@errcode: 0xB002 + @desc: NCO: Invalid Phase Parameters + @maincause: Invalid Phase Offset Setting + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: NCO Phase Setting must be between 0 - 359 + */ + ADRV903X_CPU_NCO_DRV_INVALID_GAIN = (ADRV903X_CPU_NCO_DRV_ERROR_CODE_START + 3u), /*!<@errcode: 0xB003 + @desc: NCO: Invalid Gain Parameters + @maincause: Invalid Gain Setting + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: NCO I/Q Gain Setting is Invalid + */ + ADRV903X_CPU_NCO_DRV_INVALID_SELECT = (ADRV903X_CPU_NCO_DRV_ERROR_CODE_START + 4u), /*!<@errcode: 0xB004 + @desc: NCO: Band or type selection + @maincause: Invalid band or NCO selected + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Valid Value must be used for DDC or Datapath NCO + */ + ADRV903X_CPU_NCO_DRV_INVALID_DUAL_TONE = (ADRV903X_CPU_NCO_DRV_ERROR_CODE_START + 5u), /*!<@errcode: 0xB005 + @desc: NCO: Dual tone frequencies are out-of-Range + @maincause: Frequencies not supported for Sampling Rate + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and NCO Frequency settings + */ + ADRV903X_CPU_NCO_DRV_INVALID_MIXER_NCOSET = (ADRV903X_CPU_NCO_DRV_ERROR_CODE_START + 6u), /*!<@errcode: 0xB006 + @desc: NCO: Tx Mixer NCO Frequency can not be changed while TxTestTone Enabled + @maincause: Disable Test tone with TxTestToneSet() before calling TxNcoShifterSet() + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Check API Call Sequence + */ + + /*!< ---- Object ID = ADRV903X_CPU_OBJID_DRV_STREAM Section Base Error Code = 0xB100 --- @errcode: 0xB100 + @desc: Stream + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_STRM_DRV_INVALID_PARAM = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 1u), /*!<@errcode: 0xB101 + @desc: Stream: Invalid Input Parameters + @maincause: One or more Input Parameters are not valid + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_STRM_DRV_TIMEOUT = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 2u), /*!<@errcode: 0xB102 + @desc: Stream:Timer expired waiting for stream completion + @maincause: The stream Timeout can occur due to stream processor waiting for other streams to complete + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: The stream execution is timed out. Rerun the feature to recover from this Error. + */ + + ADRV903X_CPU_STRM_DRV_GENERAL_ERROR = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 3u), /*!<@errcode: 0xB103 + @desc: Stream: Triggered stream reported an Error + @maincause: The stream that is triggered either through firmware or API has generated an Error. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: The stream number being triggered should be checked. + */ + + ADRV903X_CPU_STRM_DRV_CRC_ERROR = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 4u), /*!<@errcode: 0xB104 + @desc: Stream: Failed CRC verification + @maincause: Programmed image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reprogram the stream image. + @cause: The failure could be due to bit errors in SPI interface. + @recovenum: + */ + ADRV903X_CPU_STRM_DRV_STM_REP_FIFO_ERROR = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 5u), /*!<@errcode: 0xB105 + @desc: Stream: Stream Processor reported a FIFO Error + @maincause: The stream FIFO is full. This could happen due to back to back streams being triggered. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Rerunning the feature could solve the issue. + */ + ADRV903X_CPU_STRM_DRV_STM_REP_EXT_TIMER_ERROR = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 6u), /*!<@errcode: 0xB106 + @desc: Stream: Stream Processor reported an External Timer Error + @maincause: External Timer started by stream Failed. This could fail if no External timers available. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Rerunning the feature could solve the issue. + */ + ADRV903X_CPU_STRM_DRV_STM_REP_INV_INSTR = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 7u), /*!<@errcode: 0xB107 + @desc: Stream: Stream Processor reported an Invalid instruction + @maincause: This could happen if the stream is corrupted or stream is generated wrongly + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream. + */ + ADRV903X_CPU_STRM_DRV_STM_REP_INV_AHB_ADDR = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 8u), /*!<@errcode: 0xB108 + @desc: Stream: Stream Processor reported an Invalid AHB address + @maincause: Wrong AHB address is accessed in the stream. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream. + */ + ADRV903X_CPU_STRM_DRV_STM_REP_INV_STREAM_NUM = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 9u), /*!<@errcode: 0xB109 + @desc: Stream: Stream Processor reported an Invalid stream number + @maincause: Invalid stream number called from stream or firmware + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream. + */ + ADRV903X_CPU_STRM_DRV_STM_REP_STACK_OVERFLOW = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 10u), /*!<@errcode: 0xB10A + @desc: Stream: Stream Processor reported a stack overflow + @maincause: Too many nested calls in the stream can cause this + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream. + */ + ADRV903X_CPU_STRM_DRV_STM_REP_TIMEOUT = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 11u), /*!<@errcode: 0xB10B + @desc: Stream: Stream Processor reported a Timeout Error + @maincause: The stream did not complete within the set Timeout period + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream. + */ + ADRV903X_CPU_STRM_DRV_STM_REP_CHECK_INSTR_ERROR = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 12u), /*!<@errcode: 0xB10C + @desc: Stream: Stream Processor reported a check instruction Error + @maincause: This could happen if a wrong instruction is used in the stream. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream. + */ + ADRV903X_CPU_STRM_DRV_STM_REP_INV_SPI_ADDR = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 13u), /*!<@errcode: 0xB10D + @desc: Stream: Stream Processor reported an Invalid SPI address + @maincause: Invalid SPI address accessed in the stream. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream. + */ + ADRV903X_CPU_STRM_DRV_PREV_STM_TIMEOUT = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 14u), /*!<@errcode: 0xB10E + @desc: Stream: Previous Stream didn't finish + @maincause: The previous stream started by the stream processor or firmware did not finish + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Rerun the feature if the problem persists, contact ADI to fix the stream Timeout. + */ + ADRV903X_CPU_STRM_DRV_FUNC_NOT_SUPPORTED = (ADRV903X_CPU_STREAM_DRV_ERROR_CODE_START + 15u), /*!<@errcode: 0xB10F + @desc: Stream: Function not supported + @maincause: The functionality is not yet supported. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream. + */ + + /*!< ---- Object ID = ADRV903X_CPU_OBJID_DRV_FSC Section Base Error Code = 0xB200 --- @errcode: 0xB200 + @desc: Fsc + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_FSC_USE_CASE_DEC_ERROR = (ADRV903X_CPU_FSC_DRV_ERROR_CODE_START + 1u), /*!<@errcode: 0xB201 + @desc: FSC: Cannot find FSC decimation rates to suit this use case + @maincause: Current Calibration Configuration does not support this use case + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Check for valid/supported use case. Firmware update may be required. + */ + ADRV903X_CPU_FSC_USE_CASE_CLK_ERROR = (ADRV903X_CPU_FSC_DRV_ERROR_CODE_START + 2u), /*!<@errcode: 0xB202 + @desc: FSC: Cannot find valid FSC clock Configuration to suit this use case + @maincause: This use case is not currently supported by the FSC and its Device driver + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Check for valid/supported use case. Firmware update may be required. + */ + ADRV903X_CPU_FSC_NESTED_CAPTURE_ERROR = (ADRV903X_CPU_FSC_DRV_ERROR_CODE_START + 3u), /*!<@errcode: 0xB203 + @desc: FSC: Attempted to start second FSC capture before the first had completed + @maincause: Firmware synchronization bug is causing a resource-sharing collision in the FSC + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @marinrecovtext: Attempt to restart the Calibration that reported this Error. + */ + ADRV903X_CPU_FSC_PHASE_COMP_CAL_ANALYSIS_ERROR = (ADRV903X_CPU_FSC_DRV_ERROR_CODE_START + 4u), /*!<@errcode: 0xB204 + @desc: FSC: Cannot find valid Phase compensation factor for LB NCOs + @maincause: Loopback Phase Calibration has Failed due to unexpected or noisy observation data + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Attempt to re-run Path Delay Calibration + */ + ADRV903X_CPU_FSC_PHASE_COMP_CAL_CAPTURE_ERROR = (ADRV903X_CPU_FSC_DRV_ERROR_CODE_START + 5u), /*!<@errcode: 0xB205 + @desc: FSC: Error capturing data for Phase Compensation Calibration + @maincause: Unexpected Data Capture failure + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Attempt to re-run Path Delay Calibration + */ + + /*!< ---- Object ID = ADRV903X_CPU_OBJID_DRV_MASTER_BIAS Section Base Error Code = 0xB300 ---- @errcode: 0xB300 + @desc: Master Bias + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_MASTER_BIAS_RB0_PTAT_CAL_FAILED = (ADRV903X_CPU_MASTER_BIAS_DRV_ERROR_CODE_START + 1u), /*!<@errcode: 0xB301 + @desc: Master Bias: RB0 Ptat Calibration Failed + @maincause: Unexpected failure in resistor trim logic, or no clock provided to trim logic + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_MASTER_BIAS_RB1_PTAT_CAL_FAILED = (ADRV903X_CPU_MASTER_BIAS_DRV_ERROR_CODE_START + 2u), /*!<@errcode: 0xB302 + @desc: Master Bias: RB1 Ptat Calibration Failed + @maincause: Unexpected failure in resistor trim logic, or no clock provided to trim logic + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_MASTER_BIAS_PTAT_R_TXBBF_INVALID = (ADRV903X_CPU_MASTER_BIAS_DRV_ERROR_CODE_START + 3u), /*!<@errcode: 0xB303 + @desc: Master Bias: Invalid Ptat resistor value for Tx BBF + @maincause: Ptat trim Calibration generated an out-of-Range result + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_MASTER_BIAS_PTAT_R_UPC_INVALID = (ADRV903X_CPU_MASTER_BIAS_DRV_ERROR_CODE_START + 4u), /*!<@errcode: 0xB304 + @desc: Master Bias: Invalid Ptat resistor value for UPC + @maincause: Ptat trim Calibration generated an out-of-Range result + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_MASTER_BIAS_PTAT_R_UPC_BIAS_INVALID = (ADRV903X_CPU_MASTER_BIAS_DRV_ERROR_CODE_START + 5u), /*!<@errcode: 0xB305 + @desc: Master Bias: Invalid Ptat resistor value for UPC BIAS + @maincause: Ptat trim Calibration generated an out-of-Range result + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_MASTER_BIAS_PTAT_R_VGA_INVALID = (ADRV903X_CPU_MASTER_BIAS_DRV_ERROR_CODE_START + 6u), /*!<@errcode: 0xB306 + @desc: Master Bias: Invalid Ptat resistor value for VGA + @maincause: Ptat trim Calibration generated an out-of-Range result + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + /*!< ---- Object ID = ADRV903X_CPU_OBJID_DRV_LDO Section Base Error Code = 0xB400 --- @errcode: 0xB400 + @desc: VCO LDO + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_VCO_LDO_LOWOUTPUT = (ADRV903X_CPU_LDO_DRV_ERROR_CODE_START + 1u), /*!<@errcode: 0xB401 + @desc: VCO LDO: LDO output voltage is below low side of target Range + @maincause: VCO LDO bypass capacitor is shorted to GND + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Check Bypass Capacitor & Soldering for Damage and/or Short. Contact ADI if the problem persists. + @cause: Unexpected LDO Hardware behavior + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: Reset Device and try again. Contact ADI if the problem persists + */ + + ADRV903X_CPU_VCO_LDO_UVL = (ADRV903X_CPU_LDO_DRV_ERROR_CODE_START + 2u), /*!<@errcode: 0xB402 + @desc: VCO LDO: Input supply voltage is below low side of target Range + @maincause: Input supply voltage is below undervoltage-lockout threshold + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Check the Input supply voltage and try again. Contact ADI if the problem persists. + */ + + ADRV903X_CPU_VCO_LDO_NOREF = (ADRV903X_CPU_LDO_DRV_ERROR_CODE_START + 3u), /*!<@errcode: 0xB403 + @desc: VCO LDO: Reference Input voltage below low side of target Range + @maincause: Unexpected Hardware behavior, reference Input voltage below low side of target Range + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + ADRV903X_CPU_VCO_LDO_THERMSDN = (ADRV903X_CPU_LDO_DRV_ERROR_CODE_START + 4u), /*!<@errcode: 0xB404 + @desc: VCO LDO: Temperature is above high side of target Range + @maincause: Temperature is above high side of target Range + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Check Heat Dissipation is at required level. Contact ADI if the problem persists. + @cause: Unexpected LDO Hardware behavior + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + ADRV903X_CPU_VCO_LDO_CURLIM = (ADRV903X_CPU_LDO_DRV_ERROR_CODE_START + 5u), /*!<@errcode: 0xB405 + @desc: VCO LDO: Load current is above high side of target Range dictated by VCO + @maincause: VCO LDO bypass capacitor is shorted to GND + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Check Bypass capacitor & soldering for damage/short. Contact ADI if the problem persists. + @cause: Unexpected LDO Hardware behavior + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + ADRV903X_CPU_VCO_LDO_OVERVOLT = (ADRV903X_CPU_LDO_DRV_ERROR_CODE_START + 6u), /*!<@errcode: 0xB406 + @desc: VCO LDO: LDO output voltage is above high side of target Range + @maincause: VCO LDO bypass capacitor is shorted to VDD + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Check board layout. Contact ADI if the problem persists. + @cause: Unexpected LDO Hardware behavior + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + ADRV903X_CPU_SHUNT_LDO_SLDO1P0_UV = (ADRV903X_CPU_LDO_DRV_ERROR_CODE_START + 7u), /*!<@errcode: 0xB407 + @desc: VCO LDO: 1.0V Shunt LDO: LDO output voltage is below low threshold + @maincause: PD bit = 1 or Rampup Bit = 0 or Master Bias/LCR is not up + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: Unexpected LDO Hardware behavior + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + ADRV903X_CPU_SHUNT_LDO_SLDO1P0_OV = (ADRV903X_CPU_LDO_DRV_ERROR_CODE_START + 8u), /*!<@errcode: 0xB408 + @desc: VCO LDO: 1.0V Shunt LDO: LDO output voltage is above high threshold + @maincause: PD bit = 1 or Unexpected Hardware behavior + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + + ADRV903X_CPU_SHUNT_LDO_SLDO1P0_POWER_NOT_OK = (ADRV903X_CPU_LDO_DRV_ERROR_CODE_START + 9u), /*!<@errcode: 0xB409 + @desc: VCO LDO: 1.0V Shunt LDO: LDO output voltage is out of regulation + @maincause: Unexpected Hardware behavior, under and over voltage status bits are set + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + + ADRV903X_CPU_SHUNT_LDO_SLDO0P8_POWER_NOT_OK = (ADRV903X_CPU_LDO_DRV_ERROR_CODE_START + 10u), /*!<@errcode: 0xB40A + @desc: VCO LDO: 0.8V Shunt LDO: LDO output voltage below the targeted threshold + @maincause: LDO output does not power up at all or it may need longer wait time to power up to the targeted threshold. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + ADRV903X_CPU_VCO_LDO_BAD_STATE = (ADRV903X_CPU_LDO_DRV_ERROR_CODE_START + 11u), /*!<@errcode: 0xB40B + @desc: VCO LDO: Unspecified VCO LDO Error + @maincause: Power Not Good & No Other LDO Status Flag is Indicating an Error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: Unexpected LDO Hardware behavior + @recovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @recovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + /*!< ---- Object ID = ADRV903X_CPU_OBJID_DRV_DWT Section Base Error Code = 0xB500 --- @errcode: 0xB500 + @desc: DWT + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_DWT_DRV_NOT_INITIALIZED = (ADRV903X_CPU_DWT_DRV_ERROR_CODE_START + 1u), /*!<@errcode: 0xB501 + @desc: DWT: Data Watchpoint and Trace (DWT) driver not initialized + @maincause: HW doesn't support the DWT the driver is expecting + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reprogram the Device using a Valid Package and try again. Contact ADI if the problem persists. + */ + + /*!< ---- Object ID = ADRV903X_CPU_OBJID_DRV_TEMP Section Base Error Code = 0xB600 --- @errcode: 0xB600 + @desc: Temperature + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_DEVTEMP_INVALID_AVGMASK_ERROR = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 1u), /*!<@errcode: 0xB601 + @desc: Temperature:HAL Invalid Average Mask + @maincause: Parameter out of Range + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Parameter should be > 0 and < 256, see adi_adrv903x_DevTempSensor_e in the API + */ + + ADRV903X_CPU_DEV_TEMP_SENSOR_TIMEOUT_TX0 = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 2u), /*!<@errcode: 0xB602 + @desc: Temperature: HAL Temp sensor for TX0 conversion Timeout + @maincause: Hardware was unable to acquire temperature Sample within time limit + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device, if the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_DEV_TEMP_SENSOR_TIMEOUT_TX1 = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 3u), /*!<@errcode: 0xB603 + @desc: Temperature: HAL Temp sensor for TX1 conversion Timeout + @maincause: Hardware was unable to acquire temperature Sample within time limit + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device, if the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_DEV_TEMP_SENSOR_TIMEOUT_TX2 = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 4u), /*!<@errcode: 0xB604 + @desc: Temperature: HAL Temp sensor for TX2 conversion Timeout + @maincause: Hardware was unable to acquire temperature Sample within time limit + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device, if the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_DEV_TEMP_SENSOR_TIMEOUT_TX3 = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 5u), /*!<@errcode: 0xB605 + @desc: Temperature: HAL Temp sensor for TX3 conversion Timeout + @maincause: Hardware was unable to acquire temperature Sample within time limit + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device, if the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_DEV_TEMP_SENSOR_TIMEOUT_TX4 = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 6u), /*!<@errcode: 0xB606 + @desc: Temperature: HAL Temp sensor for TX4 conversion Timeout + @maincause: Hardware was unable to acquire temperature Sample within time limit + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device, if the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_DEV_TEMP_SENSOR_TIMEOUT_TX5 = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 7u), /*!<@errcode: 0xB607 + @desc: Temperature: HAL Temp sensor for TX5 conversion Timeout + @maincause: Hardware was unable to acquire temperature Sample within time limit + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device, if the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_DEV_TEMP_SENSOR_TIMEOUT_TX6 = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 8u), /*!<@errcode: 0xB608 + @desc: Temperature: HAL Temp sensor for TX6 conversion Timeout + @maincause: Hardware was unable to acquire temperature Sample within time limit + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device, if the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_DEV_TEMP_SENSOR_TIMEOUT_TX7 = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 9u), /*!<@errcode: 0xB609 + @desc: Temperature: HAL Temp sensor for TX7 conversion Timeout + @maincause: Hardware was unable to acquire temperature Sample within time limit + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device, if the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_DEV_TEMP_SENSOR_TIMEOUT_CLKGEN = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 10u), /*!<@errcode: 0xB60A + @desc: Temperature: HAL Temp sensor for CLK Gen PLL conversion Timeout + @maincause: Hardware was unable to acquire temperature Sample within time limit + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device, if the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_DEV_TEMP_SENSOR_TIMEOUT_RF0 = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 11u), /*!<@errcode: 0xB60B + @desc: Temperature: HAL Temp sensor for RF0 PLL conversion Timeout + @maincause: Hardware was unable to acquire temperature Sample within time limit + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device, if the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_DEV_TEMP_SENSOR_TIMEOUT_RF1 = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 12u), /*!<@errcode: 0xB60C + @desc: Temperature: HAL Temp sensor for RF1 PLL conversion Timeout + @maincause: Hardware was unable to acquire temperature Sample within time limit + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device, if the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_DEV_TEMP_SENSOR_TIMEOUT_SERDES = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 13u), /*!<@errcode: 0xB60D + @desc: Temperature: HAL Temp sensor for SERDES PLL conversion Timeout + @maincause: Hardware was unable to acquire temperature Sample within time limit + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device, if the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_DEV_TEMP_SENSOR_INVALID_EN_ERROR = (ADRV903X_CPU_TEMP_ERROR_CODE_START + 14u), /*!<@errcode: 0xB60E + @desc: Temperature: HAL Invalid Temp sensor Enable bit + @maincause: Parameter out of Range + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Temp Sensor is not on the accessed core, see adi_adrv903x_DevTempSensor_e in the API + */ + + /*!< ---- Object ID = ADRV903X_CPU_OBJID_DRV_PLL Section Base Error Code = 0xB700 --- @errcode: 0xB700 + @desc: PLL + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_PLL_SYNTH_LOCK_FAILED_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 1u), /*!<@errcode: 0xB701 + @desc: PLL: Synthesizer Lock Failed + @maincause: Hardware Lock Detection Timeout + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Check External Clock Sources and Power Supply + */ + ADRV903X_CPU_PLL_RANGE_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 2u), /*!<@errcode: 0xB702 + @desc: PLL: User Input Frequency Out of Range + @maincause: Specified Frequency by the user was out of Range + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Ensure requested Input Frequency is in Range + */ + ADRV903X_CPU_PLL_INVALID_PLL_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 3u), /*!<@errcode: 0xB703 + @desc: PLL: User specified Invalid PLL type + @maincause: Specified PLL name by the user was incorrect + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Ensure the correct PLL is specified + */ + ADRV903X_CPU_PLL_NOT_ENABLED_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 4u), /*!<@errcode: 0xB704 + @desc: PLL: Selected PLL was Not Enabled + @maincause: Selected PLL not Enabled + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: This Error code is not used + */ + ADRV903X_CPU_PLL_VCO_CAL_FAILED_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 5u), /*!<@errcode: 0xB705 + @desc: PLL: VCO Calibration Failed + @maincause: Unexpected Hardware behavior, Hardware VCO Calibration Timeout + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_PLL_INVALID_LOOPFILTER_PARAM_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 6u), /*!<@errcode: 0xB706 + @desc: PLL: Invalid Loopfilter Parameters, Phase of BW out of Range. + @maincause: Specified Loopfilter Parameters out of Range + @mainrecovenum:ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check that the Input Parameters are in Range + */ + ADRV903X_CPU_PLL_CP_CAL_FAILED_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 7u), /*!<@errcode: 0xB707 + @desc: PLL: CP Calibration Failed + @maincause: Unexpected Hardware behavior, Hardware CP Calibration Timeout + @mainrecovenum:ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_PLL_BLEED_CAL_FAILED_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 8u), /*!<@errcode: 0xB708 + @desc: PLL: Bleed ramp Calibration Failed + @maincause: Unexpected Hardware behavior, Hardware Bleed Calibration Timeout + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_PLL_INVALID_RX_LEAF_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 9u), /*!<@errcode: 0xB709 + @desc: PLL: Invalid Rx Leaf Hardware Setting, the selected Frequency could not be realized. + @maincause: Specified RX Frequency could not be realized + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check that the Input Parameters are in Range + */ + ADRV903X_CPU_PLL_INVALID_TX_LEAF_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 10u), /*!<@errcode: 0xB70A + @desc: PLL: Invalid Tx Leaf Hardware Setting, the selected Frequency could not be realized. + @maincause: Specified TX Frequency could not be realized + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: This Error code is not used + */ + ADRV903X_PHASE_SYNC_INVALID_SETTING_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 11u), /*!<@errcode: 0xB70B + @desc: PLL: Phase Sync Invalid mode Setting + @maincause: Specified Phase Sync mode Invalid + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_PHASE_SYNC_TIMEOUT_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 12u), /*!<@errcode: 0xB70C + @desc: PLL: Phase Sync Timeout + @maincause: Phase Sync Calibration Timeout + @mainrecovenum:ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_PHASE_MISMATCH_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 13u), /*!<@errcode: 0xB70D + @desc: PLL:Phase Sync Phase Mismatch + @maincause: Phase Sync Golden Counter Mismatch + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_EXT_LO_IN_RANGE_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 14u), /*!<@errcode: 0xB70E + @desc: PLL: External LO Input Frequency out of Range + @maincause: Specified External LO Frequency out of Range + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Ensure Input Parameters are correct + */ + ADRV903X_CPU_PLL_SWEEPFAIL_ARM_TOO_FAST = (ADRV903X_CPU_PLL_ERROR_CODE_START + 15u), /*!<@errcode: 0xB70F + @desc: PLL: CLK Sweep Test Error + @maincause: CPU Clock is Too Fast + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_PLL_MUST_BE_IN_TEST_MODE = (ADRV903X_CPU_PLL_ERROR_CODE_START + 17u), /*!<@errcode: 0xB711 + @desc: PLL: Invalid Control Command + @maincause: PLL Module is not in Debug Mode + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Ensure Device is in correct state for Command + */ + ADRV903X_PHASE_GCNT_SDM_MCS_TIMEOUT = (ADRV903X_CPU_PLL_ERROR_CODE_START + 18u), /*!<@errcode: 0xB712 + @desc: PLL: GCNT SDM MCS Timeout + @maincause: GCNT SDM MCS Hardware Timeout + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_PHASE_GCNT_CLKGEN_MCS_TIMEOUT = (ADRV903X_CPU_PLL_ERROR_CODE_START + 19u), /*!<@errcode: 0xB713 + @desc: PLL: GCNT ClkGen MCS Timeout + @maincause: GCNT Clkgen MCS Hardware Timeout + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_PLL_FORCED_ALC_TIMEOUT = (ADRV903X_CPU_PLL_ERROR_CODE_START + 20u), /*!<@errcode: 0xB714 + @desc: PLL: Forced ALC Enable-Disable Timeout + @maincause: Forced ALC Enable-Disabled Hardware Timeout + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + ADRV903X_CPU_PLL_SET_MODULUS_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 21u), /*!<@errcode: 0xB715 + @desc: PLL: Unable to lookup and set the PLL modulus value + @maincause: Device clock must be divisable by 122.88 or 184.32 MHz + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check that device clock setting is supported + */ + ADRV903X_CPU_PLL_CLK_RATE_LIMIT_ERROR = (ADRV903X_CPU_PLL_ERROR_CODE_START + 22u), /*!<@errcode: 0xB716 + @desc: PLL: clock rate exceeded the design limit + @maincause: PLL clock rate must be < 250 MHz + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + /*!< ---- Object ID = ADRV903X_CPU_OBJID_DRV_JESD Section Base Error Code = 0xB800 --- !<@errcode: 0xB800 + @desc: JESD + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_JESD_DRV_FRM_LANE_OVERLAP_ERROR = (ADRV903X_CPU_JESD_ERROR_CODE_START + 1u), /*!<@errcode: 0xB801 + @desc: JESD: Serializer Lane Overlap + @maincause: Incorrect Serializer Lane assignment + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_DFRM_LANE_OVERLAP_ERROR = (ADRV903X_CPU_JESD_ERROR_CODE_START + 2u), /*!<@errcode: 0xB802 + @desc: JESD: Deserializer Lane Overlap + @maincause: Incorrect Deserializer Lane assignment + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_FRM_INVALID_SAMPRATE = (ADRV903X_CPU_JESD_ERROR_CODE_START + 3u), /*!<@errcode: 0xB803 + @desc: JESD: Framer Invalid Sample Rate + @maincause: Incorrect Framer Sample Rate in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_LKSH_INVALID_SAMPRATE = (ADRV903X_CPU_JESD_ERROR_CODE_START + 4u), /*!<@errcode: 0xB804 + @desc: JESD: Link sharing Invalid Sample Rate + @maincause: Incorrect Link sharing Sample Rate in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_DFRM_INVALID_SAMPRATE = (ADRV903X_CPU_JESD_ERROR_CODE_START + 5u), /*!<@errcode: 0xB805 + @desc: JESD: Deframer Invalid Sample Rate + @maincause: Incorrect Deframer Sample Rate in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_FRM_SYNC_PAD_CFG_INVALID = (ADRV903X_CPU_JESD_ERROR_CODE_START + 6u), /*!<@errcode: 0xB806 + @desc: JESD: Invalid Framer Sync Pad Configuration + @maincause: Incorrect Framer Sync pad Configuration provided + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_DFRM_SYNC_PAD_CFG_INVALID = (ADRV903X_CPU_JESD_ERROR_CODE_START + 7u), /*!<@errcode: 0xB807 + @desc: JESD:Invalid Deframer Sync Pad Configuration + @maincause: Incorrect Deframer Sync pad Configuration provided + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_FRM0_NOT_ENABLED = (ADRV903X_CPU_JESD_ERROR_CODE_START + 8u), /*!<@errcode: 0xB808 + @desc: JESD: Framer 0 must be Enabled + @maincause: Framer 0 is not used in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_FRM_INVALID_SPLXBAR_ENTRY = (ADRV903X_CPU_JESD_ERROR_CODE_START + 9u), /*!<@errcode: 0xB809 + @desc: JESD: Invalid Framer Sample Crossbar entry + @maincause: Invalid Framer Sample Crossbar entry in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_FRM_INVALID_LINK_LAYER_MODE = (ADRV903X_CPU_JESD_ERROR_CODE_START + 10u), /*!<@errcode: 0xB80A + @desc: JESD:Invalid Framer Link layer mode of Operation + @maincause: Invalid Framer mode Parameter in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_DFRM_INVALID_SPLXBAR_ENTRY = (ADRV903X_CPU_JESD_ERROR_CODE_START + 11u), /*!<@errcode: 0xB80B + @desc: JESD: Invalid Deframer Sample Crossbar entry + @maincause: Invalid Deframer Sample Crossbar entry in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_DFRM_INVALID_LINK_LAYER_MODE = (ADRV903X_CPU_JESD_ERROR_CODE_START + 12u), /*!<@errcode: 0xB80C + @desc: JESD: Invalid Deframer Link layer mode of Operation + @maincause: Invalid Deframer mode Parameter in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_FRM_S_NOT_POW2 = (ADRV903X_CPU_JESD_ERROR_CODE_START + 13u), /*!<@errcode: 0xB80D + @desc: JESD: Framer S Parameter is not a power of 2 + @maincause: Invalid Framer S Parameter in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_DFRM_S_NOT_POW2 = (ADRV903X_CPU_JESD_ERROR_CODE_START + 14u), /*!<@errcode: 0xB80E + @desc: JESD: Deframer S Parameter is not a power of 2 + @maincause: Invalid Deframer S Parameter in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_FRM_INVALID_CONFIG_DET = (ADRV903X_CPU_JESD_ERROR_CODE_START + 15u), /*!<@errcode: 0xB80F + @desc: JESD: Invalid Framer Configuration + @maincause: Invalid Framer Configuration detected by the JESD Hardware block + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_DRFM_INVALID_CONFIG_DET = (ADRV903X_CPU_JESD_ERROR_CODE_START + 16u), /*!<@errcode: 0xB810 + @desc: JESD: Invalid Deframer Configuration + @maincause: Invalid Deframer Configuration detected by the JESD Hardware block + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_LKSH_INVALID_SPLXBAR_ENTRY = (ADRV903X_CPU_JESD_ERROR_CODE_START + 17u), /*!<@errcode: 0xB811 + @desc: JESD: Invalid Sample Crossbar + @maincause: Invalid Link sharing Sample Crossbar entry in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_UNSUPPORTED_FREQ_DIV_RATIO = (ADRV903X_CPU_JESD_ERROR_CODE_START + 18u), /*!<@errcode: 0xB812 + @desc: JESD: Unsupported Frequency Divide Ratio + @maincause: Invalid Frequency Parameter in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_INVALID_FREQ_INPUT = (ADRV903X_CPU_JESD_ERROR_CODE_START + 19u), /*!<@errcode: 0xB813 + @desc: JESD: Invalid Frequency + @maincause: Invalid Frequency Parameter provided in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_FRM_NUM_OF_CONV_INVALID = (ADRV903X_CPU_JESD_ERROR_CODE_START + 20u), /*!<@errcode: 0xB814 + @desc: JESD: Invalid number of converters + @maincause: Invalid number of converters specified in the Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_SER_INVALID_LANE_SELECTED = (ADRV903X_CPU_JESD_ERROR_CODE_START + 21u), /*!<@errcode: 0xB815 + @desc: JESD: Invalid Serializer Lane selected + @maincause: Invalid Serializer Lane selected + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_SER_INVALID_LANE_PARAMETER = (ADRV903X_CPU_JESD_ERROR_CODE_START + 22u), /*!<@errcode: 0xB816 + @desc: JESD: Invalid Serializer Lane Parameter + @maincause: Invalid Serializer Lane Parameter + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_JESD_DRV_SER_CLK_OFFSET_CAL_FAILURE = (ADRV903X_CPU_JESD_ERROR_CODE_START + 23u), /*!<@errcode: 0xB817 + @desc: JESD: Serializer Clock offset calibration failed + @maincause: JESD: Serializer Clock offset calibration failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + /*!< ---- Object ID = ADRV903X_CPU_OBJID_DRV_UART Section Base Error Code = 0xB900 --- @errcode: 0xB900 + @desc: UART + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_UART_DRV_INVALID_SCLK_FREQ = (ADRV903X_CPU_UART_ERROR_CODE_START + 1u), /*!<@errcode: 0xB901 + @desc: UART: Invalid SCLK Frequency + @maincause: SCLK is too low for configured UART bit Rate, check Device clock Settings + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Increase SCLK Frequency and try again. + */ + + + /*!< ---- Object ID = ADRV903X_CPU_OBJID_DRV_TXATTEN Section Base Error Code = 0xBA00 --- @errcode: 0xBA00 + @desc: Tx Attenuation Driver + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_TXATTEN_DRV_WRONG_SPI_MODE_ERROR = (ADRV903X_CPU_TXATTEN_ERROR_CODE_START + 1u), /*!<@errcode: 0xBA01 + @desc: TxAttenDrv: Must be in SPI mode to accesses this mode + @maincause: Invalid Tx attenuation mode selected + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Select SPI Mode before changing Tx Attenuation + */ + ADRV903X_TXATTEN_DRV_INVALID_HP_VALUE_ERROR = (ADRV903X_CPU_TXATTEN_ERROR_CODE_START + 2u), /*!<@errcode: 0xBA02 + @desc: TxAttenDrv: Invalid HP attenuation value, attenuation max exceeded + @maincause: Invalid HP attenuation value + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Select HP value within Range + */ + + /*!< ---- Object ID = ADRV903X_CPU_OBJID_DRV_TXLOL Section Base Error Code = 0xBB00 --- @errcode: 0xBB00 + @desc: TxLolDrv + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_TXLOL_DRV_NESTED_ACCUM_ERROR = (ADRV903X_CPU_TXLOL_DRV_ERROR_CODE_START + 1u), /*!<@errcode: 0xBB01 + @desc: TxLolDrv: Attempted second accumulation before the first completed + @maincause: Tx LOL Calibration state machine bug + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Stop and restart TxLOL tracking Calibration + */ + ADRV903X_TXLOL_DRV_HALT_ERROR = (ADRV903X_CPU_TXLOL_DRV_ERROR_CODE_START + 2u), /*!<@errcode: 0xBB02 + @desc: TxLolDrv: Attempted to read results before accumulator had halted + @maincause: Tx LOL Calibration firmware/Hardware handshake problem + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Stop and restart TxLOL tracking Calibration + */ + ADRV903X_TXLOL_DRV_CLK_CONFIG_NOT_SUPPORTED = (ADRV903X_CPU_TXLOL_DRV_ERROR_CODE_START + 4u), /*!<@errcode: 0xBB04 + @desc: TxLolDrv: Cannot configure TX LOL clock faster than ORX LOL clock + @maincause: External Tx LOL observations not supported with the current Profile + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Device Profile and restart the Device + */ + ADRV903X_TXLOL_DRV_ORX_CHAN_ERROR = (ADRV903X_CPU_TXLOL_DRV_ERROR_CODE_START + 5u), /*!<@errcode: 0xBB05 + @desc: TxLolDrv:Observation Channel is unsupported + @maincause: External Tx LOL observations do not support this ORx Channel + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check TX to ORx mapping + */ + /*!< ---- Object ID = ADRV903X_CPU_OBJID_DRV_GPIO Section Base Error Code = 0xBD00 --- @errcode: 0xBD00 + @desc: Gpio Driver + @maincause: + @mainrecovenum: + @separator: true + */ + + ADRV903X_GPIO_DRV_INVALID_SIGNAL_ID = (ADRV903X_CPU_GPIO_DRV_ERROR_CODE_START + 1u), /*!<@errcode: 0xBD01 + @desc: GpioDrv: Invalid signal ID provided + @maincause: Invalid signal ID provided + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_GPIO_DRV_INVALID_PIN_ID = (ADRV903X_CPU_GPIO_DRV_ERROR_CODE_START + 2u), /*!<@errcode: 0xBD02 + @desc: GpioDrv: Invalid GPIO pin number provided + @maincause: Invalid GPIO pin number provided + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + ADRV903X_CPU_DDCC_DRV_INIT_ERR = (ADRV903X_CPU_DDCC_DRV_ERROR_CODE_START + 1u), /*!<@errcode: 0xF101 + @desc: DDCC: HW in unexpected state + @maincause: DDCC HW error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reprogram the Device using a Valid Package and try again. Contact ADI if the problem persists. + */ + + ADRV903X_CPU_DDCC_DRV_SM_ERR = (ADRV903X_CPU_DDCC_DRV_ERROR_CODE_START + 2u), /*!<@errcode: 0xF102 + @desc: DDCC: HW SM in unexpected state + @maincause: DDCC HW State Machine error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reprogram the Device using a Valid Package and try again. Contact ADI if the problem persists. + */ + + ADRV903X_CPU_DDCC_DRV_CM_ERR = (ADRV903X_CPU_DDCC_DRV_ERROR_CODE_START + 3u), /*!<@errcode: 0xF103 + @desc: DDCC: CAL Filter CM in unexpected state + @maincause: DDCC HW CAL Filter CM error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reprogram the Device using a Valid Package and try again. Contact ADI if the problem persists. + */ + + /*!< --- Object ID = ADRV903X_CPU_OBJID_SYSTEM_ERROR Section Base Error Code = 0xFF00 --- @errcode: 0xFF00 + @desc: System + @maincause: + @mainrecovenum: + @separator: true + */ + ADRV903X_CPU_SYSTEM_GP_TIMER_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 1u), /*!<@errcode: 0xFF01 + @desc: System: General-Purpose Timer Error + @maincause: Software Timer allocation failure. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_MAILBOX_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 2u), /*!<@errcode: 0xFF02 + @desc: System: Generic Mailbox Error + @maincause: Unspecified Mailbox Error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_MAILBOX_BUSY = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 3u), /*!<@errcode: 0xFF03 + @desc: System: Mailbox Busy Error + @maincause: The requested Mailbox Hardware is in use and cannot receive commands + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Rerun feature. If the problem persists reset and try again. Contact ADI if the problem persists. + */ + ADRV903X_CPU_SYSTEM_MAILBOX_INVALID_HANDLE = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 4u), /*!<@errcode: 0xFF04 + @desc: System: Invalid Mailbox Handle + @maincause: Mailbox Operation requested on an Invalid Mailbox + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_MAILBOX_INVALID_LINK_NUMBER = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 5u), /*!<@errcode: 0xFF05 + @desc: System: Invalid Mailbox Link Number + @maincause: Mailbox Operation requested on an Invalid Mailbox Link + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_MAILBOX_LINK_BUSY = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 6u), /*!<@errcode: 0xFF06 + @desc: System: Mailbox Link busy + @maincause: The requested Mailbox Link is in use and cannot receive commands + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Rerun feature. If the problem persists reset and try again. Contact ADI if the problem persists. + */ + ADRV903X_CPU_SYSTEM_MAILBOX_CMD_TOO_LARGE = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 7u), /*!<@errcode: 0xFF07 + @desc: System: Mailbox Command too large for Link buffer + @maincause: Command payload is unexpectedly too large for Mailbox buffer + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_MAILBOX_CMD_BAD_TID = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 8u), /*!<@errcode: 0xFF08 + @desc: System: Mailbox Command Invalid transaction ID + @maincause: Mailbox received a Command with an Invalid transaction ID, most likely a duplicate Command. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Rerun feature. If the problem persists reset and try again. Contact ADI if the problem persists. + */ + ADRV903X_CPU_SYSTEM_INVALID_CPU_ID = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 9u), /*!<@errcode: 0xFF09 + @desc: System: Invalid CPU ID specified + @maincause: Given CPU ID Parameter is Invalid. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reprogram the CPU firmware image. If the problem persists contact ADI + */ + ADRV903X_CPU_SYSTEM_NULL_PTR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 10u), /*!<@errcode: 0xFF0A + @desc: System: Null Pointer Detected + @maincause: Programmed image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reprogram the CPU firmware image. If the problem persists contact ADI + */ + ADRV903X_CPU_SYSTEM_TASK_CREATE_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 11u), /*!<@errcode: 0xFF0B + @desc: System: O/S Task Create Error + @maincause: Invalid Parameters passed to the Task Create API + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_CAPTURE_RAM_LOCK_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 12u), /*!<@errcode: 0xFF0C + @desc: System: RAM Lock Error + @maincause: RAM Lock Procedure not followed for Data Capture + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_CAPTURE_RAM_UNLOCK_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 13u), /*!<@errcode: 0xFF0D + @desc: System: RAM Unlock Error + @maincause: RAM Unlock Procedure not followed for Data Capture + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_CTRL_CMD_ARG_INVALID = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 14u), /*!<@errcode: 0xFF0E + @desc: System: Invalid Control Command Argument + @maincause: Invalid Control Command Argument + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Verify Command Argument is correct and try again. + */ + ADRV903X_CPU_SYSTEM_INIT_CAL_INIT_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 15u), /*!<@errcode: 0xFF0F + @desc: System: Initialization Calibration Startup Error + @maincause: Initialization Calibration Startup Error + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_INIT_CAL_ABORTED_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 20u), /*!<@errcode: 0xFF14 + @desc: System: Aborted Initialization Calibration + @maincause: Initialization Calibration was Aborted by Command + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Rerun the Initialization Calibrations + */ + ADRV903X_CPU_SYSTEM_INIT_CAL_WARM_BOOT_CHKSUM_ERROR= (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 21u), /*!<@errcode: 0xFF15 + @desc: System: Initialization Calibration Warm Boot Checksum Error + @maincause: Initialization Calibration Warm Boot Data Image is corrupted + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Rerun Initialization Calibration + */ + ADRV903X_CPU_SYSTEM_INIT_CAL_INV_CHAN_MASK_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 22u), /*!<@errcode: 0xFF16 + @desc: System: Initialization Calibration Invalid Channel mask Error + @maincause: Channel numbers that are not Enabled in the Profile are selected in the Channel mask + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Rerun the Initialization Calibration with correct Channel mask + */ + ADRV903X_CPU_SYSTEM_INIT_CAL_INV_CAL_MASK_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 23u), /*!<@errcode: 0xFF17 + @desc: System: Initialization Calibration Invalid Calibration mask Error + @maincause: The Initialization Calibration mask might have unsupported Calibrations + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Rerun the Initialization Calibration with correct Calibration mask + */ + ADRV903X_CPU_SYSTEM_INIT_CAL_ALREADY_IN_PROGRESS = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 24u), /*!<@errcode: 0xFF18 + @desc: System: Initialization Calibration Busy + @maincause: Initialization Calibration Command is sent again while one is in progress + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Make sure not to send the Initialization Calibration Command while one is in progress. + */ + ADRV903X_CPU_SYSTEM_EFUSE_PROFILE_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 25u), /*!<@errcode: 0xFF19 + @desc: System: Profile Checksum Failed or bad Profile wrt to EFUSE + @maincause: The Device Profile image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reprogram the Device Profile image. If the problem persists contact ADI + */ + ADRV903X_CPU_SYSTEM_EFUSE_PRODUCT_ID_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 26u), /*!<@errcode: 0xFF1A + @desc: System: Profile product ID doesn't match Profile product ID + @maincause: The Device Profile is not valid for this Product + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Reprogram the Device with a Valid Profile Image. If the problem persists contact ADI + */ + ADRV903X_CPU_SYSTEM_EVENT_CREATE_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 28u), /*!<@errcode: 0xFF1C + @desc: System: Could not create the event + @maincause: Invalid Event Parameters are passed to the OS call + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_QUEUE_CREATE_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 29u), /*!<@errcode: 0xFF1D + @desc: System: Could not create the Queue + @maincause: Invalid Queue Parameters are passed to the OS call + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_TIMER_CREATE_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 30u), /*!<@errcode: 0xFF1E + @desc: System: Could not create the Timer + @maincause: Invalid Timer Parameters are passed to the OS call. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_QUEUE_POST_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 31u), /*!<@errcode: 0xFF1F + @desc: System: Failed to post the message + @maincause: Message Queue Full + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_QUEUE_RECV_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 32u), /*!<@errcode: 0xFF20 + @desc: System: Failed to receive the message + @maincause: Invalid Queue Parameters are passed to the OS call + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_TASK_DOES_NOT_EXIST = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 36u), /*!<@errcode: 0xFF24 + @desc: System: Commands sent to task that does not exist + @maincause: This can happen if a Command is sent to a Channel that is not Enabled in the Profile or disabled. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Rerun the feature with the correct Channel mask. + */ + ADRV903X_CPU_SYSTEM_CTRL_TASK_INVALID_MSG = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 37u), /*!<@errcode: 0xFF25 + @desc: System: Invalid Control Command + @maincause: Invalid Control Command Received + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Rerun the feature with the correct Command. + */ + ADRV903X_CPU_SYSTEM_INSUFFICIENT_MEMORY = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 38u), /*!<@errcode: 0xFF26 + @desc: System: Insufficient Memory available for the Requested Operation + @maincause: This can happen if an insufficient buffer size is sent for a Command. For example get Configuration or get Calibration status. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Rerun the Command with the correct buffer size allocated. + */ + ADRV903X_CPU_SYSTEM_CTRL_FUNC_NOT_SUPPORTED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 39u), /*!<@errcode: 0xFF27 + @desc: System: Invalid Calibration Control Command + @maincause: Invalid Control Command Sent to Calibration + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Rerun the Calibration with the Correct Control Command + */ + ADRV903X_CPU_SYSTEM_SET_CONFIG_FUNC_NOT_SUPPORTED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 40u), /*!<@errcode: 0xFF28 + @desc: System: Invalid Calibration Set Configuration + @maincause: Invalid Set Configuration sent to Calibration + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Ensure Input Parameters are correct + */ + ADRV903X_CPU_SYSTEM_GET_CONFIG_FUNC_NOT_SUPPORTED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 41u), /*!<@errcode: 0xFF29 + @desc: System: Invalid Calibration Get Configuration + @maincause: Invalid Get Configuration sent to Calibration + @mainrecovenum:ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Ensure Input Parameters are correct + */ + ADRV903X_CPU_SYSTEM_STATUS_FUNC_NOT_SUPPORTED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 42u), /*!<@errcode: 0xFF2A + @desc: System: Invalid Calibration Get Status Command + @maincause: Invalid Get Status Command sent to Calibration + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Control Command is Supported + */ + ADRV903X_CPU_SYSTEM_INVALID_CHANNEL_MASK = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 43u), /*!<@errcode: 0xFF2B + @desc: System: The given Channel is not Enabled in the Profile + @maincause: This can happen if a Channel is not Enabled in the Profile is getting Enabled or disabled. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Ensure Input Parameters are correct + */ + ADRV903X_CPU_SYSTEM_INVALID_CONFIG_OBJECT = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 44u), /*!<@errcode: 0xFF2C + @desc: System: Invalid Configuration Object + @maincause: Invalid Set Configuration Command for Configuration Object ID + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Ensure Input Parameters are correct + */ + ADRV903X_CPU_SYSTEM_INVALID_CONFIG_SIZE = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 45u), /*!<@errcode: 0xFF2D + @desc: System: Invalid Configuration Data Size + @maincause: Invalid Configuration Data Size for Module Configuration Buffer Size + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Ensure Input Parameters are correct + */ + ADRV903X_CPU_SYSTEM_INVALID_CONFIG_OFFSET = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 46u), /*!<@errcode: 0xFF2E + @desc: System: Invalid Configuration Offset + @maincause: Invalid Offset Sent with Configuration Command + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Ensure Input Parameters are correct + */ + ADRV903X_CPU_SYSTEM_INVALID_CONFIG_STATE = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 47u), /*!<@errcode: 0xFF2F + @desc: System: Invalid Configuration State + @maincause: Cannot Update Configuration while Initialization Calibrations are Running + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Rerun the Configuration Command after the Initialization Calibrations are complete. + */ + ADRV903X_CPU_SYSTEM_HAL_FUNC_NOT_IMPLEMENTED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 81u), /*!<@errcode: 0xFF51 + @desc: System: CPU HAL Feature not Implemented + @maincause: CPU HAL Feature not Implemented + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_HAL_INVALID_CHANNEL = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 82u), /*!<@errcode: 0xFF52 + @desc: System: HAL Invalid Channel + @maincause: Invalid Channel Configuration in Profile or an Invalid Channel requested + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Verify Channel Configuration and reprogram the Device Profile Image + */ + ADRV903X_CPU_SYSTEM_HAL_INVALID_LO_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 83u), /*!<@errcode: 0xFF53 + @desc: System: HAL Invalid LO + @maincause: Invalid PLL chosen for LO. This could be due to corrupted program memory + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_AHB_COMMON_INVALID_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 84u), /*!<@errcode: 0xFF54 + @desc: System: AHB (Common) Error detected + @maincause: Invalid SPI address access either an Invalid address or span of registers + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Verify address and Range are correct for the SPI region being accessed + */ + ADRV903X_CPU_SYSTEM_AHB_CPU0_INVALID_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 85u), /*!<@errcode: 0xFF55 + @desc: System: AHB (CPU0) Error detected + @maincause: CPU0 accessing Invalid memory address or Range + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_SYSTEM_AHB_CPU1_INVALID_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 86u), /*!<@errcode: 0xFF56 + @desc: System: AHB (CPU1) Error detected + @maincause: CPU1 accessing Invalid memory address or Range + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_SYSTEM_INTERNAL_MCS_FAILED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 87u), /*!<@errcode: 0xFF57 + @desc: System: Internal Multi-chip Sync (MCS) Failed to complete + @maincause: MCS Hardware did not complete synchronization in the allotted time + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_SECONDARY_CPU_BOOT_FAILED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 88u), /*!<@errcode: 0xFF58 + @desc: System:Primary CPU detected secondary CPU(s) boot failure + @maincause: Secondary core not completing boot + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_UTIL_TIMER_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 89u), /*!<@errcode: 0xFF59 + @desc: System: Utilities Timer Internal Error + @maincause: RTOS Task Scheduler not running for Timer request + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_LOGEN_INVALID_LO_CONFIG = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 90u), /*!<@errcode: 0xFF5A + @desc: System: LOGEN Invalid LO Input/Output Configuration + @maincause: User selected an Invalid LOGEN Configuration, verify Device Profile/Configurator settings + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Ensure Input Parameters are correct + */ + ADRV903X_CPU_SYSTEM_FORCE_EXCEPTION_COMMAND = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 92u), /*!<@errcode: 0xFF5C + @desc: System: Intentional crash, from force exception Command + @maincause: API Command sent to force an exception in the CPU + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: This is a deliberate forced Error + */ + ADRV903X_CPU_SYSTEM_CONFIG_LOCKED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 93u), /*!<@errcode: 0xFF5D + @desc: System: Configuration locked, for updating + @maincause: The Configuration is not unlocked before sending the Configuration Command + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Unlock the Configuration and resend the Configuration Command + */ + ADRV903X_CPU_SYSTEM_CONFIG_KEY_MISMATCH = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 94u), /*!<@errcode: 0xFF5E + @desc: System: The given key to unlock Configuration did not match with the key in current package + @maincause: The Configuration key did not match required key to unlock + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Use the correct key given by ADI and try to unlock the Configuration again + */ + ADRV903X_CPU_SYSTEM_CONFIG_LIMIT_REACHED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 95u), /*!<@errcode: 0xFF5F + @desc: System: Number of Configuration update limit reached + @maincause: Reached the limit of the number Configuration commands allowed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset the Device to send new set of Configuration Parameters + */ + ADRV903X_CPU_SYSTEM_DBG_KEY_MISMATCH = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 96u), /*!<@errcode: 0xFF60 + @desc: System: The given key to enter debug mode did not match with the key to enter debug mode + @maincause: The debug key did not match required key to unlock. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Try to send the Command again with the right Debug key. Contact ADI to get the correct key if the problem persists. + */ + ADRV903X_CPU_SYSTEM_CTRL_CMD_LENGTH_INVALID = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 97u), /*!<@errcode: 0xFF61 + @desc: System: The Set Control Command length is less than expected or greater than max data size allowed + @maincause: The control Command buffer is greater than the supported size + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Change the size of the control Command payload or increase the control Command buffer size. + */ + ADRV903X_CPU_SYSTEM_WATCHDOG_EXPIRED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 98u), /*!<@errcode: 0xFF62 + @desc: System: Watchdog Timer expired, system is unresponsive + @maincause: Not all firmware tasks completed in the expected time frame. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Collect memory dump to provide debug information and reset Device. + @cause: Not all firmware tasks completed in the expected time frame, possibly due to bad Parameters + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @recovtext: Collect memory dump to provide debug information, verify that all Calibrations and commands have valid Parameters, and reset Device. + */ + ADRV903X_CPU_SYSTEM_SHARED_MEM_MUTEX_TIMEOUT = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 99u), /*!<@errcode: 0xFF63 + @desc: System: Shared memory Mutex Timeout + @maincause: This could happen if the shared Mutex cannot be obtained within the Timeout period + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_SWBKPT_INVALID_TABLE_INDEX = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 100u), /*!<@errcode: 0xFF64 + @desc: System: The given index to the SW Breakpoint Table is out of Range + @maincause: Unexpected SW Breakpoint Table Index + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_SHARED_MEM_MUTEX_TAKEN_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 101u), /*!<@errcode: 0xFF65 + @desc: System: Shared memory Mutex already taken + @maincause: This could happen if trying to take the Mutex which is already taken + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_SHARED_MEM_MUTEX_RELEASE_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 102u), /*!<@errcode: 0xFF66 + @desc: System: Shared memory Mutex released without owning it + @maincause: This could happen if trying to release the Mutex which is not owned + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_UNSUPPORTED_CHANS_PER_CPU_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 103u), /*!< @errcode: 0xFF67 + @desc: System: This system is being configured to support too many channels per CPU + @maincause: This is a Configurator Channel enable issue + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Check the Profile and the Configurator logic + */ + ADRV903X_CPU_SYSTEM_INVALID_STATUS_SIZE = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 104u), /*!<@errcode: 0xFF68 + @desc: System: The given status size is Invalid + @maincause: The user requested the status size larger than supported size. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Change the size of the status Command buffer size. + */ + ADRV903X_CPU_SYSTEM_STARTUP_TIMEOUT_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 105u), /*!<@errcode: 0xFF69 + @desc: System: Initialization and tracking start-up functions still running + @maincause: The Control task waits a predefined amount of time which is not long enough + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Increase the Timeout in the FW Control task. + */ + ADRV903X_CPU_SYSTEM_DBG_CMD_NOT_SUPPORTED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 106u), /*!<@errcode: 0xFF6A + @desc: System: Invalid Debug Command + @maincause: Invalid Debug Command Provided + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Debug Command is Supported. Contact ADI to get the correct Command if the problem persists. + */ + ADRV903X_CPU_SYSTEM_DBG_CMD_PARAMS_INVALID = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 107u), /*!<@errcode: 0xFF6B + @desc: System: Invalid Debug Command Parameter + @maincause: Invalid Debug Command Parameter Provided + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Debug Command Parameter is Supported. Contact ADI to get the correct info if the problem persists. + */ + ADRV903X_CPU_SYSTEM_HAL_TX_ATTEN_RESTORE_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 108u), /*!<@errcode: 0xFF6C + @desc: System: HAL Tx attenuation Restore Failed + @maincause: Cannot restore Tx attenuation because the settings were not saved + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: Reset Feature and try again. If the problem persists acquire a Memory Dump and contact ADI + */ + ADRV903X_CPU_SYSTEM_DEBUG_FUNC_NOT_SUPPORTED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 109u), /*!<@errcode: 0xFF6D + @desc: System: Invalid Calibration Debug Control Command + @maincause: Invalid Debug Control Command sent to Calibration Feature + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Check Control Command is Supported + */ + ADRV903X_CPU_SYSTEM_HEALTHMON_TOO_MANY_TASKS = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 110u), /*!<@errcode: 0xFF6E + @desc: System: The health monitor memory allocation is not large enough for the current number of tasks + @maincause: The number of RTOS tasks is greater than expected. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Allocate the required health monitor memory for the number of RTOS tasks + */ + ADRV903X_CPU_SYSTEM_SEM_CREATE_FAILED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 111u), /*!<@errcode: 0xFF6F + @desc: System: Semaphore Create Failure + @maincause: System Failed to Create Semaphore + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_SEM_TAKE_FAILED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 112u), /*!<@errcode: 0xFF70 + @desc: System: Semaphore Take Failure + @maincause: System Failed to Take Semaphore + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_SIMULATED_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 113u), /*!<@errcode: 0xFF71 + @desc: System: Simulated Error + @maincause: Simulated System Error Condition for Internal Testing + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_SI_REV_ID_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 114u), /*!<@errcode: 0xFF72 + @desc: System: Unexpected Silicon Revision Detected + @maincause: Using Incompatible Hardware with Current Version of Software + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_RADIO_LOOPBACK_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 115u), /*!<@errcode: 0xFF73 + @desc: System: Radio Loopback requested but being used + @maincause: A Calibration is already using a radio Loopback + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Verify Calibration logic to find multiple request + */ + ADRV903X_CPU_SYSTEM_TIMER_STOP_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 116u), /*!<@errcode: 0xFF74 + @desc: System: System Timer stop Error + @maincause: System Timer didn't stop within Timeout + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_TRACKING_CAL_SUSPEND_TIMEOUT = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 117u), /*!<@errcode: 0xFF75 + @desc: System: Tracking Calibration did not suspend without Timeout + @maincause: The tracking Calibration Failed to suspend within the expected time. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_FEATURE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_EFUSE_UNSUPPORTED_CPU = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 118u), /*!<@errcode: 0xFF76 + @desc: System: Only primary CPU supports EFUSE commands + @maincause: Sent EFUSE Command to secondary CPU. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: API Error. Contact ADI. + */ + ADRV903X_CPU_SYSTEM_PROFILE_UNAVAILABLE = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 119u), /*!<@errcode: 0xFF77 + @desc: System: The full Profile is only available during CPU0 boot-up + @maincause: Full Profile gets erased after CPU0 boot-up. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Don't use full Profile after boot-up. + */ + ADRV903X_CPU_SYSTEM_SEM_GIVE_FAILED = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 120u), /*!<@errcode: 0xFF78 + @desc: System: Semaphore give Operation failure + @maincause: This could happen because the system Failed in giving the semaphore. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_SYSTEM_EFUSE_READ_TIMEOUT = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 121u), /*!<@errcode: 0xFF79 + @desc: System: Unable to read EFUSE + @maincause: The EFUSE read did not occur. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Reset Device and try again. If the problem persists contact ADI + */ + + ADRV903X_CPU_SYSTEM_SBET_PRODUCT_ID_ERROR = (ADRV903X_CPU_SYSTEM_ERROR_CODE_START + 122u), /*!<@errcode: 0xFF7A + @desc: System: Profile product ID doesn't support SBET + @maincause: The Device Profile is not valid for this Product + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_PARAM + @mainrecovtext: Reprogram the Device with a Valid Profile Image. If the problem persists contact ADI + */ + +#ifndef ADI_ADRV903X_FW + /* Pseudo Error code */ + ADRV903X_CPU_CAL_EXIT_OCCURRED_ERROR = (int32_t)0x80000000 /* Remove UL for API to avoid ISO C Error. set to large number to force enum to be uint32_t */ +#else + /* Pseudo Error code */ + ADRV903X_CPU_CAL_EXIT_OCCURRED_ERROR = 0x80000000UL /* Add UL for FW to force it to be unsigned int. set to large number to force enum to be uint32_t */ +#endif +} adrv903x_CpuErrorCode_e; + +#endif + +/* Type and enumeration for CPU boot status and Error codes */ +typedef uint8_t adrv903x_CpuBootStatus_t; +typedef enum adrv903x_CpuBootStatus +{ + ADRV903X_CPU_BOOT_STATUS_POWER_UP = 0u, /*!<@errcode: 0x0000 + @desc: Boot Status: CPU Powering Up + @maincause: CPU Still Booting Up + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Wait for CPU to Boot + */ + ADRV903X_CPU_STATUS_READY = 1u, /*!<@errcode: 0x0001 + @desc: Boot Status: CPU Ready + @maincause: CPU Booted Successfully + @mainrecovenum: ADI_ADRV903X_ERR_ACT_NONE + @mainrecovtext: No Action Required + */ + ADRV903X_CPU_BOOT_WAIT_FOR_CPUS = 2u, /*!<@errcode: 0x0002 + @desc: Boot Status: Primary CPU waiting for Secondary CPU(s) + @maincause: Secondary CPU(s) Failed to Boot + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + @cause: Secondary CPU(s) Still Booting + @recovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @recovtext: Wait for CPU to Boot + */ + ADRV903X_CPU_BOOT_HANDSHAKE_ERR = 3u, /*!<@errcode: 0x0003 + @desc: Boot Error: CPU-to-CPU Handshake + @maincause: Primary CPU did not get ACK from secondary CPU. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_FW_CRC_ERR = 4u, /*!<@errcode: 0x0004 + @desc: Boot Error: CPU Firmware Image CRC Failed + @maincause: Programmed image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_STREAM_IMG_CRC_ERR = 5u, /*!<@errcode: 0x0005 + @desc: Boot Error: Stream Image CRC Failed + @maincause: Programmed image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_DEVPROF_CRC_ERR = 6u, /*!<@errcode: 0x0006 + @desc: Boot Error: Device Profile Image CRC Failed + @maincause: Programmed image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer. + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_BOOT_CLKGEN_ERR = 7u, /*!<@errcode: 0x0007 + @desc: Boot Error: CLKGEN Setup Error + @maincause: System Clock Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_BOOT_CLKJESD_ERR = 8u, /*!<@errcode: 0x0008 + @desc: Boot Error: JESD Setup Error + @maincause: JESD Clock Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_BOOT_PWRINIT_ERR = 9u, /*!<@errcode: 0x0009 + @desc: Boot Error: Power Initialization Setup Error + @maincause: Master Bias Module Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_JTAG_BUILD_STATUS_READY = 10u, /*!<@errcode: 0x000A + @desc: Boot Status: JTAG Build Status Ready + @maincause: CPU Configured for JTAG Mode + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_BOOT_CLKLOGEN_ERR = 11u, /*!<@errcode: 0x000B + @desc: Boot Error: Clock LOGEN + @maincause: Clock LOGEN Module Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_BOOT_RXQECHW_ERR = 12u, /*!<@errcode: 0x000C + @desc: Boot Error: Rx QEC + @maincause: Rx QEC Module Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_ADC_RCAL_ERR = 13u, /*!<@errcode: 0x000D + @desc: Boot Error: ADC RCAL + @maincause: ADC RCalibration Module Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_STREAM_RUNTIME_ERR = 14u, /*!<@errcode: 0x000E + @desc: Boot Error: Main Stream Processor + @maincause: Main Stream Processor Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_INTERNAL_MCS_ERR = 15u, /*!<@errcode: 0x000F + @desc: Boot Error: Internal MCS + @maincause: MCS Hardware Module Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_HAL_DATACAP_INIT_ERR = 16u, /*!<@errcode: 0x0010 + @desc: Boot Error: Data Capture + @maincause: Data Capture Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_FW_CLI_INIT_ERR = 17u, /*!<@errcode: 0x0011 + @desc: Boot Error: Command Line Interface + @maincause: Command Line Interface (CLI) Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_BOOT_TEMP_ERR = 18u, /*!<@errcode: 0x0012 + @desc: Boot Error: Temperature Sensor + @maincause: Temperature Sensor Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_BOOT_TXNCO_INIT_ERR = 19u, /*!<@errcode: 0x0013 + @desc: Boot Error: TxTest/Mix NCO + @maincause: TX NCO Module Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_BOOT_ORXNCO_INIT_ERR = 20u, /*!<@errcode: 0x0014 + @desc: Boot Error: ORx Mix NCO + @maincause: ORX NCO Module Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_BOOT_RXNCO_INIT_ERR = 21u, /*!<@errcode: 0x0015 + @desc: Boot Error: Rx Mix NCO + @maincause: Rx NCO Module Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_BOOT_TXATTEN_INIT_ERR = 22u, /*!<@errcode: 0x0016 + @desc: Boot Error: Tx Attenuator + @maincause: Tx Attenuator Module Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + ADRV903X_CPU_PRS_MCS_ERR = 23u, /*!<@errcode: 0x0017 + @desc: Boot Error: LO PLLs + @maincause: LOGEN Initialization (Pre MCS) Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + ADRV903X_CPU_BOOT_UNEXPECTED_ERR = 24u, /*!<@errcode: 0x0018 + @desc: Boot Error: Unspecified Error + @maincause: Unspecific Initialization Error Detected + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + ADRV903X_CPU_RADIO_RXTX_ERR = 25u, /*!<@errcode: 0x0019 + @desc: Boot Error: Radio Rx/Tx + @maincause: Radio Rx/Tx Module Initialization Failed + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + + ADRV903X_CPU_BOOT_PID_PROFILE_MISMATCH_ERR = 26u, /*!<@errcode: 0x001A + @desc: Boot Error: Product ID Mismatch + @maincause: Device Profile Incompatible with Product ID on Device + @mainrecovenum: ADI_ADRV903X_ERR_ACT_CHECK_FEATURE + @mainrecovtext: Use Compatible Device Profile. Contact ADI if the problem persists. + */ + ADRV903X_CPU_BOOT_TX_ORX_MAPPING_FREQ_ERR = 30u, /*!<@errcode: 0x001E + @desc: Boot Error: Tx-to-ORx Mapping + @maincause: Unable to Calculate and Save Frequencies + @mainrecovenum: ADI_ADRV903X_ERR_ACT_RESET_DEVICE + @mainrecovtext: Check Device Profile, If the Problem Persists, Acquire a Memory Dump and Contact ADI + */ + +} adrv903x_CpuBootStatus_e; + +/* Type used to store CPU Error status information */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_CpuErrors +{ + adrv903x_CpuErrorCode_e lastCmd; + adrv903x_CpuErrorCode_e system; + adrv903x_CpuErrorCode_e trackCal; +} adrv903x_CpuErrors_t;) + +#endif /* __ADRV903X_CPU_ERROR_CODES_TYPES_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_error_tables.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_error_tables.h new file mode 100644 index 0000000000000..4c9fdc58a99e9 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_error_tables.h @@ -0,0 +1,2983 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file + * + * \brief + * + * \details + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_CPU_ERROR_TABLES_H_ +#define _ADRV903X_CPU_ERROR_TABLES_H_ + +#include "adi_common_error.h" +#include "adi_adrv903x_error_types.h" + +const adrv903x_CpuBootErrCodes_t adrv903x_CpuBootErrTable[] = +{ +/* DO NOT EDIT THIS TABLE, CHANGES WILL BE OVERWRITTEN DURING FULL BUILD */ +/* START AUTOGENERATED CPU BOOT ERROR TABLE */ + { + 0x0000u, + ADI_STRING("Boot Status: CPU Powering Up"), + ADI_STRING("CPU Still Booting Up"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Wait for CPU to Boot") + }, + { + 0x0001u, + ADI_STRING("Boot Status: CPU Ready"), + ADI_STRING("CPU Booted Successfully"), + ADI_ADRV903X_ERR_ACT_NONE, + ADI_STRING("No Action Required") + }, + { + 0x0002u, + ADI_STRING("Boot Status: Primary CPU waiting for Secondary CPU(s)"), + ADI_STRING("Secondary CPU(s) Failed to Boot"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0003u, + ADI_STRING("Boot Error: CPU-to-CPU Handshake"), + ADI_STRING("Primary CPU did not get ACK from secondary CPU."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0004u, + ADI_STRING("Boot Error: CPU Firmware Image CRC Failed"), + ADI_STRING("Programmed image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0005u, + ADI_STRING("Boot Error: Stream Image CRC Failed"), + ADI_STRING("Programmed image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0006u, + ADI_STRING("Boot Error: Device Profile Image CRC Failed"), + ADI_STRING("Programmed image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0007u, + ADI_STRING("Boot Error: CLKGEN Setup Error"), + ADI_STRING("System Clock Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0008u, + ADI_STRING("Boot Error: JESD Setup Error"), + ADI_STRING("JESD Clock Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0009u, + ADI_STRING("Boot Error: Power Initialization Setup Error"), + ADI_STRING("Master Bias Module Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x000Au, + ADI_STRING("Boot Status: JTAG Build Status Ready"), + ADI_STRING("CPU Configured for JTAG Mode"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x000Bu, + ADI_STRING("Boot Error: Clock LOGEN"), + ADI_STRING("Clock LOGEN Module Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x000Cu, + ADI_STRING("Boot Error: Rx QEC"), + ADI_STRING("Rx QEC Module Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x000Du, + ADI_STRING("Boot Error: ADC RCAL"), + ADI_STRING("ADC RCalibration Module Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x000Eu, + ADI_STRING("Boot Error: Main Stream Processor"), + ADI_STRING("Main Stream Processor Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x000Fu, + ADI_STRING("Boot Error: Internal MCS"), + ADI_STRING("MCS Hardware Module Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0010u, + ADI_STRING("Boot Error: Data Capture"), + ADI_STRING("Data Capture Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0011u, + ADI_STRING("Boot Error: Command Line Interface"), + ADI_STRING("Command Line Interface (CLI) Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0012u, + ADI_STRING("Boot Error: Temperature Sensor"), + ADI_STRING("Temperature Sensor Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0013u, + ADI_STRING("Boot Error: TxTest/Mix NCO"), + ADI_STRING("TX NCO Module Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0014u, + ADI_STRING("Boot Error: ORx Mix NCO"), + ADI_STRING("ORX NCO Module Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0015u, + ADI_STRING("Boot Error: Rx Mix NCO"), + ADI_STRING("Rx NCO Module Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0016u, + ADI_STRING("Boot Error: Tx Attenuator"), + ADI_STRING("Tx Attenuator Module Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0017u, + ADI_STRING("Boot Error: LO PLLs"), + ADI_STRING("LOGEN Initialization (Pre MCS) Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0018u, + ADI_STRING("Boot Error: Unspecified Error"), + ADI_STRING("Unspecific Initialization Error Detected"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0019u, + ADI_STRING("Boot Error: Radio Rx/Tx"), + ADI_STRING("Radio Rx/Tx Module Initialization Failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x001Au, + ADI_STRING("Boot Error: Product ID Mismatch"), + ADI_STRING("Device Profile Incompatible with Product ID on Device"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Use Compatible Device Profile. Contact ADI if the problem persists.") + }, + { + 0x001Eu, + ADI_STRING("Boot Error: Tx-to-ORx Mapping"), + ADI_STRING("Unable to Calculate and Save Frequencies"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Check Device Profile, If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, +/* END AUTOGENERATED CPU BOOT ERROR TABLE */ +}; + +const adrv903x_CpuRuntimeErrCodes_t adrv903x_CpuRunTimeErrTable[] = +{ +/* DO NOT EDIT THIS TABLE, CHANGES WILL BE OVERWRITTEN DURING FULL BUILD */ +/* START AUTOGENERATED CPU RUNTIME ERROR TABLE */ + { + 0x0000u, + ADI_STRING("No Error"), + ADI_STRING("Operation Successful"), + ADI_ADRV903X_ERR_ACT_NONE, + ADI_STRING("No Action Required") + }, + /*!< -------- RC Tuner Calibration Section Base Error Code = 0x0000 ------ */ + { + 0x0001u, + ADI_STRING("RC Tuner: Calibration Timeout"), + ADI_STRING("Timeout Waiting for RCAL and/or CCAL to Finish"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Re-program Device and re-run RC Tuner Calibration") + }, + { + 0x0002u, + ADI_STRING("RC Tuner: Self-Test Error"), + ADI_STRING("RCAL/CCAL Results violate +/-25% limits (from Nominal)"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Re-program Device and re-run RC Tuner Calibration") + }, + /*!< -------- DC Offset Calibration Section Base Error Code = 0x0100 ------ */ + { + 0x0101u, + ADI_STRING("DC Offset: Calibration was aborted while collecting data"), + ADI_STRING("Rx going low or higher priority Calibration aborting the current capture"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run the Calibration") + }, + { + 0x0102u, + ADI_STRING("DC Offset: Calibration Timed out due to Error in Data Capture"), + ADI_STRING("Hardware was unable to capture enough data within time limit"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run the Calibration") + }, + { + 0x0103u, + ADI_STRING("DC Offset: Internal Test to verify if Calibration was successful"), + ADI_STRING("FSC was unable to capture data required to confirm Calibration completion"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Perform Soft Reset to complete Data Capture") + }, + { + 0x0104u, + ADI_STRING("DC Offset: Undefined control Command"), + ADI_STRING("Invalid control Command used for tracking Calibration"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Control Command is Valid") + }, + { + 0x0105u, + ADI_STRING("DC Offset: Calibration was unable to converge"), + ADI_STRING("The residual DC Offset was higher than threshold"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + /*!< -------- ADC Rx Calibration Section Base Error Code = 0x0200 ------ */ + { + 0x0201u, + ADI_STRING("ADC Rx: Stage 1 Error"), + ADI_STRING("Calibration may have saturated"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0202u, + ADI_STRING("ADC Rx: Stage V Error"), + ADI_STRING("Calibration may have saturated"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0203u, + ADI_STRING("ADC Rx: DRF Error"), + ADI_STRING("Calibration may have saturated"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0204u, + ADI_STRING("ADC Rx: Invalid FSM Command"), + ADI_STRING("Invalid FSM Command passed to ADC Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0205u, + ADI_STRING("ADC Rx: Run ADC Rx Initial Calibration before Tracking Calibration"), + ADI_STRING("Initial ADC Rx Calibration has not completed successfully yet"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0206u, + ADI_STRING("ADC Rx: Calibration Timeout"), + ADI_STRING("Calibration did not finish in expected time"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0207u, + ADI_STRING("ADC Rx:HW start-up Error"), + ADI_STRING("Unexpected HW behavior: start-up Error; report to ADI"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0208u, + ADI_STRING("ADC Rx: Invalid Configuration Parameter"), + ADI_STRING("Invalid Configuration Parameter Passed to ADC Rx Module"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0209u, + ADI_STRING("ADC Rx: Unknown Error"), + ADI_STRING("Unspecified Error Detected in ADC Rx Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x020Au, + ADI_STRING("ADC Rx: Invalid Control Command"), + ADI_STRING("Invalid Control Command provided to ADC Rx Module"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Control Command is Supported") + }, + { + 0x020Bu, + ADI_STRING("ADC Rx: Busy"), + ADI_STRING("A Calibration is currently Running"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Wait for Current Calibration Running to Complete") + }, + { + 0x020Cu, + ADI_STRING("ADC Rx: Control Command Requires Debug Mode"), + ADI_STRING("Debug Mode is not Supported"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x020Du, + ADI_STRING("ADC Rx: Register Map Verification Failed"), + ADI_STRING("ADC Rx Module not Configured as Expected"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x020Eu, + ADI_STRING("ADC Rx: Tracking Calibration Timeout"), + ADI_STRING("Timeout due to Disabled Rx"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Enable Rx before Timeout") + }, + /*!< -------- ADC ORx Calibration Section Base Error Code = 0x0300 ------ */ + { + 0x0301u, + ADI_STRING("ADC ORx: Slice Calibration Object Error"), + ADI_STRING("Calibration may have Saturated"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0302u, + ADI_STRING("ADC ORx: Slice Calibration Interrupt Status Error"), + ADI_STRING("Interrupt Pin Caused Error, but Status was OK"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0303u, + ADI_STRING("ADC ORx: Slice Calibration Interrupt Timeout"), + ADI_STRING("Interrupt Timer has Expired"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0304u, + ADI_STRING("ADC ORx: Slice Initialization Calibration Interrupt Error"), + ADI_STRING("Unexpected Interrupt Received"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0305u, + ADI_STRING("ADC ORx: Slice Tracking Calibration Interrupt Error"), + ADI_STRING("Unexpected Interrupt Received"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0306u, + ADI_STRING("ADC ORx: Front-End Calibration Object Error"), + ADI_STRING("Calibration may have Saturated"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0307u, + ADI_STRING("ADC ORx: Front-End Calibration Interrupt Status Error"), + ADI_STRING("Interrupt Pin caused Error, but status was OK"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0308u, + ADI_STRING("ADC ORx: Front-End Calibration Interrupt Timeout Error"), + ADI_STRING("Interrupt Timer has Expired"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0309u, + ADI_STRING("ADC ORx: Front-End Initialization Calibration Interrupt Error"), + ADI_STRING("Unexpected Interrupt Received"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x030Au, + ADI_STRING("ADC ORx: Front-End Tracking Calibration Interrupt Error"), + ADI_STRING("Unexpected Interrupt Received"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x030Bu, + ADI_STRING("ADC ORx: Interleaving Timing Calibration Object Error"), + ADI_STRING("Calibration may have Saturated"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x030Cu, + ADI_STRING("ADC ORx: Interleaving Timing Calibration Interrupt Status Error"), + ADI_STRING("Interrupt Pin caused Error, but Status was OK"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x030Du, + ADI_STRING("ADC ORx: Interleaving Timing Calibration Interrupt Timeout Error"), + ADI_STRING("Interrupt Timer has Expired"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x030Eu, + ADI_STRING("ADC ORx: Interleaving Timing Initialization Calibration Interrupt Error"), + ADI_STRING("Unexpected Interrupt Received"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x030Fu, + ADI_STRING("ADC ORx: Interleaving Timing Tracking Calibration Interrupt Error"), + ADI_STRING("Unexpected Interrupt Received"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0310u, + ADI_STRING("ADC ORx: Invalid Control Command"), + ADI_STRING("Invalid Control Command passed to ADC ORx Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0311u, + ADI_STRING("ADC ORx: Control Command Queue Error"), + ADI_STRING("Unexpected Behaviour in ADC ORx Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0312u, + ADI_STRING("ADC ORx: Hardware Slice Initialization Error"), + ADI_STRING("Unexpected Behaviour in ADC ORx Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0313u, + ADI_STRING("ADC ORx: Hardware Track & Hold Initialization Error"), + ADI_STRING("Unexpected Behaviour in ADC ORx Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0314u, + ADI_STRING("ADC ORx: Hardware Start-Up Error"), + ADI_STRING("Unexpected Behaviour in ADC ORx Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0315u, + ADI_STRING("ADC ORx: Calibration Timeout Error"), + ADI_STRING("Calibration did not Finish in Expected Time"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0316u, + ADI_STRING("ADC ORx: Invalid Configuration Parameter"), + ADI_STRING("Invalid Configuration Parameter Used in Command to ADC ORx Module"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Parameters and try again. Contact ADI if the problem persists") + }, + { + 0x0317u, + ADI_STRING("ADC ORx: Unknown Error"), + ADI_STRING("Unspecified Error in ADC ORx Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0318u, + ADI_STRING("ADC ORx: Control Command Not Supported"), + ADI_STRING("Invalid Control Command"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Control Command is Supported") + }, + { + 0x0319u, + ADI_STRING("ADC ORx: Busy"), + ADI_STRING("A Calibration is Currently Running"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Wait for Current Calibration Running to Complete") + }, + { + 0x031Au, + ADI_STRING("ADC ORx: Control Command Requires Debug Mode"), + ADI_STRING("Debug Mode Not Enabled"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Check Command & Mode of Operation") + }, + { + 0x031Bu, + ADI_STRING("ADC ORx: Run ADC ORx Initial Calibration before Tracking Calibration"), + ADI_STRING("Initial ADC ORx Calibration has not completed successfully yet"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x031Cu, + ADI_STRING("ADC ORx: DAC Stream Write Error"), + ADI_STRING("Stream DAC has stopped Writing"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x031Du, + ADI_STRING("ADC ORx: Register Map Verification Failed"), + ADI_STRING("ADC ORx Module not Configured as Expected"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x031Eu, + ADI_STRING("ADC ORx: Tracking Calibration Timeout"), + ADI_STRING("Timeout Due to Disabled ORx"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Enable ORx before Timeout") + }, + /*!< -------- ADC TxLb Calibration Section Base Error Code = 0x0400 ------ */ + { + 0x0401u, + ADI_STRING("ADC TxLb: Slice Calibration Object Error"), + ADI_STRING("Calibration may have Saturated"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0402u, + ADI_STRING("ADC TxLb: Slice Calibration Interrupt Status Error"), + ADI_STRING("Interrupt Pin caused Error, but Status was OK"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0403u, + ADI_STRING("ADC TxLb: Slice Calibration Interrupt Timeout Error"), + ADI_STRING("Interrupt Timer has Expired"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0404u, + ADI_STRING("ADC TxLb: Slice Initialization Calibration Interrupt Error"), + ADI_STRING("Unexpected Interrupt Received"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0405u, + ADI_STRING("ADC TxLb: Slice Tracking Calibration Interrupt Error"), + ADI_STRING("Unexpected Interrupt Received"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0406u, + ADI_STRING("ADC TxLb: Front-End Calibration Object Error"), + ADI_STRING("Calibration may have Saturated"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0407u, + ADI_STRING("ADC TxLb: Front-End Calibration Interrupt Status Error"), + ADI_STRING("Interrupt Pin caused Error, but Status was OK"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0408u, + ADI_STRING("ADC TxLb: Front-End Calibration Interrupt Timeout Error"), + ADI_STRING("Interrupt Timer has Expired"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0409u, + ADI_STRING("ADC TxLb: Front-End Initialization Calibration Interrupt Error"), + ADI_STRING("Unexpected Interrupt Received"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x040Au, + ADI_STRING("ADC TxLb: Front-End Tracking Calibration Interrupt Error"), + ADI_STRING("Unexpected Interrupt Received"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x040Bu, + ADI_STRING("ADC TxLb: Invalid Control Command"), + ADI_STRING("Invalid Control Command passed to ADC TxLb Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x040Cu, + ADI_STRING("ADC TxLb: Control Command Queue Error"), + ADI_STRING("Unexpected Behaviour in ADC TxLb Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x040Du, + ADI_STRING("ADC TxLb: Hardware Slice Initialization Error"), + ADI_STRING("Unexpected Behaviour in ADC TxLb Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x040Eu, + ADI_STRING("ADC TxLb: Hardware Start-Up Error"), + ADI_STRING("Unexpected Behaviour in ADC TxLb Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x040Fu, + ADI_STRING("ADC TxLb: Hardware Track & Hold Initialization Error"), + ADI_STRING("Unexpected Behaviour in ADC TxLb Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0410u, + ADI_STRING("ADC TxLb: Calibration Timeout"), + ADI_STRING("Calibration did not Finish in Expected Time"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0411u, + ADI_STRING("ADC TxLb: Invalid Parameter"), + ADI_STRING("Invalid Configuration Parameter passed to ADC TxLb Module"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0412u, + ADI_STRING("ADC TxLb: Unknown Error"), + ADI_STRING("Unspecified Error in ADC TxLb Module"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0413u, + ADI_STRING("ADC TxLb: Control Command Not Supported"), + ADI_STRING("Invalid Control Command passed to ADC TxLb Module"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Control Command is Supported") + }, + { + 0x0414u, + ADI_STRING("ADC Txlb: Busy"), + ADI_STRING("A Calibration is Currently Running"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Wait Until Current Calibration Finishes") + }, + { + 0x0415u, + ADI_STRING("ADC Txlb: Control Command Requires Debug Mode"), + ADI_STRING("Debug Mode is not Supported"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0416u, + ADI_STRING("ADC Txlb: Run ADC ORx Initial Calibration before Tracking Calibration"), + ADI_STRING("Initial ADC TxLb Calibration has not completed successfully yet"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0417u, + ADI_STRING("ADC Txlb: DAC Stream Write Error"), + ADI_STRING("Stream DAC has stopped Writing"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0418u, + ADI_STRING("ADC Txlb: Register Map Verification Failed"), + ADI_STRING("ADC TxLb Module not Configured as Expected"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0419u, + ADI_STRING("ADC Txlb: Tracking Calibration Timeout"), + ADI_STRING("Timeout due to Disabled Tx"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Enable ORx before Timeout") + }, + /*!< -------- Tx DAC Calibration Section Base Error Code = 0x0500 ------ */ + { + 0x0501u, + ADI_STRING("Tx DAC: DAC Channel I not Powered Up"), + ADI_STRING("Supplies not Ready or Clock is not on"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Verify Supply Ready Flags and PLL Ready Flags are Set, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0x0502u, + ADI_STRING("Tx DAC: DAC Channel Q not Powered Up"), + ADI_STRING("Supplies not Ready or Clock is not on"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Verify Supply Ready Flags and PLL Ready Flags are Set, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0x0503u, + ADI_STRING("Tx DAC: DAC Channel I Initial Calibration didn't finish"), + ADI_STRING("DAC Clock not on"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Verify PLL Ready Flags are Set, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0x0504u, + ADI_STRING("Tx DAC: DAC Channel Q Initial Calibration didn't finish"), + ADI_STRING("DAC Clock not on"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Verify PLL Ready Flags are Set, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0x0505u, + ADI_STRING("Tx DAC: DAC Channel I Saturated during Initial Calibration"), + ADI_STRING("Not Enough Range during TxDAC Initial Calibration"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Possibly not Enough Range, acquire a Memory Dump and contact ADI") + }, + { + 0x0506u, + ADI_STRING("Tx DAC: DAC Channel Q Saturated during Initial Calibration"), + ADI_STRING("Not Enough Range during TxDAC Initial Calibration"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Possibly not Enough Range, acquire a Memory Dump and contact ADI") + }, + { + 0x0507u, + ADI_STRING("Tx DAC: DAC Channel I not Powered Down"), + ADI_STRING("Supplies not Ready or Clock is not on"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Verify Supply Ready Flags and PLL Ready Flags are Set, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0x0508u, + ADI_STRING("Tx DAC: DAC Channel Q not Powered Down"), + ADI_STRING("Supplies not Ready or Clock is not on"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("verify supply ready flags and PLL ready flags are set, if the problem persists acquire a Memory Dump and contact ADI @cause: TxDAC clock has incorrect Configuration") + }, + { + 0x0509u, + ADI_STRING("Tx DAC: DAC Channel I not in Standby"), + ADI_STRING("Supplies not Ready or Clock is not on"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Verify Supply Ready Flags and PLL Ready Flags are Set, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0x050Au, + ADI_STRING("Tx DAC: DAC Channel Q not in Standby"), + ADI_STRING("Supplies not Ready or Clock is not on"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("verify supply ready flags and PLL ready flags are set, if the problem persists acquire a Memory Dump and contact ADI @cause: TxDAC clock has incorrect Configuration") + }, + { + 0x050Bu, + ADI_STRING("Tx DAC: Invalid Clock Divider"), + ADI_STRING("Invalid Clock Divider Value"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Verify dacPowerDownDiv_i/q, dacPowerUpDiv_i/q, and txDacClkDiv have correct Configuration") + }, + { + 0x050Cu, + ADI_STRING("Tx DAC: DAC Sample Clock out of Operating Frequency Range"), + ADI_STRING("Sample clock should be between 1.5 - 3GHz"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Sample Clock Rate") + }, + /*!< -------- BBF Tx Calibration Section Base Error Code = 0x0600 ------ */ + { + 0x0601u, + ADI_STRING("BBF Tx: Calibration Data Capture Aborted"), + ADI_STRING("Tx Going Lower or Higher Priority"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Calibration") + }, + { + 0x0602u, + ADI_STRING("BBF Tx: Insufficient Power measured at Loopback path"), + ADI_STRING("Insufficient power measured at Loopback path"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0603u, + ADI_STRING("BBF Tx: Base Band Filter was not Tuned to Achieve Flatness"), + ADI_STRING("Algorithm unable to converge on Tuning Capacitor Values"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Rerun the Initial Calibration again. Contact ADI if the problem persists") + }, + { + 0x0604u, + ADI_STRING("BBF Tx: Invalid Data Captured by FSC Hardware"), + ADI_STRING("FSC Hardware unable to Capture Correct Data"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Rerun the Initial Calibration again. Contact ADI if the problem persists") + }, + { + 0x0605u, + ADI_STRING("BBF Tx: Control Command Not Supported"), + ADI_STRING("Invalid Control Command passed to BBF Tx Module"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Control Command is Supported") + }, + { + 0x0606u, + ADI_STRING("BBF Tx: Capacitor Estimate Higher than Threshold"), + ADI_STRING("Calibration unable to Converge on Tuning Capacitor Values"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Calibration") + }, + { + 0x0607u, + ADI_STRING("BBF Tx: Capacitor Estimate Lower than Threshold"), + ADI_STRING("Calibration unable to Converge on Tuning Capacitor Values"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Calibration") + }, + { + 0x0608u, + ADI_STRING("BBF Tx: Hardware unable to Schedule/Complete Data Capture"), + ADI_STRING("FSC Hardware unable to Capture Correct Data"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Calibration") + }, + { + 0x0609u, + ADI_STRING("BBF Tx: Test Mode Range Error"), + ADI_STRING("Tx Input Range is Out of Range"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Sample Clock Rate") + }, + { + 0x060Au, + ADI_STRING("BBF Tx: CPU Synchronization Error"), + ADI_STRING("Timeout Waiting for the Other CPU to Synchronize"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Whether Both Cores are Running") + }, + { + 0x060Bu, + ADI_STRING("BBF Tx: Error adjusting invalid frequency"), + ADI_STRING("Unable to adjust LO or Fbb by adjust value"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Re-run the Initial Calibration. Contact ADI if the problem persists") + }, + { + 0x060Cu, + ADI_STRING("BBF Tx: Unable to find capacitor for proper attenuation"), + ADI_STRING("Calibration unable to Converge on Tuning Capacitor Values"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Calibration") + }, + /*!< -------- Path Delay Calibration Section Base Error Code = 0x0700 ------ */ + { + 0x0701u, + ADI_STRING("Path Delay: Use case is not Currently Supported"), + ADI_STRING("unsupported use case"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Check Use Case is Currently Supported") + }, + { + 0x0702u, + ADI_STRING("Path Delay: Self Check Failure"), + ADI_STRING("Estimated Delay Exceeds Margin"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0703u, + ADI_STRING("Path Delay:Number of observations more than the limit set"), + ADI_STRING("Adjust algorithm Configuration Parameters to handle Profile"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0704u, + ADI_STRING("Path Delay: Cross-Correlation Timeout"), + ADI_STRING("FSC was unable to Capture Data"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0x0705u, + ADI_STRING("Path Delay: Cross-Correlation Error"), + ADI_STRING("FSC was unable to capture data"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Calibration") + }, + { + 0x0706u, + ADI_STRING("Path Delay: Cross-Correlation Get Results Error"), + ADI_STRING("Unable to Get FSC Capture Results"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + /*!< -------- TxAtten Calibration Section Base Error Code = 0x0800 ------ */ + /*!< -------- Tx HRM Calibration Section Base Error Code = 0x0900 ------ */ + { + 0x0901u, + ADI_STRING("Tx HRM: Warm Boot Error"), + ADI_STRING("Initial Calibration must run successfully at least once before Warm Boot"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Tx HRM Initial Calibration") + }, + { + 0x0902u, + ADI_STRING("Tx HRM: Correlation Capture Error"), + ADI_STRING("Timeout waiting for Data Capture to Complete"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Tx HRM Initial Calibration") + }, + { + 0x0903u, + ADI_STRING("Tx HRM: Auto-Correlation Timeout"), + ADI_STRING("FSC was unable to Capture Data"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Tx HRM Initial Calibration") + }, + { + 0x0904u, + ADI_STRING("Tx HRM: Auto-correlation Get Results"), + ADI_STRING("Unable to Get FSC Capture Results"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Tx HRM Initial Calibration") + }, + { + 0x0905u, + ADI_STRING("Tx HRM: Invalid Delay Parameter"), + ADI_STRING("Delay Parameter being searched does not exist"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Tx HRM Initial Calibration. Contact ADI if the problem persists") + }, + { + 0x0906u, + ADI_STRING("Tx HRM: Delay Parameter Value is Out of Range"), + ADI_STRING("Delay Parameter being searched is outside Min/Max limits specified"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Tx HRM Initial Calibration") + }, + { + 0x0907u, + ADI_STRING("Tx HRM: Delay Parameter search Error"), + ADI_STRING("Did not find optimum value for delay Parameter. Target Performance not Achieved"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Tx HRM Initial Calibration") + }, + { + 0x0908u, + ADI_STRING("Tx HRM: Fundamental Power Measurement Error"), + ADI_STRING("Fundamental Power Measured is too Low"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Tx HRM Initial Calibration") + }, + { + 0x0909u, + ADI_STRING("Tx HRM: Zeroing Cal Error"), + ADI_STRING("No optimum FDACP/FDACN detected"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Tx HRM Initial Calibration") + }, + { + 0x090Au, + ADI_STRING("Tx HRM: Incorrect Number of bytes supplied to HRM Control Function"), + ADI_STRING("API function supplied incorrect number of bytes to HRM Control Function"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check API call that supplied the parameters") + }, + { + 0x090Bu, + ADI_STRING("Tx HRM: Must choose only 1 channel for HRM Control Function"), + ADI_STRING("API function supplied chnnel mask with more than one channel to HRM Control Function"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check API call that supplied the parameters") + }, + /*!< -------- Tx LOL Calibration Section Base Error Code = 0x0B00 ------ */ + { + 0x0B01u, + ADI_STRING("TxLol:Hardware unable to schedule/complete Data Capture"), + ADI_STRING("FSC was unable to capture data"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Power measured at output is below threshold. Reset Device") + }, + { + 0x0B05u, + ADI_STRING("Tx Lol: Correction Predicted exceeds Threshold"), + ADI_STRING("Predicted correction higher than Hardware threshold limits"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Tx LOL Initial Calibration") + }, + { + 0x0B06u, + ADI_STRING("TxLol: Internal Calibration Error"), + ADI_STRING("Invalid Observations Reported by Hardware"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Tx LOL Initial Calibration") + }, + { + 0x0B07u, + ADI_STRING("TxLol: Invalid Tx to ORx Mapping"), + ADI_STRING("Invalid ORx Mapped to Current Tx Channel"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Tx to ORx Mapping Configuration") + }, + /*!< -------- SERDES Calibration Section Base Error Code = 0x0C00 ------ */ + { + 0x0C01u, + ADI_STRING("SERDES: Lane is Powered down or not Configured"), + ADI_STRING("Requesting to calibrate a Lane that is Powered down or not Configured"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check provided Lane Number/Mask against SERDES Device Profile") + }, + { + 0x0C02u, + ADI_STRING("SERDES: Control Command not Supported"), + ADI_STRING("Invalid Control Command passed to SERDES Module"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Command is Supported") + }, + { + 0x0C03u, + ADI_STRING("SERDES: Invalid Parameter Error"), + ADI_STRING("Invalid Parameter in Control Command"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Parameters are supported for the Control Command") + }, + { + 0x0C04u, + ADI_STRING("SERDES: Temperature Error"), + ADI_STRING("Unsupported Operating Temperature Detected"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device & Wait for Normal Operating Temperature") + }, + { + 0x0C05u, + ADI_STRING("SERDES: BG LMS can not converge"), + ADI_STRING("Check user's Tx data - possible long stream of unscrambled 0"), + ADI_ADRV903X_ERR_ACT_NONE, + ADI_STRING("No Action Required if the JESD link is up") + }, + { + 0x0C06u, + ADI_STRING("SERDES: Semaphore Take Failed"), + ADI_STRING("SERDES Internal OS Error failing to take the SERDES semaphore"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device and re-initialize the SERDES, if the problem persists contact ADI") + }, + { + 0x0C07u, + ADI_STRING("SERDES: One of the comparator Offset DACs reached its limits"), + ADI_STRING("Exceeded operating temperature Range or unexpected Hardware behavior"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device in a supported temperature region, if the problem persists contact ADI") + }, + { + 0x0C08u, + ADI_STRING("SERDES: One of the GmSw Offset DACs reached its limits"), + ADI_STRING("Exceeded operating temperature Range or unexpected Hardware behavior"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device in a supported temperature region, if the problem persists contact ADI") + }, + { + 0x0C09u, + ADI_STRING("SERDES: Offset DAC has reached its minimum or maximum value"), + ADI_STRING("Exceeded operating temperature Range or unexpected Hardware behavior"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device in a supported temperature region, if the problem persists contact ADI") + }, + { + 0x0C0Au, + ADI_STRING("SERDES: The regulator or slew-Rate Calibration didn't complete"), + ADI_STRING("Unexpected Hardware behavior"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset Device, if the problem persists contact ADI") + }, + { + 0x0C0Bu, + ADI_STRING("SERDES: Accumulation Timeout during BG Calibration"), + ADI_STRING("No serial traffic present - Check serial Link integrity"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset JESD Link or Device, re-run Calibration, if the problem persists contact ADI") + }, + { + 0x0C0Cu, + ADI_STRING("SERDES: Applied Clock Delay is not Consistent with the Measured Delay"), + ADI_STRING("Unexpected Hardware Behavior"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset JESD Link or Device, re-run Calibration, if the problem persists contact ADI") + }, + { + 0x0C0Du, + ADI_STRING("SERDES: Initialization Calibration didn't Complete in the Prescribed Amount of Time"), + ADI_STRING("No serial traffic present - Check serial Link integrity"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset JESD Link or Device, re-run Calibration, if the problem persists contact ADI") + }, + { + 0x0C0Eu, + ADI_STRING("SERDES: Tracking Calibration didn't complete in the prescribed amount of time"), + ADI_STRING("No serial traffic present - Check serial Link integrity"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset JESD Link or Device, re-run Calibration, if the problem persists contact ADI") + }, + { + 0x0C0Fu, + ADI_STRING("SERDES: Attempting to run Tracking Calibrations before Initialization Calibrations"), + ADI_STRING("Serdes tracking Calibration was initiated before SERDES Initial Calibration"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Run SERDES Initial Calibration before starting SERDES tracking Calibration") + }, + { + 0x0C10u, + ADI_STRING("SERDES: Unknown SERDES Error"), + ADI_STRING("Unspecified SERDES Error"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset Device, if the problem persists contact ADI") + }, + { + 0x0C11u, + ADI_STRING("SERDES: Single Lane Profile Unsupported for > 16.22Ghz"), + ADI_STRING("Incorrect Profile Configuration"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reconfigure Device to use at least 2 Lanes") + }, + { + 0x0C12u, + ADI_STRING("SERDES: Initialization Calibration didn't find a Suitable CTLE Setting with an open eye"), + ADI_STRING("Check serial Link integrity - No serial traffic present"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset JESD Link or Device, re-run Calibration, if the problem persists contact ADI") + }, + { + 0x0C13u, + ADI_STRING("SERDES: CTLE Offset DACs reached its limits"), + ADI_STRING("Exceeded operating temperature Range or unexpected Hardware behavior"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device in a supported temperature region, if the problem persists contact ADI") + }, + { + 0x0C14u, + ADI_STRING("SERDES: Semaphore Create Failed"), + ADI_STRING("SERDES Internal OS Error failing to create the SERDES semaphore"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device and re-initialize the SERDES") + }, + /*!< -------- TxLb Filter Calibration Section Base Error Code = 0x0E00 ------ */ + { + 0x0E01u, + ADI_STRING("TxLb Filter: No Valid Capacitor Code Found"), + ADI_STRING("Capacitor Code Range exceeded due to unexpected power measurement failures"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Reduce observed power measurement BW and re-run Calibration") + }, + { + 0x0E02u, + ADI_STRING("TxLb Filter: Unexpected Data Capture Error"), + ADI_STRING("Timed out Waiting for Data Capture to complete"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run TxLb Filter Calibration") + }, + { + 0x0E03u, + ADI_STRING("TxLb Filter: Calibration not completed for this Channel"), + ADI_STRING("User did not run TxLb Filter Calibration"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Run TxLb Filter Calibration for the desired channels") + }, + /*!< -------- Tx/Rx Phase Calibration Section Base Error Code = 0x1100 ------ */ + { + 0x1101u, + ADI_STRING("Tx/Rx Phase Calibration: Error performing phase measurement"), + ADI_STRING("Unknown data capture error"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Calibration") + }, + { + 0x1102u, + ADI_STRING("Tx/Rx Phase Calibration: Error performing phase measurement"), + ADI_STRING("Unknown data capture error"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Calibration") + }, + { + 0x1103u, + ADI_STRING("Tx/Rx Phase Calibration: All the channels of the same CPU must either use the internal UHB LO or the external LO"), + ADI_STRING("Follow guidelines for selecting the LO source"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Use the same LO source (internal or external) for all the channels") + }, + /*!< -------- Rx ADC Spur Calibration Section Base Error Code = 0x1200 ------ */ + { + 0x1201u, + ADI_STRING("RxSpur: No Valid Actuator configuration found"), + ADI_STRING("Rx Spur Actuator capbility exceeded"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("ADI_ADRV903X_ERR_ACT_CHECK_PARAM") + }, + { + 0x1202u, + ADI_STRING("RxSpur: Data Capture Timeout Error"), + ADI_STRING("Timed out Waiting for Data Capture to complete"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run RxSpur Calibration") + }, + { + 0x1203u, + ADI_STRING("RxSpur: Unexpected Data Capture Error"), + ADI_STRING("Failure to retrieve result of data capture"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run RxSpur Calibration") + }, + { + 0x1204u, + ADI_STRING("RxSpur: Init Calibration not completed for this Channel"), + ADI_STRING("User did not run RxSpur Init Calibration"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Run RxSpur Init Calibration for the desired channels") + }, + { + 0x1205u, + ADI_STRING("RxSpur: Calibration not supported on current hardware"), + ADI_STRING("Hardware revision does not support Rx Spur"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Do not execute RxSpur Calibration on current hardware") + }, + { + 0x1206u, + ADI_STRING("RxSpur: No spur frequency to cancel"), + ADI_STRING("No spur frequency in passband"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Do not execute RxSpur Calibration on current profile channel") + }, + { + 0x1207u, + ADI_STRING("RxSpur: Large variation detected in phase offset measurement"), + ADI_STRING("Incorrect measurement"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run RxSpur Calibration") + }, + { + 0x1208u, + ADI_STRING("RxSpur: Invalid custom spur frequency"), + ADI_STRING("Custom spur frequency not in passband"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Configure custom spur frequency within passband") + }, + { + 0x1209u, + ADI_STRING("RxSpur: Error sharing FSC hardware resources"), + ADI_STRING("Unexpected Resource Sharing Error"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Initialization Calibration before attempting to run tracking Calibration") + }, + /*!< -------- Rx QEC Tracking Calibration Section Base Error Code = 0x3000 ------ */ + { + 0x3001u, + ADI_STRING("Rx QEC: Error during Signal Search"), + ADI_STRING("Persistent signal-search HW unexpected Error when completing search"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Issue a CTRL RESET Command and re-run the Calibration") + }, + { + 0x3002u, + ADI_STRING("Rx QEC: Error during Data Capture"), + ADI_STRING("Persistent data-capture HW unexpected Error when completing capture"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Issue a CTRL RESET Command and re-run the Calibration") + }, + { + 0x3003u, + ADI_STRING("Rx QEC: Error during Core Update"), + ADI_STRING("Persistent core computation unexpected Error when completing update"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Issue a CTRL RESET Command and re-run the Calibration") + }, + { + 0x3004u, + ADI_STRING("Rx QEC:Error during QEC filter refresh"), + ADI_STRING("Persistent filter computation unexpected Error when completing QEC refresh"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Issue a CTRL RESET Command and re-run the Calibration") + }, + { + 0x3005u, + ADI_STRING("Rx QEC: Unsupported Use Case Error"), + ADI_STRING("Number of Frequency bins per search band exceeds the maximum (32) supported by HW"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check the bandwidth Parameters in the use case or change the use case") + }, + { + 0x3006u, + ADI_STRING("Rx QEC: Unsupported Use Case Error"), + ADI_STRING("Unable to support the Rx Gain table that was loaded on boot"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Change the Rx Gain table or update the firmware") + }, + { + 0x3007u, + ADI_STRING("Rx QEC: DC Notch Filter Start Delay too large"), + ADI_STRING("Unsupported Configuration Parameters for DC notch filter"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check DC notch Configuration or update the firmware") + }, + /*!< -------- Tx Lol Tracking Calibration Section Base Error Code = 0x3100 ------ */ + { + 0x3101u, + ADI_STRING("Tx Lol: Cannot run Tracking Calibration without previously running Initialization Calibration"), + ADI_STRING("Initialization Calibration was not run during initialization"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Run Initialization Calibration before attempting to run tracking Calibration") + }, + { + 0x3102u, + ADI_STRING("Tx Lol: Error sharing resources with Tx QEC Calibration"), + ADI_STRING("Unexpected Resource Sharing Error"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Initialization Calibration before attempting to run tracking Calibration") + }, + { + 0x3103u, + ADI_STRING("Tx Lol: Error capturing FSC data"), + ADI_STRING("Unexpected Data Capture Error"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Initialization Calibration before attempting to run tracking Calibration") + }, + { + 0x3104u, + ADI_STRING("Tx Lol: Error capturing FSC data"), + ADI_STRING("Data capture aborted due AGC over Range Error"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Initialization Calibration before attempting to run tracking Calibration") + }, + { + 0x3105u, + ADI_STRING("Tx Lol: Error capturing data from External Tx LOL accumulator"), + ADI_STRING("Unexpected Data Capture Error"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Initialization Calibration before attempting to run tracking Calibration") + }, + { + 0x3106u, + ADI_STRING("Tx Lol: Invalid Tx-to-ORx Path Delay passed to External Tx LOL accumulator"), + ADI_STRING("Unsupported use case, Invalid Configurator output, or Invalid user Configuration"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Ensure combined Configurator and user-adjusted Path Delay is between 0 and 250") + }, + { + 0x3107u, + ADI_STRING("Tx Lol: ORx LOL NCO not configured properly to mix Tx LO to DC at accumulator Input"), + ADI_STRING("LOL NCO not reconfigured properly when Tx LO or ORx NCO Frequency changed at run-time"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Disable LOL tracking Calibration, re-issue Tx LO and/or ORx NCO Frequency change Command, then re-enable LOL tracking Calibration") + }, + { + 0x3108u, + ADI_STRING("Tx Lol: Lo Frequency violates Frequency planning conditions"), + ADI_STRING("Lo Frequency coincides with Loopback/ORx Sampling frequencies"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Change Lo Frequency to avoid Overlap on Loopback/ORx bandwidth edge") + }, + { + 0x3109u, + ADI_STRING("Tx Lol: Model does not agree with incoming observation data, indicating the Calibration has diverged"), + ADI_STRING("Unexpected Calibration divergence can occur when observation data is corrupted (e.g. External Loopback disconnected)"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Initialization Calibration before attempting to run tracking Calibration") + }, + { + 0x310Au, + ADI_STRING("Tx Lol: Tx-to-ORx channel gain estimate falls outside expected range"), + ADI_STRING("Typically a Tx-to-ORx mapping problem (not observing the expected Tx channel)"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Fix external observation path, issue LOL channel reset command, and re-enable LOL tracking cal") + }, + { + 0x310Bu, + ADI_STRING("Tx Lol: estimate leakage is too large or NaN, or estimate leakage variance is too small or NaN"), + ADI_STRING("Typically an observation problem"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Fix external observation path, issue LOL channel reset command, and re-enable LOL tracking cal") + }, + /*!< -------- TxQEC Tracking Calibration Section Base Error Code = 0x3200 ------ */ + { + 0x3201u, + ADI_STRING("Tx QEC: Correlation Capture Error"), + ADI_STRING("Timed out waiting for Data Capture to complete"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Calibration") + }, + { + 0x3202u, + ADI_STRING("Tx QEC: Initial Calibration not done"), + ADI_STRING("At least one of the required Initial Calibrations was not run"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Ensure that all required Initial Calibrations are run without Error") + }, + { + 0x3203u, + ADI_STRING("Tx QEC: Error Initializing Frequency mask for signal search"), + ADI_STRING("Some other Calibration is conflicting with Tx QEC signal search"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run TxQEC Tracking Calibration") + }, + { + 0x3204u, + ADI_STRING("Tx QEC: Error Initializing Frequency mask for signal search"), + ADI_STRING("Signal search mask overflow due to unsupported Configurator Parameters"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Current firmware doesn't support this Profile/use case, contact ADI for FW update") + }, + { + 0x3205u, + ADI_STRING("Tx QEC: Error configuring Tx QEC to work over specified Tx bands"), + ADI_STRING("Unsupported Configurator Parameters"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Current firmware doesn't support this Profile/use case, contact ADI for FW update") + }, + { + 0x3206u, + ADI_STRING("Tx QEC: Error configuring Tx QEC actuator, not enough correction Range"), + ADI_STRING("The current firmware can not correct quadrature Error of this Device as it is different than expected"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Contact ADI for a firmware update") + }, + { + 0x3207u, + ADI_STRING("Tx QEC: Self Check Error, new coefficients increases group delay"), + ADI_STRING("Data capture returning unexpected results"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Re-run the algorithm") + }, + { + 0x3208u, + ADI_STRING("Low Tx tone power, possibly due to wrong tone Frequency or some other errors on Tx path"), + ADI_STRING("TxQEC Initialization, insufficient tone power"), + ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE, + ADI_STRING("TXQEC Initialization Re-Run, contact ADI for FW debug, if Error repeats") + }, + { + 0x3209u, + ADI_STRING("Detected too many potential interfering/aliasing signals in the LB path"), + ADI_STRING("Number of significant interferences exceeds FW Setting. ADI anticipated this Error to not occur in field"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Contact ADI to disable reporting this Error, Calibration performance maybe reduced") + }, + { + 0x320Au, + ADI_STRING("Detected user programmed LO Frequency too close to one of interfering harmonic in the LB path"), + ADI_STRING("User has changed the LO Frequency Setting at runtime. ADI anticipated this Error to occur less frequently"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Use formula provided by ADI to compute a valid LO Frequency, otherwise Calibration performance maybe severely reduced") + }, + { + 0x320Bu, + ADI_STRING("Tx QEC:DC notch settling time too large"), + ADI_STRING("Unsupported Configurator Parameters"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Current firmware doesn't support this Configuration, contact ADI for FW update") + }, + { + 0x320Cu, + ADI_STRING("Tx QEC:Calibration detected that the QEC model does not agree with the incoming observation data"), + ADI_STRING("Calibration detected divergence due to a bad observation"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Perform QEC reset, or re-run Initialization Calibration, before re-enabling QEC tracking Calibration") + }, + { + 0x320Du, + ADI_STRING("Tx QEC:Calibration detected NaN in critical state data"), + ADI_STRING("Unexpected NaN, possibly due to divide-by-zero"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Perform QEC reset, or re-run Initialization Calibration, before re-enabling QEC tracking Calibration") + }, + { + 0x320Eu, + ADI_STRING("Tx QEC:Error tuning LB filter bandwidth prior to DAC image tuning"), + ADI_STRING("LB observation error"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Initialization Calibration, before re-enabling QEC tracking Calibration") + }, + { + 0x320Fu, + ADI_STRING("LB DC tune: Error waiting for auto-corr capture"), + ADI_STRING("Error in capturing the required data"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Calibration") + }, + { + 0x3210u, + ADI_STRING("LB DC tune: Error in getting auto-corr results"), + ADI_STRING("Error in capturing the required data"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Re-run Calibration") + }, + { + 0x3211u, + ADI_STRING("LB DC tune: Timeout waiting for the auto-corr capture to be done"), + ADI_STRING("The data capture HW cannot collect the required data within a specific time interval"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("The cal will re-run automatically") + }, + /*!< -------- Device Profile Configuration Section Base Error Code = 0x8000 ------ */ + { + 0x8001u, + ADI_STRING("Device Profile: Failed CRC verification"), + ADI_STRING("Programmed image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reprogram the Device Profile Image") + }, + /*!< -------- Device Profile Configuration Section Base Error Code = 0x8500 ------ */ + { + 0x8501u, + ADI_STRING("Parity: Fatal 2bit Error"), + ADI_STRING("Memory data is corrupted. Uncorrectable error."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("ADI_ADRV903X_ERR_ACT_RESET_DEVICE") + }, + /*!< -------- NCO Section Base Error Code = 0xB000 ------ */ + { + 0xB001u, + ADI_STRING("NCO: Invalid Frequency Parameters"), + ADI_STRING("Frequency not supported for Sampling Rate"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and NCO Frequency settings") + }, + { + 0xB002u, + ADI_STRING("NCO: Invalid Phase Parameters"), + ADI_STRING("Invalid Phase Offset Setting"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("NCO Phase Setting must be between 0 - 359") + }, + { + 0xB003u, + ADI_STRING("NCO: Invalid Gain Parameters"), + ADI_STRING("Invalid Gain Setting"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("NCO I/Q Gain Setting is Invalid") + }, + { + 0xB004u, + ADI_STRING("NCO: Band or type selection"), + ADI_STRING("Invalid band or NCO selected"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Valid Value must be used for DDC or Datapath NCO") + }, + { + 0xB005u, + ADI_STRING("NCO: Dual tone frequencies are out-of-Range"), + ADI_STRING("Frequencies not supported for Sampling Rate"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and NCO Frequency settings") + }, + { + 0xB006u, + ADI_STRING("NCO: Tx Mixer NCO Frequency can not be changed while TxTestTone Enabled"), + ADI_STRING("Disable Test tone with TxTestToneSet() before calling TxNcoShifterSet()"), + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, + ADI_STRING("Check API Call Sequence") + }, + /*!< -------- Stream Section Base Error Code = 0xB100 ------ */ + { + 0xB101u, + ADI_STRING("Stream: Invalid Input Parameters"), + ADI_STRING("One or more Input Parameters are not valid"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB102u, + ADI_STRING("Stream:Timer expired waiting for stream completion"), + ADI_STRING("The stream Timeout can occur due to stream processor waiting for other streams to complete"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("The stream execution is timed out. Rerun the feature to recover from this Error.") + }, + { + 0xB103u, + ADI_STRING("Stream: Triggered stream reported an Error"), + ADI_STRING("The stream that is triggered either through firmware or API has generated an Error."), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("The stream number being triggered should be checked.") + }, + { + 0xB104u, + ADI_STRING("Stream: Failed CRC verification"), + ADI_STRING("Programmed image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reprogram the stream image.") + }, + { + 0xB105u, + ADI_STRING("Stream: Stream Processor reported a FIFO Error"), + ADI_STRING("The stream FIFO is full. This could happen due to back to back streams being triggered."), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Rerunning the feature could solve the issue.") + }, + { + 0xB106u, + ADI_STRING("Stream: Stream Processor reported an External Timer Error"), + ADI_STRING("External Timer started by stream Failed. This could fail if no External timers available."), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Rerunning the feature could solve the issue.") + }, + { + 0xB107u, + ADI_STRING("Stream: Stream Processor reported an Invalid instruction"), + ADI_STRING("This could happen if the stream is corrupted or stream is generated wrongly"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream.") + }, + { + 0xB108u, + ADI_STRING("Stream: Stream Processor reported an Invalid AHB address"), + ADI_STRING("Wrong AHB address is accessed in the stream."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream.") + }, + { + 0xB109u, + ADI_STRING("Stream: Stream Processor reported an Invalid stream number"), + ADI_STRING("Invalid stream number called from stream or firmware"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream.") + }, + { + 0xB10Au, + ADI_STRING("Stream: Stream Processor reported a stack overflow"), + ADI_STRING("Too many nested calls in the stream can cause this"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream.") + }, + { + 0xB10Bu, + ADI_STRING("Stream: Stream Processor reported a Timeout Error"), + ADI_STRING("The stream did not complete within the set Timeout period"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream.") + }, + { + 0xB10Cu, + ADI_STRING("Stream: Stream Processor reported a check instruction Error"), + ADI_STRING("This could happen if a wrong instruction is used in the stream."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream.") + }, + { + 0xB10Du, + ADI_STRING("Stream: Stream Processor reported an Invalid SPI address"), + ADI_STRING("Invalid SPI address accessed in the stream."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream.") + }, + { + 0xB10Eu, + ADI_STRING("Stream: Previous Stream didn't finish"), + ADI_STRING("The previous stream started by the stream processor or firmware did not finish"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Rerun the feature if the problem persists, contact ADI to fix the stream Timeout.") + }, + { + 0xB10Fu, + ADI_STRING("Stream: Function not supported"), + ADI_STRING("The functionality is not yet supported."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Recreate the stream and reprogram the Device. If the problem persists contact ADI to fix the stream.") + }, + /*!< -------- Fsc Section Base Error Code = 0xB200 ------ */ + { + 0xB201u, + ADI_STRING("FSC: Cannot find FSC decimation rates to suit this use case"), + ADI_STRING("Current Calibration Configuration does not support this use case"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Check for valid/supported use case. Firmware update may be required.") + }, + { + 0xB202u, + ADI_STRING("FSC: Cannot find valid FSC clock Configuration to suit this use case"), + ADI_STRING("This use case is not currently supported by the FSC and its Device driver"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Check for valid/supported use case. Firmware update may be required.") + }, + { + 0xB203u, + ADI_STRING("FSC: Attempted to start second FSC capture before the first had completed"), + ADI_STRING("Firmware synchronization bug is causing a resource-sharing collision in the FSC"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("ADI_ADRV903X_ERR_ACT_RESET_FEATURE") + }, + { + 0xB204u, + ADI_STRING("FSC: Cannot find valid Phase compensation factor for LB NCOs"), + ADI_STRING("Loopback Phase Calibration has Failed due to unexpected or noisy observation data"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Attempt to re-run Path Delay Calibration") + }, + { + 0xB205u, + ADI_STRING("FSC: Error capturing data for Phase Compensation Calibration"), + ADI_STRING("Unexpected Data Capture failure"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Attempt to re-run Path Delay Calibration") + }, + /*!< -------- Master Bias Section Base Error Code = 0xB300 ------ */ + { + 0xB301u, + ADI_STRING("Master Bias: RB0 Ptat Calibration Failed"), + ADI_STRING("Unexpected failure in resistor trim logic, or no clock provided to trim logic"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB302u, + ADI_STRING("Master Bias: RB1 Ptat Calibration Failed"), + ADI_STRING("Unexpected failure in resistor trim logic, or no clock provided to trim logic"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB303u, + ADI_STRING("Master Bias: Invalid Ptat resistor value for Tx BBF"), + ADI_STRING("Ptat trim Calibration generated an out-of-Range result"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB304u, + ADI_STRING("Master Bias: Invalid Ptat resistor value for UPC"), + ADI_STRING("Ptat trim Calibration generated an out-of-Range result"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB305u, + ADI_STRING("Master Bias: Invalid Ptat resistor value for UPC BIAS"), + ADI_STRING("Ptat trim Calibration generated an out-of-Range result"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB306u, + ADI_STRING("Master Bias: Invalid Ptat resistor value for VGA"), + ADI_STRING("Ptat trim Calibration generated an out-of-Range result"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + /*!< -------- VCO LDO Section Base Error Code = 0xB400 ------ */ + { + 0xB401u, + ADI_STRING("VCO LDO: LDO output voltage is below low side of target Range"), + ADI_STRING("VCO LDO bypass capacitor is shorted to GND"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Check Bypass Capacitor & Soldering for Damage and/or Short. Contact ADI if the problem persists.") + }, + { + 0xB402u, + ADI_STRING("VCO LDO: Input supply voltage is below low side of target Range"), + ADI_STRING("Input supply voltage is below undervoltage-lockout threshold"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Check the Input supply voltage and try again. Contact ADI if the problem persists.") + }, + { + 0xB403u, + ADI_STRING("VCO LDO: Reference Input voltage below low side of target Range"), + ADI_STRING("Unexpected Hardware behavior, reference Input voltage below low side of target Range"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB404u, + ADI_STRING("VCO LDO: Temperature is above high side of target Range"), + ADI_STRING("Temperature is above high side of target Range"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Check Heat Dissipation is at required level. Contact ADI if the problem persists.") + }, + { + 0xB405u, + ADI_STRING("VCO LDO: Load current is above high side of target Range dictated by VCO"), + ADI_STRING("VCO LDO bypass capacitor is shorted to GND"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Check Bypass capacitor & soldering for damage/short. Contact ADI if the problem persists.") + }, + { + 0xB406u, + ADI_STRING("VCO LDO: LDO output voltage is above high side of target Range"), + ADI_STRING("VCO LDO bypass capacitor is shorted to VDD"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Check board layout. Contact ADI if the problem persists.") + }, + { + 0xB407u, + ADI_STRING("VCO LDO: 1.0V Shunt LDO: LDO output voltage is below low threshold"), + ADI_STRING("PD bit = 1 or Rampup Bit = 0 or Master Bias/LCR is not up"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB408u, + ADI_STRING("VCO LDO: 1.0V Shunt LDO: LDO output voltage is above high threshold"), + ADI_STRING("PD bit = 1 or Unexpected Hardware behavior"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB409u, + ADI_STRING("VCO LDO: 1.0V Shunt LDO: LDO output voltage is out of regulation"), + ADI_STRING("Unexpected Hardware behavior, under and over voltage status bits are set"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB40Au, + ADI_STRING("VCO LDO: 0.8V Shunt LDO: LDO output voltage below the targeted threshold"), + ADI_STRING("LDO output does not power up at all or it may need longer wait time to power up to the targeted threshold."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB40Bu, + ADI_STRING("VCO LDO: Unspecified VCO LDO Error"), + ADI_STRING("Power Not Good & No Other LDO Status Flag is Indicating an Error"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + /*!< -------- DWT Section Base Error Code = 0xB500 ------ */ + { + 0xB501u, + ADI_STRING("DWT: Data Watchpoint and Trace (DWT) driver not initialized"), + ADI_STRING("HW doesn't support the DWT the driver is expecting"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reprogram the Device using a Valid Package and try again. Contact ADI if the problem persists.") + }, + /*!< -------- Temperature Section Base Error Code = 0xB600 ------ */ + { + 0xB601u, + ADI_STRING("Temperature:HAL Invalid Average Mask"), + ADI_STRING("Parameter out of Range"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Parameter should be > 0 and < 256, see adi_adrv903x_DevTempSensor_e in the API") + }, + { + 0xB602u, + ADI_STRING("Temperature: HAL Temp sensor for TX0 conversion Timeout"), + ADI_STRING("Hardware was unable to acquire temperature Sample within time limit"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xB603u, + ADI_STRING("Temperature: HAL Temp sensor for TX1 conversion Timeout"), + ADI_STRING("Hardware was unable to acquire temperature Sample within time limit"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xB604u, + ADI_STRING("Temperature: HAL Temp sensor for TX2 conversion Timeout"), + ADI_STRING("Hardware was unable to acquire temperature Sample within time limit"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xB605u, + ADI_STRING("Temperature: HAL Temp sensor for TX3 conversion Timeout"), + ADI_STRING("Hardware was unable to acquire temperature Sample within time limit"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xB606u, + ADI_STRING("Temperature: HAL Temp sensor for TX4 conversion Timeout"), + ADI_STRING("Hardware was unable to acquire temperature Sample within time limit"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xB607u, + ADI_STRING("Temperature: HAL Temp sensor for TX5 conversion Timeout"), + ADI_STRING("Hardware was unable to acquire temperature Sample within time limit"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xB608u, + ADI_STRING("Temperature: HAL Temp sensor for TX6 conversion Timeout"), + ADI_STRING("Hardware was unable to acquire temperature Sample within time limit"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xB609u, + ADI_STRING("Temperature: HAL Temp sensor for TX7 conversion Timeout"), + ADI_STRING("Hardware was unable to acquire temperature Sample within time limit"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xB60Au, + ADI_STRING("Temperature: HAL Temp sensor for CLK Gen PLL conversion Timeout"), + ADI_STRING("Hardware was unable to acquire temperature Sample within time limit"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xB60Bu, + ADI_STRING("Temperature: HAL Temp sensor for RF0 PLL conversion Timeout"), + ADI_STRING("Hardware was unable to acquire temperature Sample within time limit"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xB60Cu, + ADI_STRING("Temperature: HAL Temp sensor for RF1 PLL conversion Timeout"), + ADI_STRING("Hardware was unable to acquire temperature Sample within time limit"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xB60Du, + ADI_STRING("Temperature: HAL Temp sensor for SERDES PLL conversion Timeout"), + ADI_STRING("Hardware was unable to acquire temperature Sample within time limit"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device, if the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xB60Eu, + ADI_STRING("Temperature: HAL Invalid Temp sensor Enable bit"), + ADI_STRING("Parameter out of Range"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Temp Sensor is not on the accessed core, see adi_adrv903x_DevTempSensor_e in the API") + }, + /*!< -------- PLL Section Base Error Code = 0xB700 ------ */ + { + 0xB701u, + ADI_STRING("PLL: Synthesizer Lock Failed"), + ADI_STRING("Hardware Lock Detection Timeout"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Check External Clock Sources and Power Supply") + }, + { + 0xB702u, + ADI_STRING("PLL: User Input Frequency Out of Range"), + ADI_STRING("Specified Frequency by the user was out of Range"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Ensure requested Input Frequency is in Range") + }, + { + 0xB703u, + ADI_STRING("PLL: User specified Invalid PLL type"), + ADI_STRING("Specified PLL name by the user was incorrect"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Ensure the correct PLL is specified") + }, + { + 0xB704u, + ADI_STRING("PLL: Selected PLL was Not Enabled"), + ADI_STRING("Selected PLL not Enabled"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("This Error code is not used") + }, + { + 0xB705u, + ADI_STRING("PLL: VCO Calibration Failed"), + ADI_STRING("Unexpected Hardware behavior, Hardware VCO Calibration Timeout"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB706u, + ADI_STRING("PLL: Invalid Loopfilter Parameters, Phase of BW out of Range."), + ADI_STRING("Specified Loopfilter Parameters out of Range"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check that the Input Parameters are in Range") + }, + { + 0xB707u, + ADI_STRING("PLL: CP Calibration Failed"), + ADI_STRING("Unexpected Hardware behavior, Hardware CP Calibration Timeout"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB708u, + ADI_STRING("PLL: Bleed ramp Calibration Failed"), + ADI_STRING("Unexpected Hardware behavior, Hardware Bleed Calibration Timeout"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB709u, + ADI_STRING("PLL: Invalid Rx Leaf Hardware Setting, the selected Frequency could not be realized."), + ADI_STRING("Specified RX Frequency could not be realized"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check that the Input Parameters are in Range") + }, + { + 0xB70Au, + ADI_STRING("PLL: Invalid Tx Leaf Hardware Setting, the selected Frequency could not be realized."), + ADI_STRING("Specified TX Frequency could not be realized"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("This Error code is not used") + }, + { + 0xB70Bu, + ADI_STRING("PLL: Phase Sync Invalid mode Setting"), + ADI_STRING("Specified Phase Sync mode Invalid"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB70Cu, + ADI_STRING("PLL: Phase Sync Timeout"), + ADI_STRING("Phase Sync Calibration Timeout"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB70Du, + ADI_STRING("PLL:Phase Sync Phase Mismatch"), + ADI_STRING("Phase Sync Golden Counter Mismatch"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB70Eu, + ADI_STRING("PLL: External LO Input Frequency out of Range"), + ADI_STRING("Specified External LO Frequency out of Range"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Ensure Input Parameters are correct") + }, + { + 0xB70Fu, + ADI_STRING("PLL: CLK Sweep Test Error"), + ADI_STRING("CPU Clock is Too Fast"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB711u, + ADI_STRING("PLL: Invalid Control Command"), + ADI_STRING("PLL Module is not in Debug Mode"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Ensure Device is in correct state for Command") + }, + { + 0xB712u, + ADI_STRING("PLL: GCNT SDM MCS Timeout"), + ADI_STRING("GCNT SDM MCS Hardware Timeout"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB713u, + ADI_STRING("PLL: GCNT ClkGen MCS Timeout"), + ADI_STRING("GCNT Clkgen MCS Hardware Timeout"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB714u, + ADI_STRING("PLL: Forced ALC Enable-Disable Timeout"), + ADI_STRING("Forced ALC Enable-Disabled Hardware Timeout"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xB715u, + ADI_STRING("PLL: Unable to lookup and set the PLL modulus value"), + ADI_STRING("Device clock must be divisable by 122.88 or 184.32 MHz"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check that device clock setting is supported") + }, + { + 0xB716u, + ADI_STRING("PLL: clock rate exceeded the design limit"), + ADI_STRING("PLL clock rate must be < 250 MHz"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + /*!< -------- JESD Section Base Error Code = 0xB800 ------ */ + { + 0xB801u, + ADI_STRING("JESD: Serializer Lane Overlap"), + ADI_STRING("Incorrect Serializer Lane assignment"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB802u, + ADI_STRING("JESD: Deserializer Lane Overlap"), + ADI_STRING("Incorrect Deserializer Lane assignment"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB803u, + ADI_STRING("JESD: Framer Invalid Sample Rate"), + ADI_STRING("Incorrect Framer Sample Rate in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB804u, + ADI_STRING("JESD: Link sharing Invalid Sample Rate"), + ADI_STRING("Incorrect Link sharing Sample Rate in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB805u, + ADI_STRING("JESD: Deframer Invalid Sample Rate"), + ADI_STRING("Incorrect Deframer Sample Rate in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB806u, + ADI_STRING("JESD: Invalid Framer Sync Pad Configuration"), + ADI_STRING("Incorrect Framer Sync pad Configuration provided"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB807u, + ADI_STRING("JESD:Invalid Deframer Sync Pad Configuration"), + ADI_STRING("Incorrect Deframer Sync pad Configuration provided"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB808u, + ADI_STRING("JESD: Framer 0 must be Enabled"), + ADI_STRING("Framer 0 is not used in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB809u, + ADI_STRING("JESD: Invalid Framer Sample Crossbar entry"), + ADI_STRING("Invalid Framer Sample Crossbar entry in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB80Au, + ADI_STRING("JESD:Invalid Framer Link layer mode of Operation"), + ADI_STRING("Invalid Framer mode Parameter in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB80Bu, + ADI_STRING("JESD: Invalid Deframer Sample Crossbar entry"), + ADI_STRING("Invalid Deframer Sample Crossbar entry in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB80Cu, + ADI_STRING("JESD: Invalid Deframer Link layer mode of Operation"), + ADI_STRING("Invalid Deframer mode Parameter in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB80Du, + ADI_STRING("JESD: Framer S Parameter is not a power of 2"), + ADI_STRING("Invalid Framer S Parameter in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB80Eu, + ADI_STRING("JESD: Deframer S Parameter is not a power of 2"), + ADI_STRING("Invalid Deframer S Parameter in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB80Fu, + ADI_STRING("JESD: Invalid Framer Configuration"), + ADI_STRING("Invalid Framer Configuration detected by the JESD Hardware block"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB810u, + ADI_STRING("JESD: Invalid Deframer Configuration"), + ADI_STRING("Invalid Deframer Configuration detected by the JESD Hardware block"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB811u, + ADI_STRING("JESD: Invalid Sample Crossbar"), + ADI_STRING("Invalid Link sharing Sample Crossbar entry in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB812u, + ADI_STRING("JESD: Unsupported Frequency Divide Ratio"), + ADI_STRING("Invalid Frequency Parameter in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB813u, + ADI_STRING("JESD: Invalid Frequency"), + ADI_STRING("Invalid Frequency Parameter provided in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB814u, + ADI_STRING("JESD: Invalid number of converters"), + ADI_STRING("Invalid number of converters specified in the Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB815u, + ADI_STRING("JESD: Invalid Serializer Lane selected"), + ADI_STRING("Invalid Serializer Lane selected"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB816u, + ADI_STRING("JESD: Invalid Serializer Lane Parameter"), + ADI_STRING("Invalid Serializer Lane Parameter"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xB817u, + ADI_STRING("JESD: Serializer Clock offset calibration failed"), + ADI_STRING("JESD: Serializer Clock offset calibration failed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + /*!< -------- UART Section Base Error Code = 0xB900 ------ */ + { + 0xB901u, + ADI_STRING("UART: Invalid SCLK Frequency"), + ADI_STRING("SCLK is too low for configured UART bit Rate, check Device clock Settings"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Increase SCLK Frequency and try again.") + }, + /*!< -------- Tx Attenuation Driver Section Base Error Code = 0xBA00 ------ */ + { + 0xBA01u, + ADI_STRING("TxAttenDrv: Must be in SPI mode to accesses this mode"), + ADI_STRING("Invalid Tx attenuation mode selected"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Select SPI Mode before changing Tx Attenuation") + }, + { + 0xBA02u, + ADI_STRING("TxAttenDrv: Invalid HP attenuation value, attenuation max exceeded"), + ADI_STRING("Invalid HP attenuation value"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Select HP value within Range") + }, + /*!< -------- TxLolDrv Section Base Error Code = 0xBB00 ------ */ + { + 0xBB01u, + ADI_STRING("TxLolDrv: Attempted second accumulation before the first completed"), + ADI_STRING("Tx LOL Calibration state machine bug"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Stop and restart TxLOL tracking Calibration") + }, + { + 0xBB02u, + ADI_STRING("TxLolDrv: Attempted to read results before accumulator had halted"), + ADI_STRING("Tx LOL Calibration firmware/Hardware handshake problem"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Stop and restart TxLOL tracking Calibration") + }, + { + 0xBB04u, + ADI_STRING("TxLolDrv: Cannot configure TX LOL clock faster than ORX LOL clock"), + ADI_STRING("External Tx LOL observations not supported with the current Profile"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Device Profile and restart the Device") + }, + { + 0xBB05u, + ADI_STRING("TxLolDrv:Observation Channel is unsupported"), + ADI_STRING("External Tx LOL observations do not support this ORx Channel"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check TX to ORx mapping") + }, + /*!< -------- Gpio Driver Section Base Error Code = 0xBD00 ------ */ + { + 0xBD01u, + ADI_STRING("GpioDrv: Invalid signal ID provided"), + ADI_STRING("Invalid signal ID provided"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xBD02u, + ADI_STRING("GpioDrv: Invalid GPIO pin number provided"), + ADI_STRING("Invalid GPIO pin number provided"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xF101u, + ADI_STRING("DDCC: HW in unexpected state"), + ADI_STRING("DDCC HW error"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reprogram the Device using a Valid Package and try again. Contact ADI if the problem persists.") + }, + { + 0xF102u, + ADI_STRING("DDCC: HW SM in unexpected state"), + ADI_STRING("DDCC HW State Machine error"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reprogram the Device using a Valid Package and try again. Contact ADI if the problem persists.") + }, + { + 0xF103u, + ADI_STRING("DDCC: CAL Filter CM in unexpected state"), + ADI_STRING("DDCC HW CAL Filter CM error"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reprogram the Device using a Valid Package and try again. Contact ADI if the problem persists.") + }, + /*!< -------- System Section Base Error Code = 0xFF00 ------ */ + { + 0xFF01u, + ADI_STRING("System: General-Purpose Timer Error"), + ADI_STRING("Software Timer allocation failure."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF02u, + ADI_STRING("System: Generic Mailbox Error"), + ADI_STRING("Unspecified Mailbox Error"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF03u, + ADI_STRING("System: Mailbox Busy Error"), + ADI_STRING("The requested Mailbox Hardware is in use and cannot receive commands"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Rerun feature. If the problem persists reset and try again. Contact ADI if the problem persists.") + }, + { + 0xFF04u, + ADI_STRING("System: Invalid Mailbox Handle"), + ADI_STRING("Mailbox Operation requested on an Invalid Mailbox"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF05u, + ADI_STRING("System: Invalid Mailbox Link Number"), + ADI_STRING("Mailbox Operation requested on an Invalid Mailbox Link"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF06u, + ADI_STRING("System: Mailbox Link busy"), + ADI_STRING("The requested Mailbox Link is in use and cannot receive commands"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Rerun feature. If the problem persists reset and try again. Contact ADI if the problem persists.") + }, + { + 0xFF07u, + ADI_STRING("System: Mailbox Command too large for Link buffer"), + ADI_STRING("Command payload is unexpectedly too large for Mailbox buffer"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF08u, + ADI_STRING("System: Mailbox Command Invalid transaction ID"), + ADI_STRING("Mailbox received a Command with an Invalid transaction ID, most likely a duplicate Command."), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Rerun feature. If the problem persists reset and try again. Contact ADI if the problem persists.") + }, + { + 0xFF09u, + ADI_STRING("System: Invalid CPU ID specified"), + ADI_STRING("Given CPU ID Parameter is Invalid."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reprogram the CPU firmware image. If the problem persists contact ADI") + }, + { + 0xFF0Au, + ADI_STRING("System: Null Pointer Detected"), + ADI_STRING("Programmed image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reprogram the CPU firmware image. If the problem persists contact ADI") + }, + { + 0xFF0Bu, + ADI_STRING("System: O/S Task Create Error"), + ADI_STRING("Invalid Parameters passed to the Task Create API"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF0Cu, + ADI_STRING("System: RAM Lock Error"), + ADI_STRING("RAM Lock Procedure not followed for Data Capture"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF0Du, + ADI_STRING("System: RAM Unlock Error"), + ADI_STRING("RAM Unlock Procedure not followed for Data Capture"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF0Eu, + ADI_STRING("System: Invalid Control Command Argument"), + ADI_STRING("Invalid Control Command Argument"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Verify Command Argument is correct and try again.") + }, + { + 0xFF0Fu, + ADI_STRING("System: Initialization Calibration Startup Error"), + ADI_STRING("Initialization Calibration Startup Error"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF14u, + ADI_STRING("System: Aborted Initialization Calibration"), + ADI_STRING("Initialization Calibration was Aborted by Command"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Rerun the Initialization Calibrations") + }, + { + 0xFF15u, + ADI_STRING("System: Initialization Calibration Warm Boot Checksum Error"), + ADI_STRING("Initialization Calibration Warm Boot Data Image is corrupted"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Rerun Initialization Calibration") + }, + { + 0xFF16u, + ADI_STRING("System: Initialization Calibration Invalid Channel mask Error"), + ADI_STRING("Channel numbers that are not Enabled in the Profile are selected in the Channel mask"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Rerun the Initialization Calibration with correct Channel mask") + }, + { + 0xFF17u, + ADI_STRING("System: Initialization Calibration Invalid Calibration mask Error"), + ADI_STRING("The Initialization Calibration mask might have unsupported Calibrations"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Rerun the Initialization Calibration with correct Calibration mask") + }, + { + 0xFF18u, + ADI_STRING("System: Initialization Calibration Busy"), + ADI_STRING("Initialization Calibration Command is sent again while one is in progress"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Make sure not to send the Initialization Calibration Command while one is in progress.") + }, + { + 0xFF19u, + ADI_STRING("System: Profile Checksum Failed or bad Profile wrt to EFUSE"), + ADI_STRING("The Device Profile image is corrupted. Original image may be Invalid or may have been corrupted during SPI transfer."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reprogram the Device Profile image. If the problem persists contact ADI") + }, + { + 0xFF1Au, + ADI_STRING("System: Profile product ID doesn't match Profile product ID"), + ADI_STRING("The Device Profile is not valid for this Product"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Reprogram the Device with a Valid Profile Image. If the problem persists contact ADI") + }, + { + 0xFF1Cu, + ADI_STRING("System: Could not create the event"), + ADI_STRING("Invalid Event Parameters are passed to the OS call"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF1Du, + ADI_STRING("System: Could not create the Queue"), + ADI_STRING("Invalid Queue Parameters are passed to the OS call"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF1Eu, + ADI_STRING("System: Could not create the Timer"), + ADI_STRING("Invalid Timer Parameters are passed to the OS call."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF1Fu, + ADI_STRING("System: Failed to post the message"), + ADI_STRING("Message Queue Full"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF20u, + ADI_STRING("System: Failed to receive the message"), + ADI_STRING("Invalid Queue Parameters are passed to the OS call"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF24u, + ADI_STRING("System: Commands sent to task that does not exist"), + ADI_STRING("This can happen if a Command is sent to a Channel that is not Enabled in the Profile or disabled."), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Rerun the feature with the correct Channel mask.") + }, + { + 0xFF25u, + ADI_STRING("System: Invalid Control Command"), + ADI_STRING("Invalid Control Command Received"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Rerun the feature with the correct Command.") + }, + { + 0xFF26u, + ADI_STRING("System: Insufficient Memory available for the Requested Operation"), + ADI_STRING("This can happen if an insufficient buffer size is sent for a Command. For example get Configuration or get Calibration status."), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Rerun the Command with the correct buffer size allocated.") + }, + { + 0xFF27u, + ADI_STRING("System: Invalid Calibration Control Command"), + ADI_STRING("Invalid Control Command Sent to Calibration"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Rerun the Calibration with the Correct Control Command") + }, + { + 0xFF28u, + ADI_STRING("System: Invalid Calibration Set Configuration"), + ADI_STRING("Invalid Set Configuration sent to Calibration"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Ensure Input Parameters are correct") + }, + { + 0xFF29u, + ADI_STRING("System: Invalid Calibration Get Configuration"), + ADI_STRING("Invalid Get Configuration sent to Calibration"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Ensure Input Parameters are correct") + }, + { + 0xFF2Au, + ADI_STRING("System: Invalid Calibration Get Status Command"), + ADI_STRING("Invalid Get Status Command sent to Calibration"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Control Command is Supported") + }, + { + 0xFF2Bu, + ADI_STRING("System: The given Channel is not Enabled in the Profile"), + ADI_STRING("This can happen if a Channel is not Enabled in the Profile is getting Enabled or disabled."), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Ensure Input Parameters are correct") + }, + { + 0xFF2Cu, + ADI_STRING("System: Invalid Configuration Object"), + ADI_STRING("Invalid Set Configuration Command for Configuration Object ID"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Ensure Input Parameters are correct") + }, + { + 0xFF2Du, + ADI_STRING("System: Invalid Configuration Data Size"), + ADI_STRING("Invalid Configuration Data Size for Module Configuration Buffer Size"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Ensure Input Parameters are correct") + }, + { + 0xFF2Eu, + ADI_STRING("System: Invalid Configuration Offset"), + ADI_STRING("Invalid Offset Sent with Configuration Command"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Ensure Input Parameters are correct") + }, + { + 0xFF2Fu, + ADI_STRING("System: Invalid Configuration State"), + ADI_STRING("Cannot Update Configuration while Initialization Calibrations are Running"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Rerun the Configuration Command after the Initialization Calibrations are complete.") + }, + { + 0xFF51u, + ADI_STRING("System: CPU HAL Feature not Implemented"), + ADI_STRING("CPU HAL Feature not Implemented"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF52u, + ADI_STRING("System: HAL Invalid Channel"), + ADI_STRING("Invalid Channel Configuration in Profile or an Invalid Channel requested"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Verify Channel Configuration and reprogram the Device Profile Image") + }, + { + 0xFF53u, + ADI_STRING("System: HAL Invalid LO"), + ADI_STRING("Invalid PLL chosen for LO. This could be due to corrupted program memory"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF54u, + ADI_STRING("System: AHB (Common) Error detected"), + ADI_STRING("Invalid SPI address access either an Invalid address or span of registers"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Verify address and Range are correct for the SPI region being accessed") + }, + { + 0xFF55u, + ADI_STRING("System: AHB (CPU0) Error detected"), + ADI_STRING("CPU0 accessing Invalid memory address or Range"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xFF56u, + ADI_STRING("System: AHB (CPU1) Error detected"), + ADI_STRING("CPU1 accessing Invalid memory address or Range"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xFF57u, + ADI_STRING("System: Internal Multi-chip Sync (MCS) Failed to complete"), + ADI_STRING("MCS Hardware did not complete synchronization in the allotted time"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF58u, + ADI_STRING("System:Primary CPU detected secondary CPU(s) boot failure"), + ADI_STRING("Secondary core not completing boot"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF59u, + ADI_STRING("System: Utilities Timer Internal Error"), + ADI_STRING("RTOS Task Scheduler not running for Timer request"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF5Au, + ADI_STRING("System: LOGEN Invalid LO Input/Output Configuration"), + ADI_STRING("User selected an Invalid LOGEN Configuration, verify Device Profile/Configurator settings"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Ensure Input Parameters are correct") + }, + { + 0xFF5Cu, + ADI_STRING("System: Intentional crash, from force exception Command"), + ADI_STRING("API Command sent to force an exception in the CPU"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("This is a deliberate forced Error") + }, + { + 0xFF5Du, + ADI_STRING("System: Configuration locked, for updating"), + ADI_STRING("The Configuration is not unlocked before sending the Configuration Command"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Unlock the Configuration and resend the Configuration Command") + }, + { + 0xFF5Eu, + ADI_STRING("System: The given key to unlock Configuration did not match with the key in current package"), + ADI_STRING("The Configuration key did not match required key to unlock"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Use the correct key given by ADI and try to unlock the Configuration again") + }, + { + 0xFF5Fu, + ADI_STRING("System: Number of Configuration update limit reached"), + ADI_STRING("Reached the limit of the number Configuration commands allowed"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset the Device to send new set of Configuration Parameters") + }, + { + 0xFF60u, + ADI_STRING("System: The given key to enter debug mode did not match with the key to enter debug mode"), + ADI_STRING("The debug key did not match required key to unlock."), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Try to send the Command again with the right Debug key. Contact ADI to get the correct key if the problem persists.") + }, + { + 0xFF61u, + ADI_STRING("System: The Set Control Command length is less than expected or greater than max data size allowed"), + ADI_STRING("The control Command buffer is greater than the supported size"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Change the size of the control Command payload or increase the control Command buffer size.") + }, + { + 0xFF62u, + ADI_STRING("System: Watchdog Timer expired, system is unresponsive"), + ADI_STRING("Not all firmware tasks completed in the expected time frame."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Collect memory dump to provide debug information and reset Device.") + }, + { + 0xFF63u, + ADI_STRING("System: Shared memory Mutex Timeout"), + ADI_STRING("This could happen if the shared Mutex cannot be obtained within the Timeout period"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF64u, + ADI_STRING("System: The given index to the SW Breakpoint Table is out of Range"), + ADI_STRING("Unexpected SW Breakpoint Table Index"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF65u, + ADI_STRING("System: Shared memory Mutex already taken"), + ADI_STRING("This could happen if trying to take the Mutex which is already taken"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF66u, + ADI_STRING("System: Shared memory Mutex released without owning it"), + ADI_STRING("This could happen if trying to release the Mutex which is not owned"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF67u, + ADI_STRING("System: This system is being configured to support too many channels per CPU"), + ADI_STRING("This is a Configurator Channel enable issue"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Check the Profile and the Configurator logic") + }, + { + 0xFF68u, + ADI_STRING("System: The given status size is Invalid"), + ADI_STRING("The user requested the status size larger than supported size."), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Change the size of the status Command buffer size.") + }, + { + 0xFF69u, + ADI_STRING("System: Initialization and tracking start-up functions still running"), + ADI_STRING("The Control task waits a predefined amount of time which is not long enough"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Increase the Timeout in the FW Control task.") + }, + { + 0xFF6Au, + ADI_STRING("System: Invalid Debug Command"), + ADI_STRING("Invalid Debug Command Provided"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Debug Command is Supported. Contact ADI to get the correct Command if the problem persists.") + }, + { + 0xFF6Bu, + ADI_STRING("System: Invalid Debug Command Parameter"), + ADI_STRING("Invalid Debug Command Parameter Provided"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Debug Command Parameter is Supported. Contact ADI to get the correct info if the problem persists.") + }, + { + 0xFF6Cu, + ADI_STRING("System: HAL Tx attenuation Restore Failed"), + ADI_STRING("Cannot restore Tx attenuation because the settings were not saved"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("Reset Feature and try again. If the problem persists acquire a Memory Dump and contact ADI") + }, + { + 0xFF6Du, + ADI_STRING("System: Invalid Calibration Debug Control Command"), + ADI_STRING("Invalid Debug Control Command sent to Calibration Feature"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Check Control Command is Supported") + }, + { + 0xFF6Eu, + ADI_STRING("System: The health monitor memory allocation is not large enough for the current number of tasks"), + ADI_STRING("The number of RTOS tasks is greater than expected."), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Allocate the required health monitor memory for the number of RTOS tasks") + }, + { + 0xFF6Fu, + ADI_STRING("System: Semaphore Create Failure"), + ADI_STRING("System Failed to Create Semaphore"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF70u, + ADI_STRING("System: Semaphore Take Failure"), + ADI_STRING("System Failed to Take Semaphore"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF71u, + ADI_STRING("System: Simulated Error"), + ADI_STRING("Simulated System Error Condition for Internal Testing"), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF72u, + ADI_STRING("System: Unexpected Silicon Revision Detected"), + ADI_STRING("Using Incompatible Hardware with Current Version of Software"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF73u, + ADI_STRING("System: Radio Loopback requested but being used"), + ADI_STRING("A Calibration is already using a radio Loopback"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Verify Calibration logic to find multiple request") + }, + { + 0xFF74u, + ADI_STRING("System: System Timer stop Error"), + ADI_STRING("System Timer didn't stop within Timeout"), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF75u, + ADI_STRING("System: Tracking Calibration did not suspend without Timeout"), + ADI_STRING("The tracking Calibration Failed to suspend within the expected time."), + ADI_ADRV903X_ERR_ACT_RESET_FEATURE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF76u, + ADI_STRING("System: Only primary CPU supports EFUSE commands"), + ADI_STRING("Sent EFUSE Command to secondary CPU."), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("API Error. Contact ADI.") + }, + { + 0xFF77u, + ADI_STRING("System: The full Profile is only available during CPU0 boot-up"), + ADI_STRING("Full Profile gets erased after CPU0 boot-up."), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Don't use full Profile after boot-up.") + }, + { + 0xFF78u, + ADI_STRING("System: Semaphore give Operation failure"), + ADI_STRING("This could happen because the system Failed in giving the semaphore."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("If the Problem Persists, Acquire a Memory Dump and Contact ADI") + }, + { + 0xFF79u, + ADI_STRING("System: Unable to read EFUSE"), + ADI_STRING("The EFUSE read did not occur."), + ADI_ADRV903X_ERR_ACT_RESET_DEVICE, + ADI_STRING("Reset Device and try again. If the problem persists contact ADI") + }, + { + 0xFF7Au, + ADI_STRING("System: Profile product ID doesn't support SBET"), + ADI_STRING("The Device Profile is not valid for this Product"), + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_STRING("Reprogram the Device with a Valid Profile Image. If the problem persists contact ADI") + }, +/* END AUTOGENERATED CPU RUNTIME ERROR TABLE */ +}; + +#endif /* _ADRV903X_CPU_ERROR_TABLES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_error_tables_template.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_error_tables_template.h new file mode 100644 index 0000000000000..8485944215c8f --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_error_tables_template.h @@ -0,0 +1,39 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file + * + * \brief + * + * \details + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_CPU_ERROR_TABLES_H_ +#define _ADRV903X_CPU_ERROR_TABLES_H_ + +#include "adi_common_error.h" +#include "adi_adrv903x_error_types.h" + +const adrv903x_CpuBootErrCodes_t adrv903x_CpuBootErrTable[] = +{ +/* DO NOT EDIT THIS TABLE, CHANGES WILL BE OVERWRITTEN DURING FULL BUILD */ +/* START AUTOGENERATED CPU BOOT ERROR TABLE */ +#error Firmware build (genErrorInfo.bat) needs to be run to autogenerate CPU boot error table! +/* END AUTOGENERATED CPU BOOT ERROR TABLE */ +}; + +const adrv903x_CpuRuntimeErrCodes_t adrv903x_CpuRunTimeErrTable[] = +{ +/* DO NOT EDIT THIS TABLE, CHANGES WILL BE OVERWRITTEN DURING FULL BUILD */ +/* START AUTOGENERATED CPU RUNTIME ERROR TABLE */ +#error Firmware build (genErrorInfo.bat) needs to be run to autogenerate CPU boot error table! +/* END AUTOGENERATED CPU RUNTIME ERROR TABLE */ +}; + +#endif /* _ADRV903X_CPU_ERROR_TABLES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_fw_rev_info_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_fw_rev_info_types.h new file mode 100644 index 0000000000000..73b69d76134a2 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_fw_rev_info_types.h @@ -0,0 +1,43 @@ +/** + * \file adrv903x_cpu_fw_rev_info_types.h + * + * \brief Contains device revision information. + * + * \details Contains device revision information. + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_CPU_FW_REV_INFO_TYPES_H__ +#define __ADRV903X_CPU_FW_REV_INFO_TYPES_H__ + +#include "adi_adrv903x_platform_pack.h" + +/* + ******************************************************************************************************** + * Declarations used below to reference global data + ******************************************************************************************************** + */ +ADI_ADRV903X_PACK_START +typedef struct adrv903x_DeviceRevisionData +{ + uint32_t majorRev; + uint32_t minorRev; + uint32_t maintRev; + uint32_t buildNum; + uint32_t buildType; + uint8_t gitHash[41]; + uint8_t branchInfo[80]; + uint32_t reserved[12]; +} adrv903x_DeviceRevisionData_t; +ADI_ADRV903X_PACK_FINISH + +#endif /* __ADRV903X_CPU_FW_REV_INFO_TYPES_H__*/ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_health_monitor_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_health_monitor_types.h new file mode 100644 index 0000000000000..ce252311f29f2 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_health_monitor_types.h @@ -0,0 +1,41 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2020 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adrv903x_cpu_health_monitor_types.h + * + * \brief Contains ADRV903X Private CPU Health Monitor data types + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_CPU_HEALTH_MONITOR_TYPES_H__ +#define __ADRV903X_CPU_HEALTH_MONITOR_TYPES_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cpu_error_codes_types.h" + +/** + * \brief Health Monitor Private structure for a single CPU. No defined private data to include yet. + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_HealthMonitorPrivateCpuStatusSingle +{ + uint8_t dummyField; /*!< Dummy field */ +} adrv903x_HealthMonitorPrivateCpuStatusSingle_t;) + +/** + * \brief Health Monitor Private structure for all CPUs + */ +ADI_ADRV903X_PACKED( +typedef struct adrv903x_HealthMonitorPrivateCpuStatus +{ + adrv903x_HealthMonitorPrivateCpuStatusSingle_t cpu0; /*!< Private CPU Health Monitor Status info for CPU0 */ + adrv903x_HealthMonitorPrivateCpuStatusSingle_t cpu1; /*!< Private CPU Health Monitor Status info for CPU1 */ +} adrv903x_HealthMonitorPrivateCpuStatus_t;) + +#endif /* __ADRV903X_CPU_HEALTH_MONITOR_TYPES_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_macros.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_macros.h new file mode 100644 index 0000000000000..e1fd42898570a --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_macros.h @@ -0,0 +1,42 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adrv903x_cpu_macros.h + * \brief Contains ADRV903X API miscellaneous macro definitions for CPU + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_CPU_MACROS_H_ +#define _ADRV903X_CPU_MACROS_H_ + +#include "adi_library_types.h" +#include "adrv903x_cpu_memory.h" + +#define ADRV903X_CPU_0MD_ERRCODE(armOpCode, armObjId, armErrorFlag) \ + ((armOpCode << ADRV903X_CPU_OPCODE_SHIFT) | \ + (armObjId << ADRV903X_CPU_OBJ_ID_SHIFT) | \ + armErrorFlag) + +#define ADRV903X_CPU_OPCODE_VALID(a) \ + (((a) != 0) && (((a) % 2) || ((a) > 30))) + +/* CPU memory map */ +#define ADRV903X_CPU_0_ADDR_PROG_START (ADRV903X_CPU0_PM_START) + +/* CPU memory map */ +#define ADRV903X_CPU_1_ADDR_PROG_START (ADRV903X_CPU1_PM_START) + +/* CPU FW version address */ +#define ADRV903X_ADDR_FW_VERSION (ADRV903X_PM_DEVICE_REV_DATA) + +#define ADRV903X_MAX_CPU_FW_PATH 128u +#define ADRV903X_CPU_FW_PATH_SEP ';' + +#define ADRV903X_CPU_STREAM_TRIGGER_OPCODE 0x1FU + + +#endif /* _ADRV903X__MACROS_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_memory.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_memory.h new file mode 100644 index 0000000000000..6df7198d1a723 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_memory.h @@ -0,0 +1,171 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adrv903x_cpu_memory.h + * + * \brief Contains CPU memory tables + * + * \details Contains CPU memory tables and a few configuration constants. + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_CPU_MEMORY_H__ +#define __ADRV903X_CPU_MEMORY_H__ + +/* CPU0/CPU1 program and data memory starting addresses */ +#define ADRV903X_CPU0_PM_START (0x01000000U) +#define ADRV903X_CPU0_DM_START (0x20000000U) + +#define ADRV903X_CPU1_PM_START (0x02000000U) +#define ADRV903X_CPU1_DM_START (0x21000000U) + +/* CPU program and data memory physical sizes */ +#define ADRV903X_CPU_PM_SIZE (0x50000U) +#define ADRV903X_CPU_DM_SIZE (0x40000U) + +/* CPU program and data memory limits (virtual sizes) */ +#define ADRV903X_CPU_PM_LIMIT (0x50000U) +#define ADRV903X_CPU_DM_LIMIT (0x40000U) + +/* Ensure limits are within the physical memory limits */ +#if ADRV903X_CPU_PM_LIMIT > ADRV903X_CPU_PM_SIZE +#error "ADRV903X_CPU_PM_LIMIT must be <= ADRV903X_CPU_PM_SIZE" +#endif +#if ADRV903X_CPU_DM_LIMIT > ADRV903X_CPU_DM_SIZE +#error "ADRV903X_CPU_DM_LIMIT must be <= ADRV903X_CPU_DM_SIZE" +#endif + +/* CPU0/CPU1 memory bank setting for the l1mem0_shared_bank_div_ctrl + * and l1mem1_shared_bank_div_ctrl registers. + * + * Possible values: + * IRAM_288K_DRAM_288K: 0x00U + * IRAM_224K_DRAM_352K: 0x01U + * IRAM_256K_DRAM_320K: 0x02U + * IRAM_320K_DRAM_256K: 0x03U + * IRAM_352K_DRAM_224K: 0x04U + */ +#define ADRV903X_CPU_MEM_BANK_CTRL_REG_VAL (0x03U) + +/** Regular for the format of CPU memory MACRO definition: + * 1. If the memory belongs both to CPU0 and CPU1, or ignore the CPU index, the MACRO should contain the 'PM' or 'DM' + * to point out which kind of memory it belongs to + * 2. If the memory belongs to a specific CPU, the MACRO should contains the 'CPU_0' or 'CPU_1' to indicate + * which CPU it belongs to, and contain the 'PM' or 'DM' to indicate which kind of memory it belongs to + */ + +/** + * The following memory definitions are in the ADRV903X CPU 0 program memory range (before application): + * ADRV903X_CPU0_PM_START to ADRV903X_CPU0_PM_START + (ADRV903X_CPU_PM_SIZE - ADRV903X_CPU_PM_LIMIT) - 1 + * -> (0x01000000 to 0x01004FFF) + * + * Any access of this M4 memory via shared memory must account for 64-bit alignment when dereferencing pointers + * and when accessing 64-bit data, such as in a struct. With a struct, 64-bit members must be 64-bit + * aligned, and therefore not packed. + * + * Any pointers that are shared must be on a 64-bit boundary since they will be read with a 64-bit register. + * After the pointer is read, it must be masked to only use the lower 32-bits. + * + * Example: + * + * \code + * // runtime values from BBIC/Radio Processor + * _adi_svc_ProfileRuntimeProfile_t *pRuntimeProfile = *((_adi_svc_ProfileRuntimeProfile_t**)_ADI_SVC_CMN_CPU_1_PM_RUNTIME_PROFILE_PTR); + * + * // the pointer is read as a 64-bit value, but the pointer is 32-bits + * pRuntimeProfile = (_adi_svc_ProfileRuntimeProfile_t *)((uint64_t)pRuntimeProfile & 0xFFFFFFFFUL); + * \endcode + */ + +#define ADRV903X_CPU_0_PM_EXCEPTION_FLAG (0x01000398U) /*!< CPU 0 ARM exception status */ + +#define ADRV903X_PM_DEBUG_CONFIG_BUF (0x010003A4U) /*!< JTAG Enable flag */ +#define ADRV903X_PM_DEVICE_REV_DATA (0x010003A8U) /*!< Firmware version */ + +#define ADRV903X_CPU_0_PM_CHECKSUM (0x01000468U) /*!< Run-time checksum (ADRV903X_PM_DEVICE_REV_DATA + size of RevData) */ + +#define ADRV903X_PM_SW_BKPT_TABLE_PTR (0x0100048CU) /*!< Breakpoint table pointer */ +#define ADRV903X_PM_SW_BKPT_GLOBAL_HALT_MASK_PTR (0x01000490U) /*!< Global Halt Mask pointer */ + +#define ADRV903X_CPU_0_PM_TRACKING_CAL_TASK_INFO (0x01000494U) /*!< Tracking cal info */ +#define ADRV903X_CPU_0_PM_TRACKING_CAL_TASK_DATA (0x01000498U) /*!< Tracking cal Data */ +#define ADRV903X_CPU_0_PM_INIT_CAL_TASK_INFO (0x0100049CU) /*!< Init cal info/status */ +#define ADRV903X_CPU_0_PM_ERROR_STATUS (0x010004A0U) /*!< Error status */ + +#define ADRV903X_CPU_0_PM_CONFIG_LOG (0x010004A4U) /*!< Configuration framework log */ +#define ADRV903X_CPU_0_PM_INIT_CAL_DATA (0x010004A8U) /*!< Location of the initial cal data */ +#define ADRV903X_CPU_0_PM_CMD_LOG (0x010004ACU) /*!< Command log record */ +#define ADRV903X_CPU_0_PM_TCB_TABLE (0x010004B0U) /*!< TCB buff table */ +#define ADRV903X_CPU_0_PM_CURR_TASK_HANDLE (0x010004B4U) /*!< Current task handle */ +#define ADRV903X_CPU_0_PM_SYS_CLOCK (0x010004B8U) /*!< System clock config */ +#define ADRV903X_PM_HEALTH_STATUS_PTR (0x010004BCU) /*!< Health monitors status pointer */ + +/* Range from 0x010004C0U to 0x010004E8U are defined below */ + + + +#define ADRV903X_CPU_0_PM_EFUSE_SETTINGS_PTR (0x010004ECU) /*!< eFUSE system settings - CPU 0 */ + +#define ADRV903X_CPU_0_PM_RADIO_SEQ_SEQUENCE_SIZE (0x010004F0U) +#define ADRV903X_CPU_0_PM_RADIO_SEQ_BUILD_TIME_CRC (0x010004F4U) + +#define ADRV903X_PM_CORE_SCRATCH_EXT_PTR (0x01000508U) /*!< Extended core scratch registers pointer: MUST be 8 byte aligned! */ + +/** + * The following memory definitions are in the ADRV903X CPU 1 program memory range (before application): + * ADRV903X_CPU1_PM_START to ADRV903X_CPU1_PM_START + (ADRV903X_CPU_PM_SIZE - ADRV903X_CPU_PM_LIMIT) - 1 + * -> (0x02000000 to 0x02004FFF) + * + * Any pointers that are shared must be on a 64-bit boundary since they will be read with a 64-bit register. + * After the pointer is read, it must be masked to only use the lower 32-bits. + * See example above. + */ + +#define ADRV903X_CPU_1_PM_EXCEPTION_FLAG (0x02000398U) /*!< CPU 1 ARM exception status */ + +/* 0x020003A4U is available */ + +#define ADRV903X_CPU_1_PM_TRACKING_CAL_TASK_INFO (0x020003A8U) /*!< Tracking cal info */ +#define ADRV903X_CPU_1_PM_TRACKING_CAL_TASK_DATA (0x020003ACU) /*!< Tracking cal Data */ +#define ADRV903X_CPU_1_PM_INIT_CAL_TASK_INFO (0x020003B0U) /*!< Init cal info/status */ +#define ADRV903X_CPU_1_PM_ERROR_STATUS (0x020003B4U) /*!< Error status */ + +#define ADRV903X_CPU_1_PM_CONFIG_LOG (0x020003B8U) /*!< Configuration framework log */ +#define ADRV903X_CPU_1_PM_INIT_CAL_DATA (0x020003BCU) /*!< Location of the initial cal data */ +#define ADRV903X_CPU_1_PM_TCB_TABLE (0x020003C0U) /*!< TCB buff table */ +#define ADRV903X_CPU_1_PM_CURR_TASK_HANDLE (0x020003C4U) /*!< Current task handle */ +#define ADRV903X_CPU_1_PM_SYS_CLOCK (0x020003C8U) /*!< System clock config */ +#define ADRV903X_CPU_1_PM_CHECKSUM (0x020003CCU) /*!< Run-time checksum of CPU 1 */ +#define ADRV903X_CPU_1_PM_CMD_LOG (0x020003D0U) /*!< Command log record */ +#define ADRV903X_CPU_1_PM_RUNTIME_PROFILE_PTR (0x020003D8U) /*!< Runtime profile pointer - shared ptr: must be 64-bit aligned */ +#define ADRV903X_PM_DEVICE_PROFILE_PTR (0x020003E0U) /*!< Device profile pointer - shared ptr: must be 64-bit aligned */ + +/** + * CPU 0 and CPU 1 data memory definitions. + */ + +/* mailbox buffers */ +#define ADRV903X_CPU_0_MAILBOX_NUM_LINKS (1) +#define ADRV903X_CPU_0_DM_MAILBOX_LINK_0_START_ADDR (0x20000000U) +#define ADRV903X_CPU_0_MAILBOX_LINK_0_SIZE (0x400U) + +/* Radio Sequencer Image Size and CRC */ +#define ADRV903X_DM_RSEQ_IMAGE_SIZE (0x20000420U) +#define ADRV903X_DM_RSEQ_IMAGE_CRC (0x20000424U) + +#define ADRV903X_CPU_1_MAILBOX_NUM_LINKS (1) +#define ADRV903X_CPU_1_DM_MAILBOX_LINK_0_START_ADDR (0x21000000U) +#define ADRV903X_CPU_1_MAILBOX_LINK_0_SIZE (0x400U) + +/* __CHECKSUM_ADDR__ OFFSET IN temp.icf */ +#define ADRV903X_CPU_0_PM_CHECKSUM_BUILDTIME (0x0104FFFCU) +#define ADRV903X_CPU_1_PM_CHECKSUM_BUILDTIME (0x0204FFFCU) +#endif /* __ADRV903X_CPU_MEMORY_H__ */ + + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_object_ids_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_object_ids_types.h new file mode 100644 index 0000000000000..d787b7dc13313 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_object_ids_types.h @@ -0,0 +1,143 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + + /** + * \file adrv903x_cpu_object_ids_types.h + * + * \brief Contains CPU Object ID definitions + * + * \details Contains CPU Object ID definitions + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_CPU_OBJECT_IDS_TYPES_H__ +#define __ADRV903X_CPU_OBJECT_IDS_TYPES_H__ + + +#include "adi_library_types.h" + + + +typedef enum adrv903x_CpuObjectId +{ + /* Initial calibrations */ + ADRV903X_CPU_OBJID_IC_START = 0x00u, /*!< Start of Initial Calibration OBJID */ + ADRV903X_CPU_OBJID_IC_RC_TUNER = 0x00u, /*!< RC Tuner */ + ADRV903X_CPU_OBJID_IC_RX_DC_OFFSET = 0x01u, /*!< Rx DC offset */ + ADRV903X_CPU_OBJID_IC_ADC_RX = 0x02u, /*!< ADC Rx */ + ADRV903X_CPU_OBJID_IC_ADC_ORX = 0x03u, /*!< ADC ORx */ + ADRV903X_CPU_OBJID_IC_ADC_TXLB = 0x04u, /*!< ADC Tx Loopback */ + ADRV903X_CPU_OBJID_IC_TXDAC = 0x05u, /*!< TX DAC */ + ADRV903X_CPU_OBJID_IC_TXBBF = 0x06u, /*!< TXBBF */ + ADRV903X_CPU_OBJID_IC_TXLB_PATH_DLY = 0x07u, /*!< TxLB Path delay */ + ADRV903X_CPU_OBJID_IC_TX_ATTEN_CAL = 0x08u, /*!< TX Atten CAL (Gain/Phase) */ + ADRV903X_CPU_OBJID_IC_HRM = 0x09u, /*!< HRM */ + ADRV903X_CPU_OBJID_IC_TXQEC = 0x0Au, /*!< TxQEC init */ + ADRV903X_CPU_OBJID_IC_TXLOL = 0x0Bu, /*!< LOL Internal Init */ + ADRV903X_CPU_OBJID_IC_SERDES = 0x0Cu, /*!< SERDES Initial Cal */ + ADRV903X_CPU_OBJID_IC_RX_TIA = 0x0Du, /*!< RX TIA */ + ADRV903X_CPU_OBJID_IC_TXLB_FILTER = 0x0Eu, /*!< TxLB Filter cal */ + ADRV903X_CPU_OBJID_IC_TEST_0 = 0x0Fu, /*!< Test cal 0, Initial Cal Framework test */ + ADRV903X_CPU_OBJID_IC_TEST_1 = 0x10u, /*!< Test cal 1, Initial Cal Framework test */ + ADRV903X_CPU_OBJID_IC_TXRX_PHASE = 0x11u, /*!< Tx/Rx Phase Cal */ + ADRV903X_CPU_OBJID_IC_RXSPUR = 0x12u, /*!< RxSpur Initial Cal */ + ADRV903X_CPU_OBJID_IC_END = 0x12u, /*!< End of Initial Calibration OBJID */ + ADRV903X_CPU_OBJID_IC_NUM_CALS = (ADRV903X_CPU_OBJID_IC_END - ADRV903X_CPU_OBJID_IC_START + 1u), /*!< number of initial cals */ + + /* Tracking calibrations */ + ADRV903X_CPU_OBJID_TC_START = 0x30u, /*!< Start of Tracking Calibration OBJID */ + ADRV903X_CPU_OBJID_TC_RXQEC = 0x30u, /*!< Rx QEC */ + ADRV903X_CPU_OBJID_TC_TX_LOL = 0x31u, /*!< TX LOL */ + ADRV903X_CPU_OBJID_TC_TXQEC = 0x32u, /*!< Tx QEC */ + ADRV903X_CPU_OBJID_TC_SERDES = 0x33u, /*!< SERDES */ + ADRV903X_CPU_OBJID_TC_INTERNAL_START = 0x34u, /*!< Start of Internal Tracking Calibration OBJID */ + ADRV903X_CPU_OBJID_TC_RX_ADC = 0x34u, /*!< Rx ADC */ + ADRV903X_CPU_OBJID_TC_TXLB_ADC = 0x35u, /*!< TxLb ADC */ + ADRV903X_CPU_OBJID_TC_ORX_ADC = 0x36u, /*!< ORx ADC */ + ADRV903X_CPU_OBJID_TC_RXSPUR = 0x37u, /*!< RxSpur */ + ADRV903X_CPU_OBJID_TC_END = 0x37u, /*!< End of Tracking Calibration OBJID */ + ADRV903X_CPU_OBJID_TC_NUM_CALS = (ADRV903X_CPU_OBJID_TC_END - ADRV903X_CPU_OBJID_TC_START + 1u), /*!< number of tracking cals */ + + /* Configuration objects */ + ADRV903X_CPU_OBJID_CFG_DEVICE_PROFILE = 0x80u, /*!< Configuration profile */ + ADRV903X_CPU_OBJID_CFG_RADIO_EVENT = 0x81u, /*!< Radio events module */ + ADRV903X_CPU_OBJID_CFG_INITIAL_CALS = 0x82u, /*!< Initial Calibration framework configuration */ + ADRV903X_CPU_OBJID_CFG_CAL_SCHEDULER = 0x83u, /*!< Calibration scheduler */ + ADRV903X_CPU_OBJID_CFG_HM = 0x84u, /*!< HM Timer Control */ + ADRV903X_CPU_OBJID_CFG_PARITY_ERROR_CHECK = 0x85u, /*!< Configurable objects for memory refresh */ + ADRV903X_CPU_OBJID_CFG_SYSTEM_CONFIG = 0x86u, /*!< System configuration */ + ADRV903X_CPU_OBJID_CFG_TRACKING_CALS = 0x87u, /*!< Set tracking cal framework configuration */ + ADRV903X_CPU_OBJID_CFG_TELEM = 0x8Cu, /*!< Configure the telemetry logging */ + ADRV903X_CPU_OBJID_CFG_RESERVED3 = 0x8Du, /*!< reserved */ + ADRV903X_CPU_OBJID_CFG_RESERVED4 = 0x8Eu, /*!< reserved */ + ADRV903X_CPU_OBJID_CFG_RESERVED5 = 0x8Fu, /*!< reserved */ + + /* Driver objects ( 0xB0 - 0xBF ) */ + ADRV903X_CPU_OBJID_DRV_NCO = 0xB0u, /*!< NCO */ + ADRV903X_CPU_OBJID_DRV_STREAM = 0xB1u, /*!< Stream */ + ADRV903X_CPU_OBJID_DRV_FSC = 0xB2u, /*!< FSC */ + ADRV903X_CPU_OBJID_DRV_MASTER_BIAS = 0xB3u, /*!< Master Bias */ + ADRV903X_CPU_OBJID_DRV_LDO = 0xB4u, /*!< LDO */ + ADRV903X_CPU_OBJID_DRV_DWT = 0xB5u, /*!< DWT */ + ADRV903X_CPU_OBJID_DRV_TEMP = 0xB6u, /*!< TEMP */ + ADRV903X_CPU_OBJID_DRV_PLL = 0xB7u, /*!< PLL */ + ADRV903X_CPU_OBJID_DRV_JESD = 0xB8u, /*!< JESD */ + ADRV903X_CPU_OBJID_DRV_UART = 0xB9u, /*!< UART */ + ADRV903X_CPU_OBJID_DRV_TXATTEN = 0xBAu, /*!< TXATTEN */ + ADRV903X_CPU_OBJID_DRV_TXLOL = 0xBBu, /*!< TX LOL Accumulator */ + ADRV903X_CPU_OBJID_DRV_RX_CFG = 0xBCu, /*!< Rx Config */ + ADRV903X_CPU_OBJID_DRV_GPIO = 0xBDu, /*!< GPIO */ + ADRV903X_CPU_OBJID_HAL_RADIO = 0xC0u, /*!< HAL_RADIO */ + ADRV903X_CPU_OBJID_DRV_DUMMY = 0xF0u, /*!< Dummy driver object */ + ADRV903X_CPU_OBJID_DRV_DDCC = 0xF1u, /*!< Dummy driver object */ + + /* System objects */ + ADRV903X_CPU_OBJID_SYSTEM_START = 0xFFu, /*!< Start of System OBJID */ + ADRV903X_CPU_OBJID_SYSTEM_ERROR = 0xFFu, /*!< System error */ + ADRV903X_CPU_OBJID_SYSTEM_END = 0xFFu /*!< End of System OBJID */ + +} adrv903x_CpuObjectId_e; + +typedef uint32_t adrv903x_CpuObjectId_t; + +/* Object Groups */ +typedef enum adrv903x_CpuCalibrationsObjectGroup +{ + ADRV903X_CPU_OBJECT_CONFIG_INIT_CALS = 0u, /*!< Group 0 range 0x00 - 0x1f */ + ADRV903X_CPU_OBJECT_CONFIG_TRACKING_CALS, /*!< Group 1 range 0x20 - 0x3f */ + ADRV903X_CPU_OBJECT_CONFIG_CTRL, /*!< Group 4 range 0x80 - 0x9f */ + ADRV903X_CPU_NUM_OBJECT_GROUPS +} adrv903x_CpuCalibrationsObjectGroup_e; + + +/* Mask to get the Initial cal object ID */ +#define ADRV903X_CPU_INITCAL_OBJECT_ID_MASK (0x1Fu) + +/* Subtract the first tracking cal object ID to convert object ID to array index */ +#define ADRV903X_CPU_TRACKING_CAL_OBJ_TO_IDX(x) ((x) - ADRV903X_CPU_OBJID_TC_START) + +/* Add the first tracking cal object ID to convert array index to object ID */ +#define ADRV903X_CPU_TRACKING_CAL_IDX_TO_OBJ(x) ((x) + ADRV903X_CPU_OBJID_TC_START) + +/* Add the first system status object ID to convert array index to object ID */ +#define ADRV903X_CPU_SYS_STATUS_IDX_TO_OBJ(x) ((x) + ADRV903X_CPU_OBJID_SYSTEM_START) + +/* Convert an init cal object ID to a cal bitmask */ +#define ADRV903X_CPU_INITCAL_OBJID_TO_CAL_MASK(x) (1ull << (x)) + +/* Convert an tracking cal object ID to a cal ID */ +#define ADRV903X_CPU_TRACKING_OBJID_TO_CAL_ID(x) ((x) - ADRV903X_CPU_OBJID_TC_START) + +/* Convert an tracking cal object ID to cal bitmask */ +#define ADRV903X_CPU_TRACKING_OBJID_TO_CAL_MASK(x) (1ull << ((x) - ADRV903X_CPU_OBJID_TC_START)) + +/* Compare an cal object ID to ORX. Adding any new ORX object ID here */ +#define ADRV903X_CPU_OBJID_IS_ORX(x) (((x) == ADRV903X_CPU_OBJID_IC_ADC_ORX) || ((x) == ADRV903X_CPU_OBJID_TC_ORX_ADC)) + +#endif /* __ADRV903X_CPU_OBJECT_IDS_TYPES_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_scratch_registers.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_scratch_registers.h new file mode 100644 index 0000000000000..bbb385b109665 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_scratch_registers.h @@ -0,0 +1,340 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adrv903x_cpu_scratch_registers.h + * + * \brief Contains CPU scratch register definitions + * + * \details Contains CPU scratch register definitions + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_CPU_SCRATCH_REGISTERS_H__ +#define __ADRV903X_CPU_SCRATCH_REGISTERS_H__ + +/* Scratch register 0 contains CPU0 boot status */ +#define ADRV903X_CPU_CPU0_BOOT_STATUS_SCRATCH_REG_ID 0 + +/* Scratch register 1 contains CPU1 boot status */ +#define ADRV903X_CPU_CPU1_BOOT_STATUS_SCRATCH_REG_ID 1 + +/* Scratch register 6 contains Stream/API Tx to ORx Mapping byte */ +#define ADRV903X_CPU_TX_ORX_MAPPING_SET_SCRATCH_REG_ID 6 + +/* Scratch register 7 contains config needed by ORX High Stream for JESD Link Sharing */ +#define ADRV903X_CPU_ORX_LINK_SHARING_SCRATCH_REG_ID 7 + +/* Scratch register 8 contains config needed by RX0-3 High Streams for JESD Link Sharing */ +#define ADRV903X_CPU_TX_RX03_MAPPING_SET_SCRATCH_REG_ID 8 + +/* Scratch register 9 contains config needed by RX4-7 High Streams for JESD Link Sharing */ +#define ADRV903X_CPU_TX_RX47_MAPPING_SET_SCRATCH_REG_ID 9 + +/* Software Breakpoint scratchpad register assignments */ +#define ADRV903X_CPU_CPU0_SWBKPT_INDEX_SCRATCH_REG_ID 10 +#define ADRV903X_CPU_CPU0_SWBKPT_BKPT_NUM_SCRATCH_REG_ID 11 +#define ADRV903X_CPU_CPU0_SWBKPT_CHAN_NUM_SCRATCH_REG_ID 12 +#define ADRV903X_CPU_CPU1_SWBKPT_INDEX_SCRATCH_REG_ID 13 +#define ADRV903X_CPU_CPU1_SWBKPT_BKPT_NUM_SCRATCH_REG_ID 14 +#define ADRV903X_CPU_CPU1_SWBKPT_CHAN_NUM_SCRATCH_REG_ID 15 + +/* CPU Primary/Secondary boot sequencing registers */ +#define ADRV903X_CPU_CPU0_IS_PRIMARY 16 +#define ADRV903X_CPU_CPU1_IS_PRIMARY 17 +#define ADRV903X_CPU_SECONDARY_BOOT_RELEASE 18 + +/* Scratch registers 19-35 contain Stream/API Tx to ORx Mapping look up table */ +#define ADRV903X_CPU_TX_ORX_MAPPING_00 19 +#define ADRV903X_CPU_TX_ORX_MAPPING_01 20 +#define ADRV903X_CPU_TX_ORX_MAPPING_02 21 +#define ADRV903X_CPU_TX_ORX_MAPPING_03 22 +#define ADRV903X_CPU_TX_ORX_MAPPING_04 23 +#define ADRV903X_CPU_TX_ORX_MAPPING_05 24 +#define ADRV903X_CPU_TX_ORX_MAPPING_06 25 +#define ADRV903X_CPU_TX_ORX_MAPPING_07 26 +#define ADRV903X_CPU_TX_ORX_MAPPING_08 27 +#define ADRV903X_CPU_TX_ORX_MAPPING_09 28 +#define ADRV903X_CPU_TX_ORX_MAPPING_10 29 +#define ADRV903X_CPU_TX_ORX_MAPPING_11 30 +#define ADRV903X_CPU_TX_ORX_MAPPING_12 31 +#define ADRV903X_CPU_TX_ORX_MAPPING_13 32 +#define ADRV903X_CPU_TX_ORX_MAPPING_14 33 +#define ADRV903X_CPU_TX_ORX_MAPPING_15 34 + +/* Scratch registers to hold temporary Tx to ORx NCO and atten values */ +#define ADRV903X_CPU_TEMP0 35 /* Tx channel (0 - 7) */ +#define ADRV903X_CPU_TEMP1 36 /* LSB of ORx ADC NCO or LOL NCO frequency or ORx atten */ +#define ADRV903X_CPU_TEMP2 37 /* ISB of ORx ADC NCO or LOL NCO frequency or ORx atten */ +#define ADRV903X_CPU_TEMP3 38 /* MSB of ORx ADC NCO or LOL NCO frequency */ +#define ADRV903X_CPU_TEMP4 39 /* LSB of ORx DP NCO or LOL NCO frequency */ +#define ADRV903X_CPU_TEMP5 40 /* ISB of ORx DP NCO or LOL NCO frequency */ +#define ADRV903X_CPU_TEMP6 41 /* MSB of ORx DP NCO or LOL NCO frequency */ + +/* + * Table to hold ADC and DP NCO values for all supported mappings + */ +/* Scratch registers to hold ADC/DP NCO values for mapping=0x00 (Tx0-to-ORx) */ +#define ADRV903X_CPU_TX_0_ORX_NCO_ADC_FREQ_LSB 42 +#define ADRV903X_CPU_TX_0_ORX_NCO_ADC_FREQ_ISB 43 +#define ADRV903X_CPU_TX_0_ORX_NCO_ADC_FREQ_MSB 44 +#define ADRV903X_CPU_TX_0_ORX_NCO_DP_FREQ_LSB 45 +#define ADRV903X_CPU_TX_0_ORX_NCO_DP_FREQ_ISB 46 +#define ADRV903X_CPU_TX_0_ORX_NCO_DP_FREQ_MSB 47 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x01 (Tx1-to-ORx) */ +#define ADRV903X_CPU_TX_1_ORX_NCO_ADC_FREQ_LSB 48 +#define ADRV903X_CPU_TX_1_ORX_NCO_ADC_FREQ_ISB 49 +#define ADRV903X_CPU_TX_1_ORX_NCO_ADC_FREQ_MSB 50 +#define ADRV903X_CPU_TX_1_ORX_NCO_DP_FREQ_LSB 51 +#define ADRV903X_CPU_TX_1_ORX_NCO_DP_FREQ_ISB 52 +#define ADRV903X_CPU_TX_1_ORX_NCO_DP_FREQ_MSB 53 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x02 (Tx2-to-ORx) */ +#define ADRV903X_CPU_TX_2_ORX_NCO_ADC_FREQ_LSB 54 +#define ADRV903X_CPU_TX_2_ORX_NCO_ADC_FREQ_ISB 55 +#define ADRV903X_CPU_TX_2_ORX_NCO_ADC_FREQ_MSB 56 +#define ADRV903X_CPU_TX_2_ORX_NCO_DP_FREQ_LSB 57 +#define ADRV903X_CPU_TX_2_ORX_NCO_DP_FREQ_ISB 58 +#define ADRV903X_CPU_TX_2_ORX_NCO_DP_FREQ_MSB 59 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x03 (Tx3-to-ORx) */ +#define ADRV903X_CPU_TX_3_ORX_NCO_ADC_FREQ_LSB 60 +#define ADRV903X_CPU_TX_3_ORX_NCO_ADC_FREQ_ISB 61 +#define ADRV903X_CPU_TX_3_ORX_NCO_ADC_FREQ_MSB 62 +#define ADRV903X_CPU_TX_3_ORX_NCO_DP_FREQ_LSB 63 +#define ADRV903X_CPU_TX_3_ORX_NCO_DP_FREQ_ISB 64 +#define ADRV903X_CPU_TX_3_ORX_NCO_DP_FREQ_MSB 65 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x04 (Tx4-to-ORx) */ +#define ADRV903X_CPU_TX_4_ORX_NCO_ADC_FREQ_LSB 66 +#define ADRV903X_CPU_TX_4_ORX_NCO_ADC_FREQ_ISB 67 +#define ADRV903X_CPU_TX_4_ORX_NCO_ADC_FREQ_MSB 68 +#define ADRV903X_CPU_TX_4_ORX_NCO_DP_FREQ_LSB 69 +#define ADRV903X_CPU_TX_4_ORX_NCO_DP_FREQ_ISB 70 +#define ADRV903X_CPU_TX_4_ORX_NCO_DP_FREQ_MSB 71 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x05 (Tx5-to-ORx) */ +#define ADRV903X_CPU_TX_5_ORX_NCO_ADC_FREQ_LSB 72 +#define ADRV903X_CPU_TX_5_ORX_NCO_ADC_FREQ_ISB 73 +#define ADRV903X_CPU_TX_5_ORX_NCO_ADC_FREQ_MSB 74 +#define ADRV903X_CPU_TX_5_ORX_NCO_DP_FREQ_LSB 75 +#define ADRV903X_CPU_TX_5_ORX_NCO_DP_FREQ_ISB 76 +#define ADRV903X_CPU_TX_5_ORX_NCO_DP_FREQ_MSB 77 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x06 (Tx6-to-ORx) */ +#define ADRV903X_CPU_TX_6_ORX_NCO_ADC_FREQ_LSB 78 +#define ADRV903X_CPU_TX_6_ORX_NCO_ADC_FREQ_ISB 79 +#define ADRV903X_CPU_TX_6_ORX_NCO_ADC_FREQ_MSB 80 +#define ADRV903X_CPU_TX_6_ORX_NCO_DP_FREQ_LSB 81 +#define ADRV903X_CPU_TX_6_ORX_NCO_DP_FREQ_ISB 82 +#define ADRV903X_CPU_TX_6_ORX_NCO_DP_FREQ_MSB 83 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x07 (Tx7-to-ORx) */ +#define ADRV903X_CPU_TX_7_ORX_NCO_ADC_FREQ_LSB 84 +#define ADRV903X_CPU_TX_7_ORX_NCO_ADC_FREQ_ISB 85 +#define ADRV903X_CPU_TX_7_ORX_NCO_ADC_FREQ_MSB 86 +#define ADRV903X_CPU_TX_7_ORX_NCO_DP_FREQ_LSB 87 +#define ADRV903X_CPU_TX_7_ORX_NCO_DP_FREQ_ISB 88 +#define ADRV903X_CPU_TX_7_ORX_NCO_DP_FREQ_MSB 89 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x08 */ +#define ADRV903X_CPU_MAPVAL_8_NCO_ADC_FREQ_LSB 90 +#define ADRV903X_CPU_MAPVAL_8_NCO_ADC_FREQ_ISB 91 +#define ADRV903X_CPU_MAPVAL_8_NCO_ADC_FREQ_MSB 92 +#define ADRV903X_CPU_MAPVAL_8_NCO_DP_FREQ_LSB 93 +#define ADRV903X_CPU_MAPVAL_8_NCO_DP_FREQ_ISB 94 +#define ADRV903X_CPU_MAPVAL_8_NCO_DP_FREQ_MSB 95 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x09 */ +#define ADRV903X_CPU_MAPVAL_9_NCO_ADC_FREQ_LSB 96 +#define ADRV903X_CPU_MAPVAL_9_NCO_ADC_FREQ_ISB 97 +#define ADRV903X_CPU_MAPVAL_9_NCO_ADC_FREQ_MSB 98 +#define ADRV903X_CPU_MAPVAL_9_NCO_DP_FREQ_LSB 99 +#define ADRV903X_CPU_MAPVAL_9_NCO_DP_FREQ_ISB 100 +#define ADRV903X_CPU_MAPVAL_9_NCO_DP_FREQ_MSB 101 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x0A */ +#define ADRV903X_CPU_MAPVAL_A_NCO_ADC_FREQ_LSB 102 +#define ADRV903X_CPU_MAPVAL_A_NCO_ADC_FREQ_ISB 103 +#define ADRV903X_CPU_MAPVAL_A_NCO_ADC_FREQ_MSB 104 +#define ADRV903X_CPU_MAPVAL_A_NCO_DP_FREQ_LSB 105 +#define ADRV903X_CPU_MAPVAL_A_NCO_DP_FREQ_ISB 106 +#define ADRV903X_CPU_MAPVAL_A_NCO_DP_FREQ_MSB 107 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x0B */ +#define ADRV903X_CPU_MAPVAL_B_NCO_ADC_FREQ_LSB 108 +#define ADRV903X_CPU_MAPVAL_B_NCO_ADC_FREQ_ISB 109 +#define ADRV903X_CPU_MAPVAL_B_NCO_ADC_FREQ_MSB 110 +#define ADRV903X_CPU_MAPVAL_B_NCO_DP_FREQ_LSB 111 +#define ADRV903X_CPU_MAPVAL_B_NCO_DP_FREQ_ISB 112 +#define ADRV903X_CPU_MAPVAL_B_NCO_DP_FREQ_MSB 113 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x0C */ +#define ADRV903X_CPU_MAPVAL_C_NCO_ADC_FREQ_LSB 114 +#define ADRV903X_CPU_MAPVAL_C_NCO_ADC_FREQ_ISB 115 +#define ADRV903X_CPU_MAPVAL_C_NCO_ADC_FREQ_MSB 116 +#define ADRV903X_CPU_MAPVAL_C_NCO_DP_FREQ_LSB 117 +#define ADRV903X_CPU_MAPVAL_C_NCO_DP_FREQ_ISB 118 +#define ADRV903X_CPU_MAPVAL_C_NCO_DP_FREQ_MSB 119 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x0D */ +#define ADRV903X_CPU_MAPVAL_D_NCO_ADC_FREQ_LSB 120 +#define ADRV903X_CPU_MAPVAL_D_NCO_ADC_FREQ_ISB 121 +#define ADRV903X_CPU_MAPVAL_D_NCO_ADC_FREQ_MSB 122 +#define ADRV903X_CPU_MAPVAL_D_NCO_DP_FREQ_LSB 123 +#define ADRV903X_CPU_MAPVAL_D_NCO_DP_FREQ_ISB 124 +#define ADRV903X_CPU_MAPVAL_D_NCO_DP_FREQ_MSB 125 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x0E */ +#define ADRV903X_CPU_MAPVAL_E_NCO_ADC_FREQ_LSB 126 +#define ADRV903X_CPU_MAPVAL_E_NCO_ADC_FREQ_ISB 127 +#define ADRV903X_CPU_MAPVAL_E_NCO_ADC_FREQ_MSB 128 +#define ADRV903X_CPU_MAPVAL_E_NCO_DP_FREQ_LSB 129 +#define ADRV903X_CPU_MAPVAL_E_NCO_DP_FREQ_ISB 130 +#define ADRV903X_CPU_MAPVAL_E_NCO_DP_FREQ_MSB 131 +/* Scratch registers to hold ADC/DP NCO values for mapping=0x0F */ +#define ADRV903X_CPU_MAPVAL_F_NCO_ADC_FREQ_LSB 132 +#define ADRV903X_CPU_MAPVAL_F_NCO_ADC_FREQ_ISB 133 +#define ADRV903X_CPU_MAPVAL_F_NCO_ADC_FREQ_MSB 134 +#define ADRV903X_CPU_MAPVAL_F_NCO_DP_FREQ_LSB 135 +#define ADRV903X_CPU_MAPVAL_F_NCO_DP_FREQ_ISB 136 +#define ADRV903X_CPU_MAPVAL_F_NCO_DP_FREQ_MSB 137 + +/* + * Table to hold attenuation values for all supported mappings + */ +/* Scratch registers to hold attenuation value for mapping=0x00 (Tx0-to-ORx) */ +#define ADRV903X_CPU_TX_0_ORX_ATTEN 138 +#define ADRV903X_CPU_TX_0_ORX_ATTEN_CTRL 139 +/* Scratch registers to hold attenuation value for mapping=0x01 (Tx1-to-ORx) */ +#define ADRV903X_CPU_TX_1_ORX_ATTEN 140 +#define ADRV903X_CPU_TX_1_ORX_ATTEN_CTRL 141 +/* Scratch registers to hold attenuation value for mapping=0x02 (Tx2-to-ORx) */ +#define ADRV903X_CPU_TX_2_ORX_ATTEN 142 +#define ADRV903X_CPU_TX_2_ORX_ATTEN_CTRL 143 +/* Scratch registers to hold attenuation value for mapping=0x03 (Tx3-to-ORx) */ +#define ADRV903X_CPU_TX_3_ORX_ATTEN 144 +#define ADRV903X_CPU_TX_3_ORX_ATTEN_CTRL 145 +/* Scratch registers to hold attenuation value for mapping=0x04 (Tx4-to-ORx) */ +#define ADRV903X_CPU_TX_4_ORX_ATTEN 146 +#define ADRV903X_CPU_TX_4_ORX_ATTEN_CTRL 147 +/* Scratch registers to hold attenuation value for mapping=0x05 (Tx5-to-ORx) */ +#define ADRV903X_CPU_TX_5_ORX_ATTEN 148 +#define ADRV903X_CPU_TX_5_ORX_ATTEN_CTRL 149 +/* Scratch registers to hold attenuation value for mapping=0x06 (Tx6-to-ORx) */ +#define ADRV903X_CPU_TX_6_ORX_ATTEN 150 +#define ADRV903X_CPU_TX_6_ORX_ATTEN_CTRL 151 +/* Scratch registers to hold attenuation value for mapping=0x07 (Tx7-to-ORx) */ +#define ADRV903X_CPU_TX_7_ORX_ATTEN 152 +#define ADRV903X_CPU_TX_7_ORX_ATTEN_CTRL 153 +/* Scratch registers to hold attenuation value for mapping=0x08 */ +#define ADRV903X_CPU_MAPVAL_8_ATTEN 154 +#define ADRV903X_CPU_MAPVAL_8_ATTEN_CTRL 155 +/* Scratch registers to hold attenuation value for mapping=0x09 */ +#define ADRV903X_CPU_MAPVAL_9_ATTEN 156 +#define ADRV903X_CPU_MAPVAL_9_ATTEN_CTRL 157 +/* Scratch registers to hold attenuation value for mapping=0x0A */ +#define ADRV903X_CPU_MAPVAL_A_ATTEN 158 +#define ADRV903X_CPU_MAPVAL_A_ATTEN_CTRL 159 +/* Scratch registers to hold attenuation value for mapping=0x0B */ +#define ADRV903X_CPU_MAPVAL_B_ATTEN 160 +#define ADRV903X_CPU_MAPVAL_B_ATTEN_CTRL 161 +/* Scratch registers to hold attenuation value for mapping=0x0C */ +#define ADRV903X_CPU_MAPVAL_C_ATTEN 162 +#define ADRV903X_CPU_MAPVAL_C_ATTEN_CTRL 163 +/* Scratch registers to hold attenuation value for mapping=0x0D */ +#define ADRV903X_CPU_MAPVAL_D_ATTEN 164 +#define ADRV903X_CPU_MAPVAL_D_ATTEN_CTRL 165 +/* Scratch registers to hold attenuation value for mapping=0x0E */ +#define ADRV903X_CPU_MAPVAL_E_ATTEN 166 +#define ADRV903X_CPU_MAPVAL_E_ATTEN_CTRL 167 +/* Scratch registers to hold attenuation value for mapping=0x0F */ +#define ADRV903X_CPU_MAPVAL_F_ATTEN 168 +#define ADRV903X_CPU_MAPVAL_F_ATTEN_CTRL 169 + +/* + * Table to hold LOL NCO values for all supported mappings + */ +/* Scratch registers to hold LOL NCO values for mapping=0x00 (Tx0-to-ORx) */ +#define ADRV903X_CPU_TX_0_ORX_NCO_LOL_FREQ_LSB 170 +#define ADRV903X_CPU_TX_0_ORX_NCO_LOL_FREQ_ISB 171 +#define ADRV903X_CPU_TX_0_ORX_NCO_LOL_FREQ_MSB 172 +/* Scratch registers to hold LOL NCO values for mapping=0x01 (Tx1-to-ORx) */ +#define ADRV903X_CPU_TX_1_ORX_NCO_LOL_FREQ_LSB 173 +#define ADRV903X_CPU_TX_1_ORX_NCO_LOL_FREQ_ISB 174 +#define ADRV903X_CPU_TX_1_ORX_NCO_LOL_FREQ_MSB 175 +/* Scratch registers to hold LOL NCO values for mapping=0x02 (Tx2-to-ORx) */ +#define ADRV903X_CPU_TX_2_ORX_NCO_LOL_FREQ_LSB 176 +#define ADRV903X_CPU_TX_2_ORX_NCO_LOL_FREQ_ISB 177 +#define ADRV903X_CPU_TX_2_ORX_NCO_LOL_FREQ_MSB 178 +/* Scratch registers to hold LOL NCO values for mapping=0x03 (Tx3-to-ORx) */ +#define ADRV903X_CPU_TX_3_ORX_NCO_LOL_FREQ_LSB 179 +#define ADRV903X_CPU_TX_3_ORX_NCO_LOL_FREQ_ISB 180 +#define ADRV903X_CPU_TX_3_ORX_NCO_LOL_FREQ_MSB 181 +/* Scratch registers to hold LOL NCO values for mapping=0x04 (Tx4-to-ORx) */ +#define ADRV903X_CPU_TX_4_ORX_NCO_LOL_FREQ_LSB 182 +#define ADRV903X_CPU_TX_4_ORX_NCO_LOL_FREQ_ISB 183 +#define ADRV903X_CPU_TX_4_ORX_NCO_LOL_FREQ_MSB 184 +/* Scratch registers to hold LOL NCO values for mapping=0x05 (Tx5-to-ORx) */ +#define ADRV903X_CPU_TX_5_ORX_NCO_LOL_FREQ_LSB 185 +#define ADRV903X_CPU_TX_5_ORX_NCO_LOL_FREQ_ISB 186 +#define ADRV903X_CPU_TX_5_ORX_NCO_LOL_FREQ_MSB 187 +/* Scratch registers to hold LOL NCO values for mapping=0x06 (Tx6-to-ORx) */ +#define ADRV903X_CPU_TX_6_ORX_NCO_LOL_FREQ_LSB 188 +#define ADRV903X_CPU_TX_6_ORX_NCO_LOL_FREQ_ISB 189 +#define ADRV903X_CPU_TX_6_ORX_NCO_LOL_FREQ_MSB 190 +/* Scratch registers to hold LOL NCO values for mapping=0x07 (Tx7-to-ORx) */ +#define ADRV903X_CPU_TX_7_ORX_NCO_LOL_FREQ_LSB 191 +#define ADRV903X_CPU_TX_7_ORX_NCO_LOL_FREQ_ISB 192 +#define ADRV903X_CPU_TX_7_ORX_NCO_LOL_FREQ_MSB 193 + +/* Scratch register used to store ORX_TX_AUTO_SWITCH_MODE information */ +#define ADRV903X_CPU_ORX_TX_AUTO_SWITCH_MODE 194 + + +/* Scratch register to enable/disable the TxLB ADC DAC - channelMask (see TPGSWE-2397) */ +#define ADRV903X_CPU_TXLB_DAC_ENABLE 195 + +/* Software Breakpoint GPIO scratchpad register assignments */ +#define ADRV903X_CPU_SWBKPT_WAKEUP_GPIO_PIN_REG_ID 196 + +/* Set by powerup stream if SBET is enabled in stream settings */ +#define ADRV903X_SCRATCH_ID_SBET_MODE 197 + +/* Scratch register to enable/disable the Tx Anttena Cal - channelMask */ +#define ADRV903X_GPIO_ANTCAL_TX_MASK 198 + +/* Scratch register to enable/disable the Rx Anttena Cal - channelMask */ +#define ADRV903X_GPIO_ANTCAL_RX_MASK 199 + +/* Unused */ +#define ADRV903X_SCRATCH_ID_UNUSED_01 200 +#define ADRV903X_SCRATCH_ID_UNUSED_02 201 +#define ADRV903X_SCRATCH_ID_UNUSED_03 202 +#define ADRV903X_SCRATCH_ID_UNUSED_04 203 + +/* Scratch register containing slice stream processor stream number to trigger */ +#define ADRV903X_TRIGGER_SLICE_STREAM_NUM 204 + +/* Scratch register containing channel mask of which slice stream processors to trigger stream in */ +#define ADRV903X_TRIGGER_SLICE_STREAM_MASK 205 + +/* Unused */ +#define ADRV903X_SCRATCH_ID_UNUSED_05 206 +#define ADRV903X_SCRATCH_ID_UNUSED_06 207 +#define ADRV903X_SCRATCH_ID_UNUSED_07 208 +#define ADRV903X_SCRATCH_ID_UNUSED_08 209 +#define ADRV903X_SCRATCH_ID_UNUSED_09 210 +#define ADRV903X_SCRATCH_ID_UNUSED_10 211 + +/* Scratch register that holds TRx channels for gpio 0 */ +#define ADRV903X_TRIGGER_SLICE_GPIO_0_TRX_CHANNELS 212 + +/* Scratch register that holds TRx channels for gpio 1 */ +#define ADRV903X_TRIGGER_SLICE_GPIO_1_TRX_CHANNELS 213 + +/* Scratch register that holds TRx channels for gpio 2 */ +#define ADRV903X_TRIGGER_SLICE_GPIO_2_TRX_CHANNELS 214 + +/* Scratch register that holds TRx channels for gpio 3 */ +#define ADRV903X_TRIGGER_SLICE_GPIO_3_TRX_CHANNELS 215 + +/* Scratch register that holds if channels affect are from Rx or Tx */ +#define ADRV903X_TRIGGER_SLICE_TR_OR_RX_CHANNELS 216 + +/* Unused scratch registers from 229 to 255 */ + +#endif /* __ADRV903X_CPU_SCRATCH_REGISTERS_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_sw_bkpt_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_sw_bkpt_types.h new file mode 100644 index 0000000000000..3aee63493c736 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_sw_bkpt_types.h @@ -0,0 +1,43 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adrv903x_cpu_sw_bkpt_types.h + * + * \brief Contains the definitions for Software Breakpoints + * + * \details Contains the definitions for Software Breakpoints + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_CPU_SW_BKPT_TYPES_H__ +#define __ADRV903X_CPU_SW_BKPT_TYPES_H__ + + +/** +* \brief Software breakpoint table indexes. +*/ + +typedef enum +{ + ADRV903X_SWBKPT_INDEX_INVALID, /*!< Invalid index */ + ADRV903X_SWBKPT_INDEX_IC_TXBBF, /*!< TXBBF Init Cal Index */ + ADRV903X_SWBKPT_INDEX_IC_TEST_0, /*!< TEST_0 Init Cal Index */ + ADRV903X_SWBKPT_INDEX_IC_TEST_1, /*!< TEST_1 Init Cal Index */ + ADRV903X_SWBKPT_INDEX_TC_RXQEC, /*!< RxQEC Tracking Cal Index */ + ADRV903X_SWBKPT_INDEX_IC_TXLB_FILTER, /*!< TX LB Filter Init Cal Index */ + ADRV903X_SWBKPT_INDEX_IC_PATHDELAY, /*!< Path Delay Cal Index */ + ADRV903X_SWBKPT_INDEX_IC_TXQEC, /*!< TxQec Init Cal Index */ + ADRV903X_SWBKPT_INDEX_TC_TXQEC, /*!< TxQec Track Cal Index */ + + ADRV903X_CPU_BKPT_TABLE_SIZE /*!< Table size */ +} ADRV903X_SWBKPT_TABLE_INDEX; + + +#endif /* __ADRV903X_CPU_SW_BKPT_TYPES_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_types.h new file mode 100644 index 0000000000000..e51cae28e60a2 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_cpu_types.h @@ -0,0 +1,28 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adrv903x_cpu_types.h +* +* \brief Contains ADRV903X data types for on board cpus feature +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef _ADRV903X_CPU_TYPES_H_ +#define _ADRV903X_CPU_TYPES_H_ + +/** + * \brief Enumerated list of Link Id + */ +typedef enum adrv903x_LinkId +{ + ADRV903X_LINK_ID_UNKNOWN = -1, + ADRV903X_LINK_ID_0, + ADRV903X_LINK_ID_MAX +} adrv903x_LinkId_e; + +#endif /* _ADRV903X_CPU_TYPES_H_ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_datainterface.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_datainterface.h new file mode 100644 index 0000000000000..50f608a8ce6f3 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_datainterface.h @@ -0,0 +1,367 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adrv903x_datainterface.h + * \brief Contains ADRV903X data interface related private function prototypes for + * adrv903x_datainterface.c which helps adi_adrv903x_datainterface.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_DATAINTERFACE_H_ +#define _ADRV903X_DATAINTERFACE_H_ + +#ifndef __KERNEL__ +#include +#include +#endif +#include "../../private/bf/adrv903x_bf_jtx_link.h" +#include "../../private/bf/adrv903x_bf_jrx_link.h" +#include "../../private/bf/adrv903x_bf_jesd_common.h" +#include "../../private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2.h" +#include "../../private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.h" + +#include "adi_adrv903x_error.h" + + +#define ADI_ADRV903X_CAPTURE_LOC_DDC0_BASE_CONFIG 0x00005008U +#define ADI_ADRV903X_CAPTURE_LOC_DDC1_BASE_CONFIG 0x00004008U +#define ADI_ADRV903X_CAPTURE_LOC_DPD_BASE_CONFIG 0x00000001U +#define ADI_ADRV903X_CAPTURE_LOC_DPD_PRE_BASE_CONFIG 0x00000101U +#define ADI_ADRV903X_CAPTURE_LOC_DPD_POST_BASE_CONFIG 0x00000201U +#define ADI_ADRV903X_CAPTURE_LOC_ORX_TX0_BASE_CONFIG 0x00000011U +#define ADI_ADRV903X_CAPTURE_LOC_ORX_TX1_BASE_CONFIG 0x00010011U +#define ADI_ADRV903X_CAPTURE_LOC_ORX_TX2_BASE_CONFIG 0x00020011U +#define ADI_ADRV903X_CAPTURE_LOC_ORX_TX3_BASE_CONFIG 0x00030011U +#define ADI_ADRV903X_CAPTURE_LOC_ORX_TX4_BASE_CONFIG 0x00040011U +#define ADI_ADRV903X_CAPTURE_LOC_ORX_TX5_BASE_CONFIG 0x00050011U +#define ADI_ADRV903X_CAPTURE_LOC_ORX_TX6_BASE_CONFIG 0x00060011U +#define ADI_ADRV903X_CAPTURE_LOC_ORX_TX7_BASE_CONFIG 0x00070011U +#define ADI_ADRV903X_CAPTURE_LOC_FORMATTER_BASE_CONFIG 0x00000001U +#define ADI_ADRV903X_CAPTURE_LOC_SLICE_MASK 0xFFFF0000U +#define ADI_ADRV903X_CAPTURE_SIZE_MASK_16K 0x0F000000U +#define ADI_ADRV903X_CAPTURE_SIZE_MASK_12K 0x00000000U +#define ADI_ADRV903X_CAPTURE_SIZE_MASK_8K 0x01000000U +#define ADI_ADRV903X_CAPTURE_SIZE_MASK_4K 0x02000000U +#define ADI_ADRV903X_CAPTURE_SIZE_MASK_2K 0x03000000U +#define ADI_ADRV903X_CAPTURE_SIZE_MASK_1K 0x04000000U +#define ADI_ADRV903X_CAPTURE_SIZE_MASK_512 0x05000000U +#define ADI_ADRV903X_CAPTURE_SIZE_MASK_256 0x06000000U +#define ADI_ADRV903X_CAPTURE_SIZE_MASK_128 0x07000000U +#define ADI_ADRV903X_CAPTURE_SIZE_MASK_64 0x08000000U +#define ADI_ADRV903X_CAPTURE_SIZE_MASK_32 0x09000000U + +/** + * \brief Reads the contents of the Rx/ORx data capture RAM into + * + * \dep begin + * \dep{device->common.devHalInfo} + * \dep end + * + * \param[in,out] device Pointer to the device settings structure + * \param[in] channelSelect Bit mask used to select the channel to read back + * \param[in] wordOffset Offset (starting from 0) of where to begin reading the RAM memory + * \param[out] ramData Pointer to the array that stores the captured data + * \param[in] wordCount The number of words of data read back from the RAM + * +* \retval adi_common_ErrAction_e - ADI_COMMON_ACT_NO_ACTION if Successful + */ + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxOrxDataCaptureRead(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e channelSelect, + uint32_t ramData[], + const uint32_t wordCount, + const adi_adrv903x_RxOrxDataCaptureLocation_e loc); + +/** + * \brief Helper function to decode the capture location + * + * Determines the value that should be written to the capture + * configuration register based on the location passed in + * + * \dep begin + * \dep{device->common.devHalInfo} + * \dep end + * + * \param[in] device Pointer to the device settings structure + * \param[in] captureLocation The location at which the data capture will occur + * \param[in] size The length of data capture + * \param[out] config 32-bit value representing the capture config register state for the selected location +* \retval adi_common_ErrAction_e - ADI_COMMON_ACT_NO_ACTION if Successful + */ + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxOrxDataCaptureConfigSet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxOrxDataCaptureLocation_e captureLocation, + const uint32_t size, + uint32_t* const config); + +/** + * \brief Helper function to decode the channel number to select the base address for the memory region to read + * + * \dep begin + * \dep{device->common.devHalInfo} + * \dep end + * + * \param[in] device Pointer to the device settings structure + * \param[in] channelSelect Channel mask indicating which channel is being captured + * \param[out] address 32-bit register base address of the capture memory location + * +* \retval adi_common_ErrAction_e - ADI_COMMON_ACT_NO_ACTION if Successful + */ + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxOrxDataCaptureConfigAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e channelSelect, + uint32_t* const address); + + +/** + * \brief Helper function to poll the channel stream debug register to determine the state of the ram capture flag + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in, out] device Pointer to the device settings structure + * \param[out] bStreamDbgFlag read only value is set to 0 when the stream processor has initiated a data capture + * +* \retval adi_common_ErrAction_e - ADI_COMMON_ACT_NO_ACTION if Successful + */ + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxOrxDataCaptureStreamDebugPoll(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e channelSelect, + uint32_t* const bStreamDbgFlag); + + +/** +* \brief Look up the framer function bitfield address given a framer index +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] framerIdx Framer selection index +* \param[out] framerBitfieldAddr Framer bitfield address which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_FramerBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerIdx, + adrv903x_BfJtxLinkChanAddr_e* const framerBitfieldAddr); + +/** +* \brief Look up the framer function bitfield address given a deframer index +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] deframerIdx Deframer selection index +* \param[out] deframerBitfieldAddr Deframer bitfield address which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_DeframerBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerIdx, + adrv903x_BfJrxLinkChanAddr_e* const deframerBitfieldAddr); + +/** +* \brief Look up the lane serdes PHY bitfield address given a lane index +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] laneIdx lane selection index +* \param[out] laneSerdesPhyBitfieldAddr lane serdes phy bitfield address which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_FramerLaneSerdesPhyBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const uint8_t laneIdx, + adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e* const laneSerdesPhyBitfieldAddr); + +/** +* \brief this private function is to get the lane crossbar for the selected framer. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] framerSel selected of framer defined in adi_adrv903x_FramerSel_e +* \param[inout] framerCfg Pointer to the JESD Framer configuration read back +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_FramerLaneEnableGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + adi_adrv903x_FramerCfg_t* const framerCfg); + +/** +* \brief this private function is to get the lane crossbar for the selected deframer. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] deframerSel selected of framer defined in adi_adrv903x_DeframerSel_e +* \param[inout] deframerCfg Pointer to the JESD Deframer configuration read back +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_DeframerLaneEnableGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DeframerCfg_t* const deframerCfg); + +/** +* \brief this private function is to set the lanes serdes phy power up or down associated to the selected framer. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] framerSelMask selected of framers defined in adi_adrv903x_FramerSel_e +* \param[in] powerAct indicate the action power up or down. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_FramerLaneSerdesPowerSet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + const uint8_t powerAct); + +/** +* \brief this private function is to set the lanes serdes phy power up or down associated to the selected deframer. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] deframerSelMask selected of deframers defined in adi_adrv903x_DeframerSel_e +* \param[in] powerAct indicate the action power up or down. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_DeframerLaneSerdesPowerSet(adi_adrv903x_Device_t* const device, + const uint8_t deframerSelMask, + const uint8_t powerAct); + +/** +* \brief this function calculates the clock divider setting required to set the DPD RAM capture clock rate to match the Rx output sample rate. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Pointer to the ADRV903X data structure +* \param[in] channelSelect The Rx channel that is doing the data capture +* \param[out] value The divider value required to set the DPD RAM clock rate to match the Rx output sample rate. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RadClkDividerValueCalculate(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e channelSelect, + const adi_adrv903x_RxOrxDataCaptureLocation_e loc, + uint8_t* const value); + + +/** +* \brief this function polls the capture busy bitfield in the appropriate capture status register indicated by the channelSelect parameter. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Pointer to the ADRV903X data structure +* \param[in] channelSelect The Rx channel that is doing the data capture +* \param[out] bCptBusy variable that stores the status of the capture busy bitfield +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_StatusRegisterPoll(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e channelSelect, + uint8_t* const bCptBusy); + +/** +* \brief This Function Reads the Jrx Repair screen Id information to check if the device has undergone the CM screen +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Pointer to the ADRV903X data structure +* \param[out] screenID if 1 the device has undergone the CM screen, 0 otherwise +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxRepairScreenTestChecker(adi_adrv903x_Device_t* const device, + uint8_t* const screenID); + +/** +* \brief Determine if a JESD Tx lane is powered down. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Pointer to the ADRV903X data structure +* \param[in] bitfieldAddr Indicates the JESD Tx lane +* \param[out] phyLanePd Is set to 1 if lane is powered down, 0 otherwise +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GetJtxLanePoweredDown(adi_adrv903x_Device_t* const device, + adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e const laneSerdesPhyBitfieldAddr, + uint8_t* const phyLanePd); + + + +/** +* \brief Retrieve Deframer configuration +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to the device settings structure +* \param[in] deframerSel selected of framer defined in adi_adrv903x_DeframerSel_e +* \param[in] chanSel selected Tx channel defined in adi_adrv903x_TxChannels_e +* \param[out] deframerCfg Pointer to the JESD Deframer configuration read back +* \param[in] bypass mode select +* \param[in] scale parameters enable +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_DeframerCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const adi_adrv903x_TxChannels_e chanSel, + adi_adrv903x_DeframerCfg_t* const deframerCfg, + const bool bBypass, + const bool bParamScaling); + +/** + * \brief Gets the DAC sample crossbar for the specified ADRV903X deframer + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Pointer to the device settings structure + * \param[in] deframerSel selected of framer defined in adi_adrv903x_DeframerSel_e + * \param[out] dacXbar Pointer to the JESD structure adi_adrv903x_DacSampleXbarCfg_t + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adrv903x_DacSampleXbarGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DacSampleXbarCfg_t* const dacXbar); + +#endif /* _ADRV903X_DATAINTERFACE_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_gpio.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_gpio.h new file mode 100644 index 0000000000000..ad4174154a29a --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_gpio.h @@ -0,0 +1,748 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adrv903x_gpio.h + * \brief Contains ADRV903X gpio related private function prototypes for + * adrv903x_gpio.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_GPIO_H_ +#define _ADRV903X_GPIO_H_ + +#include "adrv903x_gpio_types.h" + +#include "adi_adrv903x_error.h" +#include "adi_adrv903x_gpio.h" + + +/** +* \brief Helper function to retrieve GPIO signal information struct from a lookup table +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] signal Selected Digital GPIO signal +* \param[out] info Returned struct containing Signal Information required for signal routing/checking +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioSignalInfoGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioSignal_e signal, + adrv903x_GpioSignalInfo_t* const info); + +/** +* \brief Top Level entry point to private GPIO helper utility to configure a Digital GPIO pin for a signal +* +* Configures all routing for GPIO pin to/from selected signal. Handles all routing types internally, checks +* for GPIO allocation errors, and allocates GPIO to the feature associated with the signal. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[in] signal Selected GPIO signal +* \param[in] channelMask Channel mask to select the instance(S) of the signal. If not a channel signal, +* set to ADI_ADRV903X_CHOFF = 0U. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioSignalSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const adi_adrv903x_GpioSignal_e signal, + const uint32_t channelMask); + +/** +* \brief Top Level entry point to private GPIO helper utility to retrieve the current signal on a Digital GPIO +* +* Returns the signal/channelMask currently being routed to the GPIO pin. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[out] signal Returned signal for +* \param[out] channelMask Returned Channel mask for the current signal, if signal is channel-instanced. +* If not a channel signal, this value will be set to 0U = ADI_ADRV903X_CHOFF. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioSignalGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + adi_adrv903x_GpioSignal_e* const signal, + uint32_t* const channelMask); + +/** +* \brief Top Level entry point to private GPIO helper utility to release a Digital GPIO from it's current signal +* +* Configures all routing for GPIO pin back to default settings to disconnect selected GPIO to previously +* connected signal. Deallocates GPIO back for use in Shared Resource Manager. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin to release +* \param[in] signal Selected GPIO signal to release +* \param[in] channelMask Channel mask to select the instance(S) of the signal to release. If not a channel signal, +* set to ADI_ADRV903X_CHOFF = 0U. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioSignalRelease(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const adi_adrv903x_GpioSignal_e signal, + const uint32_t channelMask); + +/** +* \brief Top Level entry point to private GPIO helper utility to configure an Analog GPIO pin for a signal +* +* Configures all routing for GPIO pin to/from selected signal. Handles are routing types internally, +* checks for GPIO allocation errors, and allocates GPIO to the feature associated with the signal. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[in] signal Selected GPIO signal +* \param[in] channelMask Channel mask to select the instance(S) of the signal. If not a channel signal, +* set to ADI_ADRV903X_CHOFF = 0U. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogSignalSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + const adi_adrv903x_GpioSignal_e signal, + const uint32_t channelMask); + +/** +* \brief Top Level entry point to private GPIO helper utility to retrieve the current signal on an Analog GPIO +* +* Returns the signal/channelMask currently being routed to the Analog GPIO pin. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected analog GPIO pin +* \param[out] signal Returned signal for +* \param[out] channelMask Returned Channel mask for the current signal, if signal is channel-instanced. +* If not a channel signal, this value will be set to 0U = ADI_ADRV903X_CHOFF. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogSignalGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + adi_adrv903x_GpioSignal_e* const signal, + uint32_t* const channelMask); + + +/** +* \brief Top Level entry point to private GPIO helper utility to release an Analog GPIO from it's current signal +* +* Configures all routing for GPIO pin back to default settings to disconnect selected GPIO to previously +* connected signal. Deallocates GPIO back for use in Shared Resource Manager. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected analog GPIO pin to release +* \param[in] signal Selected GPIO signal to release +* \param[in] channelMask Channel mask to select the instance(S) of the signal to release. If not a channel signal, +* set to ADI_ADRV903X_CHOFF = 0U. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogSignalRelease(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + const adi_adrv903x_GpioSignal_e signal, + const uint32_t channelMask); + +/** + * \brief Private helper function to set the GP Int Type(Category) for all interrupt sources. + * + * This function uses a bitmask word to select the Type: Pulse/Edge triggered (default) vs. Level Triggered. + * This function is meant to be called during Initialization to set correct default settings for each source. + * These default settings are based on hardware design are meant to be static over all device configurations. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] gpIntType Pointer to data structure containing GP Interrupt word to set interrupt + * source types. Each bit in the word selects the type for the associated interrupt source: + * 0 = Pulse/Edge triggered (default), 1 = Level Triggered + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpIntTypeSet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntMask_t* const gpIntType); + +/** + * \brief Private helper function to retrieve the GP Int Type(Category) for all interrupt sources. + * + * This function uses a bitmask word to select the Type: Pulse/Edge triggered (default) vs. Level Triggered. + * This function is meant to be called during Initialization to set correct default settings for each source. + * These default settings are based on hardware design are meant to be static over all device configurations. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[out] gpIntType Pointer to data structure to contain retrieved GP Interrupt Type word. + * Each bit in the word selects the type for the associated interrupt source: + * 0 = Pulse/Edge triggered (default), 1 = Level Triggered + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpIntTypeGet( adi_adrv903x_Device_t* const device, + adi_adrv903x_GpIntMask_t* const gpIntType); + +#ifndef CLIENT_IGNORE +/**************************************************************************** + * Top Level GPIO Utility Functions + **************************************************************************** + */ + +/** +* \brief Top Level entry point to private GPIO helper utility to retrieve the GPIO of a selected signal & channel +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[out] gpio GPIO assignment of selected signal, INVALID if signal isn't mapped to any GPIO +* If not a channel signal, this value should be set to 0U = ADI_ADRV903X_CHOFF. +* \param[in] signal Signal to check GPIO mapping +* \param[in] channelSel Channel selection to check GPIO mapping +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioSignalFind(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioPinSel_e* const gpio, + const adi_adrv903x_GpioSignal_e signal, + const adi_adrv903x_Channels_e channelSel); + + + +/** +* \brief Top Level entry point to private GPIO helper utility to retrieve the Analog GPIO of a selected signal & channel +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[out] gpio GPIO assignment of selected signal, INVALID if signal isn't mapped to any GPIO +* If not a channel signal, this value should be set to 0U = ADI_ADRV903X_CHOFF. +* \param[in] signal Signal to check GPIO mapping +* \param[in] channelSel Channel selection to check GPIO mapping +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogSignalFind(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioAnaPinSel_e* const gpio, + const adi_adrv903x_GpioSignal_e signal, + const adi_adrv903x_Channels_e channelSel); + +/** +* \brief High level helper function to check validity of a digital GPIO signal/channel as a Monitor Output Signal. +* +* Returns result in parameter isValid +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] signal Selected GPIO signal to check +* \param[in] channel Selected channel number to check +* \param[out] isValid Pointer to result of validity check +* \param[out] channelMask Pointer to channelMask conversion of signal/channel dependent on Route type +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioMonitorOutSignalValidCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioSignal_e signal, + const uint8_t channel, + uint8_t* const isValidFlag, + uint32_t* const channelMask); + +/**************************************************************************** + * Low Level GPIO Utility Helper Functions + **************************************************************************** + */ + + + +/** +* \brief Helper function to get the associated Shared Resource Manager FeatureID for a given GPIO signal +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] signal Selected GPIO signal +* \param[out] featureID Returned featureID associated with the GPIO signal +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_FromSignalToFeatureGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioSignal_e signal, + adrv903x_FeatureID_e* const featureID); + +/** +* \brief Helper function to get the associated GPIO signal for a Shared Resource Manager FeatureID +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] featureID Selected Shared Resource Manager featureID +* \param[out] signal Returned GPIO signal associated with the featureID +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_FromFeatureToSignalGet(adi_adrv903x_Device_t* const device, + const adrv903x_FeatureID_e featureID, + adi_adrv903x_GpioSignal_e* const signal); + + +/** +* \brief Helper function to set bitfields for configuring Digital GPIO Pinmux Stage3 (Top-level digital mux) +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[in] muxSelect Stage 3 mux selection (16:1 mux) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg3Set(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect); + +/** +* \brief Helper function to get bitfields for configuring Digital GPIO Pinmux Stage3 (Top-level digital mux) +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[out] muxSelect Pointer to hold value of muxSelect Stage 3 mux selection (16:1 mux) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg3Get(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + uint8_t * const muxSelect); + +/** +* \brief Helper function to set bitfields for configuring Digital GPIO Pinmux Stage2_Rx +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[in] muxSelect Stage 2 Rx mux selection (8:1 mux) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg2RxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect); + + + +/** +* \brief Helper function to set bitfields for configuring Digital GPIO Pinmux Stage2_Tx +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[in] muxSelect Stage 2 Tx mux selection (8:1 mux) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg2TxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect); + + + +/** +* \brief Helper function to set bitfields for configuring Digital GPIO Pinmux Stage2_Orx +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[in] muxSelect Stage 2 ORx mux selection (2:1 mux) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg2OrxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect); + + + +/** +* \brief Helper function to set bitfields for configuring Digital GPIO Pinmux Stage2_Actrl (Analog Control Observation Signals) +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[in] muxSelect Stage 2 Actrl mux selection (512:1 mux, only 247 inputs are being used currently) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg2ActrlSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint16_t muxSelect); + +/** +* \brief Helper function to set bitfields for configuring Digital GPIO Pinmux Stage1_Rx +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[in] muxSelect Stage 1 Rx mux selection (N:1 mux, 1 output of a N:24 Xbar) +* \param[in] channelIdx The Rx channel index +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg1RxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect, + const uint8_t channelIdx); + +/** +* \brief Helper function to set bitfields for configuring Digital GPIO Pinmux Stage1_Tx +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[in] muxSelect Stage 1 Tx mux selection (N:1 mux, 1 output of a N:24 Xbar) +* \param[in] channelIdx The Tx channel index +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg1TxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect, + const uint8_t channelIdx); + +/** +* \brief Helper function to set bitfields for configuring Digital GPIO Pinmux Stage1_Orx +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[in] muxSelect Stage 1 Orx mux selection (N:1 mux, 1 output of a N:24 Xbar) +* \param[in] channelIdx The Orx channel index +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg1OrxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect, + const uint8_t channelIdx); + +/** +* \brief Helper function to set IE Override bit for a given GPIO. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[in] override IF override = 0, gpio direction is set by the current OE/IE of the signal on Stg3 of pinmux. +* IF override = 1, gpio direction is forced to IE = 1. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioIeOverride(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t override); + +/** +* \brief Helper function to set bitfields for configuring Digital GPIO Rx Destination signals +* +* NOTE: If configuring more than 1 channel for use with the same GPIO, this helper function must be +* called multiple times: 1 call per channel desired. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] destIdx Index of the selected Rx destination signal +* \param[in] channelIdx Rx channel index to enable GPIO input for signal +* \param[in] muxSelect mux selection to make for the destination signal (i.e. select GPIO1-23 or 0 to disable) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioDestRxSet(adi_adrv903x_Device_t* const device, + const uint8_t destIdx, + const uint8_t channelIdx, + const uint8_t muxSelect); +/** +* \brief Helper function to set bitfields for configuring Digital GPIO Tx Destination signals +* +* NOTE: If configuring more than 1 channel for use with the same GPIO, this helper function must be +* called multiple times: 1 call per channel desired. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] destIdx Index of the selected Tx destination signal +* \param[in] channelIdx Tx channel index to enable GPIO input for signal +* \param[in] muxSelect mux selection to make for the destination signal (i.e. select GPIO1-23 or 0 to disable) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioDestTxSet(adi_adrv903x_Device_t* const device, + const uint8_t destIdx, + const uint8_t channelIdx, + const uint8_t muxSelect); + + +/** +* \brief Helper function to set bitfield for configuring Digital GPIO Stream Trigger Destinations +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[in] maskTrigger Stream Trigger Mask selection for the GPIO pin. 0 = Disable GPIO trigger. 1 = Enable GPIO trigger +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioDestStreamTrigSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t maskTrigger); + +/** +* \brief Check if channelMask is valid for the given signal route. If valid, return ADI_TRUE.Else return ADI_FALSE +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] route The route type of the signal to check channelMask for +* \param[in] channelMask The channelMask to check +* \param[out] isValid the result of validity check +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioRouteValidChannelMaskCheck(adi_adrv903x_Device_t* const device, + const adrv903x_GpioRoute_e route, + const uint32_t channelMask, + uint8_t* const isValid); + + +/** +* \brief Helper function to connect or disconnect a signal to/from a GPIO +* +* Configures all routing for GPIO pin to/from selected signal. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] connect Connect/Disconnect selection for function. 0 = Disconnect.1 = Connect +* \param[in] gpio Selected digital GPIO pin +* \param[in] sigInfo Selected GPIO signal information struct +* \param[in] channelIdx Channel index to select the instance(S) of the signal to connect/disconnect. +* If not a channel signal, channelIdx is ignored +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioConnect(adi_adrv903x_Device_t* const device, + const uint8_t connect, + const adi_adrv903x_GpioPinSel_e gpio, + const adrv903x_GpioSignalInfo_t* const sigInfo, + uint32_t const channelIdx); + +/** +* \brief Helper function to set IE Override bit for a given analog GPIO. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected analog GPIO pin +* \param[in] override IF override = 0, analog gpio direction is set by the current OE/IE of the signal on Stg3 of pinmux. +* IF override = 1, analog gpio direction is forced to IE = 1. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogIeOverride( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + const uint8_t override); + +/** +* \brief Helper function to set bitfields for configuring Analog GPIO Pinmux +* +* NOTE: Analog pinmux is much simpler than Digital GPIO Pinmux. Only one level and simple selection bitfields per GPIO. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected Analog GPIO pin +* \param[in] muxSelect Analog mux selection (16:1 mux) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogPinmuxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + const uint8_t muxSelect); + +/** +* \brief Helper function to get bitfields for configuring Analog GPIO Pinmux +* +* NOTE: Analog pinmux is much simpler than Digital GPIO Pinmux. Only one level and simple selection bitfields per GPIO. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gpio Selected Analog GPIO pin +* \param[out] muxSelect pointer to hold value of Analog mux selection (16:1 mux) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogPinmuxGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + uint8_t * const muxSelect); + +/** +* \brief Helper function to connect or disconnect a signal to/from an Analog GPIO +* +* Configures all routing for Analog GPIO pin to/from selected signal. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] connect Connect/Disconnect selection for function. 0 = Disconnect.1 = Connect +* \param[in] gpio Selected analog GPIO pin +* \param[in] sigInfo Selected GPIO signal information struct +* \param[in] channelIdx Channel index to select the instance(S) of the signal to connect/disconnect. +* If not a channel signal, channelIdx is ignored. Unused parameter +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogConnect(adi_adrv903x_Device_t* const device, + const uint8_t connect, + const adi_adrv903x_GpioAnaPinSel_e gpio, + const adrv903x_GpioSignalInfo_t* const sigInfo, + uint32_t const channelIdx); + + + +/**************************************************************************** + * GP Int (General Purpose Interrupt) related functions + *************************************************************************** + */ + +/** + * \brief Private utility function intended for use during PreMcsInit and initializes GP interrupt masks for all GP Int Pins. + * + * The intent of this function is that it gets called during init time to set the GP interrupt + * masks BEFORE main initialization sequence. Masks are applied as selected in init struct. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] pinMaskCfg Pointer to data structure containing GP Interrupt Pin Mask Config to be + * applied to GP Interrupt pins during PreMcsInit + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpIntPreMcsInit( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntPinMaskCfg_t* const pinMaskCfg); + +/** + * \brief Private utility function intended for use during PostMcsInit and initializes GP interrupt masks for all GP Int Pins. + * + * The intent of this function is that it gets called during init time to set the GP interrupt + * masks AFTER main initialization sequence. Masks are applied as selected in postMcsInit struct. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] pinMaskCfg Pointer to data structure containing GP Interrupt Pin Mask Config to be + * applied to GP Interrupt pins during PostMcsInit + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpIntPostMcsInit( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntPinMaskCfg_t* const pinMaskCfg); + +#endif //CLIENT_IGNORE +#endif // ! _ADRV903X_GPIO_H_ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_gpio_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_gpio_types.h new file mode 100644 index 0000000000000..34eee2af49cd9 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_gpio_types.h @@ -0,0 +1,90 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adrv903x_gpio_types.h + * \brief Contains ADRV903X GPIO related private data prototypes for + * adrv903x_gpio.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_GPIO_TYPES_H_ +#define _ADRV903X_GPIO_TYPES_H_ + +#include "../../public/include/adi_adrv903x_gpio_types.h" +#include "adrv903x_shared_resource_manager_types.h" + + + +#define ADRV903X_GP_INT_TYPE_DEFAULT_LOWER (uint64_t)(0x3FFFFFULL) +#define ADRV903X_GP_INT_TYPE_DEFAULT_UPPER (uint64_t)(0x7FFFFFFFFULL) + +#define ADRV903X_GPIO_PINMUX_STAGE3_MAX 15U +#define ADRV903X_GPIO_PINMUX_STAGE2_RX_MAX 7U +#define ADRV903X_GPIO_PINMUX_STAGE2_TX_MAX 7U +#define ADRV903X_GPIO_PINMUX_STAGE2_ORX_MAX 2U +#define ADRV903X_GPIO_PINMUX_STAGE2_ACTRL_MAX 511U +#define ADRV903X_GPIO_PINMUX_STAGE1_RX_MAX 94U +#define ADRV903X_GPIO_PINMUX_STAGE1_TX_MAX 15U +#define ADRV903X_GPIO_PINMUX_STAGE1_ORX_MAX 15U +#define ADRV903X_GPIO_ANALOG_PINMUX_MAX 15U +#define ADRV903X_GPIO_NUM_DESTINATIONS_RX 7U +#define ADRV903X_GPIO_NUM_DESTINATIONS_TX 6U + + +#define ADRV903X_DIGITAL_PIN_GROUP_NUM 8U +#define ADRV903X_DIGITAL_PIN_PER_GROUP_NUM 6U + +/** + * \brief Enum for ADRV903X GPIO Domain Type: Digital vs Analog + */ +typedef enum adrv903x_GpioDomain +{ + ADRV903X_GPIO_DOMAIN_NONE, + ADRV903X_GPIO_DOMAIN_DIGITAL, + ADRV903X_GPIO_DOMAIN_ANALOG +} adrv903x_GpioDomain_e; + + +/** + * \brief Enum for ADRV903X GPIO Route Type + */ +typedef enum adrv903x_GpioRoute +{ + ADRV903X_GPIO_ROUTE_OFF = 0U, /*!< Routing Off. This Route Type is only for feature UNUSED */ + ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE = 1U, /*!< Digital Pinmux Route using Pinmux Stg3 */ + ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL = 2U, /*!< Digital Pinmux Route using Pinmux Stg2,3 */ + ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX = 3U, /*!< Digital Pinmux Route using Pinmux Stg1,2,3 */ + ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX = 4U, /*!< Digital Pinmux Route using Pinmux Stg1,2,3 */ + ADRV903X_GPIO_ROUTE_DIG_PINMUX_ORX = 5U, /*!< Digital Pinmux Route using Pinmux Stg1,2,3 */ + ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG = 6U, /*!< Digital Destination Route to Dig Core for Triggering Streams with GPIOs*/ + ADRV903X_GPIO_ROUTE_DIG_DEST_PPI = 7U, /*!< Digital Destination Route to Dig Core for PPI16 Bus */ + ADRV903X_GPIO_ROUTE_DIG_DEST_RX = 9U, /*!< Digital Destination Route to Rx using Stg3 selected source 0 and Rx channel gpio_select */ + ADRV903X_GPIO_ROUTE_DIG_DEST_TX = 10U, /*!< Digital Destination Route to Tx using Stg3 selected source 0 and Tx channel gpio_select */ + ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE = 12U, /*!< Analog Pinmux Route using simple Analog Pinmux */ + ADRV903X_GPIO_ROUTE_ANA_DEST_CORE = 13U, /*!< NOT SUPPORTED: Analog Destination Route to Core using Ana IE Override */ + ADRV903X_GPIO_ROUTE_ANA_DEST_RX = 14U, /*!< NOT SUPPORTED: Analog Destination Route to RX using Ana IE Override */ + ADRV903X_GPIO_ROUTE_ANA_DEST_TX = 15U, /*!< NOT SUPPORTED: Analog Destination Route to TX using Ana IE Override */ + ADRV903X_GPIO_ROUTE_ANA_DEST_ORX = 16U, /*!< NOT SUPPORTED: Analog Destination Route to ORX using Ana IE Override */ +} adrv903x_GpioRoute_e; + + +/** + * \brief Struct for ADRV903X GPIO Signal Information. Used in LUT to obtain + signal-specific routing details + */ +typedef struct adrv903x_GpioSignalInfo +{ + adi_adrv903x_GpioSignal_e signal; /*!< The internal signal to be exposed via GPIO */ + adrv903x_GpioDomain_e domain; /*!< Analog or Digital */ + adrv903x_GpioRoute_e route; /*!< Indicates the set of pin-muxes involved in routing the signal to a GPIO */ + uint32_t pinMask; /*!< Indicates the GPIO pins to which routing is valid. LSB for GPIO0 etc. */ + uint8_t topSelect; + int16_t targetSelect; +} adrv903x_GpioSignalInfo_t; + + +#endif /* ! _ADRV903X_GPIO_TYPES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_init.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_init.h new file mode 100644 index 0000000000000..0a8a766c03989 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_init.h @@ -0,0 +1,228 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_init.h + * \brief Contains ADRV903X init related private function prototypes for + * adrv903x_init.c that helps adi_adrv903x_init.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_INIT_H_ +#define _ADRV903X_INIT_H_ + +#include "adi_adrv903x_error.h" +#include "adi_library.h" + +//#define ADRV903X_INIT_DEBUG 1 +#ifdef ADRV903X_INIT_DEBUG +#define ADRV903X_BUGINFO(x) ADI_LIBRARY_PRINTF("MESSAGE: %s ******************************* \n", (x)); +#define ADRV903X_BUGINFO_NUM(x,n) ADI_LIBRARY_PRINTF("MESSAGE: %s: %d 0x%08x \n", (x),(n),(n)); +#else +#define ADRV903X_BUGINFO(x) +#define ADRV903X_BUGINFO_NUM(x,n) +#endif + +//#define ADRV903X_INIT_DMAINFO_DEBUG 1 +#ifdef ADRV903X_INIT_DMAINFO_DEBUG +#define ADRV903X_DMAINFO(text, addr, count) ADI_LIBRARY_PRINTF("MESSAGE: DMA: %30s: addr=0x%08x, count=%d \n", (text), (addr), (count)); +#else +#define ADRV903X_DMAINFO(text, addr, count) +#endif + +//#define ADRV903X_INIT_DMA_DEBUG 1 +#ifdef ADRV903X_INIT_DMA_DEBUG +#define ADRV903X_SPIDMAINFO(s,a,b,c) ADI_LIBRARY_PRINTF((s),(a),(b),(c)); +#else +#define ADRV903X_SPIDMAINFO(s,a,b,c) +#endif + +//#define ADRV903X_INIT_SPI_DEBUG 1 +#ifdef ADRV903X_INIT_SPI_DEBUG +#define ADRV903X_SPIINFO(s,a,b,c) ADI_LIBRARY_PRINTF((s),(a),(b),(c)); +#define ADRV903X_SPI_FIELD_INFO(s,a,b,c,d) ADI_LIBRARY_PRINTF((s),(a),(b),(c), (d)); +#else +#define ADRV903X_SPIINFO(s,a,b,c) +#define ADRV903X_SPI_FIELD_INFO(s,a,b,c,d) +#endif + +#define ADRV903X_SPIWRITEBYTE_RETURN(text, addr, data, recoveryAction) \ +{ \ + recoveryAction = adi_adrv903x_Register32Write(device, NULL, (addr), (data), 0xFFU); \ + if(ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) \ + { \ + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Byte Write Issue"); \ + return recoveryAction; \ + } \ + ADRV903X_SPIINFO("MESSAGE: WRITE: %30s: addr=0x%04x, data=0x%02x \n", (text), (addr), (data)); \ +} + +#define ADRV903X_SPIWRITEBYTE_GOTO(text, addr, data, recoveryAction, label) \ +{ \ + recoveryAction = adi_adrv903x_Register32Write(device, NULL, (addr), (data), 0xFFU); \ + if(ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) \ + { \ + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Byte Write Issue"); \ + goto cleanup; \ + } \ + ADRV903X_SPIINFO("MESSAGE: WRITE: %30s: addr=0x%04x, data=0x%02x \n", (text), (addr), (data)); \ +} + +/** +* \brief Sets up the thresholds on Rx channel which triggers overload bits +* if the input level exceeds threshold. +* +* \pre This function is private and is not called directly by the user. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure +* \param[in] rxChannel Channel for which overload protection config is desired +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxOverloadProtectionSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel); + +/** +* \brief Private function used by the APIs that can benefit from SPI streaming. This function should be called +* at the beginning of the function. If device->devStatInfo->spiOptions.allowSpiStreaming is set the part +* is placed into streaming mode. Otherwise, this function does nothing. +* +* This function to range check the version number of the API +* +* \param[in,out] device Context variable - Pointer to the ADRV903X data structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SpiStreamingEntry(adi_adrv903x_Device_t* const device); + +/** +* \brief Private function used by the APIs that call adrv903x_SpiStreamingEntry. It is the responsibility of each +* API function that calls adrv903x_SpiStreamingEntry to call this function also to disable streaming if +* necessary. +* +* This function to range check the version number of the API +* +* \param[in,out] device Context variable - Pointer to the ADRV903X data structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SpiStreamingExit(adi_adrv903x_Device_t* const device); + +/** +* \brief Configures and allocates selected GPIO pins that will trigger a Stream that handle +* Tx to Orx Mapping changes at runtime. +* +* This function will handle GPIO setup (if appropriate) and store the selected feature mode +* in the device data structure for use at runtime. +* +* \pre This function is private and is not called directly by the user. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] mappingConfig Pointer to the mapping config stored in the init structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxToOrxMappingInit(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxToOrxMappingConfig_t* const mappingConfig); +#ifndef CLIENT_IGNORE + +/** +* \brief Configures the part to use DEVCLK as HSDIG to allow FW to boot and syncs slice clocks. +* * Program FW divide registers using configurator settings +* * Configure HSDIG as DEVCLK +* * Calculate and program DEVCLK divider values +* * Clear master bias igen powerdown +* * Enable DEVCLK & digital clock +* * Sync slice clocks +* +* \pre This function is private and is not called directly by the user. +* +* \dep_begin +* \dep{device->devStateInfo} +* \dep{init-> (most members)} +* \dep_end +* +* \param[in] device A pointer to the device settings structure +* \param[in] init A pointer to the init data structure for clock settings +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_ClocksSync(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Init_t* const init); + + + +/** +* \brief Initializes power monitoring related parameters during device bootup. +* +* \pre This function is private and is not called directly by the user. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X device data structure +* \param[in] txChannelMask Tx channel/s to initialize power monitor configuration for +* \param[in] totalInputInterpoloationRate Total interpolation rate for input signal. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxPowerMonitorInitialize(adi_adrv903x_Device_t* const device, + const uint32_t txChannelMask, + const uint8_t totalInputInterpoloationRate); + +/** +* \brief Helper function to set the specified Uart Signal to Gpio Output Pin. +* +* \pre This function can be called before the CPU start +* +* GPIO Pins : UART Signals +* ============================================================== +* ADI_ADRV903X_GPIO_09 : ADI_ADRV903X_GPIO_SIGNAL_UART_PADRXSIN +* ADI_ADRV903X_GPIO_10 : ADI_ADRV903X_GPIO_SIGNAL_UART_PADCTS +* ADI_ADRV903X_GPIO_11 : ADI_ADRV903X_GPIO_SIGNAL_UART_PADRTSOUT +* ADI_ADRV903X_GPIO_12 : ADI_ADRV903X_GPIO_SIGNAL_UART_PADTXSOUT +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X device data structure containing settings +* \param[in] pinSelect The GPIO Pin Select for UART signal +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_UartCfg(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e pinSelect); + +/** +* \brief Range Check API version number +* +* This function to range check the version number of the API +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] version Pointer to structure where API version information +* \param[in] minVersion Pointer to structure where API version information +* \param[in] maxVersion Pointer to structure where API version information +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_ApiVersionRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Version_t* const version, + const adi_adrv903x_Version_t* const minVersion, + const adi_adrv903x_Version_t* const maxVersion); + +#endif //CLIENT_IGNORE + +#endif diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_platform_byte_order.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_platform_byte_order.h new file mode 100644 index 0000000000000..9b59ca29fb447 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_platform_byte_order.h @@ -0,0 +1,99 @@ + /** + * \file adrv903x_platform_byte_order.h + * + * \brief Contains platform byte order (endianness) conversion macros + * + * \details Contains platform byte order (endianness) conversion macros + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_PLATFORM_BYTE_ORDER_H__ +#define __ADRV903X_PLATFORM_BYTE_ORDER_H__ + +#ifndef ADI_ADRV903X_FW +#include "adi_library_types.h" +#include "adi_adrv903x_user.h" +#ifdef ADI_ADRV903X_LITTLE_ENDIAN +#define ADRV903X_LITTLE_ENDIAN ADI_ADRV903X_LITTLE_ENDIAN +#endif +#endif + +#ifndef ADRV903X_LITTLE_ENDIAN +#ifdef __GNUC__ +#define ADRV903X_LITTLE_ENDIAN (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) +#elif defined __ICCARM__ +#define ADRV903X_LITTLE_ENDIAN (__LITTLE_ENDIAN__ == 1) +#else +#error( "Define the ADRV903X_LITTLE_ENDIAN macro for your platform.") +#endif +#endif + +/* + * Endianess conversion macros naming: + * + * C is the adrv903x's CPU byte-order i.e. little-endian + * + * H is the byte-order of the host on which the API is running which can be either big or little endian. Setting + * ADRVGEN_LITTLE_ENDIAN to match the endianess of the host will cuase the xTOy conversion macros swap bytes or not as + * appropriate for the host endianess. + * + * N is 'network byte-order' i.e. big-endian. + */ + +#define ADRV903X_BYTESWAP_S(x) \ + ((((x) & 0xFF00u) >> 8) | \ + (((x) & 0x00FFu) << 8)) + +#define ADRV903X_BYTESWAP_L(x) \ + ((((x) & 0xFF000000ul) >> 24) | \ + (((x) & 0x00FF0000ul) >> 8) | \ + (((x) & 0x0000FF00ul) << 8) | \ + (((x) & 0x000000FFul) << 24)) + +#define ADRV903X_BYTESWAP_LL( x ) \ + ((((x) & 0xFF00000000000000ull) >> 56u) | \ + (((x) & 0x00FF000000000000ull) >> 40u) | \ + (((x) & 0x0000FF0000000000ull) >> 24u) | \ + (((x) & 0x000000FF00000000ull) >> 8u) | \ + (((x) & 0x00000000FF000000ull) << 8u) | \ + (((x) & 0x0000000000FF0000ull) << 24u) | \ + (((x) & 0x000000000000FF00ull) << 40u) | \ + (((x) & 0x00000000000000FFull) << 56u)) + +#define ADRV903X_NTOCL( x ) ADRV903X_BYTESWAP_L((x)) +#define ADRV903X_CTONL( x ) ADRV903X_BYTESWAP_L((x)) + +#if ADRV903X_LITTLE_ENDIAN == 1 +/* Host is LE */ +#define ADRV903X_HTOCLL( x ) ( x ) +#define ADRV903X_CTOHLL( x ) ( x ) +#define ADRV903X_HTOCL( x ) ( x ) +#define ADRV903X_CTOHL( x ) ( x ) +#define ADRV903X_HTOCS( x ) ( x ) +#define ADRV903X_CTOHS( x ) ( x ) +#define ADRV903X_NTOHL( x ) ADRV903X_BYTESWAP_L((x)) +#define ADRV903X_HTONL( x ) ADRV903X_BYTESWAP_L((x)) +#elif ADRV903X_LITTLE_ENDIAN == 0 +/* Host is BE */ +#define ADRV903X_HTOCLL( x ) ADRV903X_BYTESWAP_LL((x)) +#define ADRV903X_CTOHLL( x ) ADRV903X_BYTESWAP_LL((x)) +#define ADRV903X_HTOCL( x ) ADRV903X_BYTESWAP_L((x)) +#define ADRV903X_CTOHL( x ) ADRV903X_BYTESWAP_L((x)) +#define ADRV903X_HTOCS( x ) ADRV903X_BYTESWAP_S((x)) +#define ADRV903X_CTOHS( x ) ADRV903X_BYTESWAP_S((x)) +#define ADRV903X_NTOHL( x ) ( x ) +#define ADRV903X_HTONL( x ) ( x ) +#else +#error "ADRV903X_LITTLE_ENDIAN value not recognized. Must be either 0 or 1." +#endif /* ADRV903X_LITTLE_ENDIAN */ + +#endif /* __ADRV903X_PLATFORM_BYTE_ORDER_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_platform_pack.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_platform_pack.h new file mode 100644 index 0000000000000..f163488a1c961 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_platform_pack.h @@ -0,0 +1,49 @@ + /** + * \file adrv903x_platform_pack.h + * + * \brief Contains platform pack define + * + * \details Contains platform pack define + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADRV903X_PLATFORM_PACK_H__ +#define __ADRV903X_PLATFORM_PACK_H__ + +#ifndef ADI_ADRV903X_FW +#include "adi_adrv903x_user.h" +#ifdef ADI_ADRV903X_PACKED +#define ADRV903X_PACKED ADI_ADRV903X_PACKED +#endif +#endif + +#ifndef ADRV903X_PACKED +#ifdef __GNUC__ +#define ADRV903X_PACKED(d) _Pragma("pack(1)") d _Pragma("pack()") +#elif defined __ICCARM__ +/* + * Error[Pm154]: in the definition of a function-like macro, each instance of a + * parameter shall be enclosed in parenthesis (MISRA C 2004 rule 19.10) + * + * ADRV903X_PACKED() is a macro used for structure packing. The parameter + * for this macro must be a structure definition, which cannot be enclosed in + * parenthesis (syntatically invalid). + */ +#pragma diag_suppress=Pm154 +#define ADRV903X_PACKED(d) _Pragma("pack(1)") d _Pragma("pack()") +#pragma diag_default=Pm154 +#elif defined _MSC_VER +#define ADRV903X_PACKED(d) __pragma(pack(1)) d __pragma(pack()) +#else +#error( "Define the ADRV903X_PACKED() macro for your compiler.") +#endif +#endif + +#endif /* __ADRV903X_PLATFORM_PACK_H__ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_radioctrl.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_radioctrl.h new file mode 100644 index 0000000000000..ada9dee8e07c3 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_radioctrl.h @@ -0,0 +1,665 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_radioctrl.h + * \brief Contains ADRV903X radio control related private function prototypes for + * adrv903x_radioctrl.c which helps adi_adrv903x_radioctrl.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_RADIOCTRL_H_ +#define _ADRV903X_RADIOCTRL_H_ + +#include "adrv903x_radioctrl_types.h" +#include "adrv903x_cpu_macros.h" +#include "adrv903x_cpu_cmd.h" + +#include "adi_adrv903x_radioctrl.h" +#include "adi_adrv903x_error.h" + +/** +* \brief This function directly triggers a stream on the Core Stream Processor. +* +* This function utilizes the ARM mailbox with a particular opcode to trigger the Core +* Stream Processor directly. Mailbox must not be busy in order to send the command, but +* ARM is not involved and will not send a response. +* +* \pre This function can be called after the stream binary has been loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] streamId unique stream identification no. of the stream to execute +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_StreamTrigger(adi_adrv903x_Device_t* const device, + const uint8_t streamId); + +/** +* \brief This function indirectly triggers a stream on the TX Stream Processor. +* +* This function calls a core stream to trigger a stream on TX Stream Processor. +* +* \pre This function can be called after the stream binary has been loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txChanMask TX channel mask +* \param[in] txStreamId unique TX stream identification no. of the stream to execute +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxStreamTrigger(adi_adrv903x_Device_t* const device, + const uint8_t txChanMask, + const uint8_t txStreamId); + +/** +* \brief This function indirectly triggers a stream on the RX Stream Processor. +* +* This function calls a core stream to trigger a stream on RX Stream Processor. +* +* \pre This function can be called after the stream binary has been loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] rxChanMask RX channel mask +* \param[in] rxStreamId unique RX stream identification no. of the stream to execute +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxStreamTrigger(adi_adrv903x_Device_t* const device, + const uint8_t rxChanMask, + const uint8_t rxStreamId); +/** +* \brief Reads back the version of the ADC module for the cal type +* +* This function sends a control command to the ARM to read back the major.minor.maint.build +* version for specified ADC module (Rx, Tx, Orx where Tx and ORx have the same version parameters) +* +* \pre +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] calType - calibration type +* \param[in] channel - channel number +* \param[out] adcVersion - Pointer to four parts of ADC version +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_AdcVersionGet(adi_adrv903x_Device_t* const device, + const uint8_t calType, + const adi_adrv903x_Channels_e channel, + adi_adrv903x_Version_t* const adcVersion); + +/** +* \brief Reads back the data sizes and base addresses of the ADC module for the cal type +* +* This function sends a control command to the ARM to read back the sizes and the addresses +* for specified ADC module (Rx, Tx, Orx) and channel. +* +* \pre +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] calType - calibration type +* \param[in] channel - channel number +* \param[out] adcSizes - Pointer to adc sizes structure +* \param[out] adcAddrs - Pointer to adc addresses structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_AdcGetDataInfo(adi_adrv903x_Device_t* const device, + const uint8_t calType, + const adi_adrv903x_Channels_e channel, + adrv903x_CpuCmd_GetAdcSizeAddrs_t* const adcSizes, + adrv903x_CpuCmd_GetAdcSizeAddrs_t* const adcAddrs); + +/** +* \brief Run the Init command of the ADC module for the cal type +* +* This function sends a control command to the ARM to run the Init command +* for specified ADC module (Rx, Tx, Orx) and channel. +* +* \pre +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] calType - calibration type +* \param[in] channel - channel number +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_AdcRunInit(adi_adrv903x_Device_t* const device, + const uint8_t calType, + const adi_adrv903x_Channels_e channel); + +/** +* \brief Set the FSM command of the ADC module for the cal type +* +* This function sends a control command to the ARM to send an FSM command +* for specified the ADC module (Rx, Tx, Orx) and channel. +* +* \pre +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] calType - calibration type +* \param[in] channel - channel number +* \param[in] fsmCmd - command number +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_AdcSetFsmCmd(adi_adrv903x_Device_t* const device, + const uint8_t calType, + const adi_adrv903x_Channels_e channel, + const uint8_t fsmCmd); + +/** +* \brief Reads back the ADC FSM state of the ADC module for the cal type +* +* This function sends a control command to the ARM to read back the FSM state +* for specified the ADC module (Rx, Tx, Orx) and channel. +* +* \pre +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] calType - calibration type +* \param[in] channel - channel number +* \param[out] fsmState - Pointer to state variable +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_AdcGetFsmState(adi_adrv903x_Device_t* const device, + const uint8_t calType, + const adi_adrv903x_Channels_e channel, + uint8_t* const fsmState); + +/** +* \brief This command results in the FW calling the _Run() function +* +* Execute the _Run() function for the +* specified ADC module (Rx, Tx, Orx) and channel. +* +* \pre +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] calType - calibration type +* \param[in] channel - channel number +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_AdcRunCmd(adi_adrv903x_Device_t* const device, + const uint8_t calType, + const adi_adrv903x_Channels_e channel); + +/** +* \brief Set the Tracking cal rate in milli seconds +* +* This function sends a set config command to the ARM to set the timer used for the specified tracking cal. +* +* \pre +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] objId - object ID +* \param[in] rateMsec - rate in milli seconds +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SetTrackingPeriod(adi_adrv903x_Device_t* const device, + uint8_t objId, + uint32_t rateMsec); + +/** +* \brief Get the Tracking cal rate in milli seconds +* +* This function sends a get config command to the ARM to get the timer used for the specified tracking cal. +* +* \pre +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] objId - object ID +* \param[out] rateMsec - rate in milli seconds +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GetTrackingPeriod(adi_adrv903x_Device_t* const device, + uint8_t objId, + uint32_t* const rateMsec); + +#ifndef CLIENT_IGNORE +/** +* \brief Perform range check for adi_adrv903x_RxTxEnableSet. +* +* Checks that all the channels in the Rx and Tx masks exist. Any invalid channel +* results in failure. Also checks that CPU state is suitable for allowing enabling of +* Rx/Tx channels. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X device data structure containing settings +* \param[in] orxChannelMask Desired Orx signal chain (channel) to power up/down +* \param[in] orxChannelEnable Desired Orx signal chain (channel) to Enable(1)/Disable(0) - Unused parameter +* \param[in] rxChannelMask Desired Rx signal chain (channel) to power up/down +* \param[in] rxChannelEnable Desired Rx signal chain (channel) to Enable(1)/Disable(0) - Unused parameter +* \param[in] txChannelMask Desired Tx signal chains (channel) to power up/down +* \param[in] txChannelEnable Desired Tx signal chain (channel) to Enable(1)/Disable(0) - Unused parameter +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxTxEnableSetRangeCheck(adi_adrv903x_Device_t* const device, + const uint32_t orxChannelMask, + const uint32_t orxChannelEnable, + const uint32_t rxChannelMask, + const uint32_t rxChannelEnable, + const uint32_t txChannelMask, + const uint32_t txChannelEnable); + +/** +* \brief Enables or disables all Rx channels that are in SPI control mode (see +* adi_adrv903x_RadioCtrlCfgSet. Has no effect on channels that are not set to SPI control mode. +* +* \pre This function should only be called after the transceiver is initialized and the stream +* images are loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param [in] device Pointer to an ADRV903X device +* \param [in] rxChannelMask Desired Rx signal chains (channels) to power up/down +* \param [in] rxChannelEnable Desired Rx signal chains (channels) to Enable(1)/Disable(0) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxEnableSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint32_t rxChannelEnable); + +/** +* \brief Enables or disables all Tx channels that are in SPI control mode (see +* adi_adrv903x_RadioCtrlCfgSet. Has no effect on channels that are not set to SPI control mode. +* +* \pre This function should only be called after the transceiver is initialized and the stream +* images are loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param [in] device Pointer to an ADRV903X device +* \param [in] txChannelMask Desired Tx signal chains (channels) to power up/down +* \param [in] txChannelEnable Desired Tx signal chains (channels) to Enable(1)/Disable(0) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxEnableSet(adi_adrv903x_Device_t* const device, + const uint32_t txChannelMask, + const uint32_t txChannelEnable); + +/** +* \brief Sets the ORx channels to be enabled or disabled in the transceiver if the signal chain +* control is configured to be in SPI mode. +* +* For use cases where pin mode is not required, this function can be used to +* enable/disable the ORx signal paths. +* +* \pre This function should be called after initialization and loading the stream +* processor. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param [in] device Pointer to the ADRV903X data structure +* \param [in] rxChannelMask Desired ORx signal chains (channel) to power up/down. Note only the bits indicating +* ORx channels are effective. Other bits indicating Rx channels are ignored. See rxChannels argument to +* adrv903x_RxTxEnableSet. +* \param [in] rxChannelEnable Desired ORx signal chains (channels) to Enable(1)/Disable(0) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxEnableSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint32_t rxChannelEnable); + + +/** +* \brief This function performs Range check on parameters passed to adi_adrv903x_RadioCtrlCfgSet() API +* +* This function is called automatically as part of adi_adrv903x_RadioCtrlCfgSet() if ADI_ADRV903X_RADIOCTRL_RANGE_CHECK +* is set to 1. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] radioCtrlCfg is comprised of radio control mode configurations for Rx,ORx and Tx channels +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RadioCtrlCfgSetRangeCheck(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RadioCtrlModeCfg_t* const radioCtrlCfg); + +/** +* \brief This function sets up the ORx signal chain Radio Ctrl configuration +* +* In Pin mode, the Rx signal chain is controlled via dedicated pins RX_ENABLE<3:0>. In +* Non-pin mode, the API command is used to configure Rx radio ctrl settings. +* +* \pre This function can be called after initialization and completion of stream loading. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] orxRadioCtrlModeCfg Pointer to ORx radio ctrl mode configuration settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxRadioCtrlCfgSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_ORxRadioCtrlModeCfg_t* const orxRadioCtrlModeCfg); + +/** +* \brief This function sets up the Rx signal chain Radio Ctrl configuration +* +* In Pin mode, the Rx signal chain is controlled via dedicated pins RX_ENABLE<3:0>. In +* Non-pin mode, the API command is used to configure Rx radio ctrl settings. +* +* \pre This function can be called after initialization and completion of stream loading. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] rxRadioCtrlModeCfg Pointer to ORx radio ctrl mode configuration settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxRadioCtrlCfgSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_RxRadioCtrlModeCfg_t* const rxRadioCtrlModeCfg); + +/** +* \brief This function sets up the Tx signal chain Radio Ctrl configuration +* +* In Pin mode, the Tx signal chain is controlled via dedicated pins TX_ENABLE<3:0>. In +* Non-pin mode, the API command is used to configure Tx radio ctrl settings. +* +* \pre This function can be called after initialization and completion of stream loading. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] txRadioCtrlModeCfg Pointer to ORx radio ctrl mode configuration settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxRadioCtrlCfgSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TxRadioCtrlModeCfg_t* const txRadioCtrlModeCfg); + +/** +* \brief This function reads back the ORx signal chain Radio Ctrl configuration +* +* \pre This function can be called after initialization. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] rxChannel Desired RxChannel +* \param[out] orxRadioCtrlModeCfg Pointer to ORx radio ctrl mode configuration settings +* which will be updated with read back configuration +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxRadioCtrlCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_ORxRadioCtrlModeCfg_t* const orxRadioCtrlModeCfg); + +/** +* \brief This function reads back the Rx signal chain Radio Ctrl configuration +* +* \pre This function can be called after initialization. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] rxChannel Desired RxChannel +* \param[out] rxRadioCtrlModeCfg Pointer to Rx radio ctrl mode configuration settings +* which will be updated with read back configuration +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxRadioCtrlCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxRadioCtrlModeCfg_t* const rxRadioCtrlModeCfg); + +/** +* \brief This function reads back the Tx signal chain Radio Ctrl configuration +* +* \pre This function can be called after initialization. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] txChannel Desired TxChannel +* \param[out] txRadioCtrlModeCfg Pointer to Tx radio ctrl mode configuration settings +* which will be updated with read back configuration +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxRadioCtrlCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxRadioCtrlModeCfg_t* const txRadioCtrlModeCfg); + +/** +* \brief This function masks/unmasks the LO unlock GP interrupt for a requested LO +* +* When the LO frequency is being updated, the LO is unlocked which generates +* a GP interrupt. For use cases where LO frequency is required to be changed, +* the GP interrupt needs to be masked so that it does not flag a false interrupt. +* +* \pre +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param device Pointer to the ADRV903X data structure +* \param loName LO for which frequency needs to be set +* \param gpInterruptPin0Mask flag to mask(1) / unmask(0) the requested LO unlock interrupt on Pin0 +* \param gpInterruptPin1Mask flag to mask(1) / unmask(0) the requested LO unlock interrupt on Pin1 +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoUnlockGpInterruptMaskSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_LoName_e const loName, + uint8_t const loGpInterruptPin0Mask, + uint8_t const loGpInterruptPin1Mask); + +/** +* \brief This reads the LO unlock GP interrupt mask for a requested LO +* +* This function can be used to retrieve current GP Interrupt mask status for the requested LO. +* +* \pre +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param device Pointer to the ADRV903X data structure +* \param loName LO unlock GP Interrupt mask is requested +* \param loGpInterruptPin0Mask Current mask/unmask status of the requested LO unlock GP Interrupt on Pin0 +* \param loGpInterruptPin1Mask Current mask/unmask status of the requested LO unlock GP Interrupt on Pin1 +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoUnlockGpInterruptMaskGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_LoName_e const loName, + uint8_t* const loGpInterruptPin0Mask, + uint8_t* const loGpInterruptPin1Mask); + +/** +* \brief This function masks/unmasks the LO overrange GP interrupt for a requested LO +* +* When the LO frequency is being updated, the LO is unlocked which generates +* a GP interrupt. For use cases where LO frequency is required to be changed, +* the GP interrupt needs to be masked so that it does not flag a false interrupt. +* +* \pre +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param device Pointer to the ADRV903X data structure +* \param loName LO for which frequency needs to be set +* \param gpInterruptPin0Mask flag to mask(1) / unmask(0) the requested LO unlock interrupt on Pin0 +* \param gpInterruptPin1Mask flag to mask(1) / unmask(0) the requested LO unlock interrupt on Pin1 +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoOverrangeGpInterruptMaskSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoName_e loName, + const uint8_t loGpInterruptPin0Mask, + const uint8_t loGpInterruptPin1Mask); + +/** +* \brief This reads the GP Interrupt overrange mask status +* +* This function can be used to retrieve current GP Interrupt mask status +* for the requested LO. +* +* \pre +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param device Pointer to the ADRV903X data structure +* \param loName LO unlock GP Interrupt mask is requested +* \param loGpInterruptPin0Mask Current mask/unmask status of the requested LO unlock GP Interrupt on Pin0 +* \param loGpInterruptPin1Mask Current mask/unmask status of the requested LO unlock GP Interrupt on Pin1 +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoOverrangeGpInterruptMaskGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoName_e loName, + uint8_t* const loGpInterruptPin0Mask, + uint8_t* const loGpInterruptPin1Mask); + +/** +* \brief Performs range check on parameters for adrv903x_LoFrequencySetRangeCheck function +* +* \pre This function is automatically called as part of adi_adrv903x_LoFrequencySet if +* ADI_ADRV903X_RADIOCTRL_RANGE_CHECK is set to 1. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X device data structure containing settings +* \param[in] loConfig Pointer to the LO config settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoFrequencySetRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoConfig_t* const loConfig); + +/** +* \brief Performs range check on parameters for adrv903x_LoLoopFilterSetRangeCheck function +* +* \pre This function is automatically called as part of adi_adrv903x_LoLoopFilterSet if +* ADI_ADRV903X_RADIOCTRL_RANGE_CHECK is set to 1. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] loName The RF LO selected +* \param[in] loLoopFilterConfig Pointer to the LO config settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoLoopFilterSetRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoName_e loName, + const adi_adrv903x_LoLoopFilterCfg_t* const loLoopFilterConfig); + + + +/** +* \brief Performs range check on parameters for adi_adrv903x_StreamGpioConfigSet function. +* +** \pre This function is automatically called as part of adi_adrv903x_StreamGpioConfigSet if +* ADI_ADRV903X_RADIOCTRL_RANGE_CHECK is set to 1. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] streamGpioPinCfg Pointer to the structure holding GPIO pin to stream GP input mappings (Input) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_StreamGpioConfigSetRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_StreamGpioPinCfg_t* const streamGpioPinCfg); + +#endif //CLIENT_IGNORE + +#endif diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_radioctrl_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_radioctrl_types.h new file mode 100644 index 0000000000000..875b7e3e4ebb0 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_radioctrl_types.h @@ -0,0 +1,42 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adrv903x_radioctrl_types.h + * \brief Contains ADRV903X RADIOCTRL related private data prototypes for + * adrv903x_radioctrl.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_RADIOCTRL_TYPES_H_ +#define _ADRV903X_RADIOCTRL_TYPES_H_ + +typedef enum adrv903x_StreamGpioFeatureSelection +{ + ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT0 = 0U, + ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT1 = 1U, + ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT2 = 2U, + ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT3 = 3U, + ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT4 = 4U, + ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT5 = 5U, + ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT6 = 6U, + ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT7 = 7U, + ADRV903X_STREAM_GPIO_TX_ANTENNA_CAL = 8U, + ADRV903X_STREAM_GPIO_RX_ANTENNA_CAL = 9U, + ADRV903X_STREAM_GPIO_TX_PAP_FOR_EXT_LO0_UNLOCK = 10U, + ADRV903X_STREAM_GPIO_TX_PAP_FOR_EXT_LO1_UNLOCK = 11U, + ADRV903X_STREAM_GPIO_0_TRX_TRIGGER_CHANNEL = 130, + ADRV903X_STREAM_GPIO_1_TRX_TRIGGER_CHANNEL = 131, + ADRV903X_STREAM_GPIO_2_TRX_TRIGGER_CHANNEL = 132, + ADRV903X_STREAM_GPIO_3_TRX_TRIGGER_CHANNEL = 133, + ADRV903X_STREAM_GPIO_UNUSED = 255U +} adrv903x_StreamGpioFeatureSelection_e; + +typedef enum adrv903x_StreamAnaGpioFeatureSelection +{ + ADRV903X_STREAM_ANA_GPIO_UNUSED = 255U +} adrv903x_StreamAnaGpioFeatureSelection_e; +#endif /* _ADRV903X_RADIOCTRL_TYPES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_reg_addr_macros.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_reg_addr_macros.h new file mode 100644 index 0000000000000..3ad66ef35a42e --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_reg_addr_macros.h @@ -0,0 +1,481 @@ +/** + * This file is automatically generated - DO NOT EDIT + * + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ADRV903X_REG_ADDR_MACROS_H +#define _ADRV903X_REG_ADDR_MACROS_H + +#define ADRV903X_BF_ENCODE(value, mask, shift) (((value) << (shift)) & (mask)) +#define ADRV903X_BF_DECODE(value, mask, shift) (((value) & (mask)) >> (shift)) +#define ADRV903X_BF_CLEAR(result, mask) (result = ((result) & ~(mask))) +#define ADRV903X_BF_SET(result, mask) (result = (result) | (mask)) +#define ADRV903X_BF_UPDATE(result, value, mask, shift) (result = ((result) & ~(mask)) | ( ((value) << (shift)) & (mask))) +#define ADRV903X_BF_EQUAL(value, mask) ((mask) == ((value) & (mask))) + + +/* Bit positions */ +#define ADRV903X_CPU_MASK_CTL1_M3_RUN 0x01 +#define ADRV903X_STREAM_RESET_BIT 0 +#define ADRV903X_RX_STREAM_RESET_BIT 16 +#define ADRV903X_STREAM_BASE_BYTE0_BIT 3 +#define ADRV903X_STREAM_BASE_BYTE1_BIT 11 +#define ADRV903X_LAST_STREAM_NUMBER_BIT 19 +#define ADRV903X_RX_STREAM_BASE_BYTE0_BIT 0 +#define ADRV903X_RX_STREAM_BASE_BYTE1_BIT 8 +#define ADRV903X_RX_LAST_STREAM_NUMBER_BIT 16 + +/* Core stream register offsets */ +#define ADRV903X_STREAM_BASE_BYTE0_REG_OFFSET 1 +#define ADRV903X_STREAM_BASE_BYTE1_REG_OFFSET 2 +#define ADRV903X_LAST_STREAM_NUMBER_REG_OFFSET 3 + +/* Registers that require using 32-bit SPI transactions */ +/* ORx RAM, Tx DPD RAM, and Tx/Rx Gain Tables */ +#define ADRV903X_AHB_ADDR_STRIDE 0x100000U +#define ADRV903X_ORX_RAM_ADDR_BASE 0x61000000U +#define ADRV903X_ORX_RAM_REG_LEN 0xC000U +#define ADRV903X_ORX_ANALOG_ADC_ADDR_BASE 0x61070000U +#define ADRV903X_ORX_ANALOG_ADC_REG_LEN 0xD800U +#define ADRV903X_RX_GAIN_TABLE_ADDR_BASE 0x600A0000U +#define ADRV903X_RX_GAIN_TABLE_REG_LEN 0x800U +#define ADRV903X_TX_DPD_RAM_ADDR_BASE 0x60800000U +#define ADRV903X_TX_DPD_RAM_REG_LEN 0x10000U +#define ADRV903X_TX_ATTEN_TABLE_ADDR_BASE 0x60810000U +#define ADRV903X_TX_ATTEN_TABLE_REG_LEN 0x2F00U +#define ADRV903X_UART_ADDR_BASE 0x46100000U +#define ADRV903X_UART_REG_LEN 0x100000U +#define ADRV903X_SPI_MASTER_ADDR_BASE 0x46200000U +#define ADRV903X_SPI_MASTER_REG_LEN 0x100000U +#define ADRV903X_INTR_TSMTR_ADDR_BASE 0x46800000U +#define ADRV903X_INTR_TSMTR_REG_LEN 0x10000U +#define ADRV903X_TELEMETRY_ADDR_BASE 0x46400000U +#define ADRV903X_TELEMETRY_REG_LEN 0x100000U + +/* 32 Hardware semaphore addresses */ +#define ADRV903X_SEMAPHORE_ADDR_BASE 0x46500000U +#define ADRV903X_SEMAPHORE_ADDR_STRIDE 0x00010000U + +/* Register addresses + * To add new register macros append the [API macro name] [YODA Header name] + * pair in c_src\devices\adrv903x\private\include\adrv903x_yoda_reg_list.txt file. +*/ +#define ADRV903X_ADDR_SPIFIFO_MODE (0x10U) +#define ADRV903X_CPU_0_ADDR_CTL_1 (0x21U) +#define ADRV903X_CPU_0_ADDR_BOOT_ADDR_BYTE0 (0x23U) +#define ADRV903X_CPU_0_ADDR_BOOT_ADDR_BYTE1 (0x24U) +#define ADRV903X_CPU_0_ADDR_BOOT_ADDR_BYTE2 (0x25U) +#define ADRV903X_CPU_0_ADDR_BOOT_ADDR_BYTE3 (0x26U) +#define ADRV903X_CPU_0_ADDR_STACK_PTR_BYTE0 (0x27U) +#define ADRV903X_CPU_0_ADDR_STACK_PTR_BYTE1 (0x28U) +#define ADRV903X_CPU_0_ADDR_STACK_PTR_BYTE2 (0x29U) +#define ADRV903X_CPU_0_ADDR_STACK_PTR_BYTE3 (0x2AU) +#define ADRV903X_CPU_0_ADDR_MEM_BANK_CTRL (0x4DU) +#define ADRV903X_ADDR_SPIDMA0_CTL (0x4FU) +#define ADRV903X_ADDR_SPIDMA0_ADDR3 (0x50U) +#define ADRV903X_ADDR_SPIDMA0_ADDR2 (0x51U) +#define ADRV903X_ADDR_SPIDMA0_ADDR1 (0x52U) +#define ADRV903X_ADDR_SPIDMA0_ADDR0 (0x53U) +#define ADRV903X_ADDR_SPIDMA0_DATA3 (0x54U) +#define ADRV903X_ADDR_SPIDMA0_DATA2 (0x55U) +#define ADRV903X_ADDR_SPIDMA0_DATA1 (0x56U) +#define ADRV903X_ADDR_SPIDMA0_DATA0 (0x57U) +#define ADRV903X_CPU_0_ADDR_COMMAND (0x63U) +#define ADRV903X_CPU_0_ADDR_EXT_CMD_BYTE_1 (0x64U) +#define ADRV903X_CPU_0_ADDR_CMD_STATUS_0 (0x6BU) +#define ADRV903X_ADDR_MAIN_STREAM_CTL (0x95U) +#define ADRV903X_ADDR_KFA_STREAM_CTL (0x95U) +#define ADRV903X_CPU_1_ADDR_CTL_1 (0xC6U) +#define ADRV903X_CPU_1_ADDR_BOOT_ADDR_BYTE0 (0xC8U) +#define ADRV903X_CPU_1_ADDR_BOOT_ADDR_BYTE1 (0xC9U) +#define ADRV903X_CPU_1_ADDR_BOOT_ADDR_BYTE2 (0xCAU) +#define ADRV903X_CPU_1_ADDR_BOOT_ADDR_BYTE3 (0xCBU) +#define ADRV903X_CPU_1_ADDR_STACK_PTR_BYTE0 (0xCCU) +#define ADRV903X_CPU_1_ADDR_STACK_PTR_BYTE1 (0xCDU) +#define ADRV903X_CPU_1_ADDR_STACK_PTR_BYTE2 (0xCEU) +#define ADRV903X_CPU_1_ADDR_STACK_PTR_BYTE3 (0xCFU) +#define ADRV903X_CPU_1_ADDR_MEM_BANK_CTRL (0xF2U) +#define ADRV903X_CPU_1_ADDR_COMMAND (0xF4U) +#define ADRV903X_CPU_1_ADDR_EXT_CMD_BYTE_1 (0xF5U) +#define ADRV903X_CPU_1_ADDR_CMD_STATUS_0 (0xFCU) +#define ADRV903X_ADDR_SPI0_PAGE_31TO24 (0x126U) +#define ADRV903X_ADDR_SPI0_PAGE_23TO16 (0x127U) +#define ADRV903X_ADDR_SPI0_PAGE_15TO8 (0x128U) +#define ADRV903X_ADDR_SPI0_PAGE_7TO0 (0x129U) +#define ADRV903X_ADDR_SPI0_PAGING_CONTROL (0x12AU) +#define ADRV903X_ADDR_SPI0_MASK_7TO0 (0x132U) +#define ADRV903X_ADDR_GPINT_MASK_PIN1_BYTE1 (0x147U) +#define ADRV903X_ADDR_GPINT_MASK_PIN1_BYTE9 (0x14FU) +#define ADRV903X_ADDR_GPINT_MASK_PIN0_BYTE1 (0x153U) +#define ADRV903X_ADDR_GPINT_MASK_PIN0_BYTE9 (0x15BU) +#define ADRV903X_ADDR_GPINT_STATUS_BYTE1 (0x16BU) +#define ADRV903X_ADDR_EFUSE_READ_CTRL (0x18BU) +#define ADRV903X_ADDR_EFUSE_READ_ADDR (0x192U) +#define ADRV903X_ADDR_CORE_STREAM_SCRATCH204 (0x2CCU) +#define ADRV903X_ADDR_CORE_STREAM_SCRATCH212 (0x2D4U) +#define ADRV903X_ADDR_CORE_STREAM_SCRATCH213 (0x2D5U) +#define ADRV903X_ADDR_CORE_STREAM_SCRATCH214 (0x2D6U) +#define ADRV903X_ADDR_CORE_STREAM_SCRATCH215 (0x2D7U) +#define ADRV903X_ADDR_CORE_STREAM_SCRATCH216 (0x2D8U) +#define ADRV903X_ADDR_RFLO0_PLL_MISC_PD (0x47300001U) +#define ADRV903X_ADDR_RFLO1_PLL_MISC_PD (0x47400001U) +#define ADRV903X_ADDR_SERDES_PLL_MISC_PD (0x48060001U) +#define ADRV903X_ADDR_SERDES_PLL_OUTPUT_DIVIDER_CTL (0x480600AEU) +#define ADRV903X_ADDR_CLK_PLL_MISC_PD (0x48090001U) +#define ADRV903X_ADDR_JESD_JTX_LINK0_SAMPLE_XBAR0 (0x48030000U) +#define ADRV903X_ADDR_JESD_JTX_LINK1_SAMPLE_XBAR0 (0x48040000U) +#define ADRV903X_ADDR_JESD_JTX_LINK2_SAMPLE_XBAR0 (0x48050000U) +#define ADRV903X_ADDR_DESER_PHY0_SPI_INTFCONFA (0x48080000U) +#define ADRV903X_ADDR_SERDES_RXDIG_PHY_PD_0 (0x48080002U) +#define ADRV903X_ADDR_DESER_PHY0_PD_REG_0 (0x48080002U) +#define ADRV903X_ADDR_DESER_PHY0_PD_REG_1 (0x48080003U) +#define ADRV903X_ADDR_DESER_PHY0_CORE1P2_TEST (0x4808000EU) +#define ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL0 (0x480800C0U) +#define ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL18 (0x480800D2U) +#define ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL28 (0x480800DCU) +#define ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL31 (0x480800E2U) +#define ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL41 (0x480800ECU) +#define ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL43 (0x480800EFU) +#define ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL45 (0x480800F2U) +#define ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL49 (0x480800F7U) +#define ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL54 (0x480800FCU) +#define ADRV903X_ADDR_DESER_PHY1_SPI_INTFCONFA (0x48080800U) +#define ADRV903X_ADDR_DESER_PHY1_PD_REG_0 (0x48080802U) +#define ADRV903X_ADDR_DESER_PHY1_PD_REG_1 (0x48080803U) +#define ADRV903X_ADDR_DESER_PHY1_CORE1P2_TEST (0x4808080EU) +#define ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL0 (0x480808C0U) +#define ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL18 (0x480808D2U) +#define ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL28 (0x480808DCU) +#define ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL31 (0x480808E2U) +#define ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL41 (0x480808ECU) +#define ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL43 (0x480808EFU) +#define ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL45 (0x480808F2U) +#define ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL49 (0x480808F7U) +#define ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL54 (0x480808FCU) +#define ADRV903X_ADDR_DESER_PHY2_SPI_INTFCONFA (0x48081000U) +#define ADRV903X_ADDR_DESER_PHY2_PD_REG_0 (0x48081002U) +#define ADRV903X_ADDR_DESER_PHY2_PD_REG_1 (0x48081003U) +#define ADRV903X_ADDR_DESER_PHY2_CORE1P2_TEST (0x4808100EU) +#define ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL0 (0x480810C0U) +#define ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL18 (0x480810D2U) +#define ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL28 (0x480810DCU) +#define ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL31 (0x480810E2U) +#define ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL41 (0x480810ECU) +#define ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL43 (0x480810EFU) +#define ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL45 (0x480810F2U) +#define ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL49 (0x480810F7U) +#define ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL54 (0x480810FCU) +#define ADRV903X_ADDR_DESER_PHY3_SPI_INTFCONFA (0x48081800U) +#define ADRV903X_ADDR_DESER_PHY3_PD_REG_0 (0x48081802U) +#define ADRV903X_ADDR_DESER_PHY3_PD_REG_1 (0x48081803U) +#define ADRV903X_ADDR_DESER_PHY3_CORE1P2_TEST (0x4808180EU) +#define ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL0 (0x480818C0U) +#define ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL18 (0x480818D2U) +#define ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL28 (0x480818DCU) +#define ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL31 (0x480818E2U) +#define ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL41 (0x480818ECU) +#define ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL43 (0x480818EFU) +#define ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL45 (0x480818F2U) +#define ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL49 (0x480818F7U) +#define ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL54 (0x480818FCU) +#define ADRV903X_ADDR_DESER_PHY4_SPI_INTFCONFA (0x48082000U) +#define ADRV903X_ADDR_DESER_PHY4_PD_REG_0 (0x48082002U) +#define ADRV903X_ADDR_DESER_PHY4_PD_REG_1 (0x48082003U) +#define ADRV903X_ADDR_DESER_PHY4_CORE1P2_TEST (0x4808200EU) +#define ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL0 (0x480820C0U) +#define ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL18 (0x480820D2U) +#define ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL28 (0x480820DCU) +#define ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL31 (0x480820E2U) +#define ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL41 (0x480820ECU) +#define ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL43 (0x480820EFU) +#define ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL45 (0x480820F2U) +#define ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL49 (0x480820F7U) +#define ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL54 (0x480820FCU) +#define ADRV903X_ADDR_DESER_PHY5_SPI_INTFCONFA (0x48082800U) +#define ADRV903X_ADDR_DESER_PHY5_PD_REG_0 (0x48082802U) +#define ADRV903X_ADDR_DESER_PHY5_PD_REG_1 (0x48082803U) +#define ADRV903X_ADDR_DESER_PHY5_CORE1P2_TEST (0x4808280EU) +#define ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL0 (0x480828C0U) +#define ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL18 (0x480828D2U) +#define ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL28 (0x480828DCU) +#define ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL31 (0x480828E2U) +#define ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL41 (0x480828ECU) +#define ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL43 (0x480828EFU) +#define ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL45 (0x480828F2U) +#define ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL49 (0x480828F7U) +#define ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL54 (0x480828FCU) +#define ADRV903X_ADDR_DESER_PHY6_SPI_INTFCONFA (0x48083000U) +#define ADRV903X_ADDR_DESER_PHY6_PD_REG_0 (0x48083002U) +#define ADRV903X_ADDR_DESER_PHY6_PD_REG_1 (0x48083003U) +#define ADRV903X_ADDR_DESER_PHY6_CORE1P2_TEST (0x4808300EU) +#define ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL0 (0x480830C0U) +#define ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL18 (0x480830D2U) +#define ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL28 (0x480830DCU) +#define ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL31 (0x480830E2U) +#define ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL41 (0x480830ECU) +#define ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL43 (0x480830EFU) +#define ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL45 (0x480830F2U) +#define ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL49 (0x480830F7U) +#define ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL54 (0x480830FCU) +#define ADRV903X_ADDR_DESER_PHY7_SPI_INTFCONFA (0x48083800U) +#define ADRV903X_ADDR_DESER_PHY7_PD_REG_0 (0x48083802U) +#define ADRV903X_ADDR_DESER_PHY7_PD_REG_1 (0x48083803U) +#define ADRV903X_ADDR_DESER_PHY7_CORE1P2_TEST (0x4808380EU) +#define ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL0 (0x480838C0U) +#define ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL18 (0x480838D2U) +#define ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL28 (0x480838DCU) +#define ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL31 (0x480838E2U) +#define ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL41 (0x480838ECU) +#define ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL43 (0x480838EFU) +#define ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL45 (0x480838F2U) +#define ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL49 (0x480838F7U) +#define ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL54 (0x480838FCU) +#define ADRV903X_ADDR_RX0_STREAM_CTL (0x60023000U) +#define ADRV903X_ADDR_RX0_STREAM_SCRATCH0 (0x60023014U) +#define ADRV903X_ADDR_RX0_STREAM_SCRATCH1 (0x60023018U) +#define ADRV903X_ADDR_RX0_STREAM_SCRATCH2 (0x6002301CU) +#define ADRV903X_ADDR_RX0_STREAM_SCRATCH3 (0x60023020U) +#define ADRV903X_ADDR_RX0_STREAM_SCRATCH4 (0x60023024U) +#define ADRV903X_ADDR_RX0_STREAM_SCRATCH5 (0x60023028U) +#define ADRV903X_ADDR_RX0_STREAM_SCRATCH6 (0x6002302CU) +#define ADRV903X_ADDR_RX0_STREAM_SCRATCH7 (0x60023030U) +#define ADRV903X_ADDR_RX1_STREAM_CTL (0x60123000U) +#define ADRV903X_ADDR_RX1_STREAM_SCRATCH0 (0x60123014U) +#define ADRV903X_ADDR_RX1_STREAM_SCRATCH1 (0x60123018U) +#define ADRV903X_ADDR_RX1_STREAM_SCRATCH2 (0x6012301CU) +#define ADRV903X_ADDR_RX1_STREAM_SCRATCH3 (0x60123020U) +#define ADRV903X_ADDR_RX1_STREAM_SCRATCH4 (0x60123024U) +#define ADRV903X_ADDR_RX1_STREAM_SCRATCH5 (0x60123028U) +#define ADRV903X_ADDR_RX1_STREAM_SCRATCH6 (0x6012302CU) +#define ADRV903X_ADDR_RX1_STREAM_SCRATCH7 (0x60123030U) +#define ADRV903X_ADDR_RX2_STREAM_CTL (0x60223000U) +#define ADRV903X_ADDR_RX2_STREAM_SCRATCH0 (0x60223014U) +#define ADRV903X_ADDR_RX2_STREAM_SCRATCH1 (0x60223018U) +#define ADRV903X_ADDR_RX2_STREAM_SCRATCH2 (0x6022301CU) +#define ADRV903X_ADDR_RX2_STREAM_SCRATCH3 (0x60223020U) +#define ADRV903X_ADDR_RX2_STREAM_SCRATCH4 (0x60223024U) +#define ADRV903X_ADDR_RX2_STREAM_SCRATCH5 (0x60223028U) +#define ADRV903X_ADDR_RX2_STREAM_SCRATCH6 (0x6022302CU) +#define ADRV903X_ADDR_RX2_STREAM_SCRATCH7 (0x60223030U) +#define ADRV903X_ADDR_RX3_STREAM_CTL (0x60323000U) +#define ADRV903X_ADDR_RX3_STREAM_SCRATCH0 (0x60323014U) +#define ADRV903X_ADDR_RX3_STREAM_SCRATCH1 (0x60323018U) +#define ADRV903X_ADDR_RX3_STREAM_SCRATCH2 (0x6032301CU) +#define ADRV903X_ADDR_RX3_STREAM_SCRATCH3 (0x60323020U) +#define ADRV903X_ADDR_RX3_STREAM_SCRATCH4 (0x60323024U) +#define ADRV903X_ADDR_RX3_STREAM_SCRATCH5 (0x60323028U) +#define ADRV903X_ADDR_RX3_STREAM_SCRATCH6 (0x6032302CU) +#define ADRV903X_ADDR_RX3_STREAM_SCRATCH7 (0x60323030U) +#define ADRV903X_ADDR_RX4_STREAM_CTL (0x60423000U) +#define ADRV903X_ADDR_RX4_STREAM_SCRATCH0 (0x60423014U) +#define ADRV903X_ADDR_RX4_STREAM_SCRATCH1 (0x60423018U) +#define ADRV903X_ADDR_RX4_STREAM_SCRATCH2 (0x6042301CU) +#define ADRV903X_ADDR_RX4_STREAM_SCRATCH3 (0x60423020U) +#define ADRV903X_ADDR_RX4_STREAM_SCRATCH4 (0x60423024U) +#define ADRV903X_ADDR_RX4_STREAM_SCRATCH5 (0x60423028U) +#define ADRV903X_ADDR_RX4_STREAM_SCRATCH6 (0x6042302CU) +#define ADRV903X_ADDR_RX4_STREAM_SCRATCH7 (0x60423030U) +#define ADRV903X_ADDR_RX5_STREAM_CTL (0x60523000U) +#define ADRV903X_ADDR_RX5_STREAM_SCRATCH0 (0x60523014U) +#define ADRV903X_ADDR_RX5_STREAM_SCRATCH1 (0x60523018U) +#define ADRV903X_ADDR_RX5_STREAM_SCRATCH2 (0x6052301CU) +#define ADRV903X_ADDR_RX5_STREAM_SCRATCH3 (0x60523020U) +#define ADRV903X_ADDR_RX5_STREAM_SCRATCH4 (0x60523024U) +#define ADRV903X_ADDR_RX5_STREAM_SCRATCH5 (0x60523028U) +#define ADRV903X_ADDR_RX5_STREAM_SCRATCH6 (0x6052302CU) +#define ADRV903X_ADDR_RX5_STREAM_SCRATCH7 (0x60523030U) +#define ADRV903X_ADDR_RX6_STREAM_CTL (0x60623000U) +#define ADRV903X_ADDR_RX6_STREAM_SCRATCH0 (0x60623014U) +#define ADRV903X_ADDR_RX6_STREAM_SCRATCH1 (0x60623018U) +#define ADRV903X_ADDR_RX6_STREAM_SCRATCH2 (0x6062301CU) +#define ADRV903X_ADDR_RX6_STREAM_SCRATCH3 (0x60623020U) +#define ADRV903X_ADDR_RX6_STREAM_SCRATCH4 (0x60623024U) +#define ADRV903X_ADDR_RX6_STREAM_SCRATCH5 (0x60623028U) +#define ADRV903X_ADDR_RX6_STREAM_SCRATCH6 (0x6062302CU) +#define ADRV903X_ADDR_RX6_STREAM_SCRATCH7 (0x60623030U) +#define ADRV903X_ADDR_RX7_STREAM_CTL (0x60723000U) +#define ADRV903X_ADDR_RX7_STREAM_SCRATCH0 (0x60723014U) +#define ADRV903X_ADDR_RX7_STREAM_SCRATCH1 (0x60723018U) +#define ADRV903X_ADDR_RX7_STREAM_SCRATCH2 (0x6072301CU) +#define ADRV903X_ADDR_RX7_STREAM_SCRATCH3 (0x60723020U) +#define ADRV903X_ADDR_RX7_STREAM_SCRATCH4 (0x60723024U) +#define ADRV903X_ADDR_RX7_STREAM_SCRATCH5 (0x60723028U) +#define ADRV903X_ADDR_RX7_STREAM_SCRATCH6 (0x6072302CU) +#define ADRV903X_ADDR_RX7_STREAM_SCRATCH7 (0x60723030U) +#define ADRV903X_ADDR_TX0_STREAM_CTL (0x60823000U) +#define ADRV903X_ADDR_TX0_STREAM_SCRATCH0 (0x60823014U) +#define ADRV903X_ADDR_TX0_STREAM_SCRATCH1 (0x60823018U) +#define ADRV903X_ADDR_TX0_STREAM_SCRATCH2 (0x6082301CU) +#define ADRV903X_ADDR_TX0_STREAM_SCRATCH5 (0x60823028U) +#define ADRV903X_ADDR_TX0_STREAM_SCRATCH6 (0x6082302CU) +#define ADRV903X_ADDR_TX1_STREAM_CTL (0x60923000U) +#define ADRV903X_ADDR_TX1_STREAM_SCRATCH0 (0x60923014U) +#define ADRV903X_ADDR_TX1_STREAM_SCRATCH1 (0x60923018U) +#define ADRV903X_ADDR_TX1_STREAM_SCRATCH2 (0x6092301CU) +#define ADRV903X_ADDR_TX1_STREAM_SCRATCH5 (0x60923028U) +#define ADRV903X_ADDR_TX1_STREAM_SCRATCH6 (0x6092302CU) +#define ADRV903X_ADDR_TX2_STREAM_CTL (0x60A23000U) +#define ADRV903X_ADDR_TX2_STREAM_SCRATCH0 (0x60A23014U) +#define ADRV903X_ADDR_TX2_STREAM_SCRATCH1 (0x60A23018U) +#define ADRV903X_ADDR_TX2_STREAM_SCRATCH2 (0x60A2301CU) +#define ADRV903X_ADDR_TX2_STREAM_SCRATCH5 (0x60A23028U) +#define ADRV903X_ADDR_TX2_STREAM_SCRATCH6 (0x60A2302CU) +#define ADRV903X_ADDR_TX3_STREAM_CTL (0x60B23000U) +#define ADRV903X_ADDR_TX3_STREAM_SCRATCH0 (0x60B23014U) +#define ADRV903X_ADDR_TX3_STREAM_SCRATCH1 (0x60B23018U) +#define ADRV903X_ADDR_TX3_STREAM_SCRATCH2 (0x60B2301CU) +#define ADRV903X_ADDR_TX3_STREAM_SCRATCH5 (0x60B23028U) +#define ADRV903X_ADDR_TX3_STREAM_SCRATCH6 (0x60B2302CU) +#define ADRV903X_ADDR_TX4_STREAM_CTL (0x60C23000U) +#define ADRV903X_ADDR_TX4_STREAM_SCRATCH0 (0x60C23014U) +#define ADRV903X_ADDR_TX4_STREAM_SCRATCH1 (0x60C23018U) +#define ADRV903X_ADDR_TX4_STREAM_SCRATCH2 (0x60C2301CU) +#define ADRV903X_ADDR_TX4_STREAM_SCRATCH5 (0x60C23028U) +#define ADRV903X_ADDR_TX4_STREAM_SCRATCH6 (0x60C2302CU) +#define ADRV903X_ADDR_TX5_STREAM_CTL (0x60D23000U) +#define ADRV903X_ADDR_TX5_STREAM_SCRATCH0 (0x60D23014U) +#define ADRV903X_ADDR_TX5_STREAM_SCRATCH1 (0x60D23018U) +#define ADRV903X_ADDR_TX5_STREAM_SCRATCH2 (0x60D2301CU) +#define ADRV903X_ADDR_TX5_STREAM_SCRATCH5 (0x60D23028U) +#define ADRV903X_ADDR_TX5_STREAM_SCRATCH6 (0x60D2302CU) +#define ADRV903X_ADDR_TX6_STREAM_CTL (0x60E23000U) +#define ADRV903X_ADDR_TX6_STREAM_SCRATCH0 (0x60E23014U) +#define ADRV903X_ADDR_TX6_STREAM_SCRATCH1 (0x60E23018U) +#define ADRV903X_ADDR_TX6_STREAM_SCRATCH2 (0x60E2301CU) +#define ADRV903X_ADDR_TX6_STREAM_SCRATCH5 (0x60E23028U) +#define ADRV903X_ADDR_TX6_STREAM_SCRATCH6 (0x60E2302CU) +#define ADRV903X_ADDR_TX7_STREAM_CTL (0x60F23000U) +#define ADRV903X_ADDR_TX7_STREAM_SCRATCH0 (0x60F23014U) +#define ADRV903X_ADDR_TX7_STREAM_SCRATCH1 (0x60F23018U) +#define ADRV903X_ADDR_TX7_STREAM_SCRATCH2 (0x60F2301CU) +#define ADRV903X_ADDR_TX7_STREAM_SCRATCH5 (0x60F23028U) +#define ADRV903X_ADDR_TX7_STREAM_SCRATCH6 (0x60F2302CU) +#define ADRV903X_ADDR_ORX0_STREAM_CTL (0x61023000U) +#define ADRV903X_ADDR_ORX0_STREAM_SCRATCH1 (0x61023018U) +#define ADRV903X_ADDR_ORX1_STREAM_CTL (0x61123000U) +#define ADRV903X_ADDR_ORX1_STREAM_SCRATCH1 (0x61123018U) +#define ADRV903X_ADDR_RX0_GAIN_COMP_CONFIG0_DDC0 (0x60060020U) +#define ADRV903X_ADDR_RX0_DEC_PWR_CONFIG1 (0x60060078U) +#define ADRV903X_ADDR_RX0_GAIN_COMP_CONFIG0_DDC1 (0x60070020U) +#define ADRV903X_ADDR_RX1_GAIN_COMP_CONFIG0_DDC0 (0x60160020U) +#define ADRV903X_ADDR_RX1_DEC_PWR_CONFIG1 (0x60160078U) +#define ADRV903X_ADDR_RX1_GAIN_COMP_CONFIG0_DDC1 (0x60170020U) +#define ADRV903X_ADDR_RX2_GAIN_COMP_CONFIG0_DDC0 (0x60260020U) +#define ADRV903X_ADDR_RX2_DEC_PWR_CONFIG1 (0x60260078U) +#define ADRV903X_ADDR_RX2_GAIN_COMP_CONFIG0_DDC1 (0x60270020U) +#define ADRV903X_ADDR_RX3_GAIN_COMP_CONFIG0_DDC0 (0x60360020U) +#define ADRV903X_ADDR_RX3_DEC_PWR_CONFIG1 (0x60360078U) +#define ADRV903X_ADDR_RX3_GAIN_COMP_CONFIG0_DDC1 (0x60370020U) +#define ADRV903X_ADDR_RX4_GAIN_COMP_CONFIG0_DDC0 (0x60460020U) +#define ADRV903X_ADDR_RX4_DEC_PWR_CONFIG1 (0x60460078U) +#define ADRV903X_ADDR_RX4_GAIN_COMP_CONFIG0_DDC1 (0x60470020U) +#define ADRV903X_ADDR_RX5_GAIN_COMP_CONFIG0_DDC0 (0x60560020U) +#define ADRV903X_ADDR_RX5_DEC_PWR_CONFIG1 (0x60560078U) +#define ADRV903X_ADDR_RX5_GAIN_COMP_CONFIG0_DDC1 (0x60570020U) +#define ADRV903X_ADDR_RX6_GAIN_COMP_CONFIG0_DDC0 (0x60660020U) +#define ADRV903X_ADDR_RX6_DEC_PWR_CONFIG1 (0x60660078U) +#define ADRV903X_ADDR_RX6_GAIN_COMP_CONFIG0_DDC1 (0x60670020U) +#define ADRV903X_ADDR_RX7_GAIN_COMP_CONFIG0_DDC0 (0x60760020U) +#define ADRV903X_ADDR_RX7_DEC_PWR_CONFIG1 (0x60760078U) +#define ADRV903X_ADDR_RX7_GAIN_COMP_CONFIG0_DDC1 (0x60770020U) +#define ADRV903X_ADDR_RX0_ADC_REGMAP0_CTRL_FD_PD (0x600C000CU) +#define ADRV903X_ADDR_RX0_ADC_REGMAP0_CTRL_FL_PD (0x600C0020U) +#define ADRV903X_ADDR_RX1_ADC_REGMAP0_CTRL_FD_PD (0x601C000CU) +#define ADRV903X_ADDR_RX1_ADC_REGMAP0_CTRL_FL_PD (0x601C0020U) +#define ADRV903X_ADDR_RX2_ADC_REGMAP0_CTRL_FD_PD (0x602C000CU) +#define ADRV903X_ADDR_RX2_ADC_REGMAP0_CTRL_FL_PD (0x602C0020U) +#define ADRV903X_ADDR_RX3_ADC_REGMAP0_CTRL_FD_PD (0x603C000CU) +#define ADRV903X_ADDR_RX3_ADC_REGMAP0_CTRL_FL_PD (0x603C0020U) +#define ADRV903X_ADDR_RX4_ADC_REGMAP0_CTRL_FD_PD (0x604C000CU) +#define ADRV903X_ADDR_RX4_ADC_REGMAP0_CTRL_FL_PD (0x604C0020U) +#define ADRV903X_ADDR_RX5_ADC_REGMAP0_CTRL_FD_PD (0x605C000CU) +#define ADRV903X_ADDR_RX5_ADC_REGMAP0_CTRL_FL_PD (0x605C0020U) +#define ADRV903X_ADDR_RX6_ADC_REGMAP0_CTRL_FD_PD (0x606C000CU) +#define ADRV903X_ADDR_RX6_ADC_REGMAP0_CTRL_FL_PD (0x606C0020U) +#define ADRV903X_ADDR_RX7_ADC_REGMAP0_CTRL_FD_PD (0x607C000CU) +#define ADRV903X_ADDR_RX7_ADC_REGMAP0_CTRL_FL_PD (0x607C0020U) +#define ADRV903X_ADDR_TX0_CPT_CONFIG (0x60830054U) +#define ADRV903X_ADDR_TX0_CPT_STATUS (0x60830058U) +#define ADRV903X_ADDR_TX0_CPT_TIMESTAMP0 (0x6083005CU) +#define ADRV903X_ADDR_TX0_CPT_TIMESTAMP1 (0x60830060U) +#define ADRV903X_ADDR_TX1_CPT_CONFIG (0x60930054U) +#define ADRV903X_ADDR_TX1_CPT_STATUS (0x60930058U) +#define ADRV903X_ADDR_TX1_CPT_TIMESTAMP0 (0x6093005CU) +#define ADRV903X_ADDR_TX1_CPT_TIMESTAMP1 (0x60930060U) +#define ADRV903X_ADDR_TX2_CPT_CONFIG (0x60A30054U) +#define ADRV903X_ADDR_TX2_CPT_STATUS (0x60A30058U) +#define ADRV903X_ADDR_TX2_CPT_TIMESTAMP0 (0x60A3005CU) +#define ADRV903X_ADDR_TX2_CPT_TIMESTAMP1 (0x60A30060U) +#define ADRV903X_ADDR_TX3_CPT_CONFIG (0x60B30054U) +#define ADRV903X_ADDR_TX3_CPT_STATUS (0x60B30058U) +#define ADRV903X_ADDR_TX3_CPT_TIMESTAMP0 (0x60B3005CU) +#define ADRV903X_ADDR_TX3_CPT_TIMESTAMP1 (0x60B30060U) +#define ADRV903X_ADDR_TX4_CPT_CONFIG (0x60C30054U) +#define ADRV903X_ADDR_TX4_CPT_STATUS (0x60C30058U) +#define ADRV903X_ADDR_TX4_CPT_TIMESTAMP0 (0x60C3005CU) +#define ADRV903X_ADDR_TX4_CPT_TIMESTAMP1 (0x60C30060U) +#define ADRV903X_ADDR_TX5_CPT_CONFIG (0x60D30054U) +#define ADRV903X_ADDR_TX5_CPT_STATUS (0x60D30058U) +#define ADRV903X_ADDR_TX5_CPT_TIMESTAMP0 (0x60D3005CU) +#define ADRV903X_ADDR_TX5_CPT_TIMESTAMP1 (0x60D30060U) +#define ADRV903X_ADDR_TX6_CPT_CONFIG (0x60E30054U) +#define ADRV903X_ADDR_TX6_CPT_STATUS (0x60E30058U) +#define ADRV903X_ADDR_TX6_CPT_TIMESTAMP0 (0x60E3005CU) +#define ADRV903X_ADDR_TX6_CPT_TIMESTAMP1 (0x60E30060U) +#define ADRV903X_ADDR_TX7_CPT_CONFIG (0x60F30054U) +#define ADRV903X_ADDR_TX7_CPT_STATUS (0x60F30058U) +#define ADRV903X_ADDR_TX7_CPT_TIMESTAMP0 (0x60F3005CU) +#define ADRV903X_ADDR_TX7_CPT_TIMESTAMP1 (0x60F30060U) +#define ADRV903X_ADDR_TX0_DAC_PWD_DOWN_I (0x6088003EU) +#define ADRV903X_ADDR_TX1_DAC_PWD_DOWN_I (0x6098003EU) +#define ADRV903X_ADDR_TX2_DAC_PWD_DOWN_I (0x60A8003EU) +#define ADRV903X_ADDR_TX3_DAC_PWD_DOWN_I (0x60B8003EU) +#define ADRV903X_ADDR_TX4_DAC_PWD_DOWN_I (0x60C8003EU) +#define ADRV903X_ADDR_TX5_DAC_PWD_DOWN_I (0x60D8003EU) +#define ADRV903X_ADDR_TX6_DAC_PWD_DOWN_I (0x60E8003EU) +#define ADRV903X_ADDR_TX7_DAC_PWD_DOWN_I (0x60F8003EU) +#define ADRV903X_ADDR_TX0_LB_ADC_WEST_TRM_PDN_CTRL (0x60896446U) +#define ADRV903X_ADDR_TX1_LB_ADC_WEST_TRM_PDN_CTRL (0x60996446U) +#define ADRV903X_ADDR_TX2_LB_ADC_WEST_TRM_PDN_CTRL (0x60A96446U) +#define ADRV903X_ADDR_TX3_LB_ADC_WEST_TRM_PDN_CTRL (0x60B96446U) +#define ADRV903X_ADDR_TX4_LB_ADC_WEST_TRM_PDN_CTRL (0x60C96446U) +#define ADRV903X_ADDR_TX5_LB_ADC_WEST_TRM_PDN_CTRL (0x60D96446U) +#define ADRV903X_ADDR_TX6_LB_ADC_WEST_TRM_PDN_CTRL (0x60E96446U) +#define ADRV903X_ADDR_TX7_LB_ADC_WEST_TRM_PDN_CTRL (0x60F96446U) +#define ADRV903X_ADDR_TX0_LB_ADC_EAST_TRM_PDN_CTRL (0x608968FDU) +#define ADRV903X_ADDR_TX1_LB_ADC_EAST_TRM_PDN_CTRL (0x609968FDU) +#define ADRV903X_ADDR_TX2_LB_ADC_EAST_TRM_PDN_CTRL (0x60A968FDU) +#define ADRV903X_ADDR_TX3_LB_ADC_EAST_TRM_PDN_CTRL (0x60B968FDU) +#define ADRV903X_ADDR_TX4_LB_ADC_EAST_TRM_PDN_CTRL (0x60C968FDU) +#define ADRV903X_ADDR_TX5_LB_ADC_EAST_TRM_PDN_CTRL (0x60D968FDU) +#define ADRV903X_ADDR_TX6_LB_ADC_EAST_TRM_PDN_CTRL (0x60E968FDU) +#define ADRV903X_ADDR_TX7_LB_ADC_EAST_TRM_PDN_CTRL (0x60F968FDU) +#define ADRV903X_ADDR_ORX0_CPT_CONFIG (0x610500D0U) +#define ADRV903X_ADDR_ORX0_CPT_STATUS0 (0x610500D4U) +#define ADRV903X_ADDR_ORX1_CPT_CONFIG (0x611500D0U) +#define ADRV903X_ADDR_ORX1_CPT_STATUS0 (0x611500D4U) + +#include "adi_library_types.h" + +typedef struct adrv903x_CpuMemDump +{ + uint32_t cpuMemAddr; + uint32_t cpuMemSize; + uint8_t cpuMemWidth; + uint8_t cpuMemEndianness; +} adrv903x_CpuMemDump_t; +typedef struct adrv903x_CpuRamMemDump +{ + uint32_t cpuMemAddr; + uint32_t cpuMemSize; + uint16_t ramId; + uint8_t cpuMemEndianness; +} adrv903x_CpuRamMemDump_t; + +extern const adrv903x_CpuRamMemDump_t adrv903x_CpuRamMemDumpTable[24]; +extern const adrv903x_CpuMemDump_t adrv903x_TelemetryMemDumpTable[1]; +extern const adrv903x_CpuMemDump_t adrv903x_CpuMemDumpTable[1858]; + +#endif diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_rx.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_rx.h new file mode 100644 index 0000000000000..594884904988f --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_rx.h @@ -0,0 +1,1290 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adrv903x_rx.h + * \brief Contains ADRV903X Rx related private function prototypes for + * adrv903x_rx.c which helps adi_adrv903x_rx.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_RX_H_ +#define _ADRV903X_RX_H_ + +#include "../../private/bf/adrv903x_bf_rx_dig_types.h" +#include "../../private/bf/adrv903x_bf_rx_funcs_types.h" +#include "../../private/bf/adrv903x_bf_rx_ddc_types.h" +#include "../../private/bf/adrv903x_bf_orx_dig_types.h" +#include "../../private/bf/adrv903x_bf_tdr_dpath_top.h" +#include "../../private/bf/adrv903x_bf_actrl_orx_west_regmap.h" +#include "adrv903x_reg_addr_macros.h" +#include "adrv903x_rx_types.h" + + +#include "adi_adrv903x_error.h" +#include "adi_adrv903x_rx.h" + +/** +* \brief Sets RX Data Formatter configuration. +* +* The slicer/formatter work in conjunction with the gain compensation module. +* The digital gain compensation module compensates for the front end attenuation +* thereby increasing the bit resolution of the Rx data word. The slicer is then +* applied to attenuate the data such that it can fit into the JESD data path resolution. +* +* This function will set the data format for the receive data on JESD link. This function +* also configures the formatter / slicer if any of the integer slicer modes are required +* to be configured. In addition to the above, any selected internal slicer GPIOs are acquired +* and configured by this function. +* +* When using integer formatting, the number of slicer bits as well as their position +* in the data word are selectable. +* +* The user can select the data format mode from one of the following +* +* rxDataFormat[i]->formatSelect | Description +* ---------------------------------------------|-------------------------------------- +* ADI_ADRV903X_GAIN_COMPENSATION_DISABLED | Disables gain compensation and Rx data formatting +* | +* ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO | Setup Rx data format to an integer format such +* | that the gain compensation data(slicer) is embedded +* | in the I and Q data. It is possible to embed 2/3/4 +* | slicer bits providing a dynamic gain compensation range +* | of 50dB. Applicable for 16-bit / 12-bit resolution +* | +* ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER | Setup Rx data format to an integer format such +* | that the gain compensation data(slicer) is encoded +* | in the GPIO output from ADRV903X. It is possible to encode 2/3/4 +* | slicer bits providing a dynamic gain compensation range +* | of 50dB. Applicable for 16-bit / 12-bit resolution +* | +* ADI_ADRV903X_EMBED_OVERLOAD_MONITOR_DATA | Setup overload indicators to be embedded in the 16 bit +* | 2s complement data. The overload indicators can be embedded +* | at LSB and/or LSB+1 positions of I and Q samples. +* ADI_ADRV903X_GAIN_WITH_FLOATING_POINT | -- MODE NOT SUPPORTED -- +* ADI_ADRV903X_GAIN_WITH_EXTERNAL_SLICER | -- MODE NOT SUPPORTED -- +* +* The ADRV903X data formatting should be used in conjunction with the +* gain compensation feature. +* +* Please note that for ORx channels ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO is the only valid mode. +* +* Please note that while disabling gain compensation a valid data format represented by +* rxDataFormat[i].integerConfigSettings.intSampleResolution has to be set to a valid mode. Please refer to enum +* adi_adrv903x_RxIntSampleResolution_e for valid intSampleResolution modes +* +* It has to be ensured that the ADRV903X JESD Framer Np for the selected Rx channel is at least equal to +* integer sample resolution size. +* +* In a 2 bit embedded slicer mode (ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO), slicer position bit 0 +* is embedded in Q data from JESD and slicer position bit 1 is embedded in I data from JESD. +* +* In a 4 bit embedded slicer mode (ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO), slicer position bit 0 +* and bit1 are embedded in Q data from JESD and slicer position bit 2 and bit 3 are embedded in I data from JESD. +* +* The slicer position can also be read back via adi_adrv903x_RxSlicerPositionGet() API +* +* The slicer position in the internal slicer mode (ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER) can be observed on +* any GPIO[23:0]. +* +* Please note that only the least significant 3/4 bits of the slicer control word is output on the GPIOs. +* +* User needs to enable fast recovery and configure AGC block with adi_adrv903x_AgcCfgSet API before using +* HB2 int0/int1 threshold and counter exceeded embedded overload flags +* +* \pre Slicer/Formatter operation requires that the device be loaded with a gain table that compensates +* for the analog front end attenuation applied. +* \pre JESD datawidth should match the data width for the requested Rx Format. +* \pre JESD initialization should be complete. +* \pre User must ensure that selected GPIOs are not already configured for another +* feature when configuring slicer formats involving GPIOS. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] rxDataFormat Pointer to the Rx data format configuration structure +* \param[in] arraySize Size of rxDataFormat array representing no. of configs +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatSet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxDataFormatRt_t rxDataFormat[], + const uint32_t arraySize); + +#ifndef CLIENT_IGNORE +/** +* \brief Formats gain table structure input into a format expected by ARM DMA +* +* Format Gain Table Data as follows : +* No. of Bytes per Gain Table Entry = 8 +* Addr 8 x gainIndex : {13'b0 , rx_fe_gain[7:0], dig_gain[10:0]} +* Addr 8 x gainIndex + 4 : {14'b0, ext_control[1:0], phase_offset[15:0]} +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] gainTablePtr Input gain table +* \param[out] formattedGainTablePtr memory to store formatted gain table data +* \param[in] numGainIndicesInTable number of gain table entries +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainTableFormat(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxGainTableRow_t gainTablePtr[], + uint8_t formattedGainTablePtr[], + const uint16_t numGainIndicesInTable); + +/** +* \brief Calculates parameters required to read Rx Gain Table from ADRV903X SRAM +* +* This function calculates the number of gain indices to read and the SRAM base +* address for the read operation given the maximum read size and gain index offset +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel is the channel for which gain table read is requested +* \param[in] maxReadGainIndices is the maximum no. of gain indices allowed to be read +* \param[in] gainIndexOffset is the off-set index from maximum gain index which is +* the starting gain index to read from +* \param[out] numGainIndicesToRead output from this function which provides the no. of gain table +* row entry reads to be performed +* \param[out] baseAddr is the starting SRAM address for read operation (output) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainTableReadParamsCompute(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint32_t maxReadGainIndices, + const uint8_t gainIndexOffset, + uint16_t* const numGainIndicesToRead, + uint32_t* const baseAddr); + +/** +* \brief Parses gain table in ARM DMA data format into a gain table row structure +* +* Format Gain Table Data as follows : +* No. of Bytes per Gain Table Entry = 8 +* cpuDmaDataGainIndex[8 x gainIndex] : {13'b0 , rx_fe_gain[7:0], dig_gain[10:0]} +* cpuDmaDataGainIndex[8 x gainIndex + 4] : {14'b0, ext_control[1:0], phase_offset[15:0]} +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[out] gainTablePtr pointer to gain table row entry structure where parsed data is stored +* \param[in] cpuDmaDataGainTablePtr memory containing data from ARM DMA +* \param[in] numGainIndicesInTable number of gain table entries +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainTableParse(adi_adrv903x_Device_t* const device, + adi_adrv903x_RxGainTableRow_t gainTablePtr[], + const uint8_t cpuDmaDataGainTablePtr[], + const uint16_t numGainIndicesInTable); + + +/** +* \brief Performs range check on rx gain index setting. +* +* \pre This function is called automatically as part of adi_adrv903x_RxGainSet() +* function if ADI_ADRV903X_RX_RANGE_CHECK > 0. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X device data structure +* \param[in] rxGain is the channelized gain setting parameter +* \param[in] arraySize Size of rxGain array representing no. of configs. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainSetRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxGain_t rxGain[], + const uint32_t arraySize); + + +/** +* \brief Performs range check on AGC/MGC gain get API. +* +* \pre This function is called automatically as part of AGC/MGC gain get API. +* function if ADI_ADRV903X_RX_RANGE_CHECK > 0. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] rxChannel Channel selection to read back gain index for (Valid Rx0-Rx7 only) +* \param[out] rxGain Pointer to the specified channel gain index value +* which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainGetRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxGain_t * const rxGain); + +/** +* \brief Performs range check on Dec power configuration. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] decPowerCfg Decimated power block configured to be range checked + +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_DecPowerCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxDecimatedPowerCfg_t* const decPowerCfg); + +/** +* \brief Performs range check on Orx Dec power configuration. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] decPowerCfg Decimated power block configured to be range checked + +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDecPowerCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_ORxDecimatedPowerCfg_t* const decPowerCfg); + + +typedef adrv903x_BfRxDigChanAddr_e adrv903x_BfRxChanAddr_e; +#define ADRV903X_BF_RX_CH0 ADRV903X_BF_SLICE_RX_0__RX_DIG +#define ADRV903X_BF_RX_CH1 ADRV903X_BF_SLICE_RX_1__RX_DIG +#define ADRV903X_BF_RX_CH2 ADRV903X_BF_SLICE_RX_2__RX_DIG +#define ADRV903X_BF_RX_CH3 ADRV903X_BF_SLICE_RX_3__RX_DIG +#define ADRV903X_BF_RX_CH4 ADRV903X_BF_SLICE_RX_4__RX_DIG +#define ADRV903X_BF_RX_CH5 ADRV903X_BF_SLICE_RX_5__RX_DIG +#define ADRV903X_BF_RX_CH6 ADRV903X_BF_SLICE_RX_6__RX_DIG +#define ADRV903X_BF_RX_CH7 ADRV903X_BF_SLICE_RX_7__RX_DIG + +/** +* \brief Look up the Rx digital bitfield address given a Rx channel +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] rxChannel Channel selection to read back gain index for (Valid Rx0-Rx7 only) +* \param[out] rxChannelBitfieldAddr Rx digital channel bitfield address which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adrv903x_BfRxChanAddr_e* const rxChannelBitfieldAddr); + +/** +* \brief Look up the ORx digital bitfield address given a Rx channel +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] rxChannel Channel selection to read back gain index for (Valid Rx0-Rx7 only) +* \param[out] orxChannelBitfieldAddr ORx digital channel bitfield address which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adrv903x_BfOrxDigChanAddr_e* const orxChannelBitfieldAddr); + +/** +* \brief Look up the Rx analog bitfield address given a Rx Channel +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] rxChannel Channel selection to read back gain index for (Valid Rx0-Rx7 only) +* \param[out] rxAnalogChannelIBitfieldAddr Rx analog channel I bitfield address which will be updated by this function +* \param[out] rxAnalogChannelQBitfieldAddr Rx analog channel Q bitfield address which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxAnalogBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adrv903x_BfTdrDpathTopChanAddr_e* const rxAnalogChannelIBitfieldAddr, + adrv903x_BfTdrDpathTopChanAddr_e* const rxAnalogChannelQBitfieldAddr); + +/** +* \brief Look up the Rx function bitfield address given a Rx Channel +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] rxChannel Channel selection to read back gain index for (Valid Rx0-Rx7 only) +* \param[out] rxFuncsChannelBitfieldAddr Rx function channel bitfield address which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncsBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adrv903x_BfRxFuncsChanAddr_e* const rxFuncsChannelBitfieldAddr); + + +/** +* \brief Look up the Rx DDC bitfield address given a Rx Channel and Band +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] rxChannel Channel selection +* \param[in] ddcBand Band selection +* \param[out] rxDdcBitfieldAddr Rx DDC channel bitfield address which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdcBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const adi_adrv903x_RxDdcs_e ddcBand, + adrv903x_BfRxDdcChanAddr_e* const rxDdcBitfieldAddr); + +/** +* \brief Helper function for adrv903x_RxDataFormatSet. Validates data in configuration table. +* +* The ADRV903X data formatting should be used in conjunction with the +* gain compensation feature. This function is automatically called as +* part of adrv903x_RxDataFormatSet() if ADI_ADRV903X_RX_RANGE_CHECK +* is set to 1 +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the device settings structure +* \param[in] rxDataFormat Pointer to the Rx data format configuration structure +* \param[in] arraySize Size of rxDataFormat array representing no. of configs +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatSetRangeCheck(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxDataFormatRt_t rxDataFormat[], + const uint32_t arraySize); + +/** +* \brief Helper function for adrv903x_RxDataFormatSetFloatingPointRangeCheck to validate configuration of +* floating point formatter +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] floatingPointConfig Structure pointer to floating point formatter settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatSetFloatingPointRangeCheck(adi_adrv903x_Device_t * const device, + const adi_adrv903x_FloatingPointConfigSettings_t * const floatingPointConfig); + + +/** +* \brief Helper function for adrv903x_CddcDataFormatSetFloatingPointRangeCheck to validate configuration of +* floating point formatter +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] floatingPointConfig Structure pointer to floating point formatter settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CddcDataFormatSetFloatingPointRangeCheck(adi_adrv903x_Device_t * const device, + const adi_adrv903x_CddcFloatingPointConfigSettings_t * const floatingPointConfig); + +/** +* \brief Performs range check on Rx integer and slicer format settings +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannelMask Channels which need to be configured for one of the integer formats +* \param[in] formatSelect Target format mode +* \param[in] integerConfigSettings Structure pointer to integer formatter configuration settings +* \param[in] slicerConfigSettings Structure pointer to slicer configuration settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatSetIntegerRangeCheck(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const adi_adrv903x_RxDataFormatModes_e formatSelect, + const adi_adrv903x_IntegerConfigSettings_t * const integerConfigSettings, + const adi_adrv903x_SlicerConfigSettings_t * const slicerConfigSettings); + +/** +* \brief Helper function for adrv903x_RxDataFormatSetRangeCheck to validate configuration of +* embedded overload monitor formatter +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] embOvldConfigSettings Structure pointer to embedded overload monitor formatter settings +* \param[in] intSampleResolution Integer sample resolution of the JESD Rx data samples +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatSetEmbOvldMonitorRangeCheck(adi_adrv903x_Device_t * const device, + const adi_adrv903x_EmbOverloadMonitorConfigSettings_t * const embOvldConfigSettings, + const adi_adrv903x_RxIntSampleResolution_e intSampleResolution); + +/** +* \brief Helper function for adrv903x_CddcDataFormatSetRangeCheck to validate configuration of +* embedded overload monitor formatter +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] embOvldConfigSettings Structure pointer to embedded overload monitor formatter settings +* \param[in] intSampleResolution Integer sample resolution of the JESD Rx data samples +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CddcDataFormatSetEmbOvldMonitorRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CddcEmbOverloadMonitorConfigSettings_t* const cddcEmbOvldConfigSettings, + const adi_adrv903x_RxIntSampleResolution_e intSampleResolution); + +/** +* \brief Disables gain compensation for the requested Rx Channels +* +* Please note that even though gain compensation is disabled, +* the embedded slicer bits have to be explicitly set to 0 failing +* which the received data will contain slicer bits if it was previously +* enabled. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannelMask specifies the channels for which gain compensation is to be disabled +* \param[in] intDataFormat integer data format on disabling gain compensation (2s complement vs signed) +* \param[in] intDataResolution integer data resolution (12/16) on disabling gain compensation +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatGainCompDisable(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const uint8_t intDataFormat, + const uint8_t intDataResolution); + +/** +* \brief Sets gain compensation for external LNA gain enable +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannelMask channels which need to be configured +* \param[in] externalLnaGain enable(1) or disable(0) gain compensation to consider LNA gain +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainCompExtLnaSet(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const uint8_t externalLnaGain); + +/** +* \brief Sets gain compensation for temperature enable +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannelMask channels which need to be configured +* \param[in] tempCompensationEnable enable(1) or disable(0) gain compensation to consider temperature +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainCompTempEnableSet(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const uint8_t tempCompensationEnable); + +/** +* \brief Sets the Rx Data format to floating point format. +* +* Following settings are configured through this function +* -> Floating point data format ({Sign, Exp, Significand} or {Sign, Significand, Exp}) +* -> Floating point round mode +* -> No. of exponent bits +* -> Attenuation step size for the floating point config +* -> Leading one for floating point and NaN encoding +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannelMask Rx channels for which floating point format has to be configured +* \param[in] floatingPointConfig Structure pointer to floating point formatter settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatFloatingPointSet(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const adi_adrv903x_FloatingPointConfigSettings_t * const floatingPointConfig); + +/** +* \brief Sets the Rx Data format to integer and configures slicer settings. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannelMask channels which need to be configured with integer settings requested +* \param[in] formatSelect Integer formatter mode select +* \param[in] integerConfigSettings contains the integer formatter settings for Rx channels requested +* \param[in] slicerConfigSettings contains the integer formatter settings for Rx channels requested +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatIntegerSet(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const adi_adrv903x_RxDataFormatModes_e formatSelect, + const adi_adrv903x_IntegerConfigSettings_t * const integerConfigSettings, + const adi_adrv903x_SlicerConfigSettings_t * const slicerConfigSettings); + +/** +* \brief Sets the Rx Data format to embedded overload indicator format and configures the embedded overload monitor settings. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannelMask Rx channels for which embedded overload indicator format has to be configured +* \param[in] embOvldConfigSettings Structure pointer to embedded overload monitor formatter settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatEmbOvldMonitorSet(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const adi_adrv903x_EmbOverloadMonitorConfigSettings_t * const embOvldConfigSettings); + +/** +* \brief Sets the Rx Data format embedded overload bits +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] chanIdx Rx channels selection +* \param[in] lsbIData I data selection +* \param[in] lsbIPlusData I+1 data selection +* \param[in] lsbQData Q data selection +* \param[in] lsbQPlusData Q+1 data selection +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxEmbeddedOverloadBitsSet(adi_adrv903x_Device_t * const device, + uint8_t chanIdx, + uint8_t lsbIData, + uint8_t lsbIPlusData, + uint8_t lsbQData, + uint8_t lsbQPlusData); + +/** +* \brief Sets the CDDC Data format embedded overload bits +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] chanIdx Rx channels selection +* \param[in] lsbIData I data selection +* \param[in] lsbIPlusData I+1 data selection +* \param[in] lsbQData Q data selection +* \param[in] lsbQPlusData Q+1 data selection +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CddcEmbeddedOverloadBitsSet(adi_adrv903x_Device_t * const device, + uint8_t chanIdx, + uint8_t lsbIData, + uint8_t lsbIPlusData, + uint8_t lsbQData, + uint8_t lsbQPlusData); + +/** +* \brief Resolves the integer data resolution and format for integer formatter. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] integerConfigSettings Structure pointer to integer formatter settings +* \param[out] intDataResolution pointer updated with integer resolution. 12bit = 0, 16bit = 1. +* \param[out] intDataFormat pointer updated integer data format. 2's complement = 0, signed magnitude = 1. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxIntSampleResFormatResolve(adi_adrv903x_Device_t * const device, + const adi_adrv903x_IntegerConfigSettings_t * const integerConfigSettings, + uint8_t * const intDataResolution, + uint8_t * const intDataFormat); + +/** +* \brief Resolves the integer data resolution and format for integer formatter. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] cddcIntegerConfigSettings Structure pointer to integer formatter settings +* \param[out] intDataResolution pointer updated with integer resolution. 12bit = 0, 16bit = 1. +* \param[out] intDataFormat pointer updated integer data format. 2's complement = 0, signed magnitude = 1. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CddcIntSampleResFormatResolve(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CddcIntegerConfigSettings_t* const cddcIntegerConfigSettings, + uint8_t* const intDataResolution, + uint8_t* const intDataFormat); + +/** +* \brief Deallocates GPIOs for internal slicer ctrl observation functionality and disconnects them. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel Receiver channel for which internal slicer ctrl GPIOs are to be disconnected +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxInternalSlicerGpioDisable(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel); + +/** +* \brief Allocates GPIOs for internal slicer ctrl observation functionality and routes the signals to +* selected GPIOs. Internal slicer ctrl GPIO outputs can be mapped to any GPIO[23:0]. +* +* It has to be noted that no two channels can share the same internal slicer ctrl GPIOs. Furthermore +* it is possible to observe Rx slicer positions only. There are no ORx slicers. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel Receiver channel for which internal slicer ctrl GPIO observation is required +* \param[in] intSlicerFormatSel Internal slicer 3pin / 4 pin mode select +* \param[in] slicerConfigSettings Slicer Config settings that contain Gpio Selections for Internal Slicer Word outputs +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxInternalSlicerGpioEnable(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + const adi_adrv903x_RxDataFormatModes_e intSlicerFormatSel, + const adi_adrv903x_SlicerConfigSettings_t* const slicerConfigSettings); + +/** +* \brief Resolves the embedded slicer position and no. of embedded slicer bits for integer formatter. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] formatSelect Requested integer format +* \param[in] intEmbeddedBits Selected embedded bits mode +* \param[out] intEmbedSlicer Updated with embedded slicer enable(1) or disable(0) +* \param[out] intEmbedSlicerPos Updated with embedded slicer position. MSB = 0, LSB = 1 +* \param[out] intEmbedSlicerNumber Updated with number of embedded slicer bits. 2 bits = 0, 1 bit = 1 +* \param[out] staticSlicer3bitModeEn Updated with the enable value for a 3bit slicer. Enable = 1, Disable = 0 +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxIntEmbSlicerConfigResolve(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxDataFormatModes_e formatSelect, + const adi_adrv903x_RxSlicerEmbeddedBits_e intEmbeddedBits, + const adi_adrv903x_RxIntParity_e parity, + uint8_t * const intEmbedSlicer, + uint8_t * const intEmbedSlicerPos, + uint8_t * const intEmbedSlicerNumber, + uint8_t * const staticSlicer3bitModeEn); + +/** +* \brief Resolves the embedded slicer position and no. of embedded slicer bits for integer formatter. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] formatSelect Requested integer format +* \param[in] intEmbeddedBits Selected embedded bits mode +* \param[out] intEmbedSlicer Updated with embedded slicer enable(1) or disable(0) +* \param[out] intEmbedSlicerPos Updated with embedded slicer position. MSB = 0, LSB = 1 +* \param[out] intEmbedSlicerNumber Updated with number of embedded slicer bits. 2 bits = 0, 1 bit = 1 +* \param[out] staticSlicer3bitModeEn Updated with the enable value for a 3bit slicer. Enable = 1, Disable = 0 +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CddcIntEmbSlicerConfigResolve(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CddcDataFormatModes_e formatSelect, + const adi_adrv903x_RxSlicerEmbeddedBits_e intEmbeddedBits, + const adi_adrv903x_RxIntParity_e parity, + uint8_t* const intEmbedSlicer, + uint8_t* const intEmbedSlicerPos, + uint8_t* const intEmbedSlicerNumber, + uint8_t* const staticSlicer3bitModeEn); + +/** +* \brief Resolves the integer parity support for integer formatter. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] integerConfigSettings Structure containing integer formatter settings +* \param[out] intParitySupport Updated with integer parity support. Enabled = 1, Disabled = 0. +* \param[out] intEvenParity Updated with even/odd parity. Even = 0, Odd = 1. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxIntParitySupportResolve(adi_adrv903x_Device_t * const device, + const adi_adrv903x_IntegerConfigSettings_t * const integerConfigSettings, + uint8_t * const intParitySupport, + uint8_t * const intEvenParity); + +/** +* \brief Resolves the integer parity support for integer formatter. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] integerConfigSettings Structure containing integer formatter settings +* \param[out] intParitySupport Updated with integer parity support. Enabled = 1, Disabled = 0. +* \param[out] intEvenParity Updated with even/odd parity. Even = 0, Odd = 1. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CddcIntParitySupportResolve(adi_adrv903x_Device_t * const device, + const adi_adrv903x_CddcIntegerConfigSettings_t * const cddcIntegerConfigSettings, + uint8_t * const intParitySupport, + uint8_t * const intEvenParity); + +/** +* \brief Returns the Rx Data formatter mode currently configured +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel Receiver channel for which Rx data format select read back is requested +* \param[out] rxDataFormat output representing currently configured Rx data format +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatSelectGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxDataFormatModes_e * const rxDataFormat); + +/** +* \brief Retrieves the Rx floating point formatter settings configured in the device +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel RX channel for which to retrieve floating point formatter settings +* \param[out] floatingPointConfig Output structure to populate with floating point formatter settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatFloatingPointGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_FloatingPointConfigSettings_t * const floatingPointConfig); + +/** +* \brief Returns the Rx Data formatter integer and slicer settings. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel Channel for which to retrieve integer format and slicer settings +* \param[out] integerConfigSettings Populated with integer config settings +* \param[out] slicerConfigSettings Populated with slicer config settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatIntegerGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_IntegerConfigSettings_t * const integerConfigSettings, + adi_adrv903x_SlicerConfigSettings_t * const slicerConfigSettings); + +/** +* \brief Retrieves the Rx embedded overload indicator format settings configured in the device +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel RX channel for which to retrieve embedded overload indicator format settings +* \param[out] embOvldConfigSettings Output structure to populate with settings of the embedded overload +* monitor formatter +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatEmbOvldMonitorGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_EmbOverloadMonitorConfigSettings_t * const embOvldConfigSettings); + +/** +* \brief Returns gain compensation for external LNA gain enable status +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel RX channel to retrieve settings for +* \param[out] externalLnaGain Current status of the external LNA gain compensation enable. 0 = Disabled, 1 = Enabled +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainCompExtLnaGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint8_t * const externalLnaGain); + +/** +* \brief Returns gain compensation for temperature enable status +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel RX channel to retrieve settings for +* \param[out] tempCompensationEnable Populated with wither temp compensation is enabled (1) or disabled (0). +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainCompTempEnableGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint8_t * const tempCompensationEnable); + +/** +* \brief Reads the GPIO source control register to determine if GPIOs are assigned to observe the +* internal slicer control word. +* +* +* ORx slicer positions cannot be observed via internal slicer observation GPIOs. There are not ORx slicers. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel RX channel to retrieve settings for +* \param[out] intSlicerFormatSel Output parameter that will be populated with the current RX data + format selection, if enableStatus is 1. +* \param[out] enableStatus Output parameter that will be populated with whether the slicer control + is routed to observation GPIOs(1) or not(0). +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxInternalSlicerGpioEnableGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxDataFormatModes_e * const intSlicerFormatSel, + uint8_t * const enableStatus); + +/** +* \brief Encodes the embedded slicer position and no. of embedded slicer bits for integer formatter. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel RX channel which to retrieve settings for +* \param[in] intEmbedSlicer embedded slicer enable/disable status read back from device +* \param[in] intEmbedSlicerPos embedded slicer position status read back from device +* \param[in] intEmbedSlicerNumber embedded slicer bits status read back from device +* \param[out] integerConfigSettingsEmbSlicer Output enumeration that is populated with + the value that corresponds to the combination of slicer configuration parameters +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxIntEmbSlicerConfigEncode(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint8_t intEmbedSlicer, + const uint8_t intEmbedSlicerPos, + const uint8_t intEmbedSlicerNumber, + adi_adrv903x_RxSlicerEmbeddedBits_e * const integerConfigSettingsEmbSlicer); + +/** +* \brief Encodes the embedded slicer position and no. of embedded slicer bits for integer formatter for the CDDC. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel RX channel which to retrieve settings for +* \param[in] intEmbedSlicer embedded slicer enable/disable status read back from device +* \param[in] intEmbedSlicerPos embedded slicer position status read back from device +* \param[in] intEmbedSlicerNumber embedded slicer bits status read back from device +* \param[out] integerConfigSettingsEmbSlicer Output enumeration that is populated with + the value that corresponds to the combination of slicer configuration parameters +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CddcIntEmbSlicerConfigEncode(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint8_t intEmbedSlicer, + const uint8_t intEmbedSlicerPos, + const uint8_t intEmbedSlicerNumber, + adi_adrv903x_RxSlicerEmbeddedBits_e* const integerConfigSettingsEmbSlicer); + +/** +* \brief Encodes the integer data resolution and format for integer formatter. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] intDataResolution Integer resolution of Rx data formatter. + 12 bits = 0, 16 bits = 1. +* \param[in] intDataFormat Integer data format of Rx Data Formatter. + 2's complement = 0, signed-magnitude = 1. +* \param[out] intSampleResolution Output parameter populated with the value that + corresponds to the integer format represented by the input parameters. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxIntSampleResFormatEncode(adi_adrv903x_Device_t * const device, + const uint8_t intDataResolution, + const uint8_t intDataFormat, + adi_adrv903x_RxIntSampleResolution_e * const intSampleResolution); + +/** +* \brief Encodes the integer parity support for integer formatter. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel Receiver channel for which RX data format is requested +* \param[in] intParitySupport Integer parity support from the device. Disabled = 0, enabled = 1. +* \param[in] intEvenParity Integer parity from the device. Even = 0, odd = 1. +* \param[out] integerParity Output parameter populated with the value that corresponds to the parity + settings represented by the input parameters +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxIntParitySupportEncode(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint8_t intParitySupport, + const uint8_t intEvenParity, + adi_adrv903x_RxIntParity_e * const integerParity); + +/** +* \brief Encodes the integer parity support for integer formatter for the CDDC. +* +* \dep_begin +* \dep{ device->common.devHalInfo } +* \dep{ device->devStateInfo } +* \dep_end +* +* \param[in] device Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel Receiver channel for which RX data format is requested +* \param[in] intParitySupport Integer parity support from the device.Disabled = 0, enabled = 1. +* \param[in] intEvenParity Integer parity from the device.Even = 0, odd = 1. +* \param[out] integerParity Output parameter populated with the value that corresponds to the parity +* settings represented by the input parameters +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_CddcIntParitySupportEncode(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint8_t intParitySupport, + const uint8_t intEvenParity, + adi_adrv903x_RxIntParity_e* const integerParity); + +/** +* \brief This function reads back the LO Source Mapping to the requested Rx channel. +* +* The LO source select for a given channel is configured during init time. This function +* can be used to read back the configuration during run time. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X device data structure +* \param[in] rxChannel Enum to select Rx Channel. +* \param[out] rxLoSource Pointer to store Rx channel LO source mapping read back (Output) +* +* \retval adi_adrv903x_ErrAction_e - ADI_COMMON_ACT_NO_ACTION if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxLoSourceGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_LoSel_e* const rxLoSource); + +/** +* \brief Performs range check on the Rx channel min and max gain indices to be updated +* +* This function is called automatically as part of adi_adrv903x_RxMinMaxGainIndexSet() +* if the ADI_ADRV903X_RX_RANGE_CHECK is set to 1. This function can be called independently +* to perform range checks only on parameters for adi_adrv903x_RxMinMaxGainIndexSet() API +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] rxChannelMask channel masks for which min and max gain indices are to be updated +* \param[in] minGainIndex is the lower limit of the gain index for a given channel +* \param[in] maxGainIndex is the upper limit of the gain index for a given channel +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxMinMaxGainIndexSetRangeCheck(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint8_t minGainIndex, + const uint8_t maxGainIndex); + +/** +* \brief Performs range check on the gain table settings for Rx channels. +* +* This function called automatically as part of adi_adrv903x_RxGainTableWrite() API +* if ADI_ADRV903X_RX_RANGE_CHECK is set to 1. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] rxChannelMask is the set of channels for which current gain table settings are to be programmed. +* Valid Rx channels include Rx0-Rx7 +* \param[in] gainIndexOffset is the starting gain index from which gain table is programmed +* \param[in] gainTableRow Array of gain table row entries for programming +* \param[in] arraySize is the number of gain table rows to be programmed +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainTableWriteRangeCheck(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint8_t gainIndexOffset, + const adi_adrv903x_RxGainTableRow_t gainTableRow[], + const uint32_t arraySize); +/** +* \brief Performs range check on the gain table read request for Rx channels. +* +* This function called automatically as part of adi_adrv903x_RxGainTableRead() API +* if ADI_ADRV903X_RX_RANGE_CHECK is set to 1. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel represents the channels for which gain table read back is requested. +* Valid Rx channels include Rx0-Rx7 +* \param[in] gainIndexOffset is the gain index from which gain table read back should start +* \param[out] gainTableRow Read back array for gain table row entries which will be updated with the read back values +* \param[in] arraySize is the size of gainTableRow array. It is also the upper limit for the no. of gain indices to read +* \param[out] numGainIndicesRead is the actual no. of gain indices read from SRAM (output). A NULL can be passed +* if the value of no. of gain indices actually read is not required. + +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainTableReadRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint8_t gainIndexOffset, + const adi_adrv903x_RxGainTableRow_t gainTableRow[], + const uint32_t arraySize); + +/** +* \brief This function configures Hb2 peak detector block for selected Rx channel +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] rxChannel Enum to select Rx Channel. +* \param[in] enableHb2Overload 1:Enable Hb2 block, 0:Disable Hb2 block +* \param[in] hb2OverloadSignalSelection 2: Select input of DEC3 Block 1:Select input of Hb2 block, 0:Select output of Hb2 block +* \param[in] hb2OverloadPowerMode 1:Use I^2+Q^2 signal configuration, 0:Use max(|I|, |Q|) signal configuration +* +* \retval adi_adrv903x_ErrAction_e - ADI_COMMON_ACT_NO_ACTION if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxHb2OverloadCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint8_t enableHb2Overload, + const uint8_t hb2OverloadSignalSelection, + const uint8_t hb2OverloadPowerMode); + +/** +* \brief This function reads back the Hb2 block configuration of selected Hb2 block +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] rxChannel Enum to select Rx Channel. +* \param[out] enableHb2Overload Pointer to readback value. enableHb2Overload 1:Enable Hb2 block, 0:Disable Hb2 block +* \param[out] hb2OverloadSignalSelection Pointer to readback value 1:Select input of Hb2 block, 0:Select output of Hb2 block +* \param[out] hb2OverloadPowerMode Pointer to readback value 1:Use I^2+Q^2 signal configuration, 0:Use max(|I|, |Q|) signal configuration +* +* \retval adi_adrv903x_ErrAction_e - ADI_COMMON_ACT_NO_ACTION if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxHb2OverloadCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint8_t * const enableHb2Overload, + uint8_t * const hb2OverloadSignalSelection, + uint8_t * const hb2OverloadPowerMode); + +/** + * \brief Convert from ORx integer attenuation (dB) to TrmAtten and trmAttenBwCapEn bitfield values + * required by the device to give effect to the requested ORx attenuation. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep{device->devStateInfo} + * \dep_end + * + * \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure + * \param[in] attenDb ORx attenuation. Valid range 0-16 dB. + * \param[out] trmAtten. The value required for the trm_atten bitfield is written here. + * \param[out] trmAtten. The value required for the trm_atten_bw_cap_en bitfield is written here. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adrv903x_ORxAttenDbToRegValues(adi_adrv903x_Device_t* const device, + const uint8_t attenDb, + uint8_t* const trmAtten, + uint8_t* const trmAttenBwCapEn); + +/** + * \brief Convert from the value supplied by the TrmAtten bitfield read function + * to the closest corresponding attenuation (dB) which it indicates. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep{device->devStateInfo} + * \dep_end + * + * \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure + * \param[in] attenDb ORx attenuation. Valid range 0-16 dB. + * \param[out] trmAtten. The converted adrv903x_Bf_ActrlOrxWestRegmap_TrmAtten_e is written here. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adrv903x_ORxTrmAttenToDb(adi_adrv903x_Device_t* const device, + const uint8_t trmAtten, + uint8_t* const attenDb); + +/** +* \brief Returns 0-indexed channel id for a given adi_adrv903x_RxChannels_e. +* +* \param[in] rxChannel The value to convert. +* +* \retval uint8_t The channel id. Returns a value greater ADI_ADRV903X_CHAN_ID_MAX if the value supplied cannot be +* converted (i.e. is not valid value for the enum or refers to RX_ALL or RX_NONE). +*/ +ADI_API uint8_t adrv903x_RxChannelsToId(const adi_adrv903x_RxChannels_e rxChannel); + +#endif //CLIENT_IGNORE +#endif diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_rx_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_rx_types.h new file mode 100644 index 0000000000000..aec2f2b870ab0 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_rx_types.h @@ -0,0 +1,20 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adrv903x_rx_types.h +* +* \brief Contains ADRV903X data types for on board cpus feature +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef _ADRV903X_RX_TYPES_H_ +#define _ADRV903X_RX_TYPES_H_ + +#include "adi_adrv903x_rx_types.h" + +#endif /* _ADRV903X_RX_TYPES_H_ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_shared_resource_manager.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_shared_resource_manager.h new file mode 100644 index 0000000000000..db98386d71308 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_shared_resource_manager.h @@ -0,0 +1,290 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_shared_resource_manager.h + * \brief Contains ADRV903X shared resource related private function prototypes for + * adrv903x_shared_resource_manager.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_SHARED_RESOURCE_MANAGER_H_ +#define _ADRV903X_SHARED_RESOURCE_MANAGER_H_ + +#include "adrv903x_shared_resource_manager_types.h" +#include "adi_adrv903x_error.h" + + +/** +* \brief Resets the shared resource pool for a given adrv903x device +* +* Each shared resource is associated with a feature. On reset, all the +* shared resources are assigned to 'UNUSED' and are ready for use by a given feature. +* +* \pre This function is required to be called during initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the adrv903x device data structure +* \retval ADI_ADRV903X_ERR_ACT_NONE if Error Data is marked clear +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceMgrReset(adi_adrv903x_Device_t* const device); + +/** +* \brief Returns if a requested shared resource is available for use +* +* Each shared resource is associated with a feature. Returns a success if the shared resource +* is unused and a failure if already in use. +* +* \pre This function is a private function used internally by the API and can be called +* anytime after initialization by the API to test shared resource availability +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the adrv903x device data structure +* \param[in] sharedResourceID is the shared resource whose availability is being inquired +* \param[out] sharedResourceAvailable result - ADI_TRUE or ADI_FALSE is returned depending +* on availability of shared resource +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Error Data is marked clear +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceAvailabilityCheck(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceID_e sharedResourceID, + uint8_t* const sharedResourceAvailable); + +/** +* \brief Returns the shared resource ID for a shared resource +* +* \pre This function is a private function used internally by the API and can be called +* anytime after initialization by the API to test shared resource availability +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the adrv903x device data structure +* \param[in] sharedResourceType is the shared resource type(GPIO, MEMORY etc) for which ID is being requested +* \param[in] sharedResource is typically the enum value of the shared resource for which ID is being requested +* \param[out] sharedResourceID result shared resource ID is updated in this variable +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Error Data is marked clear +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceIdGet(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceType_e sharedResourceType, + int32_t sharedResource, + adrv903x_SharedResourceID_e* const sharedResourceID); + +/** +* \brief Returns the feature currently consuming the shared resource. +* +* Each shared resource is associated with a feature in the resource pool. +* This function returns the feature currently associated with the shared resource +* +* \pre This function is a private function used internally by the API and can be called +* anytime after initialization by the API to inquirer shared +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the adrv903x device data structure +* \param[in] sharedResourceID is the shared resource whose availability is under query +* \param[out] featureID pointer to the feature associated with the requested shared resource ID +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Error Data is marked clear +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceFeatureGet(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceID_e sharedResourceID, + adrv903x_FeatureID_e* const featureID); + +/** +* \brief Set the channelMask currently consuming the shared resource. +* +* Each shared resource is associated with a feature in the resource pool. +* This function returns the channelMask currently associated with the shared resource +* +* \pre This function is a private function used internally by the API and can be called +* anytime after initialization by the API to inquire shared +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the adrv903x device data structure +* \param[in] sharedResourceID is the shared resource whose availability is under query +* \param[in] channelMask the channelMask associated with the requested shared resource ID +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Error Data is marked clear +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceChannelMaskSet(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceID_e sharedResourceID, + const uint32_t channelMask); + +/** +* \brief Returns the channelMask currently consuming the shared resource. +* +* Each shared resource is associated with a feature in the resource pool. +* This function returns the channelMask currently associated with the shared resource +* +* \pre This function is a private function used internally by the API and can be called +* anytime after initialization by the API to inquire shared +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the adrv903x device data structure +* \param[in] sharedResourceID is the shared resource whose availability is under query +* \param[out] channelMask pointer to the channelMask associated with the requested shared resource ID +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Error Data is marked clear +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceChannelMaskGet(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceID_e sharedResourceID, + uint32_t * const channelMask); + + +/** +* \brief Returns the maximum semaphore count for a given feature. +* +* Each shared resource is associated with a feature in the resource pool. +* Some features share the shared resource with multiple consumers necessitating +* a semaphore associated with each feature. This function can be used to inquire +* the maximum semaphore count associated with the feature. +* +* \pre This function is a private function used internally by the API and can be called +* anytime after initialization by the API to inquire the maximum semaphore count associated +* with a feature +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the adrv903x device data structure +* \param[in] featureID The feature ID for which the maximum semaphore count is requested +* \param[out] maxSemaphoreCount Pointer to the max semaphore count variable which will be updated +* with the maximum semaphore count for a given feature. +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Error Data is marked clear +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceFeatureMaxSemaphoreCntGet(adi_adrv903x_Device_t* const device, + const adrv903x_FeatureID_e featureID, + uint8_t* const maxSemaphoreCount); + +/** +* \brief Attempts to acquire the requested shared resource for a requested from the +* adrv903x device data structure shared resource pool +* +* \pre This function is a private function used internally by the API and can be called +* anytime after initialization by the API to acquire a shared resource +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the adrv903x device data structure +* \param[in] sharedResourceID is the shared resource whose availability is under query +* \param[in] featureID feature requesting the shared resource +* \param[out] resourceAcquistionStatus stores ADI_SUCCESS if resource acquisition was successful, +* ADI_FAILURE otherwise +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Error Data is marked clear +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceAcquire(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceID_e sharedResourceID, + const adrv903x_FeatureID_e featureID, + uint8_t* const resourceAcquistionStatus); + +/** +* \brief Attempts to acquire multiple shared resources for a requested feature from the +* adrv903x device data structure shared resource pool +* +* This function returns a failure even if a single resource acquisition fails +* +* \pre This function is a private function used internally by the API and can be called +* anytime after initialization by the API to acquire multiple shared resources for +* the same feature +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the adrv903x device data structure +* \param[in] sharedResourceType is the enum of the shared resource type to be acquired +* \param[in] sharedResourceArr is the array of shared resources to be acquired +* \param[in] numSharedResources is the size of sharedResourceArr +* \param[in] featureID feature requesting the shared resource +* \param[out] resourceAcquistionStatus stores ADI_SUCCESS if resource acquisition was successful, +* ADI_FAILURE otherwise +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Error Data is marked clear +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourcesAcquire(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceType_e sharedResourceType, + int32_t sharedResourceArr[], + const uint32_t numSharedResources, + const adrv903x_FeatureID_e featureID, + uint8_t* const resourceAcquistionStatus); + +/** +* \brief Attempts to release the shared resource under consumption by the given feature +* +* \pre This function is a private function used internally by the API and can be called +* anytime after initialization by the API to test shared resource availability +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the adrv903x device data structure +* \param[in] sharedResourceID is the shared resource whose availability is under query +* \param[in] featureID feature requesting the shared resource +* \param[out] resourceReleaseStatus stores ADI_SUCCESS if resource release was successful, +* ADI_FAILURE otherwise +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Error Data is marked clear +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceRelease(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceID_e sharedResourceID, + const adrv903x_FeatureID_e featureID, + uint8_t* const resourceReleaseStatus); + +/** +* \brief Attempts to release multiple shared resources for a requested feature from the +* adrv903x device data structure shared resource pool +* +* This function returns a failure even if a single resource release fails +* +* \pre This function is a private function used internally by the API and can be called +* anytime after initialization by the API to release multiple shared resources for +* the same feature +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the adrv903x device data structure +* \param[in] sharedResourceType is the enum of the shared resource type to be released +* \param[in] sharedResourceArr is the array of shared resources to be acquired +* \param[in] numSharedResources is the size of sharedResourceArr +* \param[in] featureID feature requesting the shared resource +* \param[out] resourceReleaseStatus stores ADI_SUCCESS if resource release was successful, +* ADI_FAILURE otherwise +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Error Data is marked clear +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourcesRelease(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceType_e sharedResourceType, + int32_t sharedResourceArr[], + uint32_t numSharedResources, + const adrv903x_FeatureID_e featureID, + uint8_t* const resourceReleaseStatus); + +#endif // ! _ADRV903X_SHARED_RESOURCE_MANAGER_H_ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_shared_resource_manager_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_shared_resource_manager_types.h new file mode 100644 index 0000000000000..9423be3eddb33 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_shared_resource_manager_types.h @@ -0,0 +1,734 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_shared_resource_manager_types.h + * \brief Contains ADRV903X shared resource related private data prototypes for + * adrv903x_shared_resource_manager.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_SHARED_RESOURCE_MANAGER_TYPES_H_ +#define _ADRV903X_SHARED_RESOURCE_MANAGER_TYPES_H_ + +#include "adi_library.h" +#include "../../public/include/adi_adrv903x_gpio_types.h" + + +/***Please add shared resource maximum semaphore count above this line****/ + +typedef enum adrv903x_SharedResourceType +{ + ADRV903X_SHARED_RESOURCE_GPIO = 0U, /*!< Select GPIO as the Shared Resource type*/ + ADRV903X_SHARED_RESOURCE_GPIO_ANALOG = 1U, + /*!< Select GPIO Analog as the Shared Resource type*/ + /***Please add shared resource type above this line****/ + ADRV903X_NUM_SHARED_RESOURCE_TYPES +} adrv903x_SharedResourceType_e; + +typedef enum adrv903x_SharedResourceID +{ + /******START OF DIGITAL GPIO********/ + ADRV903X_GPIO_00 = 0U, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_00*/ + ADRV903X_GPIO_01, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_01*/ + ADRV903X_GPIO_02, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_02*/ + ADRV903X_GPIO_03, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_03*/ + ADRV903X_GPIO_04, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_04*/ + ADRV903X_GPIO_05, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_05*/ + ADRV903X_GPIO_06, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_06*/ + ADRV903X_GPIO_07, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_07*/ + ADRV903X_GPIO_08, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_08*/ + ADRV903X_GPIO_09, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_09*/ + ADRV903X_GPIO_10, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_10*/ + ADRV903X_GPIO_11, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_11*/ + ADRV903X_GPIO_12, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_12*/ + ADRV903X_GPIO_13, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_13*/ + ADRV903X_GPIO_14, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_14*/ + ADRV903X_GPIO_15, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_15*/ + ADRV903X_GPIO_16, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_16*/ + ADRV903X_GPIO_17, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_17*/ + ADRV903X_GPIO_18, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_18*/ + ADRV903X_GPIO_19, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_19*/ + ADRV903X_GPIO_20, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_20*/ + ADRV903X_GPIO_21, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_21*/ + ADRV903X_GPIO_22, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_22*/ + ADRV903X_GPIO_23, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_23*/ + /******START OF GPIO Analog********/ + ADRV903X_GPIO_ANA_00, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_00*/ + ADRV903X_GPIO_ANA_01, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_01*/ + ADRV903X_GPIO_ANA_02, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_02*/ + ADRV903X_GPIO_ANA_03, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_03*/ + ADRV903X_GPIO_ANA_04, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_04*/ + ADRV903X_GPIO_ANA_05, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_05*/ + ADRV903X_GPIO_ANA_06, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_06*/ + ADRV903X_GPIO_ANA_07, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_07*/ + ADRV903X_GPIO_ANA_08, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_08*/ + ADRV903X_GPIO_ANA_09, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_09*/ + ADRV903X_GPIO_ANA_10, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_10*/ + ADRV903X_GPIO_ANA_11, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_11*/ + ADRV903X_GPIO_ANA_12, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_12*/ + ADRV903X_GPIO_ANA_13, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_13*/ + ADRV903X_GPIO_ANA_14, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_14*/ + ADRV903X_GPIO_ANA_15, /*!< Unique Shared Resource ID for ADI_ADRV903X_GPIO_ANA_15*/ + /***Please add shared resources above this line***/ + ADRV903X_NUM_SHARED_RESOURCES, + ADRV903X_SHARED_RESOURCE_INVALID +} adrv903x_SharedResourceID_e; + +#define GPIO_SIGNAL_FEATURE 0x01000000 + +typedef enum adrv903x_FeatureID +{ + ADRV903X_FEATURE_UNUSED = 0U, + ADRV903X_FEATURE_GPIO_AUX_SPI_SDIO = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_SDIO, + ADRV903X_FEATURE_GPIO_AUX_SPI_SDO = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_SDO, + ADRV903X_FEATURE_GPIO_AUX_SPI_CLK = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_CLK, + ADRV903X_FEATURE_GPIO_AUX_SPI_CSB = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_CSB, + ADRV903X_FEATURE_GPIO_UART_PADRXSIN = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_UART_PADRXSIN, + ADRV903X_FEATURE_GPIO_UART_PADCTS = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_UART_PADCTS, + ADRV903X_FEATURE_GPIO_UART_PADRTSOUT = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_UART_PADRTSOUT, + ADRV903X_FEATURE_GPIO_UART_PADTXSOUT = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_UART_PADTXSOUT, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_0, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_1, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_2, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_3, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_4, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_5, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_6, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_7, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_8, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_9, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_10, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_11, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_12 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_12, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_13 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_13, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_14 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_14, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_15 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_15, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_16 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_16, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_17 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_17, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_18 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_18, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_19 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_19, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_20 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_20, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_21 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_21, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_22 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_22, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_OUTPUT_23 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_23, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_0, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_1, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_2, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_3, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_4, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_5, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_6, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_7, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_8, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_9, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_10, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_11, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_12 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_12, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_13 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_13, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_14 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_14, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_15 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_15, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_16 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_16, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_17 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_17, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_18 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_18, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_19 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_19, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_20 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_20, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_21 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_21, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_22 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_22, + ADRV903X_FEATURE_GPIO_MANUAL_MODE_INPUT_23 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_23, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_0, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_1, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_2, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_3, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_4, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_5, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_6, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_7, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_8, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_9, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_10, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_11, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_12 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_12, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_13 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_13, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_14 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_14, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_15 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_15, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_16 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_16, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_17 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_17, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_18 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_18, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_19 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_19, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_20 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_20, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_21 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_21, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_22 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_22, + ADRV903X_FEATURE_GPIO_ARM_OUTPUT_23 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_23, + ADRV903X_FEATURE_GPIO_ARM_INPUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_0, + ADRV903X_FEATURE_GPIO_ARM_INPUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_1, + ADRV903X_FEATURE_GPIO_ARM_INPUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_2, + ADRV903X_FEATURE_GPIO_ARM_INPUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_3, + ADRV903X_FEATURE_GPIO_ARM_INPUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_4, + ADRV903X_FEATURE_GPIO_ARM_INPUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_5, + ADRV903X_FEATURE_GPIO_ARM_INPUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_6, + ADRV903X_FEATURE_GPIO_ARM_INPUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_7, + ADRV903X_FEATURE_GPIO_ARM_INPUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_8, + ADRV903X_FEATURE_GPIO_ARM_INPUT_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_9, + ADRV903X_FEATURE_GPIO_ARM_INPUT_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_10, + ADRV903X_FEATURE_GPIO_ARM_INPUT_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_11, + ADRV903X_FEATURE_GPIO_ARM_INPUT_12 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_12, + ADRV903X_FEATURE_GPIO_ARM_INPUT_13 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_13, + ADRV903X_FEATURE_GPIO_ARM_INPUT_14 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_14, + ADRV903X_FEATURE_GPIO_ARM_INPUT_15 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_15, + ADRV903X_FEATURE_GPIO_ARM_INPUT_16 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_16, + ADRV903X_FEATURE_GPIO_ARM_INPUT_17 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_17, + ADRV903X_FEATURE_GPIO_ARM_INPUT_18 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_18, + ADRV903X_FEATURE_GPIO_ARM_INPUT_19 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_19, + ADRV903X_FEATURE_GPIO_ARM_INPUT_20 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_20, + ADRV903X_FEATURE_GPIO_ARM_INPUT_21 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_21, + ADRV903X_FEATURE_GPIO_ARM_INPUT_22 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_22, + ADRV903X_FEATURE_GPIO_ARM_INPUT_23 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_23, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_FINE_BAND_OUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_0, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_FINE_BAND_OUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_1, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_FINE_BAND_OUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_2, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_FINE_BAND_OUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_3, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_FINE_BAND_OUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_4, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_FINE_BAND_OUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_5, + ADRV903X_FEATURE_GPIO_CLKPLL_CP_CALBITS_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_0, + ADRV903X_FEATURE_GPIO_CLKPLL_CP_CALBITS_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_1, + ADRV903X_FEATURE_GPIO_CLKPLL_CP_CALBITS_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_2, + ADRV903X_FEATURE_GPIO_CLKPLL_CP_CALBITS_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_3, + ADRV903X_FEATURE_GPIO_CLKPLL_CP_CALBITS_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_4, + ADRV903X_FEATURE_GPIO_CLKPLL_CP_CALBITS_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_5, + ADRV903X_FEATURE_GPIO_CLKPLL_PLL_LOCKED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_PLL_LOCKED, + ADRV903X_FEATURE_GPIO_CLKPLL_CP_OVERRANGE_LOW_FLAG = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_OVERRANGE_LOW_FLAG, + ADRV903X_FEATURE_GPIO_CLKPLL_CP_OVERRANGE_HIGH_FLAG = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_OVERRANGE_HIGH_FLAG, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_COMP_OUT = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_COMP_OUT, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_CAL_IN_PROGRESS = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_CAL_IN_PROGRESS, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_0, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_1, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_2, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_3, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_4, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_5, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_6, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_7, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_8, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_ALC_WORD_OUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_0, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_ALC_WORD_OUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_1, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_ALC_WORD_OUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_2, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_ALC_WORD_OUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_3, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_ALC_WORD_OUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_4, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_ALC_WORD_OUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_5, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_ALC_WORD_OUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_6, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_ALC_WORD_OUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_7, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_ALC_WORD_OUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_8, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_ALC_WORD_OUT_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_9, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_ALC_WORD_OUT_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_10, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_TCIDAC_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_0, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_TCIDAC_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_1, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_TCIDAC_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_2, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_TCIDAC_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_3, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_TCIDAC_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_4, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_TCIDAC_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_5, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_TCIDAC_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_6, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_TCIDAC_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_7, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_TCIDAC_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_8, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_TCIDAC_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_9, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_TCIDAC_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_10, + ADRV903X_FEATURE_GPIO_CLKPLL_VCO_TCIDAC_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_11, + ADRV903X_FEATURE_GPIO_CLKPLL_SPARE_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_0, + ADRV903X_FEATURE_GPIO_CLKPLL_SPARE_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_1, + ADRV903X_FEATURE_GPIO_CLKPLL_SPARE_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_2, + ADRV903X_FEATURE_GPIO_CLKPLL_SPARE_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_3, + ADRV903X_FEATURE_GPIO_CLKPLL_SPARE_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_4, + ADRV903X_FEATURE_GPIO_CLKPLL_SPARE_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_5, + ADRV903X_FEATURE_GPIO_CLKPLL_SPARE_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_6, + ADRV903X_FEATURE_GPIO_CLKPLL_SPARE_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_7, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_FINE_BAND_OUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_0, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_FINE_BAND_OUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_1, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_FINE_BAND_OUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_2, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_FINE_BAND_OUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_3, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_FINE_BAND_OUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_4, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_FINE_BAND_OUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_5, + ADRV903X_FEATURE_GPIO_RFPLL0_CP_CALBITS_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_0, + ADRV903X_FEATURE_GPIO_RFPLL0_CP_CALBITS_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_1, + ADRV903X_FEATURE_GPIO_RFPLL0_CP_CALBITS_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_2, + ADRV903X_FEATURE_GPIO_RFPLL0_CP_CALBITS_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_3, + ADRV903X_FEATURE_GPIO_RFPLL0_CP_CALBITS_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_4, + ADRV903X_FEATURE_GPIO_RFPLL0_CP_CALBITS_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_5, + ADRV903X_FEATURE_GPIO_RFPLL0_PLL_LOCKED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_PLL_LOCKED, + ADRV903X_FEATURE_GPIO_RFPLL0_CP_OVERRANGE_LOW_FLAG = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_OVERRANGE_LOW_FLAG, + ADRV903X_FEATURE_GPIO_RFPLL0_CP_OVERRANGE_HIGH_FLAG = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_OVERRANGE_HIGH_FLAG, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_COMP_OUT = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_COMP_OUT, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_CAL_IN_PROGRESS = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_CAL_IN_PROGRESS, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_0, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_1, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_2, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_3, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_4, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_5, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_6, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_7, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_8, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_ALC_WORD_OUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_0, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_ALC_WORD_OUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_1, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_ALC_WORD_OUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_2, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_ALC_WORD_OUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_3, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_ALC_WORD_OUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_4, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_ALC_WORD_OUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_5, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_ALC_WORD_OUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_6, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_ALC_WORD_OUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_7, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_ALC_WORD_OUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_8, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_ALC_WORD_OUT_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_9, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_ALC_WORD_OUT_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_10, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_TCIDAC_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_0, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_TCIDAC_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_1, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_TCIDAC_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_2, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_TCIDAC_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_3, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_TCIDAC_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_4, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_TCIDAC_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_5, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_TCIDAC_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_6, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_TCIDAC_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_7, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_TCIDAC_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_8, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_TCIDAC_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_9, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_TCIDAC_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_10, + ADRV903X_FEATURE_GPIO_RFPLL0_VCO_TCIDAC_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_11, + ADRV903X_FEATURE_GPIO_RFPLL0_SPARE_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_0, + ADRV903X_FEATURE_GPIO_RFPLL0_SPARE_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_1, + ADRV903X_FEATURE_GPIO_RFPLL0_SPARE_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_2, + ADRV903X_FEATURE_GPIO_RFPLL0_SPARE_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_3, + ADRV903X_FEATURE_GPIO_RFPLL0_SPARE_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_4, + ADRV903X_FEATURE_GPIO_RFPLL0_SPARE_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_5, + ADRV903X_FEATURE_GPIO_RFPLL0_SPARE_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_6, + ADRV903X_FEATURE_GPIO_RFPLL0_SPARE_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_7, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_FINE_BAND_OUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_0, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_FINE_BAND_OUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_1, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_FINE_BAND_OUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_2, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_FINE_BAND_OUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_3, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_FINE_BAND_OUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_4, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_FINE_BAND_OUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_5, + ADRV903X_FEATURE_GPIO_RFPLL1_CP_CALBITS_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_0, + ADRV903X_FEATURE_GPIO_RFPLL1_CP_CALBITS_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_1, + ADRV903X_FEATURE_GPIO_RFPLL1_CP_CALBITS_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_2, + ADRV903X_FEATURE_GPIO_RFPLL1_CP_CALBITS_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_3, + ADRV903X_FEATURE_GPIO_RFPLL1_CP_CALBITS_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_4, + ADRV903X_FEATURE_GPIO_RFPLL1_CP_CALBITS_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_5, + ADRV903X_FEATURE_GPIO_RFPLL1_PLL_LOCKED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_PLL_LOCKED, + ADRV903X_FEATURE_GPIO_RFPLL1_CP_OVERRANGE_LOW_FLAG = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_OVERRANGE_LOW_FLAG, + ADRV903X_FEATURE_GPIO_RFPLL1_CP_OVERRANGE_HIGH_FLAG = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_OVERRANGE_HIGH_FLAG, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_COMP_OUT = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_COMP_OUT, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_CAL_IN_PROGRESS = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_CAL_IN_PROGRESS, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_0, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_1, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_2, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_3, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_4, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_5, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_6, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_7, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_8, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_ALC_WORD_OUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_0, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_ALC_WORD_OUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_1, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_ALC_WORD_OUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_2, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_ALC_WORD_OUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_3, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_ALC_WORD_OUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_4, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_ALC_WORD_OUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_5, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_ALC_WORD_OUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_6, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_ALC_WORD_OUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_7, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_ALC_WORD_OUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_8, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_ALC_WORD_OUT_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_9, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_ALC_WORD_OUT_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_10, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_TCIDAC_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_0, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_TCIDAC_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_1, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_TCIDAC_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_2, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_TCIDAC_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_3, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_TCIDAC_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_4, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_TCIDAC_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_5, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_TCIDAC_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_6, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_TCIDAC_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_7, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_TCIDAC_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_8, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_TCIDAC_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_9, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_TCIDAC_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_10, + ADRV903X_FEATURE_GPIO_RFPLL1_VCO_TCIDAC_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_11, + ADRV903X_FEATURE_GPIO_RFPLL1_SPARE_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_0, + ADRV903X_FEATURE_GPIO_RFPLL1_SPARE_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_1, + ADRV903X_FEATURE_GPIO_RFPLL1_SPARE_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_2, + ADRV903X_FEATURE_GPIO_RFPLL1_SPARE_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_3, + ADRV903X_FEATURE_GPIO_RFPLL1_SPARE_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_4, + ADRV903X_FEATURE_GPIO_RFPLL1_SPARE_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_5, + ADRV903X_FEATURE_GPIO_RFPLL1_SPARE_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_6, + ADRV903X_FEATURE_GPIO_RFPLL1_SPARE_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_7, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_N_DES_CH_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_0, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_N_DES_CH_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_1, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_N_DES_CH_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_2, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_N_DES_CH_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_3, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_N_DES_CH_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_4, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_N_DES_CH_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_5, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_N_DES_CH_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_6, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_N_DES_CH_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_7, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_P_DES_CH_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_0, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_P_DES_CH_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_1, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_P_DES_CH_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_2, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_P_DES_CH_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_3, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_P_DES_CH_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_4, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_P_DES_CH_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_5, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_P_DES_CH_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_6, + ADRV903X_FEATURE_GPIO_JTAG_DETECTOR_P_DES_CH_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_7, + ADRV903X_FEATURE_GPIO_RX_SYNC_JTAG_DETECTOR_P_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_P_0, + ADRV903X_FEATURE_GPIO_RX_SYNC_JTAG_DETECTOR_P_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_P_1, + ADRV903X_FEATURE_GPIO_RX_SYNC_JTAG_DETECTOR_P_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_P_2, + ADRV903X_FEATURE_GPIO_RX_SYNC_JTAG_DETECTOR_N_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_N_0, + ADRV903X_FEATURE_GPIO_RX_SYNC_JTAG_DETECTOR_N_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_N_1, + ADRV903X_FEATURE_GPIO_RX_SYNC_JTAG_DETECTOR_N_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_N_2, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JRX_READ_DATA_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_0, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JRX_READ_DATA_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_1, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JRX_READ_DATA_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_2, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JRX_READ_DATA_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_3, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JRX_READ_DATA_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_4, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JRX_READ_DATA_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_5, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JRX_READ_DATA_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_6, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JRX_READ_DATA_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_7, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JTX_READ_DATA_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_0, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JTX_READ_DATA_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_1, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JTX_READ_DATA_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_2, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JTX_READ_DATA_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_3, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JTX_READ_DATA_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_4, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JTX_READ_DATA_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_5, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JTX_READ_DATA_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_6, + ADRV903X_FEATURE_GPIO_CONTROL_OUT_MUX_JTX_READ_DATA_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_7, + ADRV903X_FEATURE_GPIO_CONTROL_UPDATE_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_UPDATE_0, + ADRV903X_FEATURE_GPIO_CONTROL_UPDATE_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_UPDATE_1, + ADRV903X_FEATURE_GPIO_CONTROL_UPDATE_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_UPDATE_2, + ADRV903X_FEATURE_GPIO_CONTROL_UPDATE_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_CONTROL_UPDATE_3, + ADRV903X_FEATURE_GPIO_MCS_CLK_IND_CORE = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MCS_CLK_IND_CORE, + ADRV903X_FEATURE_GPIO_REF_CLK = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_REF_CLK, + ADRV903X_FEATURE_GPIO_SPI_REG_ARM0_ERROR = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_SPI_REG_ARM0_ERROR, + ADRV903X_FEATURE_GPIO_SPI_REG_ARM1_ERROR = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_SPI_REG_ARM1_ERROR, + ADRV903X_FEATURE_GPIO_DIG_POWERGOOD = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_DIG_POWERGOOD, + ADRV903X_FEATURE_GPIO_MASTER_BIAS_CLK = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MASTER_BIAS_CLK, + ADRV903X_FEATURE_GPIO_MBIAS_IGEN_PD_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MBIAS_IGEN_PD_0, + ADRV903X_FEATURE_GPIO_MBIAS_IGEN_PD_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MBIAS_IGEN_PD_1, + ADRV903X_FEATURE_GPIO_MBIAS_COMP_OUT_ANA_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MBIAS_COMP_OUT_ANA_0, + ADRV903X_FEATURE_GPIO_MBIAS_COMP_OUT_ANA_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MBIAS_COMP_OUT_ANA_1, + ADRV903X_FEATURE_GPIO_SPI_REG_MBIAS_IGEN_PTATR_TRIM_DONE_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_SPI_REG_MBIAS_IGEN_PTATR_TRIM_DONE_0, + ADRV903X_FEATURE_GPIO_SPI_REG_MBIAS_IGEN_PTATR_TRIM_DONE_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_SPI_REG_MBIAS_IGEN_PTATR_TRIM_DONE_1, + ADRV903X_FEATURE_GPIO_JRX_IRQ_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_0, + ADRV903X_FEATURE_GPIO_JRX_IRQ_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_1, + ADRV903X_FEATURE_GPIO_JRX_IRQ_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_2, + ADRV903X_FEATURE_GPIO_JRX_IRQ_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_3, + ADRV903X_FEATURE_GPIO_JRX_IRQ_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_4, + ADRV903X_FEATURE_GPIO_JRX_IRQ_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_5, + ADRV903X_FEATURE_GPIO_JRX_IRQ_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_6, + ADRV903X_FEATURE_GPIO_JRX_IRQ_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_7, + ADRV903X_FEATURE_GPIO_JRX_IRQ_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_8, + ADRV903X_FEATURE_GPIO_JRX_IRQ_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_9, + ADRV903X_FEATURE_GPIO_JRX_IRQ_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_10, + ADRV903X_FEATURE_GPIO_JRX_IRQ_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_11, + ADRV903X_FEATURE_GPIO_JTX_IRQ_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_0, + ADRV903X_FEATURE_GPIO_JTX_IRQ_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_1, + ADRV903X_FEATURE_GPIO_JTX_IRQ_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_2, + ADRV903X_FEATURE_GPIO_JTX_IRQ_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_3, + ADRV903X_FEATURE_GPIO_JTX_IRQ_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_4, + ADRV903X_FEATURE_GPIO_JTX_IRQ_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_5, + ADRV903X_FEATURE_GPIO_JTX_IRQ_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_6, + ADRV903X_FEATURE_GPIO_JTX_IRQ_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_7, + ADRV903X_FEATURE_GPIO_JTX_IRQ_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_8, + ADRV903X_FEATURE_GPIO_JTX_IRQ_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_9, + ADRV903X_FEATURE_GPIO_NEW_PHASE_TOGGLE = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NEW_PHASE_TOGGLE, + ADRV903X_FEATURE_GPIO_JESD_MCS_CLK_IND = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_JESD_MCS_CLK_IND, + ADRV903X_FEATURE_GPIO_SERDES_PLL_PLL_LOCKED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_SERDES_PLL_PLL_LOCKED, + ADRV903X_FEATURE_GPIO_SERDES_PLL_VCO_COMP_OUT = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_SERDES_PLL_VCO_COMP_OUT, + ADRV903X_FEATURE_GPIO_POWER_ON_RESET_N = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_POWER_ON_RESET_N, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_0, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_1, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_2, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_3, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_4, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_5, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_6, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_7, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_8, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_9, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_10, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_11, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_12 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_12, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_13 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_13, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_14 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_14, + ADRV903X_FEATURE_GPIO_MISR_SIGNATURE_15 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_15, + ADRV903X_FEATURE_GPIO_RX_SPI_SOURCE_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_0, + ADRV903X_FEATURE_GPIO_RX_SPI_SOURCE_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_1, + ADRV903X_FEATURE_GPIO_RX_SPI_SOURCE_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_2, + ADRV903X_FEATURE_GPIO_RX_SPI_SOURCE_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_3, + ADRV903X_FEATURE_GPIO_RX_SPI_SOURCE_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_4, + ADRV903X_FEATURE_GPIO_RX_SPI_SOURCE_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_5, + ADRV903X_FEATURE_GPIO_RX_SPI_SOURCE_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_6, + ADRV903X_FEATURE_GPIO_RX_SPI_SOURCE_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_7, + ADRV903X_FEATURE_GPIO_SLICER_POSITION_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_0, + ADRV903X_FEATURE_GPIO_SLICER_POSITION_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_1, + ADRV903X_FEATURE_GPIO_SLICER_POSITION_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_2, + ADRV903X_FEATURE_GPIO_SLICER_POSITION_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_3, + ADRV903X_FEATURE_GPIO_MCS_CLK_IND_RX = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MCS_CLK_IND_RX, + ADRV903X_FEATURE_GPIO_RFDC_UPDATE = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFDC_UPDATE, + ADRV903X_FEATURE_GPIO_SLICER_OVERFLOW = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_SLICER_OVERFLOW, + ADRV903X_FEATURE_GPIO_AGC_ADCOVRG_SEC_HIGH = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_SEC_HIGH, + ADRV903X_FEATURE_GPIO_AGC_OVRG_SEC_HIGH_COUNTER_EXCEEDED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_SEC_HIGH_COUNTER_EXCEEDED, + ADRV903X_FEATURE_GPIO_TIA_VALID = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_TIA_VALID, + ADRV903X_FEATURE_GPIO_RXFE_VALID = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RXFE_VALID, + ADRV903X_FEATURE_GPIO_RSSI_DECPWR_READY = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RSSI_DECPWR_READY, + ADRV903X_FEATURE_GPIO_PEAK_COUNT_EXCEEDED_QEC_ANA = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PEAK_COUNT_EXCEEDED_QEC_ANA, + ADRV903X_FEATURE_GPIO_PEAK_COUNT_EXCEEDED_QEC_DIG = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PEAK_COUNT_EXCEEDED_QEC_DIG, + ADRV903X_FEATURE_GPIO_RSSI_SYMBOL_READY = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RSSI_SYMBOL_READY, + ADRV903X_FEATURE_GPIO_RXON = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RXON, + ADRV903X_FEATURE_GPIO_ADC_OVERLOAD_RESET_ADC = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ADC_OVERLOAD_RESET_ADC, + ADRV903X_FEATURE_GPIO_RFDC_STATE_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFDC_STATE_0, + ADRV903X_FEATURE_GPIO_RFDC_STATE_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFDC_STATE_1, + ADRV903X_FEATURE_GPIO_RFDC_STATE_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFDC_STATE_2, + ADRV903X_FEATURE_GPIO_RFDC_STATE_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFDC_STATE_3, + ADRV903X_FEATURE_GPIO_RFDC_UPDATE_COUNTER_EXPIRED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFDC_UPDATE_COUNTER_EXPIRED, + ADRV903X_FEATURE_GPIO_RFDC_MEASURE = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFDC_MEASURE, + ADRV903X_FEATURE_GPIO_RFDC_CAL_DONE = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFDC_CAL_DONE, + ADRV903X_FEATURE_GPIO_RFDC_MEASURE_COUNTER_EXPIRED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RFDC_MEASURE_COUNTER_EXPIRED, + ADRV903X_FEATURE_GPIO_AGC_OVRG_LOW_INT1_COUNTER_EXCEEDED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_LOW_INT1_COUNTER_EXCEEDED, + ADRV903X_FEATURE_GPIO_AGC_OVRG_LOW_INT0_COUNTER_EXCEEDED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_LOW_INT0_COUNTER_EXCEEDED, + ADRV903X_FEATURE_GPIO_DIG_GAIN_SAT = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_DIG_GAIN_SAT, + ADRV903X_FEATURE_GPIO_AGC_ADCOVRG_INT1_LOW = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_INT1_LOW, + ADRV903X_FEATURE_GPIO_AGC_ADCOVRG_INT0_LOW = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_INT0_LOW, + ADRV903X_FEATURE_GPIO_AGC_SL_STATE_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_SL_STATE_0, + ADRV903X_FEATURE_GPIO_AGC_SL_STATE_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_SL_STATE_1, + ADRV903X_FEATURE_GPIO_AGC_GAINUPDATE_COUNTER_EXPIRED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_GAINUPDATE_COUNTER_EXPIRED, + ADRV903X_FEATURE_GPIO_AGC_SL_LOW_TH_EXCEEDED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_SL_LOW_TH_EXCEEDED, + ADRV903X_FEATURE_GPIO_AGC_SL_HIGH_TH_EXCEEDED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_SL_HIGH_TH_EXCEEDED, + ADRV903X_FEATURE_GPIO_AGC_OVRG_LLB_COUNTER_EXCEEDED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_LLB_COUNTER_EXCEEDED, + ADRV903X_FEATURE_GPIO_AGC_ADCOVRG_LOW = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_LOW, + ADRV903X_FEATURE_GPIO_AGC_ADCOVRG_HIGH = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_HIGH, + ADRV903X_FEATURE_GPIO_GT_GAIN_CHANGE = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GT_GAIN_CHANGE, + ADRV903X_FEATURE_GPIO_AGC_OVRG_ULB_COUNTER_EXCEEDED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_ULB_COUNTER_EXCEEDED, + ADRV903X_FEATURE_GPIO_AGC_OVRG_LOW_COUNTER_EXCEEDED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_LOW_COUNTER_EXCEEDED, + ADRV903X_FEATURE_GPIO_AGC_OVRG_HIGH_COUNTER_EXCEEDED = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_HIGH_COUNTER_EXCEEDED, + ADRV903X_FEATURE_GPIO_BAND_PEAK_COUNT_EXCEEDED_LOW_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_BAND_PEAK_COUNT_EXCEEDED_LOW_0, + ADRV903X_FEATURE_GPIO_BAND_PEAK_COUNT_EXCEEDED_LOW_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_BAND_PEAK_COUNT_EXCEEDED_LOW_1, + ADRV903X_FEATURE_GPIO_BAND_PEAK_COUNT_EXCEEDED_HIGH_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_BAND_PEAK_COUNT_EXCEEDED_HIGH_0, + ADRV903X_FEATURE_GPIO_BAND_PEAK_COUNT_EXCEEDED_HIGH_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_BAND_PEAK_COUNT_EXCEEDED_HIGH_1, + ADRV903X_FEATURE_GPIO_BAND_DECPWR_READY_TOGGLE_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_BAND_DECPWR_READY_TOGGLE_0, + ADRV903X_FEATURE_GPIO_BAND_DECPWR_READY_TOGGLE_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_BAND_DECPWR_READY_TOGGLE_1, + ADRV903X_FEATURE_GPIO_BAND_DECPWR_READY_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_BAND_DECPWR_READY_0, + ADRV903X_FEATURE_GPIO_BAND_DECPWR_READY_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_BAND_DECPWR_READY_1, + ADRV903X_FEATURE_GPIO_MCS_CLK_IND_TX = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MCS_CLK_IND_TX, + ADRV903X_FEATURE_GPIO_PA_PROT_SRERROR = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PA_PROT_SRERROR, + ADRV903X_FEATURE_GPIO_PA_PROT_PPERROR_OR_APERROR = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PA_PROT_PPERROR_OR_APERROR, + ADRV903X_FEATURE_GPIO_ATTEN_RAMP_UP_PROT = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ATTEN_RAMP_UP_PROT, + ADRV903X_FEATURE_GPIO_ATTEN_RAMP_DOWN_PROT = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ATTEN_RAMP_DOWN_PROT, + ADRV903X_FEATURE_GPIO_ATTEN_TDD_RAMP_DOWN = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ATTEN_TDD_RAMP_DOWN, + ADRV903X_FEATURE_GPIO_ATTEN_TDD_RAMP_UP = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ATTEN_TDD_RAMP_UP, + ADRV903X_FEATURE_GPIO_ATTEN_LATCH_EN = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ATTEN_LATCH_EN, + ADRV903X_FEATURE_GPIO_DTX_POWER_UP_TRIGGER = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_DTX_POWER_UP_TRIGGER, + ADRV903X_FEATURE_GPIO_DTX_POWER_DOWN_TRIGGER = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_DTX_POWER_DOWN_TRIGGER, + ADRV903X_FEATURE_GPIO_TX_GAIN_CHANGE = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_TX_GAIN_CHANGE, + ADRV903X_FEATURE_GPIO_TX_POWER_READY = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_TX_POWER_READY, + ADRV903X_FEATURE_GPIO_PA_PROT_SRD_IRQ = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PA_PROT_SRD_IRQ, + ADRV903X_FEATURE_GPIO_TX_TSSI_DUC0_READY = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_TX_TSSI_DUC0_READY, + ADRV903X_FEATURE_GPIO_ADC_SAMPLE_OVR = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ADC_SAMPLE_OVR, + ADRV903X_FEATURE_GPIO_MCS_CLK_IND_ORX = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_MCS_CLK_IND_ORX, + ADRV903X_FEATURE_GPIO_ORX_ON = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ORX_ON, + ADRV903X_FEATURE_GPIO_DECPWR_READY = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_DECPWR_READY, + ADRV903X_FEATURE_GPIO_ANY_ADC_SAMPLE_OVR = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANY_ADC_SAMPLE_OVR, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_0, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_1, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_2, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_3, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_4, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_5, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_6, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_7, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_8, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_9, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_10, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_11, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_12 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_12, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_13 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_13, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_14 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_14, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_15 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_15, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_16 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_16, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_17 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_17, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_18 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_18, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_19 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_19, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_20 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_20, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_21 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_21, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_22 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_22, + ADRV903X_FEATURE_GPIO_GPIO_STREAM_PROC_PIN_23 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_23, + ADRV903X_FEATURE_GPIO_PPI16_PEB = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PEB, + ADRV903X_FEATURE_GPIO_PPI16_CLK = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_CLK, + ADRV903X_FEATURE_GPIO_PPI16_PDI_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_0, + ADRV903X_FEATURE_GPIO_PPI16_PDI_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_1, + ADRV903X_FEATURE_GPIO_PPI16_PDI_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_2, + ADRV903X_FEATURE_GPIO_PPI16_PDI_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_3, + ADRV903X_FEATURE_GPIO_PPI16_PDI_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_4, + ADRV903X_FEATURE_GPIO_PPI16_PDI_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_5, + ADRV903X_FEATURE_GPIO_PPI16_PDI_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_6, + ADRV903X_FEATURE_GPIO_PPI16_PDI_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_7, + ADRV903X_FEATURE_GPIO_PPI16_PDI_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_8, + ADRV903X_FEATURE_GPIO_PPI16_PDI_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_9, + ADRV903X_FEATURE_GPIO_PPI16_PDI_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_10, + ADRV903X_FEATURE_GPIO_PPI16_PDI_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_11, + ADRV903X_FEATURE_GPIO_PPI16_PDI_12 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_12, + ADRV903X_FEATURE_GPIO_PPI16_PDI_13 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_13, + ADRV903X_FEATURE_GPIO_PPI16_PDI_14 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_14, + ADRV903X_FEATURE_GPIO_PPI16_PDI_15 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_15, + ADRV903X_FEATURE_GPIO_ADC_TEST_GEN_ENABLE = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ADC_TEST_GEN_ENABLE, + ADRV903X_FEATURE_GPIO_AGC_GAIN_CHANGE = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_GAIN_CHANGE, + ADRV903X_FEATURE_GPIO_AGC_DEC_GAIN = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_DEC_GAIN, + ADRV903X_FEATURE_GPIO_AGC_INC_GAIN = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_INC_GAIN, + ADRV903X_FEATURE_GPIO_AGC_SLOWLOOP_FREEZE_ENABLE = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_SLOWLOOP_FREEZE_ENABLE, + ADRV903X_FEATURE_GPIO_AGC_MANUAL_GAIN_LOCK = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_AGC_MANUAL_GAIN_LOCK, + ADRV903X_FEATURE_GPIO_SELECT_S1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_SELECT_S1, + ADRV903X_FEATURE_GPIO_DTX_FORCE_PIN = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_DTX_FORCE_PIN, + ADRV903X_FEATURE_GPIO_TX_ATTEN_UPD_GPIO = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_TX_ATTEN_UPD_GPIO, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_0, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_1, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_2, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_3, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_4, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_5, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_6, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_7, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_8, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_9, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_10, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_11, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_12 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_12, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_13 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_13, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_14 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_14, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_OUTPUT_15 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_15, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_0, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_1, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_2, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_3, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_4, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_5, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_6, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_7, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_8, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_9, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_10, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_11, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_12 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_12, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_13 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_13, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_14 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_14, + ADRV903X_FEATURE_GPIO_ANALOG_MANUAL_MODE_INPUT_15 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_15, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_0, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_1, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_2, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_3, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_4, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_5, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_6, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_7, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_8, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_9, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_10, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_11, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_12 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_12, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_13 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_13, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_14 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_14, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_OUTPUT_15 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_15, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_0, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_1, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_2, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_3, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_4, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_5, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_6, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_7, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_8, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_9, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_10, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_11, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_12 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_12, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_13 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_13, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_14 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_14, + ADRV903X_FEATURE_GPIO_ANALOG_ARM_INPUT_15 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_15, + ADRV903X_FEATURE_GPIO_RX0_EXT_CONTROL_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX0_EXT_CONTROL_0, + ADRV903X_FEATURE_GPIO_RX0_EXT_CONTROL_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX0_EXT_CONTROL_1, + ADRV903X_FEATURE_GPIO_RX1_EXT_CONTROL_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX1_EXT_CONTROL_0, + ADRV903X_FEATURE_GPIO_RX1_EXT_CONTROL_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX1_EXT_CONTROL_1, + ADRV903X_FEATURE_GPIO_RX2_EXT_CONTROL_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX2_EXT_CONTROL_0, + ADRV903X_FEATURE_GPIO_RX2_EXT_CONTROL_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX2_EXT_CONTROL_1, + ADRV903X_FEATURE_GPIO_RX3_EXT_CONTROL_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX3_EXT_CONTROL_0, + ADRV903X_FEATURE_GPIO_RX3_EXT_CONTROL_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX3_EXT_CONTROL_1, + ADRV903X_FEATURE_GPIO_RX4_EXT_CONTROL_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX4_EXT_CONTROL_0, + ADRV903X_FEATURE_GPIO_RX4_EXT_CONTROL_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX4_EXT_CONTROL_1, + ADRV903X_FEATURE_GPIO_RX5_EXT_CONTROL_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX5_EXT_CONTROL_0, + ADRV903X_FEATURE_GPIO_RX5_EXT_CONTROL_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX5_EXT_CONTROL_1, + ADRV903X_FEATURE_GPIO_RX6_EXT_CONTROL_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX6_EXT_CONTROL_0, + ADRV903X_FEATURE_GPIO_RX6_EXT_CONTROL_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX6_EXT_CONTROL_1, + ADRV903X_FEATURE_GPIO_RX7_EXT_CONTROL_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX7_EXT_CONTROL_0, + ADRV903X_FEATURE_GPIO_RX7_EXT_CONTROL_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX7_EXT_CONTROL_1, + ADRV903X_FEATURE_GPIO_RX0_DUALBAND_CONTROL_BAND0_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_0, + ADRV903X_FEATURE_GPIO_RX0_DUALBAND_CONTROL_BAND0_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_1, + ADRV903X_FEATURE_GPIO_RX0_DUALBAND_CONTROL_BAND1_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND1_0, + ADRV903X_FEATURE_GPIO_RX0_DUALBAND_CONTROL_BAND1_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND1_1, + ADRV903X_FEATURE_GPIO_RX1_DUALBAND_CONTROL_BAND0_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND0_0, + ADRV903X_FEATURE_GPIO_RX1_DUALBAND_CONTROL_BAND0_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND0_1, + ADRV903X_FEATURE_GPIO_RX1_DUALBAND_CONTROL_BAND1_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND1_0, + ADRV903X_FEATURE_GPIO_RX1_DUALBAND_CONTROL_BAND1_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND1_1, + ADRV903X_FEATURE_GPIO_RX4_DUALBAND_CONTROL_BAND0_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND0_0, + ADRV903X_FEATURE_GPIO_RX4_DUALBAND_CONTROL_BAND0_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND0_1, + ADRV903X_FEATURE_GPIO_RX4_DUALBAND_CONTROL_BAND1_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND1_0, + ADRV903X_FEATURE_GPIO_RX4_DUALBAND_CONTROL_BAND1_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND1_1, + ADRV903X_FEATURE_GPIO_RX5_DUALBAND_CONTROL_BAND0_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND0_0, + ADRV903X_FEATURE_GPIO_RX5_DUALBAND_CONTROL_BAND0_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND0_1, + ADRV903X_FEATURE_GPIO_RX5_DUALBAND_CONTROL_BAND1_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND1_0, + ADRV903X_FEATURE_GPIO_RX5_DUALBAND_CONTROL_BAND1_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND1_1, + ADRV903X_FEATURE_GPIO_RX2_DUALBAND_CONTROL_BAND0_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND0_0, + ADRV903X_FEATURE_GPIO_RX2_DUALBAND_CONTROL_BAND0_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND0_1, + ADRV903X_FEATURE_GPIO_RX2_DUALBAND_CONTROL_BAND1_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND1_0, + ADRV903X_FEATURE_GPIO_RX2_DUALBAND_CONTROL_BAND1_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND1_1, + ADRV903X_FEATURE_GPIO_RX3_DUALBAND_CONTROL_BAND0_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND0_0, + ADRV903X_FEATURE_GPIO_RX3_DUALBAND_CONTROL_BAND0_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND0_1, + ADRV903X_FEATURE_GPIO_RX3_DUALBAND_CONTROL_BAND1_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND1_0, + ADRV903X_FEATURE_GPIO_RX3_DUALBAND_CONTROL_BAND1_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND1_1, + ADRV903X_FEATURE_GPIO_RX6_DUALBAND_CONTROL_BAND0_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND0_0, + ADRV903X_FEATURE_GPIO_RX6_DUALBAND_CONTROL_BAND0_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND0_1, + ADRV903X_FEATURE_GPIO_RX6_DUALBAND_CONTROL_BAND1_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND1_0, + ADRV903X_FEATURE_GPIO_RX6_DUALBAND_CONTROL_BAND1_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND1_1, + ADRV903X_FEATURE_GPIO_RX7_DUALBAND_CONTROL_BAND0_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND0_0, + ADRV903X_FEATURE_GPIO_RX7_DUALBAND_CONTROL_BAND0_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND0_1, + ADRV903X_FEATURE_GPIO_RX7_DUALBAND_CONTROL_BAND1_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND1_0, + ADRV903X_FEATURE_GPIO_RX7_DUALBAND_CONTROL_BAND1_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND1_1, + ADRV903X_FEATURE_GPIO_NOOP_0 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_0, + ADRV903X_FEATURE_GPIO_NOOP_1 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_1, + ADRV903X_FEATURE_GPIO_NOOP_2 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_2, + ADRV903X_FEATURE_GPIO_NOOP_3 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_3, + ADRV903X_FEATURE_GPIO_NOOP_4 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_4, + ADRV903X_FEATURE_GPIO_NOOP_5 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_5, + ADRV903X_FEATURE_GPIO_NOOP_6 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_6, + ADRV903X_FEATURE_GPIO_NOOP_7 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_7, + ADRV903X_FEATURE_GPIO_NOOP_8 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_8, + ADRV903X_FEATURE_GPIO_NOOP_9 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_9, + ADRV903X_FEATURE_GPIO_NOOP_10 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_10, + ADRV903X_FEATURE_GPIO_NOOP_11 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_11, + ADRV903X_FEATURE_GPIO_NOOP_12 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_12, + ADRV903X_FEATURE_GPIO_NOOP_13 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_13, + ADRV903X_FEATURE_GPIO_NOOP_14 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_14, + ADRV903X_FEATURE_GPIO_NOOP_15 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_15, + ADRV903X_FEATURE_GPIO_NOOP_16 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_16, + ADRV903X_FEATURE_GPIO_NOOP_17 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_17, + ADRV903X_FEATURE_GPIO_NOOP_18 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_18, + ADRV903X_FEATURE_GPIO_NOOP_19 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_19, + ADRV903X_FEATURE_GPIO_NOOP_20 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_20, + ADRV903X_FEATURE_GPIO_NOOP_21 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_21, + ADRV903X_FEATURE_GPIO_NOOP_22 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_22, + ADRV903X_FEATURE_GPIO_NOOP_23 = GPIO_SIGNAL_FEATURE | ADI_ADRV903X_GPIO_SIGNAL_NOOP_23, + /***Please add Feature IDs which use shared resources above this line***/ + ADRV903X_NUM_FEATURES, + ADRV903X_FEATURE_INVALID +} adrv903x_FeatureID_e; + +typedef struct adrv903x_SharedResourceLut +{ + adrv903x_SharedResourceType_e sharedResourceType; /*!< Specifies the type of shared resource for a Look Up Table entry*/ + int32_t sharedResource; /*!< Specifies the shared resource value associated with the type for a Look Up Table entry*/ + adrv903x_SharedResourceID_e sharedResourceId; /*!< Specifies the unique shared resource ID associated with the shared resource for a Look Up Table entry*/ +} adrv903x_SharedResourceLut_t; + +#endif /* ! _adrv903x_SHARED_RESOURCE_MANAGER_TYPES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_stream_id_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_stream_id_types.h new file mode 100644 index 0000000000000..60299d5cd960d --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_stream_id_types.h @@ -0,0 +1,58 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file + * + * \brief Contains ADRV903X stream id definitions + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_STREAM_ID_H__ +#define __ADRV903X_STREAM_ID_H__ + +#define ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_IMMEDIATE_SET_ATTEN_ORX0 (1U) +#define ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_IMMEDIATE_SET_ATTEN_ORX1 (2U) +#define ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_IMMEDIATE_SET_NCO_ORX0 (3U) +#define ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_IMMEDIATE_SET_NCO_ORX1 (4U) +#define ADRV903X_STREAM_ID__CORE__POWERUP (128U) +#define ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_API_TRIGGER (129U) +#define ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_ORX_ATT_TABLE_UPDATE (140U) +#define ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_ORX_NCO_FREQ_TABLE_UPDATE (141U) +#define ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_ONLY_LOL_NCO_FREQ_TABLE_UPDATE (143U) +#define ADRV903X_STREAM_ID__CORE__TRIGGER_TX_STREAM (176U) +#define ADRV903X_STREAM_ID__CORE__TRIGGER_RX_STREAM (177U) +#define ADRV903X_STREAM_ID__TX__DTX_POWER_UP (5U) +#define ADRV903X_STREAM_ID__TX__TX_LOOPBACK1_ENABLE_REQUEST (17U) +#define ADRV903X_STREAM_ID__TX__TX_LOOPBACK1_DISABLE_REQUEST (18U) +#define ADRV903X_STREAM_ID__TX__TX_LOOPBACK2_ENABLE_REQUEST (19U) +#define ADRV903X_STREAM_ID__TX__TX_LOOPBACK2_DISABLE_REQUEST (20U) +#define ADRV903X_STREAM_ID__TX__TXLB_ADC_RAMP_ENABLE (29U) +#define ADRV903X_STREAM_ID__TX__TXLB_ADC_RAMP_DISABLE (30U) +#define ADRV903X_STREAM_ID__TX__WRITE_DTX_MODE_CONFIG (33U) +#define ADRV903X_STREAM_ID__TX__TX_SET_INIT_CAL_RUNNING_BIT (38U) +#define ADRV903X_STREAM_ID__TX__TX_CLR_INIT_CAL_RUNNING_BIT (39U) +#define ADRV903X_STREAM_ID__TX__PA_PROT_CLEAR_ACTIVE_FLAG (41U) +#define ADRV903X_STREAM_ID__TX__WRITE_DTX_MODE_CONFIG_CLRSTATUS (42U) +#define ADRV903X_STREAM_ID__TX__PA_PROT_ACTIVATE (43U) +#define ADRV903X_STREAM_ID__TX__PA_PROT_CHECK_IF_ACTIVE (44U) +#define ADRV903X_STREAM_ID__RX__RX_CUSTOM_RISE (21U) +#define ADRV903X_STREAM_ID__RX__RX_CUSTOM_FALL (22U) +#define ADRV903X_STREAM_ID__ORX__ORX_ADC_RAMP_ENABLE (8U) +#define ADRV903X_STREAM_ID__ORX__ORX_ADC_RAMP_DISABLE (9U) +#define ADRV903X_STREAM_ID__ORX__ORX_ADC_STBY (12U) +#define ADRV903X_STREAM_ID__ORX__ORX_ADC_STBY_EN (13U) +#define ADRV903X_STREAM_ID__ORX__ORX_ADC_STBY_DIS (14U) +#define ADRV903X_STREAM_ID__ORX__ORX_ADC_NOT_STBY (15U) +/* !!! This dummy stream must be the last stream!!! */ +#define ADRV903X_STREAM_ID__ORX__ORX_DUMMY (16U) + +#define ADRV903X_STREAM_ID__ORX__ORX_CUSTOM_RISE (21U) +#define ADRV903X_STREAM_ID__ORX__ORX_CUSTOM_FALL (22U) +#endif /* __ADRV903X_STREAMID_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_stream_proc_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_stream_proc_types.h new file mode 100644 index 0000000000000..bf49582ee7041 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_stream_proc_types.h @@ -0,0 +1,80 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adrv903x_stream_proc_types.h + * + * \brief Contains ADRV903X stream process macros and enums. + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_STREAM_PROC_TYPES_H__ +#define __ADRV903X_STREAM_PROC_TYPES_H__ + + + +#include "adrv903x_stream_id_types.h" + + +#define ADRV903X_STREAM_NUM_RX_SLICE (8) +#define ADRV903X_STREAM_NUM_TX_SLICE (8) +#define ADRV903X_STREAM_NUM_ORX_SLICE (2) +#define ADRV903X_STREAM_NUM_MAIN_SLICE (1) + +typedef enum +{ + ADRV903X_STREAM_ORX_ADC_DAC_ENABLE_RAMP = ADRV903X_STREAM_ID__ORX__ORX_ADC_RAMP_ENABLE, /*!< Custom stream: Enable ORx DAC ramp */ + ADRV903X_STREAM_ORX_ADC_DAC_DISABLE_RAMP = ADRV903X_STREAM_ID__ORX__ORX_ADC_RAMP_DISABLE, /*!< Custom stream: Disable ORx DAC ramp */ + ADRV903X_STREAM_ORX_CUSTOM_RISE = ADRV903X_STREAM_ID__ORX__ORX_CUSTOM_RISE, /*!< Not defined yet */ + ADRV903X_STREAM_ORX_CUSTOM_FALL = ADRV903X_STREAM_ID__ORX__ORX_CUSTOM_FALL, /*!< Not defined yet */ + ADRV903X_STREAM_ORX_ADC_STBY_EN = ADRV903X_STREAM_ID__ORX__ORX_ADC_STBY_EN, /*!< Custom stream: Put ORx ADC into Standby */ + ADRV903X_STREAM_ORX_ADC_STBY_DIS = ADRV903X_STREAM_ID__ORX__ORX_ADC_STBY_DIS, /*!< Custom stream: Take ORx ADC out of Standby */ +} adrv903x_StreamOrxCustomStreams_e; + +typedef enum +{ + ADRV903X_STREAM_RX_CUSTOM_RISE = ADRV903X_STREAM_ID__RX__RX_CUSTOM_RISE, /*!< Not defined yet */ + ADRV903X_STREAM_RX_CUSTOM_FALL = ADRV903X_STREAM_ID__RX__RX_CUSTOM_FALL, /*!< Not defined yet */ +} adrv903x_StreamRxCustomStreams_e; + +typedef enum +{ + ADRV903X_STREAM_TX_VGA_OUT_ENABLE_TO_LB = ADRV903X_STREAM_ID__TX__TX_LOOPBACK1_ENABLE_REQUEST, /*!< Custom stream: Enable Tx VGA output to loopback path */ + ADRV903X_STREAM_TX_VGA_OUT_DISABLE_TO_LB = ADRV903X_STREAM_ID__TX__TX_LOOPBACK1_DISABLE_REQUEST, /*!< Custom stream: Disable Tx VGA output to loopback path */ + ADRV903X_STREAM_TX_VGA_IN_ENABLE_TO_LB = ADRV903X_STREAM_ID__TX__TX_LOOPBACK2_ENABLE_REQUEST, /*!< Custom stream: Enable Tx VGA input to loopback path */ + ADRV903X_STREAM_TX_VGA_IN_DISABLE_TO_LB = ADRV903X_STREAM_ID__TX__TX_LOOPBACK2_DISABLE_REQUEST, /*!< Custom stream: Disable Tx VGA input to loopback path */ + ADRV903X_STREAM_TX_ADC_DAC_ENABLE_RAMP = ADRV903X_STREAM_ID__TX__TXLB_ADC_RAMP_ENABLE, /*!< Custom stream: Enable TxLB ADC DAC ramp */ + ADRV903X_STREAM_TX_ADC_DAC_DISABLE_RAMP = ADRV903X_STREAM_ID__TX__TXLB_ADC_RAMP_DISABLE, /*!< Custom stream: Disable TxLB ADC DAC ramp */ + ADRV903X_STREAM_TX_WRITE_DTX_MODE_CONFIG = ADRV903X_STREAM_ID__TX__WRITE_DTX_MODE_CONFIG, /*!< Custom stream: Write DTX Mode Config */ + ADRV903X_STREAM_TX_WRITE_DTX_MODE_CONFIG_CLRSTATUS = ADRV903X_STREAM_ID__TX__WRITE_DTX_MODE_CONFIG_CLRSTATUS, /*!< Custom stream: Write DTX Mode Config And Set Clear-Status bits */ + ADRV903X_STREAM_TX_DTX_POWER_UP = ADRV903X_STREAM_ID__TX__DTX_POWER_UP, /*!< Custom stream: Exit from DTX mode */ + ADRV903X_STREAM_TX_SET_INIT_CAL_RUNNING_BIT = ADRV903X_STREAM_ID__TX__TX_SET_INIT_CAL_RUNNING_BIT, /*!< Custom stream: Set Init Cal Running Bit */ + ADRV903X_STREAM_TX_CLR_INIT_CAL_RUNNING_BIT = ADRV903X_STREAM_ID__TX__TX_CLR_INIT_CAL_RUNNING_BIT, /*!< Custom stream: Clear Init Cal Running Bit */ + ADRV903X_STREAM_TX_PA_PROT_CLEAR_ACTIVE_FLAG = ADRV903X_STREAM_ID__TX__PA_PROT_CLEAR_ACTIVE_FLAG, /*!< Custom stream: PAP Active Bit clear */ + ADRV903X_STREAM_TX_PA_PROT_CHECK_IF_ACTIVE = ADRV903X_STREAM_ID__TX__PA_PROT_CHECK_IF_ACTIVE, /*!< Custom stream: PAP Active Bit check */ + ADRV903X_STREAM_TX_PA_PROT_ACTIVATE = ADRV903X_STREAM_ID__TX__PA_PROT_ACTIVATE, /*!< Custom stream: PAP Activate Handling*/ +} adrv903x_StreamTxCustomStreams_e; + +typedef enum +{ + ADRV903X_STREAM_MAIN_POWER_UP = ADRV903X_STREAM_ID__CORE__POWERUP, /*!< Power up stream in main stream */ + ADRV903X_STREAM_MAIN_TX_TO_ORX_MAP = ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_API_TRIGGER, /*!< Stream triggered by adi_adrv903x_TxToOrxMappingSet */ + ADRV903X_STREAM_MAIN_SET_ORX0_ATT = ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_IMMEDIATE_SET_ATTEN_ORX0, /*!< Custom stream: Set ORx attenuation for ORx0 */ + ADRV903X_STREAM_MAIN_SET_ORX1_ATT = ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_IMMEDIATE_SET_ATTEN_ORX1, /*!< Custom stream: Set ORx attenuation for ORx1 */ + ADRV903X_STREAM_MAIN_SET_ORX0_NCO_FREQ = ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_IMMEDIATE_SET_NCO_ORX0, /*!< Custom stream: Set ORx ADC/DP NCO frequency for ORx0 */ + ADRV903X_STREAM_MAIN_SET_ORX1_NCO_FREQ = ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_IMMEDIATE_SET_NCO_ORX1, /*!< Custom stream: Set ORx ADC/DP NCO frequency for ORx1 */ + ADRV903X_STREAM_MAIN_ORX_ATT_TABLE_UPDATE = ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_ORX_ATT_TABLE_UPDATE, /*!< Custom stream: Update ORx attenuation table */ + ADRV903X_STREAM_MAIN_ORX_NCO_FREQ_TABLE_UPDATE = ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_ORX_NCO_FREQ_TABLE_UPDATE, /*!< Custom stream: Update ORx ADC/DP and LOL NCO frequency tables */ + ADRV903X_STREAM_MAIN_ONLY_LOL_NCO_FREQ_TABLE_UPDATE = ADRV903X_STREAM_ID__CORE__TX_TO_ORX_MAPPING_ONLY_LOL_NCO_FREQ_TABLE_UPDATE, /*!< Custom stream: Update only LOL NCO frequency tables */ + ADRV903X_STREAM_MAIN_TRIGGER_TX_STREAM = ADRV903X_STREAM_ID__CORE__TRIGGER_TX_STREAM, /*!< Core stream used to trigger TX streams (see ADRV903X_TRIGGER_SLICE_STREAM_[NUM|MASK]) */ + ADRV903X_STREAM_MAIN_TRIGGER_RX_STREAM = ADRV903X_STREAM_ID__CORE__TRIGGER_RX_STREAM, /*!< Core stream used to trigger RX streams (see ADRV903X_TRIGGER_SLICE_STREAM_[NUM|MASK]) */ + +} adrv903x_StreamMainCustomStreams_e; + +#endif /* __ADRV903X_STREAM_PROC_TYPES_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_struct_endian.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_struct_endian.h new file mode 100644 index 0000000000000..e2c3c2c3fb2c0 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_struct_endian.h @@ -0,0 +1,25 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +#ifndef _ADRV903X_STRUCT_ENDIAN_H_ +#define _ADRV903X_STRUCT_ENDIAN_H_ + +#include "adrv903x_platform_byte_order.h" +#include "adrv903x_cpu_cmd_run_serdes_eye_sweep.h" + +#if ADRV903X_LITTLE_ENDIAN == 1 +#define CTOH_STRUCT(struct_name, struct_type) +#else +#define CTOH_STRUCT(struct_name, struct_type) struct_type##_swap(&(struct_name)) +#endif + +#define HTOC_STRUCT CTOH_STRUCT + +void adrv903x_SerdesInitCalStatusCmdResp_swap(struct adrv903x_SerdesInitCalStatusCmdResp* _struct); +void adrv903x_SerdesTrackingCalStatusCmdResp_swap(struct adrv903x_SerdesTrackingCalStatusCmdResp* _struct); +void adrv903x_SerdesTrackingCalStatus_swap(struct adi_adrv903x_SerdesTrackingCalStatus* _struct); +void adrv903x_SerdesInitCalStatus_swap(struct adi_adrv903x_SerdesInitCalStatus* _struct); +void adrv903x_CpuCmd_SerdesCalStatusGet_swap(struct adrv903x_CpuCmd_SerdesCalStatusGet* _struct); +#endif \ No newline at end of file diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_tx.h b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_tx.h new file mode 100644 index 0000000000000..ff567b6152fd4 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/include/adrv903x_tx.h @@ -0,0 +1,179 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_tx.h + * \brief Contains ADRV903X Tx related private function prototypes for + * adrv903x_tx.c which helps adi_adrv903x_tx.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADRV903X_TX_H_ +#define _ADRV903X_TX_H_ + +#include "../../private/bf/adrv903x_bf_tx_dig_types.h" +#include "../../private/bf/adrv903x_bf_tx_funcs_types.h" +#include "../../private/bf/adrv903x_bf_tx_datapath.h" +#include "../../private/bf/adrv903x_bf_tx_datapath_types.h" + +#include "adi_adrv903x_tx_types.h" +#include "adi_adrv903x_error.h" + +/** +* \brief Returns the address for a given tx channel's attenuation table. +* +* \param[in] txChannel The channel for which tx atten table address is requested. +* +* \retval uint32_t The address of the attenuation table or 0 if txChannel is ADI_ADRV903X_TXOFF or +* ADI_ADRV903X_TXNONE. +*/ +ADI_API uint32_t adrv903x_txAttenAddrLookup(const adi_adrv903x_TxChannels_e txChannel); + +/** +* \brief Returns 0-indexed channel id for a given adi_adrv903x_TxChannels_e. +* +* \param[in] txChannel The value to convert. +* +* \retval uint8_t The channel id. Returns a value greater ADI_ADRV903X_CHAN_ID_MAX if the value supplied cannot be +* converted (i.e. is not valid value for the enum or refers to TX_ALL or TX_NONE). +*/ +ADI_API uint8_t adrv903x_TxChannelsToId(const adi_adrv903x_TxChannels_e txChannel); + +/* TODO: remove when adrv903x_Dig_TxEnableBySpi_BfSet and adrv903x_BfTxChanAddr_e are available */ +typedef adrv903x_BfTxDigChanAddr_e adrv903x_BfTxChanAddr_e; +#define ADRV903X_BF_TX_CH0 ADRV903X_BF_SLICE_TX_0__TX_DIG +#define ADRV903X_BF_TX_CH1 ADRV903X_BF_SLICE_TX_1__TX_DIG +#define ADRV903X_BF_TX_CH2 ADRV903X_BF_SLICE_TX_2__TX_DIG +#define ADRV903X_BF_TX_CH3 ADRV903X_BF_SLICE_TX_3__TX_DIG +#define ADRV903X_BF_TX_CH4 ADRV903X_BF_SLICE_TX_4__TX_DIG +#define ADRV903X_BF_TX_CH5 ADRV903X_BF_SLICE_TX_5__TX_DIG +#define ADRV903X_BF_TX_CH6 ADRV903X_BF_SLICE_TX_6__TX_DIG +#define ADRV903X_BF_TX_CH7 ADRV903X_BF_SLICE_TX_7__TX_DIG + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adrv903x_BfTxChanAddr_e* const txChannelBitfieldAddr); + +/** +* \brief Look up the Tx function bitfield address given a Tx Channel +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] txChannel Channel selection to read back gain index for (Valid Tx0-Tx7 only) +* \param[out] txFuncsChannelBitfieldAddr Tx function channel bitfield address which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncsBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adrv903x_BfTxFuncsChanAddr_e* const txFuncsChannelBitfieldAddr); + +/** +* \brief Look up the Tx Datapath bitfield address given a Tx Channel +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] txChannel Channel selection to read back gain index for (Valid Tx0-Tx7 only) +* \param[out] txDatapathChannelBitfieldAddr Tx datapath channel bitfield address which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDatapathBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adrv903x_BfTxDatapathChanAddr_e* const txDatapathChannelBitfieldAddr); + + +/** +* \brief Look up the Tx function bitfield address given a Tx Channel +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] txChannel Channel selection to read back gain index for (Valid Tx0-Tx7 only) +* \param[out] txdIGChannelBitfieldAddr Tx function channel bitfield address which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDigBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adrv903x_BfTxDigChanAddr_e* const txDigChannelBitfieldAddr); + +/** +* \brief Range check a given TxPowerMonitor configuration +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] txPowerMonitorCfg Pointer to power monitor configuration to be range checked +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxPowerMonitorCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_PowerMonitorCfg_t * const txPowerMonitorCfg); + +/** +* \brief Range check a given Srd configuration +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X data structure +* \param[in] txSlewRateDetectorCfg Pointer to srd configuration to be range checked +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxSlewRateDetectorCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_SlewRateDetectorCfg_t * const txSlewRateDetectorCfg); + +/** +* \brief This function reads back the LO Source Mapping to the requested Tx channel. +* +* The LO source select for a given channel is configured during init time. This function +* can be used to read back the configuration during run time. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Pointer to the ADRV903X device data structure +* \param[in] txChannel Enum to select Tx Channel. +* \param[out] txLoSource Pointer to store Tx channel LO source mapping read back (Output) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxLoSourceGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_LoSel_e* const txLoSource); + + +/** +* \brief Performs range check on Dec power configuration. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] decPowerCfg Decimated power block configured to be range checked + +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDecPowerCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxDecimatedPowerCfg_t* const decPowerCfg); + +#endif /* _ADRV903X_TX_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_agc.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_agc.c new file mode 100644 index 0000000000000..abae16dd4b475 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_agc.c @@ -0,0 +1,689 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_agc.c + * \brief Contains ADRV903X AGC related private function implementations + * + * ADRV903X API Version: 2.12.1.4 + */ + +#include "../../private/include/adrv903x_agc.h" +#include "../../private/include/adrv903x_rx.h" + + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_AGC + +ADI_API adi_adrv903x_ErrAction_e adrv903x_AgcGainRangeCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_AgcGainRange_t * const agcGainRangeCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint8_t chanIdx = 0U; + uint8_t rxMinIndex = 0U; + uint8_t rxMaxIndex = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check agcGainRangeCfg address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, agcGainRangeCfg); + + if (((agcGainRangeCfg->rxChannelMask & (~(uint32_t)ADI_ADRV903X_RX_MASK_ALL)) != 0U) || (agcGainRangeCfg->rxChannelMask == (uint32_t)ADI_ADRV903X_RXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcGainRangeCfg->rxChannelMask, + "Invalid Rx channel is selected. Valid values are any combinations of Rx0/1/2/3/4/5/6/7"); + return recoveryAction; + } + + if (agcGainRangeCfg->minGainIndex > agcGainRangeCfg->maxGainIndex) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcGainRangeCfg->minGainIndex, + "minGainIndex cannot be larger than maxGainIndex"); + return recoveryAction; + } + + /* AGC config range check */ + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_RX_ONLY; ++chanIdx) + { + if (ADRV903X_BF_EQUAL(agcGainRangeCfg->rxChannelMask, (uint32_t)(1U << chanIdx))) + { + if (chanIdx == 0U) + { + rxMinIndex = device->devStateInfo.gainIndexes.rx0MinGainIndex; + rxMaxIndex = device->devStateInfo.gainIndexes.rx0MaxGainIndex; + } + else if (chanIdx == 1U) + { + rxMinIndex = device->devStateInfo.gainIndexes.rx1MinGainIndex; + rxMaxIndex = device->devStateInfo.gainIndexes.rx1MaxGainIndex; + } + else if (chanIdx == 2U) + { + rxMinIndex = device->devStateInfo.gainIndexes.rx2MinGainIndex; + rxMaxIndex = device->devStateInfo.gainIndexes.rx2MaxGainIndex; + } + else if (chanIdx == 3U) + { + rxMinIndex = device->devStateInfo.gainIndexes.rx3MinGainIndex; + rxMaxIndex = device->devStateInfo.gainIndexes.rx3MaxGainIndex; + } + else if (chanIdx == 4U) + { + rxMinIndex = device->devStateInfo.gainIndexes.rx4MinGainIndex; + rxMaxIndex = device->devStateInfo.gainIndexes.rx4MaxGainIndex; + } + else if (chanIdx == 5U) + { + rxMinIndex = device->devStateInfo.gainIndexes.rx5MinGainIndex; + rxMaxIndex = device->devStateInfo.gainIndexes.rx5MaxGainIndex; + } + else if (chanIdx == 6U) + { + rxMinIndex = device->devStateInfo.gainIndexes.rx6MinGainIndex; + rxMaxIndex = device->devStateInfo.gainIndexes.rx6MaxGainIndex; + } + else + { + rxMinIndex = device->devStateInfo.gainIndexes.rx7MinGainIndex; + rxMaxIndex = device->devStateInfo.gainIndexes.rx7MaxGainIndex; + } + + if (agcGainRangeCfg->maxGainIndex > rxMaxIndex) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcGainRangeCfg->maxGainIndex, + "agcGainRangeCfg->maxGainIndex cannot be larger than Rx max index of device"); + return recoveryAction; + } + + if (agcGainRangeCfg->minGainIndex < rxMinIndex) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcGainRangeCfg->minGainIndex, + "agcGainRangeCfg->minGainIndex cannot be smaller than Rx min index of device"); + return recoveryAction; + } + } + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_AgcCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_AgcCfg_t * const agcCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Valid ranges for the AGC configuration values */ + static const uint8_t MAX_GAIN_STEP_SIZE = 31U; + static const uint8_t MAX_ADCOVLD_LOW_THRESHOLD = 8U; + static const uint16_t MAX_THRESHOLD_VAL = 16383U; + static const uint8_t HB2_FIRST_STAGE_DURATION_MAX = 63U; + static const uint8_t HB2_FIRST_STAGE_THRESHOLD_MAX = 7U; + static const uint8_t FAST_RECOVERY_MAX_INTERVAL = 63U; + static const uint8_t POWER_TRIGGER_MAX_THRESHOLD = 127U; + static const uint8_t POWER_TRIGGER_UNDERRANGE_LOW_POWER_MAX_THRESHOLD = 31U; + static const uint8_t POWER_TRIGGER_OVERRANGE_HIGH_POWER_MAX_THRESHOLD = 15U; + static const uint8_t DEC_POWER_INPUT_SELECT_MAX = 3U; + static const uint8_t DEC_POWER_MEAS_DURATION_MAX = 31U; + static const uint32_t GAIN_UPDATE_COUNTER_MAX = 4194303U; + static const uint8_t IMMEDIATE_GAIN_CHANGE_MAX_VAL = 3U; + static const uint8_t MAX_ATTACK_DELAY = 63U; + static const uint8_t MAX_ADC_RESET_GAIN_STEP = 31U; + static const uint8_t MAX_PEAK_WAIT_TIME = 3U; + adi_adrv903x_AgcGainRange_t agcGainRange; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check agcCfg address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, agcCfg); + + ADI_LIBRARY_MEMSET(&agcGainRange, 0, sizeof(adi_adrv903x_AgcGainRange_t)); + + /*Check that if requested Rx Channel valid*/ + if(((agcCfg->rxChannelMask & (~(uint32_t)ADI_ADRV903X_RX_MASK_ALL)) != 0U) || (agcCfg->rxChannelMask == (uint32_t)ADI_ADRV903X_RXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->rxChannelMask, + "Invalid Rx channel is selected. Valid values are any combinations of Rx0/1/2/3/4/5/6/7"); + return recoveryAction; + } + + /* Peak detector config range check */ + if (agcCfg->agcPeak.adcOvldGainStepAttack > MAX_GAIN_STEP_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.adcOvldGainStepAttack, + "agcCfg->agcPeak.adcOvldGainStepAttack is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.adcOvldLowThresh > MAX_ADCOVLD_LOW_THRESHOLD) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.adcOvldLowThresh, + "agcCfg->agcPeak.adcOvldLowThresh is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.adcOvldGainStepRecovery > MAX_GAIN_STEP_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.adcOvldGainStepRecovery, + "agcCfg->agcPeak.adcOvldGainStepRecovery is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2OverloadDurationCnt > HB2_FIRST_STAGE_DURATION_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2OverloadDurationCnt, + "agcCfg->agcPeak.hb2OverloadDurationCnt is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2OverloadThreshCnt > HB2_FIRST_STAGE_THRESHOLD_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2OverloadThreshCnt, + "agcCfg->agcPeak.hb2OverloadThreshCnt is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2HighThresh > MAX_THRESHOLD_VAL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2HighThresh, + "agcCfg->agcPeak.hb2HighThresh is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2GainStepAttack > MAX_GAIN_STEP_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2GainStepAttack, + "agcCfg->agcPeak.hb2GainStepAttack is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2UnderRangeHighThresh > MAX_THRESHOLD_VAL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2UnderRangeHighThresh, + "agcCfg->agcPeak.hb2UnderRangeHighThresh is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2GainStepHighRecovery > MAX_GAIN_STEP_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2GainStepHighRecovery, + "agcCfg->agcPeak.hb2GainStepHighRecovery is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2UnderRangeMidThresh > MAX_THRESHOLD_VAL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2UnderRangeMidThresh, + "agcCfg->agcPeak.hb2UnderRangeMidThresh is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2GainStepMidRecovery > MAX_GAIN_STEP_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2GainStepMidRecovery, + "agcCfg->agcPeak.hb2GainStepMidRecovery is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2UnderRangeLowThresh > MAX_THRESHOLD_VAL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2UnderRangeLowThresh, + "agcCfg->agcPeak.hb2UnderRangeLowThesh is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2GainStepLowRecovery > MAX_GAIN_STEP_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2GainStepLowRecovery, + "agcCfg->agcPeak.hb2GainStepLowRecovery is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2UnderRangeMidInterval > FAST_RECOVERY_MAX_INTERVAL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2UnderRangeMidInterval, + "agcCfg->agcPeak.hb2UnderRangeMidInterval is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2UnderRangeHighInterval > FAST_RECOVERY_MAX_INTERVAL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2UnderRangeHighInterval, + "agcCfg->agcPeak.hb2UnderRangeHighInterval is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.enableHb2Overload > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.enableHb2Overload, + "agcCfg->agcPeak.enableHb2Overload is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2OverloadPowerMode > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2OverloadPowerMode, + "agcCfg->agcPeak.hb2OverloadPowerMode is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.hb2OverloadSignalSelection > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.hb2OverloadSignalSelection, + "agcCfg->agcPeak.hb2OverloadSignalSelection is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeak.adcOvldUpperThreshPeakExceededCnt < 2U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.adcOvldUpperThreshPeakExceededCnt, + "ADC Overload Upper Threshold Peak Exceeded Count Between 2 and 255"); + return recoveryAction; + } + + if (agcCfg->agcPeak.adcOvldLowerThreshPeakExceededCnt < 2U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeak.adcOvldLowerThreshPeakExceededCnt, + "ADC Overload Lower Threshold Peak Exceeded Count Between 2 and 255"); + return recoveryAction; + } + + /* Power measurement detector config range check */ + if (agcCfg->agcPower.underRangeHighPowerThresh > POWER_TRIGGER_MAX_THRESHOLD) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPower.underRangeHighPowerThresh, + "agcCfg->agcPower.underRangeHighPowerThresh is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPower.underRangeHighPowerGainStepRecovery > MAX_GAIN_STEP_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPower.underRangeHighPowerGainStepRecovery, + "agcCfg->agcPower.underRangeHighPowerGainStepRecovery is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPower.underRangeLowPowerThresh > POWER_TRIGGER_UNDERRANGE_LOW_POWER_MAX_THRESHOLD) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPower.underRangeLowPowerThresh, + "agcCfg->agcPower.underRangeLowPowerThresh is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPower.underRangeLowPowerGainStepRecovery > MAX_GAIN_STEP_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPower.underRangeLowPowerGainStepRecovery, + "agcCfg->agcPower.underRangeLowPowerGainStepRecovery is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPower.overRangeLowPowerThresh > POWER_TRIGGER_MAX_THRESHOLD) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPower.overRangeLowPowerThresh, + "agcCfg->agcPower.overRangeLowPowerThresh is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPower.overRangeLowPowerGainStepAttack > MAX_GAIN_STEP_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPower.overRangeLowPowerGainStepAttack, + "agcCfg->agcPower.overRangeLowPowerGainStepAttack is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPower.overRangeHighPowerThresh > POWER_TRIGGER_OVERRANGE_HIGH_POWER_MAX_THRESHOLD) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPower.overRangeHighPowerThresh, + "agcCfg->agcPower.overRangeHighPowerThresh is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPower.overRangeHighPowerGainStepAttack > MAX_GAIN_STEP_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPower.overRangeHighPowerGainStepAttack, + "agcCfg->agcPower.overRangeHighPowerGainStepAttack is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPower.powerEnableMeasurement > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPower.powerEnableMeasurement, + "agcCfg->agcPower.powerEnableMeasurement is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPower.powerInputSelect > DEC_POWER_INPUT_SELECT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPower.powerInputSelect, + "agcCfg->agcPower.powerInputSelect is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPower.powerMeasurementDuration > DEC_POWER_MEAS_DURATION_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPower.powerMeasurementDuration, + "agcCfg->agcPower.powerMeasurementDuration is out of range"); + return recoveryAction; + } + + agcGainRange.rxChannelMask = agcCfg->rxChannelMask; + agcGainRange.maxGainIndex = agcCfg->agcRxMaxGainIndex; + agcGainRange.minGainIndex = agcCfg->agcRxMinGainIndex; + + recoveryAction = adrv903x_AgcGainRangeCfgRangeCheck(device, &agcGainRange); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, &agcGainRange, "Invalid Rx AGC Gain range"); + return recoveryAction; + } + + if (agcCfg->agcGainUpdateCounter > GAIN_UPDATE_COUNTER_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcGainUpdateCounter, + "agcCfg->agcGainUpdateCounter is out of range"); + return recoveryAction; + } + + if (agcCfg->agcChangeGainIfThreshHigh > IMMEDIATE_GAIN_CHANGE_MAX_VAL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcChangeGainIfThreshHigh, + "agcCfg->agcChangeGainIfThreshHigh is out of range"); + return recoveryAction; + } + + if (agcCfg->agcEnableFastRecoveryLoop > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcEnableFastRecoveryLoop, + "agcCfg->agcEnableFastRecoveryLoop is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeakThreshGainControlMode > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeakThreshGainControlMode, + "agcCfg->agcPeakThreshGainControlMode is out of range"); + return recoveryAction; + } + + if (agcCfg->agcLowThreshPreventGainInc > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcLowThreshPreventGainInc, + "agcCfg->agcLowThreshPreventGainInc is out of range"); + return recoveryAction; + } + + if (agcCfg->agcResetOnRxon > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcResetOnRxon, + "agcCfg->agcResetOnRxon is out of range"); + return recoveryAction; + } + + if (agcCfg->agcRxAttackDelay > MAX_ATTACK_DELAY) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcRxAttackDelay, + "agcCfg->agcRxAttackDelay is out of range"); + return recoveryAction; + } + + if (agcCfg->agcAdcResetGainStep > MAX_ADC_RESET_GAIN_STEP) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcAdcResetGainStep, + "agcCfg->agcAdcResetGainStep is out of range"); + return recoveryAction; + } + + if (agcCfg->agcPeakWaitTime > MAX_PEAK_WAIT_TIME) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcCfg->agcPeakWaitTime, + "agcCfg->agcPeakWaitTime is out of range"); + return recoveryAction; + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_AgcDualBandCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_AgcDualBandCfg_t * const agcDualBandCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Valid ranges for the AGC configuration values */ + static const uint8_t MAX_POWER_MARGIN = 31U; + static const uint8_t POWER_MEASUREMENT_DURATION = 31U; + static const uint8_t DUALBAND_MAX_GAIN_INDEX = 3U; + adi_adrv903x_AgcGainRange_t agcGainRange; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check agcCfg address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, agcDualBandCfg); + + ADI_LIBRARY_MEMSET(&agcGainRange, 0, sizeof(adi_adrv903x_AgcGainRange_t)); + + /*Check that if requested Rx Channel valid*/ + if (((agcDualBandCfg->rxChannelMask & (~(uint32_t)ADI_ADRV903X_RX_MASK_ALL)) != 0U) || (agcDualBandCfg->rxChannelMask == (uint32_t)ADI_ADRV903X_RXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcDualBandCfg->rxChannelMask, + "Invalid Rx channel is selected. Valid values are any combinations of Rx0/1/2/3/4/5/6/7"); + return recoveryAction; + } + + if (agcDualBandCfg->agcDualBandEnable > ADI_TRUE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcDualBandCfg->agcDualBandEnable, + "agcDualBandCfg->agcDualBandEnable is out of range"); + return recoveryAction; + } + + agcGainRange.rxChannelMask = agcDualBandCfg->rxChannelMask; + agcGainRange.maxGainIndex = agcDualBandCfg->agcRxDualbandExtTableUpperIndex; + agcGainRange.minGainIndex = agcDualBandCfg->agcRxDualbandExtTableLowerIndex; + + recoveryAction = adrv903x_AgcGainRangeCfgRangeCheck(device, &agcGainRange); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, &agcGainRange, "Invalid Rx Dual Band AGC Gain range"); + return recoveryAction; + } + + if (agcDualBandCfg->agcDualbandPwrMargin > MAX_POWER_MARGIN) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcDualBandCfg->agcDualbandPwrMargin, + "agcDualBandCfg->agcDualbandPwrMargin is out of range"); + return recoveryAction; + } + + if (agcDualBandCfg->decPowerDdcMeasurementDuration > POWER_MEASUREMENT_DURATION) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcDualBandCfg->decPowerDdcMeasurementDuration, + "agcDualBandCfg->decPowerDdcMeasurementDuration is out of range"); + return recoveryAction; + } + + if (agcDualBandCfg->agcDualBandMaxGainIndex > DUALBAND_MAX_GAIN_INDEX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcDualBandCfg->agcDualBandMaxGainIndex, + "agcDualBandCfg->agcDualBandMaxGainIndex is out of range"); + return recoveryAction; + } + + if (agcDualBandCfg->enableGainCompensationForExtLna > ADI_TRUE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + agcDualBandCfg->enableGainCompensationForExtLna, + "agcDualBandCfg->enableGainCompensationForExtLna is out of range"); + return recoveryAction; + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; + +} \ No newline at end of file diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_binloader.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_binloader.c new file mode 100644 index 0000000000000..23929aef96d37 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_binloader.c @@ -0,0 +1,427 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_binloader.c + * \brief Contains ADRV903X binary loader related private function implementations. + * + * ADRV903X API Version: 2.12.1.4 + */ +#include "adi_library_types.h" +#include "../../private/include/adrv903x_binloader.h" +#include "../../public/include/adi_adrv903x_types.h" +#include "../../public/include/adi_adrv903x_user.h" +#include "../../private/include/adrv903x_platform_byte_order.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_BINLOADER + +#define SAFE_READ(r, d, f, s, n, file) \ +r = adrv903x_SafeBinFileRead(&f, s, n, file, sizeof(f)); \ +if (r != ADI_ADRV903X_ERR_ACT_NONE) \ +{ \ + ADI_PARAM_ERROR_REPORT(&d->common, r, f, "Unable to extract variable from bin file.");\ + return recoveryAction; \ +} + +#define ADI_MIN(x, y) (((x) < (y)) ? (x) : (y)) + +static void adrv903x_EndiannessCheckAndConvert(void* const buffer, const size_t elementSize, const size_t elementCount); +static adi_adrv903x_ErrAction_e adrv903x_SafeBinFileRead(void* const buffer, const size_t elementSize, const size_t elementCount, FILE* const file, const size_t sizeOfBuffer); +static adi_adrv903x_ErrAction_e adrv903x_LoadVersionFromBin(adi_adrv903x_Device_t* const device, adi_adrv903x_Version_t *const target, FILE* const file); +static adi_adrv903x_ErrAction_e adrv903x_LoadFwVersionFromBin(adi_adrv903x_Device_t* const device, adi_adrv903x_CpuFwVersion_t* const target, FILE* const file); +static adi_adrv903x_ErrAction_e adrv903x_LoadInitStructFromBin(adi_adrv903x_Device_t* const device, adi_adrv903x_Init_t* const target, FILE* const file); +static adi_adrv903x_ErrAction_e adrv903x_LoadPostMcsInitStructFromBin(adi_adrv903x_Device_t* const device, adi_adrv903x_PostMcsInit_t* const target, FILE* const file); + +static void adrv903x_EndiannessCheckAndConvert(void* const buffer, const size_t elementSize, const size_t elementCount) +{ + /* new function entry reporting */ + uint8_t i = 0U; + uint16_t* tmp16; + uint32_t* tmp32; + uint64_t* tmp64; + + if (elementSize == 2U) + { + //biteswap small + tmp16 = (uint16_t* const)buffer; + for (i = 0; i < elementCount; i++) { + tmp16[i] = ADRV903X_HTOCS(tmp16[i]); + } + } + else if (elementSize == 4U) + { + //biteswap large + tmp32 = (uint32_t* const)buffer; + for (i = 0; i < elementCount; i++) { + tmp32[i] = ADRV903X_HTOCL(tmp32[i]); + } + } + else if (elementSize == 8U) + { + //biteswap large large + tmp64 = (uint64_t* const)buffer; + for (i = 0; i < elementCount; i++) { + tmp64[i] = ADRV903X_HTOCLL(tmp64[i]); + } + } +} + +static adi_adrv903x_ErrAction_e adrv903x_SafeBinFileRead(void* const buffer, const size_t elementSize, const size_t elementCount, FILE* const file, const size_t sizeOfBuffer) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + ADI_ADRV903X_NULL_PTR_RETURN(buffer); + ADI_ADRV903X_NULL_PTR_RETURN(file); + + if (sizeOfBuffer > (elementCount * elementSize)) + { + ADI_LIBRARY_MEMSET(buffer, 0, sizeOfBuffer); + } + + if(ADI_LIBRARY_FREAD(buffer, 1, ADI_MIN(elementSize * elementCount, sizeOfBuffer), file) != ADI_MIN(elementSize * elementCount, sizeOfBuffer)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + } + + if (ADRV903X_LITTLE_ENDIAN == 0) + { + adrv903x_EndiannessCheckAndConvert(buffer, elementSize, elementCount); + } + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_LoadVersionFromBin(adi_adrv903x_Device_t* const device, adi_adrv903x_Version_t *const target, FILE* const file) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + /* hash designed to check if data inside the binary is for this type of structure */ + const uint8_t STRUCT_HASH[16] = { 0xD1, 0xE9, 0xDC, 0x16, 0x3B, 0x18, 0x9F, 0xFD, 0x95, 0xB9, 0xE6, 0x24, 0x39, 0x13, 0xF7, 0xCC }; + char buf[16]; + ADI_LIBRARY_MEMSET(&buf, 0, sizeof(buf)); + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_RETURN(target); + ADI_ADRV903X_NULL_PTR_RETURN(file); + + if (ADI_LIBRARY_FREAD(buf, 1, 16, file) != 16) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, file, "Unable to read bin file."); + return recoveryAction; + } + + if (ADI_LIBRARY_MEMCMP(buf, STRUCT_HASH, 16) != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, file, "Incorrect structure format written in bin file."); + return recoveryAction; + } + + SAFE_READ(recoveryAction, device, target->majorVer, 4U, 1U, file); // UInt32 at 16 + SAFE_READ(recoveryAction, device, target->minorVer, 4U, 1U, file); // UInt32 at 20 + SAFE_READ(recoveryAction, device, target->maintenanceVer, 4U, 1U, file); // UInt32 at 24 + SAFE_READ(recoveryAction, device, target->buildVer, 4U, 1U, file); // UInt32 at 28 + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_LoadFwVersionFromBin(adi_adrv903x_Device_t* const device, adi_adrv903x_CpuFwVersion_t* const target, FILE* const file) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + /* hash designed to check if data inside the binary is for this type of structure */ + const uint8_t STRUCT_HASH[16] = { 0x8D, 0xDA, 0x34, 0xE4, 0x46, 0x71, 0x5D, 0xC8, 0xA4, 0x08, 0x00, 0xC0, 0x2D, 0x59, 0x32, 0x2B }; + char buf[16]; + ADI_LIBRARY_MEMSET(&buf, 0, sizeof(buf)); + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_RETURN(target); + ADI_ADRV903X_NULL_PTR_RETURN(file); + + if (ADI_LIBRARY_FREAD(buf, 1, 16, file) != 16) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, file, "Unable to read bin file."); + return recoveryAction; + } + + if (ADI_LIBRARY_MEMCMP(buf, STRUCT_HASH, 16) != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, file, "Incorrect structure format written in bin file."); + return recoveryAction; + } + + SAFE_READ(recoveryAction, device, target->commVer.majorVer, 4U, 1U, file); // UInt32 at 16 + SAFE_READ(recoveryAction, device, target->commVer.minorVer, 4U, 1U, file); // UInt32 at 20 + SAFE_READ(recoveryAction, device, target->commVer.maintenanceVer, 4U, 1U, file); // UInt32 at 24 + SAFE_READ(recoveryAction, device, target->commVer.buildVer, 4U, 1U, file); // UInt32 at 28 + SAFE_READ(recoveryAction, device, target->cpuFwBuildType, 4U, 1U, file); // Int32 at 32 + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_LoadInitStructFromBin(adi_adrv903x_Device_t* const device, adi_adrv903x_Init_t* const target, FILE* const file) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + /* hash designed to check if data inside the binary is for this type of structure */ + + const uint8_t STRUCT_HASH[16] = { 0x46, 0x0C, 0xA4, 0x04, 0xA4, 0x35, 0x6A, 0x03, 0x47, 0xE4, 0xDC, 0x6E, 0x9F, 0x5D, 0x95, 0x9D }; + char buf[16]; + uint8_t i = 0U; + uint8_t j = 0U; + ADI_LIBRARY_MEMSET(&buf, 0, sizeof(buf)); + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_RETURN(target); + ADI_ADRV903X_NULL_PTR_RETURN(file); + + if (ADI_LIBRARY_FREAD(buf, 1, 16, file) != 16) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, file, "Unable to read bin file."); + return recoveryAction; + } + + if (ADI_LIBRARY_MEMCMP(buf, STRUCT_HASH, 16) != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, file, "Incorrect structure format written in bin file."); + return recoveryAction; + } + + SAFE_READ(recoveryAction, device, target->spiOptionsInit.allowSpiStreaming, 1U, 1U, file); // Byte at 16 + SAFE_READ(recoveryAction, device, target->spiOptionsInit.allowAhbAutoIncrement, 1U, 1U, file); // Byte at 17 + SAFE_READ(recoveryAction, device, target->spiOptionsInit.allowAhbSpiFifoMode, 1U, 1U, file); // Byte at 18 + SAFE_READ(recoveryAction, device, target->clocks.DevClkOnChipTermResEn, 1U, 1U, file); // Byte at 19 + SAFE_READ(recoveryAction, device, target->cpuMemDump.filePath, 1U, 256U, file); // Byte[256] at 20-275 + + for (i = 0U; i < 10U; i++) + { + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.formatSelect, 4U, 1U, file); // Int32 at 276 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.floatingPointConfig.fpDataFormat, 4U, 1U, file); // Int32 at 280 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.floatingPointConfig.fpRoundMode, 4U, 1U, file); // Int32 at 284 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.floatingPointConfig.fpNumExpBits, 4U, 1U, file); // Int32 at 288 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.floatingPointConfig.fpAttenSteps, 4U, 1U, file); // Int32 at 292 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.floatingPointConfig.fpHideLeadingOne, 4U, 1U, file); // Int32 at 296 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.floatingPointConfig.fpEncodeNan, 4U, 1U, file); // Int32 at 300 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.integerConfigSettings.intEmbeddedBits, 4U, 1U, file); // Int32 at 304 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.integerConfigSettings.intSampleResolution, 4U, 1U, file); // Int32 at 308 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.integerConfigSettings.intParity, 4U, 1U, file); // Int32 at 312 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.integerConfigSettings.intEmbeddedPos, 4U, 1U, file); // Int32 at 316 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.slicerConfigSettings.extSlicerStepSize, 4U, 1U, file); // Int32 at 320 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.slicerConfigSettings.intSlicerStepSize, 4U, 1U, file); // Int32 at 324 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.slicerConfigSettings.extSlicerGpioSelect, 4U, 1U, file); // Int32 at 328 + + for (j = 0U; j < 4U; j++) + { + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.slicerConfigSettings.intSlicerGpioSelect[j], 4U, 1U, file); // Int32 at 332 + } + + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.embOvldMonitorSettings.embeddedMonitorSrcLsbI, 4U, 1U, file); // Int32 at 348 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.embOvldMonitorSettings.embeddedMonitorSrcLsbQ, 4U, 1U, file); // Int32 at 352 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.embOvldMonitorSettings.embeddedMonitorSrcLsbPlusOneI, 4U, 1U, file); // Int32 at 356 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.embOvldMonitorSettings.embeddedMonitorSrcLsbPlusOneQ, 4U, 1U, file); // Int32 at 360 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.embOvldMonitorSettings.embeddedMonitorHb2LowSrcSel, 4U, 1U, file); // Int32 at 364 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.embOvldMonitorSettings.embeddedMonitorHb2HighSrcSel, 4U, 1U, file); // Int32 at 368 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.embOvldMonitorSettings.embeddedMonitorApdLowSrcSel, 4U, 1U, file); // Int32 at 372 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.embOvldMonitorSettings.embeddedMonitorApdHighSrcSel, 4U, 1U, file); // Int32 at 376 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.embOvldMonitorSettings.invertHb2Flag, 1U, 1U, file); // Byte at 380 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.embOvldMonitorSettings.invertApdFlag, 1U, 1U, file); // Byte at 381 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.externalLnaGain, 1U, 1U, file); // Byte at 382 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxDataFormat.tempCompensationEnable, 1U, 1U, file); // Byte at 383 + SAFE_READ(recoveryAction, device, target->rx.rxChannelCfg[i].rxGainIndexInit, 1U, 1U, file); // Byte at 384 + } + + for (i = 0U; i < 8U; i++) + { + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txAttenCfg.updateCfg.srcCfg.updateSrc, 4U, 1U, file); // Int32 at 1366 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txAttenCfg.updateCfg.srcCfg.s0OrS1Gpio, 4U, 1U, file); // Int32 at 1370 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txAttenCfg.updateCfg.trgCfg.updateTrg, 4U, 1U, file); // Int32 at 1374 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txAttenCfg.updateCfg.trgCfg.triggerGpio, 4U, 1U, file); // Int32 at 1378 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txAttenCfg.txAttenStepSize, 4U, 1U, file); // Int32 at 1382 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txAttenInit_mdB, 2U, 1U, file); // UInt16 at 1386 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txpowerMonitorCfg.inputSel, 4U, 1U, file); // Int32 at 1388 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txpowerMonitorCfg.peakThreshold, 2U, 1U, file); // UInt16 at 1392 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txpowerMonitorCfg.measDuration, 1U, 1U, file); // Byte at 1394 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txpowerMonitorCfg.peakCount, 1U, 1U, file); // Byte at 1395 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txpowerMonitorCfg.peakErrorClearRequired, 1U, 1U, file); // Byte at 1396 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txpowerMonitorCfg.peakPowerEnable, 1U, 1U, file); // Byte at 1397 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txpowerMonitorCfg.peakPowerIrqEnable, 1U, 1U, file); // Byte at 1398 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txpowerMonitorCfg.avgThreshold, 2U, 1U, file); // UInt16 at 1399 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txpowerMonitorCfg.avgErrorClearRequired, 1U, 1U, file); // Byte at 1401 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txpowerMonitorCfg.avgPowerEnable, 1U, 1U, file); // Byte at 1402 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txpowerMonitorCfg.avgPowerIrqEnable, 1U, 1U, file); // Byte at 1403 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].txpowerMonitorCfg.avgPeakRatioEnable, 1U, 1U, file); // Byte at 1404 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].srlCfg.inputSel, 4U, 1U, file); // Int32 at 1405 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].srlCfg.srdOffset, 2U, 1U, file); // UInt16 at 1409 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].srlCfg.srdEnable, 1U, 1U, file); // Byte at 1411 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].srlCfg.srdIrqEnable, 1U, 1U, file); // Byte at 1412 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].srlCfg.autoRecoveryWaitTime, 1U, 1U, file); // Byte at 1413 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].srlCfg.autoRecoveryEnable, 1U, 1U, file); // Byte at 1414 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].srlCfg.autoRecoveryDisableTimerWhenTxOff, 1U, 1U, file); // Byte at 1415 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].srlCfg.srdStatisticsEnable, 1U, 1U, file); // Byte at 1416 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].srlCfg.srdStatisticsMode, 1U, 1U, file); // Byte at 1417 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].protectionRampCfg.rampDownMask, 4U, 1U, file); // UInt32 at 1418 + SAFE_READ(recoveryAction, device, target->tx.txChannelCfg[i].protectionRampCfg.altEventClearReqd, 1U, 1U, file); // Byte at 1422 + } + + for (i = 0U; i < 4U; i++) + { + SAFE_READ(recoveryAction, device, target->uart[i].enable, 1U, 1U, file); // Byte at 1822 + SAFE_READ(recoveryAction, device, target->uart[i].pinSelect, 4U, 1U, file); // Int32 at 1823 + } + + SAFE_READ(recoveryAction, device, target->gpIntPreInit.gpInt0Mask.lowerMask, 8U, 1U, file); // UInt64 at 1842 + SAFE_READ(recoveryAction, device, target->gpIntPreInit.gpInt0Mask.upperMask, 8U, 1U, file); // UInt64 at 1850 + SAFE_READ(recoveryAction, device, target->gpIntPreInit.gpInt1Mask.lowerMask, 8U, 1U, file); // UInt64 at 1858 + SAFE_READ(recoveryAction, device, target->gpIntPreInit.gpInt1Mask.upperMask, 8U, 1U, file); // UInt64 at 1866 + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_LoadPostMcsInitStructFromBin(adi_adrv903x_Device_t* const device, adi_adrv903x_PostMcsInit_t* const target, FILE* const file) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + /* hash designed to check if data inside the binary is for this type of structure */ + const uint8_t STRUCT_HASH[16] = { 0xAC, 0xB7, 0x4F, 0x9A, 0xF2, 0x5E, 0xD2, 0x96, 0xDD, 0xA8, 0xA8, 0x75, 0xAC, 0xDB, 0xA4, 0xF2 }; + char buf[16]; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_RETURN(target); + ADI_ADRV903X_NULL_PTR_RETURN(file); + + if (ADI_LIBRARY_FREAD(buf, 1, 16, file) != 16) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, file, "Unable to read bin file."); + return recoveryAction; + } + + if (ADI_LIBRARY_MEMCMP(buf, STRUCT_HASH, 16) != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, file, "Incorrect structure format written in bin file."); + return recoveryAction; + } + + SAFE_READ(recoveryAction, device, target->radioCtrlCfg.txRadioCtrlModeCfg.txEnableMode, 4U, 1U, file); // Int32 at 16 + SAFE_READ(recoveryAction, device, target->radioCtrlCfg.txRadioCtrlModeCfg.txChannelMask, 4U, 1U, file); // UInt32 at 20 + SAFE_READ(recoveryAction, device, target->radioCtrlCfg.rxRadioCtrlModeCfg.rxEnableMode, 4U, 1U, file); // Int32 at 24 + SAFE_READ(recoveryAction, device, target->radioCtrlCfg.rxRadioCtrlModeCfg.rxChannelMask, 4U, 1U, file); // UInt32 at 28 + SAFE_READ(recoveryAction, device, target->radioCtrlCfg.orxRadioCtrlModeCfg.orxEnableMode, 4U, 1U, file); // Int32 at 32 + SAFE_READ(recoveryAction, device, target->radioCtrlCfg.orxRadioCtrlModeCfg.orxChannelMask, 4U, 1U, file); // UInt32 at 36 + SAFE_READ(recoveryAction, device, target->radioCtrlGpioCfg.txEnMapping, 1U, 8U, file); // Byte[8] at 40-47 + SAFE_READ(recoveryAction, device, target->radioCtrlGpioCfg.txAltMapping, 1U, 8U, file); // Byte[8] at 48-55 + SAFE_READ(recoveryAction, device, target->radioCtrlGpioCfg.rxEnMapping, 1U, 8U, file); // Byte[8] at 56-63 + SAFE_READ(recoveryAction, device, target->radioCtrlGpioCfg.rxAltMapping, 1U, 8U, file); // Byte[8] at 64-71 + SAFE_READ(recoveryAction, device, target->radioCtrlTxRxEnPinSel, 1U, 1U, file); // Byte at 72 + SAFE_READ(recoveryAction, device, target->radioCtrlTxRxEnCfgSel, 1U, 1U, file); // Byte at 73 + SAFE_READ(recoveryAction, device, target->gpIntPostInit.gpInt0Mask.lowerMask, 8U, 1U, file); // UInt64 at 74 + SAFE_READ(recoveryAction, device, target->gpIntPostInit.gpInt0Mask.upperMask, 8U, 1U, file); // UInt64 at 82 + SAFE_READ(recoveryAction, device, target->gpIntPostInit.gpInt1Mask.lowerMask, 8U, 1U, file); // UInt64 at 90 + SAFE_READ(recoveryAction, device, target->gpIntPostInit.gpInt1Mask.upperMask, 8U, 1U, file); // UInt64 at 98 + SAFE_READ(recoveryAction, device, target->initCals.calMask, 8U, 1U, file); // UInt64 at 106 + SAFE_READ(recoveryAction, device, target->initCals.rxChannelMask, 4U, 1U, file); // UInt32 at 114 + SAFE_READ(recoveryAction, device, target->initCals.txChannelMask, 4U, 1U, file); // UInt32 at 118 + SAFE_READ(recoveryAction, device, target->initCals.orxChannelMask, 4U, 1U, file); // UInt32 at 122 + SAFE_READ(recoveryAction, device, target->initCals.warmBoot, 1U, 1U, file); // Byte at 126 + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoadBinFile(adi_adrv903x_Device_t* const device, + FILE* const file, + adi_adrv903x_Version_t* const apiVer, + adi_adrv903x_CpuFwVersion_t* const fwVer, + adi_adrv903x_Version_t* const streamVer, + adi_adrv903x_Init_t* const initStruct, + adi_adrv903x_PostMcsInit_t* const postMcsInitStruct, + const uint32_t fileOffset) +{ + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + uint32_t totalFileSize = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, file); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, apiVer); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, fwVer); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, streamVer); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, initStruct); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, postMcsInitStruct); + + + /* Determine file size */ + if (ADI_LIBRARY_FSEEK(file, 0U, SEEK_END) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, file, "Seek to EOF Failed"); + return recoveryAction; + } + + /* ADI_LIBRARY_FTELL returns long type */ + totalFileSize = (uint32_t) ADI_LIBRARY_FTELL(file); + + /* Check that FW binary file is not empty */ + if (0U == totalFileSize) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, totalFileSize, "Zero Length CPU Profile Binary Detected"); + return recoveryAction; + } + + if (ADI_LIBRARY_FSEEK(file, 0U, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, file, "Could not rewind to start"); + return recoveryAction; + } + + if (ADI_LIBRARY_FSEEK(file, fileOffset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, file, "Could not rewind to file Offset"); + return recoveryAction; + } + + recoveryAction = adrv903x_LoadVersionFromBin(device, apiVer, file); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Unable to read bin file to extract api version"); + return recoveryAction; + } + + recoveryAction = adrv903x_LoadFwVersionFromBin(device, fwVer, file); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Unable to read bin file to extract firmware version"); + return recoveryAction; + } + + recoveryAction = adrv903x_LoadVersionFromBin(device, streamVer, file); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Unable to read bin file to extract stream version"); + return recoveryAction; + } + + recoveryAction = adrv903x_LoadInitStructFromBin(device, initStruct, file); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Unable to read bin file to extract adi_adrv903x_Init_t struct"); + return recoveryAction; + } + + recoveryAction = adrv903x_LoadPostMcsInitStructFromBin(device, postMcsInitStruct, file); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Unable to read bin file to extract adi_adrv903x_PostMcsInit_t struct"); + return recoveryAction; + } + + return recoveryAction; +} diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_cpu.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_cpu.c new file mode 100644 index 0000000000000..9a04aa92673d6 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_cpu.c @@ -0,0 +1,1845 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adrv903x_cpu.c +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#include "../../private/include/adrv903x_cpu.h" +#include "../../private/include/adrv903x_gpio.h" +#include "../../private/include/adrv903x_cpu_error_codes_types.h" +#include "../../private/include/adrv903x_reg_addr_macros.h" +#include "../../private/include/adrv903x_init.h" +#include "../../private/include/adrv903x_cpu_memory.h" +#include "../../private/include/adrv903x_cpu_device_profile_types.h" +#include "../../private/include/adrv903x_cpu_scratch_registers.h" +#include "adi_adrv903x_cpu_cmd_ecc_scrub.h" + +#include "adi_adrv903x_cpu_types.h" +#include "adi_adrv903x_cpu.h" +#include "adi_adrv903x_utilities.h" + + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_CPU + +/*****************************************************************************/ +/***** Helper functions' prototypes ******************************************/ +/*****************************************************************************/ +static adi_adrv903x_ErrAction_e adrv903x_CpuAddrInitialize( adi_adrv903x_CpuAddr_t* const cpuAddr, + const adi_adrv903x_CpuType_e type); + + +/*****************************************************************************/ +/***** Local data types ******************************************************/ +/*****************************************************************************/ + +static adi_adrv903x_ErrAction_e adrv903x_CpuAddrInitialize( adi_adrv903x_CpuAddr_t* const cpuAddr, + const adi_adrv903x_CpuType_e type) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + switch (type) + { + case ADI_ADRV903X_CPU_TYPE_0: + cpuAddr->enabled = ADI_TRUE; + cpuAddr->ctlAddr = ADRV903X_CPU_0_ADDR_CTL_1; + cpuAddr->bootAddr = ADRV903X_CPU_0_ADDR_BOOT_ADDR_BYTE0; + cpuAddr->stackPtrAddr = ADRV903X_CPU_0_ADDR_STACK_PTR_BYTE0; + cpuAddr->memBankCtrlAddr = ADRV903X_CPU_0_ADDR_MEM_BANK_CTRL; + cpuAddr->cmdAddr = ADRV903X_CPU_0_ADDR_COMMAND; + cpuAddr->extCmdAddr = ADRV903X_CPU_0_ADDR_EXT_CMD_BYTE_1; + cpuAddr->cmdStatusAddr = ADRV903X_CPU_0_ADDR_CMD_STATUS_0; + cpuAddr->progStartAddr = ADRV903X_CPU_0_ADDR_PROG_START; + cpuAddr->mailboxGetAddr = ADRV903X_CPU_0_DM_MAILBOX_LINK_0_START_ADDR; + cpuAddr->versionAddr = ADRV903X_ADDR_FW_VERSION; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + case ADI_ADRV903X_CPU_TYPE_1: + cpuAddr->ctlAddr = ADRV903X_CPU_1_ADDR_CTL_1; + cpuAddr->bootAddr = ADRV903X_CPU_1_ADDR_BOOT_ADDR_BYTE0; + cpuAddr->stackPtrAddr = ADRV903X_CPU_1_ADDR_STACK_PTR_BYTE0; + cpuAddr->memBankCtrlAddr = ADRV903X_CPU_1_ADDR_MEM_BANK_CTRL; + cpuAddr->cmdAddr = ADRV903X_CPU_1_ADDR_COMMAND; + cpuAddr->extCmdAddr = ADRV903X_CPU_1_ADDR_EXT_CMD_BYTE_1; + cpuAddr->cmdStatusAddr = ADRV903X_CPU_1_ADDR_CMD_STATUS_0; + cpuAddr->progStartAddr = ADRV903X_CPU_1_ADDR_PROG_START; + cpuAddr->mailboxGetAddr = ADRV903X_CPU_1_DM_MAILBOX_LINK_0_START_ADDR; + cpuAddr->versionAddr = ADRV903X_ADDR_FW_VERSION; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + case ADI_ADRV903X_CPU_TYPE_UNKNOWN: /* Fall Through */ + case ADI_ADRV903X_CPU_TYPE_MAX_RADIO: /* Fall Through */ + case ADI_ADRV903X_CPU_TYPE_MAX: /* Fall Through */ + + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + break; + } + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_CpuMailBoxRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const adrv903x_LinkId_e linkId, + const uint32_t byteCount) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + if ((cpuType >= ADI_ADRV903X_CPU_TYPE_MAX) || + (cpuType <= ADI_ADRV903X_CPU_TYPE_UNKNOWN)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, cpuType, "Invalid CPU Type Passed"); + return recoveryAction; + } + + if ((linkId >= ADRV903X_LINK_ID_MAX) || + (linkId <= ADRV903X_LINK_ID_UNKNOWN)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common,recoveryAction, linkId,"Invalid LinkId Passed"); + return recoveryAction; + } + + if (cpuType == ADI_ADRV903X_CPU_TYPE_0) + { + /* check for valid byteCount */ + if (byteCount > ADRV903X_CPU_0_MAILBOX_LINK_0_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, byteCount, "Invalid Byte Count"); + return recoveryAction; + } + } + + if (cpuType == ADI_ADRV903X_CPU_TYPE_1) + { + /* check for valid byteCount */ + if (byteCount > ADRV903X_CPU_1_MAILBOX_LINK_0_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, byteCount, "Invalid Byte Count"); + return recoveryAction; + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuForceException(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_CpuAddr_t *cpuAddr = NULL; + uint32_t i = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + if (cpuType == ADI_ADRV903X_CPU_TYPE_0 || + cpuType == ADI_ADRV903X_CPU_TYPE_1) + { + cpuAddr = &(device->devStateInfo.cpu.cpuAddr[cpuType]); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cpuAddr); + + /* Command payload */ + for (i = 1U; i <= 4U; ++i) + { + recoveryAction = adi_adrv903x_Register32Write(device, + NULL, + cpuAddr->cmdAddr + i, + (uint32_t)0xFFU, + (uint32_t)0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Mailbox Command Write Issue"); + return recoveryAction; + } + } + + /* Opcode */ + recoveryAction = adi_adrv903x_Register32Write(device, + NULL, + cpuAddr->cmdAddr, + (uint32_t)ADRV903X_MAILBOX_FORCE_EXCEPTION, + (uint32_t)0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Mailbox Command Write Issue"); + return recoveryAction; + } + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuType, "Invalid CPU Type Passed"); + return recoveryAction; + } + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_CpuMailboxBufferWrite(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const adrv903x_LinkId_e linkId, + const uint8_t data[], + const uint32_t byteCount) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_SpiCache_t spiCache = { {0U}, 0U, 0U, 0U }; + uint32_t cpuAddr = ADRV903X_CPU_0_DM_MAILBOX_LINK_0_START_ADDR; + uint32_t i = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, data); + + if (0U == byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, byteCount, "Invalid Byte Count"); + return recoveryAction; + } + + recoveryAction = adrv903x_CpuMailBoxRangeCheck( device, cpuType, linkId, byteCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Mailbox Range Check Issue"); + return recoveryAction; + } + + /* get the particular processor's address map */ + if (cpuType == ADI_ADRV903X_CPU_TYPE_1) + { + cpuAddr = ADRV903X_CPU_1_DM_MAILBOX_LINK_0_START_ADDR; + + } + + for (i = 0U; i < byteCount; ++i) + { + recoveryAction = adi_adrv903x_Register32Write( device, + &spiCache, + cpuAddr + i, + (uint32_t)data[i], + (uint32_t)0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Mailbox Buffer Write Issue"); + return recoveryAction; + } + } + + recoveryAction = adi_adrv903x_SpiFlush( device, spiCache.data, &spiCache.count); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush Issue After CPU Mailbox Buffer Write"); + return recoveryAction; + } + + return recoveryAction; +} + + +static adi_adrv903x_ErrAction_e adrv903x_CpuMailboxBufferRead(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const adrv903x_LinkId_e linkId, + uint8_t data[], + const uint32_t byteCount) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cpuAddr = ADRV903X_CPU_0_DM_MAILBOX_LINK_0_START_ADDR; + + ADI_PLATFORM_LARGE_ARRAY_ALLOC(uint8_t, readData, ADRV903X_CPU_0_MAILBOX_LINK_0_SIZE); + + uint32_t i = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, data); + + if (0U == byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, byteCount, "Invalid Byte Count"); + return recoveryAction; + } + + recoveryAction = adrv903x_CpuMailBoxRangeCheck(device, cpuType, linkId, byteCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Mailbox Range Check Issue"); + return recoveryAction; + } + + /* get the particular processor's address map */ + if (cpuType == ADI_ADRV903X_CPU_TYPE_1) + { + cpuAddr = ADRV903X_CPU_1_DM_MAILBOX_LINK_0_START_ADDR; + } + + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, cpuAddr, readData, NULL, byteCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Mailbox Buffer Read Issue"); + return recoveryAction; + } + + for (i = 0U; i < byteCount; ++i) + { + data[i] = readData[i]; + } + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_CpuMailboxBusyGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + uint8_t* const mailboxBusy) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, mailboxBusy); + + /* Read cpu_command_busy bit in cpu_command(0x00c3) register*/ + if (cpuType == ADI_ADRV903X_CPU_TYPE_0) + { + recoveryAction = adrv903x_Core_Arm0Spi0CommandBusy_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + mailboxBusy); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register Read (for CPU 0 Command Busy Bit) Issue"); + return recoveryAction; + } + } + else if (cpuType == ADI_ADRV903X_CPU_TYPE_1) + { + recoveryAction = adrv903x_Core_Arm1Spi0CommandBusy_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + mailboxBusy); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register Read (for CPU 1 Command Busy Bit) Issue"); + return recoveryAction; + } + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuType, "Invalid CPU Type Provided"); + return recoveryAction; + } + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_CpuCmdStatusLinkIdGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const adrv903x_LinkId_e linkId, + uint8_t* const cmdStatByte) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t cmdByteIndex = 0U; + uint8_t cmdByte = 0U; + uint8_t cmdByteVerify = 0U; + uint32_t readData = 0U; + adi_adrv903x_CpuAddr_t *cpuAddr = NULL; + static const uint8_t CPU_STATUS_MASK = 0x0FU; + static const uint8_t CPU_STATUS_SHIFT_HI = 4U; + static const uint8_t CPU_PENDING = 0x01U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cmdStatByte); + + recoveryAction = adrv903x_CpuMailBoxRangeCheck( device, cpuType, linkId, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Mailbox Range Check Issue"); + return recoveryAction; + } + + if ((cpuType == ADI_ADRV903X_CPU_TYPE_0) || + (cpuType == ADI_ADRV903X_CPU_TYPE_1)) + { + /* get the particular processor's address map */ + cpuAddr = &(device->devStateInfo.cpu.cpuAddr[cpuType]); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cpuAddr); + + /* calculating command status register offset based on linkId status packing */ + cmdByteIndex = (uint8_t)linkId >> 2U; + + /* reading the command status register for given linkId */ + /* Two reads back to back for verify correct SPI operation */ + recoveryAction = adi_adrv903x_Register32Read(device, NULL, cpuAddr->cmdStatusAddr + cmdByteIndex, &readData, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Command Status Read Issue (1)"); + return recoveryAction; + } + cmdByte = readData & 0xFFU; + recoveryAction = adi_adrv903x_Register32Read(device, NULL, cpuAddr->cmdStatusAddr + cmdByteIndex, &readData, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Command Status Read Issue (2)"); + return recoveryAction; + } + cmdByteVerify = readData & 0xFFU; + } + /* identifying nibble location in command register for given linkId */ + /* Manually set the pending bit if verification fails */ + if ((((uint8_t)linkId >> 1) & (uint8_t)0x01) == (uint8_t)0x01) + { + *cmdStatByte = ((cmdByte == cmdByteVerify) ? ((cmdByte >> CPU_STATUS_SHIFT_HI) & CPU_STATUS_MASK) : ((cmdByte >> CPU_STATUS_SHIFT_HI) & CPU_STATUS_MASK) | CPU_PENDING); + } + else + { + *cmdStatByte = ((cmdByte == cmdByteVerify) ? (cmdByte & CPU_STATUS_MASK) : (cmdByte & CPU_STATUS_MASK) | CPU_PENDING); + } + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_CpuCmdStatusWait(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const adrv903x_LinkId_e linkId, + uint8_t* const cmdStatusByte, + const uint32_t timeout_us, + uint32_t waitInterval_us) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t eventCheck = 0U; + uint32_t numEventChecks = 0U; + static const uint8_t CPU_PENDING = 0x01U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cmdStatusByte); + + recoveryAction = adrv903x_CpuMailBoxRangeCheck(device, cpuType, linkId, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Mailbox Range Check Issue"); + return recoveryAction; + } + + waitInterval_us = (waitInterval_us > timeout_us) ? timeout_us : waitInterval_us; + numEventChecks = (waitInterval_us == 0U) ? 1U : (timeout_us / waitInterval_us); + + /* timeout event check loop */ + for (eventCheck = 0U; eventCheck <= numEventChecks; ++eventCheck) + { + /* read status of linkId */ + recoveryAction = adrv903x_CpuCmdStatusLinkIdGet( device, cpuType, linkId, cmdStatusByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "LinkId Status Check Issue"); + return recoveryAction; + } + + /* if pending bit is set for linkId of interest and the number of events have not expired, perform wait */ + if (((*cmdStatusByte & CPU_PENDING) > 0U) && + (eventCheck < numEventChecks)) + { + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, waitInterval_us) ; + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Request Issue"); + return recoveryAction; + } + } + else + { + break; + } + } + + /* if CPU Command did not complete within the timeout period */ + if ((*cmdStatusByte & CPU_PENDING) > 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_CMD_TIMEOUT, + recoveryAction, + *cmdStatusByte, + "Timed out waiting for command response"); + return recoveryAction; + } + + return recoveryAction; +} + +/*****************************************************************************/ +/***** Public functions' definition ******************************************/ +/*****************************************************************************/ +ADI_API adi_adrv903x_CpuAddr_t* adrv903x_CpuAddrGet(adi_adrv903x_Cpu_t* const cpu, + const adi_adrv903x_CpuType_e cpuType) +{ + if (cpu == NULL) + { + return NULL; + } + return &cpu->cpuAddr[cpuType]; +} + +/* Interprets the memory at buf as a little-endian 2 or 4 byte integer and returns it as + * a uint32_t */ +ADI_API uint32_t adrv903x_CpuIntFromBytesGet(const uint8_t* const buf, const uint8_t size) +{ + uint32_t result = 0U; + uint8_t i = 0U; + + if (buf == NULL) + { + return 0U; + } + + if (size <= 4U) + { + for (i = 0U; i < size; ++i) + { + result |= (uint32_t)(*(buf + i)) << (i * 8U); + } + } + + return result; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuInitialize(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_Cpu_t* cpu = NULL; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + uint8_t idx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + cpu = &device->devStateInfo.cpu; + + //This is retrieved from the FW image directly + cpu->devProfileAddr = 0; + + for (idx = 0U; idx < ADI_ADRV903X_MAX_NUM_CPUS; ++idx) + { + /* Skip ADI_ADRV903X_CPU_TYPE_MAX_RADIO value */ + if (idx == (uint8_t)ADI_ADRV903X_CPU_TYPE_MAX_RADIO) + { + continue; + } + cpuType = (adi_adrv903x_CpuType_e)idx; + + recoveryAction = adrv903x_CpuAddrInitialize(&cpu->cpuAddr[idx], cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid CPU Type Provided"); + return recoveryAction; + break; + } + + if (idx < (uint8_t)ADI_ADRV903X_CPU_TYPE_MAX_RADIO) + { + /* Set the memory bank configuration for the CPU0 and CPU1. Must be done here + * before any attempt to program the CPU image is made. + */ + ADRV903X_SPIWRITEBYTE_RETURN("CPU_ADDR_MEM_BANK_CTRL", cpu->cpuAddr[idx].memBankCtrlAddr, ADRV903X_CPU_MEM_BANK_CTRL_REG_VAL, recoveryAction); + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuCmdWrite(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const adrv903x_LinkId_e linkId, + const adrv903x_CpuCmdId_t cmdId, + adrv903x_CpuCmd_t* const cmd, + const uint32_t payloadSize) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t cpuCommandBusy = 0U; + uint32_t exceptionValue = 0U; + uint32_t timeout_us = ADI_ADRV903X_SENDCPUCMD_TIMEOUT_US; + uint32_t waitInterval_us = ADI_ADRV903X_SENDCPUCMD_INTERVAL_US; + uint32_t eventCheck = 0U; + uint32_t numEventChecks = 0U; + adi_adrv903x_CpuAddr_t *cpuAddr = NULL; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cmd); + + if ((cpuType == ADI_ADRV903X_CPU_TYPE_0) || + (cpuType == ADI_ADRV903X_CPU_TYPE_1)) + { + /* check for valid cmd id */ + if (cmdId >= ADRV903X_CPU_CMD_ID_NUM_CMDS) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + cmdId, + "Invalid Command ID Provided"); + return recoveryAction; + } + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + cpuType, + "Invalid CPU Type Provided"); + return recoveryAction; + } + + /* setting a 2 second timeout for mailbox busy bit to be clear (can't send an cpu mailbox command until mailbox is ready) */ +#if ADI_ADRV903X_SENDCPUCMD_INTERVAL_US > ADI_ADRV903X_SENDCPUCMD_TIMEOUT_US + waitInterval_us = timeout_us; +#elif ADI_ADRV903X_SENDCPUCMD_INTERVAL_US == 0 + waitInterval_us = timeout_us; +#endif + numEventChecks = timeout_us / waitInterval_us; + + /* timeout event loop to permit non-blocking of thread */ + for (eventCheck = 0U; eventCheck <= numEventChecks; ++eventCheck) + { + recoveryAction = adrv903x_CpuMailboxBusyGet( device, cpuType, &cpuCommandBusy); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cpu Mailbox busy state cannot be read"); + return recoveryAction; + } + + if (cpuCommandBusy == ADI_TRUE) + { + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, waitInterval_us); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Request Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_CpuCheckException(device, &exceptionValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU exception state cannot be read."); + return recoveryAction; + } + + if (exceptionValue != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_DEVICE; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, exceptionValue, "CPU exception detected waiting for mailbox ready."); + return recoveryAction; + } + + } + else + { + break; + } + } + + /* if busy bit remains set after timeout event loop function is exited, otherwise command is sent */ + if (cpuCommandBusy == ADI_TRUE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_CMD_TIMEOUT, + recoveryAction, + cpuCommandBusy, + "CPU Mailbox Busy; Timeout Occurred"); + return recoveryAction; + } + + cpuAddr = &(device->devStateInfo.cpu.cpuAddr[cpuType]); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cpuAddr); + + ++cpuAddr->curTransactionId[linkId]; + cmd->cmdId = ADRV903X_HTOCS(cmdId); + cmd->tId = ADRV903X_HTOCS(cpuAddr->curTransactionId[linkId]); + + recoveryAction = adrv903x_CpuMailboxBufferWrite(device, + cpuType, + linkId, + (const uint8_t *)cmd, + payloadSize+sizeof(adrv903x_CpuCmd_t)); + if(recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Mailbox Buffer Write Issue"); + return recoveryAction; + } + + if ((cpuType == ADI_ADRV903X_CPU_TYPE_0) || + (cpuType == ADI_ADRV903X_CPU_TYPE_1)) + { + /* Write to CPU's Mailbox CMD bitfield (armX_spiX_command) to notify it of incoming command. */ + ADRV903X_SPIWRITEBYTE_RETURN("CPU_COMMAND", cpuAddr->cmdAddr, linkId, recoveryAction); + } + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuCmdRespRead(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const adrv903x_LinkId_e linkId, + adrv903x_CpuCmdId_t*const cmdId, + adrv903x_CpuCmdResp_t* const cmdRsp, + const uint32_t payloadSize, + adrv903x_CpuCmdStatus_e* const status) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmdTransactionId_t rxdTransactionId = 0U; + const adi_adrv903x_CpuAddr_t* cpuAddr = NULL; + uint8_t cmdStatusByte = 0U; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cmdRsp); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cmdId); + + /* Caller is allowed to pass in NULL for status, + * so we must check every time before dereferencing. + */ + if (status != NULL) + { + *status = ADRV903X_CPU_CMD_STATUS_GENERIC; + } + + /* Wait for a command response from the CPU */ + recoveryAction = adrv903x_CpuCmdStatusWait( device, + cpuType, + linkId, + &cmdStatusByte, + ADI_ADRV903X_READCPURESP_TIMEOUT_US, + ADI_ADRV903X_READCPURESP_INTERVAL_US); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + if (status != NULL) + { + *status = ADRV903X_CPU_CMD_STATUS_LINK_ERROR; + } + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_CMD_TIMEOUT, + ADI_NO_VARIABLE, + recoveryAction); + return recoveryAction; + } + + cpuAddr = &(device->devStateInfo.cpu.cpuAddr[cpuType]); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cpuAddr); + + /* Read the response from the CPU */ + recoveryAction = adrv903x_CpuMailboxBufferRead( device, + cpuType, + linkId, + (uint8_t *)cmdRsp, + payloadSize + sizeof(adrv903x_CpuCmdResp_t)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + if (status != NULL) + { + *status = ADRV903X_CPU_CMD_STATUS_LINK_ERROR; + } + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_MAILBOX_READ, + ADI_NO_VARIABLE, + recoveryAction); + return recoveryAction; + } + + /* Extract the cmd ID and transaction ID from the response */ + *cmdId = ADRV903X_CTOHS(cmdRsp->cmdId); + rxdTransactionId = ADRV903X_CTOHS(cmdRsp->tId); + + /* Verify the transaction ID */ + if (rxdTransactionId != cpuAddr->curTransactionId[linkId]) + { + if (status != NULL) + { + *status = ADRV903X_CPU_CMD_STATUS_UNEXPECTED_TRANSACTION_ID; + } + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_CMD_ID, + recoveryAction, + rxdTransactionId, + "Command Failed: Unexpected Transaction Id"); + return recoveryAction; + } + else + { + /* Transaction ID is correct. Check the command status for failure. */ + cmdStatus = (adrv903x_CpuCmdStatus_e)ADRV903X_CTOHS(cmdRsp->status); + + if (status != NULL) + { + *status = cmdStatus; + } + + if (cmdStatus != ADRV903X_CPU_CMD_STATUS_NO_ERROR) + { + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_CMD_RESPONSE, + cmdStatus, + recoveryAction); + return recoveryAction; + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuCmdSend(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const adrv903x_LinkId_e linkId, + const adrv903x_CpuCmdId_t cmdId, + void* const pCmdPayload, + const size_t cmdPayloadSz, + void* const pRespPayload, + const size_t respPayloadSz, + adrv903x_CpuCmdStatus_e* const status) +{ + /* Union to determine maximum buffer size needed for both CPU command and response */ + typedef union + { + uint8_t maxCmdBuf[ADRV903X_CPU_CMD_MAX_SIZE_BYTES]; + uint8_t maxCmdRspBuf[ADRV903X_CPU_CMD_RESP_MAX_SIZE_BYTES]; + } adrv903x_MaxCpuCmdBufSz_t; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_t *txCmd = NULL; + adrv903x_CpuCmdResp_t *rxRsp = NULL; + adrv903x_CpuCmdId_t rspCmdId; + adrv903x_CpuCmdStatus_e cmdStatus; + ADI_PLATFORM_LARGE_ARRAY_ALLOC(uint8_t, cmdBuf, sizeof(adrv903x_MaxCpuCmdBufSz_t)); + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Initialize the caller's status parameter, if applicable. */ + if (status != NULL) + { + *status = ADRV903X_CPU_CMD_STATUS_GENERIC; + } + + /* If the command payload size is nonzero, verify the pointer is not null */ + if (cmdPayloadSz != 0) + { + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, pCmdPayload); + } + else if (pCmdPayload != NULL) + { + /* If the command payload size is zero, pointer must be null */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, pCmdPayload, "pCmdPayload must be NULL if cmdPayloadSz is 0"); + return recoveryAction; + } + + /* If the command response payload size is nonzero, verify the pointer is not null */ + if (respPayloadSz != 0) + { + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, pRespPayload); + } + else if (pRespPayload != NULL) + { + /* If the command response payload size is zero, pointer must be null */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, pRespPayload, "pRespPayload must be NULL if respPayloadSz is 0"); + return recoveryAction; + } + + /* Verify cpuType */ + if ((cpuType >= ADI_ADRV903X_CPU_TYPE_MAX_RADIO) || + (cpuType <= ADI_ADRV903X_CPU_TYPE_UNKNOWN)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuType, "Invalid CPU type"); + return recoveryAction; + } + + /* Verify cmdId */ + if (cmdId >= ADRV903X_CPU_CMD_ID_NUM_CMDS) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cmdId, "Invalid command ID"); + return recoveryAction; + } + + /* Verify linkId */ + if ((linkId >= ADRV903X_LINK_ID_MAX) || (linkId <= ADRV903X_LINK_ID_UNKNOWN)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, linkId, "Invalid link ID"); + return recoveryAction; + } + + /* Verify command payload size is acceptable */ + if (cmdPayloadSz > (sizeof(adrv903x_MaxCpuCmdBufSz_t) - sizeof(adrv903x_CpuCmd_t))) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cmdPayloadSz, "cmdPayloadSz is too large for command buffer."); + return recoveryAction; + } + + /* Verify response payload size is acceptable */ + if (respPayloadSz > (sizeof(adrv903x_MaxCpuCmdBufSz_t) - sizeof(adrv903x_CpuCmdResp_t))) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, respPayloadSz, "respPayloadSz is too large for command buffer."); + return recoveryAction; + } + + /* Overlay the command header and response header on the buffer */ + txCmd = (adrv903x_CpuCmd_t*)cmdBuf; + rxRsp = (adrv903x_CpuCmdResp_t*)cmdBuf; + + /* Copy the caller's payload to the correct location. Size is verified above. */ + if (cmdPayloadSz != 0) + { + ADI_LIBRARY_MEMCPY((void*)((uint8_t*)txCmd + sizeof(adrv903x_CpuCmd_t)), pCmdPayload, cmdPayloadSz) ; + } + + /* Send the command */ + recoveryAction = adrv903x_CpuCmdWrite(device, cpuType, linkId, cmdId, txCmd, cmdPayloadSz); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to send command to CPU"); + goto debug; + } + + /* Wait for the response, then receive the payload into rxRsp. rxRsp is verified to be able to hold respPayloadSz payload above. */ + recoveryAction = adrv903x_CpuCmdRespRead(device, cpuType, linkId, &rspCmdId, rxRsp, (uint32_t)respPayloadSz, &cmdStatus); + + /* Copy cmd status out for caller, if applicable */ + if (status != NULL) + { + *status = cmdStatus; + } + + /* Process any cmd errors */ + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + if (cmdStatus == ADRV903X_CPU_CMD_STATUS_CMD_FAILED) + { + /* For command-specific failures, copy the payload to the caller's buffer before aborting. */ + if (respPayloadSz != 0) + { + ADI_LIBRARY_MEMCPY(pRespPayload, (void*)((uint8_t*)rxRsp + sizeof(adrv903x_CpuCmdResp_t)), respPayloadSz); + } + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Command Response Error"); + } + else + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "No CPU Command Response Received"); + } + + goto debug; + } + + /* Copy the payload to the caller's buffer */ + if (respPayloadSz != 0) + { + ADI_LIBRARY_MEMCPY(pRespPayload, (void*)((uint8_t*)rxRsp + sizeof(adrv903x_CpuCmdResp_t)), respPayloadSz); + } + + return recoveryAction; + +debug: + /* Disable Error Clearing for Private API Call Case e.g. CpuPing */ + ++device->common.publicCnt; + + adrv903x_CpuErrorDebugCheck(device); + + --device->common.publicCnt; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuChannelMappingGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Channels_e channel, + const adrv903x_CpuObjectId_e objId, + adi_adrv903x_CpuType_e* const cpuType) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cpuNum = 2u; /* Set to bad CPU */ + uint32_t idx = 0u; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_PTR_RETURN(cpuType); + + /* Detect any ORx channel commands */ + if (ADRV903X_CPU_OBJID_IS_ORX(objId)) + { + for (idx = 0U; idx < ADI_ADRV903X_MAX_ORX; idx++) + { + if ((uint32_t)channel == ((uint32_t)1U << idx)) + { + cpuNum = device->initExtract.orxCpuConfig[idx]; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + } + } + } + /* The SERDES cals spread the cals for different lanes evenly across the available CPU cores. + * For these cals, the channel passed in is the SERDES lane of interest + */ + else if ((objId == ADRV903X_CPU_OBJID_IC_SERDES) || + (objId == ADRV903X_CPU_OBJID_TC_SERDES)) + { + for (idx = 0U; idx < ADI_ADRV903X_MAX_SERDES_LANES; idx++) + { + if ((uint32_t)channel == ((uint32_t)1U << idx)) + { + cpuNum = device->initExtract.jesd204DesLaneCpuConfig[idx]; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + } + } + } + /* The RC TUNER CAL is only supported on CPU0 */ + else if (objId == ADRV903X_CPU_OBJID_IC_RC_TUNER) + { + cpuNum = 0; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + else /* Assume Rx or Tx applies */ + { + for (idx = 0U; idx < ADI_ADRV903X_MAX_CHANNELS; idx++) + { + if ((uint32_t)channel == ((uint32_t)1U << idx)) + { + cpuNum = device->initExtract.rxTxCpuConfig[idx]; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + } + } + } + + if (recoveryAction == ADI_ADRV903X_ERR_ACT_NONE) + { + if (cpuNum == 0u) + { + *cpuType = ADI_ADRV903X_CPU_TYPE_0; + } + else if (cpuNum == 1u) + { + *cpuType = ADI_ADRV903X_CPU_TYPE_1; + } + else + { + *cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuRamAccessStart(adi_adrv903x_Device_t* const device, + const adrv903x_CpuCmd_CaptureRamType_e captureRamType, + const adi_adrv903x_Channels_e channelNumber, + uint8_t* const success) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_RamAccessStart_t cmd; + adrv903x_CpuCmd_RamAccessStartResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_CAPTURE_RAM_LOCK_ERROR; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, success); + + ADI_LIBRARY_MEMSET(&cmd, 0, sizeof(adrv903x_CpuCmd_RamAccessStart_t)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(adrv903x_CpuCmd_RamAccessStartResp_t)); + + /* Initialize success flag to false */ + *success = 0U; + + /* Get the CPU assigned to this channel */ + recoveryAction = adrv903x_CpuChannelMappingGet(device, channelNumber, ADRV903X_CPU_OBJID_SYSTEM_END, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get CPU channel mapping"); + return recoveryAction; + } + + /* Setup cmd-specific payload */ + cmd.captureRamType = (adrv903x_CpuCmd_CaptureRamType_t)captureRamType; + cmd.channelNumber = ADRV903X_HTOCL((uint32_t)channelNumber); + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_RAM_ACCESS_START, + (void*)&cmd, + sizeof(cmd), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_RETURN(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction); + } + + /* Extract cmd-specific response */ + cpuErrorCode = (adrv903x_CpuErrorCode_e)ADRV903X_CTOHL((uint32_t)cmdRsp.status); + + /* If NO_ERROR was returned, the start command was successful */ + if (cpuErrorCode == ADRV903X_CPU_NO_ERROR) + { + *success = 1U; + } + else if (cpuErrorCode != ADRV903X_CPU_SYSTEM_CAPTURE_RAM_LOCK_ERROR) + { + /* Any error other than LOCK_ERROR is unexpected */ + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_RAM_LOCK, + cpuErrorCode, + recoveryAction); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuRamAccessStop( adi_adrv903x_Device_t* const device, + const adrv903x_CpuCmd_CaptureRamType_e captureRamType, + const adi_adrv903x_Channels_e channelNumber, + uint8_t* const success) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_RamAccessStop_t cmd; + adrv903x_CpuCmd_RamAccessStopResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_CAPTURE_RAM_LOCK_ERROR; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, success); + ADI_LIBRARY_MEMSET(&cmd, 0, sizeof(adrv903x_CpuCmd_RamAccessStop_t)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(adrv903x_CpuCmd_RamAccessStopResp_t)); + + /* Initialize success flag to false */ + *success = 0U; + + /* Get the CPU assigned to this channel */ + recoveryAction = adrv903x_CpuChannelMappingGet(device, channelNumber, ADRV903X_CPU_OBJID_SYSTEM_END, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get CPU channel mapping"); + return recoveryAction; + } + + /* Setup cmd-specific payload */ + cmd.captureRamType = (adrv903x_CpuCmd_CaptureRamType_t)captureRamType; + cmd.channelNumber = ADRV903X_HTOCL((uint32_t)channelNumber); + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_RAM_ACCESS_STOP, + (void*)&cmd, + sizeof(cmd), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_RETURN(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction); + } + + /* Extract cmd-specific response */ + cpuErrorCode = (adrv903x_CpuErrorCode_e)ADRV903X_CTOHL((uint32_t)cmdRsp.status); + + /* If NO_ERROR was returned, the stop command was successful */ + if (cpuErrorCode == ADRV903X_CPU_NO_ERROR) + { + *success = 1U; + } + else if (cpuErrorCode != ADRV903X_CPU_SYSTEM_CAPTURE_RAM_UNLOCK_ERROR) + { + /* Any error other than UNLOCK_ERROR is unexpected */ + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_RAM_LOCK, + cpuErrorCode, + recoveryAction); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuPing(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const uint32_t writeData, + uint32_t* const readData) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_Ping_t pingCmd; + adrv903x_CpuCmd_PingResp_t pingCmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, readData); + + ADI_LIBRARY_MEMSET(&pingCmd, 0, sizeof(adrv903x_CpuCmd_Ping_t)); + ADI_LIBRARY_MEMSET(&pingCmdRsp, 0, sizeof(adrv903x_CpuCmd_PingResp_t)); + + /* Setup ping-specific payload */ + pingCmd.echoData = ADRV903X_HTOCL(writeData); + + if ((cpuType == ADI_ADRV903X_CPU_TYPE_0) || + (cpuType == ADI_ADRV903X_CPU_TYPE_1)) + { + recoveryAction = adrv903x_CpuCmdSend(device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_PING, + (void*)&pingCmd, + sizeof(pingCmd), + (void*)&pingCmdRsp, + sizeof(pingCmdRsp), + &cmdStatus); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_RETURN(pingCmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction); + } + } + /* Extract ping-specific response */ + cpuErrorCode = (adrv903x_CpuErrorCode_e)ADRV903X_CTOHL((uint32_t)pingCmdRsp.status); + *readData = ADRV903X_CTOHL(pingCmdRsp.echoData); + + /* Handle ping-specific errors */ + if ((cpuErrorCode != ADRV903X_CPU_NO_ERROR) || (*readData != writeData)) + { + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_PING, + ADI_NO_VARIABLE, + recoveryAction); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuEfuseGet(adi_adrv903x_Device_t* const device, + const uint32_t address, + uint32_t* const value) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_EfuseGet_t efuseCmd; + adrv903x_CpuCmd_EfuseGetResp_t efuseCmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, value); + + ADI_LIBRARY_MEMSET(&efuseCmd, 0, sizeof(adrv903x_CpuCmd_EfuseGet_t)); + ADI_LIBRARY_MEMSET(&efuseCmdRsp, 0, sizeof(adrv903x_CpuCmd_EfuseGetResp_t)); + + if (address >= 0x20U) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid EFUSE address (must be 0 - 0x1F)"); + return recoveryAction; + } + + /* Setup efuse-specific payload */ + efuseCmd.addr = ADRV903X_HTOCL(address); + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, /* assume CPU0 is the primary CPU */ + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_EFUSE_GET, + (void*)&efuseCmd, + sizeof(efuseCmd), + (void*)&efuseCmdRsp, + sizeof(efuseCmdRsp), + &cmdStatus); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_RETURN(efuseCmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction); + } + + /* Extract efuse-specific response */ + *value = ADRV903X_CTOHL(efuseCmdRsp.value); + + return recoveryAction; +} + +static const uint32_t LUT_CRC32[16] = { + 0x00000000u, + 0x04c11db7u, + 0x09823b6eu, + 0x0d4326d9u, + 0x130476dcu, + 0x17c56b6bu, + 0x1a864db2u, + 0x1e475005u, + 0x2608edb8u, + 0x22c9f00fu, + 0x2f8ad6d6u, + 0x2b4bcb61u, + 0x350c9b64u, + 0x31cd86d3u, + 0x3c8ea00au, + 0x384fbdbdu +}; + +ADI_API uint32_t adrv903x_Crc32ForChunk(const uint8_t buf[], + const uint32_t bufLen, + const uint32_t seedCrc, + const uint8_t finalCrc) +{ + uint32_t i; + uint32_t a, b, c, d; + + if (buf == NULL) + { + return 0; + } + + a = seedCrc; + + for (i = 0u; i < bufLen; i++) + { + b = (a >> 28u) & 0xfu; + c = LUT_CRC32[b]; + d = buf[i]; + a = (a << 4u) | (d >> 4u); + a = a ^ c; + b = (a >> 28u) & 0xfu; + c = LUT_CRC32[b]; + a = (a << 4u) | (d & 0xfu); + a = a ^ c; + } + + if (finalCrc > 0) + { + for (i = 0u; i < 4u; i++) + { + b = (a >> 28u) & 0xfu; + c = LUT_CRC32[b]; + a = (a << 4u); + a = a ^ c; + b = (a >> 28u) & 0xfu; + c = LUT_CRC32[b]; + a = (a << 4u); + a = a ^ c; + } + } + + return a; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_HealthMonitorPrivateCpuStatusGet( adi_adrv903x_Device_t* const device, + adrv903x_HealthMonitorPrivateCpuStatus_t* const healthMonitorStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, healthMonitorStatus); + + ADI_LIBRARY_MEMSET(healthMonitorStatus, 0, sizeof(adrv903x_HealthMonitorPrivateCpuStatus_t)); + + /* TODO: When Private CPU Health Monitoring becomes useful, populate return data appropriately */ + /* For now, simply return all zero data */ + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuGpioSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpioSelect, + const adrv903x_CpuCmd_GpioSignal_e cpuGpioSignal, + const uint8_t isInput) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_SetGpio_t setGpioCmd; + adrv903x_CpuCmd_SetGpioResp_t setGpioResp; + adrv903x_CpuCmd_GetGpio_t getGpioCmd; + adrv903x_CpuCmd_GetGpioResp_t getGpioResp; + uint32_t cpuTypeIdx = 0U; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_GpioSignal_e signal = ADI_ADRV903X_GPIO_SIGNAL_UNUSED; + + adi_adrv903x_GpioSignal_e outputSignals[ADI_ADRV903X_GPIO_COUNT] = { + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_0, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_1, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_2, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_3, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_4, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_5, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_6, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_7, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_8, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_9, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_10, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_11, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_12, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_13, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_14, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_15, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_16, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_17, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_18, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_19, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_20, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_21, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_22, + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_23 + }; + + adi_adrv903x_GpioSignal_e inputSignals[ADI_ADRV903X_GPIO_COUNT] = { + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_0, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_1, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_2, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_3, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_4, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_5, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_6, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_7, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_8, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_9, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_10, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_11, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_12, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_13, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_14, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_15, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_16, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_17, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_18, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_19, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_20, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_21, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_22, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_23 + }; + + /* Prepare the command payload */ + getGpioCmd.signal = (uint8_t)cpuGpioSignal; + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_GPIO, + (void*)&getGpioCmd, + sizeof(getGpioCmd), + (void*)&getGpioResp, + sizeof(getGpioResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_RETURN(getGpioResp.cmdStatus, cmdStatus, cpuErrorCode, recoveryAction); + } + + /* Release the pin assigned to same CPU signal */ + if (getGpioResp.pin != (uint8_t)ADI_ADRV903X_GPIO_INVALID) + { + if (isInput == ADI_TRUE) + { + signal = inputSignals[getGpioResp.pin]; + } + else + { + signal = outputSignals[getGpioResp.pin]; + } + + recoveryAction = adrv903x_GpioSignalRelease(device, (adi_adrv903x_GpioPinSel_e)getGpioResp.pin, signal, ADI_ADRV903X_CHOFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + getGpioResp.pin, + "GpioSignalRelease issue"); + return recoveryAction; + } + + /* Send GPIO set command to CPU to disable the pin */ + /* Fill out set gpio cmd params with user-provided params */ + setGpioCmd.signal = (uint8_t)cpuGpioSignal; + setGpioCmd.pin = (uint8_t)getGpioResp.pin; + setGpioCmd.polarity = (uint8_t)ADRV903X_CPU_CMD_GPIO_PIN_POLARITY_NORMAL; + setGpioCmd.enable = (uint8_t)ADRV903X_CPU_CMD_GPIO_PIN_DISABLE; + + /* For each CPU, send the SET_GPIO command, wait for a response, and process any errors. */ + for (cpuTypeIdx = 0U; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_GPIO, + (void*)&setGpioCmd, + sizeof(setGpioCmd), + (void*)&setGpioResp, + sizeof(setGpioResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_RETURN(setGpioResp.cmdStatus, cmdStatus, cpuErrorCode, recoveryAction); + } + } + } + + /* Set if valid GPIO */ + if (gpioSelect != ADI_ADRV903X_GPIO_INVALID) + { + if (isInput == ADI_TRUE) + { + signal = inputSignals[gpioSelect]; + } + else + { + signal = outputSignals[gpioSelect]; + } + + /* Set the signal to the GPIO */ + recoveryAction = adrv903x_GpioSignalSet(device, gpioSelect, signal, ADI_ADRV903X_CHOFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while routing CPU signal to GPIO."); + return recoveryAction; + } + + /* Send GPIO set command to CPU to enable the pin */ + /* Fill out set gpio cmd params with user-provided params */ + setGpioCmd.signal = (uint8_t)cpuGpioSignal; + setGpioCmd.pin = (uint8_t)gpioSelect; + setGpioCmd.polarity = (uint8_t)ADRV903X_CPU_CMD_GPIO_PIN_POLARITY_NORMAL; + setGpioCmd.enable = (uint8_t)ADRV903X_CPU_CMD_GPIO_PIN_ENABLE; + + /* For each CPU, send the SET_GPIO command, wait for a response, and process any errors. */ + for (cpuTypeIdx = 0U; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_GPIO, + (void*)&setGpioCmd, + sizeof(setGpioCmd), + (void*)&setGpioResp, + sizeof(setGpioResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_RETURN(setGpioResp.cmdStatus, cmdStatus, cpuErrorCode, recoveryAction); + } + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CpuGpioGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioPinSel_e * const gpioSelect, + const adrv903x_CpuCmd_GpioSignal_e cpuGpioSignal) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_GetGpio_t getGpioCmd; + adrv903x_CpuCmd_GetGpioResp_t getGpioResp; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + + /* Prepare the command payload */ + getGpioCmd.signal = (uint8_t)cpuGpioSignal; + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_GPIO, + (void*)&getGpioCmd, + sizeof(getGpioCmd), + (void*)&getGpioResp, + sizeof(getGpioResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_RETURN(getGpioResp.cmdStatus, cmdStatus, cpuErrorCode, recoveryAction); + } + + *gpioSelect = (adi_adrv903x_GpioPinSel_e)getGpioResp.pin; + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_EccEnableGet(adi_adrv903x_Device_t* const device, + uint8_t* const eccEnable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cmdErrorCode = ADRV903X_CPU_NO_ERROR; + + adi_adrv903x_CpuGetEccScrubEnableCmdResp_t eccEnableGetRsp; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(eccEnable); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_LIBRARY_MEMSET(&eccEnableGetRsp, 0, sizeof(adi_adrv903x_CpuGetEccScrubEnableCmdResp_t)); + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_ENABLE_ECC_SCRUB, + 0U, + 0U, + (void*)&eccEnableGetRsp, + sizeof(eccEnableGetRsp), + &cmdStatus); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + /* If the command failed for a command-specific reason, extract the command status code and log the error. */ + cmdErrorCode = (adrv903x_CpuErrorCode_e)ADRV903X_CTOHL(eccEnableGetRsp.status); + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + cmdErrorCode, + "ECC Enable Get command failed, CPU0"); + + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO((adrv903x_CpuErrorCode_e)(eccEnableGetRsp.status), cmdStatus, cmdErrorCode, recoveryAction, cleanup); + } + else + { + *eccEnable = eccEnableGetRsp.eccScrubEnable; + + /* reset for the next get */ + ADI_LIBRARY_MEMSET(&eccEnableGetRsp, 0, sizeof(adi_adrv903x_CpuGetEccScrubEnableCmdResp_t)); + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_1, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_ENABLE_ECC_SCRUB, + 0U, + 0U, + (void*)&eccEnableGetRsp, + sizeof(eccEnableGetRsp), + &cmdStatus); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + /* If the command failed for a command-specific reason, extract the command status code and log the error. */ + cmdErrorCode = (adrv903x_CpuErrorCode_e)ADRV903X_CTOHL(eccEnableGetRsp.status); + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + cmdErrorCode, + "ECC Enable Get command failed, CPU1"); + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO((adrv903x_CpuErrorCode_e)(eccEnableGetRsp.status), cmdStatus, cmdErrorCode, recoveryAction, cleanup); + } + else + { + if (eccEnableGetRsp.eccScrubEnable > 0) + { + *eccEnable |= 1u; + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_EccEnableSet(adi_adrv903x_Device_t* const device, + uint8_t const eccEnable) +{ + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cmdErrorCode = ADRV903X_CPU_NO_ERROR; + adi_adrv903x_CpuSetEccScrubEnableCmd_t eccEnableSet; + adi_adrv903x_CpuSetEccScrubEnableCmdResp_t eccEnableSetRsp; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_LIBRARY_MEMSET(&eccEnableSetRsp, 0, sizeof(adi_adrv903x_CpuSetEccScrubEnableCmdResp_t)); + + eccEnableSet.eccScrubEnable = (uint8_t)(eccEnable); + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_ENABLE_ECC_SCRUB, + (void*)&eccEnableSet, + sizeof(eccEnableSet), + (void*)&eccEnableSetRsp, + sizeof(eccEnableSetRsp), + &cmdStatus); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + /* If the command failed for a command-specific reason, extract the command status code and log the error. */ + cmdErrorCode = (adrv903x_CpuErrorCode_e)ADRV903X_CTOHL(eccEnableSetRsp.status); + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + cmdErrorCode, + "ECC Enable Set command failed, CPU0"); + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO((adrv903x_CpuErrorCode_e)(eccEnableSetRsp.status), cmdStatus, cmdErrorCode, recoveryAction, cleanup); + + } + else + { + /* reset for the next set */ + ADI_LIBRARY_MEMSET(&eccEnableSetRsp, 0, sizeof(adi_adrv903x_CpuSetEccScrubEnableCmdResp_t)); + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_1, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_ENABLE_ECC_SCRUB, + (void*)&eccEnableSet, + sizeof(eccEnableSet), + (void*)&eccEnableSetRsp, + sizeof(eccEnableSetRsp), + &cmdStatus); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + /* If the command failed for a command-specific reason, extract the command status code and log the error. */ + cmdErrorCode = (adrv903x_CpuErrorCode_e)ADRV903X_CTOHL(eccEnableSetRsp.status); + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + cmdErrorCode, + "ECC Enable Set command failed, CPU1"); + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO((adrv903x_CpuErrorCode_e)(eccEnableSetRsp.status), cmdStatus, cmdErrorCode, recoveryAction, cleanup); + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API void adrv903x_CpuErrorDebugCheck(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cpuException = 0U; + uint32_t errAddress = 0U; + adrv903x_CpuErrors_t cpu0Status = { ADRV903X_CPU_NO_ERROR, ADRV903X_CPU_NO_ERROR, ADRV903X_CPU_NO_ERROR }; + adrv903x_CpuErrors_t cpu1Status = { ADRV903X_CPU_NO_ERROR, ADRV903X_CPU_NO_ERROR, ADRV903X_CPU_NO_ERROR }; + + if (device == NULL) + { + return; + } + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + if ((device->devStateInfo.devState & ADI_ADRV903X_STATE_ALLCPUSLOADED) == ADI_ADRV903X_STATE_ALLCPUSLOADED) + { + recoveryAction = adi_adrv903x_CpuCheckException(device, &cpuException); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Radio CPU Exception Check Issue"); + /* Continue Debug */ + } + + if (cpuException != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_DEVICE; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuException, "Radio CPU Exception Detected"); + /* Continue Debug */ + } + } + + /* Get CPU 0 Runtime Status */ + if (ADI_ADRV903X_ERR_ACT_NONE == adi_adrv903x_Register32Read( device, + NULL, + ADRV903X_CPU_0_PM_ERROR_STATUS, + &errAddress, + 0xFFFFFFFFU)) + { + (void) adi_adrv903x_Registers32Read(device, + NULL, + errAddress, + (uint32_t*) &cpu0Status, + NULL, + (uint32_t) (sizeof(adrv903x_CpuErrors_t) / (sizeof(uint32_t)))); + } + + /* Get CPU 1 Runtime Status */ + if (ADI_ADRV903X_ERR_ACT_NONE == adi_adrv903x_Register32Read( device, + NULL, + ADRV903X_CPU_1_PM_ERROR_STATUS, + &errAddress, + 0xFFFFFFFFU)) + { + (void) adi_adrv903x_Registers32Read(device, + NULL, + errAddress, + (uint32_t*) &cpu1Status, + NULL, + (uint32_t) (sizeof(adrv903x_CpuErrors_t) / (sizeof(uint32_t)))); + } + + if (cpu0Status.system != ADRV903X_CPU_NO_ERROR) + { + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU_RUNTIME, + cpu0Status.system, + cpu0Status.system, + recoveryAction); + } + + + if (cpu1Status.system != ADRV903X_CPU_NO_ERROR) + { + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU_RUNTIME, + cpu1Status.system, + cpu1Status.system, + recoveryAction); + } + + (void) recoveryAction; +} diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_datainterface.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_datainterface.c new file mode 100644 index 0000000000000..88314849c4748 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_datainterface.c @@ -0,0 +1,1815 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adrv903x_data_interface.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#include "../../private/include/adrv903x_datainterface.h" + + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_DATAINTERFACE + +#include "adi_adrv903x_user.h" +#include "adi_adrv903x_hal.h" +#include "../../private/bf/adrv903x_bf_core.h" +#include "../../private/include/adrv903x_init.h" + +#include "../../private/include/adrv903x_reg_addr_macros.h" +#include "adi_adrv903x_types.h" +#include "adi_common_macros.h" +#include "adi_common_types.h" +#include "adi_adrv903x_error.h" +#include "../../private/include/adrv903x_init.h" +#include "../../private/bf/adrv903x_bf_tx_dig_types.h" +#include "../../private/bf/adrv903x_bf_tx_dig.h" +#include "../../private/bf/adrv903x_bf_orx_dig.h" + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxOrxDataCaptureConfigAddressGet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e channelSelect, + uint32_t* const address) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_RETURN(address) + + /* select the ram base address based on the channel select value */ + switch (channelSelect) + { + case ADI_ADRV903X_RXOFF: + /* invalid capture location request */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelSelect, "Invalid channel selected for capture or readback"); + break; + case ADI_ADRV903X_RX0: + *address = ADRV903X_ADDR_TX0_CPT_CONFIG; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_RX1: + *address = ADRV903X_ADDR_TX1_CPT_CONFIG; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_RX2: + *address = ADRV903X_ADDR_TX2_CPT_CONFIG; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_RX3: + *address = ADRV903X_ADDR_TX3_CPT_CONFIG; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_RX4: + *address = ADRV903X_ADDR_TX4_CPT_CONFIG; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_RX5: + *address = ADRV903X_ADDR_TX5_CPT_CONFIG; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_RX6: + *address = ADRV903X_ADDR_TX6_CPT_CONFIG; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_RX7: + *address = ADRV903X_ADDR_TX7_CPT_CONFIG; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_ORX0: + *address = ADRV903X_ADDR_ORX0_CPT_CONFIG; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_ORX1: + *address = ADRV903X_ADDR_ORX1_CPT_CONFIG; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + default: + /* invalid capture location request */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelSelect, "Invalid channel selected for capture or readback"); + break; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxOrxDataCaptureRead(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e channelSelect, + uint32_t ramData[], + const uint32_t wordCount, + const adi_adrv903x_RxOrxDataCaptureLocation_e loc) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t baseAddress = 0U; + uint32_t cptCfgAddr = 0U; + const uint32_t BASE_ADDRESS_MASK = 0xFFF00000U; + uint32_t wordOffset = 0x8000U; + uint32_t ramDataIndex = 0U; + uint32_t bankSize = wordCount >> 1; + static const uint8_t BYTE_ORIENTED_DATA = 1u; + + (void)loc; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_RETURN(ramData); + + /* select the ram base address based on the channel select value */ + recoveryAction = adrv903x_RxOrxDataCaptureConfigAddressGet(device, channelSelect, &cptCfgAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from the capture memory"); + return recoveryAction; + } + baseAddress = cptCfgAddr & BASE_ADDRESS_MASK; /* Capture memory is located at the base address of the slice */ + + /* read memory */ + if (channelSelect == ADI_ADRV903X_ORX0 || + channelSelect == ADI_ADRV903X_ORX1) /* reading from ORx capture ram 3 banks 4k each */ + { + wordOffset = 0x4000; + /* read from bank 0 */ + recoveryAction = adrv903x_Registers32bOnlyRead_vEndian(device, + NULL, + baseAddress, + (uint8_t*)(&ramData[0U]), + wordCount * 4U, + BYTE_ORIENTED_DATA); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from the capture memory"); + return recoveryAction; + } + + if (wordCount > ADI_ADRV903X_CAPTURE_SIZE_4K) /* read from bank 1 */ + { + recoveryAction = adrv903x_Registers32bOnlyRead_vEndian(device, + NULL, + baseAddress + wordOffset, + (uint8_t*)(&ramData[ADI_ADRV903X_CAPTURE_SIZE_4K]), + ADI_ADRV903X_CAPTURE_SIZE_4K * 4U, + BYTE_ORIENTED_DATA); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from the capture memory"); + return recoveryAction; + } + } + if (wordCount > ADI_ADRV903X_CAPTURE_SIZE_8K) /* read from bank 2 */ + { + recoveryAction = adrv903x_Registers32bOnlyRead_vEndian(device, + NULL, + baseAddress + wordOffset * 2U, + (uint8_t*)(&ramData[ADI_ADRV903X_CAPTURE_SIZE_8K]), + ADI_ADRV903X_CAPTURE_SIZE_4K * 4U, + BYTE_ORIENTED_DATA); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from the capture memory"); + return recoveryAction; + } + } + } + else /* reading from dpd capture memory 2 banks 8k each */ + { + /* read bank 0 memory */ + recoveryAction = adrv903x_Registers32bOnlyRead_vEndian(device, NULL, baseAddress, (uint8_t*)(&ramData[ramDataIndex]), bankSize * 4U, BYTE_ORIENTED_DATA); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from the capture memory"); + return recoveryAction; + } + + /* read bank 1 memory */ + ramDataIndex += bankSize; + recoveryAction = adrv903x_Registers32bOnlyRead_vEndian(device, NULL, baseAddress + wordOffset, (uint8_t*)(&ramData[ramDataIndex]), bankSize * 4U, BYTE_ORIENTED_DATA); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from the capture memory"); + return recoveryAction; + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxOrxDataCaptureConfigSet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxOrxDataCaptureLocation_e captureLocation, + const uint32_t size, + uint32_t* const config) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t sizeMask = 0U; + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_RETURN(config); + switch (size) + { + case ADI_ADRV903X_CAPTURE_SIZE_16K: + sizeMask = ADI_ADRV903X_CAPTURE_SIZE_MASK_16K; + break; + case ADI_ADRV903X_CAPTURE_SIZE_12K: + sizeMask = ADI_ADRV903X_CAPTURE_SIZE_MASK_12K; + break; + case ADI_ADRV903X_CAPTURE_SIZE_8K: + sizeMask = ADI_ADRV903X_CAPTURE_SIZE_MASK_8K; + break; + case ADI_ADRV903X_CAPTURE_SIZE_4K: + sizeMask = ADI_ADRV903X_CAPTURE_SIZE_MASK_4K; + break; + case ADI_ADRV903X_CAPTURE_SIZE_2K: + sizeMask = ADI_ADRV903X_CAPTURE_SIZE_MASK_2K; + break; + case ADI_ADRV903X_CAPTURE_SIZE_1K: + sizeMask = ADI_ADRV903X_CAPTURE_SIZE_MASK_1K; + break; + case ADI_ADRV903X_CAPTURE_SIZE_512: + sizeMask = ADI_ADRV903X_CAPTURE_SIZE_MASK_512; + break; + case ADI_ADRV903X_CAPTURE_SIZE_256: + sizeMask = ADI_ADRV903X_CAPTURE_SIZE_MASK_256; + break; + case ADI_ADRV903X_CAPTURE_SIZE_128: + sizeMask = ADI_ADRV903X_CAPTURE_SIZE_MASK_128; + break; + case ADI_ADRV903X_CAPTURE_SIZE_64: + sizeMask = ADI_ADRV903X_CAPTURE_SIZE_MASK_64; + break; + case ADI_ADRV903X_CAPTURE_SIZE_32: + sizeMask = ADI_ADRV903X_CAPTURE_SIZE_MASK_32; + break; + default: + sizeMask = ADI_ADRV903X_CAPTURE_SIZE_MASK_12K; + break; + } + /* set the base configuration and capture size to max samples; + * no size mask is applied for ORx config because the default is the max 12k */ + switch (captureLocation) + { + case ADI_ADRV903X_CAPTURE_LOC_DDC0: + *config = ADI_ADRV903X_CAPTURE_LOC_DDC0_BASE_CONFIG | sizeMask; /* Rx channel DDC0 */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_CAPTURE_LOC_DDC1: + *config = ADI_ADRV903X_CAPTURE_LOC_DDC1_BASE_CONFIG | sizeMask; /* Rx channel DDC1 */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_CAPTURE_LOC_DATAPATH: + *config = ADI_ADRV903X_CAPTURE_LOC_FORMATTER_BASE_CONFIG; /* ORx data path */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_CAPTURE_LOC_DPD: + *config = ADI_ADRV903X_CAPTURE_LOC_DPD_BASE_CONFIG | sizeMask; /* DPD */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_CAPTURE_LOC_DPD_PRE : + *config = ADI_ADRV903X_CAPTURE_LOC_DPD_PRE_BASE_CONFIG | sizeMask; /* DPD pre actuator */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_CAPTURE_LOC_DPD_POST : + *config = ADI_ADRV903X_CAPTURE_LOC_DPD_POST_BASE_CONFIG | sizeMask; /* DPD post actuator */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_CAPTURE_LOC_FSC : + /* TODO: Not yet supported */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + break; + case ADI_ADRV903X_CAPTURE_LOC_ORX_TX0 : + *config = ADI_ADRV903X_CAPTURE_LOC_ORX_TX0_BASE_CONFIG | sizeMask; /* ORx capture synchronized with Tx 0 */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_CAPTURE_LOC_ORX_TX1 : + *config = ADI_ADRV903X_CAPTURE_LOC_ORX_TX1_BASE_CONFIG | sizeMask; /* ORx capture synchronized with Tx 1 */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_CAPTURE_LOC_ORX_TX2 : + *config = ADI_ADRV903X_CAPTURE_LOC_ORX_TX2_BASE_CONFIG | sizeMask; /* ORx capture synchronized with Tx 2 */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_CAPTURE_LOC_ORX_TX3 : + *config = ADI_ADRV903X_CAPTURE_LOC_ORX_TX3_BASE_CONFIG | sizeMask; /* ORx capture synchronized with Tx 3 */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_CAPTURE_LOC_ORX_TX4 : + *config = ADI_ADRV903X_CAPTURE_LOC_ORX_TX4_BASE_CONFIG | sizeMask; /* ORx capture synchronized with Tx 4 */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_CAPTURE_LOC_ORX_TX5 : + *config = ADI_ADRV903X_CAPTURE_LOC_ORX_TX5_BASE_CONFIG | sizeMask; /* ORx capture synchronized with Tx 5 */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_CAPTURE_LOC_ORX_TX6 : + *config = ADI_ADRV903X_CAPTURE_LOC_ORX_TX6_BASE_CONFIG | sizeMask; /* ORx capture synchronized with Tx 6 */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + case ADI_ADRV903X_CAPTURE_LOC_ORX_TX7 : + *config = ADI_ADRV903X_CAPTURE_LOC_ORX_TX7_BASE_CONFIG | sizeMask; /* ORx capture synchronized with Tx 7 */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + default: + /* invalid capture location requested */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + break; + } + + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error configuring the capture location. An invalid capture location was written"); + return recoveryAction; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxOrxDataCaptureStreamDebugPoll(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e channelSelect, + uint32_t* const bStreamDbgFlag) + +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + const uint32_t READBACK_MASK = 0xFFFFFFFFU; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_RETURN(bStreamDbgFlag); + + switch (channelSelect) + { + case ADI_ADRV903X_ORX0: + recoveryAction = adi_adrv903x_Register32Read(device, NULL, ADRV903X_ADDR_ORX0_STREAM_SCRATCH1, bStreamDbgFlag, READBACK_MASK); + break; + case ADI_ADRV903X_ORX1: + recoveryAction = adi_adrv903x_Register32Read(device, NULL, ADRV903X_ADDR_ORX1_STREAM_SCRATCH1, bStreamDbgFlag, READBACK_MASK); + break; + case ADI_ADRV903X_RX0: + recoveryAction = adi_adrv903x_Register32Read(device, NULL, ADRV903X_ADDR_RX0_STREAM_SCRATCH1, bStreamDbgFlag, READBACK_MASK); + break; + case ADI_ADRV903X_RX1: + recoveryAction = adi_adrv903x_Register32Read(device, NULL, ADRV903X_ADDR_RX1_STREAM_SCRATCH1, bStreamDbgFlag, READBACK_MASK); + break; + case ADI_ADRV903X_RX2: + recoveryAction = adi_adrv903x_Register32Read(device, NULL, ADRV903X_ADDR_RX2_STREAM_SCRATCH1, bStreamDbgFlag, READBACK_MASK); + break; + case ADI_ADRV903X_RX3: + recoveryAction = adi_adrv903x_Register32Read(device, NULL, ADRV903X_ADDR_RX3_STREAM_SCRATCH1, bStreamDbgFlag, READBACK_MASK); + break; + case ADI_ADRV903X_RX4: + recoveryAction = adi_adrv903x_Register32Read(device, NULL, ADRV903X_ADDR_RX4_STREAM_SCRATCH1, bStreamDbgFlag, READBACK_MASK); + break; + case ADI_ADRV903X_RX5: + recoveryAction = adi_adrv903x_Register32Read(device, NULL, ADRV903X_ADDR_RX5_STREAM_SCRATCH1, bStreamDbgFlag, READBACK_MASK); + break; + case ADI_ADRV903X_RX6: + recoveryAction = adi_adrv903x_Register32Read(device, NULL, ADRV903X_ADDR_RX6_STREAM_SCRATCH1, bStreamDbgFlag, READBACK_MASK); + break; + case ADI_ADRV903X_RX7: + recoveryAction = adi_adrv903x_Register32Read(device, NULL, ADRV903X_ADDR_RX7_STREAM_SCRATCH1, bStreamDbgFlag, READBACK_MASK); + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_FramerBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerIdx, + adrv903x_BfJtxLinkChanAddr_e* const framerBitfieldAddr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, framerBitfieldAddr); + + switch (framerIdx) + { + case ADI_ADRV903X_FRAMER_0: + *framerBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + break; + + case ADI_ADRV903X_FRAMER_1: + *framerBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_; + break; + + case ADI_ADRV903X_FRAMER_2: + *framerBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_; + break; + + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + framerIdx, + "Invalid Framer selection parameter "); + return recoveryAction; + } + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_DeframerBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerIdx, + adrv903x_BfJrxLinkChanAddr_e* const deframerBitfieldAddr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, deframerBitfieldAddr); + + switch (deframerIdx) + { + case ADI_ADRV903X_DEFRAMER_0: + *deframerBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + break; + + case ADI_ADRV903X_DEFRAMER_1: + *deframerBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_; + break; + + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + deframerIdx, + "Invalid Deframer selection parameter "); + return recoveryAction; + } + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_FramerLaneSerdesPhyBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const uint8_t laneIdx, + adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e* const laneSerdesPhyBitfieldAddr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, laneSerdesPhyBitfieldAddr); + + switch (laneIdx) + { + case 0: + *laneSerdesPhyBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_0_; + break; + + case 1: + *laneSerdesPhyBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_1_; + break; + + case 2: + *laneSerdesPhyBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_2_; + break; + + case 3: + *laneSerdesPhyBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_3_; + break; + + case 4: + *laneSerdesPhyBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_4_; + break; + + case 5: + *laneSerdesPhyBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_5_; + break; + + case 6: + *laneSerdesPhyBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_6_; + break; + + case 7: + *laneSerdesPhyBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_7_; + break; + + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + laneIdx, + "Invalid Lane selection parameter "); + return recoveryAction; + } + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_FramerLaneSerdesPowerSet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + const uint8_t powerAct) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e laneSerdesPhyBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_0_; + uint8_t laneIdx = 0U; + uint8_t lanePd = 0U; + uint8_t laneBit = 0U; + uint8_t serdesNeedPowerDownBySelectedFramers = 0U; + uint8_t serdesUsedByUnselectedFramers = 0U; + uint8_t serdesPowerDownSet = 0U; + uint8_t framerIdx = 0U; + uint8_t framerSel = 0U; + const uint8_t PHY_POWER_DOWN = 0x01; + const uint8_t PHY_POWER_UP = 0x00; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Prepare for framers enabling case */ + if (powerAct) + { + for (framerIdx = 0; framerIdx < ADI_ADRV903X_MAX_FRAMERS; framerIdx++) + { + framerSel = 1U << framerIdx; + + /* Skip unselected framer */ + if ((framerSel & framerSelMask) == 0) + { + continue; + } + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, + (adi_adrv903x_FramerSel_e) framerSel, + &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + return recoveryAction; + } + + /* Get the lane crossbar selection */ + for (laneIdx = 0U; laneIdx < ADI_ADRV903X_MAX_SERDES_LANES; ++laneIdx) + { + recoveryAction = adrv903x_JtxLink_JtxForceLanePd_BfGet(device, + NULL, + framerBaseAddr, + laneIdx, + &lanePd); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane crossbar selection for the selected lane"); + return recoveryAction; + } + + + if (lanePd == 0U) /* LanePd is not set, so power it up */ + { + recoveryAction = (adi_adrv903x_ErrAction_e) adrv903x_FramerLaneSerdesPhyBitfieldAddressGet(device, + laneIdx, + &laneSerdesPhyBitfieldAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane serdes PHY address."); + return recoveryAction; + } + + recoveryAction = adrv903x_SerdesTxdigPhyRegmapCore1p2_PdSer_BfSet(device, + NULL, + laneSerdesPhyBitfieldAddr, + PHY_POWER_UP); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to power up lane serdes PHY."); + return recoveryAction; + } + } + } + } + + /* The power up was done above */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; + } + + /* Prepare for framers disabling case */ + for (framerIdx = 0; framerIdx < ADI_ADRV903X_MAX_FRAMERS; framerIdx++) + { + framerSel = 1U << framerIdx; + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, + (adi_adrv903x_FramerSel_e) framerSel, + &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + return recoveryAction; + } + + /* Get the lane crossbar selection */ + for (laneIdx = 0U; laneIdx < ADI_ADRV903X_MAX_SERDES_LANES; ++laneIdx) + { + laneBit = 1U << laneIdx; + recoveryAction = adrv903x_JtxLink_JtxForceLanePd_BfGet(device, + NULL, + framerBaseAddr, + laneIdx, + &lanePd); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane crossbar selection for the selected lane"); + return recoveryAction; + } + + + if (lanePd) /* LanePd is set, so it can be powered it down if it is not shared */ + { + if (framerSel & framerSelMask) + { + serdesNeedPowerDownBySelectedFramers |= laneBit; /* aggregate all lane serdes that need power down by selected framers */ + } + else + { + serdesUsedByUnselectedFramers |= laneBit; /* aggregate all lane serdes being used by unselected framers */ + } + } + } + } + + /* Exclude serdes that being used by unselected frames */ + serdesPowerDownSet = serdesNeedPowerDownBySelectedFramers & ~serdesUsedByUnselectedFramers; + + + /* Power down the serdes PHY based on serdesPowerDownSet */ + for (laneIdx = 0U; laneIdx < ADI_ADRV903X_MAX_SERDES_LANES; ++laneIdx) + { + laneBit = 1 << laneIdx; + if (laneBit & serdesPowerDownSet) + { + recoveryAction = (adi_adrv903x_ErrAction_e) adrv903x_FramerLaneSerdesPhyBitfieldAddressGet(device, + laneIdx, + &laneSerdesPhyBitfieldAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane serdes PHY address."); + return recoveryAction; + } + + recoveryAction = adrv903x_SerdesTxdigPhyRegmapCore1p2_PdSer_BfSet(device, + NULL, + laneSerdesPhyBitfieldAddr, + PHY_POWER_DOWN); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to change power down serdes PHY."); + return recoveryAction; + } + } + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_DeframerLaneSerdesPowerSet(adi_adrv903x_Device_t* const device, + const uint8_t deframerSelMask, + const uint8_t powerAct) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + uint8_t deframerSel = 0U; + uint8_t deframerIdx = 0U; + uint8_t serdesNeedPowerDownBySelectedDeframers = 0U; + uint8_t serdesUsedByUnselectedDeframers = 0U; + uint8_t serdesPowerDownSet = 0U; + uint8_t laneIdx = 0U; + uint8_t laneBit = 0U; + uint8_t dataByte = 0U; + uint8_t pLane = 0U; + uint8_t j = 0U; + uint8_t deserPhyPowerBit = 0U; + uint8_t numberofLaneL = 0U; + uint8_t deserPhyPowerSetMask = 0x0FU; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Prepare for framers enabling case */ + if (powerAct) + { + for (deframerIdx = 0U; deframerIdx < ADI_ADRV903X_MAX_DEFRAMERS; deframerIdx++) + { + deframerSel = 1U << deframerIdx; + /* Skip unselected deframer */ + if ((deframerSel & deframerSelMask) == 0U) + { + continue; + } + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, + (adi_adrv903x_DeframerSel_e) deframerSel, + &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + return recoveryAction; + } + + recoveryAction = adrv903x_JrxLink_JrxCoreLCfg_BfGet(device, + NULL, + deframerBaseAddr, + &numberofLaneL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of lane"); + return recoveryAction; + } + + /* Read the current deserializer power status for all lanes*/ + recoveryAction = adrv903x_SerdesRxdig8packRegmapCore1p2_RxdesPdCh_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK, + &deserPhyPowerSetMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading deserializer Phy power status"); + return recoveryAction; + } + + /* Get the lane crossbar selection */ + for (laneIdx = 0U; laneIdx < ADI_ADRV903X_MAX_SERDES_LANES; ++laneIdx) + { + for (j = 0U; j < numberofLaneL; j++) + { + recoveryAction = adrv903x_JrxLink_JrxCoreLaneSel_BfGet(device, + NULL, + deframerBaseAddr, + j, + &dataByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading Jrx Core Lane Sel field"); + return recoveryAction; + } + + if (dataByte == laneIdx) + { + deserPhyPowerBit |= 1U << laneIdx; + break; + } + } + } + } + + /* Exclude serdes that being used by unselected frames */ + deserPhyPowerSetMask &= ~deserPhyPowerBit; /* Clear the corresponding bit to power up */ + recoveryAction = adrv903x_SerdesRxdig8packRegmapCore1p2_RxdesPdCh_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK, + deserPhyPowerSetMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to change lane deserdes PHY power."); + return recoveryAction; + } + + /* The power up was done above */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; + } + + /* Prepare for deframers disabling case */ + for (deframerIdx = 0U; deframerIdx < ADI_ADRV903X_MAX_DEFRAMERS; deframerIdx++) + { + deframerSel = 1U << deframerIdx; + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, + (adi_adrv903x_DeframerSel_e) deframerSel, + &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + return recoveryAction; + } + + /* Get the number of logical lanes */ + recoveryAction = adrv903x_JrxLink_JrxCoreLCfg_BfGet(device, + NULL, + deframerBaseAddr, + &numberofLaneL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of lane"); + return recoveryAction; + } + + /* Get the lane crossbar selection */ + for (laneIdx = 0U; laneIdx < ADI_ADRV903X_MAX_SERDES_LANES; ++laneIdx) + { + laneBit = 1U << laneIdx; + pLane = 0U; + for (j = 0U; j < numberofLaneL; j++) + { + recoveryAction = adrv903x_JrxLink_JrxCoreLaneSel_BfGet(device, + NULL, + deframerBaseAddr, + j, + &dataByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading Jrx Core Lane Sel field"); + return recoveryAction; + } + + if (dataByte == laneIdx) + { + pLane = 1U; + break; + } + } + + if (pLane == 1U) + { + if (deframerSel & deframerSelMask) + { + serdesNeedPowerDownBySelectedDeframers |= laneBit; /* aggregate all lane serdes that need power down by selected deframers */ + } + else + { + serdesUsedByUnselectedDeframers |= laneBit; /* aggregate all lane serdes being used by unselected deframers */ + } + } + } + } + + /* Read the current deserializer power status for all lanes*/ + recoveryAction = adrv903x_SerdesRxdig8packRegmapCore1p2_RxdesPdCh_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK, + &deserPhyPowerSetMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading deserializer Phy power status"); + return recoveryAction; + } + + /* Exclude serdes that being used by unselected frames */ + serdesPowerDownSet = serdesNeedPowerDownBySelectedDeframers & ~serdesUsedByUnselectedDeframers; + + /* Prepare for serdes power bit mask.*/ + deserPhyPowerSetMask &= ~serdesPowerDownSet; /* Clear the corresponding bit to power up */ + + recoveryAction = adrv903x_SerdesRxdig8packRegmapCore1p2_RxdesPdCh_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK, + deserPhyPowerSetMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to power down lane deserdes PHY."); + return recoveryAction; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_FramerLaneEnableGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + adi_adrv903x_FramerCfg_t* const framerCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + uint8_t dataByte = 0U; + uint8_t laneId = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, framerCfg); + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, framerSel, &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + return recoveryAction; + } + + /* Get the lane crossbar selection */ + framerCfg->serializerLanesEnabled = 0; + for (laneId = 0U; laneId < ADI_ADRV903X_MAX_SERDES_LANES; ++laneId) + { + recoveryAction = adrv903x_JtxLink_JtxLaneSel_BfGet(device, + NULL, + framerBaseAddr, + laneId, + &dataByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane crossbar selection for the selected framer"); + return recoveryAction; + } + + framerCfg->serializerLanePdCrossbar.laneFramerOutSel[laneId] = 0x08U; /* assigned to out of range value */ + if (dataByte < 0x1FU) + { + framerCfg->serializerLanesEnabled |= (0x1U << laneId); + /* Get the physical lane in use based on link and crossbar configuration */ + framerCfg->serializerLanePdCrossbar.laneFramerOutSel[laneId] = dataByte; + } + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_DeframerLaneEnableGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DeframerCfg_t* const deframerCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + uint8_t dataByte = 0U; + uint8_t laneId = 0U; + uint8_t cfgLvalue = 0U; + uint8_t cfgM = 0U; + uint8_t cfgK = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, deframerCfg); + + /* Initialization */ + deframerCfg->deserializerLanesEnabled = 0U; + for (laneId = 0U; laneId < ADI_ADRV903X_MAX_SERDES_LANES; ++laneId) + { + deframerCfg->deserializerLaneCrossbar.deframerInputLaneSel[laneId] = 0x08U; /* assigned to out of range value */ + } + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + return recoveryAction; + } + + /* Get deframer L value */ + recoveryAction = adrv903x_JrxLink_JrxCoreLCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgLvalue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG L cfg for the selected deframer"); + return recoveryAction; + } + + /* Check if deframer link has lane configured or not */ + if (cfgLvalue == 0U) + { + /* get M - Number of converters per device */ + recoveryAction = adrv903x_JrxLink_JrxCoreMCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgM); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of converters per device"); + return recoveryAction; + } + + /* get K - Number of frames in extended multiblock */ + recoveryAction = adrv903x_JrxLink_JrxCoreKCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of frames in extended multiblock"); + return recoveryAction; + } + + if ((cfgM == 0U) && (cfgK == 0U)) + { + /* Link has no lane configured */ + return recoveryAction; + } + /* Link has 1 lane */ + } + + /* Get the lane crossbar selection */ + for (laneId = 0U; laneId < ADI_ADRV903X_MAX_SERDES_LANES; ++laneId) + { + recoveryAction = adrv903x_JrxLink_JrxCoreLaneSel_BfGet(device, + NULL, + deframerBaseAddr, + laneId, + &dataByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane crossbar selection"); + return recoveryAction; + } + + if (laneId <= cfgLvalue) + { + if (dataByte < 0x1FU) + { + deframerCfg->deserializerLanesEnabled |= (0x1U << laneId); + /* Get the physical lane in use based on link and crossbar configuration */ + deframerCfg->deserializerLaneCrossbar.deframerInputLaneSel[laneId] = dataByte; + } + } + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RadClkDividerValueCalculate(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e channelSelect, + const adi_adrv903x_RxOrxDataCaptureLocation_e loc, + uint8_t* value) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t ratio = 0U; /* ratio can be as high as 128; must be a power of 2 */ + uint8_t divN = 0U; /* divN is log2(ratio) */ + uint8_t rxOutputRateIndex = 11U; /* initialize the index to be out of range */ + uint8_t idx = 1U; + uint32_t tgtSampleRate = 0U; + const uint8_t MAXBIT = 8U; /* number of bits to use when calculating log base 2 */ + const uint8_t MAXRATEINDEX = 9U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + if (loc == ADI_ADRV903X_CAPTURE_LOC_DDC0 || + loc == ADI_ADRV903X_CAPTURE_LOC_DDC1 || + loc == ADI_ADRV903X_CAPTURE_LOC_DATAPATH) + { + switch (channelSelect) + { + case ADI_ADRV903X_RXOFF: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelSelect, "Invalid channel selected for capture or readback"); + break; + case ADI_ADRV903X_RX0: + rxOutputRateIndex = 0U; + break; + case ADI_ADRV903X_RX1: + rxOutputRateIndex = 1U; + break; + case ADI_ADRV903X_RX2: + rxOutputRateIndex = 2U; + break; + case ADI_ADRV903X_RX3: + rxOutputRateIndex = 3U; + break; + case ADI_ADRV903X_RX4: + rxOutputRateIndex = 4U; + break; + case ADI_ADRV903X_RX5: + rxOutputRateIndex = 5U; + break; + case ADI_ADRV903X_RX6: + rxOutputRateIndex = 6U; + break; + case ADI_ADRV903X_RX7: + rxOutputRateIndex = 7U; + break; + case ADI_ADRV903X_ORX0: + rxOutputRateIndex = 8U; + break; + case ADI_ADRV903X_ORX1: + rxOutputRateIndex = 9U; + break; + default : + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelSelect, "Invalid channel selected for capture or readback"); + break; + } + } + if (rxOutputRateIndex <= MAXRATEINDEX) + { + /* Make sure divide by zero doesn't happen */ + if (rxOutputRateIndex == 9U) /* ORx 1 */ + { + if (device->initExtract.orx.orxChannelCfg[1].orxOutputRate_kHz > 0U) + { + tgtSampleRate = device->initExtract.orx.orxChannelCfg[1].orxOutputRate_kHz; + ratio = device->initExtract.clocks.hsDigClk_kHz / tgtSampleRate; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + } + else if (rxOutputRateIndex == 8U) /* ORx 0 */ + { + if (device->initExtract.orx.orxChannelCfg[0].orxOutputRate_kHz > 0U) + { + tgtSampleRate = device->initExtract.orx.orxChannelCfg[0].orxOutputRate_kHz; + ratio = device->initExtract.clocks.hsDigClk_kHz / tgtSampleRate; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + } + else + { + if (loc == ADI_ADRV903X_CAPTURE_LOC_DDC0) + { + tgtSampleRate = device->initExtract.rx.rxChannelCfg[rxOutputRateIndex].rxDdc0OutputRate_kHz; + ratio = device->initExtract.clocks.hsDigClk_kHz / tgtSampleRate; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + else if (loc == ADI_ADRV903X_CAPTURE_LOC_DDC1) + { + tgtSampleRate = device->initExtract.rx.rxChannelCfg[rxOutputRateIndex].rxDdc1OutputRate_kHz; + ratio = device->initExtract.clocks.hsDigClk_kHz / tgtSampleRate; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelSelect, "Invalid location selected for the selected channel"); + } + } + } + else + { + ratio = 1U; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + /* The divider ratio is a 3 bit value and only divides by powers of 2. Check the ratio here and + * return an error if the current configuration requires other than a power of 2 division. + */ + if (ratio != 1 && /* divide by 2 to the power of 0 */ + ratio != 2 && /* divide by 2 to the power of 1 */ + ratio != 4 && /* divide by 2 to the power of 2 */ + ratio != 8 && /* divide by 2 to the power of 3 */ + ratio != 16 && /* divide by 2 to the power of 4 */ + ratio != 32 && /* divide by 2 to the power of 5 */ + ratio != 64 && /* divide by 2 to the power of 6 */ + ratio != 128) /* divide by 2 to the power of 7 */ + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "The current clock configuration does not permit the correct sampling of data using internal capture memory"); + } + if (ADI_ADRV903X_ERR_ACT_NONE == recoveryAction) + { + /* compute log 2 */ + for (idx = 0U; idx <= MAXBIT; idx++) + { + if (ratio >>= 1) + { + divN++; + } + } + *value = divN; + } + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_StatusRegisterPoll(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e channelSelect, + uint8_t* const bCptBusy) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t statusRegister = 0U; + const uint32_t bitfieldMask = 0xFFFF0000U; /* The bitfield function uses the slice base address to access the capture status registers */ + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + switch (channelSelect) + { + case ADI_ADRV903X_RX0: + statusRegister = ADRV903X_ADDR_TX0_CPT_STATUS & bitfieldMask; /* the bitfield get function needs the slice base address */ + break; + case ADI_ADRV903X_RX1: + statusRegister = ADRV903X_ADDR_TX1_CPT_STATUS & bitfieldMask; + break; + case ADI_ADRV903X_RX2: + statusRegister = ADRV903X_ADDR_TX2_CPT_STATUS & bitfieldMask; + break; + case ADI_ADRV903X_RX3: + statusRegister = ADRV903X_ADDR_TX3_CPT_STATUS & bitfieldMask; + break; + case ADI_ADRV903X_RX4: + statusRegister = ADRV903X_ADDR_TX4_CPT_STATUS & bitfieldMask; + break; + case ADI_ADRV903X_RX5: + statusRegister = ADRV903X_ADDR_TX5_CPT_STATUS & bitfieldMask; + break; + case ADI_ADRV903X_RX6: + statusRegister = ADRV903X_ADDR_TX6_CPT_STATUS & bitfieldMask; + break; + case ADI_ADRV903X_RX7: + statusRegister = ADRV903X_ADDR_TX7_CPT_STATUS & bitfieldMask; + break; + case ADI_ADRV903X_ORX0: + statusRegister = ADRV903X_ADDR_ORX0_CPT_STATUS0 & bitfieldMask; + break; + case ADI_ADRV903X_ORX1: + statusRegister = ADRV903X_ADDR_ORX1_CPT_STATUS0 & bitfieldMask; + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, statusRegister, "Invalid capture status register chosen for readback"); + break; + } + if (channelSelect == ADI_ADRV903X_ORX0 || + channelSelect == ADI_ADRV903X_ORX1) + { + recoveryAction = adrv903x_OrxDig_CptBusy_BfGet(device, + NULL, + (adrv903x_BfOrxDigChanAddr_e) statusRegister, + bCptBusy); + } + else + { + recoveryAction = adrv903x_TxDig_TxCptBusy_BfGet(device, + NULL, + (adrv903x_BfTxDigChanAddr_e) statusRegister, + bCptBusy); + } + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from the capture status register capture busy bitfield"); + } + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_JrxRepairScreenTestChecker(adi_adrv903x_Device_t* const device, + uint8_t* const screenID) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + const uint8_t numRetries = 5U; + uint8_t regValue = 0U; + uint32_t efuseData = 0U; + uint32_t i = 0U; + + static const uint8_t EFUSE_READ_ADDRESS = 0x09U; + static const uint8_t EFUSE_READ_CONTROL = 0x19U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Read ready bit. It needs to be 1 */ + recoveryAction = adi_adrv903x_ProductIdGet(device, ®Value); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Efuse Product Id"); + return recoveryAction; + } + + /* Write Efuse Read Address */ + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_EFUSE_READ_ADDR, &EFUSE_READ_ADDRESS, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write Efuse Read control register"); + return recoveryAction; + } + + /* Start read command */ + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_EFUSE_READ_CTRL, &EFUSE_READ_CONTROL, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write Efuse Read control register"); + return recoveryAction; + } + + /* Wait for Data Valid and Read State */ + for (i = 0U; i < numRetries; i++) + { + recoveryAction = adrv903x_Core_EfuseReadDataValid_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ®Value); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read Efuse Data Valid status"); + return recoveryAction; + } + + if (regValue == 1U) + { + recoveryAction = adrv903x_Core_EfuseReadState_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ®Value); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read Efuse Read State status"); + return recoveryAction; + } + + if (regValue == 1U) + { + break; + } + } + } + + if (regValue == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Unable to read Efuse Data"); + return recoveryAction; + } + + /* Read Efuse Data */ + recoveryAction = adrv903x_Core_EfuseReadData_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &efuseData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read Efuse Data"); + return recoveryAction; + } + + /* get CM screen bit */ + *screenID = (uint8_t)((efuseData >> 16U) & 0x01U); + + return recoveryAction; +} +ADI_API adi_adrv903x_ErrAction_e adrv903x_GetJtxLanePoweredDown(adi_adrv903x_Device_t* const device, + adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e const laneSerdesPhyBitfieldAddr, + uint8_t* const phyLanePd) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + uint8_t pdSer = 0U; + uint8_t serEnRc = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, phyLanePd); + + recoveryAction = adrv903x_SerdesTxdigPhyRegmapCore1p2_PdSer_BfGet(device, + NULL, + laneSerdesPhyBitfieldAddr, + &pdSer); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to read phy lane pd"); + return recoveryAction; + } + + if (pdSer == 1U) + { + /* Lane is in h/w power-down; No need to fetch SerEnRc */ + *phyLanePd = 1U; + return recoveryAction; + } + + recoveryAction = adrv903x_SerdesTxdigPhyRegmapCore1p2_SerEnRc_BfGet(device, + NULL, + laneSerdesPhyBitfieldAddr, + &serEnRc); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to read phy lane s/w power up"); + return recoveryAction; + } + + /* serEnRc bitfield indicates lane powered up. Return value must indicate power *down* */ + *phyLanePd = (uint8_t) !serEnRc; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_DeframerCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const adi_adrv903x_TxChannels_e chanSel, + adi_adrv903x_DeframerCfg_t* const deframerCfg, + const bool bBypass, + const bool bParamScaling) +{ + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + uint8_t enabledDeframers = 0U; + uint8_t laneIdx = 0U; + uint8_t deframerIdx = 0U; + uint8_t tmpByte = 0U; + uint8_t interleavingEnabled; + + /* Get all deframers link state */ + recoveryAction = adrv903x_JesdCommon_JrxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &enabledDeframers); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get deframer link state failed"); + return recoveryAction; + } + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + return recoveryAction; + } + + /* Get the Deframer IQ Rate and Lane Rate */ + switch ((int32_t) deframerSel) + { + case ADI_ADRV903X_DEFRAMER_0: + deframerIdx = 0; + break; + + case ADI_ADRV903X_DEFRAMER_1: + deframerIdx = 1; + break; + } + + interleavingEnabled = device->initExtract.jesdSetting.deframerSetting[deframerIdx].interleavingEnabled; + + /* Get the deframer link type */ + recoveryAction = adrv903x_JrxLink_JrxLinkType_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->enableJesd204C); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link type for the selected deframer"); + return recoveryAction; + } + + /* Bank ID for Jrx is not available, assign it to zero */ + deframerCfg->bankId = 0; + + /* Get the deframer device ID */ + recoveryAction = adrv903x_JrxLink_JrxCoreDidCfg_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->deviceId); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get device ID for the selected deframer"); + return recoveryAction; + } + + /* Get the deframer lane ID */ + for (laneIdx = 0U; laneIdx < ADI_ADRV903X_MAX_DESERIALIZER_LANES; laneIdx++) + { + recoveryAction = adrv903x_JrxLink_JrxCoreLidCfg_BfGet(device, + NULL, + deframerBaseAddr, + laneIdx, + &deframerCfg->laneId[laneIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane ID for the selected deframer"); + return recoveryAction; + } + } + + /* get M - Number of converters per device */ + recoveryAction = adrv903x_JrxLink_JrxCoreMCfg_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->jesd204M); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of converters per device"); + return recoveryAction; + } + ++deframerCfg->jesd204M; + if (interleavingEnabled && bParamScaling) + { + deframerCfg->jesd204M *= 4; + } + + /* get K - Number of frames in extended multiblocks */ + recoveryAction = adrv903x_JrxLink_JrxCoreKCfg_BfGet(device, + NULL, + deframerBaseAddr, + &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of frames in extended multiblocks"); + return recoveryAction; + } + + deframerCfg->jesd204K = tmpByte + 1; + if (interleavingEnabled && bParamScaling) + { + deframerCfg->jesd204K /= 4; + } + + /* get Np - Total number of bits per sample */ + recoveryAction = adrv903x_JrxLink_JrxCoreNpCfg_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->jesd204Np); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get total number of bits per sample"); + return recoveryAction; + } + ++deframerCfg->jesd204Np; + + /* get F - Number of octets per frame per lane*/ + recoveryAction = adrv903x_JrxLink_JrxCoreFCfg_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->jesd204F); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of octets per frame per lane"); + return recoveryAction; + } + ++deframerCfg->jesd204F; + if (interleavingEnabled && bParamScaling) + { + deframerCfg->jesd204F *= 4; + } + + /* get E - Number of multiblocks in extended multiblocks */ + /* This parameter is only valid for Jesd204C */ + deframerCfg->jesd204E = 0; + if (deframerCfg->enableJesd204C == 1) + { + recoveryAction = adrv903x_JrxLink_JrxCoreECfg_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->jesd204E); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of multiblocks in extended multiblocks"); + return recoveryAction; + } + } + + /* get descrambling enabled */ + recoveryAction = adrv903x_JrxLink_JrxCoreDscrCfg_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->decrambling); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get descrambling enabled"); + return recoveryAction; + } + + /* Get the lane crossbar selection and physical lane crossbar */ + recoveryAction = adrv903x_DeframerLaneEnableGet(device, deframerSel, deframerCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane crossbar selection and physical lane"); + return recoveryAction; + } + + /* get global LMFC phase adjustment */ + recoveryAction = adrv903x_JrxLink_JrxCorePhaseAdjust_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->lmfcOffset); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get global LMFC phase adjustment"); + return recoveryAction; + } + + /* get sync Out Cmos Drive strength for both SyncOut0 and SyncOut1 */ + recoveryAction = adrv903x_Core_SyncOut0CmosTxDriveStrength_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &deframerCfg->syncbOut0CmosDriveStrength); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get syncbOut0CmosDriveStrength"); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_SyncOut1CmosTxDriveStrength_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &deframerCfg->syncbOut1CmosDriveStrength); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get syncbOut1CmosDriveStrength"); + return recoveryAction; + } + + /* get sync out select */ + recoveryAction = adrv903x_JrxLink_JrxCoreSyncNSel_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->syncbOutSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get sync out select"); + return recoveryAction; + } + + /* Should be 0, 1, 2, or 3 */ + if (deframerCfg->syncbOutSelect > 3U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid syncbOutSelect value."); + return recoveryAction; + } + + /* Re-encode syncbOutSelect to 0: pin-0, 1: pin-1, 2: both pins, 3: no pin selected */ + if (deframerCfg->syncbOutSelect == 0U) + { + deframerCfg->syncbOutSelect = 3U; + } + else + { + deframerCfg->syncbOutSelect -= 1U; + } + + /* If any pin selected */ + if (deframerCfg->syncbOutSelect != 3U) + { + /* get syncbOut Lvds mode */ + recoveryAction = adrv903x_Core_SyncOutLvdsAndCmosEnable_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &deframerCfg->syncbOutLvdsMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get syncbOut Lvds mode"); + return recoveryAction; + } + + /* get lvds pin invert */ + recoveryAction = adrv903x_Core_SyncOutLvdsPnInvert_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &deframerCfg->syncbOutLvdsPnInvert); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lvds pin invert"); + return recoveryAction; + } + + /* Case link-0 or both link-0 and link-1 selected */ + if ((deframerCfg->syncbOutSelect == 0U) || (deframerCfg->syncbOutSelect == 2U)) + { + deframerCfg->syncbOutLvdsMode = deframerCfg->syncbOutLvdsMode & 0x01U; + deframerCfg->syncbOutLvdsPnInvert = deframerCfg->syncbOutLvdsPnInvert & 0x01U; + } + else if (deframerCfg->syncbOutSelect == 1U) /* Case only link-1 selected */ + { + deframerCfg->syncbOutLvdsMode = (deframerCfg->syncbOutLvdsMode >> 1U) & 0x01U; + deframerCfg->syncbOutLvdsPnInvert = (deframerCfg->syncbOutLvdsPnInvert >> 1U) & 0x01U; + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid 'syncbOutSelect', should be 0-2"); + return recoveryAction; + } + } + + /* get Deframer output to DAC mapping */ + recoveryAction = adrv903x_DacSampleXbarGet(device, + deframerSel, + &deframerCfg->dacCrossbar); + (void)bBypass; + (void)chanSel; + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get dacCrossbar"); + return recoveryAction; + } + + /* get sysref on relink enable */ + recoveryAction = adrv903x_JrxLink_JrxCoreSysrefForRelink_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->newSysrefOnRelink); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get sysref on relink enable"); + return recoveryAction; + } + + /* get sysrefForStartup */ + recoveryAction = adrv903x_JrxLink_JrxCoreSysrefForStartup_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->sysrefForStartup); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get sysrefForStartup"); + return recoveryAction; + } + + /* get sysrefNhot Enable*/ + recoveryAction = adrv903x_JrxLink_JrxCoreSysrefNShotEnable_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->sysrefNShotEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get sysrefNhot enable"); + return recoveryAction; + } + + /* get sysrefNshotCount */ + recoveryAction = adrv903x_JrxLink_JrxCoreSysrefNShotCount_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->sysrefNShotCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get sysrefNshotCount"); + return recoveryAction; + } + + /* get sysrefIgnoreWhenLinked*/ + recoveryAction = adrv903x_JrxLink_JrxCoreSysrefIgnoreWhenLinked_BfGet(device, + NULL, + deframerBaseAddr, + &deframerCfg->sysrefIgnoreWhenLinked); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get sysrefIgnoreWhenLinked"); + return recoveryAction; + } + + deframerCfg->iqRate_kHz = device->initExtract.jesdSetting.deframerSetting[deframerIdx].iqRate_kHz; + deframerCfg->laneRate_kHz = device->initExtract.jesdSetting.deframerSetting[deframerIdx].laneRate_kHz; + + return ADI_ADRV903X_ERR_ACT_NONE; + +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_DacSampleXbarGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DacSampleXbarCfg_t* const dacXbar) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + uint8_t bfValue = 0U; + uint8_t dacIdx = 0U; + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + return recoveryAction; + } + + for (dacIdx = 0U; dacIdx < ADI_ADRV903X_NUM_DAC_SAMPLE_XBAR; dacIdx++) + { + /* Get the sample xbar converter */ + recoveryAction = adrv903x_JrxLink_JrxCoreConvSel_BfGet(device, + NULL, + deframerBaseAddr, + dacIdx, + &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get sample xbar converter."); + return recoveryAction; + } + + dacXbar->txDacChan[dacIdx] = (adi_adrv903x_DacSampleXbarSel_e) bfValue; + } + + return ADI_ADRV903X_ERR_ACT_NONE; + +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_gpio.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_gpio.c new file mode 100644 index 0000000000000..99bb28f27829c --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_gpio.c @@ -0,0 +1,3751 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_gpio.c + * \brief Contains ADRV903X gpio helper-utility related private function implementations + * + * ADRV903X API Version: 2.12.1.4 + */ + +#include "../../private/include/adrv903x_gpio.h" +#include "../../private/include/adrv903x_shared_resource_manager.h" +#include "../../private/include/adrv903x_rx.h" +#include "../../private/include/adrv903x_tx.h" +#include "../../private/bf/adrv903x_bf_core.h" +#include "../../private/bf/adrv903x_bf_rx_dig.h" +#include "../../private/bf/adrv903x_bf_orx_dig.h" +#include "../../private/bf/adrv903x_bf_tx_dig.h" + + #include "adi_adrv903x_gpio.h" + + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_GPIO + +/**************************************************************************** + * High Level GPIO Utility Functions + **************************************************************************** + */ + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioSignalGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + adi_adrv903x_GpioSignal_e* const signal, + uint32_t* const channelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_SharedResourceID_e sharedResourceID = ADRV903X_SHARED_RESOURCE_INVALID; + adrv903x_FeatureID_e featureID = ADRV903X_FEATURE_UNUSED; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, signal); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, channelMask); + + /* Range check gpio */ + if ((gpio < ADI_ADRV903X_GPIO_00) || + (gpio >= ADI_ADRV903X_GPIO_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Get the current feature for this gpio from the SRM */ + sharedResourceID = (adrv903x_SharedResourceID_e)gpio; + recoveryAction = adrv903x_SharedResourceFeatureGet(device, sharedResourceID, &featureID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while retrieving feature for selected GPIO"); + return recoveryAction; + } + + /* Convert SRM feature to the associated gpio signal */ + recoveryAction = adrv903x_FromFeatureToSignalGet(device, featureID, signal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while retrieving signal for selected GPIO"); + return recoveryAction; + } + + /* Get channelMask from SRM */ + recoveryAction = adrv903x_SharedResourceChannelMaskGet(device, sharedResourceID, channelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while getting channelMask"); + return recoveryAction; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioSignalFind(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioPinSel_e* const gpio, + const adi_adrv903x_GpioSignal_e signal, + const adi_adrv903x_Channels_e channelSel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_GpioSignal_e readbackSignal = ADI_ADRV903X_GPIO_SIGNAL_INVALID; + uint32_t readbackChannelMask = (uint32_t)ADI_ADRV903X_CHOFF; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, gpio); + + uint8_t gpioIterator = 0U; + + /* If this function returns INVALID gpio, it means selected signal isn't mapped to any GPIO */ + *gpio = ADI_ADRV903X_GPIO_INVALID; + + /* Range check signal. */ + if ((signal <= ADI_ADRV903X_GPIO_SIGNAL_UNUSED) || + (signal >= ADI_ADRV903X_GPIO_SIGNAL_NUM_SIGNALS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + signal, + "Invalid signal selected. Out of range."); + return recoveryAction; + } + + if ((channelSel != ADI_ADRV903X_CHOFF) && + (channelSel != ADI_ADRV903X_CH0) && + (channelSel != ADI_ADRV903X_CH1) && + (channelSel != ADI_ADRV903X_CH2) && + (channelSel != ADI_ADRV903X_CH3) && + (channelSel != ADI_ADRV903X_CH4) && + (channelSel != ADI_ADRV903X_CH5) && + (channelSel != ADI_ADRV903X_CH6) && + (channelSel != ADI_ADRV903X_CH7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + channelSel, + "Invalid channel selected"); + return recoveryAction; + } + + /* Check all GPIOs until we find the matching signal */ + for (gpioIterator = 0U; gpioIterator < (uint8_t)ADI_ADRV903X_GPIO_INVALID; gpioIterator++) + { + recoveryAction = adrv903x_GpioSignalGet(device, + (adi_adrv903x_GpioPinSel_e)gpioIterator, + &readbackSignal, + &readbackChannelMask); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read signal for selected GPIO"); + return recoveryAction; + } + + if ((readbackSignal == signal) && + (((readbackChannelMask & (uint32_t)channelSel) != 0U) || (readbackChannelMask == (uint32_t)channelSel))) + { + *gpio = (adi_adrv903x_GpioPinSel_e)gpioIterator; + break; + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioSignalRelease(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const adi_adrv903x_GpioSignal_e signal, + const uint32_t channelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_GpioSignal_e initSignal = ADI_ADRV903X_GPIO_SIGNAL_UNUSED; + uint32_t initChannelMask = 0U; + adrv903x_FeatureID_e featureID = ADRV903X_FEATURE_UNUSED; + adrv903x_SharedResourceID_e sharedResourceID = ADRV903X_SHARED_RESOURCE_INVALID; + uint8_t resourceStatus = ADI_FAILURE; + uint8_t channelIdx = 0U; + adrv903x_GpioSignalInfo_t info = { ADI_ADRV903X_GPIO_SIGNAL_UNUSED, ADRV903X_GPIO_DOMAIN_NONE, ADRV903X_GPIO_ROUTE_OFF, 0U, 0U, 0 }; + uint8_t isValid = ADI_FALSE; + + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Range check gpio */ + if ((gpio < ADI_ADRV903X_GPIO_00) || + (gpio >= ADI_ADRV903X_GPIO_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Range check signal. */ + if ((signal <= ADI_ADRV903X_GPIO_SIGNAL_UNUSED) || + (signal >= ADI_ADRV903X_GPIO_SIGNAL_NUM_SIGNALS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + signal, + "Invalid signal selected. Out of range."); + return recoveryAction; + } + + /* Get signal info struct */ + recoveryAction = adrv903x_GpioSignalInfoGet(device, signal, &info); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while obtaining signal info"); + return recoveryAction; + } + + /* Check that this signal is a digital gpio signal domain */ + if ((info.domain != ADRV903X_GPIO_DOMAIN_DIGITAL) && + (info.domain != ADRV903X_GPIO_DOMAIN_NONE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + info.domain, + "Selected GPIO signal is not valid for digital GPIO pins"); + return recoveryAction; + } + + /* Check channelMask validity for this signal's route type */ + recoveryAction = adrv903x_GpioRouteValidChannelMaskCheck( device, info.route, channelMask, &isValid ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while checking validity of channel Mask for GPIO signal"); + return recoveryAction; + } + if ( isValid == ADI_FALSE ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + channelMask, + "Selected channelMask is not valid for selected GPIO signal"); + return recoveryAction; + } + + /* Get the feature for the signal */ + recoveryAction = adrv903x_FromSignalToFeatureGet(device, signal, &featureID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while feature for selected signal"); + return recoveryAction; + } + + /* Read the current signal for this gpio. Getter function will range check gpio */ + recoveryAction = adrv903x_GpioSignalGet(device, gpio, &initSignal, &initChannelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while retrieving current signal for the selected gpio"); + return recoveryAction; + } + + /* If gpio is unused, then do nothing */ + if (initSignal == ADI_ADRV903X_GPIO_SIGNAL_UNUSED) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + /* If gpio is being used, then continue */ + else + { + /* signal is not channel instanced. Disconnect in hardware */ + if ( channelMask == 0U ) + { + /* Disconnect signal from GPIO in hardware */ + recoveryAction = adrv903x_GpioConnect( device, ADI_DISABLE, gpio, &info, 0U ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while disconnecting GPIO from signal"); + return recoveryAction; + } + + /* Release the shared resource for the feature */ + sharedResourceID = (adrv903x_SharedResourceID_e)gpio; + recoveryAction = adrv903x_SharedResourceRelease(device, sharedResourceID, featureID, &resourceStatus); + if ((recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) || + (resourceStatus != ADI_SUCCESS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while attempting to release shared resource"); + return recoveryAction; + } + } + + /* signal is channel-instanced, Disconnect selected channels in hardware */ + else + { + for ( channelIdx = 0U; channelIdx < 8U; channelIdx++ ) + { + if ( ((channelMask >> channelIdx) & 1U) == 1U ) + { + /* Disconnect signal/chIdx from GPIO in hardware */ + recoveryAction = adrv903x_GpioConnect( device, ADI_DISABLE, gpio, &info, channelIdx ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while disconnecting GPIO from signal"); + return recoveryAction; + } + + /* Release the shared resource for the feature */ + sharedResourceID = (adrv903x_SharedResourceID_e)gpio; + recoveryAction = adrv903x_SharedResourceRelease(device, sharedResourceID, featureID, &resourceStatus); + if ((recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) || + (resourceStatus != ADI_SUCCESS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while attempting to release shared resource"); + return recoveryAction; + } + + /* Update channelMask by clearing bit for this channelIdx. Save channelMask */ + initChannelMask &= ~(1U << channelIdx); + recoveryAction = adrv903x_SharedResourceChannelMaskSet(device, sharedResourceID, initChannelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while set channelMask"); + return recoveryAction; + } + } /* end of ifblock for channel included in channelMask */ + + } /* end channel idx for loop */ + } /* end else block for channel-indexed signals */ + } /* end else block for a used GPIO */ + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioSignalSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const adi_adrv903x_GpioSignal_e signal, + const uint32_t channelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t isValid = ADI_FALSE; + uint32_t pinRequest = 1U; + adi_adrv903x_GpioPinSel_e prevGpio = ADI_ADRV903X_GPIO_INVALID; + adrv903x_SharedResourceID_e sharedResourceID = ADRV903X_SHARED_RESOURCE_INVALID; + adrv903x_FeatureID_e featureID = ADRV903X_FEATURE_UNUSED; + adi_adrv903x_GpioSignal_e initSig = ADI_ADRV903X_GPIO_SIGNAL_UNUSED; + uint32_t initChannelMask = 0U; + uint8_t channelIdx = 0U; + uint32_t chanSel = 0U; + adrv903x_GpioSignalInfo_t info = { ADI_ADRV903X_GPIO_SIGNAL_UNUSED, ADRV903X_GPIO_DOMAIN_NONE, ADRV903X_GPIO_ROUTE_OFF, 0U, 0U, 0 }; + uint8_t resourceStatus = ADI_FAILURE; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Range check gpio */ + if ((gpio < ADI_ADRV903X_GPIO_00) || + (gpio >= ADI_ADRV903X_GPIO_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Range check signal. */ + if ((signal <= ADI_ADRV903X_GPIO_SIGNAL_UNUSED) || + (signal >= ADI_ADRV903X_GPIO_SIGNAL_NUM_SIGNALS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + signal, + "Invalid signal selected. Out of range."); + return recoveryAction; + } + + /* Get signal info struct */ + /* Run checks against selected gpio channelMask */ + recoveryAction = adrv903x_GpioSignalInfoGet(device, signal, &info); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while obtaining signal info"); + return recoveryAction; + } + + /* Check that this signal is a digital gpio signal domain */ + if (info.domain != ADRV903X_GPIO_DOMAIN_DIGITAL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + info.domain, + "Selected GPIO signal is not valid for digital GPIO pins"); + return recoveryAction; + } + + /* Check that the user selected a gpio pin allowed by the select signal's pinMask */ + pinRequest = (1U << (uint32_t)(gpio)); + if ( (pinRequest & info.pinMask) != pinRequest) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Selected GPIO cannot be used to route the requested signal."); + return recoveryAction; + } + + /* Check channelMask validity for this signal's route type */ + recoveryAction = adrv903x_GpioRouteValidChannelMaskCheck( device, info.route, channelMask, &isValid ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while checking validity of channel Mask for GPIO signal"); + return recoveryAction; + } + if ( isValid == ADI_FALSE ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + channelMask, + "Selected channelMask is not valid for selected GPIO signal"); + return recoveryAction; + } + + /* Get SRM featureID that maps to the requested signal */ + recoveryAction = adrv903x_FromSignalToFeatureGet( device, signal, &featureID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while feature for selected signal"); + return recoveryAction; + } + + /* If signal is not channel-instanced, release any other GPIO currently routing sig that are about to be set */ + if ( channelMask == 0U ) + { + recoveryAction = adrv903x_GpioSignalFind( device, &prevGpio, signal, ADI_ADRV903X_CHOFF ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while finding GPIO routing selected signal"); + return recoveryAction; + } + + /* If prevGpio shows a pin other than the target is routing the signal, release it */ + if ( (prevGpio != ADI_ADRV903X_GPIO_INVALID) && (prevGpio != gpio) ) + { + recoveryAction = adrv903x_GpioSignalRelease( device, prevGpio, signal, channelMask ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while finding GPIO routing selected signal"); + return recoveryAction; + } + } + + /* if prevGpio was not the target, connect the signal to target */ + if (prevGpio != gpio) + { + + /* Call GpioSignalGet() for target GPIO. If UNUSED, setup. Else failure. */ + recoveryAction = adrv903x_GpioSignalGet( device, gpio, &initSig, &initChannelMask ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error retrieving current status of target GPIO"); + return recoveryAction; + } + if ( initSig != ADI_ADRV903X_GPIO_SIGNAL_UNUSED ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. GPIO already in use by another signal"); + return recoveryAction; + } + + /* Acquire Shared Resource */ + sharedResourceID = (adrv903x_SharedResourceID_e)gpio; + resourceStatus = ADI_FAILURE; + recoveryAction = adrv903x_SharedResourceAcquire(device, sharedResourceID, featureID, &resourceStatus); + if ((recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) || + (resourceStatus != ADI_SUCCESS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while acquiring shared resource"); + return recoveryAction; + } + + /* Save channelMask */ + recoveryAction = adrv903x_SharedResourceChannelMaskSet(device, sharedResourceID, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while set channelMask"); + return recoveryAction; + } + + /* Connect signal to GPIO in hardware */ + recoveryAction = adrv903x_GpioConnect( device, ADI_ENABLE, gpio, &info, 0U ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while connecting GPIO to signal"); + return recoveryAction; + } + } + } + + /* If channel-instanced signal, release any other GPIO currently routing EACH sig/chan that are about to be set */ + else + { + for (channelIdx = 0U; channelIdx < 8U; channelIdx++) + { + chanSel = 1U << channelIdx; + if ( ((channelMask >> channelIdx) & 1U) == 1U ) + { + /* This channel is in the channelMask. Search for GPIO to release */ + recoveryAction = adrv903x_GpioSignalFind(device, &prevGpio, signal, (adi_adrv903x_Channels_e)(chanSel)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while finding GPIO routing selected signal"); + return recoveryAction; + } + + /* If prevGpio shows a pin other than the target is routing the signal/chIdx, release it */ + if ( (prevGpio != ADI_ADRV903X_GPIO_INVALID) && (prevGpio != gpio) ) + { + recoveryAction = adrv903x_GpioSignalRelease( device, prevGpio, signal, (adi_adrv903x_Channels_e)(1U << channelIdx) ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while finding GPIO routing selected signal"); + return recoveryAction; + } + } + + /* if prevGpio was not the target, connect the signal/chIdx to target */ + if (prevGpio != gpio) + { + /* Call GpioSignalGet() for target GPIO. If UNUSED or already the target signal, setup. Else failure. */ + recoveryAction = adrv903x_GpioSignalGet( device, gpio, &initSig, &initChannelMask ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error retrieving current status of target GPIO"); + return recoveryAction; + } + if ( (initSig != ADI_ADRV903X_GPIO_SIGNAL_UNUSED) && + (initSig != signal ) ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. GPIO already in use by another signal"); + return recoveryAction; + } + + /* Acquire Shared Resource */ + sharedResourceID = (adrv903x_SharedResourceID_e)gpio; + resourceStatus = ADI_FAILURE; + recoveryAction = adrv903x_SharedResourceAcquire(device, sharedResourceID, featureID, &resourceStatus); + if ((recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) || + (resourceStatus != ADI_SUCCESS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while acquiring shared resource"); + return recoveryAction; + } + + /* Update chanelMask by setting bit for this channelIdx. Save channelMask */ + initChannelMask |= (1U << channelIdx); + recoveryAction = adrv903x_SharedResourceChannelMaskSet(device, sharedResourceID, initChannelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while set channelMask"); + return recoveryAction; + } + + /* Connect signal to GPIO in hardware */ + recoveryAction = adrv903x_GpioConnect( device, ADI_ENABLE, gpio, &info, channelIdx ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while finding connecting GPIO to signal"); + return recoveryAction; + } + } + + } /* end if block for channelMask including channelIdx */ + } /* end for loop over channelIdx */ + } /* end channel-instanced signal "else" block */ + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogSignalGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + adi_adrv903x_GpioSignal_e* const signal, + uint32_t* const channelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_SharedResourceID_e sharedResourceID = ADRV903X_SHARED_RESOURCE_INVALID; + uint32_t sharedResourceIdVal = 0U; + adrv903x_FeatureID_e featureID = ADRV903X_FEATURE_UNUSED; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, signal); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, channelMask); + + /* Range check gpio */ + if ((gpio < ADI_ADRV903X_GPIO_ANA_00) || + (gpio >= ADI_ADRV903X_GPIO_ANA_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Get the current feature for this gpio from the SRM */ + sharedResourceIdVal = (uint32_t)gpio + (uint32_t)ADRV903X_GPIO_ANA_00; + sharedResourceID = (adrv903x_SharedResourceID_e)(sharedResourceIdVal); + recoveryAction = adrv903x_SharedResourceFeatureGet(device, sharedResourceID, &featureID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while retrieving feature for selected GPIO"); + return recoveryAction; + } + + /* Convert SRM feature to the associated gpio signal */ + recoveryAction = adrv903x_FromFeatureToSignalGet(device, featureID, signal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while retrieving signal for selected GPIO"); + return recoveryAction; + } + + /* Get channelMask from SRM */ + recoveryAction = adrv903x_SharedResourceChannelMaskGet(device, sharedResourceID, channelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while get channelMask"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogSignalFind(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioAnaPinSel_e* const gpio, + const adi_adrv903x_GpioSignal_e signal, + const adi_adrv903x_Channels_e channelSel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_GpioSignal_e readbackSignal = ADI_ADRV903X_GPIO_SIGNAL_INVALID; + uint32_t readbackChannelMask = (uint32_t)ADI_ADRV903X_CHOFF; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, gpio); + + uint8_t gpioIterator = 0U; + + /* If this function returns INVALID gpio, it means selected signal isn't mapped to any GPIO */ + *gpio = ADI_ADRV903X_GPIO_ANA_INVALID; + + /* Range check signal. */ + if ((signal <= ADI_ADRV903X_GPIO_SIGNAL_UNUSED) || + (signal >= ADI_ADRV903X_GPIO_SIGNAL_NUM_SIGNALS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + signal, + "Invalid signal selected. Out of range."); + return recoveryAction; + } + + if ((channelSel != ADI_ADRV903X_CHOFF) && + (channelSel != ADI_ADRV903X_CH0) && + (channelSel != ADI_ADRV903X_CH1) && + (channelSel != ADI_ADRV903X_CH2) && + (channelSel != ADI_ADRV903X_CH3) && + (channelSel != ADI_ADRV903X_CH4) && + (channelSel != ADI_ADRV903X_CH5) && + (channelSel != ADI_ADRV903X_CH6) && + (channelSel != ADI_ADRV903X_CH7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + channelSel, + "Invalid channel selected"); + return recoveryAction; + } + + /* Check all GPIOs until we find the matching signal */ + for (gpioIterator = 0U; gpioIterator < (uint8_t)ADI_ADRV903X_GPIO_ANA_INVALID; gpioIterator++) + { + recoveryAction = adrv903x_GpioAnalogSignalGet( device, + (adi_adrv903x_GpioAnaPinSel_e)gpioIterator, + &readbackSignal, + &readbackChannelMask); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read signal for selected GPIO"); + return recoveryAction; + } + + if ((readbackSignal == signal) && + (((readbackChannelMask & (uint32_t)channelSel) != 0U) || (readbackChannelMask == (uint32_t)channelSel))) + { + *gpio = (adi_adrv903x_GpioAnaPinSel_e)gpioIterator; + break; + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogSignalRelease(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + const adi_adrv903x_GpioSignal_e signal, + const uint32_t channelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_GpioSignal_e initSignal = ADI_ADRV903X_GPIO_SIGNAL_UNUSED; + uint32_t initChannelMask = 0U; + adrv903x_FeatureID_e featureID = ADRV903X_FEATURE_UNUSED; + adrv903x_SharedResourceID_e sharedResourceID = ADRV903X_SHARED_RESOURCE_INVALID; + uint32_t sharedResourceIdVal = 0U; + uint8_t resourceStatus = ADI_FAILURE; + uint8_t channelIdx = 0U; + adrv903x_GpioSignalInfo_t info = { ADI_ADRV903X_GPIO_SIGNAL_UNUSED, ADRV903X_GPIO_DOMAIN_NONE, ADRV903X_GPIO_ROUTE_OFF, 0U, 0U, 0 }; + uint8_t isValid = ADI_FALSE; + + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Range check gpio */ + if ((gpio < ADI_ADRV903X_GPIO_ANA_00) || + (gpio >= ADI_ADRV903X_GPIO_ANA_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Range check signal. */ + if ((signal <= ADI_ADRV903X_GPIO_SIGNAL_UNUSED) || + (signal >= ADI_ADRV903X_GPIO_SIGNAL_NUM_SIGNALS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + signal, + "Invalid signal selected. Out of range."); + return recoveryAction; + } + + /* Get signal info struct */ + recoveryAction = adrv903x_GpioSignalInfoGet(device, signal, &info); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while obtaining signal info"); + return recoveryAction; + } + + /* Check that this signal is an analog gpio signal domain */ + if ((info.domain != ADRV903X_GPIO_DOMAIN_ANALOG) && + (info.domain != ADRV903X_GPIO_DOMAIN_NONE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + info.domain, + "Selected GPIO signal is not valid for analog GPIO pins"); + return recoveryAction; + } + + /* Check channelMask validity for this signal's route type */ + recoveryAction = adrv903x_GpioRouteValidChannelMaskCheck( device, info.route, channelMask, &isValid ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while checking validity of channel Mask for GPIO signal"); + return recoveryAction; + } + if ( isValid == ADI_FALSE ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + channelMask, + "Selected channelMask is not valid for selected GPIO signal"); + return recoveryAction; + } + + /* Get the feature for the signal */ + recoveryAction = adrv903x_FromSignalToFeatureGet(device, signal, &featureID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while feature for selected signal"); + return recoveryAction; + } + + /* Read the current signal for this gpio. Getter function will range check gpio */ + recoveryAction = adrv903x_GpioAnalogSignalGet(device, gpio, &initSignal, &initChannelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while retreiving current signal for the selected gpio"); + return recoveryAction; + } + + /* If gpio is unused, then do nothing */ + if (initSignal == ADI_ADRV903X_GPIO_SIGNAL_UNUSED) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + /* If gpio is being used, then continue */ + else + { + /* signal is not channel instanced. Disconnect in hardware */ + if ( channelMask == 0U ) + { + /* Disconnect signal from GPIO in hardware */ + recoveryAction = adrv903x_GpioAnalogConnect( device, ADI_DISABLE, gpio, &info, 0U ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while disconnecting GPIO from signal"); + return recoveryAction; + } + + /* Release the shared resource for the feature */ + sharedResourceIdVal = (uint32_t)gpio + (uint32_t)ADRV903X_GPIO_ANA_00; + sharedResourceID = (adrv903x_SharedResourceID_e)(sharedResourceIdVal); + recoveryAction = adrv903x_SharedResourceRelease(device, sharedResourceID, featureID, &resourceStatus); + if ((recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) || + (resourceStatus != ADI_SUCCESS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while attempting to release shared resource"); + return recoveryAction; + } + + } + + /* signal is channel-instanced, Disconnect selected channels in hardware */ + else + { + for ( channelIdx = 0U; channelIdx < 8U; channelIdx++ ) + { + if ( ((channelMask >> channelIdx) & 1U) == 1U ) + { + /* Disconnect signal/chIdx from GPIO in hardware */ + recoveryAction = adrv903x_GpioAnalogConnect( device, ADI_DISABLE, gpio, &info, channelIdx ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while disconnecting GPIO from signal"); + return recoveryAction; + } + + /* Release the shared resource for the feature */ + sharedResourceIdVal = (uint32_t)gpio + (uint32_t)ADRV903X_GPIO_ANA_00; + sharedResourceID = (adrv903x_SharedResourceID_e)(sharedResourceIdVal); + recoveryAction = adrv903x_SharedResourceRelease(device, sharedResourceID, featureID, &resourceStatus); + if ((recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) || + (resourceStatus != ADI_SUCCESS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while attempting to release shared resource"); + return recoveryAction; + } + + /* Update channelMask by clearing bit for this channelIdx. Save channelMask */ + initChannelMask &= ~(1U << channelIdx); + recoveryAction = adrv903x_SharedResourceChannelMaskSet(device, sharedResourceID, initChannelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while set channelMask"); + return recoveryAction; + } + } /* end of ifblock for channel included in channelMask */ + + } /* end channel idx for loop */ + } /* end else block for channel-indexed signals */ + } /* end else block for a used GPIO */ + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogSignalSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + const adi_adrv903x_GpioSignal_e signal, + const uint32_t channelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t isValid = ADI_FALSE; + uint32_t pinRequest = 1U; + adi_adrv903x_GpioAnaPinSel_e prevGpio = ADI_ADRV903X_GPIO_ANA_INVALID; + adrv903x_SharedResourceID_e sharedResourceID = ADRV903X_SHARED_RESOURCE_INVALID; + uint32_t sharedResourceIdVal = 0U; + adrv903x_FeatureID_e featureID = ADRV903X_FEATURE_UNUSED; + adi_adrv903x_GpioSignal_e initSig = ADI_ADRV903X_GPIO_SIGNAL_UNUSED; + uint32_t initChannelMask = 0U; + uint8_t channelIdx = 0U; + uint32_t chanSel = 0U; + adrv903x_GpioSignalInfo_t info = { ADI_ADRV903X_GPIO_SIGNAL_UNUSED, ADRV903X_GPIO_DOMAIN_NONE, ADRV903X_GPIO_ROUTE_OFF, 0U, 0U, 0 }; + uint8_t resourceStatus = ADI_FAILURE; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Range check gpio */ + if ((gpio < ADI_ADRV903X_GPIO_ANA_00) || + (gpio >= ADI_ADRV903X_GPIO_ANA_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Range check signal. */ + if ((signal <= ADI_ADRV903X_GPIO_SIGNAL_UNUSED) || + (signal >= ADI_ADRV903X_GPIO_SIGNAL_NUM_SIGNALS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + signal, + "Invalid signal selected. Out of range."); + return recoveryAction; + } + + /* Get signal info struct */ + recoveryAction = adrv903x_GpioSignalInfoGet(device, signal, &info); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while obtaining signal info"); + return recoveryAction; + } + + /* Check that this signal is in analog gpio signal domain */ + if (info.domain != ADRV903X_GPIO_DOMAIN_ANALOG) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + info.domain, + "Selected GPIO signal is not valid for analog GPIO pins"); + return recoveryAction; + } + + /* Check that the user selected a gpio/signal combination with a valid route */ + pinRequest = (1U << (uint32_t)(gpio)); + if ((pinRequest & info.pinMask) != pinRequest) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Selected GPIO cannot be used to route the requested signal."); + return recoveryAction; + } + + /* Check channelMask validity for this signal's route type */ + recoveryAction = adrv903x_GpioRouteValidChannelMaskCheck( device, info.route, channelMask, &isValid ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while checking validity of channel Mask for GPIO signal"); + return recoveryAction; + } + if ( isValid == ADI_FALSE ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + channelMask, + "Selected channelMask is not valid for selected GPIO signal"); + return recoveryAction; + } + + /* Get SRM featureID that maps to the requested signal */ + recoveryAction = adrv903x_FromSignalToFeatureGet( device, signal, &featureID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while feature for selected signal"); + return recoveryAction; + } + + /* If signal is not channel-instanced, release any other GPIO currently routing sig that are about to be set */ + if ( channelMask == 0U ) + { + recoveryAction = adrv903x_GpioAnalogSignalFind(device, &prevGpio, signal, ADI_ADRV903X_CHOFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while finding GPIO routing selected signal"); + return recoveryAction; + } + + /* If prevGpio shows a pin other than the target is routing the signal, release it */ + if ( (prevGpio != ADI_ADRV903X_GPIO_ANA_INVALID) && (prevGpio != gpio) ) + { + recoveryAction = adrv903x_GpioAnalogSignalRelease( device, prevGpio, signal, channelMask ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while finding GPIO routing selected signal"); + return recoveryAction; + } + } + + /* if prevGpio was not the target, connect the signal to target */ + if (prevGpio != gpio) + { + + /* Call GpioAnalogSignalGet() for target GPIO. If UNUSED, setup. Else failure. */ + recoveryAction = adrv903x_GpioAnalogSignalGet( device, gpio, &initSig, &initChannelMask ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error retrieving current status of target GPIO"); + return recoveryAction; + } + if ( initSig != ADI_ADRV903X_GPIO_SIGNAL_UNUSED ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. GPIO already in use by another signal"); + return recoveryAction; + } + + /* Acquire Shared Resource */ + sharedResourceIdVal = (uint32_t)gpio + (uint32_t)ADRV903X_GPIO_ANA_00; + sharedResourceID = (adrv903x_SharedResourceID_e)(sharedResourceIdVal); + resourceStatus = ADI_FAILURE; + recoveryAction = adrv903x_SharedResourceAcquire(device, sharedResourceID, featureID, &resourceStatus); + if ((recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) || + (resourceStatus != ADI_SUCCESS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while acquiring shared resource"); + return recoveryAction; + } + + /* Save channelMask */ + recoveryAction = adrv903x_SharedResourceChannelMaskSet(device, sharedResourceID, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while set channelMask"); + return recoveryAction; + } + + /* Connect signal to GPIO in hardware */ + recoveryAction = adrv903x_GpioAnalogConnect( device, ADI_ENABLE, gpio, &info, 0U ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while connecting GPIO to signal"); + return recoveryAction; + } + } + } + + /* If channel-instanced signal, release any other GPIO currently routing EACH sig/chan that are about to be set */ + else + { + for (channelIdx = 0U; channelIdx < 8U; channelIdx++) + { + if ( ((channelMask >> channelIdx) & 1U) == 1U ) + { + chanSel = 1U << channelIdx; + /* This channel is in the channelMask. Search for GPIO to release */ + recoveryAction = adrv903x_GpioAnalogSignalFind(device, &prevGpio, signal, (adi_adrv903x_Channels_e)(chanSel)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while finding GPIO routing selected signal"); + return recoveryAction; + } + + /* If prevGpio shows a pin other than the target is routing the signal/chIdx, release it */ + if ( (prevGpio != ADI_ADRV903X_GPIO_ANA_INVALID) && (prevGpio != gpio) ) + { + recoveryAction = adrv903x_GpioAnalogSignalRelease( device, prevGpio, signal, (adi_adrv903x_Channels_e)(1U << channelIdx) ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while finding GPIO routing selected signal"); + return recoveryAction; + } + } + + /* if prevGpio was not the target, connect the signal/chIdx to target */ + if (prevGpio != gpio) + { + /* Call GpioSignalGet() for target GPIO. If UNUSED or already the target signal, setup. Else failure. */ + recoveryAction = adrv903x_GpioAnalogSignalGet( device, gpio, &initSig, &initChannelMask ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error retrieving current status of target GPIO"); + return recoveryAction; + } + if ( (initSig != ADI_ADRV903X_GPIO_SIGNAL_UNUSED) && + (initSig != signal ) ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. GPIO already in use by another signal"); + return recoveryAction; + } + + /* Acquire Shared Resource */ + sharedResourceIdVal = (uint32_t)gpio + (uint32_t)ADRV903X_GPIO_ANA_00; + sharedResourceID = (adrv903x_SharedResourceID_e)(sharedResourceIdVal); + resourceStatus = ADI_FAILURE; + recoveryAction = adrv903x_SharedResourceAcquire(device, sharedResourceID, featureID, &resourceStatus); + if ((recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) || + (resourceStatus != ADI_SUCCESS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while acquiring shared resource"); + return recoveryAction; + } + + /* Update chanelMask by setting bit for this channelIdx. Save channelMask */ + initChannelMask |= (1U << channelIdx); + recoveryAction = adrv903x_SharedResourceChannelMaskSet(device, sharedResourceID, initChannelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while set channelMask"); + return recoveryAction; + } + + /* Connect signal to GPIO in hardware */ + recoveryAction = adrv903x_GpioAnalogConnect( device, ADI_ENABLE, gpio, &info, channelIdx ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while finding connecting GPIO to signal"); + return recoveryAction; + } + } + + } /* end if block for channelMask including channelIdx */ + } /* end for loop over channelIdx */ + } /* end channel-instanced signal "else" block */ + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioMonitorOutSignalValidCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioSignal_e signal, + const uint8_t channel, + uint8_t* const isValidFlag, + uint32_t* const channelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_GpioSignalInfo_t info = { ADI_ADRV903X_GPIO_SIGNAL_UNUSED, ADRV903X_GPIO_DOMAIN_NONE, ADRV903X_GPIO_ROUTE_OFF, 0U, 0U, 0 }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, isValidFlag); + + /* Range check signal */ + if ((signal <= ADI_ADRV903X_GPIO_SIGNAL_UNUSED) || + (signal >= ADI_ADRV903X_GPIO_SIGNAL_NUM_SIGNALS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, signal, "Invalid signal selected. Out of range."); + return recoveryAction; + } + + /* Get signal info struct */ + recoveryAction = adrv903x_GpioSignalInfoGet(device, signal, &info); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while obtaining signal info"); + return recoveryAction; + } + + /* Check if signal/channel is a monitor output using the route */ + switch (info.route) + { + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL: + /* this route type is valid. channel is not used so ignore it */ + *isValidFlag = ADI_TRUE; + if (channelMask != NULL) + { + *channelMask = 0U; + } + break; + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX: /* FALLTHROUGH */ + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX: + /* these route types are valid, but channel must be in range 0-7 */ + *isValidFlag = (channel < ADI_ADRV903X_MAX_TXCHANNELS) ? ADI_TRUE : ADI_FALSE; + if(channelMask != NULL) + { + *channelMask = (1U << channel); + } + break; + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_ORX: + /* these route types are valid, but channel must be in range 0-1 */ + *isValidFlag = (channel < ADI_ADRV903X_MAX_ORX_ONLY) ? ADI_TRUE : ADI_FALSE; + if (channelMask != NULL) + { + *channelMask = (1U << channel); + } + break; + default: + *isValidFlag = ADI_FALSE; + if (channelMask != NULL) + { + *channelMask = 0U; + } + break; + } + + return recoveryAction; +} + + +/**************************************************************************** + * Low Level GPIO Utility Helper Functions + **************************************************************************** + */ +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioSignalInfoGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioSignal_e signal, + adrv903x_GpioSignalInfo_t* const info) +{ + /* GPIO Signal Info LUT. Maps GPIO signal to feature, domain type, route type, pinMask, topSelect, and targetSelect */ + static const adrv903x_GpioSignalInfo_t gpioSignalLut[] = { + { ADI_ADRV903X_GPIO_SIGNAL_UNUSED, ADRV903X_GPIO_DOMAIN_NONE, ADRV903X_GPIO_ROUTE_OFF, 0x00FFFFFFU, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_SDIO, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00002001U, 1U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_SDO, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00004002U, 1U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_CLK, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00008004U, 1U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_CSB, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00010008U, 1U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_UART_PADRXSIN, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000200U, 1U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_UART_PADCTS, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000400U, 1U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_UART_PADRTSOUT, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000800U, 1U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_UART_PADTXSOUT, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00001000U, 1U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000001U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000002U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000004U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000008U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000010U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000020U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000040U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000080U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000100U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000200U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000400U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_11, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000800U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_12, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00001000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_13, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00002000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_14, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00004000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_15, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00008000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_16, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00010000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_17, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00020000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_18, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00040000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_19, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00080000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_20, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00100000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_21, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00200000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_22, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00400000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_23, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00800000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000001U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000002U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000004U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000008U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000010U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000020U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000040U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000080U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000100U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000200U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000400U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_11, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000800U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_12, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00001000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_13, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00002000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_14, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00004000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_15, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00008000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_16, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00010000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_17, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00020000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_18, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00040000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_19, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00080000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_20, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00100000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_21, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00200000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_22, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00400000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_23, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00800000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000001U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000002U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000004U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000008U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000010U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000020U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000040U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000080U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000100U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000200U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000400U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_11, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000800U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_12, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00001000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_13, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00002000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_14, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00004000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_15, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00008000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_16, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00010000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_17, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00020000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_18, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00040000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_19, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00080000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_20, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00100000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_21, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00200000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_22, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00400000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_23, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00800000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000001U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000002U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000004U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000008U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000010U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000020U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000040U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000080U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000100U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000200U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000400U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_11, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000800U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_12, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00001000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_13, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00002000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_14, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00004000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_15, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00008000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_16, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00010000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_17, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00020000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_18, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00040000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_19, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00080000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_20, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00100000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_21, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00200000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_22, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00400000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_23, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00800000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 0 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 1 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 2 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 3 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 4 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 5 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 6 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 7 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 8 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 9 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 10 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 11 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_PLL_LOCKED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 12 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_OVERRANGE_LOW_FLAG, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 13 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_OVERRANGE_HIGH_FLAG, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 14 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_COMP_OUT, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 15 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_CAL_IN_PROGRESS, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 16 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 17 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 18 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 19 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 20 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 21 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 22 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 23 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 24 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 25 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 26 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 27 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 28 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 29 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 30 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 31 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 32 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 33 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 34 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 35 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 36 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 37 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 38 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 39 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 40 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 41 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 42 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 43 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 44 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 45 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 46 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 47 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_11, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 48 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 49 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 50 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 51 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 52 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 53 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 54 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 55 }, + { ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 56 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 57 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 58 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 59 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 60 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 61 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 62 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 63 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 64 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 65 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 66 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 67 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 68 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_PLL_LOCKED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 69 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_OVERRANGE_LOW_FLAG, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 70 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_OVERRANGE_HIGH_FLAG, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 71 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_COMP_OUT, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 72 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_CAL_IN_PROGRESS, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 73 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 74 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 75 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 76 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 77 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 78 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 79 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 80 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 81 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 82 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 83 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 84 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 85 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 86 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 87 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 88 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 89 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 90 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 91 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 92 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 93 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 94 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 95 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 96 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 97 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 98 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 99 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 100 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 101 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 102 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 103 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 104 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_11, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 105 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 106 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 107 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 108 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 109 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 110 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 111 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 112 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 113 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 114 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 115 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 116 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 117 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 118 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 119 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 120 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 121 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 122 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 123 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 124 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 125 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_PLL_LOCKED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 126 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_OVERRANGE_LOW_FLAG, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 127 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_OVERRANGE_HIGH_FLAG, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 128 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_COMP_OUT, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 129 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_CAL_IN_PROGRESS, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 130 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 131 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 132 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 133 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 134 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 135 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 136 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 137 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 138 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 139 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 140 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 141 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 142 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 143 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 144 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 145 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 146 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 147 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 148 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 149 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 150 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 151 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 152 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 153 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 154 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 155 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 156 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 157 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 158 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 159 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 160 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 161 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_11, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 162 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 163 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 164 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 165 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 166 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 167 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 168 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 169 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 170 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 171 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 172 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 173 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 174 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 175 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 176 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 177 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 178 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 179 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 180 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 181 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 182 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 183 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 184 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 185 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 186 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_P_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 187 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_P_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 188 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_P_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 189 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_N_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 190 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_N_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 191 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_N_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 192 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 193 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 194 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 195 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 196 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 197 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 198 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 199 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 200 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 201 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 202 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 203 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 204 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 205 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 206 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 207 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 208 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_UPDATE_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 209 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_UPDATE_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 210 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_UPDATE_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 211 }, + { ADI_ADRV903X_GPIO_SIGNAL_CONTROL_UPDATE_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 212 }, + { ADI_ADRV903X_GPIO_SIGNAL_MCS_CLK_IND_CORE, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 213 }, + { ADI_ADRV903X_GPIO_SIGNAL_REF_CLK, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 214 }, + { ADI_ADRV903X_GPIO_SIGNAL_SPI_REG_ARM0_ERROR, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 215 }, + { ADI_ADRV903X_GPIO_SIGNAL_SPI_REG_ARM1_ERROR, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 216 }, + { ADI_ADRV903X_GPIO_SIGNAL_DIG_POWERGOOD, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 217 }, + { ADI_ADRV903X_GPIO_SIGNAL_MASTER_BIAS_CLK, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 218 }, + { ADI_ADRV903X_GPIO_SIGNAL_MBIAS_IGEN_PD_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 219 }, + { ADI_ADRV903X_GPIO_SIGNAL_MBIAS_IGEN_PD_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 220 }, + { ADI_ADRV903X_GPIO_SIGNAL_MBIAS_COMP_OUT_ANA_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 221 }, + { ADI_ADRV903X_GPIO_SIGNAL_MBIAS_COMP_OUT_ANA_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 222 }, + { ADI_ADRV903X_GPIO_SIGNAL_SPI_REG_MBIAS_IGEN_PTATR_TRIM_DONE_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 223 }, + { ADI_ADRV903X_GPIO_SIGNAL_SPI_REG_MBIAS_IGEN_PTATR_TRIM_DONE_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 224 }, + { ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 225 }, + { ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 226 }, + { ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 227 }, + { ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 228 }, + { ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 229 }, + { ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 230 }, + { ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 231 }, + { ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 232 }, + { ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 233 }, + { ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 234 }, + { ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 235 }, + { ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_11, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 236 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 237 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 238 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 239 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 240 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 241 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 242 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 243 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 244 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 245 }, + { ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 246 }, + + { ADI_ADRV903X_GPIO_SIGNAL_NEW_PHASE_TOGGLE, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 247 }, + { ADI_ADRV903X_GPIO_SIGNAL_JESD_MCS_CLK_IND, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 248 }, + { ADI_ADRV903X_GPIO_SIGNAL_SERDES_PLL_PLL_LOCKED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 249 }, + { ADI_ADRV903X_GPIO_SIGNAL_SERDES_PLL_VCO_COMP_OUT, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 250 }, + { ADI_ADRV903X_GPIO_SIGNAL_POWER_ON_RESET_N, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL, 0x00FFFFFFU, 6U, 251 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 1 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 2 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 3 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 4 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 5 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 6 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 7 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 8 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 9 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 10 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 11 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_11, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 12 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_12, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 13 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_13, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 14 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_14, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 15 }, + { ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_15, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 16 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 17 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 18 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 19 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 20 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 21 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 22 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 23 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 24 }, + { ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 41 }, + { ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 42 }, + { ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 43 }, + { ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 44 }, + { ADI_ADRV903X_GPIO_SIGNAL_MCS_CLK_IND_RX, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 45 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFDC_UPDATE, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 46 }, + { ADI_ADRV903X_GPIO_SIGNAL_SLICER_OVERFLOW, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 47 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_SEC_HIGH, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 48 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_SEC_HIGH_COUNTER_EXCEEDED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 49 }, + { ADI_ADRV903X_GPIO_SIGNAL_TIA_VALID, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 50 }, + { ADI_ADRV903X_GPIO_SIGNAL_RXFE_VALID, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 51 }, + { ADI_ADRV903X_GPIO_SIGNAL_RSSI_DECPWR_READY, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 53 }, + { ADI_ADRV903X_GPIO_SIGNAL_PEAK_COUNT_EXCEEDED_QEC_ANA, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 54 }, + { ADI_ADRV903X_GPIO_SIGNAL_PEAK_COUNT_EXCEEDED_QEC_DIG, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 55 }, + { ADI_ADRV903X_GPIO_SIGNAL_RSSI_SYMBOL_READY, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 56 }, + { ADI_ADRV903X_GPIO_SIGNAL_RXON, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 57 }, + { ADI_ADRV903X_GPIO_SIGNAL_ADC_OVERLOAD_RESET_ADC, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 58 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFDC_STATE_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 59 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFDC_STATE_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 60 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFDC_STATE_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 61 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFDC_STATE_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 62 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFDC_UPDATE_COUNTER_EXPIRED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 63 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFDC_MEASURE, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 64 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFDC_CAL_DONE, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 65 }, + { ADI_ADRV903X_GPIO_SIGNAL_RFDC_MEASURE_COUNTER_EXPIRED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 66 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_LOW_INT1_COUNTER_EXCEEDED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 68 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_LOW_INT0_COUNTER_EXCEEDED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 69 }, + { ADI_ADRV903X_GPIO_SIGNAL_DIG_GAIN_SAT, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 70 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_INT1_LOW, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 71 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_INT0_LOW, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 72 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_SL_STATE_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 73 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_SL_STATE_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 74 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_GAINUPDATE_COUNTER_EXPIRED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 75 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_SL_LOW_TH_EXCEEDED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 76 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_SL_HIGH_TH_EXCEEDED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 77 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_LLB_COUNTER_EXCEEDED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 78 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_LOW, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 81 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_HIGH, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 82 }, + { ADI_ADRV903X_GPIO_SIGNAL_GT_GAIN_CHANGE, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 83 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_ULB_COUNTER_EXCEEDED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 84 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_LOW_COUNTER_EXCEEDED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 85 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_HIGH_COUNTER_EXCEEDED, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 86 }, + { ADI_ADRV903X_GPIO_SIGNAL_BAND_PEAK_COUNT_EXCEEDED_LOW_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 87 }, + { ADI_ADRV903X_GPIO_SIGNAL_BAND_PEAK_COUNT_EXCEEDED_LOW_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 88 }, + { ADI_ADRV903X_GPIO_SIGNAL_BAND_PEAK_COUNT_EXCEEDED_HIGH_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 89 }, + { ADI_ADRV903X_GPIO_SIGNAL_BAND_PEAK_COUNT_EXCEEDED_HIGH_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 90 }, + { ADI_ADRV903X_GPIO_SIGNAL_BAND_DECPWR_READY_TOGGLE_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 91 }, + { ADI_ADRV903X_GPIO_SIGNAL_BAND_DECPWR_READY_TOGGLE_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 92 }, + { ADI_ADRV903X_GPIO_SIGNAL_BAND_DECPWR_READY_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 93 }, + { ADI_ADRV903X_GPIO_SIGNAL_BAND_DECPWR_READY_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX, 0x00FFFFFFU, 7U, 94 }, + { ADI_ADRV903X_GPIO_SIGNAL_MCS_CLK_IND_TX, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PA_PROT_SRERROR, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 2 }, + { ADI_ADRV903X_GPIO_SIGNAL_PA_PROT_PPERROR_OR_APERROR, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 3 }, + { ADI_ADRV903X_GPIO_SIGNAL_ATTEN_RAMP_UP_PROT, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 4 }, + { ADI_ADRV903X_GPIO_SIGNAL_ATTEN_RAMP_DOWN_PROT, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 5 }, + { ADI_ADRV903X_GPIO_SIGNAL_ATTEN_TDD_RAMP_DOWN, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 6 }, + { ADI_ADRV903X_GPIO_SIGNAL_ATTEN_TDD_RAMP_UP, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 7 }, + { ADI_ADRV903X_GPIO_SIGNAL_ATTEN_LATCH_EN, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 8 }, + { ADI_ADRV903X_GPIO_SIGNAL_DTX_POWER_UP_TRIGGER, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 9 }, + { ADI_ADRV903X_GPIO_SIGNAL_DTX_POWER_DOWN_TRIGGER, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 10 }, + { ADI_ADRV903X_GPIO_SIGNAL_TX_GAIN_CHANGE, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 11 }, + { ADI_ADRV903X_GPIO_SIGNAL_TX_POWER_READY, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 12 }, + { ADI_ADRV903X_GPIO_SIGNAL_PA_PROT_SRD_IRQ, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 13 }, + { ADI_ADRV903X_GPIO_SIGNAL_TX_TSSI_DUC0_READY, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 14 }, + { ADI_ADRV903X_GPIO_SIGNAL_ADC_SAMPLE_OVR, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX, 0x00FFFFFFU, 8U, 15 }, + { ADI_ADRV903X_GPIO_SIGNAL_MCS_CLK_IND_ORX, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ORX, 0x00FFFFFFU, 9U, 1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ORX_ON, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ORX, 0x00FFFFFFU, 9U, 2 }, + { ADI_ADRV903X_GPIO_SIGNAL_DECPWR_READY, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ORX, 0x00FFFFFFU, 9U, 3 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANY_ADC_SAMPLE_OVR, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_ORX, 0x00FFFFFFU, 9U, 4 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00000001U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00000002U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00000004U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00000008U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00000010U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00000020U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00000040U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00000080U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00000100U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00000200U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00000400U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_11, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00000800U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_12, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00001000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_13, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00002000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_14, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00004000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_15, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00008000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_16, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00010000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_17, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00020000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_18, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00040000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_19, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00080000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_20, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00100000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_21, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00200000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_22, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00400000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_23, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG, 0x00800000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PEB, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00000008U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_CLK, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00000010U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00000020U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00000040U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00000080U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00000100U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00000200U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00000400U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00000800U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00001000U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00002000U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00004000U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00008000U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_11, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00010000U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_12, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00020000U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_13, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00040000U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_14, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00080000U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_15, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_PPI, 0x00100000U, 0U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ADC_TEST_GEN_ENABLE, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_RX, 0x00FFFFFEU, 0U, 0 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_GAIN_CHANGE, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_RX, 0x00FFFFFEU, 0U, 1 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_DEC_GAIN, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_RX, 0x00FFFFFEU, 0U, 2 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_INC_GAIN, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_RX, 0x00FFFFFEU, 0U, 3 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_SLOWLOOP_FREEZE_ENABLE, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_RX, 0x00FFFFFEU, 0U, 4 }, + { ADI_ADRV903X_GPIO_SIGNAL_AGC_MANUAL_GAIN_LOCK, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_RX, 0x00FFFFFEU, 0U, 5 }, + { ADI_ADRV903X_GPIO_SIGNAL_SELECT_S1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_TX, 0x00FFFFFEU, 0U, 0 }, + { ADI_ADRV903X_GPIO_SIGNAL_DTX_FORCE_PIN, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_TX, 0x00FFFFFEU, 0U, 3 }, + { ADI_ADRV903X_GPIO_SIGNAL_TX_ATTEN_UPD_GPIO, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_DEST_TX, 0x00FFFFFEU, 0U, 4 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000001U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000002U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_2, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000004U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_3, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000008U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_4, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000010U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_5, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000020U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_6, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000040U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_7, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000080U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_8, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000100U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_9, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000200U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_10, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000400U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_11, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000800U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_12, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00001000U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_13, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00002000U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_14, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00004000U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_15, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00008000U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000001U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000002U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_2, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000004U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_3, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000008U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_4, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000010U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_5, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000020U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_6, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000040U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_7, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000080U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_8, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000100U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_9, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000200U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_10, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000400U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_11, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000800U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_12, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00001000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_13, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00002000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_14, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00004000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_15, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00008000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000001U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000002U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_2, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000004U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_3, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000008U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_4, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000010U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_5, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000020U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_6, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000040U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_7, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000080U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_8, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000100U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_9, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000200U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_10, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000400U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_11, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000800U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_12, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00001000U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_13, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00002000U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_14, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00004000U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_15, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00008000U, 3U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000001U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000002U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_2, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000004U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_3, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000008U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_4, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000010U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_5, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000020U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_6, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000040U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_7, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000080U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_8, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000100U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_9, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000200U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_10, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000400U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_11, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000800U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_12, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00001000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_13, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00002000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_14, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00004000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_15, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00008000U, 4U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX0_EXT_CONTROL_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000001U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX0_EXT_CONTROL_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000002U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX1_EXT_CONTROL_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000004U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX1_EXT_CONTROL_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000008U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX2_EXT_CONTROL_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000010U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX2_EXT_CONTROL_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000020U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX3_EXT_CONTROL_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000040U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX3_EXT_CONTROL_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000080U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX4_EXT_CONTROL_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000100U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX4_EXT_CONTROL_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000200U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX5_EXT_CONTROL_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000400U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX5_EXT_CONTROL_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000800U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX6_EXT_CONTROL_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00001000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX6_EXT_CONTROL_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00002000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX7_EXT_CONTROL_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00004000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX7_EXT_CONTROL_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00008000U, 5U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000001U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000002U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND1_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000004U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND1_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000008U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND0_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000010U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND0_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000020U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND1_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000040U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND1_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000080U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND0_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000100U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND0_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000200U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND1_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000400U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND1_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000800U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND0_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00001000U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND0_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00002000U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND1_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00004000U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND1_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00008000U, 6U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND0_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000001U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND0_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000002U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND1_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000004U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND1_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000008U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND0_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000010U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND0_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000020U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND1_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000040U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND1_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000080U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND0_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000100U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND0_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000200U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND1_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000400U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND1_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00000800U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND0_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00001000U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND0_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00002000U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND1_0, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00004000U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND1_1, ADRV903X_GPIO_DOMAIN_ANALOG, ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE, 0x00008000U, 7U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_0, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000001U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_1, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000002U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_2, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000004U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_3, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000008U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_4, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000010U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_5, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000020U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_6, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000040U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_7, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000080U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_8, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000100U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_9, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000200U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_10, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000400U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_11, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00000800U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_12, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00001000U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_13, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00002000U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_14, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00004000U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_15, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00008000U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_16, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00010000U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_17, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00020000U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_18, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00040000U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_19, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00080000U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_20, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00100000U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_21, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00200000U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_22, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00400000U, 15U, -1 }, + { ADI_ADRV903X_GPIO_SIGNAL_NOOP_23, ADRV903X_GPIO_DOMAIN_DIGITAL, ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE, 0x00800000U, 15U, -1 }, + }; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t numEntries = sizeof(gpioSignalLut) / sizeof(adrv903x_GpioSignalInfo_t); + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, info); + + /* Range Check that gpio signal is valid */ + if ((signal < ADI_ADRV903X_GPIO_SIGNAL_UNUSED) || + (signal >= ADI_ADRV903X_GPIO_SIGNAL_NUM_SIGNALS) || + (signal < 0) || + (signal >= numEntries)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + signal, + "Invalid gpio signal encountered in adrv903x_SignalInfoGet function. Out of range."); + return recoveryAction; + } + /* Check that LUT entry for index 'signal' has a signal field that matches exactly */ + else if ( gpioSignalLut[signal].signal != signal ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + signal, + "Invalid gpio signal encountered in adrv903x_SignalInfoGet function. Lookup failure."); + return recoveryAction; + } + /* Success. Get Signal Info */ + else + { + *info = gpioSignalLut[signal]; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_FromSignalToFeatureGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioSignal_e signal, + adrv903x_FeatureID_e* const featureID) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_FeatureID_e tmpFeature = ADRV903X_NUM_FEATURES; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, featureID); + + /* Check that signal is valid */ + if (( signal < ADI_ADRV903X_GPIO_SIGNAL_UNUSED) || + ( signal >= ADI_ADRV903X_GPIO_SIGNAL_NUM_SIGNALS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + signal, + "Invalid signal encountered in adrv903x_FromSignalToFeatureGet function"); + return recoveryAction; + } + + /* Range Check featureID when cast directly from signal. */ + /* Note: Though all signals have a 1-to-1 map to features, the converse is not true */ + tmpFeature = (adrv903x_FeatureID_e)((uint32_t) signal | GPIO_SIGNAL_FEATURE); + if (( tmpFeature < ADRV903X_FEATURE_UNUSED) || + ( tmpFeature >= ADRV903X_NUM_FEATURES)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + tmpFeature, + "Invalid featureID encountered in adrv903x_FromSignalToFeatureGet function"); + return recoveryAction; + } + /* Success. Set featureID */ + else + { + *featureID = tmpFeature; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_FromFeatureToSignalGet(adi_adrv903x_Device_t* const device, + const adrv903x_FeatureID_e featureID, + adi_adrv903x_GpioSignal_e* const signal) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_GpioSignal_e tmpSig = ADI_ADRV903X_GPIO_SIGNAL_NUM_SIGNALS; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, signal); + + /* Check that featureID is valid */ + if (( featureID < ADRV903X_FEATURE_UNUSED) || + ( featureID >= ADRV903X_NUM_FEATURES)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + featureID, + "Invalid featureID encountered in adrv903x_FromFeatureToSignalGet function"); + return recoveryAction; + } + + /* Range Check signal when cast directly from featureID. */ + /* Note: Though all signals have a 1-to-1 map to features, the converse is not true */ + tmpSig = (adi_adrv903x_GpioSignal_e)((uint32_t)featureID & ~GPIO_SIGNAL_FEATURE); + if (( tmpSig < ADI_ADRV903X_GPIO_SIGNAL_UNUSED) || + ( tmpSig >= ADI_ADRV903X_GPIO_SIGNAL_NUM_SIGNALS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + tmpSig, + "Invalid signal encountered in adrv903x_FromFeatureToSignalGet function"); + return recoveryAction; + } + /* Success. Set signal */ + else + { + *signal = tmpSig; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg3Set(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t gpioIdx = 0U; + adi_adrv903x_ErrAction_e(*bfSetter[(uint32_t)(ADI_ADRV903X_GPIO_INVALID)])(adi_adrv903x_Device_t*, adi_adrv903x_SpiCache_t*, adrv903x_BfCoreChanAddr_e, uint8_t) = { + adrv903x_Core_GpioSourceControl0_BfSet, + adrv903x_Core_GpioSourceControl1_BfSet, + adrv903x_Core_GpioSourceControl2_BfSet, + adrv903x_Core_GpioSourceControl3_BfSet, + adrv903x_Core_GpioSourceControl4_BfSet, + adrv903x_Core_GpioSourceControl5_BfSet, + adrv903x_Core_GpioSourceControl6_BfSet, + adrv903x_Core_GpioSourceControl7_BfSet, + adrv903x_Core_GpioSourceControl8_BfSet, + adrv903x_Core_GpioSourceControl9_BfSet, + adrv903x_Core_GpioSourceControl10_BfSet, + adrv903x_Core_GpioSourceControl11_BfSet, + adrv903x_Core_GpioSourceControl12_BfSet, + adrv903x_Core_GpioSourceControl13_BfSet, + adrv903x_Core_GpioSourceControl14_BfSet, + adrv903x_Core_GpioSourceControl15_BfSet, + adrv903x_Core_GpioSourceControl16_BfSet, + adrv903x_Core_GpioSourceControl17_BfSet, + adrv903x_Core_GpioSourceControl18_BfSet, + adrv903x_Core_GpioSourceControl19_BfSet, + adrv903x_Core_GpioSourceControl20_BfSet, + adrv903x_Core_GpioSourceControl21_BfSet, + adrv903x_Core_GpioSourceControl22_BfSet, + adrv903x_Core_GpioSourceControl23_BfSet + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check gpio is valid */ + if ( gpio >= ADI_ADRV903X_GPIO_INVALID ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Check muxSelect */ + if (muxSelect > ADRV903X_GPIO_PINMUX_STAGE3_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + muxSelect, + "Invalid mux input selected. Out of range."); + return recoveryAction; + } + + /* Set mux bitfield */ + gpioIdx = (uint32_t)(gpio); + recoveryAction = bfSetter[gpioIdx](device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + muxSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Pinmux Stg3 selection failure"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg3Get(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + uint8_t * const muxSelect) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t gpioIdx = 0U; + adi_adrv903x_ErrAction_e(*bfGetter[(uint32_t)(ADI_ADRV903X_GPIO_INVALID)])(adi_adrv903x_Device_t*, adi_adrv903x_SpiCache_t*, adrv903x_BfCoreChanAddr_e, uint8_t *) = { + adrv903x_Core_GpioSourceControl0_BfGet, + adrv903x_Core_GpioSourceControl1_BfGet, + adrv903x_Core_GpioSourceControl2_BfGet, + adrv903x_Core_GpioSourceControl3_BfGet, + adrv903x_Core_GpioSourceControl4_BfGet, + adrv903x_Core_GpioSourceControl5_BfGet, + adrv903x_Core_GpioSourceControl6_BfGet, + adrv903x_Core_GpioSourceControl7_BfGet, + adrv903x_Core_GpioSourceControl8_BfGet, + adrv903x_Core_GpioSourceControl9_BfGet, + adrv903x_Core_GpioSourceControl10_BfGet, + adrv903x_Core_GpioSourceControl11_BfGet, + adrv903x_Core_GpioSourceControl12_BfGet, + adrv903x_Core_GpioSourceControl13_BfGet, + adrv903x_Core_GpioSourceControl14_BfGet, + adrv903x_Core_GpioSourceControl15_BfGet, + adrv903x_Core_GpioSourceControl16_BfGet, + adrv903x_Core_GpioSourceControl17_BfGet, + adrv903x_Core_GpioSourceControl18_BfGet, + adrv903x_Core_GpioSourceControl19_BfGet, + adrv903x_Core_GpioSourceControl20_BfGet, + adrv903x_Core_GpioSourceControl21_BfGet, + adrv903x_Core_GpioSourceControl22_BfGet, + adrv903x_Core_GpioSourceControl23_BfGet + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, muxSelect); + + /* Check gpio is valid */ + if (gpio >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Set mux bitfield */ + gpioIdx = (uint32_t)(gpio); + recoveryAction = bfGetter[gpioIdx](device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + muxSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Reading Pinmux Stg3 failure"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg2RxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t gpioIdx = 0U; + adi_adrv903x_ErrAction_e(*bfSetter[(uint32_t)(ADI_ADRV903X_GPIO_INVALID)])(adi_adrv903x_Device_t*, adi_adrv903x_SpiCache_t*, adrv903x_BfCoreChanAddr_e, uint8_t) = { + adrv903x_Core_GpioSourceRxControl0_BfSet, + adrv903x_Core_GpioSourceRxControl1_BfSet, + adrv903x_Core_GpioSourceRxControl2_BfSet, + adrv903x_Core_GpioSourceRxControl3_BfSet, + adrv903x_Core_GpioSourceRxControl4_BfSet, + adrv903x_Core_GpioSourceRxControl5_BfSet, + adrv903x_Core_GpioSourceRxControl6_BfSet, + adrv903x_Core_GpioSourceRxControl7_BfSet, + adrv903x_Core_GpioSourceRxControl8_BfSet, + adrv903x_Core_GpioSourceRxControl9_BfSet, + adrv903x_Core_GpioSourceRxControl10_BfSet, + adrv903x_Core_GpioSourceRxControl11_BfSet, + adrv903x_Core_GpioSourceRxControl12_BfSet, + adrv903x_Core_GpioSourceRxControl13_BfSet, + adrv903x_Core_GpioSourceRxControl14_BfSet, + adrv903x_Core_GpioSourceRxControl15_BfSet, + adrv903x_Core_GpioSourceRxControl16_BfSet, + adrv903x_Core_GpioSourceRxControl17_BfSet, + adrv903x_Core_GpioSourceRxControl18_BfSet, + adrv903x_Core_GpioSourceRxControl19_BfSet, + adrv903x_Core_GpioSourceRxControl20_BfSet, + adrv903x_Core_GpioSourceRxControl21_BfSet, + adrv903x_Core_GpioSourceRxControl22_BfSet, + adrv903x_Core_GpioSourceRxControl23_BfSet + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check gpio is valid */ + if (gpio >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Check muxSelect */ + if (muxSelect > ADRV903X_GPIO_PINMUX_STAGE2_RX_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + muxSelect, + "Invalid mux input selected. Out of range."); + return recoveryAction; + } + + /* Set mux bitfield */ + gpioIdx = (uint32_t)(gpio); + recoveryAction = bfSetter[gpioIdx](device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + muxSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Pinmux Stg2 Rx selection failure"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg2TxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t gpioIdx = 0U; + adi_adrv903x_ErrAction_e(*bfSetter[(uint32_t)(ADI_ADRV903X_GPIO_INVALID)])(adi_adrv903x_Device_t*, adi_adrv903x_SpiCache_t*, adrv903x_BfCoreChanAddr_e, uint8_t) = { + adrv903x_Core_GpioSourceTxControl0_BfSet, + adrv903x_Core_GpioSourceTxControl1_BfSet, + adrv903x_Core_GpioSourceTxControl2_BfSet, + adrv903x_Core_GpioSourceTxControl3_BfSet, + adrv903x_Core_GpioSourceTxControl4_BfSet, + adrv903x_Core_GpioSourceTxControl5_BfSet, + adrv903x_Core_GpioSourceTxControl6_BfSet, + adrv903x_Core_GpioSourceTxControl7_BfSet, + adrv903x_Core_GpioSourceTxControl8_BfSet, + adrv903x_Core_GpioSourceTxControl9_BfSet, + adrv903x_Core_GpioSourceTxControl10_BfSet, + adrv903x_Core_GpioSourceTxControl11_BfSet, + adrv903x_Core_GpioSourceTxControl12_BfSet, + adrv903x_Core_GpioSourceTxControl13_BfSet, + adrv903x_Core_GpioSourceTxControl14_BfSet, + adrv903x_Core_GpioSourceTxControl15_BfSet, + adrv903x_Core_GpioSourceTxControl16_BfSet, + adrv903x_Core_GpioSourceTxControl17_BfSet, + adrv903x_Core_GpioSourceTxControl18_BfSet, + adrv903x_Core_GpioSourceTxControl19_BfSet, + adrv903x_Core_GpioSourceTxControl20_BfSet, + adrv903x_Core_GpioSourceTxControl21_BfSet, + adrv903x_Core_GpioSourceTxControl22_BfSet, + adrv903x_Core_GpioSourceTxControl23_BfSet + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check gpio is valid */ + if (gpio >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Check muxSelect */ + if (muxSelect > ADRV903X_GPIO_PINMUX_STAGE2_TX_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + muxSelect, + "Invalid mux input selected. Out of range."); + return recoveryAction; + } + + /* Set mux bitfield */ + gpioIdx = (uint32_t)(gpio); + recoveryAction = bfSetter[gpioIdx](device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + muxSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Pinmux Stg2 Tx selection failure"); + return recoveryAction; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg2OrxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t gpioIdx = 0U; + adi_adrv903x_ErrAction_e(*bfSetter[(uint32_t)(ADI_ADRV903X_GPIO_INVALID)])(adi_adrv903x_Device_t*, adi_adrv903x_SpiCache_t*, adrv903x_BfCoreChanAddr_e, uint8_t) = { + adrv903x_Core_GpioSourceOrxControl0_BfSet, + adrv903x_Core_GpioSourceOrxControl1_BfSet, + adrv903x_Core_GpioSourceOrxControl2_BfSet, + adrv903x_Core_GpioSourceOrxControl3_BfSet, + adrv903x_Core_GpioSourceOrxControl4_BfSet, + adrv903x_Core_GpioSourceOrxControl5_BfSet, + adrv903x_Core_GpioSourceOrxControl6_BfSet, + adrv903x_Core_GpioSourceOrxControl7_BfSet, + adrv903x_Core_GpioSourceOrxControl8_BfSet, + adrv903x_Core_GpioSourceOrxControl9_BfSet, + adrv903x_Core_GpioSourceOrxControl10_BfSet, + adrv903x_Core_GpioSourceOrxControl11_BfSet, + adrv903x_Core_GpioSourceOrxControl12_BfSet, + adrv903x_Core_GpioSourceOrxControl13_BfSet, + adrv903x_Core_GpioSourceOrxControl14_BfSet, + adrv903x_Core_GpioSourceOrxControl15_BfSet, + adrv903x_Core_GpioSourceOrxControl16_BfSet, + adrv903x_Core_GpioSourceOrxControl17_BfSet, + adrv903x_Core_GpioSourceOrxControl18_BfSet, + adrv903x_Core_GpioSourceOrxControl19_BfSet, + adrv903x_Core_GpioSourceOrxControl20_BfSet, + adrv903x_Core_GpioSourceOrxControl21_BfSet, + adrv903x_Core_GpioSourceOrxControl22_BfSet, + adrv903x_Core_GpioSourceOrxControl23_BfSet + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check gpio is valid */ + if (gpio >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Check muxSelect */ + if (muxSelect > ADRV903X_GPIO_PINMUX_STAGE2_ORX_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + muxSelect, + "Invalid mux input selected. Out of range."); + return recoveryAction; + } + + /* Set mux bitfield */ + gpioIdx = (uint32_t)(gpio); + recoveryAction = bfSetter[gpioIdx](device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + muxSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Pinmux Stg2 ORx selection failure"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg2ActrlSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint16_t muxSelect) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t gpioIdx = 0U; + adi_adrv903x_ErrAction_e(*bfSetter[(uint32_t)(ADI_ADRV903X_GPIO_INVALID)])(adi_adrv903x_Device_t*, adi_adrv903x_SpiCache_t*, adrv903x_BfCoreChanAddr_e, uint16_t) = { + adrv903x_Core_DataFromControlOutSel0_BfSet, + adrv903x_Core_DataFromControlOutSel1_BfSet, + adrv903x_Core_DataFromControlOutSel2_BfSet, + adrv903x_Core_DataFromControlOutSel3_BfSet, + adrv903x_Core_DataFromControlOutSel4_BfSet, + adrv903x_Core_DataFromControlOutSel5_BfSet, + adrv903x_Core_DataFromControlOutSel6_BfSet, + adrv903x_Core_DataFromControlOutSel7_BfSet, + adrv903x_Core_DataFromControlOutSel8_BfSet, + adrv903x_Core_DataFromControlOutSel9_BfSet, + adrv903x_Core_DataFromControlOutSel10_BfSet, + adrv903x_Core_DataFromControlOutSel11_BfSet, + adrv903x_Core_DataFromControlOutSel12_BfSet, + adrv903x_Core_DataFromControlOutSel13_BfSet, + adrv903x_Core_DataFromControlOutSel14_BfSet, + adrv903x_Core_DataFromControlOutSel15_BfSet, + adrv903x_Core_DataFromControlOutSel16_BfSet, + adrv903x_Core_DataFromControlOutSel17_BfSet, + adrv903x_Core_DataFromControlOutSel18_BfSet, + adrv903x_Core_DataFromControlOutSel19_BfSet, + adrv903x_Core_DataFromControlOutSel20_BfSet, + adrv903x_Core_DataFromControlOutSel21_BfSet, + adrv903x_Core_DataFromControlOutSel22_BfSet, + adrv903x_Core_DataFromControlOutSel23_BfSet + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check gpio is valid */ + if (gpio >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Check muxSelect */ + if (muxSelect > ADRV903X_GPIO_PINMUX_STAGE2_ACTRL_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + muxSelect, + "Invalid mux input selected. Out of range."); + return recoveryAction; + } + + /* Set mux bitfield */ + gpioIdx = (uint32_t)(gpio); + recoveryAction = bfSetter[gpioIdx](device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + muxSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Pinmux Stg2 Actrl selection failure"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg1RxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect, + const uint8_t channelIdx) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDigChanAddr_e baseAddr = ADRV903X_BF_SLICE_RX_0__RX_DIG; + uint8_t gpioIdx = 0U; + uint32_t chanSel = 0U; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check gpio is valid */ + if (gpio >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Check muxSelect */ + if (muxSelect > ADRV903X_GPIO_PINMUX_STAGE1_RX_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + muxSelect, + "Invalid mux input selected. Out of range."); + return recoveryAction; + } + + /* Get baseAddress for this channel */ + chanSel = 1U << channelIdx; + recoveryAction = adrv903x_RxBitfieldAddressGet(device, (adi_adrv903x_RxChannels_e)(chanSel), &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxBitfieldAddressGet issue"); + return recoveryAction; + } + + /* Set mux bitfield */ + gpioIdx = (uint8_t)(gpio); + recoveryAction = adrv903x_RxDig_RxGpioSourceSelection_BfSet(device, NULL, baseAddr, gpioIdx, muxSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Pinmux Stg1 Rx selection failure"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg1TxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect, + const uint8_t channelIdx) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxDigChanAddr_e baseAddr = ADRV903X_BF_SLICE_TX_0__TX_DIG; + uint32_t gpioIdx = 0U; + uint32_t chanSel = 0u; + adi_adrv903x_ErrAction_e(*bfSetter[(uint32_t)(ADI_ADRV903X_GPIO_INVALID)])(adi_adrv903x_Device_t*, adi_adrv903x_SpiCache_t*, adrv903x_BfTxDigChanAddr_e, uint8_t) = { + adrv903x_TxDig_TxGpioSourceSelection0_BfSet, + adrv903x_TxDig_TxGpioSourceSelection1_BfSet, + adrv903x_TxDig_TxGpioSourceSelection2_BfSet, + adrv903x_TxDig_TxGpioSourceSelection3_BfSet, + adrv903x_TxDig_TxGpioSourceSelection4_BfSet, + adrv903x_TxDig_TxGpioSourceSelection5_BfSet, + adrv903x_TxDig_TxGpioSourceSelection6_BfSet, + adrv903x_TxDig_TxGpioSourceSelection7_BfSet, + adrv903x_TxDig_TxGpioSourceSelection8_BfSet, + adrv903x_TxDig_TxGpioSourceSelection9_BfSet, + adrv903x_TxDig_TxGpioSourceSelection10_BfSet, + adrv903x_TxDig_TxGpioSourceSelection11_BfSet, + adrv903x_TxDig_TxGpioSourceSelection12_BfSet, + adrv903x_TxDig_TxGpioSourceSelection13_BfSet, + adrv903x_TxDig_TxGpioSourceSelection14_BfSet, + adrv903x_TxDig_TxGpioSourceSelection15_BfSet, + adrv903x_TxDig_TxGpioSourceSelection16_BfSet, + adrv903x_TxDig_TxGpioSourceSelection17_BfSet, + adrv903x_TxDig_TxGpioSourceSelection18_BfSet, + adrv903x_TxDig_TxGpioSourceSelection19_BfSet, + adrv903x_TxDig_TxGpioSourceSelection20_BfSet, + adrv903x_TxDig_TxGpioSourceSelection21_BfSet, + adrv903x_TxDig_TxGpioSourceSelection22_BfSet, + adrv903x_TxDig_TxGpioSourceSelection23_BfSet + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check gpio is valid */ + if (gpio >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Check muxSelect */ + if (muxSelect > ADRV903X_GPIO_PINMUX_STAGE1_TX_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + muxSelect, + "Invalid mux input selected. Out of range."); + return recoveryAction; + } + + /* Get baseAddress for this channel */ + chanSel = 1U << channelIdx; + recoveryAction = adrv903x_TxBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "TxBitfieldAddressGet issue"); + return recoveryAction; + } + + /* Set mux bitfield */ + gpioIdx = (uint32_t)(gpio); + recoveryAction = bfSetter[gpioIdx]( device, + NULL, + baseAddr, + muxSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Pinmux Stg1 Tx selection failure"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioPinmuxStg1OrxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t muxSelect, + const uint8_t channelIdx) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfOrxDigChanAddr_e baseAddr = ADRV903X_BF_SLICE_ORX_0__ORX_DIG; + uint32_t gpioIdx = 0U; + uint32_t chanSel = 0U; + adi_adrv903x_ErrAction_e(*bfSetter[(uint32_t)(ADI_ADRV903X_GPIO_INVALID)])(adi_adrv903x_Device_t*, adi_adrv903x_SpiCache_t*, adrv903x_BfOrxDigChanAddr_e, uint8_t) = { + adrv903x_OrxDig_OrxGpioSourceSelection0_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection1_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection2_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection3_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection4_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection5_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection6_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection7_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection8_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection9_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection10_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection11_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection12_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection13_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection14_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection15_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection16_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection17_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection18_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection19_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection20_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection21_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection22_BfSet, + adrv903x_OrxDig_OrxGpioSourceSelection23_BfSet + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check gpio is valid */ + if (gpio >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Check muxSelect */ + if (muxSelect > ADRV903X_GPIO_PINMUX_STAGE1_ORX_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + muxSelect, + "Invalid mux input selected. Out of range."); + return recoveryAction; + } + + /* Get baseAddress for this channel */ + chanSel = 0x100U << channelIdx; + recoveryAction = adrv903x_OrxBitfieldAddressGet(device, (adi_adrv903x_RxChannels_e)(chanSel), &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "OrBitfieldAddressGet issue"); + return recoveryAction; + } + + /* Set mux bitfield */ + gpioIdx = (uint32_t)(gpio); + recoveryAction = bfSetter[gpioIdx]( device, + NULL, + baseAddr, + muxSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Pinmux Stg1 ORx selection failure"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioIeOverride(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t override) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfCoreChanAddr_e baseAddr = (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR; + uint32_t lclMask = 0U; + uint32_t gpioIdx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check gpio is valid */ + if (gpio >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Check IE override bit is valid */ + if ((override != ADI_ENABLE) && + (override != ADI_DISABLE) ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + override, + "Invalid Input Enable override bit for a GPIO. Must be 0 or 1."); + return recoveryAction; + } + + /* Get current bitfield value */ + recoveryAction = adrv903x_Core_GpioSourceControlOverride_BfGet( device, + NULL, + baseAddr, + &lclMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read gpio source control override bf"); + return recoveryAction; + } + + /* Update mask bit for this gpio */ + gpioIdx = (uint32_t)(gpio); + lclMask |= (override << gpioIdx ); + + /* Update bitfield value */ + recoveryAction = adrv903x_Core_GpioSourceControlOverride_BfSet( device, + NULL, + baseAddr, + lclMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write gpio source control override bf"); + return recoveryAction; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioDestRxSet(adi_adrv903x_Device_t* const device, + const uint8_t destIdx, + const uint8_t channelIdx, + const uint8_t muxSelect) +{ + const uint8_t NUM_CHANS = 8U; + const uint8_t NUM_MUX_SELECTIONS = 24U; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDigChanAddr_e baseAddr = ADRV903X_BF_SLICE_RX_0__RX_DIG; + uint32_t chanSel = 0U; + adi_adrv903x_ErrAction_e(*bfSetter[ADRV903X_GPIO_NUM_DESTINATIONS_RX])(adi_adrv903x_Device_t*, adi_adrv903x_SpiCache_t*, adrv903x_BfRxDigChanAddr_e, uint8_t) = { + adrv903x_RxDig_TestGenEnGpioSelect_BfSet, + adrv903x_RxDig_AgcGainChangeGpioSelect_BfSet, + adrv903x_RxDig_AgcDecGainGpioSelect_BfSet, + adrv903x_RxDig_AgcIncGainGpioSelect_BfSet, + adrv903x_RxDig_AgcSlowloopFreezeEnableGpioSelect_BfSet, + adrv903x_RxDig_AgcManualGainLockGpioSelect_BfSet, + adrv903x_RxDig_RssiEnableGpioSelect_BfSet + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check inputs */ + if (destIdx >= ADRV903X_GPIO_NUM_DESTINATIONS_RX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + destIdx, + "Invalid destination index specified for setting Rx channel destination"); + return recoveryAction; + } + + if (channelIdx >= NUM_CHANS) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + channelIdx, + "Invalid channel index specified for setting Rx channel destination"); + return recoveryAction; + } + + if (muxSelect >= NUM_MUX_SELECTIONS) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + muxSelect, + "Invalid mux selection specified for setting Rx channel destination"); + return recoveryAction; + } + + /* Get baseAddress for this channel */ + chanSel = 1U << channelIdx; + recoveryAction = adrv903x_RxBitfieldAddressGet(device, (adi_adrv903x_RxChannels_e)(chanSel), &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxBitfieldAddressGet issue"); + return recoveryAction; + } + + /* Set bitfield */ + recoveryAction = bfSetter[destIdx]( device, + NULL, + baseAddr, + muxSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting Rx Destination mux"); + return recoveryAction; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioDestTxSet(adi_adrv903x_Device_t* const device, + const uint8_t destIdx, + const uint8_t channelIdx, + const uint8_t muxSelect) +{ + const uint8_t NUM_CHANS = 8U; + const uint8_t NUM_MUX_SELECTIONS = 24U; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxDigChanAddr_e baseAddr = ADRV903X_BF_SLICE_TX_0__TX_DIG; + uint32_t chanSel = 0U; + adi_adrv903x_ErrAction_e(*bfSetter[ADRV903X_GPIO_NUM_DESTINATIONS_TX])(adi_adrv903x_Device_t*, adi_adrv903x_SpiCache_t*, adrv903x_BfTxDigChanAddr_e, uint8_t) = { + adrv903x_TxDig_Spi2TxAttenGpioSelect_BfSet, + adrv903x_TxDig_TpcIncrAttenGpioSelect_BfSet, + adrv903x_TxDig_TpcDecrAttenGpioSelect_BfSet, + adrv903x_TxDig_DtxForceGpioSelect_BfSet, + adrv903x_TxDig_TxAttenUpdGpioSelect_BfSet, + adrv903x_TxDig_TxDuc0TssiPinEnableSelect_BfSet + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check inputs */ + if (destIdx >= ADRV903X_GPIO_NUM_DESTINATIONS_TX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + destIdx, + "Invalid destination index specified for setting Tx channel destination"); + return recoveryAction; + } + + if (channelIdx >= NUM_CHANS) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + channelIdx, + "Invalid channel index specified for setting Tx channel destination"); + return recoveryAction; + } + + if (muxSelect >= NUM_MUX_SELECTIONS) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + muxSelect, + "Invalid mux selection specified for setting Tx channel destination"); + return recoveryAction; + } + + /* Get baseAddress for this channel */ + chanSel = 1U << channelIdx; + recoveryAction = adrv903x_TxBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "TxBitfieldAddressGet issue"); + return recoveryAction; + } + + /* Set bitfield */ + recoveryAction = bfSetter[destIdx]( device, + NULL, + baseAddr, + muxSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting Tx Destination mux"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioDestStreamTrigSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t maskTrigger) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t gpioIdx = 0U; + uint32_t tmpMask = 0U; + uint32_t streamPinmask = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check gpio is valid */ + if ( gpio >= ADI_ADRV903X_GPIO_INVALID ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Check maskTrigger */ + if ((maskTrigger != ADI_ENABLE) && + (maskTrigger != ADI_DISABLE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + maskTrigger, + "Invalid GPIO Stream maskTrigger Option. Must be 0 or 1."); + return recoveryAction; + } + + /* Get current stream gpio pin mask value */ + recoveryAction = adrv903x_Core_StreamProcGpioPinMask_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &streamPinmask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GPIO Stream Trigger mask set failure"); + return recoveryAction; + } + + /* Update mask bit for selected gpio */ + gpioIdx = (uint32_t)(gpio); + tmpMask = (1U << gpioIdx); + /* if maskTrigger, bit needs to be set and stream WILL NOT be triggered*/ + if (maskTrigger == ADI_ENABLE) + { + streamPinmask |= tmpMask; + } + /* else, bit needs to be cleared and stream WILL be triggered */ + else + { + streamPinmask &= ~tmpMask; + } + + /* Set bitfield */ + recoveryAction = adrv903x_Core_StreamProcGpioPinMask_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + streamPinmask); + if(recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GPIO Stream Trigger mask set failure"); + return recoveryAction; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioRouteValidChannelMaskCheck(adi_adrv903x_Device_t* const device, + const adrv903x_GpioRoute_e route, + const uint32_t channelMask, + uint8_t* const isValid) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, isValid); + + switch(route) + { + /* NO channel can be selected for these route types */ + case ADRV903X_GPIO_ROUTE_OFF: + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE: + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL: + case ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG: + case ADRV903X_GPIO_ROUTE_DIG_DEST_PPI: + case ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE: + *isValid = (channelMask == 0U) ? ADI_TRUE : ADI_FALSE; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + /* Exactly 1 channel of 8 must be selected for these route types */ + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX: + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX: + *isValid = ((channelMask == 0x01) || + (channelMask == 0x02) || + (channelMask == 0x04) || + (channelMask == 0x08) || + (channelMask == 0x10) || + (channelMask == 0x20) || + (channelMask == 0x40) || + (channelMask == 0x80) ) + ? ADI_TRUE + : ADI_FALSE; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + /* Only 1 channel of 2 can be selected for these route types */ + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_ORX: + *isValid = ((channelMask == 0x01) || + (channelMask == 0x02) ) + ? ADI_TRUE + : ADI_FALSE; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + /* At least 1 and at most 8 channels can be selected for these route types */ + case ADRV903X_GPIO_ROUTE_DIG_DEST_RX: + case ADRV903X_GPIO_ROUTE_DIG_DEST_TX: + *isValid = ((channelMask >= 0x01) && + (channelMask <= 0xff) ) + ? ADI_TRUE + : ADI_FALSE; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + /* These route types, or any other, are not currently supported. */ + case ADRV903X_GPIO_ROUTE_ANA_DEST_CORE: + case ADRV903X_GPIO_ROUTE_ANA_DEST_RX: + case ADRV903X_GPIO_ROUTE_ANA_DEST_TX: + case ADRV903X_GPIO_ROUTE_ANA_DEST_ORX: + default: + *isValid = ADI_FALSE; + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + route, + "Unsupported route for checking channelMask"); + return recoveryAction; + break; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioConnect(adi_adrv903x_Device_t* const device, + const uint8_t connect, + const adi_adrv903x_GpioPinSel_e gpio, + const adrv903x_GpioSignalInfo_t* const sigInfo, + uint32_t const channelIdx) +{ + static const uint8_t DEFAULT_STG3_SELECT = 0U; + static const uint8_t DEFAULT_STG2_SELECT = 0U; + static const uint8_t DEFAULT_STG1_SELECT = 0U; + static const uint8_t DEFAULT_DESTRX_SELECT = 0U; + static const uint8_t DEFAULT_DESTTX_SELECT = 0U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check if connect is valid */ + if ((connect != ADI_ENABLE) && + (connect != ADI_DISABLE) ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + connect, + "Invalid GPIO Connect/Disconnet Option. Must be 0 or 1."); + return recoveryAction; + } + + /* Check gpio is valid */ + if (gpio >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Setup the Route for this GPIO/signal (and channel, if this signal is a channel-instantiate signal) */ + switch(sigInfo->route) + { + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_CORE: + recoveryAction = adrv903x_GpioPinmuxStg3Set( device, + gpio, + (connect ? sigInfo->topSelect : DEFAULT_STG3_SELECT) ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg3Set issue"); + return recoveryAction; + } + break; + + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_ACTRL: + recoveryAction = adrv903x_GpioPinmuxStg3Set( device, + gpio, + (connect ? sigInfo->topSelect : DEFAULT_STG3_SELECT) ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg3Set issue"); + return recoveryAction; + } + recoveryAction = adrv903x_GpioPinmuxStg2ActrlSet( device, + gpio, + (connect ? sigInfo->targetSelect : DEFAULT_STG2_SELECT) ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg2ActrlSet issue"); + return recoveryAction; + } + break; + + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_RX: + recoveryAction = adrv903x_GpioPinmuxStg3Set( device, + gpio, + (connect ? sigInfo->topSelect : DEFAULT_STG3_SELECT) ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg3Set issue"); + return recoveryAction; + } + recoveryAction = adrv903x_GpioPinmuxStg2RxSet( device, + gpio, + (connect ? channelIdx : DEFAULT_STG2_SELECT) ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg2RxSet issue"); + return recoveryAction; + } + recoveryAction = adrv903x_GpioPinmuxStg1RxSet( device, + gpio, + (connect ? sigInfo->targetSelect : DEFAULT_STG1_SELECT), + channelIdx ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg1RxSet issue"); + return recoveryAction; + } + + break; + + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_TX: + recoveryAction = adrv903x_GpioPinmuxStg3Set( device, + gpio, + (connect ? sigInfo->topSelect : DEFAULT_STG3_SELECT) ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg3Set issue"); + return recoveryAction; + } + recoveryAction = adrv903x_GpioPinmuxStg2TxSet( device, + gpio, + (connect ? channelIdx : DEFAULT_STG2_SELECT) ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg2TxSet issue"); + return recoveryAction; + } + recoveryAction = adrv903x_GpioPinmuxStg1TxSet( device, + gpio, + (connect ? sigInfo->targetSelect : DEFAULT_STG1_SELECT), + channelIdx ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg1TxSet issue"); + return recoveryAction; + } + break; + + case ADRV903X_GPIO_ROUTE_DIG_PINMUX_ORX: + recoveryAction = adrv903x_GpioPinmuxStg3Set( device, + gpio, + (connect ? sigInfo->topSelect : DEFAULT_STG3_SELECT) ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg3Set issue"); + return recoveryAction; + } + recoveryAction = adrv903x_GpioPinmuxStg2OrxSet( device, + gpio, + (connect ? channelIdx : DEFAULT_STG2_SELECT) ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg2OrxSet issue"); + return recoveryAction; + } + recoveryAction = adrv903x_GpioPinmuxStg1OrxSet( device, + gpio, + (connect ? sigInfo->targetSelect : DEFAULT_STG1_SELECT), + channelIdx ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg1OrxSet issue"); + return recoveryAction; + } + break; + + case ADRV903X_GPIO_ROUTE_DIG_DEST_RX: + recoveryAction = adrv903x_GpioPinmuxStg3Set( device, gpio, DEFAULT_STG3_SELECT ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg3Set issue"); + return recoveryAction; + } + recoveryAction = adrv903x_GpioDestRxSet( device, + sigInfo->targetSelect, + channelIdx, + connect ? (uint8_t)gpio : DEFAULT_DESTRX_SELECT); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioDestRxSet issue"); + return recoveryAction; + } + + break; + case ADRV903X_GPIO_ROUTE_DIG_DEST_TX: + recoveryAction = adrv903x_GpioPinmuxStg3Set( device, gpio, DEFAULT_STG3_SELECT ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg3Set issue"); + return recoveryAction; + } + recoveryAction = adrv903x_GpioDestTxSet( device, + sigInfo->targetSelect, + channelIdx, + connect ? (uint8_t)gpio : DEFAULT_DESTTX_SELECT); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioDestTxSet issue"); + return recoveryAction; + } + break; + + case ADRV903X_GPIO_ROUTE_DIG_DEST_STREAM_TRIG: + recoveryAction = adrv903x_GpioPinmuxStg3Set( device, + gpio, + (connect ? sigInfo->topSelect : DEFAULT_STG3_SELECT) ); + + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioPinmuxStg3Set issue"); + return recoveryAction; + } + recoveryAction = adrv903x_GpioDestStreamTrigSet( device, + gpio, + !connect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adrv903x_GpioDestStreamTrigSet issue"); + return recoveryAction; + } + break; + + /* TODO: PPI Dest Core signals need some extra special handling. Add later when we start using them */ + case ADRV903X_GPIO_ROUTE_DIG_DEST_PPI: /* Fallthrough */ + + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + sigInfo->route, + "Unsupported route type for selected GPIO signal"); + return recoveryAction; + break; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogIeOverride(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + const uint8_t override) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfCoreChanAddr_e baseAddr = (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR; + uint16_t lclMask = 0U; + uint32_t gpioIdx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check analog gpio is valid */ + if (gpio >= ADI_ADRV903X_GPIO_ANA_INVALID || + gpio < ADI_ADRV903X_GPIO_ANA_00) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid analog GPIO selected. Out of range."); + return recoveryAction; + } + + /* Check IE override bit is valid */ + if ((override != ADI_ENABLE) && + (override != ADI_DISABLE) ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + override, + "Invalid Input Enable override bit for an analog GPIO. Must be 0 or 1."); + return recoveryAction; + } + + /* Get current bitfield value */ + recoveryAction = adrv903x_Core_GpioAnalogSourceControlOverride_BfGet( device, + NULL, + baseAddr, + &lclMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read analog gpio source control override bf"); + return recoveryAction; + } + + /* Update mask bit for this gpio */ + gpioIdx = (uint32_t)(gpio); + lclMask |= (override << gpioIdx ); + + /* Update bitfield value */ + recoveryAction = adrv903x_Core_GpioAnalogSourceControlOverride_BfSet( device, + NULL, + baseAddr, + lclMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write analog gpio source control override bf"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogPinmuxSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + const uint8_t muxSelect) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t gpioIdx = 0U; + adi_adrv903x_ErrAction_e(*bfSetter[(uint32_t)(ADI_ADRV903X_GPIO_ANA_INVALID)])(adi_adrv903x_Device_t*, adi_adrv903x_SpiCache_t*, adrv903x_BfCoreChanAddr_e, uint8_t) = { + adrv903x_Core_GpioAnalogSourceControl0_BfSet, + adrv903x_Core_GpioAnalogSourceControl1_BfSet, + adrv903x_Core_GpioAnalogSourceControl2_BfSet, + adrv903x_Core_GpioAnalogSourceControl3_BfSet, + adrv903x_Core_GpioAnalogSourceControl4_BfSet, + adrv903x_Core_GpioAnalogSourceControl5_BfSet, + adrv903x_Core_GpioAnalogSourceControl6_BfSet, + adrv903x_Core_GpioAnalogSourceControl7_BfSet, + adrv903x_Core_GpioAnalogSourceControl8_BfSet, + adrv903x_Core_GpioAnalogSourceControl9_BfSet, + adrv903x_Core_GpioAnalogSourceControl10_BfSet, + adrv903x_Core_GpioAnalogSourceControl11_BfSet, + adrv903x_Core_GpioAnalogSourceControl12_BfSet, + adrv903x_Core_GpioAnalogSourceControl13_BfSet, + adrv903x_Core_GpioAnalogSourceControl14_BfSet, + adrv903x_Core_GpioAnalogSourceControl15_BfSet + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check gpio is valid */ + if ( gpio >= ADI_ADRV903X_GPIO_ANA_INVALID ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Check muxSelect */ + if (muxSelect > ADRV903X_GPIO_ANALOG_PINMUX_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + muxSelect, + "Invalid mux input selected. Out of range."); + return recoveryAction; + } + + /* Set mux bitfield */ + gpioIdx = (uint32_t)(gpio); + recoveryAction = bfSetter[gpioIdx](device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + muxSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Analog Pinmux selection failure"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogPinmuxGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + uint8_t * const muxSelect) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t gpioIdx = 0U; + adi_adrv903x_ErrAction_e(*bfGetter[(uint32_t)(ADI_ADRV903X_GPIO_ANA_INVALID)])(adi_adrv903x_Device_t*, adi_adrv903x_SpiCache_t*, adrv903x_BfCoreChanAddr_e, uint8_t *) = { + adrv903x_Core_GpioAnalogSourceControl0_BfGet, + adrv903x_Core_GpioAnalogSourceControl1_BfGet, + adrv903x_Core_GpioAnalogSourceControl2_BfGet, + adrv903x_Core_GpioAnalogSourceControl3_BfGet, + adrv903x_Core_GpioAnalogSourceControl4_BfGet, + adrv903x_Core_GpioAnalogSourceControl5_BfGet, + adrv903x_Core_GpioAnalogSourceControl6_BfGet, + adrv903x_Core_GpioAnalogSourceControl7_BfGet, + adrv903x_Core_GpioAnalogSourceControl8_BfGet, + adrv903x_Core_GpioAnalogSourceControl9_BfGet, + adrv903x_Core_GpioAnalogSourceControl10_BfGet, + adrv903x_Core_GpioAnalogSourceControl11_BfGet, + adrv903x_Core_GpioAnalogSourceControl12_BfGet, + adrv903x_Core_GpioAnalogSourceControl13_BfGet, + adrv903x_Core_GpioAnalogSourceControl14_BfGet, + adrv903x_Core_GpioAnalogSourceControl15_BfGet + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, muxSelect); + + /* Check gpio is valid */ + if (gpio >= ADI_ADRV903X_GPIO_ANA_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Set mux bitfield */ + gpioIdx = (uint32_t)(gpio); + recoveryAction = bfGetter[gpioIdx](device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + muxSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Reading Analog Pinmux selection failure"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpioAnalogConnect(adi_adrv903x_Device_t* const device, + const uint8_t connect, + const adi_adrv903x_GpioAnaPinSel_e gpio, + const adrv903x_GpioSignalInfo_t* const sigInfo, + uint32_t const channelIdx) +{ + (void)channelIdx; + static const uint8_t DEFAULT_STG3_SELECT = 0U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check if connect is valid */ + if ((connect != ADI_ENABLE) && + (connect != ADI_DISABLE) ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + connect, + "Invalid GPIO Connect/Disconnet Option. Must be 0 or 1."); + return recoveryAction; + } + + /* Check gpio is valid */ + if (gpio >= ADI_ADRV903X_GPIO_ANA_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gpio, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + /* Setup the Route for this GPIO/signal (and channel, if this signal is a channel-instantiate signal) */ + switch(sigInfo->route) + { + case ADRV903X_GPIO_ROUTE_ANA_PINMUX_CORE: + recoveryAction = adrv903x_GpioAnalogPinmuxSet( device, + gpio, + (connect ? sigInfo->topSelect : DEFAULT_STG3_SELECT) ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioAnalogPinmuxSet issue"); + return recoveryAction; + } + break; + + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + sigInfo->route, + "Unsupported route type for selected GPIO signal"); + return recoveryAction; + break; + } + + return recoveryAction; +} + +/**************************************************************************** + * GP Int (General Purpose Interrupt) related functions + *************************************************************************** + */ + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpIntTypeSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntMask_t* const gpIntType) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Validate inputs */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, gpIntType); + + recoveryAction = adrv903x_Core_GpInterruptsLevelPulseBLowerWord_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + gpIntType->lowerMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing GP Interrupt Type Lower Word."); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_GpInterruptsLevelPulseBUpperWord_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + gpIntType->upperMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing GP Interrupt Type Upper Word."); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpIntTypeGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpIntMask_t* const gpIntType) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Validate inputs */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, gpIntType); + + recoveryAction = adrv903x_Core_GpInterruptsLevelPulseBLowerWord_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &gpIntType->lowerMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading GP Interrupt Type Lower Word."); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_GpInterruptsLevelPulseBUpperWord_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &gpIntType->upperMask ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading GP Interrupt Type Upper Word."); + return recoveryAction; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpIntPreMcsInit( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntPinMaskCfg_t* const pinMaskCfg) +{ + const adi_adrv903x_GpIntPinSelect_e pins = ADI_ADRV903X_GPINTALL; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + static const adi_adrv903x_GpIntMask_t initGpIntTypeMask = { ADRV903X_GP_INT_TYPE_DEFAULT_LOWER, ADRV903X_GP_INT_TYPE_DEFAULT_UPPER }; + + /* Validate inputs */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, pinMaskCfg); + + /* Setup proper GP Interrupt Type defaults (Level vs Edge Triggered) */ + recoveryAction = adrv903x_GpIntTypeSet(device, &initGpIntTypeMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing default GP Interrupt Types."); + return recoveryAction; + } + + /* Set GP Int Pin Masks to selected states */ + recoveryAction = adi_adrv903x_GpIntPinMaskCfgSet(device, pins, pinMaskCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing GP Interrupt Mask Array."); + return recoveryAction; + } + + /* Clear all status bits */ + recoveryAction = adi_adrv903x_GpIntStatusClear(device, NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error clearing GP Interrupt Status bits."); + return recoveryAction; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GpIntPostMcsInit( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntPinMaskCfg_t* const pinMaskCfg) +{ + const adi_adrv903x_GpIntPinSelect_e pins = ADI_ADRV903X_GPINTALL; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Validate inputs */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, pinMaskCfg); + + /* Set GP Int Pin Masks to selected states */ + recoveryAction = adi_adrv903x_GpIntPinMaskCfgSet(device, pins, pinMaskCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing GP Interrupt Mask Array."); + return recoveryAction; + } + + /* Clear all status bits */ + recoveryAction = adi_adrv903x_GpIntStatusClear(device, NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error clearing GP Interrupt Status bits."); + return recoveryAction; + } + + return recoveryAction; +} diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_init.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_init.c new file mode 100644 index 0000000000000..9b52205f0ae01 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_init.c @@ -0,0 +1,1344 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adrv903x_init.c +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#include "../../private/include/adrv903x_init.h" +#include "../../private/bf/adrv903x_bf_core.h" +#include "../../private/bf/adrv903x_bf_rx_funcs.h" +#include "../../private/bf/adrv903x_bf_orx_dig.h" +#include "../../private/bf/adrv903x_bf_tx_funcs.h" +#include "../../private/bf/adrv903x_bf_tx_dig.h" +#include "../../private/include/adrv903x_rx.h" +#include "../../private/include/adrv903x_tx.h" +#include "../../private/include/adrv903x_gpio.h" +#include "../../private/include/adrv903x_cpu_cmd_tx_to_orx_mapping.h" + +#include "adi_adrv903x_radioctrl_types.h" + + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_INIT + +static uint32_t adrv903x_ClockDivWithFixedDiv(const uint32_t clock, const uint32_t clockMax, const uint32_t fixedDivLog2); +static uint32_t adrv903x_ErrReportConvert(const adi_adrv903x_Version_t version); + +/*********************/ +/* Private functions */ +/*********************/ + +/** +* \brief Calculates the divide value necessary to get the +* clock parameter under the clockMax using +* out = clock / 2 ^ (div + fixedDivLog2) +* +* \param clock Input clock frequency +* \param clockMax Maximum clock frequency +* \param fixedDivLog2 Constant added to the divider +* +* \retval uint32_t divider value calculated or the max value allowed +*/ +static uint32_t adrv903x_ClockDivWithFixedDiv( const uint32_t clock, + const uint32_t clockMax, + const uint32_t fixedDivLog2) +{ + uint32_t div = 0U; + static const uint32_t ADRV903X_POWER2_MAX = 8U; + + for (div = 0U; div < ADRV903X_POWER2_MAX; div++) + { + if (clock <= (clockMax << (div + fixedDivLog2))) + { + return div; + } + } + + return div; +} + +adi_adrv903x_ErrAction_e adrv903x_ClocksSync( adi_adrv903x_Device_t* const device, + const adi_adrv903x_Init_t* const init) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t idx = 0U; + uint32_t digDeviceClockDiv = 0U; + uint32_t mBiasClockDiv = 0U; + uint32_t digRefClock_kHz = 0U; + + static const uint32_t MASTER_BIAS_CLOCK_TARGET_kHz = 1000U; /* Prefer <1MHz */ + static const uint32_t MASTER_BIAS_CLOCK_MAX_kHz = 2000U; /* But 2MHz max */ + + static const uint32_t DIGDEVICECLOCKDIVMAX = 3U; + static const uint32_t MBIASCLOCKDIVMAX = 3U; + + static const uint32_t MBIASCLOCKDIVFIXED = 6U; /* Fixed divide-by-64 before master bias divider */ + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, init); + + /* Set Digital device clock divider */ + digDeviceClockDiv = 0U; + + while( digDeviceClockDiv < DIGDEVICECLOCKDIVMAX && + (1 << digDeviceClockDiv) < device->initExtract.clocks.padDivideRatio ) + { + digDeviceClockDiv++; + } + + recoveryAction = adrv903x_Core_DevclkDivideRatio_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + digDeviceClockDiv); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to set devclk divide ratio"); + return recoveryAction; + } + + if (init->clocks.DevClkOnChipTermResEn > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + init->clocks.DevClkOnChipTermResEn, + "DevClkOnChipTermResEn can only be 0 or 1"); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_DevclkBuffTermEn_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + init->clocks.DevClkOnChipTermResEn); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to set devclk buffer Termination enable"); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_DevclkBufferEnable_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to set devclk buffer enable"); + return recoveryAction; + } + + digRefClock_kHz = device->initExtract.clocks.deviceClockScaled_kHz; + + /* Set Master Bias clock divider */ + mBiasClockDiv = adrv903x_ClockDivWithFixedDiv(digRefClock_kHz, MASTER_BIAS_CLOCK_TARGET_kHz, MBIASCLOCKDIVFIXED); + if (mBiasClockDiv > MBIASCLOCKDIVMAX) + { + /* We've exceeded target clock frequency, so clamp to max divide value and verify + that we have not exceeded max clock frequency */ + mBiasClockDiv = MBIASCLOCKDIVMAX; + if( digRefClock_kHz > (MASTER_BIAS_CLOCK_MAX_kHz << (mBiasClockDiv + MBIASCLOCKDIVFIXED)) ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + mBiasClockDiv, + "Device Clock too fast!"); + return recoveryAction; + } + } + + recoveryAction = adrv903x_Core_MasterBiasClkDivRatio_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + mBiasClockDiv); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to set dmaster bias clock div ratio"); + return recoveryAction; + } + + for (idx = 0; idx < 2U; ++idx) + { + recoveryAction = adrv903x_Core_MbiasIgenPd_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + idx, + ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to clear mbias igen powerdown"); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_MbiasTrimCompPd_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + idx, + ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to clear mbias trim comp powerdown"); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_MbiasRtrimResetb_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + idx, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to clear mbias trim comp powerdown"); + return recoveryAction; + } + } + + recoveryAction = adrv903x_Core_DevclkDividerMcsResetb_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to set DevclkDivider MCS ResetB"); + return recoveryAction; + } + + /* THIS MUST BE done BEFORE starting up the main digital clocks DigitalClockPowerUp */ + recoveryAction = adrv903x_Core_UseDeviceClkAsHsdigclk_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to set use device clk as hsdig"); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_DigitalClockPowerUp_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to set digital clock powerup"); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_ArmClkEnable_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to set arm clock enable"); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_ArmClkDivideRatio_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + device->initExtract.clocks.armClkDivideRatio); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to set arm clk divide ratio"); + return recoveryAction; + } + + /* Calculate and set the ARM clock divider when on DEVCLK */ + recoveryAction = adrv903x_Core_ArmClkDivideRatioDevClk_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + device->initExtract.clocks.armClkDevClkDivRatio); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to set arm clk device clk divide ratio"); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_AhbSpiBridgeEnable_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to set ahb spi bridge enable bit"); + return recoveryAction; + } + + /* Clear clk divider sync bit, then set it */ + recoveryAction = adrv903x_Core_DigitalClockDividerSyncEn_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to clear digital clock divider sync enable bit"); + return recoveryAction; + } + recoveryAction = adrv903x_Core_DigitalClockDividerSyncEn_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while attempting to set digital clock divider sync enable bit"); + return recoveryAction; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxOverloadProtectionSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxFuncsChannelBitfieldAddr = (adrv903x_BfRxFuncsChanAddr_e) 0U; + adrv903x_BfOrxDigChanAddr_e orxDigChannelBitfieldAddr = (adrv903x_BfOrxDigChanAddr_e) 0U; + + /* Hardcoded values for ONLY Rx Overload Protection */ + static const uint8_t AGC_USE_COUNTERS_FOR_MGC = 0x1U; + static const uint8_t AGC_MANUAL_GAIN_PIN_CONTROL = 0x0U; + static const uint8_t AGC_ULB_THRESHOLD_EXCEEDED_COUNTER = 0X3U; + static const uint8_t AGC_ADC_HIGH_OVRG_EXCEEDED_COUNTER = 0x3U; + static const uint32_t AGC_GAIN_UPDATE_COUNTER = 0x3D090U; + static const uint8_t AGC_SLOW_LOOP_SETTLING_DELAY = 0x10U; + static const uint8_t AGC_RESET_ON_RXON = 0x0U; + static const uint8_t AGC_ENABLE_SYNC_PULSE_FOR_GAIN_COUNTER = 0x0U; + static const uint8_t HB2_OVERLOAD_USE_HB2_IN = 0x0U; + + /* Hardcoded values to set for BOTH Rx and ORx Overload Protection */ + static const uint8_t PEAK_SAMPLE_COUNT_AGC = 0x1U; + static const uint8_t PEAK_WINDOW_SIZE_AGC = 0x2U; + static const uint8_t OVERLOAD_EN_AGC = 0x1U; + static const uint8_t OVERLOAD_POWER_MODE_AGC = 0x1U; + static const uint16_t OVERLOAD_TH_AGC_PRE = 0x32D6U; + static const uint16_t OVERLOAD_TH_AGC_HIGH = 0x2862U; + + /* Check for valid device handle */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /*Check that the requested rxChannel is valid*/ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7) && + (rxChannel != ADI_ADRV903X_ORX0) && + (rxChannel != ADI_ADRV903X_ORX1)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for Rx Overload Protection"); + return recoveryAction; + } + + /* If rxChannel is a Rx Channel, use Rx_Funcs base addr and bitfields */ + if (((uint32_t)ADI_ADRV903X_RX_MASK_ALL & (uint32_t)rxChannel) > 0U) + { + /* Get base address for the Rx Channel */ + recoveryAction = (adi_adrv903x_ErrAction_e) adrv903x_RxFuncsBitfieldAddressGet( device, + rxChannel, + &rxFuncsChannelBitfieldAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to get Rx Funcs Base address for given Rx channel"); + return recoveryAction; + } + + /* Set bitfields */ + recoveryAction = adrv903x_RxFuncs_AgcUseCountersForMgc_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + AGC_USE_COUNTERS_FOR_MGC); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set AgcUseCountersForMgc for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_AgcManualGainPinControl_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + AGC_MANUAL_GAIN_PIN_CONTROL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set AgcManualGainPinControl for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_AgcUlbThresholdExceededCounter_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + AGC_ULB_THRESHOLD_EXCEEDED_COUNTER); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set AgcUlbThresholdExceededCounter for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_AgcAdcHighOvrgExceededCounter_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + AGC_ADC_HIGH_OVRG_EXCEEDED_COUNTER); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set AgcAdcHighOvrgExceededCounter for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_AgcGainUpdateCounter_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + AGC_GAIN_UPDATE_COUNTER); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set AgcGainUpdateCounter for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_AgcSlowLoopSettlingDelay_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + AGC_SLOW_LOOP_SETTLING_DELAY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set AgcSlowLoopSettlingDelay for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_PeakSampleCountAgc_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + PEAK_SAMPLE_COUNT_AGC); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set PeakSampleCountAgc for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_PeakWindowSizeAgc_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + PEAK_WINDOW_SIZE_AGC); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set PeakWindowSizeAgc for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_OverloadEnAgc_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + OVERLOAD_EN_AGC); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set OverloadEnAgc for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_OverloadPowerModeAgc_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + OVERLOAD_POWER_MODE_AGC); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set OverloadPowerModeAgc for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_Hb2OverloadUseHb2In_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + HB2_OVERLOAD_USE_HB2_IN); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set Hb2OverloadUseHb2In for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_OverloadThAgcPre_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + OVERLOAD_TH_AGC_PRE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set OverloadThAgcPre for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_OverloadThAgcHigh_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + OVERLOAD_TH_AGC_HIGH); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set OverloadThAgcHigh for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_AgcResetOnRxon_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + AGC_RESET_ON_RXON); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set AgcResetOnRxon for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_AgcEnableSyncPulseForGainCounter_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + AGC_ENABLE_SYNC_PULSE_FOR_GAIN_COUNTER); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set AgcEnableSyncPulseForGainCounter for given Rx channel"); + return recoveryAction; + } + + /* Set and clear this bit to latch new threshold values */ + recoveryAction = adrv903x_RxFuncs_TiaValidOverride_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set TiaValidOverride for given Rx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_TiaValidOverride_BfSet(device, + NULL, + rxFuncsChannelBitfieldAddr, + ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set TiaValidOverride for given Rx channel"); + return recoveryAction; + } + } + + /* If rxChannel is a ORx Channel, use ORx_Dig base addr and bitfields */ + /* Note: AGC bitfields from Rx Channels do not exist here, just overload protection bitfields.*/ + if (((uint32_t)ADI_ADRV903X_ORX_MASK_ALL & (uint32_t)rxChannel) > 0U) + { + /* Get base address for the ORx Channel */ + recoveryAction = adrv903x_OrxBitfieldAddressGet( device, + rxChannel, + &orxDigChannelBitfieldAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to get ORx Dig Base address for given ORx channel"); + return recoveryAction; + } + + /* Set bitfields */ + recoveryAction = adrv903x_OrxDig_OverloadCountTh_BfSet(device, + NULL, + orxDigChannelBitfieldAddr, + PEAK_SAMPLE_COUNT_AGC); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set OverloadCountTh for given ORx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_OrxDig_OverloadDurationCount_BfSet(device, + NULL, + orxDigChannelBitfieldAddr, + PEAK_WINDOW_SIZE_AGC); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set verloadDurationCount for given ORx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_OrxDig_OverloadEn_BfSet(device, + NULL, + orxDigChannelBitfieldAddr, + OVERLOAD_EN_AGC); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set OverloadEn for given ORx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_OrxDig_OverloadPowerMode_BfSet(device, + NULL, + orxDigChannelBitfieldAddr, + OVERLOAD_POWER_MODE_AGC); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set OverloadPowerMode for given ORx channel"); + return recoveryAction; + } + + recoveryAction = adrv903x_OrxDig_OverloadThPre_BfSet(device, + NULL, + orxDigChannelBitfieldAddr, + OVERLOAD_TH_AGC_PRE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set OverloadThPre for given ORx channel"); + return recoveryAction; + } + recoveryAction = adrv903x_OrxDig_OverloadThHigh_BfSet(device, + NULL, + orxDigChannelBitfieldAddr, + OVERLOAD_TH_AGC_HIGH); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + rxChannel, + "Error while attempting to set OverloadThHigh for given ORx channel"); + return recoveryAction; + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxPowerMonitorInitialize(adi_adrv903x_Device_t* const device, + const uint32_t txChannelMask, + const uint8_t totalInputInterpoloationRate) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + static const uint8_t PROTECTION_RAMP_STEP_SIZE_IN_NS = 20U; /* Calculate the step size field for 20ns*/ + static const uint8_t PROTECTION_RAMP_STEP_SIZE_MAX = 15U; + static const uint8_t PROTECTION_RAMP_STEP_SIZE_MIN = 10U; + static const uint8_t PROTECTION_RAMP_MAX_ATTENUATION = 0x64U; + static const uint8_t PROTECTION_RAMP_STEP_SIZE = 0x02U; + static const uint8_t PROTECTION_DISABLE_ANALOG_DELAY_FOR_SRD_RAMP = 0x01U; + static const uint8_t PROTECTION_DISABLE_ANALOG_DELAY_FOR_OTHER_RAMPS = 0x01U; + static const uint8_t PROTECTION_RAMP_UP_ENABLE = 0x01U; + static const uint8_t MAX_INTERPOLATION_RATE = 8U; + uint32_t chanIdx = 0; + uint8_t attenClkDivRatio = 0U; + uint32_t stepSize = 0U; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + adrv903x_BfTxChanAddr_e txDigBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_DIG; + uint32_t txChanSel = 0U; + + if ((totalInputInterpoloationRate == 0) || + (totalInputInterpoloationRate > MAX_INTERPOLATION_RATE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + totalInputInterpoloationRate, + "Total interpolation rate cannot be 0 or higher than 8"); + return recoveryAction; + } + + /* Write the same init config to all Tx channels */ + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + txChanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(txChannelMask, txChanSel)) + { + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(txChanSel), &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Invalid Tx Channel used to determine SPI address"); + return recoveryAction; + } + + recoveryAction = adrv903x_TxBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(txChanSel), &txDigBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid Tx Channel used while reading tx dig address"); + return recoveryAction; + } + + recoveryAction = adrv903x_TxDig_TxAttenClkDivideRatio_BfGet(device, + NULL, + txDigBaseAddr, + &attenClkDivRatio); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Peak Overload Window Size"); + return recoveryAction; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionOverloadWindowSize_BfSet(device, + NULL, + txBaseAddr, + totalInputInterpoloationRate * 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Peak Overload Window Size"); + return recoveryAction; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionOverloadCountTh_BfSet(device, + NULL, + txBaseAddr, + totalInputInterpoloationRate); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Peak Overload Count"); + return recoveryAction; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionRampMaxAttenuation_BfSet(device, + NULL, + txBaseAddr, + PROTECTION_RAMP_MAX_ATTENUATION); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx Power Protect Ramp Max Attenuation"); + return recoveryAction; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionRampStepSize_BfSet(device, + NULL, + txBaseAddr, + PROTECTION_RAMP_STEP_SIZE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx Power Protect Ramp Step Size"); + return recoveryAction; + } + + /* Calculate step size as number of tx atten block clock cycles */ + stepSize = ((uint32_t)PROTECTION_RAMP_STEP_SIZE_IN_NS * device->initExtract.clocks.hsDigClk_kHz) / ((uint32_t)1U << (uint32_t)attenClkDivRatio); + stepSize = stepSize / 1000000U; + + /* Saturate step size before writing it to register */ + if (stepSize < PROTECTION_RAMP_STEP_SIZE_MIN) + { + stepSize = PROTECTION_RAMP_STEP_SIZE_MIN; + } + else if (stepSize > PROTECTION_RAMP_STEP_SIZE_MAX) + { + stepSize = PROTECTION_RAMP_STEP_SIZE_MAX; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionRampStepDuration_BfSet(device, + NULL, + txBaseAddr, + stepSize); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx Power Protect Ramp Step Duration"); + return recoveryAction; + } + + recoveryAction = adrv903x_TxFuncs_TxAttenPapDisAnalogDelay_BfSet(device, + NULL, + txBaseAddr, + PROTECTION_DISABLE_ANALOG_DELAY_FOR_OTHER_RAMPS); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx Power Protect Ramp Analog Delay"); + return recoveryAction; + } + + recoveryAction = adrv903x_TxFuncs_SrdDisAnalogDelay_BfSet(device, + NULL, + txBaseAddr, + PROTECTION_DISABLE_ANALOG_DELAY_FOR_SRD_RAMP); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx SRD Ramp Analog Delay"); + return recoveryAction; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionGainRampUpEn_BfSet(device, + NULL, + txBaseAddr, + PROTECTION_RAMP_UP_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Ramp Up Enable"); + return recoveryAction; + } + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxToOrxMappingInit(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxToOrxMappingConfig_t* const mappingConfig) +{ + static const adi_adrv903x_GpioSignal_e streamSig[ADI_ADRV903X_MAX_STREAMGPIO] = { + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_0, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_1, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_2, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_3, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_4, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_5, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_6, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_7, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_8, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_9, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_10, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_11, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_12, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_13, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_14, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_15, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_16, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_17, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_18, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_19, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_20, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_21, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_22, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_23 + }; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t numBits = 0U; + uint8_t idx = 0U; + uint8_t allInvalid = ADI_TRUE; + uint8_t allValid = ADI_TRUE; + adi_adrv903x_GpioPinSel_e pin = ADI_ADRV903X_GPIO_INVALID; + uint8_t pinIdx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, mappingConfig); + + /*Range check tx Observability does NOT allow a Tx Channel to be observable on two ORx channels*/ + if (( ((mappingConfig->txObservability >> 0u) & 0x3u) == 0x3u) || + ( ((mappingConfig->txObservability >> 2u) & 0x3u) == 0x3u) || + ( ((mappingConfig->txObservability >> 4u) & 0x3u) == 0x3u) || + ( ((mappingConfig->txObservability >> 6u) & 0x3u) == 0x3u) || + ( ((mappingConfig->txObservability >> 8u) & 0x3u) == 0x3u) || + ( ((mappingConfig->txObservability >> 10u) & 0x3u) == 0x3u) || + ( ((mappingConfig->txObservability >> 12u) & 0x3u) == 0x3u) || + ( ((mappingConfig->txObservability >> 14u) & 0x3u) == 0x3u)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + mappingConfig->txObservability, + "Invalid Tx observability on ORx channels. A Tx channel cannot be observable by two ORx channels."); + return recoveryAction; + } + + /*Range check mapping mode*/ + switch (mappingConfig->mode) + { + case ADI_ADRV903X_TX_ORX_MAPPING_MODE_2BIT: + numBits = 2U; + break; + case ADI_ADRV903X_TX_ORX_MAPPING_MODE_3BIT: + numBits = 3U; + break; + case ADI_ADRV903X_TX_ORX_MAPPING_MODE_4BIT: + numBits = 4U; + break; + case ADI_ADRV903X_TX_ORX_MAPPING_MODE_6BIT: + numBits = 6U; + break; + case ADI_ADRV903X_TX_ORX_MAPPING_MODE_8BIT: + numBits = 8U; + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + mappingConfig->mode, + "Invalid Tx To ORx Mapping mode selected. Must select 2/3/4/6/8 bit mode"); + return recoveryAction; + break; + } + + /*Range check Auto Switching Enable/Disable: Orx Atten*/ + if ((mappingConfig->autoSwitchOrxAttenEnable != ADI_ENABLE) && + (mappingConfig->autoSwitchOrxAttenEnable != ADI_DISABLE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + mappingConfig->autoSwitchOrxAttenEnable, + "Invalid Tx To ORx Mapping Auto Switching Enable setting for ORx Atten. Must select 0 or 1."); + return recoveryAction; + } + + /*Range check Auto Switching Enable/Disable: Orx Atten*/ + if ((mappingConfig->autoSwitchOrxNcoEnable != ADI_ENABLE) && + (mappingConfig->autoSwitchOrxNcoEnable != ADI_DISABLE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + mappingConfig->autoSwitchOrxNcoEnable, + "Invalid Tx To ORx Mapping Auto Switching Enable setting for ORx NCO. Must select 0 or 1."); + return recoveryAction; + } + + /* Range check GPIO LUT entries */ + for (idx = 0U; idx < ADI_ADRV903X_TX_TO_ORX_MAPPING_PIN_TABLE_SIZE; idx++) + { + + if ((mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX0) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX1) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX2) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX3) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX4) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX5) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX6) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX7) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_NONE) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_NO_CHANGE) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_0) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_1) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_2) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_3) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_4) && + (mappingConfig->pinTableOrx0[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_5)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + mappingConfig->pinTableOrx0[idx], + "Invalid Tx To ORx Mapping GPIO Table entry for ORx0. Must be valid Mapping selection Tx0-7, Extended Mapping Selection, NONE, or NO CHANGE"); + return recoveryAction; + } + + if ((mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX0) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX1) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX2) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX3) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX4) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX5) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX6) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX7) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_NONE) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_NO_CHANGE) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_0) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_1) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_2) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_3) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_4) && + (mappingConfig->pinTableOrx1[idx] != ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_5)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + mappingConfig->pinTableOrx1[idx], + "Invalid Tx To ORx Mapping GPIO Table entry for ORx1. Must be valid Mapping selection Tx0-7, Extended Mapping Selection, NONE, or NO CHANGE"); + return recoveryAction; + } + + } + + /*Range check GPIO select*/ + for (idx = 0U; idx < numBits; idx++) + { + if ((mappingConfig->gpioSelect[idx] < ADI_ADRV903X_GPIO_00) || + (mappingConfig->gpioSelect[idx] >= ADI_ADRV903X_GPIO_INVALID)) + { + allValid = ADI_FALSE; + } + else + { + allInvalid = ADI_FALSE; + } + } + + if ((allValid == ADI_FALSE) && + (allInvalid == ADI_FALSE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + mappingConfig->mode, + "Invalid GPIO selections for Tx To ORx Mapping mode. Must select a pin for all Mode bits or 0 Mode bits."); + return recoveryAction; + } + + /* If all selected GPIOs were valid, connect pins*/ + else if (allValid == ADI_TRUE) + { + for (idx = 0U; idx < numBits; idx++) + { + pin = mappingConfig->gpioSelect[idx]; + pinIdx = (uint8_t)pin; + recoveryAction = adrv903x_GpioSignalSet(device, pin, streamSig[pinIdx], 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "GPIO setup error while initializing Tx to ORx Mapping Configuration."); + return recoveryAction; + } + } + + } + + /* If all invalid, no GPIO setup functions to call */ + else if(allInvalid) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + + /*Store tx to orx mapping config in device handle for later readback*/ + /*Note that simply writing to the device handle does not affect the pre-loaded Stream Image.*/ + /*The device handle is originally updated in adi_adrv903x_StreamImageWrite */ + ADI_LIBRARY_MEMCPY(&device->devStateInfo.txToOrxMappingConfig, mappingConfig, sizeof(adi_adrv903x_TxToOrxMappingConfig_t)); + + /* Translate Extended Flag */ + + for (idx = 0U; idx < ADI_ADRV903X_TX_TO_ORX_MAPPING_PIN_TABLE_SIZE; idx++) + { + if ((device->devStateInfo.txToOrxMappingConfig.pinTableOrx0[idx] > ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_NONE) && + (device->devStateInfo.txToOrxMappingConfig.pinTableOrx0[idx] < ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_NO_CHANGE)) + { + device->devStateInfo.txToOrxMappingConfig.pinTableOrx0[idx] = (adi_adrv903x_TxToOrxMappingPinTable_e) ((uint32_t) (device->devStateInfo.txToOrxMappingConfig.pinTableOrx0[idx] & ~TX_TO_ORX_EXTENDED_MAPPING_FLAG)); + } + + if ((device->devStateInfo.txToOrxMappingConfig.pinTableOrx1[idx] > ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_NONE) && + (device->devStateInfo.txToOrxMappingConfig.pinTableOrx1[idx] < ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_NO_CHANGE)) + { + device->devStateInfo.txToOrxMappingConfig.pinTableOrx1[idx] = (adi_adrv903x_TxToOrxMappingPinTable_e) ((uint32_t) (device->devStateInfo.txToOrxMappingConfig.pinTableOrx1[idx] & ~TX_TO_ORX_EXTENDED_MAPPING_FLAG)); + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_UartCfg(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e pinSelect) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_GpioSignal_e signal = ADI_ADRV903X_GPIO_SIGNAL_UNUSED; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Range check gpio */ + if ((pinSelect < ADI_ADRV903X_GPIO_00) || + (pinSelect >= ADI_ADRV903X_GPIO_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + pinSelect, + "Invalid GPIO selected. Out of range."); + return recoveryAction; + } + + switch (pinSelect) + { + case ADI_ADRV903X_GPIO_12: + signal = ADI_ADRV903X_GPIO_SIGNAL_UART_PADTXSOUT; + break; + default: + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + pinSelect, + "Invalid GPIO selected."); + return recoveryAction; + break; + } + + /* Set the signal for this gpio */ + recoveryAction = adrv903x_GpioSignalSet(device, pinSelect, signal, 0x00U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "GpioSignalSet issue"); + return recoveryAction; + } + + return recoveryAction; +} + +static uint32_t adrv903x_ErrReportConvert(const adi_adrv903x_Version_t version) +{ + uint32_t convertedVersion = 0U; + + /* \note Data Type Limitation due to static analysis issue with Variable Reporting; 32-bit Limit */ + + convertedVersion = ( uint32_t) ((uint8_t) version.buildVer) | /* Build Version (LSB) */ + ((uint32_t) ((uint8_t) version.maintenanceVer) << 8U) | /* Maintenance Version */ + ((uint32_t) ((uint8_t) version.minorVer) << 16U) | /* Minor Version */ + ((uint32_t) ((uint8_t) version.majorVer) << 24U); /* Major Version (MSB) */ + + return convertedVersion; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_ApiVersionRangeCheck( adi_adrv903x_Device_t* const device, + const adi_adrv903x_Version_t* const version, + const adi_adrv903x_Version_t* const minVersion, + const adi_adrv903x_Version_t* const maxVersion) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + uint32_t actualVersion = 0U; + uint32_t minimumVersion = 0U; + uint32_t maximumVersion = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, version); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, minVersion); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, maxVersion); + + if ((version->majorVer < minVersion->majorVer) || (version->majorVer > maxVersion->majorVer)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, version->majorVer, "Unexpected Major Version"); + } + + if ((version->minorVer < minVersion->minorVer) || (version->minorVer > maxVersion->minorVer)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, version->minorVer, "Unexpected Minor Version"); + } + + if ((version->maintenanceVer < minVersion->maintenanceVer) || (version->maintenanceVer > maxVersion->maintenanceVer)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, version->maintenanceVer, "Unexpected Maintenance Version"); + } + + if ((version->buildVer < minVersion->buildVer) || (version->buildVer > maxVersion->buildVer)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, version->buildVer, "Unexpected Build Version"); + } + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + actualVersion = adrv903x_ErrReportConvert(*version); + minimumVersion = adrv903x_ErrReportConvert(*minVersion); + maximumVersion = adrv903x_ErrReportConvert(*maxVersion); + + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, actualVersion, "Actual Version (Note: For Illustrative Purposes Only. Packing For Error Reporting Restricts Each Version to 8-Bits)"); + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, minimumVersion, "Minimum Version Expected (Note: For Illustrative Purposes Only. Packing For Error Reporting Restricts Each Version to 8-Bits)"); + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, maximumVersion, "Maximum Version Expected (Note: For Illustrative Purposes Only. Packing For Error Reporting Restricts Each Version to 8-Bits)"); + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SpiStreamingEntry( adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t spiConfigB = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Mask with ADI_TRUE here to check bit 0 */ + /* Each function that turns on SPI streaming should also be turning it off, however, + * if it happens that SPI streaming is On we do not need to do anything. + * This if-statement only evaluates to TRUE when spiStreaming is NOT currently ON + * and when allowSpiStreaming is TRUE. + */ + if (((device->devStateInfo.spiStreamingOn & ADI_TRUE) != ADI_TRUE) && + ((device->devStateInfo.spiOptions.allowSpiStreaming & ADI_TRUE) == ADI_TRUE)) + { + /* Writing CONFFIG_B to zero puts the part in streaming mode. */ + recoveryAction = adi_adrv903x_Register32Write(device, NULL, ADRV903X_ADDR_SPI_INTERFACE_CONFIG_B, spiConfigB, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue writing to CONFIG_B register"); + return recoveryAction; + } + + device->devStateInfo.spiStreamingOn = ADI_TRUE; + + /* Force an address word on the next SPI call by giving an invalid address here. + * adrv903x_DirectSpiDataPack checks this value as part of the logic to determine if an address word must + * be inserted. + * */ + device->devStateInfo.previousSpiStreamingAddress = 0xFFFFFFFFU; + } + else + { + /* No Action Required */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SpiStreamingExit(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t spiConfigB = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Mask with ADI_TRUE here to check bit 0 */ + /* Only perform the write when it's needed, ie Spi streaming is ON. + * */ + if ((device->devStateInfo.spiStreamingOn & ADI_TRUE) == ADI_TRUE) + { + spiConfigB |= ADRV903X_CONFIG_B_SINGLE_INSTRUCTION; + recoveryAction = adi_adrv903x_Register32Write(device, NULL, ADRV903X_ADDR_SPI_INTERFACE_CONFIG_B, spiConfigB, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue writing to CONFIG_B register"); + return recoveryAction; + } + + device->devStateInfo.spiStreamingOn = ADI_FALSE; + } + else + { + /* No Action Required */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + + return recoveryAction; +} diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_radioctrl.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_radioctrl.c new file mode 100644 index 0000000000000..3ea2c248127b4 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_radioctrl.c @@ -0,0 +1,2086 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_radioctrl.c + * \brief Contains ADRV903X radio control related private function implementations. + * + * ADRV903X API Version: 2.12.1.4 + */ +#include "../../private/include/adrv903x_radioctrl.h" +#include "../../private/include/adrv903x_rx.h" +#include "../../private/include/adrv903x_tx.h" +#include "../../private/bf/adrv903x_bf_core.h" +#include "../../private/include/adrv903x_init.h" +#include "../../private/include/adrv903x_cpu.h" +#include "../../private/include/adrv903x_cpu_cmd_ctrl.h" +#include "../../private/bf/adrv903x_bf_rx_dig.h" +#include "../../private/bf/adrv903x_bf_tx_dig.h" +#include "../../private/include/adrv903x_stream_proc_types.h" +#include "../../private/include/adrv903x_cpu_scratch_registers.h" + +#include "adi_adrv903x_rx_types.h" +#include "adi_adrv903x_tx_types.h" +#include "adi_adrv903x_cals.h" +#include "adi_adrv903x_cpu.h" +#include "adi_adrv903x_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_RADIOCTRL + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxEnableSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint32_t rxChannelEnable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t orxChanMask = rxChannelMask >> ADI_ADRV903X_MAX_RX_ONLY; + uint8_t orxChanEnable = rxChannelEnable >> ADI_ADRV903X_MAX_RX_ONLY; + uint8_t bfValue = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + recoveryAction = adrv903x_Core_RadioControlInterfaceOrxSpiEn_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &bfValue); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to enable Radio Control Orx channels."); + return recoveryAction; + } + + /* Update the bfValue */ + ADRV903X_BF_UPDATE(bfValue, orxChanEnable, orxChanMask, 0U); + + recoveryAction = adrv903x_Core_RadioControlInterfaceOrxSpiEn_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to enable Radio Control ORX channels."); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxEnableSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint32_t rxChannelEnable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t bfValue = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + recoveryAction = adrv903x_Core_RadioControlInterfaceRxSpiEn_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &bfValue); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to enable Radio Control RX channels."); + return recoveryAction; + } + + /* Update the bfValue */ + ADRV903X_BF_UPDATE(bfValue, (uint8_t)rxChannelEnable, (uint8_t)rxChannelMask, 0U); + + recoveryAction = adrv903x_Core_RadioControlInterfaceRxSpiEn_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + bfValue); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to enable Radio Control RX channels."); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxEnableSet(adi_adrv903x_Device_t* const device, + const uint32_t txChannelMask, + const uint32_t txChannelEnable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t bfValue = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + recoveryAction = adrv903x_Core_RadioControlInterfaceTxSpiEn_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &bfValue); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to enable Radio Control TX channels."); + return recoveryAction; + } + + /* Update the bfValue */ + ADRV903X_BF_UPDATE(bfValue, (uint8_t)txChannelEnable, (uint8_t)txChannelMask, 0U); + + recoveryAction = adrv903x_Core_RadioControlInterfaceTxSpiEn_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + bfValue); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to enable Radio Control TX channels."); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxTxEnableSetRangeCheck(adi_adrv903x_Device_t* const device, + const uint32_t orxChannelMask, + const uint32_t orxChannelEnable, + const uint32_t rxChannelMask, + const uint32_t rxChannelEnable, + const uint32_t txChannelMask, + const uint32_t txChannelEnable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + /*TODO: update this static const once Tx channels have been numbered from Tx/Rx 0 - Tx/Rx7 */ + static const uint32_t ALL_TX_MASK = (ADI_ADRV903X_TX0 | ADI_ADRV903X_TX1 | ADI_ADRV903X_TX2 | ADI_ADRV903X_TX3 | + ADI_ADRV903X_TX4 | ADI_ADRV903X_TX5 | ADI_ADRV903X_TX6 | ADI_ADRV903X_TX7); + static const uint32_t ALL_RX_MASK = (ADI_ADRV903X_RX0 | ADI_ADRV903X_RX1 | ADI_ADRV903X_RX2 | ADI_ADRV903X_RX3 | + ADI_ADRV903X_RX4 | ADI_ADRV903X_RX5 | ADI_ADRV903X_RX6 | ADI_ADRV903X_RX7); + static const uint32_t ALL_ORX_MASK = (ADI_ADRV903X_ORX0 | ADI_ADRV903X_ORX1); + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + (void)orxChannelEnable; + (void)rxChannelEnable; + (void)txChannelEnable; + + /* Check that ARM and Stream processors have been loaded before enabling */ + if (device->devStateInfo.devState < ADI_ADRV903X_STATE_ALLCPUSLOADED) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Channel Enable/Disable is valid only after loading of CPU(s) & Stream processors"); + return recoveryAction; + } + + /* Check that ORx channel mask is valid */ + if ((orxChannelMask & (~(uint32_t)ALL_ORX_MASK)) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + NULL, + "Invalid ORx Channel mask encountered while attempting to enable ORx signal chain in SPI mode."); + return recoveryAction; + } + + /* Check that Rx channel mask is valid */ + if (rxChannelMask > ALL_RX_MASK) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + NULL, + "Invalid Rx Channel mask encountered while attempting to enable Rx signal chain in SPI mode."); + return recoveryAction; + } + + /* Check that Tx channel mask is valid */ + if (txChannelMask > ALL_TX_MASK) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txChannelMask, + "Invalid Tx Channel mask encountered while attempting to enable Tx signal chain in SPI mode."); + return recoveryAction; + } + + /* Check that requested ORx channels are initialized */ + if ((orxChannelMask & device->devStateInfo.initializedChannels) != orxChannelMask) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannelMask, + "Requested ORx channels to enable are not initialized"); + return recoveryAction; + } + + /* Check that requested Rx/ORx channels are initialized */ + if ((rxChannelMask & device->devStateInfo.initializedChannels) != rxChannelMask) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannelMask, + "Requested Rx channels to enable are not initialized"); + return recoveryAction; + } + + /* Check that requested Tx channels are initialized */ + if ((txChannelMask & (device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET)) != txChannelMask) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txChannelMask, + "Requested Tx channels to be enable are not initialized"); + return recoveryAction; + } + + return ADI_ADRV903X_ERR_ACT_NONE; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RadioCtrlCfgSetRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RadioCtrlModeCfg_t* const radioCtrlCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, radioCtrlCfg); + + static const uint32_t ALL_RX_MASK = (ADI_ADRV903X_RX0 | ADI_ADRV903X_RX1 | ADI_ADRV903X_RX2 | ADI_ADRV903X_RX3 | + ADI_ADRV903X_RX4 | ADI_ADRV903X_RX5 | ADI_ADRV903X_RX6 | ADI_ADRV903X_RX7); + static const uint32_t ALL_ORX_MASK = (ADI_ADRV903X_ORX0 | ADI_ADRV903X_ORX1); + + if (radioCtrlCfg->rxRadioCtrlModeCfg.rxEnableMode != ADI_ADRV903X_RX_EN_INVALID_MODE) + { + /*check if Rx profile is valid*/ + if ((device->devStateInfo.profilesValid & ADI_ADRV903X_RX_PROFILE_VALID) != ADI_ADRV903X_RX_PROFILE_VALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + device->devStateInfo.profilesValid, + "No valid Rx profile is loaded."); + return recoveryAction; + } + + /*Check that if requested Rx Channel is valid*/ + if (((radioCtrlCfg->rxRadioCtrlModeCfg.rxChannelMask & (~(uint32_t)ALL_RX_MASK)) != 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + radioCtrlCfg->rxRadioCtrlModeCfg.rxChannelMask, + "Invalid Rx channel is selected. Valid values are any combinations of Rx0/1/2/3/4/5/6/7"); + return recoveryAction; + } + + if ((radioCtrlCfg->rxRadioCtrlModeCfg.rxEnableMode != ADI_ADRV903X_RX_EN_SPI_MODE) && + (radioCtrlCfg->rxRadioCtrlModeCfg.rxEnableMode != ADI_ADRV903X_RX_EN_PIN_MODE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + radioCtrlCfg->rxRadioCtrlModeCfg.rxEnableMode, + "Invalid Rx signal chain enable mode selected. Valid values include SPI, Pin mode"); + return recoveryAction; + } + } + + if (radioCtrlCfg->txRadioCtrlModeCfg.txEnableMode != ADI_ADRV903X_TX_EN_INVALID_MODE) + { + /*check if Tx profile is valid*/ + if ((device->devStateInfo.profilesValid & ADI_ADRV903X_TX_PROFILE_VALID) != ADI_ADRV903X_TX_PROFILE_VALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + device->devStateInfo.profilesValid, + "No valid Tx profile is loaded."); + return recoveryAction; + } + + /*Check that if requested Tx Channel is valid*/ + if (((radioCtrlCfg->txRadioCtrlModeCfg.txChannelMask & (~(uint32_t)ADI_ADRV903X_TXALL)) != 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + radioCtrlCfg->txRadioCtrlModeCfg.txChannelMask, + "Invalid Tx channel is selected. Valid values are any combinations of Tx0/1/2/3/4/5/6/7"); + return recoveryAction; + + } + + if ((radioCtrlCfg->txRadioCtrlModeCfg.txEnableMode != ADI_ADRV903X_TX_EN_SPI_MODE) && + (radioCtrlCfg->txRadioCtrlModeCfg.txEnableMode != ADI_ADRV903X_TX_EN_PIN_MODE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + radioCtrlCfg->txRadioCtrlModeCfg.txEnableMode, + "Invalid Tx signal chain enable mode selected. Valid values include SPI, Pin mode"); + return recoveryAction; + } + } + + if (radioCtrlCfg->orxRadioCtrlModeCfg.orxEnableMode != ADI_ADRV903X_ORX_EN_INVALID_MODE) + { + if ((device->devStateInfo.profilesValid & ADI_ADRV903X_ORX_PROFILE_VALID) != ADI_ADRV903X_ORX_PROFILE_VALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + device->devStateInfo.profilesValid, + "No valid ORx profile is loaded."); + return recoveryAction; + } + + /*Check that if requested ORx Channel is valid*/ + if ((radioCtrlCfg->orxRadioCtrlModeCfg.orxChannelMask & (~(uint32_t)ALL_ORX_MASK))) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + radioCtrlCfg->orxRadioCtrlModeCfg.orxChannelMask, + "Invalid ORx channel is selected. Valid values are any combinations of ORx0/1"); + return recoveryAction; + } + + if ((radioCtrlCfg->orxRadioCtrlModeCfg.orxEnableMode != ADI_ADRV903X_ORX_EN_SPI_MODE) && + (radioCtrlCfg->orxRadioCtrlModeCfg.orxEnableMode != ADI_ADRV903X_ORX_EN_PIN_MODE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + radioCtrlCfg->orxRadioCtrlModeCfg.orxEnableMode, + "Invalid ORx signal chain enable mode selected. Valid values include SPI, Pin mode"); + return recoveryAction; + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxRadioCtrlCfgSet(adi_adrv903x_Device_t * const device, + adi_adrv903x_RxRadioCtrlModeCfg_t* const rxRadioCtrlModeCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t armModeRxChanMask = 0x0U; /* Bit N indicates RxN is in ARM mode. ARM mode overrides SPI/Pin-mode. */ + uint8_t spiModeRxChanMask = 0x0U; /* If RxN is not in ARM mode then bit N here indicates RxN is SPI-mode (1) or Pin-mode (0) */ + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxRadioCtrlModeCfg); + + /* Fetch the current Spi-enabled/Pin-enabled and ARM override status for Rx channels */ + recoveryAction = adrv903x_Core_RadioControlInterfaceRxSpiModeSel_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &spiModeRxChanMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Get RX Radio Control Cfg Failed."); + return recoveryAction; + } + + /* For both pin or SPI mode we disable ARM MODE for the Rx channels */ + armModeRxChanMask = ((uint8_t) rxRadioCtrlModeCfg->rxChannelMask); + recoveryAction = adrv903x_Core_RadioControlInterfaceRxArmModeSelClr_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + armModeRxChanMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API RX Radio Control Cfg Failed."); + return recoveryAction; + } + + if (rxRadioCtrlModeCfg->rxEnableMode == ADI_ADRV903X_RX_EN_SPI_MODE) + { + /* Enable Spi mode for the channels - turn on the relevant bits in SpiModeSel register */ + spiModeRxChanMask |= rxRadioCtrlModeCfg->rxChannelMask; + + } + else if (rxRadioCtrlModeCfg->rxEnableMode == ADI_ADRV903X_RX_EN_PIN_MODE) + { + /* Enable pin-mode for the channels - turn off the relevant bits in SpiModeSel register */ + spiModeRxChanMask &= ~((uint8_t) rxRadioCtrlModeCfg->rxChannelMask); + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxRadioCtrlModeCfg->rxEnableMode, + "Invalid Rx Enable Mode encountered while attempting to configure Rx radio ctrl configuration settings"); + return recoveryAction; + } + + /* Write the updated SpiMode register */ + recoveryAction = adrv903x_Core_RadioControlInterfaceRxSpiModeSel_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + (uint8_t) spiModeRxChanMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API RX Radio Control Cfg Failed."); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxRadioCtrlCfgSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TxRadioCtrlModeCfg_t* const txRadioCtrlModeCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t txSpiModeSel = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, txRadioCtrlModeCfg); + + /* Disable ARM MODE for Tx ctrl configuration */ + recoveryAction = adrv903x_Core_RadioControlInterfaceTxArmModeSelClr_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + (uint8_t) txRadioCtrlModeCfg->txChannelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API TX Radio Control Cfg Failed."); + return recoveryAction; + } + + /* Read Spi mode */ + recoveryAction = adrv903x_Core_RadioControlInterfaceTxSpiModeSel_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &txSpiModeSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API TX Radio Control Cfg Failed."); + return recoveryAction; + } + + /*For Spi mode set Spi Mode bitfield to 1 and for pin mode set the Spi mode bitfield to 0*/ + if (txRadioCtrlModeCfg->txEnableMode == ADI_ADRV903X_TX_EN_SPI_MODE) + { + /* Enable Spi mode */ + txSpiModeSel |= (uint8_t) txRadioCtrlModeCfg->txChannelMask; + + } + else if (txRadioCtrlModeCfg->txEnableMode == ADI_ADRV903X_TX_EN_PIN_MODE) + { + /* Disable Spi mode */ + txSpiModeSel &= ~((uint8_t) txRadioCtrlModeCfg->txChannelMask); + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txRadioCtrlModeCfg->txEnableMode, + "Invalid Tx Enable Mode encountered while attempting to configure Tx radio ctrl configuration settings"); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_RadioControlInterfaceTxSpiModeSel_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + txSpiModeSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API TX Radio Control Cfg Failed."); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxRadioCtrlCfgSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_ORxRadioCtrlModeCfg_t* const orxRadioCtrlModeCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t orxSpiModeSel = 0U; + uint8_t orxChanMask = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, orxRadioCtrlModeCfg); + + orxChanMask = (uint8_t) (orxRadioCtrlModeCfg->orxChannelMask >> ADI_ADRV903X_MAX_RX_ONLY); + + /* Disable ARM override ctrl for ORx ctrl configuration */ + recoveryAction = adrv903x_Core_RadioControlInterfaceOrxArmModeSelClr_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + orxChanMask); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API ORX Radio Control Cfg Failed."); + return recoveryAction; + } + + /* Read Spi mode sel */ + recoveryAction = adrv903x_Core_RadioControlInterfaceOrxSpiModeSel_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &orxSpiModeSel); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API ORX Radio Control Cfg Failed."); + return recoveryAction; + } + + /*For Spi mode set Spi Mode bitfield to 1 and for pin mode set the Spi mode bitfield to 0*/ + if (orxRadioCtrlModeCfg->orxEnableMode == ADI_ADRV903X_ORX_EN_SPI_MODE) + { + + /* Enable Spi mode */ + orxSpiModeSel |= orxChanMask; + } + else if (orxRadioCtrlModeCfg->orxEnableMode == ADI_ADRV903X_ORX_EN_PIN_MODE) + { + /* Disable Spi mode */ + orxSpiModeSel &= ~orxChanMask; + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + orxRadioCtrlModeCfg->orxEnableMode, + "Invalid ORx Enable Mode encountered while attempting to configure Rx radio ctrl configuration settings"); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_RadioControlInterfaceOrxSpiModeSel_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + orxSpiModeSel); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API ORX Radio Control Cfg Failed."); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxRadioCtrlCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_ORxRadioCtrlModeCfg_t* const orxRadioCtrlModeCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t orxArmMode = 0U; + uint8_t orxChannel = 0U; + uint8_t orxSpiMode = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, orxRadioCtrlModeCfg); + + orxChannel = (uint8_t)(rxChannel >> ADI_ADRV903X_MAX_RX_ONLY); + /* Verify only one ORX channel is set */ + if (orxChannel & (orxChannel - 1U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid ORX Channel selection."); + return recoveryAction; + } + + orxRadioCtrlModeCfg->orxChannelMask = 0; + orxRadioCtrlModeCfg->orxEnableMode = ADI_ADRV903X_ORX_EN_INVALID_MODE; + + /* Read ORX ARM Override ctrl bitfield*/ + recoveryAction = adrv903x_Core_RadioControlInterfaceOrxArmModeSel_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &orxArmMode); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Get ORX Radio Control Cfg Failed."); + return recoveryAction; + } + + /* The Spi mode bitfield is only valid if ARM override ctrl is set to 0 */ + if ((orxArmMode & orxChannel) == 0) + { + /* Read Pin ctrl mode */ + recoveryAction = adrv903x_Core_RadioControlInterfaceOrxSpiModeSel_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &orxSpiMode); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Get ORX Radio Control Cfg Failed."); + return recoveryAction; + } + + /* 'Spi Mode' bit field: 1 (Spi Mode), 0 (Pin Mode) */ + if ((orxChannel & orxSpiMode) == orxChannel) + { + orxRadioCtrlModeCfg->orxEnableMode = ADI_ADRV903X_ORX_EN_SPI_MODE; + } + else + { + orxRadioCtrlModeCfg->orxEnableMode = ADI_ADRV903X_ORX_EN_PIN_MODE; + } + } + + /*Update the ORx channel mask*/ + orxRadioCtrlModeCfg->orxChannelMask = rxChannel; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxRadioCtrlCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxRadioCtrlModeCfg_t * const rxRadioCtrlModeCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t rxArmMode = 0U; + uint8_t rxSpiMode = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxRadioCtrlModeCfg); + + rxRadioCtrlModeCfg->rxChannelMask = 0; + rxRadioCtrlModeCfg->rxEnableMode = ADI_ADRV903X_RX_EN_INVALID_MODE; + + /* Verify only one ORX channel is set */ + if ((rxChannel & ~ADI_ADRV903X_RX_MASK_ALL) || (rxChannel & (rxChannel - 1U))) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid RX Channel selection."); + return recoveryAction; + } + + /* Read RX ARM Override ctrl bitfield*/ + recoveryAction = adrv903x_Core_RadioControlInterfaceRxArmModeSel_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &rxArmMode); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Get RX Radio Control Cfg Failed."); + return recoveryAction; + } + + /* The Spi mode bitfield is only valid if ARM override ctrl is set to 0 */ + if ((rxArmMode & rxChannel) == 0) + { + /* Read Pin ctrl mode */ + recoveryAction = adrv903x_Core_RadioControlInterfaceRxSpiModeSel_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &rxSpiMode); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Get RX Radio Control Cfg Failed."); + return recoveryAction; + } + + /* 'Spi Mode' bit field: 1 (Spi Mode), 0 (Pin Mode) */ + if ((rxChannel & rxSpiMode) == rxChannel) + { + rxRadioCtrlModeCfg->rxEnableMode = ADI_ADRV903X_RX_EN_SPI_MODE; + } + else + { + rxRadioCtrlModeCfg->rxEnableMode = ADI_ADRV903X_RX_EN_PIN_MODE; + } + } + + /*Update the ORx channel mask*/ + rxRadioCtrlModeCfg->rxChannelMask = rxChannel; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxRadioCtrlCfgGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxRadioCtrlModeCfg_t * const txRadioCtrlModeCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t txArmMode = 0U; + uint8_t txSpiMode = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, txRadioCtrlModeCfg); + + txRadioCtrlModeCfg->txChannelMask = 0; + txRadioCtrlModeCfg->txEnableMode = ADI_ADRV903X_TX_EN_INVALID_MODE; + + /* Verify only one TX channel is set */ + if (txChannel & (txChannel - 1U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid TX Channel selection."); + return recoveryAction; + } + + /*Read TX ARM Mode ctrl bitfield*/ + recoveryAction = adrv903x_Core_RadioControlInterfaceTxArmModeSel_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &txArmMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Get TX Radio Control Cfg Failed."); + return recoveryAction; + } + + /* The Spi mode bitfield is only valid if ARM mode ctrl is not set to 1 */ + if ((txArmMode & txChannel) == 0) + { + /* Read TX Pin ctrl mode */ + recoveryAction = adrv903x_Core_RadioControlInterfaceTxSpiModeSel_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &txSpiMode); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Get TX Radio Control Cfg Failed."); + return recoveryAction; + } + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Get TX Radio Control Cfg Failed."); + return recoveryAction; + } + + /* 'Spi Mode' bit field: 1 (Spi Mode), 0 (Pin Mode) */ + if ((txChannel & txSpiMode) == txChannel) + { + txRadioCtrlModeCfg->txEnableMode = ADI_ADRV903X_TX_EN_SPI_MODE; + } + else + { + txRadioCtrlModeCfg->txEnableMode = ADI_ADRV903X_TX_EN_PIN_MODE; + } + } + + /*Update the Tx Channel mask*/ + txRadioCtrlModeCfg->txChannelMask = txChannel; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoUnlockGpInterruptMaskGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoName_e loName, + uint8_t* const loGpInterruptPin0Mask, + uint8_t* const loGpInterruptPin1Mask) +{ + static const uint8_t LO0_GP_INTERRUPT_SHIFT = 32U; + uint64_t LO0_GP_INTERRUPT_UINT64_MASK = (uint64_t)1U << LO0_GP_INTERRUPT_SHIFT; /* east */ + static const uint8_t LO1_GP_INTERRUPT_SHIFT = 31U; + uint64_t LO1_GP_INTERRUPT_UINT64_MASK = (uint64_t)1U << LO1_GP_INTERRUPT_SHIFT; /* west */ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint64_t gpInterruptPin0Mask = 0U; + uint64_t gpInterruptPin1Mask = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, loGpInterruptPin0Mask); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, loGpInterruptPin1Mask); + + /* Read GP Interrupt Pin0 and Pin1 mask */ + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &gpInterruptPin0Mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get GPIO Interrupt Pin 0 failed."); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &gpInterruptPin1Mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get GPIO Interrupt Pin 1 failed."); + return recoveryAction; + } + + switch (loName) + { + case(ADI_ADRV903X_LO0): + { + *loGpInterruptPin0Mask = (uint8_t)ADRV903X_BF_DECODE(gpInterruptPin0Mask, LO0_GP_INTERRUPT_UINT64_MASK, LO0_GP_INTERRUPT_SHIFT); + *loGpInterruptPin1Mask = (uint8_t)ADRV903X_BF_DECODE(gpInterruptPin1Mask, LO0_GP_INTERRUPT_UINT64_MASK, LO0_GP_INTERRUPT_SHIFT); + + break; + } + case(ADI_ADRV903X_LO1): + { + *loGpInterruptPin0Mask = (uint8_t)ADRV903X_BF_DECODE(gpInterruptPin0Mask, LO1_GP_INTERRUPT_UINT64_MASK, LO1_GP_INTERRUPT_SHIFT); + *loGpInterruptPin1Mask = (uint8_t)ADRV903X_BF_DECODE(gpInterruptPin1Mask, LO1_GP_INTERRUPT_UINT64_MASK, LO1_GP_INTERRUPT_SHIFT); + break; + } + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, loName, "Invalid LO selection while attempting to retrieve LO GP Interrupt mask."); + return recoveryAction; + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoUnlockGpInterruptMaskSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoName_e loName, + const uint8_t loGpInterruptPin0Mask, + const uint8_t loGpInterruptPin1Mask) +{ + static const uint8_t LO0_GP_INTERRUPT_SHIFT = 32U; + uint64_t LO0_GP_INTERRUPT_UINT64_MASK = (uint64_t)1U << LO0_GP_INTERRUPT_SHIFT; /* east */ + static const uint8_t LO1_GP_INTERRUPT_SHIFT = 31U; + uint64_t LO1_GP_INTERRUPT_UINT64_MASK = (uint64_t)1U << LO1_GP_INTERRUPT_SHIFT; /* west */ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint64_t gpInterruptPin0Mask = 0U; + uint64_t gpInterruptPin1Mask = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Read GP Interrupt Pin0 and Pin1 mask */ + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &gpInterruptPin0Mask); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get GPIO Interrupt Pin 0 failed."); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &gpInterruptPin1Mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get GPIO Interrupt Pin 1 failed."); + return recoveryAction; + } + + switch (loName) + { + case(ADI_ADRV903X_LO0): + { + /* Update GP Interrupt Mask */ + ADRV903X_BF_UPDATE(gpInterruptPin0Mask, (uint64_t)loGpInterruptPin0Mask, LO0_GP_INTERRUPT_UINT64_MASK, LO0_GP_INTERRUPT_SHIFT); + ADRV903X_BF_UPDATE(gpInterruptPin1Mask, (uint64_t)loGpInterruptPin1Mask, LO0_GP_INTERRUPT_UINT64_MASK, LO0_GP_INTERRUPT_SHIFT); + break; + } + case(ADI_ADRV903X_LO1): + { + /* Update GP Interrupt Mask */ + ADRV903X_BF_UPDATE(gpInterruptPin0Mask, (uint64_t)loGpInterruptPin0Mask, LO1_GP_INTERRUPT_UINT64_MASK, LO1_GP_INTERRUPT_SHIFT); + ADRV903X_BF_UPDATE(gpInterruptPin1Mask, (uint64_t)loGpInterruptPin1Mask, LO1_GP_INTERRUPT_UINT64_MASK, LO1_GP_INTERRUPT_SHIFT); + break; + } + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, loName, "Invalid LO selection while attempting to set LO GP Interrupt mask"); + return recoveryAction; + } + } + + /* Write GP Interrupt Pin0 and Pin1 mask */ + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + gpInterruptPin0Mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Set GPIO Interrupt Pin 0 failed."); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + gpInterruptPin1Mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Set GPIO Interrupt Pin 1 failed."); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoOverrangeGpInterruptMaskGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoName_e loName, + uint8_t* const loGpInterruptPin0Mask, + uint8_t* const loGpInterruptPin1Mask) +{ + static const uint8_t LO0_GP_INTERRUPT_SHIFT = 29U; + uint64_t LO0_GP_INTERRUPT_UINT64_MASK = (uint64_t)1U << LO0_GP_INTERRUPT_SHIFT; /* east */ + static const uint8_t LO1_GP_INTERRUPT_SHIFT = 28U; + uint64_t LO1_GP_INTERRUPT_UINT64_MASK = (uint64_t)1U << LO1_GP_INTERRUPT_SHIFT; /* west */ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint64_t gpInterruptPin0Mask = 0U; + uint64_t gpInterruptPin1Mask = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, loGpInterruptPin0Mask); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, loGpInterruptPin1Mask); + + /* Read GP Interrupt Pin0 and Pin1 mask */ + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &gpInterruptPin0Mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get GPIO Interrupt Pin 0 failed."); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &gpInterruptPin1Mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get GPIO Interrupt Pin 1 failed."); + return recoveryAction; + } + + switch (loName) + { + case(ADI_ADRV903X_LO0): + { + *loGpInterruptPin0Mask = (uint8_t)ADRV903X_BF_DECODE(gpInterruptPin0Mask, LO0_GP_INTERRUPT_UINT64_MASK, LO0_GP_INTERRUPT_SHIFT); + *loGpInterruptPin1Mask = (uint8_t)ADRV903X_BF_DECODE(gpInterruptPin1Mask, LO0_GP_INTERRUPT_UINT64_MASK, LO0_GP_INTERRUPT_SHIFT); + + break; + } + case(ADI_ADRV903X_LO1): + { + *loGpInterruptPin0Mask = (uint8_t)ADRV903X_BF_DECODE(gpInterruptPin0Mask, LO1_GP_INTERRUPT_UINT64_MASK, LO1_GP_INTERRUPT_SHIFT); + *loGpInterruptPin1Mask = (uint8_t)ADRV903X_BF_DECODE(gpInterruptPin1Mask, LO1_GP_INTERRUPT_UINT64_MASK, LO1_GP_INTERRUPT_SHIFT); + break; + } + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, loName, "Invalid LO selection while attempting to retrieve LO GP Interrupt mask."); + return recoveryAction; + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoOverrangeGpInterruptMaskSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoName_e loName, + const uint8_t loGpInterruptPin0Mask, + const uint8_t loGpInterruptPin1Mask) +{ + static const uint8_t LO0_GP_INTERRUPT_SHIFT = 29U; + uint64_t LO0_GP_INTERRUPT_UINT64_MASK = (uint64_t)1U << LO0_GP_INTERRUPT_SHIFT; /* east */ + static const uint8_t LO1_GP_INTERRUPT_SHIFT = 28U; + uint64_t LO1_GP_INTERRUPT_UINT64_MASK = (uint64_t)1U << LO1_GP_INTERRUPT_SHIFT; /* west */ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint64_t gpInterruptPin0Mask = 0U; + uint64_t gpInterruptPin1Mask = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Read GP Interrupt Pin0 and Pin1 mask */ + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &gpInterruptPin0Mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get GPIO Interrupt Pin 0 failed."); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &gpInterruptPin1Mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get GPIO Interrupt Pin 1 failed."); + return recoveryAction; + } + + switch (loName) + { + case(ADI_ADRV903X_LO0): + { + /* Update GP Interrupt Mask */ + ADRV903X_BF_UPDATE(gpInterruptPin0Mask, (uint64_t)loGpInterruptPin0Mask, LO0_GP_INTERRUPT_UINT64_MASK, LO0_GP_INTERRUPT_SHIFT); + ADRV903X_BF_UPDATE(gpInterruptPin1Mask, (uint64_t)loGpInterruptPin1Mask, LO0_GP_INTERRUPT_UINT64_MASK, LO0_GP_INTERRUPT_SHIFT); + break; + } + case(ADI_ADRV903X_LO1): + { + /* Update GP Interrupt Mask */ + ADRV903X_BF_UPDATE(gpInterruptPin0Mask, (uint64_t)loGpInterruptPin0Mask, LO1_GP_INTERRUPT_UINT64_MASK, LO1_GP_INTERRUPT_SHIFT); + ADRV903X_BF_UPDATE(gpInterruptPin1Mask, (uint64_t)loGpInterruptPin1Mask, LO1_GP_INTERRUPT_UINT64_MASK, LO1_GP_INTERRUPT_SHIFT); + break; + } + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, loName, "Invalid LO selection while attempting to set LO GP Interrupt mask"); + return recoveryAction; + } + } + + /* Write GP Interrupt Pin0 and Pin1 mask */ + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + gpInterruptPin0Mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Set GPIO Interrupt Pin 0 failed."); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + gpInterruptPin1Mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Set GPIO Interrupt Pin 1 failed."); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoFrequencySetRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoConfig_t* const loConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t areCalsRunning = 0U; + adi_adrv903x_LoSel_e loSelect = ADI_ADRV903X_LOSEL_LO1; + adi_adrv903x_LoSel_e loSelectGet = ADI_ADRV903X_LOSEL_LO1; + uint64_t maxRfBandwidth_kHz = 0U; + uint8_t i = 0U; + adi_adrv903x_TxChannels_e txChannel = ADI_ADRV903X_TXOFF; + adi_adrv903x_RxChannels_e rxChannel = ADI_ADRV903X_RXOFF; + int64_t freqValid = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, loConfig); + + /*Check that LO Name selected is valid */ + if ((loConfig->loName != ADI_ADRV903X_LO0) && + (loConfig->loName != ADI_ADRV903X_LO1) + ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, loConfig->loName, "Invalid LO selected for setting LO frequency"); + return recoveryAction; + } + + /*Check that PLL mode is valid*/ + if ((loConfig->loConfigSel != ADI_ADRV903X_NCO_NO_OPTION_SELECTED) && + (loConfig->loConfigSel != ADI_ADRV903X_NCO_AUTO_UPDATE_DISABLE)) + { + + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, loConfig->loName, "Invalid LO Config selected for setting LO frequency"); + return recoveryAction; + } + + /* Determine the PLL Frequency LO Selection */ + if (loConfig->loName == ADI_ADRV903X_LO0) + { + loSelect = ADI_ADRV903X_LOSEL_LO0; + } + else if (loConfig->loName == ADI_ADRV903X_LO1) + { + loSelect = ADI_ADRV903X_LOSEL_LO1; + } + /* Find the largest bandwidth of all the initialized Tx or Rx chans driven by the LO. */ + maxRfBandwidth_kHz = 0U; + if ((device->devStateInfo.profilesValid & ADI_ADRV903X_TX_PROFILE_VALID) == ADI_ADRV903X_TX_PROFILE_VALID) + { + for (i = 0U; i < ADI_ADRV903X_MAX_TXCHANNELS; i++) + { + /* convert the index to matching the channel */ + txChannel = (adi_adrv903x_TxChannels_e)((uint8_t)(1U << i)); + if (((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & (uint32_t)txChannel) + == (uint32_t)txChannel) + { + /* Tx chan i is initialized. */ + recoveryAction = adrv903x_TxLoSourceGet(device, txChannel, &loSelectGet); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "TxLoSourceGet Issue"); + return recoveryAction; + } + + if (loSelectGet == loSelect) + { + /* Tx chan i is driven by the lo whose freq is being changed */ + if (device->initExtract.tx.txChannelCfg[i].rfBandwidth_kHz > maxRfBandwidth_kHz) + { + /* This Tx chan has the largest bandwidth so far; Update max. */ + maxRfBandwidth_kHz = device->initExtract.tx.txChannelCfg[i].rfBandwidth_kHz; + } + } + } + } + } + + /* Find the greatest RX Output Rates value of the same LO */ + if ((device->devStateInfo.profilesValid & ADI_ADRV903X_RX_PROFILE_VALID) == ADI_ADRV903X_RX_PROFILE_VALID) + { + for (i = 0U; i < ADI_ADRV903X_MAX_RX_ONLY; i++) + { + /* convert the index to matching the channel */ + rxChannel = (adi_adrv903x_RxChannels_e)((uint8_t)(1U << i)); + if ((device->devStateInfo.initializedChannels & (uint32_t)rxChannel) == (uint32_t)rxChannel) + { + recoveryAction = adrv903x_RxLoSourceGet(device, rxChannel, &loSelectGet); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxLoSourceGet Issue"); + return recoveryAction; + } + if (loSelectGet == loSelect) + { + /* Now check if matching LO then compare to get max value */ + if (device->initExtract.rx.rxChannelCfg[i].rfBandwidth_kHz > maxRfBandwidth_kHz) + { + maxRfBandwidth_kHz = device->initExtract.rx.rxChannelCfg[i].rfBandwidth_kHz; + } + } + } + } + } + + /* The rule is that the PLL LO frequency must always more than half of the greatest bandwidth. */ + freqValid = (int64_t)loConfig->loFrequency_Hz - (int64_t)((maxRfBandwidth_kHz * 1000) >> 1U); + if ((freqValid <= 0U) && (maxRfBandwidth_kHz > 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_RADIOCTRL, + ADI_ADRV903X_ERRCODE_RADIOCTRL_LO_CFG, + recoveryAction, + loConfig->loFrequency_Hz, + "(loFreq - Bandwidth/2) should be greater than DC."); + return recoveryAction; + } + + /*Check that init cals are not running*/ + recoveryAction = (adi_adrv903x_ErrAction_e)adi_adrv903x_InitCalsCheckCompleteGet(device, &areCalsRunning, ADI_FALSE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "InitCalsCheckCompleteGet Issue"); + return recoveryAction; + } + + if (areCalsRunning == 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, areCalsRunning, "Can not set LO frequency while InitCals are running"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_LoLoopFilterSetRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoName_e loName, + const adi_adrv903x_LoLoopFilterCfg_t* const loLoopFilterConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + static const uint16_t MIN_LOOPBANDWIDTH_KHZ = 60; + static const uint16_t MAX_LOOPBANDWIDTH_KHZ = 1000; + static const uint8_t MIN_PHASEMARGIN_DEGREE = 45; + static const uint8_t MAX_PHASEMARGIN_DEGREE = 75; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, loLoopFilterConfig); + + if ((loName != ADI_ADRV903X_LO0) && (loName != ADI_ADRV903X_LO1)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, loName, "Invalid LO selected for setting LO Loop filter"); + return recoveryAction; + } + + if ((loLoopFilterConfig->loopBandwidth_kHz < MIN_LOOPBANDWIDTH_KHZ) || (loLoopFilterConfig->loopBandwidth_kHz > MAX_LOOPBANDWIDTH_KHZ)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, loName, "Invalid loop bandwidth for setting LO Loop filter"); + return recoveryAction; + } + + if ((loLoopFilterConfig->phaseMargin_degrees < MIN_PHASEMARGIN_DEGREE) || (loLoopFilterConfig->phaseMargin_degrees > MAX_PHASEMARGIN_DEGREE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, loName, "Invalid phase margin for setting LO Loop filter"); + return recoveryAction; + } + + return ADI_ADRV903X_ERR_ACT_NONE; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_StreamTrigger(adi_adrv903x_Device_t* const device, + const uint8_t streamId) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t cpuCommandBusy = 0U; + uint32_t timeout_us = ADI_ADRV903X_SENDCPUCMD_TIMEOUT_US; + uint32_t waitInterval_us = ADI_ADRV903X_SENDCPUCMD_INTERVAL_US; + uint32_t eventCheck = 0U; + uint32_t numEventChecks = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* setting a 2 second timeout for mailbox busy bit to be clear (can't send an cpu mailbox command until mailbox is ready) */ +#if ADI_ADRV903X_SENDCPUCMD_INTERVAL_US > ADI_ADRV903X_SENDCPUCMD_TIMEOUT_US + waitInterval_us = timeout_us; +#elif ADI_ADRV903X_SENDCPUCMD_INTERVAL_US == 0 + waitInterval_us = timeout_us; +#endif + numEventChecks = timeout_us / waitInterval_us; + + /* timeout event loop to permit non-blocking of thread */ + for (eventCheck = 0U; eventCheck <= numEventChecks; ++eventCheck) + { + recoveryAction = adrv903x_Core_Arm0Spi0CommandBusy_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &cpuCommandBusy); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register Read (for CPU 0 Command Busy Bit) Issue"); + return recoveryAction; + } + + if (cpuCommandBusy == ADI_TRUE) + { + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, waitInterval_us); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Request Issue"); + return recoveryAction; + } + } + else + { + break; + } + } + + /* if busy bit remains set after timeout event loop function is exited, otherwise command is sent */ + if (cpuCommandBusy == ADI_TRUE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_CMD_TIMEOUT, + recoveryAction, + cpuCommandBusy, + "CPU Mailbox Busy; Timeout Occurred"); + return recoveryAction; + } + else + { + /*Write streamId to payload in arm mailbox*/ + recoveryAction = adrv903x_Core_Arm0Spi0ExtCmdByte1_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + streamId); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting Core Stream Processor stream ID number to trigger."); + return recoveryAction; + } + + /*Write opcode to trigger Core Stream Processor rather than send command to ARM*/ + recoveryAction = adrv903x_Core_Arm0Spi0Command_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + ADRV903X_CPU_STREAM_TRIGGER_OPCODE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while triggering Core Stream Processor directly from API."); + return recoveryAction; + } + + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxStreamTrigger(adi_adrv903x_Device_t* const device, + const uint8_t txChanMask, + const uint8_t txStreamId) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + const uint32_t NUM_OF_EVENT_CHECKS = 1000U; + const uint32_t UNUSED_STREAM_ID = 0xFFU; /* The value of unused TX stream ID need to match the value used by core stream */ + uint32_t eventCheck = 0U; + uint8_t rdStreamId = 0; + uint8_t byteWriteBuf[2] = { 0U, 0U }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* timeout event loop to permit non-blocking of thread */ + for (eventCheck = 0U; eventCheck <= NUM_OF_EVENT_CHECKS; ++eventCheck) + { + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ADRV903X_TRIGGER_SLICE_STREAM_NUM, + &rdStreamId); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading stream ID from scratchpad register."); + return recoveryAction; + } + + if (rdStreamId != UNUSED_STREAM_ID) + { + recoveryAction = (adi_adrv903x_ErrAction_e)adi_adrv903x_hal_Wait_us(&device->common, 1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Request Issue"); + return recoveryAction; + } + } + else + { + break; + } + } + + /* if stream ID indicates that previous request was still not processed, exit with error */ + if (rdStreamId != UNUSED_STREAM_ID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Core SP Busy"); + return recoveryAction; + } + else + { + /* Set requested TX stream ID to be run */ + byteWriteBuf[0] = (uint8_t)txStreamId; + + /* Update Tx channel bitmask */ + byteWriteBuf[1] = txChanMask; + + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_CORE_STREAM_SCRATCH204, byteWriteBuf, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot write to Core scratch pad registers"); + return recoveryAction; + } + + recoveryAction = adrv903x_StreamTrigger(device, ADRV903X_STREAM_MAIN_TRIGGER_TX_STREAM); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while triggering Core Stream to trigger TX stream"); + return recoveryAction; + } + } + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxStreamTrigger(adi_adrv903x_Device_t* const device, + const uint8_t rxChanMask, + const uint8_t rxStreamId) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + const uint32_t NUM_OF_EVENT_CHECKS = 1000U; + const uint32_t UNUSED_STREAM_ID = 0xFFU; /* The value of unused RX stream ID need to match the value used by core stream */ + uint32_t eventCheck = 0U; + uint8_t rdStreamId = 0; + uint8_t byteWriteBuf[2] = { 0U, 0U }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* timeout event loop to permit non-blocking of thread */ + for (eventCheck = 0U; eventCheck <= NUM_OF_EVENT_CHECKS; ++eventCheck) + { + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ADRV903X_TRIGGER_SLICE_STREAM_NUM, + &rdStreamId); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading stream ID from scratchpad register."); + return recoveryAction; + } + + if (rdStreamId != UNUSED_STREAM_ID) + { + recoveryAction = (adi_adrv903x_ErrAction_e)adi_adrv903x_hal_Wait_us(&device->common, 1); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Request Issue"); + return recoveryAction; + } + } + else + { + break; + } + } + + /* if stream ID indicates that previous request was still not processed exit with error */ + if (rdStreamId != UNUSED_STREAM_ID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Core SP Busy"); + return recoveryAction; + } + else + { + /* Set requested RX stream ID to be run */ + byteWriteBuf[0] = (uint8_t)rxStreamId; + + /* Update Tx channel bitmask */ + byteWriteBuf[1] = rxChanMask; + + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_CORE_STREAM_SCRATCH204, byteWriteBuf, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot write to Core scratch pad registers"); + return recoveryAction; + } + + recoveryAction = adrv903x_StreamTrigger(device, ADRV903X_STREAM_MAIN_TRIGGER_RX_STREAM); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while triggering Core Stream to trigger RX stream"); + return recoveryAction; + } + } + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_StreamGpioConfigSetRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_StreamGpioPinCfg_t* const streamGpioPinCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + int idx = 0; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, streamGpioPinCfg); + + + /* Check all Stream GPIO if valid */ + for (idx = 0U; idx < ADI_ADRV903X_MAX_STREAMGPIO; idx++) + { + /* Check if pin is valid and match index */ + if ((streamGpioPinCfg->streamGpInput[idx] != ADI_ADRV903X_GPIO_INVALID) && + (streamGpioPinCfg->streamGpInput[idx] != (adi_adrv903x_GpioPinSel_e)idx)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, idx, "Invalid stream trigger GPIO pin selected. Index must match GPIO value. To disable, please select GPIO_INVALID"); + return recoveryAction; + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return (recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_AdcVersionGet(adi_adrv903x_Device_t* const device, + const uint8_t calType, + const adi_adrv903x_Channels_e channel, + adi_adrv903x_Version_t* const adcVersion) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, adcVersion); + + uint32_t lengthResp = 4U; + uint8_t ctrlData[4] = { 0U }; + uint8_t ctrlResp[16] = { 0U }; + + if ((calType != ADRV903X_CPU_OBJID_IC_ADC_RX) && + (calType != ADRV903X_CPU_OBJID_IC_ADC_TXLB) && + (calType != ADRV903X_CPU_OBJID_IC_ADC_ORX)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, calType, "Invalid cal type. - must be an ADC cal"); + return recoveryAction; + } + + if ((channel != ADI_ADRV903X_CH0) && + (channel != ADI_ADRV903X_CH1) && + (channel != ADI_ADRV903X_CH2) && + (channel != ADI_ADRV903X_CH3) && + (channel != ADI_ADRV903X_CH4) && + (channel != ADI_ADRV903X_CH5) && + (channel != ADI_ADRV903X_CH6) && + (channel != ADI_ADRV903X_CH7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "channel parameter is invalid."); + return recoveryAction; + } + + /* Get the ADC module revision number: */ + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + (uint32_t)calType, + (uint16_t)ADC_CTRL_GET_SW_VERSION, + channel, + ctrlData, + sizeof(ctrlData), + &lengthResp, + ctrlResp, + sizeof(ctrlResp)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "Get ADC SW version failed"); + return recoveryAction; + } + + adcVersion->majorVer = adrv903x_CpuIntFromBytesGet(&ctrlResp[ 0], 4U); + adcVersion->minorVer = adrv903x_CpuIntFromBytesGet(&ctrlResp[ 4], 4U); + adcVersion->maintenanceVer = adrv903x_CpuIntFromBytesGet(&ctrlResp[ 8], 4U); + adcVersion->buildVer = adrv903x_CpuIntFromBytesGet(&ctrlResp[12], 4U); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_AdcGetDataInfo(adi_adrv903x_Device_t* const device, + const uint8_t calType, + const adi_adrv903x_Channels_e channel, + adrv903x_CpuCmd_GetAdcSizeAddrs_t* const adcSizes, + adrv903x_CpuCmd_GetAdcSizeAddrs_t* const adcAddrs) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, adcSizes); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, adcAddrs); + + uint32_t lengthResp = 4U; + uint8_t ctrlData[4] = { 0U }; + uint8_t ctrlResp[24] = { 0U }; + + if ((calType != ADRV903X_CPU_OBJID_IC_ADC_RX) && + (calType != ADRV903X_CPU_OBJID_IC_ADC_TXLB) && + (calType != ADRV903X_CPU_OBJID_IC_ADC_ORX)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, calType, "Invalid cal type. - must be an ADC cal"); + return recoveryAction; + } + + if (calType == ADRV903X_CPU_OBJID_IC_ADC_ORX) + { + if ((channel != ADI_ADRV903X_CH0) && + (channel != ADI_ADRV903X_CH1)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "bad ORx channel"); + return recoveryAction; + } + } + else + { + if ((channel != ADI_ADRV903X_CH0) && + (channel != ADI_ADRV903X_CH1) && + (channel != ADI_ADRV903X_CH2) && + (channel != ADI_ADRV903X_CH3) && + (channel != ADI_ADRV903X_CH4) && + (channel != ADI_ADRV903X_CH5) && + (channel != ADI_ADRV903X_CH6) && + (channel != ADI_ADRV903X_CH7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "bad Rx/Tx channel"); + return recoveryAction; + } + } + + /* Get the ADC module data sizes: */ + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + (uint32_t)calType, + (uint16_t)ADC_CTRL_GET_DATA_SIZES, + channel, + ctrlData, + sizeof(ctrlData), + &lengthResp, + ctrlResp, + sizeof(ctrlResp)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "Get ADC data sizes"); + return recoveryAction; + } + + /* Store the adcSizes */ + adcSizes->obj = adrv903x_CpuIntFromBytesGet(&ctrlResp[ 0], 4U); + adcSizes->init = adrv903x_CpuIntFromBytesGet(&ctrlResp[ 4], 4U); + adcSizes->config = adrv903x_CpuIntFromBytesGet(&ctrlResp[ 8], 4U); + adcSizes->calObj = adrv903x_CpuIntFromBytesGet(&ctrlResp[12], 4U); + adcSizes->calState = adrv903x_CpuIntFromBytesGet(&ctrlResp[16], 4U); + adcSizes->calData = adrv903x_CpuIntFromBytesGet(&ctrlResp[20], 4U); + + /* Get the ADC module data addresses: */ + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + (uint32_t)calType, + (uint16_t)ADC_CTRL_GET_DATA_ADDRS, + channel, + ctrlData, + sizeof(ctrlData), + &lengthResp, + ctrlResp, + sizeof(ctrlResp)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "Get ADC data addresses"); + return recoveryAction; + } + + /* Store the ADC Addresses */ + adcAddrs->obj = adrv903x_CpuIntFromBytesGet(&ctrlResp[ 0], 4U); + adcAddrs->init = adrv903x_CpuIntFromBytesGet(&ctrlResp[ 4], 4U); + adcAddrs->config = adrv903x_CpuIntFromBytesGet(&ctrlResp[ 8], 4U); + adcAddrs->calObj = adrv903x_CpuIntFromBytesGet(&ctrlResp[12], 4U); + adcAddrs->calState = adrv903x_CpuIntFromBytesGet(&ctrlResp[16], 4U); + adcAddrs->calData = adrv903x_CpuIntFromBytesGet(&ctrlResp[20], 4U); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_AdcRunInit(adi_adrv903x_Device_t* const device, + const uint8_t calType, + const adi_adrv903x_Channels_e channel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + uint32_t lengthResp = 4U; + uint8_t ctrlData[4] = { 0U }; + uint8_t ctrlResp[16] = { 0U }; + + if ((calType != ADRV903X_CPU_OBJID_IC_ADC_RX) && + (calType != ADRV903X_CPU_OBJID_IC_ADC_TXLB) && + (calType != ADRV903X_CPU_OBJID_IC_ADC_ORX)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, calType, "Invalid cal type. - must be an ADC cal"); + return recoveryAction; + } + + if (calType == ADRV903X_CPU_OBJID_IC_ADC_ORX) + { + if ((channel != ADI_ADRV903X_CH0) && + (channel != ADI_ADRV903X_CH1)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "bad ORx channel"); + return recoveryAction; + } + } + else + { + if ((channel != ADI_ADRV903X_CH0) && + (channel != ADI_ADRV903X_CH1) && + (channel != ADI_ADRV903X_CH2) && + (channel != ADI_ADRV903X_CH3) && + (channel != ADI_ADRV903X_CH4) && + (channel != ADI_ADRV903X_CH5) && + (channel != ADI_ADRV903X_CH6) && + (channel != ADI_ADRV903X_CH7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "bad Rx/Tx channel"); + return recoveryAction; + } + } + + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + (uint32_t)calType, + (uint16_t)ADC_CTRL_INIT, + channel, + ctrlData, + sizeof(ctrlData), + &lengthResp, + ctrlResp, + sizeof(ctrlResp)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "AdcRunInit failed"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_AdcSetFsmCmd(adi_adrv903x_Device_t* const device, + const uint8_t calType, + const adi_adrv903x_Channels_e channel, + const uint8_t fsmCmd) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + uint32_t lengthResp = 4U; + uint8_t ctrlData[4] = { 0U }; + uint8_t ctrlResp[16] = { 0U }; + + if ((calType != ADRV903X_CPU_OBJID_IC_ADC_RX) && + (calType != ADRV903X_CPU_OBJID_IC_ADC_TXLB) && + (calType != ADRV903X_CPU_OBJID_IC_ADC_ORX)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, calType, "Invalid cal type. - must be an ADC cal"); + return recoveryAction; + } + + if (calType == ADRV903X_CPU_OBJID_IC_ADC_ORX) + { + if ((channel != ADI_ADRV903X_CH0) && + (channel != ADI_ADRV903X_CH1)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "AdcSetFsmCmd failed: bad ORx channel"); + return recoveryAction; + } + } + else + { + if ((channel != ADI_ADRV903X_CH0) && + (channel != ADI_ADRV903X_CH1) && + (channel != ADI_ADRV903X_CH2) && + (channel != ADI_ADRV903X_CH3) && + (channel != ADI_ADRV903X_CH4) && + (channel != ADI_ADRV903X_CH5) && + (channel != ADI_ADRV903X_CH6) && + (channel != ADI_ADRV903X_CH7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "AdcSetFsmCmd failed: bad Rx/Tx channel"); + return recoveryAction; + } + } + + ctrlData[0] = fsmCmd; + + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + (uint32_t)calType, + (uint16_t)ADC_CTRL_SET_FSM_CMD, + channel, + ctrlData, + sizeof(ctrlData), + &lengthResp, + ctrlResp, + sizeof(ctrlResp)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "AdcSetFsmCmd failed"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_AdcGetFsmState(adi_adrv903x_Device_t* const device, + const uint8_t calType, + const adi_adrv903x_Channels_e channel, + uint8_t* const fsmState) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, fsmState); + + uint32_t lengthResp = 4U; + uint8_t ctrlData[4] = { 0U }; + uint8_t ctrlResp[24] = { 0U }; + + if ((calType != ADRV903X_CPU_OBJID_IC_ADC_RX) && + (calType != ADRV903X_CPU_OBJID_IC_ADC_TXLB) && + (calType != ADRV903X_CPU_OBJID_IC_ADC_ORX)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, calType, "Invalid cal type. - must be an ADC cal"); + return recoveryAction; + } + + if (calType == ADRV903X_CPU_OBJID_IC_ADC_ORX) + { + if ((channel != ADI_ADRV903X_CH0) && + (channel != ADI_ADRV903X_CH1)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "bad ORx channel"); + return recoveryAction; + } + } + else + { + if ((channel != ADI_ADRV903X_CH0) && + (channel != ADI_ADRV903X_CH1) && + (channel != ADI_ADRV903X_CH2) && + (channel != ADI_ADRV903X_CH3) && + (channel != ADI_ADRV903X_CH4) && + (channel != ADI_ADRV903X_CH5) && + (channel != ADI_ADRV903X_CH6) && + (channel != ADI_ADRV903X_CH7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "bad Rx/Tx channel"); + return recoveryAction; + } + } + + /* Get the ADC module data sizes: */ + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + (uint32_t)calType, + (uint16_t)ADC_CTRL_GET_FSM_STATE, + channel, + ctrlData, + sizeof(ctrlData), + &lengthResp, + ctrlResp, + sizeof(ctrlResp)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "Get FSM state"); + return recoveryAction; + } + + *fsmState = ctrlResp[0]; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_AdcRunCmd(adi_adrv903x_Device_t* const device, + const uint8_t calType, + const adi_adrv903x_Channels_e channel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + uint32_t lengthResp = 4U; + uint8_t ctrlData[4] = { 0U }; + uint8_t ctrlResp[16] = { 0U }; + + if ((calType != ADRV903X_CPU_OBJID_IC_ADC_RX) && + (calType != ADRV903X_CPU_OBJID_IC_ADC_TXLB) && + (calType != ADRV903X_CPU_OBJID_IC_ADC_ORX)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, calType, "Invalid cal type. - must be an ADC cal"); + return recoveryAction; + } + + if (calType == ADRV903X_CPU_OBJID_IC_ADC_ORX) + { + if ((channel != ADI_ADRV903X_CH0) && + (channel != ADI_ADRV903X_CH1)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "AdcRunCmd failed: bad ORx channel"); + return recoveryAction; + } + } + else + { + if ((channel != ADI_ADRV903X_CH0) && + (channel != ADI_ADRV903X_CH1) && + (channel != ADI_ADRV903X_CH2) && + (channel != ADI_ADRV903X_CH3) && + (channel != ADI_ADRV903X_CH4) && + (channel != ADI_ADRV903X_CH5) && + (channel != ADI_ADRV903X_CH6) && + (channel != ADI_ADRV903X_CH7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "AdcRunCmd failed: bad Rx/Tx channel"); + return recoveryAction; + } + } + + ctrlData[0] = 0; + + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + (uint32_t)calType, + (uint16_t)ADC_CTRL_RUN_CMD, + channel, + ctrlData, + sizeof(ctrlData), + &lengthResp, + ctrlResp, + sizeof(ctrlResp)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "AdcRunCmd failed"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SetTrackingPeriod(adi_adrv903x_Device_t* const device, + uint8_t objId, + uint32_t rateMsec) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + uint16_t offset; + uint32_t configDataLength = 4; + uint8_t configDataSet[4] = { 0 }; + + if ((objId < ADRV903X_CPU_OBJID_TC_START) || + (objId > ADRV903X_CPU_OBJID_TC_END)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, objId, "Invalid objId"); + return recoveryAction; + } + + offset = (objId - ADRV903X_CPU_OBJID_TC_START) * sizeof(uint32_t); + + configDataSet[0] = (uint8_t)((rateMsec >> 0) & 0xFFu); + configDataSet[1] = (uint8_t)((rateMsec >> 8) & 0xFFu); + configDataSet[2] = (uint8_t)((rateMsec >> 16) & 0xFFu); + configDataSet[3] = (uint8_t)((rateMsec >> 24) & 0xFFu); + + /* Get the ADC module data sizes: */ + recoveryAction = adi_adrv903x_CpuConfigSet(device, + (uint32_t)ADRV903X_CPU_OBJID_CFG_TRACKING_CALS, + offset, + configDataSet, + configDataLength); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, objId, "Set tracking period"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_GetTrackingPeriod(adi_adrv903x_Device_t* const device, + uint8_t objId, + uint32_t* const rateMsec) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + uint16_t offset; + uint32_t configDataLength = 4; + uint8_t configDataGet[4] = { 0 }; + + if ((objId < ADRV903X_CPU_OBJID_TC_START) || + (objId > ADRV903X_CPU_OBJID_TC_END)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, objId, "Invalid objId"); + return recoveryAction; + } + + offset = (objId - ADRV903X_CPU_OBJID_TC_START) * sizeof(uint32_t); + + /* Get the ADC module data sizes: */ + recoveryAction = adi_adrv903x_CpuConfigGet(device, + (uint32_t)ADRV903X_CPU_OBJID_CFG_TRACKING_CALS, + offset, + configDataGet, + configDataLength); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, objId, "Set tracking period"); + return recoveryAction; + } + + *rateMsec = adrv903x_CpuIntFromBytesGet(&configDataGet[0], 4U); + + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_reg_addr_macros.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_reg_addr_macros.c new file mode 100644 index 0000000000000..d49edde3f0d52 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_reg_addr_macros.c @@ -0,0 +1,1900 @@ +/** + * This file is automatically generated - DO NOT EDIT + * + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ +#include "../../private/include/adrv903x_reg_addr_macros.h" + +const adrv903x_CpuRamMemDump_t adrv903x_CpuRamMemDumpTable[24] = +{ + {0x01000000, 0x50000, 0x1, 0 }, + {0x02000000, 0x50000, 0x2, 0 }, + {0x20000000, 0x40000, 0x3, 0 }, + {0x21000000, 0x40000, 0x4, 0 }, + {0x46A00000, 0x4000, 0x5, 0 }, + {0x4C0A0000, 0x2000, 0x6, 0 }, + {0x60020000, 0x800, 0x7, 0 }, + {0x60120000, 0x800, 0x8, 0 }, + {0x60220000, 0x800, 0x9, 0 }, + {0x60320000, 0x800, 0xA, 0 }, + {0x60420000, 0x800, 0xB, 0 }, + {0x60520000, 0x800, 0xC, 0 }, + {0x60620000, 0x800, 0xD, 0 }, + {0x60720000, 0x800, 0xE, 0 }, + {0x60820000, 0x1000, 0xF, 0 }, + {0x60920000, 0x1000, 0x10, 0 }, + {0x60A20000, 0x1000, 0x11, 0 }, + {0x60B20000, 0x1000, 0x12, 0 }, + {0x60C20000, 0x1000, 0x13, 0 }, + {0x60D20000, 0x1000, 0x14, 0 }, + {0x60E20000, 0x1000, 0x15, 0 }, + {0x60F20000, 0x1000, 0x16, 0 }, + {0x61020000, 0x2000, 0x17, 0 }, + {0x61120000, 0x2000, 0x18, 0 }, +}; +const adrv903x_CpuMemDump_t adrv903x_TelemetryMemDumpTable[1] = +{ + {0x46410000, 0x8000, 32, 0 }, +}; +const adrv903x_CpuMemDump_t adrv903x_CpuMemDumpTable[1858] = +{ + {0x4C008000, 0x4000, 32, 0 }, + {0x4C018000, 0x4000, 32, 0 }, + {0x4C028000, 0x4000, 32, 0 }, + {0x4C038000, 0x4000, 32, 0 }, + {0x4C048000, 0x4000, 32, 0 }, + {0x4C058000, 0x4000, 32, 0 }, + {0x4C068000, 0x4000, 32, 0 }, + {0x4C078000, 0x4000, 32, 0 }, + {0x60090000, 0x2000, 32, 0 }, + {0x600a0000, 0x800, 32, 0 }, + {0x60190000, 0x2000, 32, 0 }, + {0x601a0000, 0x800, 32, 0 }, + {0x60290000, 0x2000, 32, 0 }, + {0x602a0000, 0x800, 32, 0 }, + {0x60390000, 0x2000, 32, 0 }, + {0x603a0000, 0x800, 32, 0 }, + {0x60490000, 0x2000, 32, 0 }, + {0x604a0000, 0x800, 32, 0 }, + {0x60590000, 0x2000, 32, 0 }, + {0x605a0000, 0x800, 32, 0 }, + {0x60690000, 0x2000, 32, 0 }, + {0x606a0000, 0x800, 32, 0 }, + {0x60790000, 0x2000, 32, 0 }, + {0x607a0000, 0x800, 32, 0 }, + {0x60810000, 0x2000, 32, 0 }, + {0x60812000, 0xF00, 32, 0 }, + {0x60910000, 0x2000, 32, 0 }, + {0x60912000, 0xF00, 32, 0 }, + {0x60A10000, 0x2000, 32, 0 }, + {0x60A12000, 0xF00, 32, 0 }, + {0x60B10000, 0x2000, 32, 0 }, + {0x60B12000, 0xF00, 32, 0 }, + {0x60C10000, 0x2000, 32, 0 }, + {0x60C12000, 0xF00, 32, 0 }, + {0x60D10000, 0x2000, 32, 0 }, + {0x60D12000, 0xF00, 32, 0 }, + {0x60E10000, 0x2000, 32, 0 }, + {0x60E12000, 0xF00, 32, 0 }, + {0x60F10000, 0x2000, 32, 0 }, + {0x60F12000, 0xF00, 32, 0 }, + {0x40000000, 24, 32, 0 }, + {0x40010000, 24, 32, 0 }, + {0x40020000, 24, 32, 0 }, + {0x40030000, 24, 32, 0 }, + {0x40040000, 24, 32, 0 }, + {0x40050000, 24, 32, 0 }, + {0x40060000, 24, 32, 0 }, + {0x40070000, 24, 32, 0 }, + {0x40080000, 24, 32, 0 }, + {0x40090000, 24, 32, 0 }, + {0x400A0000, 24, 32, 0 }, + {0x400B0000, 24, 32, 0 }, + {0x400C0000, 24, 32, 0 }, + {0x400D0000, 24, 32, 0 }, + {0x400E0000, 24, 32, 0 }, + {0x400F0000, 24, 32, 0 }, + {0x41000000, 12, 32, 0 }, + {0x41100000, 4, 32, 0 }, + {0x41200000, 264, 32, 0 }, + {0x41500000, 28, 32, 0 }, + {0x41600000, 28, 32, 0 }, + {0x41700000, 28, 32, 0 }, + {0x41800000, 28, 32, 0 }, + {0x43000000, 24, 32, 0 }, + {0x43010000, 24, 32, 0 }, + {0x43020000, 24, 32, 0 }, + {0x43030000, 24, 32, 0 }, + {0x43040000, 24, 32, 0 }, + {0x43050000, 24, 32, 0 }, + {0x43060000, 24, 32, 0 }, + {0x43070000, 24, 32, 0 }, + {0x43080000, 24, 32, 0 }, + {0x43090000, 24, 32, 0 }, + {0x430A0000, 24, 32, 0 }, + {0x430B0000, 24, 32, 0 }, + {0x430C0000, 24, 32, 0 }, + {0x430D0000, 24, 32, 0 }, + {0x430E0000, 24, 32, 0 }, + {0x430F0000, 24, 32, 0 }, + {0x44000000, 12, 32, 0 }, + {0x44100000, 4, 32, 0 }, + {0x44200000, 264, 32, 0 }, + {0x44500000, 28, 32, 0 }, + {0x44600000, 28, 32, 0 }, + {0x44700000, 28, 32, 0 }, + {0x44800000, 28, 32, 0 }, + {0x46000000, 16, 32, 0 }, + {0x46100000, 60, 32, 0 }, + {0x46200000, 60, 32, 0 }, + {0x46300000, 128, 32, 0 }, + {0x46300E00, 4, 32, 0 }, + {0x46300E80, 40, 32, 0 }, + {0x46400000, 108, 32, 0 }, + {0x46500000, 4, 32, 0 }, + {0x46510000, 4, 32, 0 }, + {0x46520000, 4, 32, 0 }, + {0x46530000, 4, 32, 0 }, + {0x46540000, 4, 32, 0 }, + {0x46550000, 4, 32, 0 }, + {0x46560000, 4, 32, 0 }, + {0x46570000, 4, 32, 0 }, + {0x46580000, 4, 32, 0 }, + {0x46590000, 4, 32, 0 }, + {0x465A0000, 4, 32, 0 }, + {0x465B0000, 4, 32, 0 }, + {0x465C0000, 4, 32, 0 }, + {0x465D0000, 4, 32, 0 }, + {0x465E0000, 4, 32, 0 }, + {0x465F0000, 4, 32, 0 }, + {0x46600000, 4, 32, 0 }, + {0x46610000, 4, 32, 0 }, + {0x46620000, 4, 32, 0 }, + {0x46630000, 4, 32, 0 }, + {0x46640000, 4, 32, 0 }, + {0x46650000, 4, 32, 0 }, + {0x46660000, 4, 32, 0 }, + {0x46670000, 4, 32, 0 }, + {0x46680000, 4, 32, 0 }, + {0x46690000, 4, 32, 0 }, + {0x466A0000, 4, 32, 0 }, + {0x466B0000, 4, 32, 0 }, + {0x466C0000, 4, 32, 0 }, + {0x466D0000, 4, 32, 0 }, + {0x466E0000, 4, 32, 0 }, + {0x466F0000, 4, 32, 0 }, + {0x46700000, 96, 32, 0 }, + {0x46800000, 548, 32, 0 }, + {0x46810000, 12, 32, 0 }, + {0x46810100, 4, 32, 0 }, + {0x46B00000, 392, 32, 0 }, + {0x47000000, 18, 8, 0 }, + {0x47000013, 1, 8, 0 }, + {0x47000015, 1, 8, 0 }, + {0x47000017, 8, 8, 0 }, + {0x4700001F, 1, 8, 0 }, + {0x47000021, 10, 8, 0 }, + {0x4700003A, 20, 8, 0 }, + {0x4700004F, 9, 8, 0 }, + {0x47000059, 9, 8, 0 }, + {0x47000063, 24, 8, 0 }, + {0x4700007C, 24, 8, 0 }, + {0x47000095, 40, 8, 0 }, + {0x470000C6, 10, 8, 0 }, + {0x470000DF, 20, 8, 0 }, + {0x470000F4, 24, 8, 0 }, + {0x4700010D, 24, 8, 0 }, + {0x47000126, 13, 8, 0 }, + {0x47000134, 13, 8, 0 }, + {0x47000142, 3, 8, 0 }, + {0x47000146, 60, 8, 0 }, + {0x47000183, 4, 8, 0 }, + {0x47000188, 18, 8, 0 }, + {0x4700019A, 13, 8, 0 }, + {0x470001A8, 8, 8, 0 }, + {0x470001B1, 1, 8, 0 }, + {0x470001B3, 53, 8, 0 }, + {0x47000200, 256, 8, 0 }, + {0x47000300, 12, 8, 0 }, + {0x4700030C, 6, 8, 0 }, + {0x47000313, 1, 8, 0 }, + {0x47000315, 2, 8, 0 }, + {0x47000317, 5, 8, 0 }, + {0x4700031C, 16, 8, 0 }, + {0x4700032D, 20, 8, 0 }, + {0x47000350, 23, 8, 0 }, + {0x470003F0, 64, 8, 0 }, + {0x470004C0, 34, 8, 0 }, + {0x470004E3, 64, 8, 0 }, + {0x47000523, 33, 8, 0 }, + {0x47000544, 1, 8, 0 }, + {0x47000545, 5, 8, 0 }, + {0x4700054E, 1, 8, 0 }, + {0x4700054F, 1, 8, 0 }, + {0x47000550, 410, 8, 0 }, + {0x47000766, 11, 8, 0 }, + {0x47000772, 12, 8, 0 }, + {0x4700077E, 1, 8, 0 }, + {0x47000780, 1, 8, 0 }, + {0x47000782, 3, 8, 0 }, + {0x47000786, 168, 8, 0 }, + {0x4700082F, 3, 8, 0 }, + {0x47000833, 116, 8, 0 }, + {0x470008A8, 3, 8, 0 }, + {0x470008AC, 15, 8, 0 }, + {0x470008BC, 1, 8, 0 }, + {0x470008C0, 1, 8, 0 }, + {0x47300000, 4, 8, 0 }, + {0x47300004, 36, 8, 0 }, + {0x47300028, 45, 8, 0 }, + {0x47300055, 16, 8, 0 }, + {0x47300065, 3, 8, 0 }, + {0x47300068, 7, 8, 0 }, + {0x4730006F, 5, 8, 0 }, + {0x47300074, 1, 8, 0 }, + {0x47300075, 9, 8, 0 }, + {0x4730007E, 9, 8, 0 }, + {0x47300087, 38, 8, 0 }, + {0x473000AD, 2, 8, 0 }, + {0x473000AF, 3, 8, 0 }, + {0x473000B2, 2, 8, 0 }, + {0x473000B4, 21, 8, 0 }, + {0x47400000, 4, 8, 0 }, + {0x47400004, 36, 8, 0 }, + {0x47400028, 45, 8, 0 }, + {0x47400055, 16, 8, 0 }, + {0x47400065, 3, 8, 0 }, + {0x47400068, 7, 8, 0 }, + {0x4740006F, 5, 8, 0 }, + {0x47400074, 1, 8, 0 }, + {0x47400075, 9, 8, 0 }, + {0x4740007E, 9, 8, 0 }, + {0x47400087, 38, 8, 0 }, + {0x474000AD, 2, 8, 0 }, + {0x474000AF, 3, 8, 0 }, + {0x474000B2, 2, 8, 0 }, + {0x474000B4, 21, 8, 0 }, + {0x47500000, 13, 8, 0 }, + {0x48000000, 12, 32, 0 }, + {0x4800000C, 36, 32, 0 }, + {0x48000090, 36, 32, 0 }, + {0x48000114, 44, 32, 0 }, + {0x480001A0, 32, 32, 0 }, + {0x48000220, 32, 32, 0 }, + {0x480002A0, 32, 32, 0 }, + {0x48000320, 32, 32, 0 }, + {0x480003A0, 32, 32, 0 }, + {0x48000420, 32, 32, 0 }, + {0x480004A0, 32, 32, 0 }, + {0x48000520, 40, 32, 0 }, + {0x480005A8, 32, 32, 0 }, + {0x480005D0, 36, 32, 0 }, + {0x480005F4, 144, 32, 0 }, + {0x48000690, 12, 32, 0 }, + {0x4800069C, 4, 32, 0 }, + {0x480006A0, 8, 32, 0 }, + {0x480006A8, 64, 32, 0 }, + {0x480006E8, 12, 32, 0 }, + {0x480006F4, 28, 32, 0 }, + {0x48000714, 4, 32, 0 }, + {0x48010000, 172, 32, 0 }, + {0x480100AC, 76, 32, 0 }, + {0x48020000, 172, 32, 0 }, + {0x480200AC, 76, 32, 0 }, + {0x48030000, 304, 32, 0 }, + {0x48030130, 12, 32, 0 }, + {0x48030140, 44, 32, 0 }, + {0x48030170, 40, 32, 0 }, + {0x480301A0, 8, 32, 0 }, + {0x480301AC, 4, 32, 0 }, + {0x48040000, 304, 32, 0 }, + {0x48040130, 12, 32, 0 }, + {0x48040140, 44, 32, 0 }, + {0x48040170, 40, 32, 0 }, + {0x480401A0, 8, 32, 0 }, + {0x480401AC, 4, 32, 0 }, + {0x48050000, 304, 32, 0 }, + {0x48050130, 12, 32, 0 }, + {0x48050140, 44, 32, 0 }, + {0x48050170, 40, 32, 0 }, + {0x480501A0, 8, 32, 0 }, + {0x480501AC, 4, 32, 0 }, + {0x48060000, 4, 8, 0 }, + {0x48060004, 36, 8, 0 }, + {0x48060028, 45, 8, 0 }, + {0x48060055, 16, 8, 0 }, + {0x48060065, 3, 8, 0 }, + {0x48060068, 7, 8, 0 }, + {0x4806006F, 5, 8, 0 }, + {0x48060074, 1, 8, 0 }, + {0x48060075, 9, 8, 0 }, + {0x4806007E, 9, 8, 0 }, + {0x48060087, 38, 8, 0 }, + {0x480600AD, 2, 8, 0 }, + {0x480600AF, 3, 8, 0 }, + {0x480600B2, 2, 8, 0 }, + {0x480600B4, 21, 8, 0 }, + {0x48070000, 64, 8, 0 }, + {0x48070800, 64, 8, 0 }, + {0x48071000, 64, 8, 0 }, + {0x48071800, 64, 8, 0 }, + {0x48072000, 64, 8, 0 }, + {0x48072800, 64, 8, 0 }, + {0x48073000, 64, 8, 0 }, + {0x48073800, 64, 8, 0 }, + {0x48074000, 64, 8, 0 }, + {0x48078000, 8, 8, 0 }, + {0x480780FF, 1, 8, 0 }, + {0x48080000, 90, 8, 0 }, + {0x48080070, 144, 8, 0 }, + {0x48080800, 90, 8, 0 }, + {0x48080870, 144, 8, 0 }, + {0x48081000, 90, 8, 0 }, + {0x48081070, 144, 8, 0 }, + {0x48081800, 90, 8, 0 }, + {0x48081870, 144, 8, 0 }, + {0x48082000, 90, 8, 0 }, + {0x48082070, 144, 8, 0 }, + {0x48082800, 90, 8, 0 }, + {0x48082870, 144, 8, 0 }, + {0x48083000, 90, 8, 0 }, + {0x48083070, 144, 8, 0 }, + {0x48083800, 90, 8, 0 }, + {0x48083870, 144, 8, 0 }, + {0x48084000, 90, 8, 0 }, + {0x48084070, 144, 8, 0 }, + {0x48088000, 36, 8, 0 }, + {0x480880FF, 1, 8, 0 }, + {0x48090000, 4, 8, 0 }, + {0x48090004, 36, 8, 0 }, + {0x48090028, 45, 8, 0 }, + {0x48090055, 16, 8, 0 }, + {0x48090065, 3, 8, 0 }, + {0x48090068, 7, 8, 0 }, + {0x4809006F, 5, 8, 0 }, + {0x48090074, 1, 8, 0 }, + {0x48090075, 9, 8, 0 }, + {0x4809007E, 9, 8, 0 }, + {0x48090087, 38, 8, 0 }, + {0x480900AD, 2, 8, 0 }, + {0x480900AF, 3, 8, 0 }, + {0x480900B2, 2, 8, 0 }, + {0x480900B4, 21, 8, 0 }, + {0x4C000000, 100, 32, 0 }, + {0x4C004000, 28, 32, 0 }, + {0x4C005000, 40, 32, 0 }, + {0x4C010000, 100, 32, 0 }, + {0x4C014000, 28, 32, 0 }, + {0x4C015000, 40, 32, 0 }, + {0x4C020000, 100, 32, 0 }, + {0x4C024000, 28, 32, 0 }, + {0x4C025000, 40, 32, 0 }, + {0x4C030000, 100, 32, 0 }, + {0x4C034000, 28, 32, 0 }, + {0x4C035000, 40, 32, 0 }, + {0x4C040000, 100, 32, 0 }, + {0x4C044000, 28, 32, 0 }, + {0x4C045000, 40, 32, 0 }, + {0x4C050000, 100, 32, 0 }, + {0x4C054000, 28, 32, 0 }, + {0x4C055000, 40, 32, 0 }, + {0x4C060000, 100, 32, 0 }, + {0x4C064000, 28, 32, 0 }, + {0x4C065000, 40, 32, 0 }, + {0x4C070000, 100, 32, 0 }, + {0x4C074000, 28, 32, 0 }, + {0x4C075000, 40, 32, 0 }, + {0x4C080000, 392, 32, 0 }, + {0x4C090000, 648, 32, 0 }, + {0x60022000, 392, 32, 0 }, + {0x60023000, 52, 32, 0 }, + {0x60024000, 4, 32, 0 }, + {0x60025000, 4, 32, 0 }, + {0x60026000, 4, 32, 0 }, + {0x60027000, 4, 32, 0 }, + {0x60028000, 4, 32, 0 }, + {0x60029000, 4, 32, 0 }, + {0x6002A000, 4, 32, 0 }, + {0x6002B000, 4, 32, 0 }, + {0x60030000, 132, 32, 0 }, + {0x60030084, 8, 32, 0 }, + {0x6003008C, 4, 32, 0 }, + {0x60030090, 40, 32, 0 }, + {0x600300B8, 20, 32, 0 }, + {0x600300D8, 8, 32, 0 }, + {0x600300E0, 12, 32, 0 }, + {0x600300F8, 8, 32, 0 }, + {0x60040000, 48, 32, 0 }, + {0x60040030, 4, 32, 0 }, + {0x60040034, 56, 32, 0 }, + {0x6004008C, 12, 32, 0 }, + {0x6004009C, 100, 32, 0 }, + {0x60040100, 8, 32, 0 }, + {0x60040108, 12, 32, 0 }, + {0x60040114, 188, 32, 0 }, + {0x600401F0, 8, 32, 0 }, + {0x600401F8, 4, 32, 0 }, + {0x60050000, 40, 32, 0 }, + {0x6005002C, 8, 32, 0 }, + {0x60050034, 24, 32, 0 }, + {0x60060000, 24, 32, 0 }, + {0x60060020, 16, 32, 0 }, + {0x60060030, 32, 32, 0 }, + {0x60060050, 8, 32, 0 }, + {0x60060058, 28, 32, 0 }, + {0x60060074, 8, 32, 0 }, + {0x6006007C, 16, 32, 0 }, + {0x6006008C, 12, 32, 0 }, + {0x60070000, 24, 32, 0 }, + {0x60070020, 16, 32, 0 }, + {0x60070030, 32, 32, 0 }, + {0x60070050, 8, 32, 0 }, + {0x60070058, 28, 32, 0 }, + {0x60070074, 8, 32, 0 }, + {0x6007007C, 16, 32, 0 }, + {0x6007008C, 12, 32, 0 }, + {0x600B0000, 7, 8, 0 }, + {0x600B000E, 14, 8, 0 }, + {0x600B0026, 27, 8, 0 }, + {0x600B0070, 11, 8, 0 }, + {0x600B007B, 1, 8, 0 }, + {0x600C0000, 64, 8, 0 }, + {0x600C0050, 16, 8, 0 }, + {0x600C0080, 64, 8, 0 }, + {0x600C00C0, 16, 8, 0 }, + {0x600D0000, 848, 32, 0 }, + {0x600D0700, 56, 32, 0 }, + {0x600D0800, 848, 32, 0 }, + {0x600D0D00, 696, 32, 0 }, + {0x60122000, 392, 32, 0 }, + {0x60123000, 52, 32, 0 }, + {0x60124000, 4, 32, 0 }, + {0x60125000, 4, 32, 0 }, + {0x60126000, 4, 32, 0 }, + {0x60127000, 4, 32, 0 }, + {0x60128000, 4, 32, 0 }, + {0x60129000, 4, 32, 0 }, + {0x6012A000, 4, 32, 0 }, + {0x6012B000, 4, 32, 0 }, + {0x60130000, 132, 32, 0 }, + {0x60130084, 8, 32, 0 }, + {0x6013008C, 4, 32, 0 }, + {0x60130090, 40, 32, 0 }, + {0x601300B8, 20, 32, 0 }, + {0x601300D8, 8, 32, 0 }, + {0x601300E0, 12, 32, 0 }, + {0x601300F8, 8, 32, 0 }, + {0x60140000, 48, 32, 0 }, + {0x60140030, 4, 32, 0 }, + {0x60140034, 56, 32, 0 }, + {0x6014008C, 12, 32, 0 }, + {0x6014009C, 100, 32, 0 }, + {0x60140100, 8, 32, 0 }, + {0x60140108, 12, 32, 0 }, + {0x60140114, 188, 32, 0 }, + {0x601401F0, 8, 32, 0 }, + {0x601401F8, 4, 32, 0 }, + {0x60150000, 40, 32, 0 }, + {0x6015002C, 8, 32, 0 }, + {0x60150034, 24, 32, 0 }, + {0x60160000, 24, 32, 0 }, + {0x60160020, 16, 32, 0 }, + {0x60160030, 32, 32, 0 }, + {0x60160050, 8, 32, 0 }, + {0x60160058, 28, 32, 0 }, + {0x60160074, 8, 32, 0 }, + {0x6016007C, 16, 32, 0 }, + {0x6016008C, 12, 32, 0 }, + {0x60170000, 24, 32, 0 }, + {0x60170020, 16, 32, 0 }, + {0x60170030, 32, 32, 0 }, + {0x60170050, 8, 32, 0 }, + {0x60170058, 28, 32, 0 }, + {0x60170074, 8, 32, 0 }, + {0x6017007C, 16, 32, 0 }, + {0x6017008C, 12, 32, 0 }, + {0x601B0000, 7, 8, 0 }, + {0x601B000E, 14, 8, 0 }, + {0x601B0026, 27, 8, 0 }, + {0x601B0070, 11, 8, 0 }, + {0x601B007B, 1, 8, 0 }, + {0x601C0000, 64, 8, 0 }, + {0x601C0050, 16, 8, 0 }, + {0x601C0080, 64, 8, 0 }, + {0x601C00C0, 16, 8, 0 }, + {0x601D0000, 848, 32, 0 }, + {0x601D0700, 56, 32, 0 }, + {0x601D0800, 848, 32, 0 }, + {0x601D0D00, 696, 32, 0 }, + {0x60222000, 392, 32, 0 }, + {0x60223000, 52, 32, 0 }, + {0x60224000, 4, 32, 0 }, + {0x60225000, 4, 32, 0 }, + {0x60226000, 4, 32, 0 }, + {0x60227000, 4, 32, 0 }, + {0x60228000, 4, 32, 0 }, + {0x60229000, 4, 32, 0 }, + {0x6022A000, 4, 32, 0 }, + {0x6022B000, 4, 32, 0 }, + {0x60230000, 132, 32, 0 }, + {0x60230084, 8, 32, 0 }, + {0x6023008C, 4, 32, 0 }, + {0x60230090, 40, 32, 0 }, + {0x602300B8, 20, 32, 0 }, + {0x602300D8, 8, 32, 0 }, + {0x602300E0, 12, 32, 0 }, + {0x602300F8, 8, 32, 0 }, + {0x60240000, 48, 32, 0 }, + {0x60240030, 4, 32, 0 }, + {0x60240034, 56, 32, 0 }, + {0x6024008C, 12, 32, 0 }, + {0x6024009C, 100, 32, 0 }, + {0x60240100, 8, 32, 0 }, + {0x60240108, 12, 32, 0 }, + {0x60240114, 188, 32, 0 }, + {0x602401F0, 8, 32, 0 }, + {0x602401F8, 4, 32, 0 }, + {0x60250000, 40, 32, 0 }, + {0x6025002C, 8, 32, 0 }, + {0x60250034, 24, 32, 0 }, + {0x60260000, 24, 32, 0 }, + {0x60260020, 16, 32, 0 }, + {0x60260030, 32, 32, 0 }, + {0x60260050, 8, 32, 0 }, + {0x60260058, 28, 32, 0 }, + {0x60260074, 8, 32, 0 }, + {0x6026007C, 16, 32, 0 }, + {0x6026008C, 12, 32, 0 }, + {0x60270000, 24, 32, 0 }, + {0x60270020, 16, 32, 0 }, + {0x60270030, 32, 32, 0 }, + {0x60270050, 8, 32, 0 }, + {0x60270058, 28, 32, 0 }, + {0x60270074, 8, 32, 0 }, + {0x6027007C, 16, 32, 0 }, + {0x6027008C, 12, 32, 0 }, + {0x602B0000, 7, 8, 0 }, + {0x602B000E, 14, 8, 0 }, + {0x602B0026, 27, 8, 0 }, + {0x602B0070, 11, 8, 0 }, + {0x602B007B, 1, 8, 0 }, + {0x602C0000, 64, 8, 0 }, + {0x602C0050, 16, 8, 0 }, + {0x602C0080, 64, 8, 0 }, + {0x602C00C0, 16, 8, 0 }, + {0x602D0000, 848, 32, 0 }, + {0x602D0700, 56, 32, 0 }, + {0x602D0800, 848, 32, 0 }, + {0x602D0D00, 696, 32, 0 }, + {0x60322000, 392, 32, 0 }, + {0x60323000, 52, 32, 0 }, + {0x60324000, 4, 32, 0 }, + {0x60325000, 4, 32, 0 }, + {0x60326000, 4, 32, 0 }, + {0x60327000, 4, 32, 0 }, + {0x60328000, 4, 32, 0 }, + {0x60329000, 4, 32, 0 }, + {0x6032A000, 4, 32, 0 }, + {0x6032B000, 4, 32, 0 }, + {0x60330000, 132, 32, 0 }, + {0x60330084, 8, 32, 0 }, + {0x6033008C, 4, 32, 0 }, + {0x60330090, 40, 32, 0 }, + {0x603300B8, 20, 32, 0 }, + {0x603300D8, 8, 32, 0 }, + {0x603300E0, 12, 32, 0 }, + {0x603300F8, 8, 32, 0 }, + {0x60340000, 48, 32, 0 }, + {0x60340030, 4, 32, 0 }, + {0x60340034, 56, 32, 0 }, + {0x6034008C, 12, 32, 0 }, + {0x6034009C, 100, 32, 0 }, + {0x60340100, 8, 32, 0 }, + {0x60340108, 12, 32, 0 }, + {0x60340114, 188, 32, 0 }, + {0x603401F0, 8, 32, 0 }, + {0x603401F8, 4, 32, 0 }, + {0x60350000, 40, 32, 0 }, + {0x6035002C, 8, 32, 0 }, + {0x60350034, 24, 32, 0 }, + {0x60360000, 24, 32, 0 }, + {0x60360020, 16, 32, 0 }, + {0x60360030, 32, 32, 0 }, + {0x60360050, 8, 32, 0 }, + {0x60360058, 28, 32, 0 }, + {0x60360074, 8, 32, 0 }, + {0x6036007C, 16, 32, 0 }, + {0x6036008C, 12, 32, 0 }, + {0x60370000, 24, 32, 0 }, + {0x60370020, 16, 32, 0 }, + {0x60370030, 32, 32, 0 }, + {0x60370050, 8, 32, 0 }, + {0x60370058, 28, 32, 0 }, + {0x60370074, 8, 32, 0 }, + {0x6037007C, 16, 32, 0 }, + {0x6037008C, 12, 32, 0 }, + {0x603B0000, 7, 8, 0 }, + {0x603B000E, 14, 8, 0 }, + {0x603B0026, 27, 8, 0 }, + {0x603B0070, 11, 8, 0 }, + {0x603B007B, 1, 8, 0 }, + {0x603C0000, 64, 8, 0 }, + {0x603C0050, 16, 8, 0 }, + {0x603C0080, 64, 8, 0 }, + {0x603C00C0, 16, 8, 0 }, + {0x603D0000, 848, 32, 0 }, + {0x603D0700, 56, 32, 0 }, + {0x603D0800, 848, 32, 0 }, + {0x603D0D00, 696, 32, 0 }, + {0x60422000, 392, 32, 0 }, + {0x60423000, 52, 32, 0 }, + {0x60424000, 4, 32, 0 }, + {0x60425000, 4, 32, 0 }, + {0x60426000, 4, 32, 0 }, + {0x60427000, 4, 32, 0 }, + {0x60428000, 4, 32, 0 }, + {0x60429000, 4, 32, 0 }, + {0x6042A000, 4, 32, 0 }, + {0x6042B000, 4, 32, 0 }, + {0x60430000, 132, 32, 0 }, + {0x60430084, 8, 32, 0 }, + {0x6043008C, 4, 32, 0 }, + {0x60430090, 40, 32, 0 }, + {0x604300B8, 20, 32, 0 }, + {0x604300D8, 8, 32, 0 }, + {0x604300E0, 12, 32, 0 }, + {0x604300F8, 8, 32, 0 }, + {0x60440000, 48, 32, 0 }, + {0x60440030, 4, 32, 0 }, + {0x60440034, 56, 32, 0 }, + {0x6044008C, 12, 32, 0 }, + {0x6044009C, 100, 32, 0 }, + {0x60440100, 8, 32, 0 }, + {0x60440108, 12, 32, 0 }, + {0x60440114, 188, 32, 0 }, + {0x604401F0, 8, 32, 0 }, + {0x604401F8, 4, 32, 0 }, + {0x60450000, 40, 32, 0 }, + {0x6045002C, 8, 32, 0 }, + {0x60450034, 24, 32, 0 }, + {0x60460000, 24, 32, 0 }, + {0x60460020, 16, 32, 0 }, + {0x60460030, 32, 32, 0 }, + {0x60460050, 8, 32, 0 }, + {0x60460058, 28, 32, 0 }, + {0x60460074, 8, 32, 0 }, + {0x6046007C, 16, 32, 0 }, + {0x6046008C, 12, 32, 0 }, + {0x60470000, 24, 32, 0 }, + {0x60470020, 16, 32, 0 }, + {0x60470030, 32, 32, 0 }, + {0x60470050, 8, 32, 0 }, + {0x60470058, 28, 32, 0 }, + {0x60470074, 8, 32, 0 }, + {0x6047007C, 16, 32, 0 }, + {0x6047008C, 12, 32, 0 }, + {0x604B0000, 7, 8, 0 }, + {0x604B000E, 14, 8, 0 }, + {0x604B0026, 27, 8, 0 }, + {0x604B0070, 11, 8, 0 }, + {0x604B007B, 1, 8, 0 }, + {0x604C0000, 64, 8, 0 }, + {0x604C0050, 16, 8, 0 }, + {0x604C0080, 64, 8, 0 }, + {0x604C00C0, 16, 8, 0 }, + {0x604D0000, 848, 32, 0 }, + {0x604D0700, 56, 32, 0 }, + {0x604D0800, 848, 32, 0 }, + {0x604D0D00, 696, 32, 0 }, + {0x60522000, 392, 32, 0 }, + {0x60523000, 52, 32, 0 }, + {0x60524000, 4, 32, 0 }, + {0x60525000, 4, 32, 0 }, + {0x60526000, 4, 32, 0 }, + {0x60527000, 4, 32, 0 }, + {0x60528000, 4, 32, 0 }, + {0x60529000, 4, 32, 0 }, + {0x6052A000, 4, 32, 0 }, + {0x6052B000, 4, 32, 0 }, + {0x60530000, 132, 32, 0 }, + {0x60530084, 8, 32, 0 }, + {0x6053008C, 4, 32, 0 }, + {0x60530090, 40, 32, 0 }, + {0x605300B8, 20, 32, 0 }, + {0x605300D8, 8, 32, 0 }, + {0x605300E0, 12, 32, 0 }, + {0x605300F8, 8, 32, 0 }, + {0x60540000, 48, 32, 0 }, + {0x60540030, 4, 32, 0 }, + {0x60540034, 56, 32, 0 }, + {0x6054008C, 12, 32, 0 }, + {0x6054009C, 100, 32, 0 }, + {0x60540100, 8, 32, 0 }, + {0x60540108, 12, 32, 0 }, + {0x60540114, 188, 32, 0 }, + {0x605401F0, 8, 32, 0 }, + {0x605401F8, 4, 32, 0 }, + {0x60550000, 40, 32, 0 }, + {0x6055002C, 8, 32, 0 }, + {0x60550034, 24, 32, 0 }, + {0x60560000, 24, 32, 0 }, + {0x60560020, 16, 32, 0 }, + {0x60560030, 32, 32, 0 }, + {0x60560050, 8, 32, 0 }, + {0x60560058, 28, 32, 0 }, + {0x60560074, 8, 32, 0 }, + {0x6056007C, 16, 32, 0 }, + {0x6056008C, 12, 32, 0 }, + {0x60570000, 24, 32, 0 }, + {0x60570020, 16, 32, 0 }, + {0x60570030, 32, 32, 0 }, + {0x60570050, 8, 32, 0 }, + {0x60570058, 28, 32, 0 }, + {0x60570074, 8, 32, 0 }, + {0x6057007C, 16, 32, 0 }, + {0x6057008C, 12, 32, 0 }, + {0x605B0000, 7, 8, 0 }, + {0x605B000E, 14, 8, 0 }, + {0x605B0026, 27, 8, 0 }, + {0x605B0070, 11, 8, 0 }, + {0x605B007B, 1, 8, 0 }, + {0x605C0000, 64, 8, 0 }, + {0x605C0050, 16, 8, 0 }, + {0x605C0080, 64, 8, 0 }, + {0x605C00C0, 16, 8, 0 }, + {0x605D0000, 848, 32, 0 }, + {0x605D0700, 56, 32, 0 }, + {0x605D0800, 848, 32, 0 }, + {0x605D0D00, 696, 32, 0 }, + {0x60622000, 392, 32, 0 }, + {0x60623000, 52, 32, 0 }, + {0x60624000, 4, 32, 0 }, + {0x60625000, 4, 32, 0 }, + {0x60626000, 4, 32, 0 }, + {0x60627000, 4, 32, 0 }, + {0x60628000, 4, 32, 0 }, + {0x60629000, 4, 32, 0 }, + {0x6062A000, 4, 32, 0 }, + {0x6062B000, 4, 32, 0 }, + {0x60630000, 132, 32, 0 }, + {0x60630084, 8, 32, 0 }, + {0x6063008C, 4, 32, 0 }, + {0x60630090, 40, 32, 0 }, + {0x606300B8, 20, 32, 0 }, + {0x606300D8, 8, 32, 0 }, + {0x606300E0, 12, 32, 0 }, + {0x606300F8, 8, 32, 0 }, + {0x60640000, 48, 32, 0 }, + {0x60640030, 4, 32, 0 }, + {0x60640034, 56, 32, 0 }, + {0x6064008C, 12, 32, 0 }, + {0x6064009C, 100, 32, 0 }, + {0x60640100, 8, 32, 0 }, + {0x60640108, 12, 32, 0 }, + {0x60640114, 188, 32, 0 }, + {0x606401F0, 8, 32, 0 }, + {0x606401F8, 4, 32, 0 }, + {0x60650000, 40, 32, 0 }, + {0x6065002C, 8, 32, 0 }, + {0x60650034, 24, 32, 0 }, + {0x60660000, 24, 32, 0 }, + {0x60660020, 16, 32, 0 }, + {0x60660030, 32, 32, 0 }, + {0x60660050, 8, 32, 0 }, + {0x60660058, 28, 32, 0 }, + {0x60660074, 8, 32, 0 }, + {0x6066007C, 16, 32, 0 }, + {0x6066008C, 12, 32, 0 }, + {0x60670000, 24, 32, 0 }, + {0x60670020, 16, 32, 0 }, + {0x60670030, 32, 32, 0 }, + {0x60670050, 8, 32, 0 }, + {0x60670058, 28, 32, 0 }, + {0x60670074, 8, 32, 0 }, + {0x6067007C, 16, 32, 0 }, + {0x6067008C, 12, 32, 0 }, + {0x606B0000, 7, 8, 0 }, + {0x606B000E, 14, 8, 0 }, + {0x606B0026, 27, 8, 0 }, + {0x606B0070, 11, 8, 0 }, + {0x606B007B, 1, 8, 0 }, + {0x606C0000, 64, 8, 0 }, + {0x606C0050, 16, 8, 0 }, + {0x606C0080, 64, 8, 0 }, + {0x606C00C0, 16, 8, 0 }, + {0x606D0000, 848, 32, 0 }, + {0x606D0700, 56, 32, 0 }, + {0x606D0800, 848, 32, 0 }, + {0x606D0D00, 696, 32, 0 }, + {0x60722000, 392, 32, 0 }, + {0x60723000, 52, 32, 0 }, + {0x60724000, 4, 32, 0 }, + {0x60725000, 4, 32, 0 }, + {0x60726000, 4, 32, 0 }, + {0x60727000, 4, 32, 0 }, + {0x60728000, 4, 32, 0 }, + {0x60729000, 4, 32, 0 }, + {0x6072A000, 4, 32, 0 }, + {0x6072B000, 4, 32, 0 }, + {0x60730000, 132, 32, 0 }, + {0x60730084, 8, 32, 0 }, + {0x6073008C, 4, 32, 0 }, + {0x60730090, 40, 32, 0 }, + {0x607300B8, 20, 32, 0 }, + {0x607300D8, 8, 32, 0 }, + {0x607300E0, 12, 32, 0 }, + {0x607300F8, 8, 32, 0 }, + {0x60740000, 48, 32, 0 }, + {0x60740030, 4, 32, 0 }, + {0x60740034, 56, 32, 0 }, + {0x6074008C, 12, 32, 0 }, + {0x6074009C, 100, 32, 0 }, + {0x60740100, 8, 32, 0 }, + {0x60740108, 12, 32, 0 }, + {0x60740114, 188, 32, 0 }, + {0x607401F0, 8, 32, 0 }, + {0x607401F8, 4, 32, 0 }, + {0x60750000, 40, 32, 0 }, + {0x6075002C, 8, 32, 0 }, + {0x60750034, 24, 32, 0 }, + {0x60760000, 24, 32, 0 }, + {0x60760020, 16, 32, 0 }, + {0x60760030, 32, 32, 0 }, + {0x60760050, 8, 32, 0 }, + {0x60760058, 28, 32, 0 }, + {0x60760074, 8, 32, 0 }, + {0x6076007C, 16, 32, 0 }, + {0x6076008C, 12, 32, 0 }, + {0x60770000, 24, 32, 0 }, + {0x60770020, 16, 32, 0 }, + {0x60770030, 32, 32, 0 }, + {0x60770050, 8, 32, 0 }, + {0x60770058, 28, 32, 0 }, + {0x60770074, 8, 32, 0 }, + {0x6077007C, 16, 32, 0 }, + {0x6077008C, 12, 32, 0 }, + {0x607B0000, 7, 8, 0 }, + {0x607B000E, 14, 8, 0 }, + {0x607B0026, 27, 8, 0 }, + {0x607B0070, 11, 8, 0 }, + {0x607B007B, 1, 8, 0 }, + {0x607C0000, 64, 8, 0 }, + {0x607C0050, 16, 8, 0 }, + {0x607C0080, 64, 8, 0 }, + {0x607C00C0, 16, 8, 0 }, + {0x607D0000, 848, 32, 0 }, + {0x607D0700, 56, 32, 0 }, + {0x607D0800, 848, 32, 0 }, + {0x607D0D00, 696, 32, 0 }, + {0x60822000, 392, 32, 0 }, + {0x60823000, 52, 32, 0 }, + {0x60824000, 4, 32, 0 }, + {0x60825000, 4, 32, 0 }, + {0x60826000, 4, 32, 0 }, + {0x60827000, 4, 32, 0 }, + {0x60828000, 4, 32, 0 }, + {0x60829000, 4, 32, 0 }, + {0x6082A000, 4, 32, 0 }, + {0x6082B000, 4, 32, 0 }, + {0x60830004, 16, 32, 0 }, + {0x60830018, 8, 32, 0 }, + {0x60830024, 4, 32, 0 }, + {0x60830038, 8, 32, 0 }, + {0x60830040, 16, 32, 0 }, + {0x60830050, 4, 32, 0 }, + {0x60830054, 16, 32, 0 }, + {0x60830064, 4, 32, 0 }, + {0x60830068, 4, 32, 0 }, + {0x6083006C, 4, 32, 0 }, + {0x60838000, 16, 32, 0 }, + {0x60838010, 4, 32, 0 }, + {0x60838014, 196, 32, 0 }, + {0x608380D8, 172, 32, 0 }, + {0x60838190, 4, 32, 0 }, + {0x608381A8, 4, 32, 0 }, + {0x608381B0, 4, 32, 0 }, + {0x60840000, 40, 32, 0 }, + {0x60840030, 32, 32, 0 }, + {0x60840050, 4, 32, 0 }, + {0x60840060, 4, 32, 0 }, + {0x60840068, 8, 32, 0 }, + {0x60840070, 12, 32, 0 }, + {0x6084007C, 16, 32, 0 }, + {0x60848000, 4, 32, 0 }, + {0x60848004, 40, 32, 0 }, + {0x6084802C, 20, 32, 0 }, + {0x60848040, 20, 32, 0 }, + {0x60848054, 20, 32, 0 }, + {0x60848068, 4, 32, 0 }, + {0x6084806C, 32, 32, 0 }, + {0x60858000, 24, 32, 0 }, + {0x60858018, 4, 32, 0 }, + {0x6085802C, 4, 32, 0 }, + {0x60858030, 4, 32, 0 }, + {0x60858034, 4, 32, 0 }, + {0x60858038, 12, 32, 0 }, + {0x60860000, 20, 32, 0 }, + {0x60860028, 16, 32, 0 }, + {0x60870000, 512, 32, 0 }, + {0x60878000, 16, 8, 0 }, + {0x60878010, 27, 8, 0 }, + {0x60878030, 6, 8, 0 }, + {0x60878040, 21, 8, 0 }, + {0x60880000, 6, 8, 0 }, + {0x60880006, 48, 8, 0 }, + {0x60880036, 10, 8, 0 }, + {0x60880040, 13, 8, 0 }, + {0x6088004D, 11, 8, 0 }, + {0x60880058, 1, 8, 0 }, + {0x60888000, 5, 8, 0 }, + {0x60888010, 4, 8, 0 }, + {0x60888020, 10, 8, 0 }, + {0x60888030, 10, 8, 0 }, + {0x60888040, 2, 8, 0 }, + {0x60888050, 3, 8, 0 }, + {0x60890000, 16, 32, 0 }, + {0x6089002C, 20, 32, 0 }, + {0x6089005C, 196, 32, 0 }, + {0x60891FFC, 4, 32, 0 }, + {0x60892000, 100, 32, 0 }, + {0x60892084, 32, 32, 0 }, + {0x60892134, 144, 32, 0 }, + {0x608921E4, 44, 32, 0 }, + {0x6089222C, 4, 32, 0 }, + {0x6089224C, 4, 32, 0 }, + {0x60892400, 524, 32, 0 }, + {0x608927FC, 4, 32, 0 }, + {0x60892800, 100, 32, 0 }, + {0x60892884, 32, 32, 0 }, + {0x60892934, 144, 32, 0 }, + {0x608929E4, 44, 32, 0 }, + {0x60892A2C, 4, 32, 0 }, + {0x60892A4C, 4, 32, 0 }, + {0x60892C00, 524, 32, 0 }, + {0x60892FFC, 4, 32, 0 }, + {0x60894000, 44, 8, 0 }, + {0x608943FF, 1, 8, 0 }, + {0x60894400, 44, 8, 0 }, + {0x608947FF, 1, 8, 0 }, + {0x60896400, 91, 8, 0 }, + {0x608967F2, 14, 8, 0 }, + {0x60896800, 263, 8, 0 }, + {0x60896BFF, 1, 8, 0 }, + {0x60922000, 392, 32, 0 }, + {0x60923000, 52, 32, 0 }, + {0x60924000, 4, 32, 0 }, + {0x60925000, 4, 32, 0 }, + {0x60926000, 4, 32, 0 }, + {0x60927000, 4, 32, 0 }, + {0x60928000, 4, 32, 0 }, + {0x60929000, 4, 32, 0 }, + {0x6092A000, 4, 32, 0 }, + {0x6092B000, 4, 32, 0 }, + {0x60930004, 16, 32, 0 }, + {0x60930018, 8, 32, 0 }, + {0x60930024, 4, 32, 0 }, + {0x60930038, 8, 32, 0 }, + {0x60930040, 16, 32, 0 }, + {0x60930050, 4, 32, 0 }, + {0x60930054, 16, 32, 0 }, + {0x60930064, 4, 32, 0 }, + {0x60930068, 4, 32, 0 }, + {0x6093006C, 4, 32, 0 }, + {0x60938000, 16, 32, 0 }, + {0x60938010, 4, 32, 0 }, + {0x60938014, 196, 32, 0 }, + {0x609380D8, 172, 32, 0 }, + {0x60938190, 4, 32, 0 }, + {0x609381A8, 4, 32, 0 }, + {0x609381B0, 4, 32, 0 }, + {0x60940000, 40, 32, 0 }, + {0x60940030, 32, 32, 0 }, + {0x60940050, 4, 32, 0 }, + {0x60940060, 4, 32, 0 }, + {0x60940068, 8, 32, 0 }, + {0x60940070, 12, 32, 0 }, + {0x6094007C, 16, 32, 0 }, + {0x60948000, 4, 32, 0 }, + {0x60948004, 40, 32, 0 }, + {0x6094802C, 20, 32, 0 }, + {0x60948040, 20, 32, 0 }, + {0x60948054, 20, 32, 0 }, + {0x60948068, 4, 32, 0 }, + {0x6094806C, 32, 32, 0 }, + {0x60958000, 24, 32, 0 }, + {0x60958018, 4, 32, 0 }, + {0x6095802C, 4, 32, 0 }, + {0x60958030, 4, 32, 0 }, + {0x60958034, 4, 32, 0 }, + {0x60958038, 12, 32, 0 }, + {0x60960000, 20, 32, 0 }, + {0x60960028, 16, 32, 0 }, + {0x60970000, 512, 32, 0 }, + {0x60978000, 16, 8, 0 }, + {0x60978010, 27, 8, 0 }, + {0x60978030, 6, 8, 0 }, + {0x60978040, 21, 8, 0 }, + {0x60980000, 6, 8, 0 }, + {0x60980006, 48, 8, 0 }, + {0x60980036, 10, 8, 0 }, + {0x60980040, 13, 8, 0 }, + {0x6098004D, 11, 8, 0 }, + {0x60980058, 1, 8, 0 }, + {0x60988000, 5, 8, 0 }, + {0x60988010, 4, 8, 0 }, + {0x60988020, 10, 8, 0 }, + {0x60988030, 10, 8, 0 }, + {0x60988040, 2, 8, 0 }, + {0x60988050, 3, 8, 0 }, + {0x60990000, 16, 32, 0 }, + {0x6099002C, 20, 32, 0 }, + {0x6099005C, 196, 32, 0 }, + {0x60991FFC, 4, 32, 0 }, + {0x60992000, 100, 32, 0 }, + {0x60992084, 32, 32, 0 }, + {0x60992134, 144, 32, 0 }, + {0x609921E4, 44, 32, 0 }, + {0x6099222C, 4, 32, 0 }, + {0x6099224C, 4, 32, 0 }, + {0x60992400, 524, 32, 0 }, + {0x609927FC, 4, 32, 0 }, + {0x60992800, 100, 32, 0 }, + {0x60992884, 32, 32, 0 }, + {0x60992934, 144, 32, 0 }, + {0x609929E4, 44, 32, 0 }, + {0x60992A2C, 4, 32, 0 }, + {0x60992A4C, 4, 32, 0 }, + {0x60992C00, 524, 32, 0 }, + {0x60992FFC, 4, 32, 0 }, + {0x60994000, 44, 8, 0 }, + {0x609943FF, 1, 8, 0 }, + {0x60994400, 44, 8, 0 }, + {0x609947FF, 1, 8, 0 }, + {0x60996400, 91, 8, 0 }, + {0x609967F2, 14, 8, 0 }, + {0x60996800, 263, 8, 0 }, + {0x60996BFF, 1, 8, 0 }, + {0x60A22000, 392, 32, 0 }, + {0x60A23000, 52, 32, 0 }, + {0x60A24000, 4, 32, 0 }, + {0x60A25000, 4, 32, 0 }, + {0x60A26000, 4, 32, 0 }, + {0x60A27000, 4, 32, 0 }, + {0x60A28000, 4, 32, 0 }, + {0x60A29000, 4, 32, 0 }, + {0x60A2A000, 4, 32, 0 }, + {0x60A2B000, 4, 32, 0 }, + {0x60A30004, 16, 32, 0 }, + {0x60A30018, 8, 32, 0 }, + {0x60A30024, 4, 32, 0 }, + {0x60A30038, 8, 32, 0 }, + {0x60A30040, 16, 32, 0 }, + {0x60A30050, 4, 32, 0 }, + {0x60A30054, 16, 32, 0 }, + {0x60A30064, 4, 32, 0 }, + {0x60A30068, 4, 32, 0 }, + {0x60A3006C, 4, 32, 0 }, + {0x60A38000, 16, 32, 0 }, + {0x60A38010, 4, 32, 0 }, + {0x60A38014, 196, 32, 0 }, + {0x60A380D8, 172, 32, 0 }, + {0x60A38190, 4, 32, 0 }, + {0x60A381A8, 4, 32, 0 }, + {0x60A381B0, 4, 32, 0 }, + {0x60A40000, 40, 32, 0 }, + {0x60A40030, 32, 32, 0 }, + {0x60A40050, 4, 32, 0 }, + {0x60A40060, 4, 32, 0 }, + {0x60A40068, 8, 32, 0 }, + {0x60A40070, 12, 32, 0 }, + {0x60A4007C, 16, 32, 0 }, + {0x60A48000, 4, 32, 0 }, + {0x60A48004, 40, 32, 0 }, + {0x60A4802C, 20, 32, 0 }, + {0x60A48040, 20, 32, 0 }, + {0x60A48054, 20, 32, 0 }, + {0x60A48068, 4, 32, 0 }, + {0x60A4806C, 32, 32, 0 }, + {0x60A58000, 24, 32, 0 }, + {0x60A58018, 4, 32, 0 }, + {0x60A5802C, 4, 32, 0 }, + {0x60A58030, 4, 32, 0 }, + {0x60A58034, 4, 32, 0 }, + {0x60A58038, 12, 32, 0 }, + {0x60A60000, 20, 32, 0 }, + {0x60A60028, 16, 32, 0 }, + {0x60A70000, 512, 32, 0 }, + {0x60A78000, 16, 8, 0 }, + {0x60A78010, 27, 8, 0 }, + {0x60A78030, 6, 8, 0 }, + {0x60A78040, 21, 8, 0 }, + {0x60A80000, 6, 8, 0 }, + {0x60A80006, 48, 8, 0 }, + {0x60A80036, 10, 8, 0 }, + {0x60A80040, 13, 8, 0 }, + {0x60A8004D, 11, 8, 0 }, + {0x60A80058, 1, 8, 0 }, + {0x60A88000, 5, 8, 0 }, + {0x60A88010, 4, 8, 0 }, + {0x60A88020, 10, 8, 0 }, + {0x60A88030, 10, 8, 0 }, + {0x60A88040, 2, 8, 0 }, + {0x60A88050, 3, 8, 0 }, + {0x60A90000, 16, 32, 0 }, + {0x60A9002C, 20, 32, 0 }, + {0x60A9005C, 196, 32, 0 }, + {0x60A91FFC, 4, 32, 0 }, + {0x60A92000, 100, 32, 0 }, + {0x60A92084, 32, 32, 0 }, + {0x60A92134, 144, 32, 0 }, + {0x60A921E4, 44, 32, 0 }, + {0x60A9222C, 4, 32, 0 }, + {0x60A9224C, 4, 32, 0 }, + {0x60A92400, 524, 32, 0 }, + {0x60A927FC, 4, 32, 0 }, + {0x60A92800, 100, 32, 0 }, + {0x60A92884, 32, 32, 0 }, + {0x60A92934, 144, 32, 0 }, + {0x60A929E4, 44, 32, 0 }, + {0x60A92A2C, 4, 32, 0 }, + {0x60A92A4C, 4, 32, 0 }, + {0x60A92C00, 524, 32, 0 }, + {0x60A92FFC, 4, 32, 0 }, + {0x60A94000, 44, 8, 0 }, + {0x60A943FF, 1, 8, 0 }, + {0x60A94400, 44, 8, 0 }, + {0x60A947FF, 1, 8, 0 }, + {0x60A96400, 91, 8, 0 }, + {0x60A967F2, 14, 8, 0 }, + {0x60A96800, 263, 8, 0 }, + {0x60A96BFF, 1, 8, 0 }, + {0x60B22000, 392, 32, 0 }, + {0x60B23000, 52, 32, 0 }, + {0x60B24000, 4, 32, 0 }, + {0x60B25000, 4, 32, 0 }, + {0x60B26000, 4, 32, 0 }, + {0x60B27000, 4, 32, 0 }, + {0x60B28000, 4, 32, 0 }, + {0x60B29000, 4, 32, 0 }, + {0x60B2A000, 4, 32, 0 }, + {0x60B2B000, 4, 32, 0 }, + {0x60B30004, 16, 32, 0 }, + {0x60B30018, 8, 32, 0 }, + {0x60B30024, 4, 32, 0 }, + {0x60B30038, 8, 32, 0 }, + {0x60B30040, 16, 32, 0 }, + {0x60B30050, 4, 32, 0 }, + {0x60B30054, 16, 32, 0 }, + {0x60B30064, 4, 32, 0 }, + {0x60B30068, 4, 32, 0 }, + {0x60B3006C, 4, 32, 0 }, + {0x60B38000, 16, 32, 0 }, + {0x60B38010, 4, 32, 0 }, + {0x60B38014, 196, 32, 0 }, + {0x60B380D8, 172, 32, 0 }, + {0x60B38190, 4, 32, 0 }, + {0x60B381A8, 4, 32, 0 }, + {0x60B381B0, 4, 32, 0 }, + {0x60B40000, 40, 32, 0 }, + {0x60B40030, 32, 32, 0 }, + {0x60B40050, 4, 32, 0 }, + {0x60B40060, 4, 32, 0 }, + {0x60B40068, 8, 32, 0 }, + {0x60B40070, 12, 32, 0 }, + {0x60B4007C, 16, 32, 0 }, + {0x60B48000, 4, 32, 0 }, + {0x60B48004, 40, 32, 0 }, + {0x60B4802C, 20, 32, 0 }, + {0x60B48040, 20, 32, 0 }, + {0x60B48054, 20, 32, 0 }, + {0x60B48068, 4, 32, 0 }, + {0x60B4806C, 32, 32, 0 }, + {0x60B58000, 24, 32, 0 }, + {0x60B58018, 4, 32, 0 }, + {0x60B5802C, 4, 32, 0 }, + {0x60B58030, 4, 32, 0 }, + {0x60B58034, 4, 32, 0 }, + {0x60B58038, 12, 32, 0 }, + {0x60B60000, 20, 32, 0 }, + {0x60B60028, 16, 32, 0 }, + {0x60B70000, 512, 32, 0 }, + {0x60B78000, 16, 8, 0 }, + {0x60B78010, 27, 8, 0 }, + {0x60B78030, 6, 8, 0 }, + {0x60B78040, 21, 8, 0 }, + {0x60B80000, 6, 8, 0 }, + {0x60B80006, 48, 8, 0 }, + {0x60B80036, 10, 8, 0 }, + {0x60B80040, 13, 8, 0 }, + {0x60B8004D, 11, 8, 0 }, + {0x60B80058, 1, 8, 0 }, + {0x60B88000, 5, 8, 0 }, + {0x60B88010, 4, 8, 0 }, + {0x60B88020, 10, 8, 0 }, + {0x60B88030, 10, 8, 0 }, + {0x60B88040, 2, 8, 0 }, + {0x60B88050, 3, 8, 0 }, + {0x60B90000, 16, 32, 0 }, + {0x60B9002C, 20, 32, 0 }, + {0x60B9005C, 196, 32, 0 }, + {0x60B91FFC, 4, 32, 0 }, + {0x60B92000, 100, 32, 0 }, + {0x60B92084, 32, 32, 0 }, + {0x60B92134, 144, 32, 0 }, + {0x60B921E4, 44, 32, 0 }, + {0x60B9222C, 4, 32, 0 }, + {0x60B9224C, 4, 32, 0 }, + {0x60B92400, 524, 32, 0 }, + {0x60B927FC, 4, 32, 0 }, + {0x60B92800, 100, 32, 0 }, + {0x60B92884, 32, 32, 0 }, + {0x60B92934, 144, 32, 0 }, + {0x60B929E4, 44, 32, 0 }, + {0x60B92A2C, 4, 32, 0 }, + {0x60B92A4C, 4, 32, 0 }, + {0x60B92C00, 524, 32, 0 }, + {0x60B92FFC, 4, 32, 0 }, + {0x60B94000, 44, 8, 0 }, + {0x60B943FF, 1, 8, 0 }, + {0x60B94400, 44, 8, 0 }, + {0x60B947FF, 1, 8, 0 }, + {0x60B96400, 91, 8, 0 }, + {0x60B967F2, 14, 8, 0 }, + {0x60B96800, 263, 8, 0 }, + {0x60B96BFF, 1, 8, 0 }, + {0x60C22000, 392, 32, 0 }, + {0x60C23000, 52, 32, 0 }, + {0x60C24000, 4, 32, 0 }, + {0x60C25000, 4, 32, 0 }, + {0x60C26000, 4, 32, 0 }, + {0x60C27000, 4, 32, 0 }, + {0x60C28000, 4, 32, 0 }, + {0x60C29000, 4, 32, 0 }, + {0x60C2A000, 4, 32, 0 }, + {0x60C2B000, 4, 32, 0 }, + {0x60C30004, 16, 32, 0 }, + {0x60C30018, 8, 32, 0 }, + {0x60C30024, 4, 32, 0 }, + {0x60C30038, 8, 32, 0 }, + {0x60C30040, 16, 32, 0 }, + {0x60C30050, 4, 32, 0 }, + {0x60C30054, 16, 32, 0 }, + {0x60C30064, 4, 32, 0 }, + {0x60C30068, 4, 32, 0 }, + {0x60C3006C, 4, 32, 0 }, + {0x60C38000, 16, 32, 0 }, + {0x60C38010, 4, 32, 0 }, + {0x60C38014, 196, 32, 0 }, + {0x60C380D8, 172, 32, 0 }, + {0x60C38190, 4, 32, 0 }, + {0x60C381A8, 4, 32, 0 }, + {0x60C381B0, 4, 32, 0 }, + {0x60C40000, 40, 32, 0 }, + {0x60C40030, 32, 32, 0 }, + {0x60C40050, 4, 32, 0 }, + {0x60C40060, 4, 32, 0 }, + {0x60C40068, 8, 32, 0 }, + {0x60C40070, 12, 32, 0 }, + {0x60C4007C, 16, 32, 0 }, + {0x60C48000, 4, 32, 0 }, + {0x60C48004, 40, 32, 0 }, + {0x60C4802C, 20, 32, 0 }, + {0x60C48040, 20, 32, 0 }, + {0x60C48054, 20, 32, 0 }, + {0x60C48068, 4, 32, 0 }, + {0x60C4806C, 32, 32, 0 }, + {0x60C58000, 24, 32, 0 }, + {0x60C58018, 4, 32, 0 }, + {0x60C5802C, 4, 32, 0 }, + {0x60C58030, 4, 32, 0 }, + {0x60C58034, 4, 32, 0 }, + {0x60C58038, 12, 32, 0 }, + {0x60C60000, 20, 32, 0 }, + {0x60C60028, 16, 32, 0 }, + {0x60C70000, 512, 32, 0 }, + {0x60C78000, 16, 8, 0 }, + {0x60C78010, 27, 8, 0 }, + {0x60C78030, 6, 8, 0 }, + {0x60C78040, 21, 8, 0 }, + {0x60C80000, 6, 8, 0 }, + {0x60C80006, 48, 8, 0 }, + {0x60C80036, 10, 8, 0 }, + {0x60C80040, 13, 8, 0 }, + {0x60C8004D, 11, 8, 0 }, + {0x60C80058, 1, 8, 0 }, + {0x60C88000, 5, 8, 0 }, + {0x60C88010, 4, 8, 0 }, + {0x60C88020, 10, 8, 0 }, + {0x60C88030, 10, 8, 0 }, + {0x60C88040, 2, 8, 0 }, + {0x60C88050, 3, 8, 0 }, + {0x60C90000, 16, 32, 0 }, + {0x60C9002C, 20, 32, 0 }, + {0x60C9005C, 196, 32, 0 }, + {0x60C91FFC, 4, 32, 0 }, + {0x60C92000, 100, 32, 0 }, + {0x60C92084, 32, 32, 0 }, + {0x60C92134, 144, 32, 0 }, + {0x60C921E4, 44, 32, 0 }, + {0x60C9222C, 4, 32, 0 }, + {0x60C9224C, 4, 32, 0 }, + {0x60C92400, 524, 32, 0 }, + {0x60C927FC, 4, 32, 0 }, + {0x60C92800, 100, 32, 0 }, + {0x60C92884, 32, 32, 0 }, + {0x60C92934, 144, 32, 0 }, + {0x60C929E4, 44, 32, 0 }, + {0x60C92A2C, 4, 32, 0 }, + {0x60C92A4C, 4, 32, 0 }, + {0x60C92C00, 524, 32, 0 }, + {0x60C92FFC, 4, 32, 0 }, + {0x60C94000, 44, 8, 0 }, + {0x60C943FF, 1, 8, 0 }, + {0x60C94400, 44, 8, 0 }, + {0x60C947FF, 1, 8, 0 }, + {0x60C96400, 91, 8, 0 }, + {0x60C967F2, 14, 8, 0 }, + {0x60C96800, 263, 8, 0 }, + {0x60C96BFF, 1, 8, 0 }, + {0x60D22000, 392, 32, 0 }, + {0x60D23000, 52, 32, 0 }, + {0x60D24000, 4, 32, 0 }, + {0x60D25000, 4, 32, 0 }, + {0x60D26000, 4, 32, 0 }, + {0x60D27000, 4, 32, 0 }, + {0x60D28000, 4, 32, 0 }, + {0x60D29000, 4, 32, 0 }, + {0x60D2A000, 4, 32, 0 }, + {0x60D2B000, 4, 32, 0 }, + {0x60D30004, 16, 32, 0 }, + {0x60D30018, 8, 32, 0 }, + {0x60D30024, 4, 32, 0 }, + {0x60D30038, 8, 32, 0 }, + {0x60D30040, 16, 32, 0 }, + {0x60D30050, 4, 32, 0 }, + {0x60D30054, 16, 32, 0 }, + {0x60D30064, 4, 32, 0 }, + {0x60D30068, 4, 32, 0 }, + {0x60D3006C, 4, 32, 0 }, + {0x60D38000, 16, 32, 0 }, + {0x60D38010, 4, 32, 0 }, + {0x60D38014, 196, 32, 0 }, + {0x60D380D8, 172, 32, 0 }, + {0x60D38190, 4, 32, 0 }, + {0x60D381A8, 4, 32, 0 }, + {0x60D381B0, 4, 32, 0 }, + {0x60D40000, 40, 32, 0 }, + {0x60D40030, 32, 32, 0 }, + {0x60D40050, 4, 32, 0 }, + {0x60D40060, 4, 32, 0 }, + {0x60D40068, 8, 32, 0 }, + {0x60D40070, 12, 32, 0 }, + {0x60D4007C, 16, 32, 0 }, + {0x60D48000, 4, 32, 0 }, + {0x60D48004, 40, 32, 0 }, + {0x60D4802C, 20, 32, 0 }, + {0x60D48040, 20, 32, 0 }, + {0x60D48054, 20, 32, 0 }, + {0x60D48068, 4, 32, 0 }, + {0x60D4806C, 32, 32, 0 }, + {0x60D58000, 24, 32, 0 }, + {0x60D58018, 4, 32, 0 }, + {0x60D5802C, 4, 32, 0 }, + {0x60D58030, 4, 32, 0 }, + {0x60D58034, 4, 32, 0 }, + {0x60D58038, 12, 32, 0 }, + {0x60D60000, 20, 32, 0 }, + {0x60D60028, 16, 32, 0 }, + {0x60D70000, 512, 32, 0 }, + {0x60D78000, 16, 8, 0 }, + {0x60D78010, 27, 8, 0 }, + {0x60D78030, 6, 8, 0 }, + {0x60D78040, 21, 8, 0 }, + {0x60D80000, 6, 8, 0 }, + {0x60D80006, 48, 8, 0 }, + {0x60D80036, 10, 8, 0 }, + {0x60D80040, 13, 8, 0 }, + {0x60D8004D, 11, 8, 0 }, + {0x60D80058, 1, 8, 0 }, + {0x60D88000, 5, 8, 0 }, + {0x60D88010, 4, 8, 0 }, + {0x60D88020, 10, 8, 0 }, + {0x60D88030, 10, 8, 0 }, + {0x60D88040, 2, 8, 0 }, + {0x60D88050, 3, 8, 0 }, + {0x60D90000, 16, 32, 0 }, + {0x60D9002C, 20, 32, 0 }, + {0x60D9005C, 196, 32, 0 }, + {0x60D91FFC, 4, 32, 0 }, + {0x60D92000, 100, 32, 0 }, + {0x60D92084, 32, 32, 0 }, + {0x60D92134, 144, 32, 0 }, + {0x60D921E4, 44, 32, 0 }, + {0x60D9222C, 4, 32, 0 }, + {0x60D9224C, 4, 32, 0 }, + {0x60D92400, 524, 32, 0 }, + {0x60D927FC, 4, 32, 0 }, + {0x60D92800, 100, 32, 0 }, + {0x60D92884, 32, 32, 0 }, + {0x60D92934, 144, 32, 0 }, + {0x60D929E4, 44, 32, 0 }, + {0x60D92A2C, 4, 32, 0 }, + {0x60D92A4C, 4, 32, 0 }, + {0x60D92C00, 524, 32, 0 }, + {0x60D92FFC, 4, 32, 0 }, + {0x60D94000, 44, 8, 0 }, + {0x60D943FF, 1, 8, 0 }, + {0x60D94400, 44, 8, 0 }, + {0x60D947FF, 1, 8, 0 }, + {0x60D96400, 91, 8, 0 }, + {0x60D967F2, 14, 8, 0 }, + {0x60D96800, 263, 8, 0 }, + {0x60D96BFF, 1, 8, 0 }, + {0x60E22000, 392, 32, 0 }, + {0x60E23000, 52, 32, 0 }, + {0x60E24000, 4, 32, 0 }, + {0x60E25000, 4, 32, 0 }, + {0x60E26000, 4, 32, 0 }, + {0x60E27000, 4, 32, 0 }, + {0x60E28000, 4, 32, 0 }, + {0x60E29000, 4, 32, 0 }, + {0x60E2A000, 4, 32, 0 }, + {0x60E2B000, 4, 32, 0 }, + {0x60E30004, 16, 32, 0 }, + {0x60E30018, 8, 32, 0 }, + {0x60E30024, 4, 32, 0 }, + {0x60E30038, 8, 32, 0 }, + {0x60E30040, 16, 32, 0 }, + {0x60E30050, 4, 32, 0 }, + {0x60E30054, 16, 32, 0 }, + {0x60E30064, 4, 32, 0 }, + {0x60E30068, 4, 32, 0 }, + {0x60E3006C, 4, 32, 0 }, + {0x60E38000, 16, 32, 0 }, + {0x60E38010, 4, 32, 0 }, + {0x60E38014, 196, 32, 0 }, + {0x60E380D8, 172, 32, 0 }, + {0x60E38190, 4, 32, 0 }, + {0x60E381A8, 4, 32, 0 }, + {0x60E381B0, 4, 32, 0 }, + {0x60E40000, 40, 32, 0 }, + {0x60E40030, 32, 32, 0 }, + {0x60E40050, 4, 32, 0 }, + {0x60E40060, 4, 32, 0 }, + {0x60E40068, 8, 32, 0 }, + {0x60E40070, 12, 32, 0 }, + {0x60E4007C, 16, 32, 0 }, + {0x60E48000, 4, 32, 0 }, + {0x60E48004, 40, 32, 0 }, + {0x60E4802C, 20, 32, 0 }, + {0x60E48040, 20, 32, 0 }, + {0x60E48054, 20, 32, 0 }, + {0x60E48068, 4, 32, 0 }, + {0x60E4806C, 32, 32, 0 }, + {0x60E58000, 24, 32, 0 }, + {0x60E58018, 4, 32, 0 }, + {0x60E5802C, 4, 32, 0 }, + {0x60E58030, 4, 32, 0 }, + {0x60E58034, 4, 32, 0 }, + {0x60E58038, 12, 32, 0 }, + {0x60E60000, 20, 32, 0 }, + {0x60E60028, 16, 32, 0 }, + {0x60E70000, 512, 32, 0 }, + {0x60E78000, 16, 8, 0 }, + {0x60E78010, 27, 8, 0 }, + {0x60E78030, 6, 8, 0 }, + {0x60E78040, 21, 8, 0 }, + {0x60E80000, 6, 8, 0 }, + {0x60E80006, 48, 8, 0 }, + {0x60E80036, 10, 8, 0 }, + {0x60E80040, 13, 8, 0 }, + {0x60E8004D, 11, 8, 0 }, + {0x60E80058, 1, 8, 0 }, + {0x60E88000, 5, 8, 0 }, + {0x60E88010, 4, 8, 0 }, + {0x60E88020, 10, 8, 0 }, + {0x60E88030, 10, 8, 0 }, + {0x60E88040, 2, 8, 0 }, + {0x60E88050, 3, 8, 0 }, + {0x60E90000, 16, 32, 0 }, + {0x60E9002C, 20, 32, 0 }, + {0x60E9005C, 196, 32, 0 }, + {0x60E91FFC, 4, 32, 0 }, + {0x60E92000, 100, 32, 0 }, + {0x60E92084, 32, 32, 0 }, + {0x60E92134, 144, 32, 0 }, + {0x60E921E4, 44, 32, 0 }, + {0x60E9222C, 4, 32, 0 }, + {0x60E9224C, 4, 32, 0 }, + {0x60E92400, 524, 32, 0 }, + {0x60E927FC, 4, 32, 0 }, + {0x60E92800, 100, 32, 0 }, + {0x60E92884, 32, 32, 0 }, + {0x60E92934, 144, 32, 0 }, + {0x60E929E4, 44, 32, 0 }, + {0x60E92A2C, 4, 32, 0 }, + {0x60E92A4C, 4, 32, 0 }, + {0x60E92C00, 524, 32, 0 }, + {0x60E92FFC, 4, 32, 0 }, + {0x60E94000, 44, 8, 0 }, + {0x60E943FF, 1, 8, 0 }, + {0x60E94400, 44, 8, 0 }, + {0x60E947FF, 1, 8, 0 }, + {0x60E96400, 91, 8, 0 }, + {0x60E967F2, 14, 8, 0 }, + {0x60E96800, 263, 8, 0 }, + {0x60E96BFF, 1, 8, 0 }, + {0x60F22000, 392, 32, 0 }, + {0x60F23000, 52, 32, 0 }, + {0x60F24000, 4, 32, 0 }, + {0x60F25000, 4, 32, 0 }, + {0x60F26000, 4, 32, 0 }, + {0x60F27000, 4, 32, 0 }, + {0x60F28000, 4, 32, 0 }, + {0x60F29000, 4, 32, 0 }, + {0x60F2A000, 4, 32, 0 }, + {0x60F2B000, 4, 32, 0 }, + {0x60F30004, 16, 32, 0 }, + {0x60F30018, 8, 32, 0 }, + {0x60F30024, 4, 32, 0 }, + {0x60F30038, 8, 32, 0 }, + {0x60F30040, 16, 32, 0 }, + {0x60F30050, 4, 32, 0 }, + {0x60F30054, 16, 32, 0 }, + {0x60F30064, 4, 32, 0 }, + {0x60F30068, 4, 32, 0 }, + {0x60F3006C, 4, 32, 0 }, + {0x60F38000, 16, 32, 0 }, + {0x60F38010, 4, 32, 0 }, + {0x60F38014, 196, 32, 0 }, + {0x60F380D8, 172, 32, 0 }, + {0x60F38190, 4, 32, 0 }, + {0x60F381A8, 4, 32, 0 }, + {0x60F381B0, 4, 32, 0 }, + {0x60F40000, 40, 32, 0 }, + {0x60F40030, 32, 32, 0 }, + {0x60F40050, 4, 32, 0 }, + {0x60F40060, 4, 32, 0 }, + {0x60F40068, 8, 32, 0 }, + {0x60F40070, 12, 32, 0 }, + {0x60F4007C, 16, 32, 0 }, + {0x60F48000, 4, 32, 0 }, + {0x60F48004, 40, 32, 0 }, + {0x60F4802C, 20, 32, 0 }, + {0x60F48040, 20, 32, 0 }, + {0x60F48054, 20, 32, 0 }, + {0x60F48068, 4, 32, 0 }, + {0x60F4806C, 32, 32, 0 }, + {0x60F58000, 24, 32, 0 }, + {0x60F58018, 4, 32, 0 }, + {0x60F5802C, 4, 32, 0 }, + {0x60F58030, 4, 32, 0 }, + {0x60F58034, 4, 32, 0 }, + {0x60F58038, 12, 32, 0 }, + {0x60F60000, 20, 32, 0 }, + {0x60F60028, 16, 32, 0 }, + {0x60F70000, 512, 32, 0 }, + {0x60F78000, 16, 8, 0 }, + {0x60F78010, 27, 8, 0 }, + {0x60F78030, 6, 8, 0 }, + {0x60F78040, 21, 8, 0 }, + {0x60F80000, 6, 8, 0 }, + {0x60F80006, 48, 8, 0 }, + {0x60F80036, 10, 8, 0 }, + {0x60F80040, 13, 8, 0 }, + {0x60F8004D, 11, 8, 0 }, + {0x60F80058, 1, 8, 0 }, + {0x60F88000, 5, 8, 0 }, + {0x60F88010, 4, 8, 0 }, + {0x60F88020, 10, 8, 0 }, + {0x60F88030, 10, 8, 0 }, + {0x60F88040, 2, 8, 0 }, + {0x60F88050, 3, 8, 0 }, + {0x60F90000, 16, 32, 0 }, + {0x60F9002C, 20, 32, 0 }, + {0x60F9005C, 196, 32, 0 }, + {0x60F91FFC, 4, 32, 0 }, + {0x60F92000, 100, 32, 0 }, + {0x60F92084, 32, 32, 0 }, + {0x60F92134, 144, 32, 0 }, + {0x60F921E4, 44, 32, 0 }, + {0x60F9222C, 4, 32, 0 }, + {0x60F9224C, 4, 32, 0 }, + {0x60F92400, 524, 32, 0 }, + {0x60F927FC, 4, 32, 0 }, + {0x60F92800, 100, 32, 0 }, + {0x60F92884, 32, 32, 0 }, + {0x60F92934, 144, 32, 0 }, + {0x60F929E4, 44, 32, 0 }, + {0x60F92A2C, 4, 32, 0 }, + {0x60F92A4C, 4, 32, 0 }, + {0x60F92C00, 524, 32, 0 }, + {0x60F92FFC, 4, 32, 0 }, + {0x60F94000, 44, 8, 0 }, + {0x60F943FF, 1, 8, 0 }, + {0x60F94400, 44, 8, 0 }, + {0x60F947FF, 1, 8, 0 }, + {0x60F96400, 91, 8, 0 }, + {0x60F967F2, 14, 8, 0 }, + {0x60F96800, 263, 8, 0 }, + {0x60F96BFF, 1, 8, 0 }, + {0x61022000, 392, 32, 0 }, + {0x61023000, 52, 32, 0 }, + {0x61024000, 4, 32, 0 }, + {0x61025000, 4, 32, 0 }, + {0x61026000, 4, 32, 0 }, + {0x61027000, 4, 32, 0 }, + {0x61028000, 4, 32, 0 }, + {0x61029000, 4, 32, 0 }, + {0x6102A000, 4, 32, 0 }, + {0x6102B000, 4, 32, 0 }, + {0x61050000, 56, 32, 0 }, + {0x61050040, 4, 32, 0 }, + {0x61050058, 8, 32, 0 }, + {0x61050070, 12, 32, 0 }, + {0x610500A0, 12, 32, 0 }, + {0x610500D0, 12, 32, 0 }, + {0x610500E0, 4, 32, 0 }, + {0x610500E4, 4, 32, 0 }, + {0x610500E8, 20, 32, 0 }, + {0x61058000, 72, 32, 0 }, + {0x610580A8, 32, 32, 0 }, + {0x61058128, 32, 32, 0 }, + {0x610581A8, 32, 32, 0 }, + {0x61058228, 32, 32, 0 }, + {0x610582A8, 32, 32, 0 }, + {0x61068000, 44, 8, 0 }, + {0x610683FF, 1, 8, 0 }, + {0x61068400, 44, 8, 0 }, + {0x610687FF, 1, 8, 0 }, + {0x61068800, 44, 8, 0 }, + {0x61068BFF, 1, 8, 0 }, + {0x61068C00, 44, 8, 0 }, + {0x61068FFF, 1, 8, 0 }, + {0x61069000, 44, 8, 0 }, + {0x610693FF, 1, 8, 0 }, + {0x6106A400, 91, 8, 0 }, + {0x6106A7F0, 16, 8, 0 }, + {0x6106A800, 263, 8, 0 }, + {0x6106ABFF, 1, 8, 0 }, + {0x61070000, 16, 32, 0 }, + {0x6107002C, 20, 32, 0 }, + {0x6107005C, 196, 32, 0 }, + {0x610707FC, 24, 32, 0 }, + {0x61071FFC, 4, 32, 0 }, + {0x61072000, 100, 32, 0 }, + {0x61072084, 32, 32, 0 }, + {0x61072134, 144, 32, 0 }, + {0x610721E4, 44, 32, 0 }, + {0x6107222C, 4, 32, 0 }, + {0x6107224C, 4, 32, 0 }, + {0x61072400, 524, 32, 0 }, + {0x610727FC, 4, 32, 0 }, + {0x61072800, 100, 32, 0 }, + {0x61072884, 32, 32, 0 }, + {0x61072934, 144, 32, 0 }, + {0x610729E4, 44, 32, 0 }, + {0x61072A2C, 4, 32, 0 }, + {0x61072A4C, 4, 32, 0 }, + {0x61072C00, 524, 32, 0 }, + {0x61072FFC, 4, 32, 0 }, + {0x61073000, 100, 32, 0 }, + {0x61073084, 32, 32, 0 }, + {0x61073134, 144, 32, 0 }, + {0x610731E4, 44, 32, 0 }, + {0x6107322C, 4, 32, 0 }, + {0x6107324C, 4, 32, 0 }, + {0x61073400, 524, 32, 0 }, + {0x610737FC, 4, 32, 0 }, + {0x61073800, 100, 32, 0 }, + {0x61073884, 32, 32, 0 }, + {0x61073934, 144, 32, 0 }, + {0x610739E4, 44, 32, 0 }, + {0x61073A2C, 4, 32, 0 }, + {0x61073A4C, 4, 32, 0 }, + {0x61073C00, 524, 32, 0 }, + {0x61073FFC, 4, 32, 0 }, + {0x61074000, 100, 32, 0 }, + {0x61074084, 32, 32, 0 }, + {0x61074134, 144, 32, 0 }, + {0x610741E4, 44, 32, 0 }, + {0x6107422C, 4, 32, 0 }, + {0x6107424C, 4, 32, 0 }, + {0x61074400, 524, 32, 0 }, + {0x610747FC, 4, 32, 0 }, + {0x61076800, 28, 32, 0 }, + {0x61076838, 4, 32, 0 }, + {0x61076858, 4, 32, 0 }, + {0x61076888, 4, 32, 0 }, + {0x610768B8, 4, 32, 0 }, + {0x61076918, 48, 32, 0 }, + {0x61076984, 340, 32, 0 }, + {0x61076B00, 192, 32, 0 }, + {0x61076FFC, 4, 32, 0 }, + {0x61077000, 28, 32, 0 }, + {0x61077038, 4, 32, 0 }, + {0x61077058, 4, 32, 0 }, + {0x61077088, 4, 32, 0 }, + {0x610770B8, 4, 32, 0 }, + {0x61077118, 48, 32, 0 }, + {0x61077184, 340, 32, 0 }, + {0x61077300, 192, 32, 0 }, + {0x610777FC, 4, 32, 0 }, + {0x61077800, 28, 32, 0 }, + {0x61077838, 4, 32, 0 }, + {0x61077858, 4, 32, 0 }, + {0x61077888, 4, 32, 0 }, + {0x610778B8, 4, 32, 0 }, + {0x61077918, 48, 32, 0 }, + {0x61077984, 340, 32, 0 }, + {0x61077B00, 192, 32, 0 }, + {0x61077FFC, 4, 32, 0 }, + {0x61078000, 28, 32, 0 }, + {0x61078038, 4, 32, 0 }, + {0x61078058, 4, 32, 0 }, + {0x61078088, 4, 32, 0 }, + {0x610780B8, 4, 32, 0 }, + {0x61078118, 48, 32, 0 }, + {0x61078184, 340, 32, 0 }, + {0x61078300, 192, 32, 0 }, + {0x610787FC, 4, 32, 0 }, + {0x61078800, 28, 32, 0 }, + {0x61078838, 4, 32, 0 }, + {0x61078858, 4, 32, 0 }, + {0x61078888, 4, 32, 0 }, + {0x610788B8, 4, 32, 0 }, + {0x61078918, 48, 32, 0 }, + {0x61078984, 340, 32, 0 }, + {0x61078B00, 192, 32, 0 }, + {0x61078FFC, 4, 32, 0 }, + {0x6107B000, 48, 32, 0 }, + {0x6107B7FC, 4, 32, 0 }, + {0x6107B800, 48, 32, 0 }, + {0x6107BFFC, 4, 32, 0 }, + {0x6107C000, 48, 32, 0 }, + {0x6107C7FC, 4, 32, 0 }, + {0x6107C800, 48, 32, 0 }, + {0x6107CFFC, 4, 32, 0 }, + {0x6107D000, 48, 32, 0 }, + {0x6107D7FC, 4, 32, 0 }, + {0x61122000, 392, 32, 0 }, + {0x61123000, 52, 32, 0 }, + {0x61124000, 4, 32, 0 }, + {0x61125000, 4, 32, 0 }, + {0x61126000, 4, 32, 0 }, + {0x61127000, 4, 32, 0 }, + {0x61128000, 4, 32, 0 }, + {0x61129000, 4, 32, 0 }, + {0x6112A000, 4, 32, 0 }, + {0x6112B000, 4, 32, 0 }, + {0x61150000, 56, 32, 0 }, + {0x61150040, 4, 32, 0 }, + {0x61150058, 8, 32, 0 }, + {0x61150070, 12, 32, 0 }, + {0x611500A0, 12, 32, 0 }, + {0x611500D0, 12, 32, 0 }, + {0x611500E0, 4, 32, 0 }, + {0x611500E4, 4, 32, 0 }, + {0x611500E8, 20, 32, 0 }, + {0x61158000, 72, 32, 0 }, + {0x611580A8, 32, 32, 0 }, + {0x61158128, 32, 32, 0 }, + {0x611581A8, 32, 32, 0 }, + {0x61158228, 32, 32, 0 }, + {0x611582A8, 32, 32, 0 }, + {0x61168000, 44, 8, 0 }, + {0x611683FF, 1, 8, 0 }, + {0x61168400, 44, 8, 0 }, + {0x611687FF, 1, 8, 0 }, + {0x61168800, 44, 8, 0 }, + {0x61168BFF, 1, 8, 0 }, + {0x61168C00, 44, 8, 0 }, + {0x61168FFF, 1, 8, 0 }, + {0x61169000, 44, 8, 0 }, + {0x611693FF, 1, 8, 0 }, + {0x6116A400, 91, 8, 0 }, + {0x6116A7F0, 16, 8, 0 }, + {0x6116A800, 263, 8, 0 }, + {0x6116ABFF, 1, 8, 0 }, + {0x61170000, 16, 32, 0 }, + {0x6117002C, 20, 32, 0 }, + {0x6117005C, 196, 32, 0 }, + {0x611707FC, 24, 32, 0 }, + {0x61171FFC, 4, 32, 0 }, + {0x61172000, 100, 32, 0 }, + {0x61172084, 32, 32, 0 }, + {0x61172134, 144, 32, 0 }, + {0x611721E4, 44, 32, 0 }, + {0x6117222C, 4, 32, 0 }, + {0x6117224C, 4, 32, 0 }, + {0x61172400, 524, 32, 0 }, + {0x611727FC, 4, 32, 0 }, + {0x61172800, 100, 32, 0 }, + {0x61172884, 32, 32, 0 }, + {0x61172934, 144, 32, 0 }, + {0x611729E4, 44, 32, 0 }, + {0x61172A2C, 4, 32, 0 }, + {0x61172A4C, 4, 32, 0 }, + {0x61172C00, 524, 32, 0 }, + {0x61172FFC, 4, 32, 0 }, + {0x61173000, 100, 32, 0 }, + {0x61173084, 32, 32, 0 }, + {0x61173134, 144, 32, 0 }, + {0x611731E4, 44, 32, 0 }, + {0x6117322C, 4, 32, 0 }, + {0x6117324C, 4, 32, 0 }, + {0x61173400, 524, 32, 0 }, + {0x611737FC, 4, 32, 0 }, + {0x61173800, 100, 32, 0 }, + {0x61173884, 32, 32, 0 }, + {0x61173934, 144, 32, 0 }, + {0x611739E4, 44, 32, 0 }, + {0x61173A2C, 4, 32, 0 }, + {0x61173A4C, 4, 32, 0 }, + {0x61173C00, 524, 32, 0 }, + {0x61173FFC, 4, 32, 0 }, + {0x61174000, 100, 32, 0 }, + {0x61174084, 32, 32, 0 }, + {0x61174134, 144, 32, 0 }, + {0x611741E4, 44, 32, 0 }, + {0x6117422C, 4, 32, 0 }, + {0x6117424C, 4, 32, 0 }, + {0x61174400, 524, 32, 0 }, + {0x611747FC, 4, 32, 0 }, + {0x61176800, 28, 32, 0 }, + {0x61176838, 4, 32, 0 }, + {0x61176858, 4, 32, 0 }, + {0x61176888, 4, 32, 0 }, + {0x611768B8, 4, 32, 0 }, + {0x61176918, 48, 32, 0 }, + {0x61176984, 340, 32, 0 }, + {0x61176B00, 192, 32, 0 }, + {0x61176FFC, 4, 32, 0 }, + {0x61177000, 28, 32, 0 }, + {0x61177038, 4, 32, 0 }, + {0x61177058, 4, 32, 0 }, + {0x61177088, 4, 32, 0 }, + {0x611770B8, 4, 32, 0 }, + {0x61177118, 48, 32, 0 }, + {0x61177184, 340, 32, 0 }, + {0x61177300, 192, 32, 0 }, + {0x611777FC, 4, 32, 0 }, + {0x61177800, 28, 32, 0 }, + {0x61177838, 4, 32, 0 }, + {0x61177858, 4, 32, 0 }, + {0x61177888, 4, 32, 0 }, + {0x611778B8, 4, 32, 0 }, + {0x61177918, 48, 32, 0 }, + {0x61177984, 340, 32, 0 }, + {0x61177B00, 192, 32, 0 }, + {0x61177FFC, 4, 32, 0 }, + {0x61178000, 28, 32, 0 }, + {0x61178038, 4, 32, 0 }, + {0x61178058, 4, 32, 0 }, + {0x61178088, 4, 32, 0 }, + {0x611780B8, 4, 32, 0 }, + {0x61178118, 48, 32, 0 }, + {0x61178184, 340, 32, 0 }, + {0x61178300, 192, 32, 0 }, + {0x611787FC, 4, 32, 0 }, + {0x61178800, 28, 32, 0 }, + {0x61178838, 4, 32, 0 }, + {0x61178858, 4, 32, 0 }, + {0x61178888, 4, 32, 0 }, + {0x611788B8, 4, 32, 0 }, + {0x61178918, 48, 32, 0 }, + {0x61178984, 340, 32, 0 }, + {0x61178B00, 192, 32, 0 }, + {0x61178FFC, 4, 32, 0 }, + {0x6117B000, 48, 32, 0 }, + {0x6117B7FC, 4, 32, 0 }, + {0x6117B800, 48, 32, 0 }, + {0x6117BFFC, 4, 32, 0 }, + {0x6117C000, 48, 32, 0 }, + {0x6117C7FC, 4, 32, 0 }, + {0x6117C800, 48, 32, 0 }, + {0x6117CFFC, 4, 32, 0 }, + {0x6117D000, 48, 32, 0 }, + {0x6117D7FC, 4, 32, 0 }, +}; diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_rx.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_rx.c new file mode 100644 index 0000000000000..ef99c28e078b9 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_rx.c @@ -0,0 +1,6033 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_rx.c + * \brief Contains ADRV903X Rx related private function implementations + * + * ADRV903X API Version: 2.12.1.4 + */ + +#include "../../private/include/adrv903x_rx.h" +#include "../../private/bf/adrv903x_bf_core.h" +#include "../../private/bf/adrv903x_bf_rx_funcs.h" +#include "../../private/bf/adrv903x_bf_rx_ddc.h" +#include "../../private/bf/adrv903x_bf_orx_dig.h" +#include "../../private/bf/adrv903x_bf_rx_dig.h" +#include "../../private/bf/adrv903x_bf_pll_mem_map.h" +#include "../../private/include/adrv903x_init.h" +#include "../../private/include/adrv903x_gpio.h" +#include "../../private/include/adrv903x_cpu.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_RX + +static const adi_adrv903x_GpioSignal_e adrv903x_RxInternalSlicerOutputSignals[ADI_ADRV903X_MAX_RX_INT_SLICER_BITS] = { + ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_0, + ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_1, + ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_2, + ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_3 +}; + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainTableFormat(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxGainTableRow_t gainTablePtr[], + uint8_t formattedGainTablePtr[], + const uint16_t numGainIndicesInTable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + const uint32_t NUM_BYTES_PER_GAIN_TABLE_ENTRY = 8U; + const uint16_t DIG_GAIN_LSB_MASK = 0x00FFU; + const uint16_t DIG_GAIN_MSB_MASK = 0x0300U; + const uint8_t DIG_GAIN_MSB_SHIFT = 8U; + const uint16_t DIG_GAIN_SIGN_MASK = 0x0400U; + const uint8_t DIG_GAIN_SIGN_SHIFT = 8U; + const uint8_t RXFE_GAIN_LSB_MASK = 0x1FU; + const uint8_t RXFE_GAIN_LSB_SHIFT = 3U; + const uint8_t RXFE_GAIN_MSB_MASK = 0xE0U; + const uint8_t RXFE_GAIN_MSB_SHIFT = 5U; + const uint16_t PHASE_OFFSET_LSB_MASK = 0x00FFU; + const uint16_t PHASE_OFFSET_MSB_MASK = 0xFF00U; + const uint8_t PHASE_OFFSET_MSB_SHIFT = 8U; + const uint8_t EXT_CTRL_MASK = 0x03U; + + uint32_t gainIndex = 0U; + uint32_t formattedGainIndex = 0U; + uint16_t sign = 0U; + uint16_t magnitude = 0U; + + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, gainTablePtr); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, formattedGainTablePtr); + + /*Format gain table*/ + for (gainIndex = 0U; gainIndex < numGainIndicesInTable; ++gainIndex) + { + /*Format Gain Table Data as follows : + No. of Bytes per Gain Table Entry = 8 + @Addr 8 x gainIndex : {13'b0 , rx_fe_gain[7:0], dig_gain[10:0]} + @Addr 8 x gainIndex + 4 : {14'b0, ext_control[1:0], phase_offset[15:0]} + */ + formattedGainIndex = (gainIndex * NUM_BYTES_PER_GAIN_TABLE_ENTRY); + + if (gainTablePtr[gainIndex].digGain < 0) + { + sign = DIG_GAIN_SIGN_MASK; /* set bit 11 */ + magnitude = (((~(uint16_t)gainTablePtr[gainIndex].digGain) + 1U) & 0x3FFU); + } + else + { + sign = 0U; + magnitude = gainTablePtr[gainIndex].digGain & 0x3FFU; + } + + /* The Gain Table is in a '32b-only' region so must be written via Registers32bOnlyWrite() which treats data as uint32 + * and applies endianess conversion accordingly. So we layout the memory buffer differently depending on host endianess. */ +#if ADRV903X_LITTLE_ENDIAN + formattedGainTablePtr[formattedGainIndex] = (uint8_t)(magnitude & DIG_GAIN_LSB_MASK); + formattedGainTablePtr[formattedGainIndex + 1U] = (uint8_t)((sign & DIG_GAIN_SIGN_MASK) >> DIG_GAIN_SIGN_SHIFT) | + (uint8_t)((magnitude & DIG_GAIN_MSB_MASK) >> DIG_GAIN_MSB_SHIFT) | + (uint8_t)((gainTablePtr[gainIndex].rxFeGain & RXFE_GAIN_LSB_MASK) << RXFE_GAIN_LSB_SHIFT); + formattedGainTablePtr[formattedGainIndex + 2U] = (uint8_t)((gainTablePtr[gainIndex].rxFeGain & RXFE_GAIN_MSB_MASK) >> RXFE_GAIN_MSB_SHIFT); + formattedGainTablePtr[formattedGainIndex + 3U] = 0U; + formattedGainTablePtr[formattedGainIndex + 4U] = (uint8_t)(gainTablePtr[gainIndex].phaseOffset & PHASE_OFFSET_LSB_MASK); + formattedGainTablePtr[formattedGainIndex + 5U] = (uint8_t)((gainTablePtr[gainIndex].phaseOffset & PHASE_OFFSET_MSB_MASK) >> PHASE_OFFSET_MSB_SHIFT); + formattedGainTablePtr[formattedGainIndex + 6U] = (uint8_t)(gainTablePtr[gainIndex].extControl & EXT_CTRL_MASK); + formattedGainTablePtr[formattedGainIndex + 7U] = 0U; +#else + formattedGainTablePtr[formattedGainIndex + 3U] = (uint8_t)(magnitude & DIG_GAIN_LSB_MASK); + formattedGainTablePtr[formattedGainIndex + 2U] = (uint8_t)((sign & DIG_GAIN_SIGN_MASK) >> DIG_GAIN_SIGN_SHIFT) | + (uint8_t)((magnitude & DIG_GAIN_MSB_MASK) >> DIG_GAIN_MSB_SHIFT) | + (uint8_t)((gainTablePtr[gainIndex].rxFeGain & RXFE_GAIN_LSB_MASK) << RXFE_GAIN_LSB_SHIFT); + formattedGainTablePtr[formattedGainIndex + 1U] = (uint8_t)((gainTablePtr[gainIndex].rxFeGain & RXFE_GAIN_MSB_MASK) >> RXFE_GAIN_MSB_SHIFT); + formattedGainTablePtr[formattedGainIndex] = 0U; + formattedGainTablePtr[formattedGainIndex + 7U] = (uint8_t)(gainTablePtr[gainIndex].phaseOffset & PHASE_OFFSET_LSB_MASK); + formattedGainTablePtr[formattedGainIndex + 6U] = (uint8_t)((gainTablePtr[gainIndex].phaseOffset & PHASE_OFFSET_MSB_MASK) >> PHASE_OFFSET_MSB_SHIFT); + formattedGainTablePtr[formattedGainIndex + 5U] = (uint8_t)(gainTablePtr[gainIndex].extControl & EXT_CTRL_MASK); + formattedGainTablePtr[formattedGainIndex + 4U] = 0U; +#endif + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainTableReadParamsCompute(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint32_t maxReadGainIndices, + const uint8_t gainIndexOffset, + uint16_t* const numGainIndicesToRead, + uint32_t* const baseAddr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + const uint32_t NUM_BYTES_PER_RX_GAIN_INDEX = 8U; + + uint16_t maxGainIndices = 0U; + uint32_t baseIndex = 0U; + int32_t rxChannelIndex = 0U; + uint8_t minGainIndex = 0U; + + const uint32_t rxGainTableBaseAddr[] = + { + ADI_ADRV903X_RX0_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX1_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX2_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX3_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX4_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX5_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX6_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX7_GAIN_TABLE_BASEADDR + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, numGainIndicesToRead); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, baseAddr); + + switch (rxChannel) + { + case ADI_ADRV903X_RX0: + rxChannelIndex = 0U; + minGainIndex = device->devStateInfo.gainIndexes.rx0MinGainIndex; + break; + + case ADI_ADRV903X_RX1: + rxChannelIndex = 1U; + minGainIndex = device->devStateInfo.gainIndexes.rx1MinGainIndex; + break; + + case ADI_ADRV903X_RX2: + rxChannelIndex = 2U; + minGainIndex = device->devStateInfo.gainIndexes.rx2MinGainIndex; + break; + + case ADI_ADRV903X_RX3: + rxChannelIndex = 3U; + minGainIndex = device->devStateInfo.gainIndexes.rx3MinGainIndex; + break; + + case ADI_ADRV903X_RX4: + rxChannelIndex = 4U; + minGainIndex = device->devStateInfo.gainIndexes.rx4MinGainIndex; + break; + + case ADI_ADRV903X_RX5: + rxChannelIndex = 5U; + minGainIndex = device->devStateInfo.gainIndexes.rx5MinGainIndex; + break; + + case ADI_ADRV903X_RX6: + rxChannelIndex = 6U; + minGainIndex = device->devStateInfo.gainIndexes.rx6MinGainIndex; + break; + + case ADI_ADRV903X_RX7: + rxChannelIndex = 7U; + minGainIndex = device->devStateInfo.gainIndexes.rx7MinGainIndex; + break; + + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for gain table read. Valid Rx channels include Rx0-Rx7."); + return recoveryAction; + break; + } + + maxGainIndices = (gainIndexOffset - minGainIndex) + 1U; + + if (maxReadGainIndices >= maxGainIndices) + { + *numGainIndicesToRead = maxGainIndices; + } + else + { + *numGainIndicesToRead = maxReadGainIndices; + } + + baseIndex = (gainIndexOffset - (*numGainIndicesToRead - 1U)); + *baseAddr = (uint32_t)rxGainTableBaseAddr[rxChannelIndex] + (baseIndex * NUM_BYTES_PER_RX_GAIN_INDEX); + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainTableParse(adi_adrv903x_Device_t* const device, + adi_adrv903x_RxGainTableRow_t gainTablePtr[], + const uint8_t cpuDmaDataGainTablePtr[], + const uint16_t numGainIndicesInTable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + const uint32_t NUM_BYTES_PER_GAIN_TABLE_ENTRY = 8U; + const uint16_t DIG_GAIN_MSB_MASK = 0x0003U; + const uint8_t DIG_GAIN_MSB_SHIFT = 8U; + const uint8_t RXFE_GAIN_LSB_MASK = 0xF8U; + const uint8_t RXFE_GAIN_LSB_SHIFT = 3U; + const uint8_t RXFE_GAIN_MSB_MASK = 0x07U; + const uint8_t RXFE_GAIN_MSB_SHIFT = 5U; + const uint8_t PHASE_OFFSET_MSB_SHIFT = 8U; + const uint8_t EXT_CTRL_MASK = 0x03U; + /*11th bit for digital gain is the sign bit*/ + const uint8_t DIG_GAIN_SIGN_MASK = 0x04U; + const int16_t DIG_GAIN_SIGN_EXT = (int16_t)0xFC00; + + uint32_t gainIndex = 0U; + uint32_t cpuDmaDataGainIndex = 0U; + int16_t digGain = 0; + uint16_t magnitude = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, gainTablePtr); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cpuDmaDataGainTablePtr); + + /*Parse Gain Table Data in ARM DMA format and store it in gain table row struct*/ + for (gainIndex = 0U; gainIndex < numGainIndicesInTable; ++gainIndex) + { + /*Parse Gain Table Data : + No. of Bytes per Gain Table Entry = 8 + @cpuDmaDataGainIndex[8 x gainIndex] : {13'b0 , rx_fe_gain[7:0], dig_gain[10:0]} + @cpuDmaDataGainIndex[8 x gainIndex + 4]: {14'b0, ext_control[1:0], phase_offset[15:0]} + */ + cpuDmaDataGainIndex = (gainIndex * NUM_BYTES_PER_GAIN_TABLE_ENTRY); + + magnitude = ((uint16_t)cpuDmaDataGainTablePtr[cpuDmaDataGainIndex] | + (((uint16_t)cpuDmaDataGainTablePtr[cpuDmaDataGainIndex + 1] & DIG_GAIN_MSB_MASK) << DIG_GAIN_MSB_SHIFT)); + if ((cpuDmaDataGainTablePtr[cpuDmaDataGainIndex + 1] & DIG_GAIN_SIGN_MASK) == DIG_GAIN_SIGN_MASK) + { + /*Since digGain is a 11bit no. for ARM, 11th bit is the signed bit. However since it is of signed half word type for API use, hence has to be sign extended*/ + digGain = (int16_t)(~(uint16_t)(magnitude - 1U)); + digGain |= DIG_GAIN_SIGN_EXT; + } + else + { + digGain = (int16_t)magnitude; + } + + gainTablePtr[gainIndex].digGain = digGain; + gainTablePtr[gainIndex].rxFeGain = (((uint8_t)cpuDmaDataGainTablePtr[cpuDmaDataGainIndex + 1] & RXFE_GAIN_LSB_MASK) >> RXFE_GAIN_LSB_SHIFT) | + (((uint8_t)cpuDmaDataGainTablePtr[cpuDmaDataGainIndex + 2] & RXFE_GAIN_MSB_MASK) << RXFE_GAIN_MSB_SHIFT); + gainTablePtr[gainIndex].phaseOffset = (uint16_t)cpuDmaDataGainTablePtr[cpuDmaDataGainIndex + 4] | + ((uint16_t)cpuDmaDataGainTablePtr[cpuDmaDataGainIndex + 5] << PHASE_OFFSET_MSB_SHIFT); + gainTablePtr[gainIndex].extControl = (uint8_t)cpuDmaDataGainTablePtr[cpuDmaDataGainIndex + 6] & EXT_CTRL_MASK; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainSetRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxGain_t rxGain[], + const uint32_t arraySize) +{ + static const uint32_t ALL_RX_MASK = (uint32_t)(ADI_ADRV903X_RX0 | ADI_ADRV903X_RX1 | ADI_ADRV903X_RX2 | ADI_ADRV903X_RX3 | ADI_ADRV903X_RX4 | ADI_ADRV903X_RX5 | ADI_ADRV903X_RX6 | ADI_ADRV903X_RX7); + + uint32_t configIndex = 0U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /*Check for null rxGain pointer*/ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxGain); + + /*Check that no. of Rx gain settings is valid*/ + if (arraySize == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + arraySize, + "Parameter arraySize set to 0. Minimum no. of configs should be at least 1"); + return recoveryAction; + } + + /*Range check manual gain index setting for the requested channel*/ + for (configIndex = 0U; configIndex < arraySize; ++configIndex) + { + + /*Check that rxChannelMask is not out of range*/ + if ((rxGain[configIndex].rxChannelMask == 0U) || (rxGain[configIndex].rxChannelMask > ALL_RX_MASK)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxGain[configIndex].rxChannelMask, + "Invalid Rx Channel Mask encountered for manual rx gain index setting"); + return recoveryAction; + } + + /*Check that Rx profile is valid*/ + if ((rxGain[configIndex].rxChannelMask & ALL_RX_MASK) > 0U) + { + if ((device->devStateInfo.profilesValid & ADI_ADRV903X_RX_PROFILE_VALID) == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxGain[configIndex].rxChannelMask, + "Rx gain index set requested for an Rx Channel but Rx profile is invalid in the device structure"); + return recoveryAction; + } + } + + /*Check that rxChannelMask is not out of range*/ + if (rxGain[configIndex].rxChannelMask > (ALL_RX_MASK)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxGain[configIndex].rxChannelMask, + "Invalid Rx Channel Mask encountered for manual rx gain index setting"); + return recoveryAction; + } + + /*Check that gain indices are within range for the channel selected*/ + if ((rxGain[configIndex].rxChannelMask & (uint32_t)ADI_ADRV903X_RX0) == (uint32_t)ADI_ADRV903X_RX0) + { + if ((rxGain[configIndex].gainIndex > device->devStateInfo.gainIndexes.rx0MaxGainIndex) || + (rxGain[configIndex].gainIndex < device->devStateInfo.gainIndexes.rx0MinGainIndex)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxGain[configIndex].gainIndex, + "Rx0 manual gain index setting is out of range"); + return recoveryAction; + } + } + + if ((rxGain[configIndex].rxChannelMask & (uint32_t)ADI_ADRV903X_RX1) == (uint32_t)ADI_ADRV903X_RX1) + { + if ((rxGain[configIndex].gainIndex > device->devStateInfo.gainIndexes.rx1MaxGainIndex) || + (rxGain[configIndex].gainIndex < device->devStateInfo.gainIndexes.rx1MinGainIndex)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxGain[configIndex].gainIndex, + "Rx1 manual gain index setting is out of range"); + return recoveryAction; + } + } + + if ((rxGain[configIndex].rxChannelMask & (uint32_t)ADI_ADRV903X_RX2) == (uint32_t)ADI_ADRV903X_RX2) + { + if ((rxGain[configIndex].gainIndex > device->devStateInfo.gainIndexes.rx2MaxGainIndex) || + (rxGain[configIndex].gainIndex < device->devStateInfo.gainIndexes.rx2MinGainIndex)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxGain[configIndex].gainIndex, + "Rx2 manual gain index setting is out of range"); + return recoveryAction; + } + } + + if ((rxGain[configIndex].rxChannelMask & (uint32_t)ADI_ADRV903X_RX3) == (uint32_t)ADI_ADRV903X_RX3) + { + if ((rxGain[configIndex].gainIndex > device->devStateInfo.gainIndexes.rx3MaxGainIndex) || + (rxGain[configIndex].gainIndex < device->devStateInfo.gainIndexes.rx3MinGainIndex)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxGain[configIndex].gainIndex, + "Rx3 manual gain index setting is out of range"); + return recoveryAction; + } + } + + + /*Check that gain indices are within range for the channel selected*/ + if ((rxGain[configIndex].rxChannelMask & (uint32_t)ADI_ADRV903X_RX4) == (uint32_t)ADI_ADRV903X_RX4) + { + if ((rxGain[configIndex].gainIndex > device->devStateInfo.gainIndexes.rx4MaxGainIndex) || + (rxGain[configIndex].gainIndex < device->devStateInfo.gainIndexes.rx4MinGainIndex)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxGain[configIndex].gainIndex, + "Rx4 manual gain index setting is out of range"); + return recoveryAction; + } + } + + if ((rxGain[configIndex].rxChannelMask & (uint32_t)ADI_ADRV903X_RX5) == (uint32_t)ADI_ADRV903X_RX5) + { + if ((rxGain[configIndex].gainIndex > device->devStateInfo.gainIndexes.rx5MaxGainIndex) || + (rxGain[configIndex].gainIndex < device->devStateInfo.gainIndexes.rx5MinGainIndex)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxGain[configIndex].gainIndex, + "Rx5 manual gain index setting is out of range"); + return recoveryAction; + } + } + + if ((rxGain[configIndex].rxChannelMask & (uint32_t)ADI_ADRV903X_RX6) == (uint32_t)ADI_ADRV903X_RX6) + { + if ((rxGain[configIndex].gainIndex > device->devStateInfo.gainIndexes.rx6MaxGainIndex) || + (rxGain[configIndex].gainIndex < device->devStateInfo.gainIndexes.rx6MinGainIndex)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxGain[configIndex].gainIndex, + "Rx6 manual gain index setting is out of range"); + return recoveryAction; + } + } + + if ((rxGain[configIndex].rxChannelMask & (uint32_t)ADI_ADRV903X_RX7) == (uint32_t)ADI_ADRV903X_RX7) + { + if ((rxGain[configIndex].gainIndex > device->devStateInfo.gainIndexes.rx7MaxGainIndex) || + (rxGain[configIndex].gainIndex < device->devStateInfo.gainIndexes.rx7MinGainIndex)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxGain[configIndex].gainIndex, + "Rx7 manual gain index setting is out of range"); + return recoveryAction; + } + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainGetRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxGain_t* const rxGain) +{ + static const uint32_t ALL_RX_MASK = (uint32_t)(ADI_ADRV903X_RX0 | ADI_ADRV903X_RX1 | ADI_ADRV903X_RX2 | ADI_ADRV903X_RX3 | ADI_ADRV903X_RX4 | ADI_ADRV903X_RX5 | ADI_ADRV903X_RX6 | ADI_ADRV903X_RX7); + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /*Check for null rxGain pointer*/ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxGain); + + /*Check that the requested rxChannel is valid*/ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for rx gain read"); + return recoveryAction; + } + + /*Check that rx profile is valid in current config*/ + if (((uint32_t)rxChannel & ALL_RX_MASK) > 0U) + { + if ((device->devStateInfo.profilesValid & ADI_ADRV903X_RX_PROFILE_VALID) == 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Gain index read requested for an Rx channel but Rx profile is invalid in device structure"); + return recoveryAction; + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adrv903x_BfRxChanAddr_e* const rxChannelBitfieldAddr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check rx bitfield channel address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxChannelBitfieldAddr); + + if ((device->devStateInfo.initializedChannels & (uint32_t)rxChannel) == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + NULL, + "Channel not in device initializedChannels for adrv903x_RxBitfieldAddressGet() function"); + return recoveryAction; + } + + switch (rxChannel) + { + case ADI_ADRV903X_RX0: + *rxChannelBitfieldAddr = ADRV903X_BF_RX_CH0; + break; + + case ADI_ADRV903X_RX1: + *rxChannelBitfieldAddr = ADRV903X_BF_RX_CH1; + break; + + case ADI_ADRV903X_RX2: + *rxChannelBitfieldAddr = ADRV903X_BF_RX_CH2; + break; + + case ADI_ADRV903X_RX3: + *rxChannelBitfieldAddr = ADRV903X_BF_RX_CH3; + break; + + case ADI_ADRV903X_RX4: + *rxChannelBitfieldAddr = ADRV903X_BF_RX_CH4; + break; + + case ADI_ADRV903X_RX5: + *rxChannelBitfieldAddr = ADRV903X_BF_RX_CH5; + break; + + case ADI_ADRV903X_RX6: + *rxChannelBitfieldAddr = ADRV903X_BF_RX_CH6; + break; + + case ADI_ADRV903X_RX7: + *rxChannelBitfieldAddr = ADRV903X_BF_RX_CH7; + break; + + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid rxChannel parameter for adrv903x_RxBitfieldAddressGet() function"); + return recoveryAction; + } + } + + return ADI_ADRV903X_ERR_ACT_NONE; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adrv903x_BfOrxDigChanAddr_e* const orxChannelBitfieldAddr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check rx bitfield channel address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, orxChannelBitfieldAddr); + + if ((device->devStateInfo.initializedChannels & (uint32_t)rxChannel) == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + NULL, + "Channel not in device initializedChannels for adrv903x_OrxBitfieldAddressGet() function"); + return recoveryAction; + } + + switch (rxChannel) + { + case ADI_ADRV903X_ORX0: + *orxChannelBitfieldAddr = ADRV903X_BF_SLICE_ORX_0__ORX_DIG; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + case ADI_ADRV903X_ORX1: + *orxChannelBitfieldAddr = ADRV903X_BF_SLICE_ORX_1__ORX_DIG; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid rxChannel parameter for adrv903x_RxBitfieldAddressGet() function"); + return recoveryAction; + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxAnalogBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adrv903x_BfTdrDpathTopChanAddr_e* const rxAnalogChannelIBitfieldAddr, + adrv903x_BfTdrDpathTopChanAddr_e* const rxAnalogChannelQBitfieldAddr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check rx bitfield I channel address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxAnalogChannelIBitfieldAddr); + + /* Check rx bitfield Q channel address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxAnalogChannelQBitfieldAddr); + + if ((device->devStateInfo.initializedChannels & (uint32_t)rxChannel) == 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + NULL, + "Channel not in device initializedChannels"); + return recoveryAction; + } + + switch (rxChannel) + { + case ADI_ADRV903X_RX0: + *rxAnalogChannelIBitfieldAddr = ADRV903X_BF_SLICE_RX_0__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_; + *rxAnalogChannelQBitfieldAddr = ADRV903X_BF_SLICE_RX_0__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_; + break; + + case ADI_ADRV903X_RX1: + *rxAnalogChannelIBitfieldAddr = ADRV903X_BF_SLICE_RX_1__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_; + *rxAnalogChannelQBitfieldAddr = ADRV903X_BF_SLICE_RX_1__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_; + break; + + case ADI_ADRV903X_RX2: + *rxAnalogChannelIBitfieldAddr = ADRV903X_BF_SLICE_RX_2__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_; + *rxAnalogChannelQBitfieldAddr = ADRV903X_BF_SLICE_RX_2__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_; + break; + case ADI_ADRV903X_RX3: + *rxAnalogChannelIBitfieldAddr = ADRV903X_BF_SLICE_RX_3__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_; + *rxAnalogChannelQBitfieldAddr = ADRV903X_BF_SLICE_RX_3__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_; + break; + + case ADI_ADRV903X_RX4: + *rxAnalogChannelIBitfieldAddr = ADRV903X_BF_SLICE_RX_4__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_; + *rxAnalogChannelQBitfieldAddr = ADRV903X_BF_SLICE_RX_4__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_; + break; + + case ADI_ADRV903X_RX5: + *rxAnalogChannelIBitfieldAddr = ADRV903X_BF_SLICE_RX_5__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_; + *rxAnalogChannelQBitfieldAddr = ADRV903X_BF_SLICE_RX_5__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_; + break; + + case ADI_ADRV903X_RX6: + *rxAnalogChannelIBitfieldAddr = ADRV903X_BF_SLICE_RX_6__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_; + *rxAnalogChannelQBitfieldAddr = ADRV903X_BF_SLICE_RX_6__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_; + break; + + case ADI_ADRV903X_RX7: + *rxAnalogChannelIBitfieldAddr = ADRV903X_BF_SLICE_RX_7__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_; + *rxAnalogChannelQBitfieldAddr = ADRV903X_BF_SLICE_RX_7__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_; + break; + + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannel, + "Invalid rxChannel parameter "); + return recoveryAction; + } + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxFuncsBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adrv903x_BfRxFuncsChanAddr_e* const rxFuncsChannelBitfieldAddr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check rx bitfield channel address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxFuncsChannelBitfieldAddr); + + if ((device->devStateInfo.initializedChannels & (uint32_t)rxChannel) == 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + NULL, + "Channel not in device initializedChannels"); + return recoveryAction; + } + + switch (rxChannel) + { + case ADI_ADRV903X_RX0: + *rxFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + break; + + case ADI_ADRV903X_RX1: + *rxFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_RX_1__RX_FUNCS; + break; + + case ADI_ADRV903X_RX2: + *rxFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_RX_2__RX_FUNCS; + break; + case ADI_ADRV903X_RX3: + *rxFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_RX_3__RX_FUNCS; + break; + + case ADI_ADRV903X_RX4: + *rxFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_RX_4__RX_FUNCS; + break; + + case ADI_ADRV903X_RX5: + *rxFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_RX_5__RX_FUNCS; + break; + + case ADI_ADRV903X_RX6: + *rxFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_RX_6__RX_FUNCS; + break; + + case ADI_ADRV903X_RX7: + *rxFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_RX_7__RX_FUNCS; + break; + + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannel, + "Invalid rxChannel parameter "); + return recoveryAction; + } + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDdcBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const adi_adrv903x_RxDdcs_e ddcBand, + adrv903x_BfRxDdcChanAddr_e* const rxDdcBitfieldAddr) +{ + static const adrv903x_BfRxDdcChanAddr_e mapArr[ADI_ADRV903X_MAX_RX_ONLY][ADI_ADRV903X_MAX_RX_DDC_BANDS] = + { + { ADRV903X_BF_SLICE_RX_0__RX_DDC_0_, ADRV903X_BF_SLICE_RX_0__RX_DDC_1_ }, + { ADRV903X_BF_SLICE_RX_1__RX_DDC_0_, ADRV903X_BF_SLICE_RX_1__RX_DDC_1_ }, + { ADRV903X_BF_SLICE_RX_2__RX_DDC_0_, ADRV903X_BF_SLICE_RX_2__RX_DDC_1_ }, + { ADRV903X_BF_SLICE_RX_3__RX_DDC_0_, ADRV903X_BF_SLICE_RX_3__RX_DDC_1_ }, + { ADRV903X_BF_SLICE_RX_4__RX_DDC_0_, ADRV903X_BF_SLICE_RX_4__RX_DDC_1_ }, + { ADRV903X_BF_SLICE_RX_5__RX_DDC_0_, ADRV903X_BF_SLICE_RX_5__RX_DDC_1_ }, + { ADRV903X_BF_SLICE_RX_6__RX_DDC_0_, ADRV903X_BF_SLICE_RX_6__RX_DDC_1_ }, + { ADRV903X_BF_SLICE_RX_7__RX_DDC_0_, ADRV903X_BF_SLICE_RX_7__RX_DDC_1_ } + }; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t rxIdx = 0U; + uint32_t bandIdx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check rx bitfield channel address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxDdcBitfieldAddr); + + if ((device->devStateInfo.initializedChannels & (uint32_t)rxChannel) == 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + NULL, + "Channel not in device initialized Channels"); + return recoveryAction; + } + + /* Get rx channel idx from enum */ + switch (rxChannel) + { + case ADI_ADRV903X_RX0: + rxIdx = 0U; + break; + case ADI_ADRV903X_RX1: + rxIdx = 1U; + break; + case ADI_ADRV903X_RX2: + rxIdx = 2U; + break; + case ADI_ADRV903X_RX3: + rxIdx = 3U; + break; + case ADI_ADRV903X_RX4: + rxIdx = 4U; + break; + case ADI_ADRV903X_RX5: + rxIdx = 5U; + break; + case ADI_ADRV903X_RX6: + rxIdx = 6U; + break; + case ADI_ADRV903X_RX7: + rxIdx = 7U; + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid rxChannel parameter"); + return recoveryAction; + } + + /* Get ddc band idx from enum */ + switch (ddcBand) + { + case ADI_ADRV903X_RX_DDC_BAND0: + bandIdx = 0U; + break; + case ADI_ADRV903X_RX_DDC_BAND1: + bandIdx = 1U; + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + ddcBand, + "Invalid RX DDC band parameter. Must be Band0 or Band1."); + return recoveryAction; + } + + /* Get base address for this rx channel and ddc band combo */ + *rxDdcBitfieldAddr = mapArr[rxIdx][bandIdx]; + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatSet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxDataFormatRt_t rxDataFormat[], + const uint32_t arraySize) +{ + static const uint8_t GAIN_COMP_EXT_LNA_DISABLE = 0U; + static const uint8_t GAIN_COMP_TEMP_DISABLE = 0U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t intDataResolution = 0U; + uint8_t intDataFormat = 0U; + uint32_t tmpMask = 0U; + uint32_t configIdx = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxDataFormat); + + /* Range Check inputs */ +#if ADI_ADRV903X_RX_RANGE_CHECK > 0 + recoveryAction = adrv903x_RxDataFormatSetRangeCheck(device, rxDataFormat, arraySize); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxDataFormat range check failure."); + return recoveryAction; + } +#endif + + /* Iterate over arraySize elements of rxDataFormat */ + for ( configIdx = 0U; configIdx < arraySize; configIdx++ ) + { + + switch (rxDataFormat[configIdx].rxDataFormat.formatSelect) + { + + /*If Floating Point mode selected, Configure floating point*/ + case ADI_ADRV903X_GAIN_WITH_FLOATING_POINT: + recoveryAction = adrv903x_RxDataFormatFloatingPointSet( device, + rxDataFormat[configIdx].rxChannelMask, + &rxDataFormat[configIdx].rxDataFormat.floatingPointConfig); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting RxDataFormat floatingPointConfig"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxGainCompExtLnaSet(device, + rxDataFormat[configIdx].rxChannelMask, + rxDataFormat[configIdx].rxDataFormat.externalLnaGain); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting RxGainCompExtLna"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxGainCompTempEnableSet(device, + rxDataFormat[configIdx].rxChannelMask, + rxDataFormat[configIdx].rxDataFormat.tempCompensationEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting RxGainCompTempEnable"); + return recoveryAction; + } + break; + + /* Integer and slicer config settings */ + case ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO: + case ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2PIN_MODE: + case ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_3PIN_MODE: + case ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE: + recoveryAction = adrv903x_RxDataFormatIntegerSet(device, + rxDataFormat[configIdx].rxChannelMask, + rxDataFormat[configIdx].rxDataFormat.formatSelect, + &rxDataFormat[configIdx].rxDataFormat.integerConfigSettings, + &rxDataFormat[configIdx].rxDataFormat.slicerConfigSettings); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting RxDataFormat integerConfigSettings and slicerConfigSettings"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxGainCompExtLnaSet(device, + rxDataFormat[configIdx].rxChannelMask, + rxDataFormat[configIdx].rxDataFormat.externalLnaGain); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting RxGainCompExtLna"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxGainCompTempEnableSet(device, + rxDataFormat[configIdx].rxChannelMask, + rxDataFormat[configIdx].rxDataFormat.tempCompensationEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting RxGainCompTempEnable"); + return recoveryAction; + } + break; + + /* Embedded overload indicator settings */ + case ADI_ADRV903X_EMBED_OVERLOAD_MONITOR_DATA: + recoveryAction = adrv903x_RxDataFormatEmbOvldMonitorSet(device, + rxDataFormat[configIdx].rxChannelMask, + &rxDataFormat[configIdx].rxDataFormat.embOvldMonitorSettings); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting RxDataFormat embOvldMonitorSettings"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxGainCompExtLnaSet(device, + rxDataFormat[configIdx].rxChannelMask, + rxDataFormat[configIdx].rxDataFormat.externalLnaGain); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting RxGainCompExtLna"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxGainCompTempEnableSet(device, + rxDataFormat[configIdx].rxChannelMask, + rxDataFormat[configIdx].rxDataFormat.tempCompensationEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting RxGainCompTempEnable"); + return recoveryAction; + } + break; + + /* If gain compensation disable is requested set integer formatter regs to default */ + case ADI_ADRV903X_GAIN_COMPENSATION_DISABLED: + /* Resolve Sample Resolution and format */ + recoveryAction = adrv903x_RxIntSampleResFormatResolve(device, + &rxDataFormat[configIdx].rxDataFormat.integerConfigSettings, + &intDataResolution, + &intDataFormat); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error resolving RxIntSampleResFormat"); + return recoveryAction; + } + + /* Disable gain compensation and reset the formatter settings to default */ + recoveryAction = adrv903x_RxDataFormatGainCompDisable(device, + rxDataFormat[configIdx].rxChannelMask, + intDataFormat, + intDataResolution); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error disabling RxDataFormatGainComp"); + return recoveryAction; + } + + /* Disable Gain Comp by tmp and ext lna, but only applicable for Rx Channels */ + tmpMask = rxDataFormat[configIdx].rxChannelMask & ADI_ADRV903X_RX_MASK_ALL; + recoveryAction = adrv903x_RxGainCompTempEnableSet(device, + tmpMask, + GAIN_COMP_TEMP_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting RxGainCompTempEnable"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxGainCompExtLnaSet(device, + tmpMask, + GAIN_COMP_EXT_LNA_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting RxGainCompExtLna"); + return recoveryAction; + } + break; + + /* If External Slicer mode is selected, throw an error */ + /* Other modes, throw an error */ + case ADI_ADRV903X_GAIN_WITH_EXTERNAL_SLICER: + default: + ADI_ADRV903X_API_NOT_IMPLEMENTED_REPORT_RETURN(&device->common); + break; + } + + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatSetRangeCheck(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxDataFormatRt_t rxDataFormat[], + const uint32_t arraySize) +{ + static const uint32_t ALL_RX_MASK = (uint32_t)(ADI_ADRV903X_RX0 | ADI_ADRV903X_RX1 | ADI_ADRV903X_RX2 | ADI_ADRV903X_RX3 | + ADI_ADRV903X_RX4 | ADI_ADRV903X_RX5 | ADI_ADRV903X_RX6 | ADI_ADRV903X_RX7); + static const uint32_t ALL_ORX_MASK = (uint32_t)(ADI_ADRV903X_ORX0 | ADI_ADRV903X_ORX1); + static const uint32_t MINIMUM_NUM_FORMATTERS = 1U; + static const uint32_t MAXIMUM_NUM_FORMATTERS = 10U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t configIdx = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxDataFormat); + + /* Verify that arraySize is > 1 and <= the maximum number of unique formatters. */ + /* If not, throw an error indicating whether the minimum or maximum was exceeded. */ + if (arraySize < MINIMUM_NUM_FORMATTERS) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, arraySize, "Invalid number of Rx formatters. Less than minimum allowed"); + return recoveryAction; + } + if (arraySize > MAXIMUM_NUM_FORMATTERS) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, arraySize, "Invalid number of Rx formatters. Exceeded than maximum allowed"); + return recoveryAction; + } + + /* Iterate over arraySize elements of rxDataFormat */ + for ( configIdx = 0U; configIdx < arraySize; configIdx++ ) + { + /* Verify that the rxChannelMask field is not empty. */ + if (rxDataFormat[configIdx].rxChannelMask == ADI_ADRV903X_RXOFF) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + device->devStateInfo.profilesValid, + "Empty Rx channel mask selected for Rx data format configuration"); + return recoveryAction; + } + + /* If any RX channels are selected, verify that the RX profile is marked valid in the device profilesValid field. */ + if (((rxDataFormat[configIdx].rxChannelMask & ALL_RX_MASK) > 0U) && + ((device->devStateInfo.profilesValid & ADI_ADRV903X_RX_PROFILE_VALID) != ADI_ADRV903X_RX_PROFILE_VALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + device->devStateInfo.profilesValid, + "Rx channel selected for Rx data format configuration but Rx profile is invalid"); + return recoveryAction; + } + + /* If any ORX channels are selected: */ + if ( (rxDataFormat[configIdx].rxChannelMask & ALL_ORX_MASK) > 0U ) + { + /* Verify that the ORX profile is marked valid in the device profilesValid field. */ + if ( (device->devStateInfo.profilesValid & ADI_ADRV903X_ORX_PROFILE_VALID) != ADI_ADRV903X_ORX_PROFILE_VALID ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + device->devStateInfo.profilesValid, + "ORx channel selected for Rx data format configuration but ORx profile is invalid"); + + return recoveryAction; + } + + /* Verify that the ORX profile has formatSelect = ADI_ADRV903X_GAIN_COMPENSATION_DISABLED. */ + if (rxDataFormat[configIdx].rxDataFormat.formatSelect != ADI_ADRV903X_GAIN_COMPENSATION_DISABLED) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxDataFormat[configIdx].rxDataFormat.formatSelect, + "Invalid format selected for ORx data format configuration. ORx only supports ADI_ADRV903X_GAIN_COMPENSATION_DISABLED"); + return recoveryAction; + } + } + + /* Verify that format selected is valid */ + if ((rxDataFormat[configIdx].rxDataFormat.formatSelect != ADI_ADRV903X_GAIN_COMPENSATION_DISABLED) && + (rxDataFormat[configIdx].rxDataFormat.formatSelect != ADI_ADRV903X_GAIN_WITH_FLOATING_POINT) && + (rxDataFormat[configIdx].rxDataFormat.formatSelect != ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO) && + (rxDataFormat[configIdx].rxDataFormat.formatSelect != ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2PIN_MODE) && + (rxDataFormat[configIdx].rxDataFormat.formatSelect != ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_3PIN_MODE) && + (rxDataFormat[configIdx].rxDataFormat.formatSelect != ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE) && + (rxDataFormat[configIdx].rxDataFormat.formatSelect != ADI_ADRV903X_GAIN_WITH_EXTERNAL_SLICER) && + (rxDataFormat[configIdx].rxDataFormat.formatSelect != ADI_ADRV903X_EMBED_OVERLOAD_MONITOR_DATA)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxDataFormat[configIdx].rxDataFormat.formatSelect, + "Invalid Rx Data Format selected"); + return recoveryAction; + } + + /* If selected format is ADI_ADRV903X_GAIN_COMPENSATION_DISABLED, verify that the selected integer mode is valid */ + if (rxDataFormat[configIdx].rxDataFormat.formatSelect == ADI_ADRV903X_GAIN_COMPENSATION_DISABLED) + { + if ((rxDataFormat[configIdx].rxDataFormat.integerConfigSettings.intSampleResolution != ADI_ADRV903X_INTEGER_12BIT_2SCOMP) && + (rxDataFormat[configIdx].rxDataFormat.integerConfigSettings.intSampleResolution != ADI_ADRV903X_INTEGER_12BIT_SIGNED) && + (rxDataFormat[configIdx].rxDataFormat.integerConfigSettings.intSampleResolution != ADI_ADRV903X_INTEGER_16BIT_2SCOMP) && + (rxDataFormat[configIdx].rxDataFormat.integerConfigSettings.intSampleResolution != ADI_ADRV903X_INTEGER_16BIT_SIGNED)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxDataFormat[configIdx].rxDataFormat.integerConfigSettings.intSampleResolution, + "Incorrect Integer format and resolution selected while attempting to disable gain compensation"); + return recoveryAction; + } + } + + /* If selected format is ADI_ADRV903X_GAIN_WITH_FLOATING_POINT, range check floating point configuration */ + else if (rxDataFormat[configIdx].rxDataFormat.formatSelect == ADI_ADRV903X_GAIN_WITH_FLOATING_POINT) + { + recoveryAction = adrv903x_RxDataFormatSetFloatingPointRangeCheck( device, + &rxDataFormat[configIdx].rxDataFormat.floatingPointConfig); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error in floating point mode range check"); + return recoveryAction; + + } + } + + /* If selected format is one of the internal slicer modes, range check integer mode configuration */ + else if ((rxDataFormat[configIdx].rxDataFormat.formatSelect == ADI_ADRV903X_GAIN_WITH_EXTERNAL_SLICER) || + (rxDataFormat[configIdx].rxDataFormat.formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2PIN_MODE) || + (rxDataFormat[configIdx].rxDataFormat.formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_3PIN_MODE) || + (rxDataFormat[configIdx].rxDataFormat.formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE) || + (rxDataFormat[configIdx].rxDataFormat.formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO)) + { + recoveryAction = adrv903x_RxDataFormatSetIntegerRangeCheck( device, + rxDataFormat[configIdx].rxChannelMask, + rxDataFormat[configIdx].rxDataFormat.formatSelect, + &rxDataFormat[configIdx].rxDataFormat.integerConfigSettings, + &rxDataFormat[configIdx].rxDataFormat.slicerConfigSettings); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error in integer mode range check"); + return recoveryAction; + + } + } + + /* If selected format is the embedded overload monitor, range check overload monitor format settings */ + else if (rxDataFormat[configIdx].rxDataFormat.formatSelect == ADI_ADRV903X_EMBED_OVERLOAD_MONITOR_DATA) + { + recoveryAction = adrv903x_RxDataFormatSetEmbOvldMonitorRangeCheck( device, + &rxDataFormat[configIdx].rxDataFormat.embOvldMonitorSettings, + rxDataFormat[configIdx].rxDataFormat.integerConfigSettings.intSampleResolution); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error in embedded overload monitor range check"); + return recoveryAction; + + } + } + } /* end of configIdx for loop */ + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatSetFloatingPointRangeCheck(adi_adrv903x_Device_t * const device, + const adi_adrv903x_FloatingPointConfigSettings_t * const floatingPointConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, floatingPointConfig); + + /* Check floating point format selected is valid */ + if ((floatingPointConfig->fpDataFormat != ADI_ADRV903X_FP_FORMAT_SIGN_SIGNIFICAND_EXP) && + (floatingPointConfig->fpDataFormat != ADI_ADRV903X_FP_FORMAT_SIGN_EXP_SIGNIFICAND)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + floatingPointConfig->fpDataFormat, + "Invalid floating point data format selected"); + return recoveryAction; + } + + /* Check floating point round mode is valid */ + if ((floatingPointConfig->fpRoundMode != ADI_ADRV903X_ROUND_TO_EVEN) && + (floatingPointConfig->fpRoundMode != ADI_ADRV903X_ROUNDTOWARDS_POSITIVE) && + (floatingPointConfig->fpRoundMode != ADI_ADRV903X_ROUNDTOWARDS_NEGATIVE) && + (floatingPointConfig->fpRoundMode != ADI_ADRV903X_ROUNDTOWARDS_ZERO) && + (floatingPointConfig->fpRoundMode != ADI_ADRV903X_ROUND_FROM_EVEN)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + floatingPointConfig->fpRoundMode, + "Invalid floating point round mode selected"); + return recoveryAction; + } + + /* Check floating point no. of exponent bits is valid */ + if ((floatingPointConfig->fpNumExpBits != ADI_ADRV903X_2_EXPONENTBITS) && + (floatingPointConfig->fpNumExpBits != ADI_ADRV903X_3_EXPONENTBITS) && + (floatingPointConfig->fpNumExpBits != ADI_ADRV903X_4_EXPONENTBITS) && + (floatingPointConfig->fpNumExpBits != ADI_ADRV903X_5_EXPONENTBITS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + floatingPointConfig->fpNumExpBits, + "Invalid number of floating point exponent bits selected"); + return recoveryAction; + } + + /* Check floating point attenuation steps are valid */ + if ((floatingPointConfig->fpAttenSteps != ADI_ADRV903X_FPATTEN_24DB) && + (floatingPointConfig->fpAttenSteps != ADI_ADRV903X_FPATTEN_18DB) && + (floatingPointConfig->fpAttenSteps != ADI_ADRV903X_FPATTEN_12DB) && + (floatingPointConfig->fpAttenSteps != ADI_ADRV903X_FPATTEN_6DB) && + (floatingPointConfig->fpAttenSteps != ADI_ADRV903X_FPATTEN_0DB) && + (floatingPointConfig->fpAttenSteps != ADI_ADRV903X_FPATTEN_MINUS6DB) && + (floatingPointConfig->fpAttenSteps != ADI_ADRV903X_FPATTEN_MINUS12DB) && + (floatingPointConfig->fpAttenSteps != ADI_ADRV903X_FPATTEN_MINUS18DB)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + floatingPointConfig->fpAttenSteps, + "Invalid floating point attenuation step selected"); + return recoveryAction; + } + + /* Check floating point encoded NaN selection is valid */ + if ((floatingPointConfig->fpEncodeNan != ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_DISABLE) && + (floatingPointConfig->fpEncodeNan != ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_ENABLE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + floatingPointConfig->fpEncodeNan, + "Invalid floating point encode NaN selection"); + return recoveryAction; + } + + /*Check floating point encoded NaN selection is valid*/ + if ((floatingPointConfig->fpHideLeadingOne != ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_DISABLE) && + (floatingPointConfig->fpHideLeadingOne != ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_ENABLE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + floatingPointConfig->fpHideLeadingOne, + "Invalid floating point hide leading one selection"); + return recoveryAction; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatSetIntegerRangeCheck(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const adi_adrv903x_RxDataFormatModes_e formatSelect, + const adi_adrv903x_IntegerConfigSettings_t * const integerConfigSettings, + const adi_adrv903x_SlicerConfigSettings_t * const slicerConfigSettings) +{ + /* + static const uint32_t ALL_RX_MASK = (uint32_t)(ADI_ADRV903X_RX0 | ADI_ADRV903X_RX1 | ADI_ADRV903X_RX2 | ADI_ADRV903X_RX3 | + ADI_ADRV903X_RX4 | ADI_ADRV903X_RX5 | ADI_ADRV903X_RX6 | ADI_ADRV903X_RX7); + */ + static const uint32_t ALL_ORX_MASK = (uint32_t)(ADI_ADRV903X_ORX0 | ADI_ADRV903X_ORX1); + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t slicerBit = 0U; + uint8_t numRxChannels = 0U; + uint8_t i = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, integerConfigSettings); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, slicerConfigSettings); + + /* If the selected format is one of the internal slicer modes: + a. Verify integer mode configuration against the constraints in Table 5.2.4 2, otherwise throw an error. + Note: Only ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO mode is valid if any ORx channels are selected. + b. If the selected format is ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2-3 or 4PIN_MODE, + verify that the specified GPIO mode for each RX channel is not configured for use by another feature. Otherwise throw an error. + */ + /* If the selected format is one of the internal slicer modes: */ + if( (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2PIN_MODE) || + (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_3PIN_MODE) || + (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE) || + (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO)) + { + /* Verify integer mode configuration against constraints */ + /* Note: Only ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO mode is valid if any ORx channels are selected. */ + /* Check that selected integer formatter internal slicer embedded bits mode is valid */ + if ((integerConfigSettings->intEmbeddedBits != ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS) && + (integerConfigSettings->intEmbeddedBits != ADI_ADRV903X_EMBED_1_SLICERBIT_AT_MSB) && + (integerConfigSettings->intEmbeddedBits != ADI_ADRV903X_EMBED_1_SLICERBIT_AT_LSB) && + (integerConfigSettings->intEmbeddedBits != ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_3_BIT_SLICER) && + (integerConfigSettings->intEmbeddedBits != ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_3_BIT_SLICER) && + (integerConfigSettings->intEmbeddedBits != ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_4_BIT_SLICER) && + (integerConfigSettings->intEmbeddedBits != ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_4_BIT_SLICER)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + integerConfigSettings->intEmbeddedBits, + "Invalid integer formatter internal slicer embedded bits selected"); + return recoveryAction; + } + + /* Check that integer format resolution is valid */ + if ((integerConfigSettings->intSampleResolution != ADI_ADRV903X_INTEGER_12BIT_2SCOMP) && + (integerConfigSettings->intSampleResolution != ADI_ADRV903X_INTEGER_12BIT_SIGNED) && + (integerConfigSettings->intSampleResolution != ADI_ADRV903X_INTEGER_16BIT_2SCOMP) && + (integerConfigSettings->intSampleResolution != ADI_ADRV903X_INTEGER_16BIT_SIGNED)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + integerConfigSettings->intSampleResolution, + "Invalid integer formatter sample resolution selected"); + return recoveryAction; + } + + /* Embedding 1 bit slicer at MSB only supports 12 bit/16 bit signed integer sample resolution */ + if ((integerConfigSettings->intEmbeddedBits == ADI_ADRV903X_EMBED_1_SLICERBIT_AT_MSB) && + (integerConfigSettings->intSampleResolution != ADI_ADRV903X_INTEGER_12BIT_SIGNED) && + (integerConfigSettings->intSampleResolution != ADI_ADRV903X_INTEGER_16BIT_SIGNED)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + integerConfigSettings->intSampleResolution, + "Invalid integer formatter sample resolution. Valid sample resolution is 12-bit signed for embedding 1 slicer bit at MSB"); + return recoveryAction; + } + + /* Embedding 2 bit slicer at MSB for a 3-bit slicer mode only supports Signed representation in 16 bit resolution*/ + if ((integerConfigSettings->intEmbeddedBits == ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_3_BIT_SLICER) && + (integerConfigSettings->intSampleResolution != ADI_ADRV903X_INTEGER_16BIT_SIGNED)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + integerConfigSettings->intSampleResolution, + "Invalid integer formatter sample resolution. Valid sample resolution is 16 signed for embedding 2 slicer bits at MSB for a 3-bit slicer mode"); + return recoveryAction; + } + + /* Embedding 2 bit slicer at MSB for a 4-bit slicer mode only supports Signed representation in 16 bit resolution */ + if ((integerConfigSettings->intEmbeddedBits == ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_4_BIT_SLICER) && + (integerConfigSettings->intSampleResolution != ADI_ADRV903X_INTEGER_16BIT_SIGNED)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + integerConfigSettings->intSampleResolution, + "Invalid integer formatter sample resolution. Valid sample resolution is 16 signed for embedding 2 slicer bits at MSB for a 4-bit slicer mode"); + return recoveryAction; + } + + /* Embedding 2 bit slicer at LSB for a 3-bit slicer mode only supports 16 bit resolution, either signed or twos comp representation */ + if ((integerConfigSettings->intEmbeddedBits == ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_3_BIT_SLICER) && + (integerConfigSettings->intSampleResolution != ADI_ADRV903X_INTEGER_16BIT_SIGNED) && + (integerConfigSettings->intSampleResolution != ADI_ADRV903X_INTEGER_16BIT_2SCOMP)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + integerConfigSettings->intSampleResolution, + "Invalid integer formatter sample resolution. Valid sample resolution is 16 signed or twos comp for embedding 2 slicer bits at LSB for a 3-bit slicer mode"); + return recoveryAction; + } + + /* Embedding 2 bit slicer at LSB for a 4-bit slicer mode only supports 16 bit resolution, either signed or twos comp representation */ + if ((integerConfigSettings->intEmbeddedBits == ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_4_BIT_SLICER) && + (integerConfigSettings->intSampleResolution != ADI_ADRV903X_INTEGER_16BIT_SIGNED) && + (integerConfigSettings->intSampleResolution != ADI_ADRV903X_INTEGER_16BIT_2SCOMP)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + integerConfigSettings->intSampleResolution, + "Invalid integer formatter sample resolution. Valid sample resolution is 16 signed or twos comp for embedding 2 slicer bits at LSB for a 4-bit slicer mode"); + return recoveryAction; + } + + /* Check that integer format parity is valid */ + if ((integerConfigSettings->intParity != ADI_ADRV903X_3BIT_SLICER_EVEN_PARITY) && + (integerConfigSettings->intParity != ADI_ADRV903X_3BIT_SLICER_ODD_PARITY) && + (integerConfigSettings->intParity != ADI_ADRV903X_NO_PARITY)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + integerConfigSettings->intParity, + "Invalid integer formatter parity option selected"); + return recoveryAction; + } + + /* Check that the use case is valid for embedding parity bit */ + if ((integerConfigSettings->intParity == ADI_ADRV903X_3BIT_SLICER_EVEN_PARITY) || + (integerConfigSettings->intParity == ADI_ADRV903X_3BIT_SLICER_ODD_PARITY)) + { + /* Parity is valid only in 3 bit internal embedded slicer mode */ + if (formatSelect != ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + formatSelect, + "Invalid integer formatter mode selected for parity support. Parity is supported only in 3 bit internal slicer modes"); + return recoveryAction; + } + + /* Parity is valid only in 3 bit slicer mode */ + if ((integerConfigSettings->intEmbeddedBits != ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_3_BIT_SLICER) && + (integerConfigSettings->intEmbeddedBits != ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_3_BIT_SLICER)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + formatSelect, + "Invalid integer formatter mode selected for parity support. Parity is supported only in 3 bit internal slicer modes"); + return recoveryAction; + } + + /* Parity is valid only in 3 bit embedded slicer mode. 12 bit resolution does not support 3 bit parity */ + if ((integerConfigSettings->intSampleResolution == ADI_ADRV903X_INTEGER_12BIT_2SCOMP) || + (integerConfigSettings->intSampleResolution == ADI_ADRV903X_INTEGER_12BIT_SIGNED)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + integerConfigSettings->intSampleResolution, + "Invalid integer formatter sampling resolution mode for parity config. Parity is supported only for 16 resolution"); + return recoveryAction; + } + } + + /* Check that integer slicer embedded position is valid */ + if (integerConfigSettings->intEmbeddedPos != ADI_ADRV903X_LOWER_NIBBLE_ON_Q && + integerConfigSettings->intEmbeddedPos != ADI_ADRV903X_LOWER_NIBBLE_ON_I) + { + + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + slicerConfigSettings->intSlicerStepSize, + "Invalid internal slicer embedded position selected"); + return recoveryAction; + } + + /* Check that integer format step size is valid */ + if ((slicerConfigSettings->intSlicerStepSize != ADI_ADRV903X_INTSLICER_STEPSIZE_1DB) && + (slicerConfigSettings->intSlicerStepSize != ADI_ADRV903X_INTSLICER_STEPSIZE_2DB) && + (slicerConfigSettings->intSlicerStepSize != ADI_ADRV903X_INTSLICER_STEPSIZE_3DB) && + (slicerConfigSettings->intSlicerStepSize != ADI_ADRV903X_INTSLICER_STEPSIZE_4DB) && + (slicerConfigSettings->intSlicerStepSize != ADI_ADRV903X_INTSLICER_STEPSIZE_6DB) && + (slicerConfigSettings->intSlicerStepSize != ADI_ADRV903X_INTSLICER_STEPSIZE_8DB)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + slicerConfigSettings->intSlicerStepSize, + "Invalid internal slicer step size selected for integer format internal slicer mode"); + return recoveryAction; + } + + /*Check the source ctrl on Rx Slicer Posn observation GPIOs for 4 Pin mode */ + if (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE) + { + if ((rxChannelMask & ALL_ORX_MASK) > 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannelMask, + "ORx channel is only supported for ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO mode"); + return recoveryAction; + } + + /* Confirm Rx channel mask is only trying to set GPIOs for a single Rx channel */ + numRxChannels = 0U; + for (i = 0U; i < 8U; i++) + { + numRxChannels += ((rxChannelMask >> i) & 0x01); + } + + if (numRxChannels != 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + numRxChannels, + "Only 1 Rx data formatter channel can be configured at a time when formatSelect = ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE"); + return recoveryAction; + } + + /* If any Rx channels in channel mask */ + for (slicerBit = 0U; slicerBit < 4U; slicerBit++) + { + if (slicerConfigSettings->intSlicerGpioSelect[slicerBit] >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + slicerConfigSettings->intSlicerGpioSelect[slicerBit], + "GPIO must be valid for Internal Slicer output bits[3:0] when formatSelect = ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE"); + return recoveryAction; + } + } + } + + /*Check the source ctrl on Rx Slicer Posn observation GPIOs for 3 Pin mode*/ + if (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_3PIN_MODE) + { + /* Confirm Rx channel mask is only trying to set GPIOs for a single Rx channel */ + numRxChannels = 0U; + for (i = 0U; i < 8U; i++) + { + numRxChannels += ((rxChannelMask >> i) & 0x01); + } + + if (numRxChannels != 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + numRxChannels, + "Only 1 Rx data formatter channel can be configured at a time when formatSelect = ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_3PIN_MODE"); + return recoveryAction; + } + + for (slicerBit = 0U; slicerBit < 3U; slicerBit++) + { + if (slicerConfigSettings->intSlicerGpioSelect[slicerBit] >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + slicerConfigSettings->intSlicerGpioSelect[slicerBit], + "GPIO must be valid for Internal Slicer output bits[2:0] when formatSelect = ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_3PIN_MODE"); + return recoveryAction; + } + } + + } + + /*Check the source ctrl on Rx Slicer Posn observation GPIOs for 2 Pin mode*/ + if (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2PIN_MODE) + { + /* Confirm Rx channel mask is only trying to set GPIOs for a single Rx channel */ + numRxChannels = 0U; + for (i = 0U; i < 8U; i++) + { + numRxChannels += ((rxChannelMask >> i) & 0x01); + } + + if (numRxChannels != 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + numRxChannels, + "Only 1 Rx data formatter channel can be configured at a time when formatSelect = ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2PIN_MODE"); + return recoveryAction; + } + + for (slicerBit = 0U; slicerBit < 2U; slicerBit++) + { + if (slicerConfigSettings->intSlicerGpioSelect[slicerBit] >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + slicerConfigSettings->intSlicerGpioSelect[slicerBit], + "GPIO must be valid for Internal Slicer output bits[1:0] when formatSelect = ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2PIN_MODE"); + return recoveryAction; + } + } + + } + + } + + /* If the selected format is ADI_ADRV903X_GAIN_WITH_EXTERNAL_SLICER: */ + /* Throw an error indicating that the mode is not supported */ + else if (formatSelect == ADI_ADRV903X_GAIN_WITH_EXTERNAL_SLICER) + { + ADI_ADRV903X_API_NOT_IMPLEMENTED_REPORT_RETURN(&device->common); + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatSetEmbOvldMonitorRangeCheck(adi_adrv903x_Device_t * const device, + const adi_adrv903x_EmbOverloadMonitorConfigSettings_t * const embOvldConfigSettings, + const adi_adrv903x_RxIntSampleResolution_e intSampleResolution) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, embOvldConfigSettings); + + /* The embedded overload monitor is only supported in 16bit / twos-complement format */ + if (intSampleResolution != ADI_ADRV903X_INTEGER_16BIT_2SCOMP) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + intSampleResolution, + "Embedded overload monitoring Rx data format is only supported with integer 16Bit - 2s Complement format"); + return recoveryAction; + } + + /* Verify that embeddedMonitorSrcLsbI field is a valid enum */ + if ((embOvldConfigSettings->embeddedMonitorSrcLsbI != ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED) && + (embOvldConfigSettings->embeddedMonitorSrcLsbI != ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH) && + (embOvldConfigSettings->embeddedMonitorSrcLsbI != ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH) && + (embOvldConfigSettings->embeddedMonitorSrcLsbI != ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH) && + (embOvldConfigSettings->embeddedMonitorSrcLsbI != ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + embOvldConfigSettings->embeddedMonitorSrcLsbI, + "Invalid embedded monitor source selected to be embedded at LSB posn - I sample"); + return recoveryAction; + } + + /* Verify that embeddedMonitorSrcLsbPlusOneI field is a valid enum */ + if ((embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI != ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED) && + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI != ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH) && + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI != ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH) && + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI != ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH) && + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI != ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI, + "Invalid embedded monitor source selected to be embedded at LSB + 1 posn - I sample"); + return recoveryAction; + } + + /* Verify that embeddedMonitorSrcLsbQ field is a valid enum */ + if ((embOvldConfigSettings->embeddedMonitorSrcLsbQ != ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED) && + (embOvldConfigSettings->embeddedMonitorSrcLsbQ != ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH) && + (embOvldConfigSettings->embeddedMonitorSrcLsbQ != ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH) && + (embOvldConfigSettings->embeddedMonitorSrcLsbQ != ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH) && + (embOvldConfigSettings->embeddedMonitorSrcLsbQ != ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + embOvldConfigSettings->embeddedMonitorSrcLsbQ, + "Invalid embedded monitor source selected to be embedded at LSB posn - Q sample"); + return recoveryAction; + } + + /* Verify that embeddedMonitorSrcLsbPlusOneQ field is a valid enum */ + if ((embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ != ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED) && + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ != ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH) && + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ != ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH) && + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ != ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH) && + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ != ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ, + "Invalid embedded monitor source selected to be embedded at LSB + 1 posn - Q sample"); + return recoveryAction; + } + + /* If any embedded monitor bit is set to ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH, verify embeddedMonitorApdHighSrcSel field */ + if ((embOvldConfigSettings->embeddedMonitorSrcLsbI == ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbQ == ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI == ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ == ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH)) + { + if ((embOvldConfigSettings->embeddedMonitorApdHighSrcSel != ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_EXCEEDED) && + (embOvldConfigSettings->embeddedMonitorApdHighSrcSel != ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_CNTR_EXCEEDED)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + embOvldConfigSettings->embeddedMonitorApdHighSrcSel, + "Analog Peak Detector high thresh selected for embedded monitoring but APD high source is invalid"); + return recoveryAction; + } + } + + /* If any embedded monitor bit is set to ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH, verify embeddedMonitorApdLowSrcSel field */ + if ((embOvldConfigSettings->embeddedMonitorSrcLsbI == ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbQ == ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI == ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ == ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH)) + { + if ((embOvldConfigSettings->embeddedMonitorApdLowSrcSel != ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_EXCEEDED) && + (embOvldConfigSettings->embeddedMonitorApdLowSrcSel != ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_CNTR_EXCEEDED)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + embOvldConfigSettings->embeddedMonitorApdLowSrcSel, + "Analog Peak Detector low thresh selected for embedded monitoring but APD low source is invalid"); + return recoveryAction; + } + } + + /* If any embedded monitor bit is set to ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH, verify embeddedMonitorHb2HighSrcSel field */ + if ((embOvldConfigSettings->embeddedMonitorSrcLsbI == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbQ == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH)) + { + if ((embOvldConfigSettings->embeddedMonitorHb2HighSrcSel != ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH) && + (embOvldConfigSettings->embeddedMonitorHb2HighSrcSel != ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH_CNTR_EXCEEDED)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + embOvldConfigSettings->embeddedMonitorHb2HighSrcSel, + "Digital HB2 Peak Detector high thresh selected for embedded monitoring but HB2 high source is invalid"); + return recoveryAction; + } + } + + /* If any embedded monitor bit is set to ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH, verify embeddedMonitorHb2LowSrcSel field */ + if ((embOvldConfigSettings->embeddedMonitorSrcLsbI == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbQ == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH)) + { + if ((embOvldConfigSettings->embeddedMonitorHb2LowSrcSel != ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW) && + (embOvldConfigSettings->embeddedMonitorHb2LowSrcSel != ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW_INT0) && + (embOvldConfigSettings->embeddedMonitorHb2LowSrcSel != ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW_INT1) && + (embOvldConfigSettings->embeddedMonitorHb2LowSrcSel != ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW_THRESH_CNTR_EXCEEDED) && + (embOvldConfigSettings->embeddedMonitorHb2LowSrcSel != ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW_INT0_THRESH_CNTR_EXCEEDED) && + (embOvldConfigSettings->embeddedMonitorHb2LowSrcSel != ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW_INT1_THRESH_CNTR_EXCEEDED)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + embOvldConfigSettings->embeddedMonitorHb2LowSrcSel, + "Digital HB2 Peak Detector low thresh selected for embedded monitoring but HB2 low source is invalid"); + return recoveryAction; + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatGainCompDisable(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const uint8_t intDataFormat, + const uint8_t intDataResolution) +{ + static const adi_adrv903x_RxChannels_e RX_CHANNEL_ARR[] = { ADI_ADRV903X_RX0, ADI_ADRV903X_RX1, ADI_ADRV903X_RX2, ADI_ADRV903X_RX3, + ADI_ADRV903X_RX4, ADI_ADRV903X_RX5, ADI_ADRV903X_RX6, ADI_ADRV903X_RX7 }; + static const uint32_t RX_CHANNEL_ARR_SIZE = sizeof(RX_CHANNEL_ARR) / sizeof(RX_CHANNEL_ARR[0U]); + static const adi_adrv903x_RxDdcs_e RX_DDC_BAND_ARR[] = { ADI_ADRV903X_RX_DDC_BAND0, ADI_ADRV903X_RX_DDC_BAND1 }; + static const uint32_t RX_DDC_BAND_ARR_SIZE = sizeof(RX_DDC_BAND_ARR) / sizeof(RX_DDC_BAND_ARR[0U]); + static const adi_adrv903x_RxChannels_e ORX_CHANNEL_ARR[] = { ADI_ADRV903X_ORX0, ADI_ADRV903X_ORX1 }; + static const uint32_t ORX_CHANNEL_ARR_SIZE = sizeof(ORX_CHANNEL_ARR) / sizeof(ORX_CHANNEL_ARR[0U]); + static const uint8_t DEFAULT_INT_EMBED_SLICER = 0U; + static const uint8_t DEFAULT_INT_EMBED_SLICER_POS = 0U; + static const uint8_t DEFAULT_INT_EMBED_SLICER_NUM = 0U; + static const uint8_t DEFAULT_INT_PARITY_SUPPORT = 0U; + static const uint8_t DEFAULT_INT_EVEN_PARITY = 0U; + static const uint8_t DISABLE_GAIN_COMPENSATION = 0U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t gainCompEnStatus = 0U; + + adrv903x_BfRxDdcChanAddr_e baseAddrArr[ADI_ADRV903X_MAX_RX_DDC_BANDS] = { ADRV903X_BF_SLICE_RX_0__RX_DDC_0_, + ADRV903X_BF_SLICE_RX_0__RX_DDC_1_ }; + adrv903x_BfOrxDigChanAddr_e orxDigBaseAddr = (adrv903x_BfOrxDigChanAddr_e) 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Iterate through channel mask and if set disable gain compensation on the corresponding channel */ + for (uint32_t chanIdx = 0U; chanIdx < RX_CHANNEL_ARR_SIZE; chanIdx++) + { + if ((rxChannelMask & (uint32_t)RX_CHANNEL_ARR[chanIdx]) == (uint32_t)RX_CHANNEL_ARR[chanIdx]) + { + /*If an Rx channel mask is set, resolve the corresponding Rx DDC Bitfield Addresses (2 DDCs per channel)*/ + for (uint32_t bandIdx = 0U; bandIdx < RX_DDC_BAND_ARR_SIZE; bandIdx++) + { + recoveryAction = adrv903x_RxDdcBitfieldAddressGet( device, + RX_CHANNEL_ARR[chanIdx], + RX_DDC_BAND_ARR[bandIdx], + &baseAddrArr[bandIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx DDC base address"); + return recoveryAction; + } + } /* end bandIdx for loop */ + + /*Please note that even though gain compensation is disabled, + the embedded slicer bits have to be explicitly set to 0 failing + which the received data will contain slicer bits if it was previously + enabled */ + for (uint32_t bandIdx = 0U; bandIdx < RX_DDC_BAND_ARR_SIZE; bandIdx++) + { + recoveryAction = adrv903x_RxDdc_IntDataFormat_BfSet(device, + NULL, + baseAddrArr[bandIdx], + intDataFormat); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "IntDataFormat Write issue"); + return recoveryAction; + } + + + recoveryAction = adrv903x_RxDdc_IntDataResolution_BfSet(device, + NULL, + baseAddrArr[bandIdx], + intDataResolution); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntDataResolution Write issue"); + return recoveryAction; + } + + for (uint8_t embMonBitIdx = 0U; embMonBitIdx < 2U; embMonBitIdx++) + { + + /* Disable I Sample LSB Posn Embedded overload indicator config */ + recoveryAction = adrv903x_RxDdc_RxMonFormatI_BfSet(device, + NULL, + baseAddrArr[bandIdx], + embMonBitIdx, + (uint8_t)ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxMonFormatI_0 Write issue"); + return recoveryAction; + } + + /* Disable Q Sample LSB + 1 Posn Embedded overload indicator config */ + recoveryAction = adrv903x_RxDdc_RxMonFormatQ_BfSet(device, + NULL, + baseAddrArr[bandIdx], + embMonBitIdx, + (uint8_t)ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxMonFormatQ_1 Write issue"); + return recoveryAction; + } + } /* end embMonBitIdx for loop */ + + /* Disable any Floating Point Modes */ + recoveryAction = adrv903x_RxDdc_FpEn_BfSet( device, + NULL, + baseAddrArr[bandIdx], + ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "FpEn Write issue"); + return recoveryAction; + } + + } /* end bandIdx for loop */ + + /* Check if gain comp is enabled. Read Band0 instance only, assuming all bands are set equivalently */ + recoveryAction = adrv903x_RxDdc_GainCompEnable_BfGet(device, + NULL, + baseAddrArr[0], + &gainCompEnStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GainCompEnable Readback issue"); + return recoveryAction; + } + gainCompEnStatus = gainCompEnStatus ? 1U : 0U; + + + if (gainCompEnStatus) + { + for (uint32_t bandIdx = 0U; bandIdx < RX_DDC_BAND_ARR_SIZE; bandIdx++) + { + /*Disable Ext Slicer Pin Ctrl*/ + recoveryAction = adrv903x_RxDdc_SlicerPinControlMode_BfSet(device, + NULL, + baseAddrArr[bandIdx], + 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SlicerPinControlMode Write issue"); + return recoveryAction; + } + + /* Set Embedded Slicer format configs to default */ + recoveryAction = adrv903x_RxDdc_IntEmbedSlicer_BfSet(device, + NULL, + baseAddrArr[bandIdx], + DEFAULT_INT_EMBED_SLICER); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntEmbedSlicer Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntEmbedSlicerPos_BfSet(device, + NULL, + baseAddrArr[bandIdx], + DEFAULT_INT_EMBED_SLICER_POS); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntEmbedSlicerPos Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntEmbedSlicerNumber_BfSet(device, + NULL, + baseAddrArr[bandIdx], + DEFAULT_INT_EMBED_SLICER_NUM); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntEmbedSlicerNumber Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntParitySupport_BfSet(device, + NULL, + baseAddrArr[bandIdx], + DEFAULT_INT_PARITY_SUPPORT); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntParitySupport Write issue"); + return recoveryAction; + } + recoveryAction = adrv903x_RxDdc_IntEvenParity_BfSet(device, + NULL, + baseAddrArr[bandIdx], + DEFAULT_INT_EVEN_PARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntEvenParity Write issue"); + return recoveryAction; + } + + /*Disable Gain Compensation*/ + recoveryAction = adrv903x_RxDdc_GainCompEnable_BfSet(device, + NULL, + baseAddrArr[bandIdx], + DISABLE_GAIN_COMPENSATION); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GainCompEnable Write issue"); + return recoveryAction; + } + } /* end bandIdx for loop */ + } /* end if gainCompEnStatus */ + + /* Disable any currently routed GPIOs for this Rx Channel's Internal Slicer */ + recoveryAction = adrv903x_RxInternalSlicerGpioDisable(device, RX_CHANNEL_ARR[chanIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error disabling Rx Internal Slicer GPIOs."); + return recoveryAction; + } + + } /* end if Rx chanMask set */ + } /* end Rx chanIdx for loop */ + + /* ORx has no gain compensation, slicer, or embedded monitor data options. */ + /* Only basic int format/resolution options exist. */ + for (uint32_t chanIdx = 0U; chanIdx < ORX_CHANNEL_ARR_SIZE; chanIdx++) + { + if ((rxChannelMask & (uint32_t)ORX_CHANNEL_ARR[chanIdx]) == (uint32_t)ORX_CHANNEL_ARR[chanIdx]) + { + /* Get ORxDig base address for this channel */ + recoveryAction = adrv903x_OrxBitfieldAddressGet( device, + ORX_CHANNEL_ARR[chanIdx], + &orxDigBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve ORx Dig base address"); + return recoveryAction; + } + + /* Set Int Data Format */ + recoveryAction = adrv903x_OrxDig_IntDataFormat_BfSet(device, + NULL, + orxDigBaseAddr, + intDataFormat); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "IntDataFormat Write issue"); + return recoveryAction; + } + + /* Set Int Data Resolution */ + recoveryAction = adrv903x_OrxDig_IntDataResolution_BfSet(device, + NULL, + orxDigBaseAddr, + intDataResolution); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "intDataResolution Write issue"); + return recoveryAction; + } + + } /* end if ORx chanMask set */ + } /* end ORx chanIdx for loop */ + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainCompExtLnaSet(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const uint8_t externalLnaGain) +{ + static const adi_adrv903x_RxChannels_e RX_CHANNEL_ARR[] = { ADI_ADRV903X_RX0, ADI_ADRV903X_RX1, ADI_ADRV903X_RX2, ADI_ADRV903X_RX3, + ADI_ADRV903X_RX4, ADI_ADRV903X_RX5, ADI_ADRV903X_RX6, ADI_ADRV903X_RX7 }; + static const uint32_t RX_CHANNEL_ARR_SIZE = sizeof(RX_CHANNEL_ARR) / sizeof(RX_CHANNEL_ARR[0]); + static const adi_adrv903x_RxDdcs_e RX_DDC_BAND_ARR[] = { ADI_ADRV903X_RX_DDC_BAND0, ADI_ADRV903X_RX_DDC_BAND1 }; + static const uint32_t RX_DDC_BAND_ARR_SIZE = sizeof(RX_DDC_BAND_ARR) / sizeof(RX_DDC_BAND_ARR[0U]); + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDdcChanAddr_e baseAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + uint8_t tmpEnable = externalLnaGain ? ADI_ENABLE : ADI_DISABLE; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Verify that rxChannelMask selects only valid Rx Channels. No ORx */ + if ( (rxChannelMask & (uint32_t)(ADI_ADRV903X_RX_MASK_ALL)) != rxChannelMask ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannelMask, + "Invalid rxChannelMask parameter"); + return recoveryAction; + } + + /* Iterate through channel mask and if set write the ext gain bitfield for both DDCs int he given Rx Channel*/ + for (uint8_t chanIdx = 0U; chanIdx < RX_CHANNEL_ARR_SIZE; chanIdx++) + { + if ((rxChannelMask & (uint32_t)RX_CHANNEL_ARR[chanIdx]) == (uint32_t)RX_CHANNEL_ARR[chanIdx]) + { + + for (uint32_t bandIdx = 0U; bandIdx < RX_DDC_BAND_ARR_SIZE; bandIdx++) + { + /* Get Rx DDC Bitfield Address */ + recoveryAction = adrv903x_RxDdcBitfieldAddressGet( device, + RX_CHANNEL_ARR[chanIdx], + RX_DDC_BAND_ARR[bandIdx], + &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx DDC base address"); + return recoveryAction; + } + + /* Set bitfield */ + recoveryAction = adrv903x_RxDdc_GainCompForExtGain_BfSet(device, + NULL, + baseAddr, + tmpEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GainCompForExtGain Write issue"); + return recoveryAction; + } + + } /* end bandIdx for loop */ + + } /* end rxChannelMask set */ + + } /* end chIdx for loop */ + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainCompTempEnableSet(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const uint8_t tempCompensationEnable) +{ + static const adi_adrv903x_RxChannels_e RX_CHANNEL_ARR[] = { ADI_ADRV903X_RX0, ADI_ADRV903X_RX1, ADI_ADRV903X_RX2, ADI_ADRV903X_RX3, + ADI_ADRV903X_RX4, ADI_ADRV903X_RX5, ADI_ADRV903X_RX6, ADI_ADRV903X_RX7 }; + static const uint32_t RX_CHANNEL_ARR_SIZE = sizeof(RX_CHANNEL_ARR) / sizeof(RX_CHANNEL_ARR[0]); + static const adi_adrv903x_RxDdcs_e RX_DDC_BAND_ARR[] = { ADI_ADRV903X_RX_DDC_BAND0, ADI_ADRV903X_RX_DDC_BAND1 }; + static const uint32_t RX_DDC_BAND_ARR_SIZE = sizeof(RX_DDC_BAND_ARR) / sizeof(RX_DDC_BAND_ARR[0U]); + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDdcChanAddr_e baseAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + uint8_t tmpEnable = tempCompensationEnable ? ADI_ENABLE : ADI_DISABLE; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Verify that rxChannelMask selects only valid Rx Channels. No ORx */ + if ((rxChannelMask & (uint32_t)(ADI_ADRV903X_RX_MASK_ALL)) != rxChannelMask ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannelMask, + "Invalid rxChannelMask parameter"); + return recoveryAction; + } + + /* Iterate through channel mask and if set write the ext gain bitfield for both DDCs int he given Rx Channel*/ + for (uint8_t chanIdx = 0U; chanIdx < RX_CHANNEL_ARR_SIZE; chanIdx++) + { + if ( (rxChannelMask & (uint32_t)RX_CHANNEL_ARR[chanIdx]) == (uint32_t)RX_CHANNEL_ARR[chanIdx]) + { + + for (uint32_t bandIdx = 0U; bandIdx < RX_DDC_BAND_ARR_SIZE; bandIdx++) + { + /* Get Rx DDC Bitfield Address */ + recoveryAction = adrv903x_RxDdcBitfieldAddressGet( device, + RX_CHANNEL_ARR[chanIdx], + RX_DDC_BAND_ARR[bandIdx], + &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx DDC base address"); + return recoveryAction; + } + + /* Set bitfield */ + recoveryAction = adrv903x_RxDdc_GainCompForTempGain_BfSet(device, + NULL, + baseAddr, + tmpEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GainCompForTempGain Write issue"); + return recoveryAction; + } + + } /* end bandIdx for loop */ + + } /* end rxChannelMask set */ + + } /* end chIdx for loop */ + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatFloatingPointSet(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const adi_adrv903x_FloatingPointConfigSettings_t * const floatingPointConfig) +{ + static const adi_adrv903x_RxChannels_e RX_CHANNEL_ARR[] = { ADI_ADRV903X_RX0, ADI_ADRV903X_RX1, ADI_ADRV903X_RX2, ADI_ADRV903X_RX3, + ADI_ADRV903X_RX4, ADI_ADRV903X_RX5, ADI_ADRV903X_RX6, ADI_ADRV903X_RX7 }; + static const uint32_t RX_CHANNEL_ARR_SIZE = sizeof(RX_CHANNEL_ARR) / sizeof(RX_CHANNEL_ARR[0]); + static const adi_adrv903x_RxDdcs_e RX_DDC_BAND_ARR[] = { ADI_ADRV903X_RX_DDC_BAND0, ADI_ADRV903X_RX_DDC_BAND1 }; + static const uint32_t RX_DDC_BAND_ARR_SIZE = sizeof(RX_DDC_BAND_ARR) / sizeof(RX_DDC_BAND_ARR[0U]); + static const uint8_t DEFAULT_INT_DATA_FORMAT = 0U; + static const uint8_t DEFAULT_INT_DATA_RESOLUTION = 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDdcChanAddr_e baseAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, floatingPointConfig); + + /* Verify that rxChannelMask selects only valid Rx Channels. No ORx */ + if ( ((rxChannelMask & (uint32_t)(ADI_ADRV903X_RX_MASK_ALL)) != rxChannelMask) || + (rxChannelMask == ADI_ADRV903X_RXOFF) ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannelMask, + "Invalid rxChannelMask parameter"); + return recoveryAction; + } + + /* Disable Gain Compensation */ + recoveryAction = adrv903x_RxDataFormatGainCompDisable( device, + rxChannelMask, + DEFAULT_INT_DATA_FORMAT, + DEFAULT_INT_DATA_RESOLUTION); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while attempting to Disable Gain Compensation"); + return recoveryAction; + } + + + /* Iterate through channel mask and if set configure the corresponding Rx floating point formatter */ + for (uint8_t chanIdx = 0U; chanIdx < RX_CHANNEL_ARR_SIZE; chanIdx++) + { + if ((rxChannelMask & (uint32_t)RX_CHANNEL_ARR[chanIdx]) == (uint32_t)RX_CHANNEL_ARR[chanIdx]) + { + + for (uint32_t bandIdx = 0U; bandIdx < RX_DDC_BAND_ARR_SIZE; bandIdx++) + { + /* Get Rx DDC Bitfield Address */ + recoveryAction = adrv903x_RxDdcBitfieldAddressGet(device, + RX_CHANNEL_ARR[chanIdx], + RX_DDC_BAND_ARR[bandIdx], + &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx DDC base address"); + return recoveryAction; + } + + /* Set Floating Point Configs */ + recoveryAction = adrv903x_RxDdc_FpRoundMode_BfSet(device, + NULL, + baseAddr, + (adrv903x_Bf_RxDdc_FpRoundMode_e)floatingPointConfig->fpRoundMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "FpRoundMode Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_FpFloatDataFormat_BfSet(device, + NULL, + baseAddr, + floatingPointConfig->fpDataFormat); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "FpFloatDataFormat Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_FpNanEncEn_BfSet(device, + NULL, + baseAddr, + floatingPointConfig->fpEncodeNan); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "FpNanEncEn Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_FpExponentBits_BfSet(device, + NULL, + baseAddr, + (adrv903x_Bf_RxDdc_FpExponentBits_e)floatingPointConfig->fpNumExpBits); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "FpExponentBits Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_FpHideLeadingOnes_BfSet(device, + NULL, + baseAddr, + floatingPointConfig->fpHideLeadingOne); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "FpHideLeadingOnes Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_FpIntDataAtten_BfSet(device, + NULL, + baseAddr, + floatingPointConfig->fpAttenSteps); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "FpIntDataAtten Write issue"); + return recoveryAction; + } + + + /* Enable Floating Point Format on the requested channel */ + recoveryAction = adrv903x_RxDdc_FpEn_BfSet(device, + NULL, + baseAddr, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "FpEn Write issue"); + return recoveryAction; + } + + /* Enable Gain Compensation */ + recoveryAction = adrv903x_RxDdc_GainCompEnable_BfSet(device, + NULL, + baseAddr, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "GainCompEnable Write issue"); + return recoveryAction; + } + } /* end of bandIdx for loop */ + } /* end of rxChannel mask if block */ + } /* end of RxChannel for loop */ + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatIntegerSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const adi_adrv903x_RxDataFormatModes_e formatSelect, + const adi_adrv903x_IntegerConfigSettings_t* const integerConfigSettings, + const adi_adrv903x_SlicerConfigSettings_t* const slicerConfigSettings) +{ + static const adi_adrv903x_RxChannels_e RX_CHANNEL_ARR[] = { ADI_ADRV903X_RX0, ADI_ADRV903X_RX1, ADI_ADRV903X_RX2, ADI_ADRV903X_RX3, + ADI_ADRV903X_RX4, ADI_ADRV903X_RX5, ADI_ADRV903X_RX6, ADI_ADRV903X_RX7 }; + static const uint32_t RX_CHANNEL_ARR_SIZE = sizeof(RX_CHANNEL_ARR) / sizeof(RX_CHANNEL_ARR[0]); + static const adi_adrv903x_RxDdcs_e RX_DDC_BAND_ARR[] = { ADI_ADRV903X_RX_DDC_BAND0, ADI_ADRV903X_RX_DDC_BAND1 }; + static const uint32_t RX_DDC_BAND_ARR_SIZE = sizeof(RX_DDC_BAND_ARR) / sizeof(RX_DDC_BAND_ARR[0U]); + + static const uint8_t DEFAULT_INT_DATA_FORMAT = 0U; + static const uint8_t DEFAULT_INT_DATA_RESOLUTION = 1U; + static const uint8_t SLICER_PIN_CTRL_MODE_INTERNAL = 0U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDdcChanAddr_e baseAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + uint8_t intEmbedSlicer = 0U; + uint8_t intEmbedSlicerPos = 0U; + uint8_t intEmbedSlicerNumber = 0U; + uint8_t slicer3bitModeEn = 0U; + uint8_t intDataResolution = 0U; + uint8_t intDataFormat = 0U; + uint8_t intParitySupport = 0U; + uint8_t intEvenParity = 0U; + uint8_t maxSlicerValue = 0U; + uint8_t maxSlicerOverride = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, integerConfigSettings); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, slicerConfigSettings); + + /* Verify that rxChannelMask selects only valid Rx Channels. No ORx */ + if ( ((rxChannelMask & (uint32_t)(ADI_ADRV903X_RX_MASK_ALL)) != rxChannelMask) || + (rxChannelMask == ADI_ADRV903X_RXOFF) ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannelMask, + "Invalid rxChannelMask parameter"); + return recoveryAction; + } + + /* Disable Gain Compensation */ + recoveryAction = adrv903x_RxDataFormatGainCompDisable(device, + rxChannelMask, + DEFAULT_INT_DATA_FORMAT, + DEFAULT_INT_DATA_RESOLUTION); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while attempting to Disable Gain Compensation"); + return recoveryAction; + } + + /* Resolve the slicer configuration */ + recoveryAction = adrv903x_RxIntEmbSlicerConfigResolve(device, + formatSelect, + integerConfigSettings->intEmbeddedBits, + integerConfigSettings->intParity, + &intEmbedSlicer, + &intEmbedSlicerPos, + &intEmbedSlicerNumber, + &slicer3bitModeEn); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to resolve integer embedded slicer config"); + return recoveryAction; + } + + /* Resolve sample resolution */ + recoveryAction = adrv903x_RxIntSampleResFormatResolve(device, + integerConfigSettings, + &intDataResolution, + &intDataFormat); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to resolve integer sample resolution"); + return recoveryAction; + } + + /* Resolve parity selection */ + recoveryAction = adrv903x_RxIntParitySupportResolve(device, + integerConfigSettings, + &intParitySupport, + &intEvenParity); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to resolve integer parity support"); + return recoveryAction; + } + + /* Iterate through channel mask and clear any previously set Internal Slicer Word GPIOs for corresponding Rx channels */ + for (uint8_t chanIdx = 0U; chanIdx < RX_CHANNEL_ARR_SIZE; chanIdx++) + { + if ((rxChannelMask & (uint32_t)RX_CHANNEL_ARR[chanIdx]) == (uint32_t)RX_CHANNEL_ARR[chanIdx]) + { + if ((formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE) || + (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_3PIN_MODE) || + (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2PIN_MODE)) + { + /* Disable any GPIOs currently being used to route Internal Slicer word bits for this RxChannel*/ + recoveryAction = adrv903x_RxInternalSlicerGpioDisable(device, RX_CHANNEL_ARR[chanIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error disconnecting Rx Internal Slicer Word bits from previous GPIO pins."); + return recoveryAction; + } + } + } + } + + /* Iterate through channel mask and if set configure integer formatter settings on all DDCs of the corresponding Rx channel */ + for (uint8_t chanIdx = 0U; chanIdx < RX_CHANNEL_ARR_SIZE; chanIdx++) + { + if ((rxChannelMask & (uint32_t)RX_CHANNEL_ARR[chanIdx]) == (uint32_t)RX_CHANNEL_ARR[chanIdx]) + { + + /* If external slicer selected, throw an error indicated mode is not supported */ + if (formatSelect == ADI_ADRV903X_GAIN_WITH_EXTERNAL_SLICER) + { + ADI_ADRV903X_API_NOT_IMPLEMENTED_REPORT_RETURN(&device->common); + } + + /* If format is ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE/3PIN_MODE, configure GPIOs */ + else if ((formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE) || + (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_3PIN_MODE) || + (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2PIN_MODE)) + { + recoveryAction = adrv903x_RxInternalSlicerGpioEnable(device, + RX_CHANNEL_ARR[chanIdx], + formatSelect, + slicerConfigSettings); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to enable GPIOs for internal slicer observation"); + return recoveryAction; + } + } + + for (uint32_t bandIdx = 0U; bandIdx < RX_DDC_BAND_ARR_SIZE; bandIdx++) + { + /* Get Rx DDC Bitfield Address */ + recoveryAction = adrv903x_RxDdcBitfieldAddressGet(device, + RX_CHANNEL_ARR[chanIdx], + RX_DDC_BAND_ARR[bandIdx], + &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx DDC base address"); + return recoveryAction; + } + + /* Enable Rx Gain Compensation and configure format for the requested Rx Channel */ + recoveryAction = adrv903x_RxDdc_GainCompEnable_BfSet(device, + NULL, + baseAddr, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "GainCompEnable Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntDataFormat_BfSet(device, + NULL, + baseAddr, + intDataFormat); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "IntDataFormat Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntDataResolution_BfSet(device, + NULL, + baseAddr, + intDataResolution); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "IntDataResolution Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntEmbedSlicer_BfSet(device, + NULL, + baseAddr, + intEmbedSlicer); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "IntEmbedSlicer Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntEmbedSlicerPos_BfSet(device, + NULL, + baseAddr, + intEmbedSlicerPos); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "IntEmbedSlicerPos Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntEmbedSlicerNumber_BfSet(device, + NULL, + baseAddr, + intEmbedSlicerNumber); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "IntEmbedSlicerNumber Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntParitySupport_BfSet(device, + NULL, + baseAddr, + intParitySupport); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "IntParitySupport Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntEvenParity_BfSet(device, + NULL, + baseAddr, + intEvenParity); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "IntEvenParity Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_SlicerPinControlMode_BfSet(device, + NULL, + baseAddr, + SLICER_PIN_CTRL_MODE_INTERNAL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "SlicerPinControlMode Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntSlicerLsbOnQ_BfSet(device, + NULL, + baseAddr, + (uint8_t)integerConfigSettings->intEmbeddedPos); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "IntSlicerLsbOnQ Write issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_Static3bitSlicerModeEn_BfSet(device, + NULL, + baseAddr, + slicer3bitModeEn); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Static3bitSlicerModeEn Write issue"); + return recoveryAction; + } + + /* Configure pin control step size */ + recoveryAction = adrv903x_RxDdc_SlicerPinControlStep_BfSet(device, + NULL, + baseAddr, + (uint8_t)slicerConfigSettings->intSlicerStepSize); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Static3bitSlicerModeEn Write issue"); + return recoveryAction; + } + + /* If format is ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO */ + /* and intEmbeddedBits is ADI_ADRV903X_EMBED_2_SLICERBITS_AT_[MSB/LSB]_3_BIT_SLICER, */ + /* then set 3bit slicer mode bit for the rxChannel in the device handle. */ + /* Otherwise clear bit in device handle */ + if (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO) + { + if ((integerConfigSettings->intEmbeddedBits == ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_3_BIT_SLICER) || + (integerConfigSettings->intEmbeddedBits == ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_3_BIT_SLICER)) + { + device->devStateInfo.rxChannel3bitSlicerMode |= (uint8_t)RX_CHANNEL_ARR[chanIdx]; + } + else + { + device->devStateInfo.rxChannel3bitSlicerMode &= ~(uint8_t)RX_CHANNEL_ARR[chanIdx]; + } + } + else + { + device->devStateInfo.rxChannel3bitSlicerMode &= ~(uint8_t)RX_CHANNEL_ARR[chanIdx]; + } + + maxSlicerOverride = ADI_FALSE; + if (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2PIN_MODE) + { + maxSlicerValue = 3U; + maxSlicerOverride = ADI_TRUE; + } + else if (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_3PIN_MODE) + { + maxSlicerValue = 7U; + maxSlicerOverride = ADI_TRUE; + } + else if (formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE) + { + maxSlicerValue = 15U; + maxSlicerOverride = ADI_TRUE; + } + + /* Configure max slicer override value */ + recoveryAction = adrv903x_RxDdc_MaxSlicerOverride_BfSet(device, + NULL, + baseAddr, + maxSlicerOverride); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "MaxSlicerOverride Write issue"); + return recoveryAction; + } + + /* Configure max slicer override value */ + recoveryAction = adrv903x_RxDdc_MaxSlicer_BfSet(device, + NULL, + baseAddr, + maxSlicerValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "MaxSlicer Write issue"); + return recoveryAction; + } + + } /* end bandIdx for loop */ + + } /* end rxChannelMask set */ + + } /* end chIdx for loop */ + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatEmbOvldMonitorSet(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const adi_adrv903x_EmbOverloadMonitorConfigSettings_t * const embOvldConfigSettings) +{ + static const adi_adrv903x_RxChannels_e RX_CHANNEL_ARR[] = { ADI_ADRV903X_RX0, ADI_ADRV903X_RX1, ADI_ADRV903X_RX2, ADI_ADRV903X_RX3, + ADI_ADRV903X_RX4, ADI_ADRV903X_RX5, ADI_ADRV903X_RX6, ADI_ADRV903X_RX7 }; + static const uint32_t RX_CHANNEL_ARR_SIZE = sizeof(RX_CHANNEL_ARR) / sizeof(RX_CHANNEL_ARR[0]); + + static const uint8_t DEFAULT_INT_DATA_FORMAT = 0U; /* Int data format - 2s complement */ + static const uint8_t DEFAULT_INT_DATA_RESOLUTION = 1U; /* Int sample resolution - 16 bit */ + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e funcsAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + + uint8_t enable = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, embOvldConfigSettings); + + /* Verify that rxChannelMask selects only valid Rx Channels. No ORx */ + if ( ((rxChannelMask & (uint32_t)(ADI_ADRV903X_RX_MASK_ALL)) != rxChannelMask) || + (rxChannelMask == ADI_ADRV903X_RXOFF) ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannelMask, + "Invalid rxChannelMask parameter"); + return recoveryAction; + } + + /*Disable gain compensation and set integer format register to default*/ + recoveryAction = adrv903x_RxDataFormatGainCompDisable( device, + rxChannelMask, + DEFAULT_INT_DATA_FORMAT, + DEFAULT_INT_DATA_RESOLUTION); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to disable gain compensation"); + return recoveryAction; + } + + /* Iterate through channel mask and if set emb overload bitfields for both DDCs in the given Rx Channel*/ + for (uint8_t chanIdx = 0U; chanIdx < RX_CHANNEL_ARR_SIZE; chanIdx++) + { + if ( (rxChannelMask & (uint32_t)RX_CHANNEL_ARR[chanIdx]) == (uint32_t)RX_CHANNEL_ARR[chanIdx]) + { + /* Get Rx Funcs Bitfield Address */ + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet( device, + RX_CHANNEL_ARR[chanIdx], + &funcsAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx Funcs base address"); + return recoveryAction; + } + /* Change recoveryAction value to ADI_ADRV903X_ERR_ACT_CHECK_PARAM so if the embOvldConfigSettings parameters + * aren't valid for any of the following if-conditions there will be a detectable error */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + if ((embOvldConfigSettings->embeddedMonitorSrcLsbI == ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbQ == ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI == ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ == ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH)) + { + /* Set the APD High Threshold exceeded indicator source */ + recoveryAction = adrv903x_RxFuncs_ApdHighSrcSelect_BfSet(device, + NULL, + funcsAddr, + (uint8_t)embOvldConfigSettings->embeddedMonitorApdHighSrcSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "ApdHighSrcSelect Write issue"); + return recoveryAction; + } + } + + if ((embOvldConfigSettings->embeddedMonitorSrcLsbI == ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbQ == ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI == ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ == ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH)) + { + /* Set the APD Low Threshold exceeded indicator source */ + recoveryAction = adrv903x_RxFuncs_ApdLowSrcSelect_BfSet(device, + NULL, + funcsAddr, + (uint8_t)embOvldConfigSettings->embeddedMonitorApdLowSrcSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "ApdLowSrcSelect Write issue"); + return recoveryAction; + } + } + + if ((embOvldConfigSettings->embeddedMonitorSrcLsbI == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbQ == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH)) + { + /* Set the HB2 High Threshold exceeded indicator source */ + recoveryAction = adrv903x_RxFuncs_Hb2HighSrcSelect_BfSet(device, + NULL, + funcsAddr, + (uint8_t)embOvldConfigSettings->embeddedMonitorHb2HighSrcSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Hb2HighSrcSelect Write issue"); + return recoveryAction; + } + } + + if ((embOvldConfigSettings->embeddedMonitorSrcLsbI == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbQ == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH) || + (embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ == ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH)) + { + /* Set the HB2 Low Threshold exceeded indicator source */ + recoveryAction = adrv903x_RxFuncs_Hb2LowSrcSelect_BfSet(device, + NULL, + funcsAddr, + (uint8_t)embOvldConfigSettings->embeddedMonitorHb2LowSrcSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Hb2LowSrcSelect Write issue"); + return recoveryAction; + } + } + /* If recoveryAction wasn't altered in the previous if-conditions, there must be an error in the configuration */ + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, embOvldConfigSettings, "Wrong Monitor Source on LSB I and LSB Q or LSB +1 I and LSB + 1 Q"); + return recoveryAction; + } + + /* Set invert Hb2 flag config */ + enable = (embOvldConfigSettings->invertHb2Flag == 0U) ? 0U : 1U; + recoveryAction = adrv903x_RxFuncs_InvertHb2Low_BfSet(device, + NULL, + funcsAddr, + enable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while writing invert Hb2 Flag configuration"); + return recoveryAction; + } + + /* Set invert Apd2 flag config */ + enable = (embOvldConfigSettings->invertApdFlag == 0U) ? 0U : 1U; + recoveryAction = adrv903x_RxFuncs_InvertApdLow_BfSet(device, + NULL, + funcsAddr, + enable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while writing invert Apd Flag configuration"); + return recoveryAction; + } + + recoveryAction = (adi_adrv903x_ErrAction_e)adrv903x_RxEmbeddedOverloadBitsSet( device, + chanIdx, + (uint8_t)embOvldConfigSettings->embeddedMonitorSrcLsbI, + (uint8_t)embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI, + (uint8_t)embOvldConfigSettings->embeddedMonitorSrcLsbQ, + (uint8_t)embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing embedded overload bits"); + return recoveryAction; + } + + } /* end rxChannelMask set */ + + } /* end chIdx for loop */ + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxEmbeddedOverloadBitsSet(adi_adrv903x_Device_t * const device, + uint8_t chanIdx, + uint8_t lsbIData, + uint8_t lsbIPlusData, + uint8_t lsbQData, + uint8_t lsbQPlusData) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + + static const adi_adrv903x_RxChannels_e RX_CHANNEL_ARR[] = { ADI_ADRV903X_RX0, ADI_ADRV903X_RX1, ADI_ADRV903X_RX2, ADI_ADRV903X_RX3, + ADI_ADRV903X_RX4, ADI_ADRV903X_RX5, ADI_ADRV903X_RX6, ADI_ADRV903X_RX7}; + static const adi_adrv903x_RxDdcs_e RX_DDC_BAND_ARR[] = { ADI_ADRV903X_RX_DDC_BAND0, ADI_ADRV903X_RX_DDC_BAND1 }; + static const uint32_t RX_DDC_BAND_ARR_SIZE = sizeof(RX_DDC_BAND_ARR) / sizeof(RX_DDC_BAND_ARR[0U]); + static const uint8_t LSB_POS_I_CHANNEL_ID = 0U; + static const uint8_t LSB_PLUS_ONE_POS_I_CHANNEL_ID = 1U; + static const uint8_t LSB_POS_Q_CHANNEL_ID = 0U; + static const uint8_t LSB_PLUS_ONE_POS_Q_CHANNEL_ID = 1U; + adrv903x_BfRxChanAddr_e rxDigBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_DIG; + adrv903x_BfRxDdcChanAddr_e ddcAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + uint8_t routClkDividerVal = 0U; + + /* Set all instances of rx_ddc bitfields */ + for (uint32_t bandIdx = 0U; bandIdx < RX_DDC_BAND_ARR_SIZE; bandIdx++) + { + /* Get Rx DDC Bitfield Address */ + recoveryAction = adrv903x_RxDdcBitfieldAddressGet( device, + RX_CHANNEL_ARR[chanIdx], + RX_DDC_BAND_ARR[bandIdx], + &ddcAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx DDC base address"); + return recoveryAction; + } + + /* I Sample LSB Posn Embedded overload indicator config */ + recoveryAction = adrv903x_RxDdc_RxMonFormatI_BfSet(device, + NULL, + ddcAddr, + LSB_POS_I_CHANNEL_ID, + lsbIData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxMonFormatI_0 Write issue"); + return recoveryAction; + } + + /* I Sample LSB + 1 Posn Embedded overload indicator config */ + recoveryAction = adrv903x_RxDdc_RxMonFormatI_BfSet(device, + NULL, + ddcAddr, + LSB_PLUS_ONE_POS_I_CHANNEL_ID, + lsbIPlusData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxMonFormatI_1 Write issue"); + return recoveryAction; + } + + /* Q Sample LSB Posn Embedded overload indicator config */ + recoveryAction = adrv903x_RxDdc_RxMonFormatQ_BfSet(device, + NULL, + ddcAddr, + LSB_POS_Q_CHANNEL_ID, + lsbQData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxMonFormatQ_0 Write issue"); + return recoveryAction; + } + + /* Q Sample LSB + 1 Posn Embedded overload indicator config */ + recoveryAction = adrv903x_RxDdc_RxMonFormatQ_BfSet(device, + NULL, + ddcAddr, + LSB_PLUS_ONE_POS_Q_CHANNEL_ID, + lsbQPlusData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxMonFormatQ_1 Write issue"); + return recoveryAction; + } + + } /* end bandIdx for loop */ + + /* Enable the JESD clock for embedded overload bits if there at least one bit is being used */ + if ((lsbIData != (uint8_t)ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED) || + (lsbQData != (uint8_t)ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED) || + (lsbIPlusData != (uint8_t)ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED) || + (lsbQPlusData != (uint8_t)ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED)) + { + recoveryAction = adrv903x_RxBitfieldAddressGet(device, RX_CHANNEL_ARR[chanIdx], &rxDigBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Invalid Rx Channel used to determine rx dig address"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDig_RoutClkDivideRatio_BfGet(device, NULL, rxDigBaseAddr, &routClkDividerVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read rout clock divider value"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDig_Ddc1Hb1OutClkDivideRatio_BfSet(device, NULL, rxDigBaseAddr, routClkDividerVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write ddc1 hb1 out clock div ratio"); + return recoveryAction; + } + + /* This is to provide smon block a clock source */ + recoveryAction = adrv903x_RxDig_StreamprocDdc1Hb1OutClkEnable_BfSet(device, NULL, rxDigBaseAddr, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to set ddc1 hb1 out clock enable"); + return recoveryAction; + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxIntSampleResFormatResolve(adi_adrv903x_Device_t * const device, + const adi_adrv903x_IntegerConfigSettings_t * const integerConfigSettings, + uint8_t * const intDataResolution, + uint8_t * const intDataFormat) +{ + static const uint8_t INT_DATA_FORMAT_2S_COMPLEMENT = 0U; + static const uint8_t INT_DATA_FORMAT_SIGNED_MAGNITUDE = 1U; + static const uint8_t INT_DATA_RESOLUTION_12BITS = 0U; + static const uint8_t INT_DATA_RESOLUTION_16BITS = 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, integerConfigSettings); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intDataResolution); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intDataFormat); + + /* Resolve Sample Resolution */ + switch (integerConfigSettings->intSampleResolution) + { + case ADI_ADRV903X_INTEGER_12BIT_2SCOMP: + { + *intDataResolution = INT_DATA_RESOLUTION_12BITS; + *intDataFormat = INT_DATA_FORMAT_2S_COMPLEMENT; + break; + } + + case ADI_ADRV903X_INTEGER_12BIT_SIGNED: + { + *intDataResolution = INT_DATA_RESOLUTION_12BITS; + *intDataFormat = INT_DATA_FORMAT_SIGNED_MAGNITUDE; + break; + } + + case ADI_ADRV903X_INTEGER_16BIT_2SCOMP: + { + *intDataResolution = INT_DATA_RESOLUTION_16BITS; + *intDataFormat = INT_DATA_FORMAT_2S_COMPLEMENT; + break; + } + + case ADI_ADRV903X_INTEGER_16BIT_SIGNED: + { + *intDataResolution = INT_DATA_RESOLUTION_16BITS; + *intDataFormat = INT_DATA_FORMAT_SIGNED_MAGNITUDE; + break; + } + + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + integerConfigSettings->intSampleResolution, + "Invalid integer formatter data resolution selected"); + return recoveryAction; + + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CddcIntSampleResFormatResolve(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CddcIntegerConfigSettings_t* const cddcIntegerConfigSettings, + uint8_t* const intDataResolution, + uint8_t* const intDataFormat) +{ + static const uint8_t INT_DATA_FORMAT_2S_COMPLEMENT = 0U; + static const uint8_t INT_DATA_FORMAT_SIGNED_MAGNITUDE = 1U; + static const uint8_t INT_DATA_RESOLUTION_12BITS = 0U; + static const uint8_t INT_DATA_RESOLUTION_16BITS = 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cddcIntegerConfigSettings); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intDataResolution); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intDataFormat); + + /* Resolve Sample Resolution */ + switch (cddcIntegerConfigSettings->intSampleResolution) + { + case ADI_ADRV903X_INTEGER_12BIT_2SCOMP: + { + *intDataResolution = INT_DATA_RESOLUTION_12BITS; + *intDataFormat = INT_DATA_FORMAT_2S_COMPLEMENT; + break; + } + + case ADI_ADRV903X_INTEGER_12BIT_SIGNED: + { + *intDataResolution = INT_DATA_RESOLUTION_12BITS; + *intDataFormat = INT_DATA_FORMAT_SIGNED_MAGNITUDE; + break; + } + + case ADI_ADRV903X_INTEGER_16BIT_2SCOMP: + { + *intDataResolution = INT_DATA_RESOLUTION_16BITS; + *intDataFormat = INT_DATA_FORMAT_2S_COMPLEMENT; + break; + } + + case ADI_ADRV903X_INTEGER_16BIT_SIGNED: + { + *intDataResolution = INT_DATA_RESOLUTION_16BITS; + *intDataFormat = INT_DATA_FORMAT_SIGNED_MAGNITUDE; + break; + } + + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + cddcIntegerConfigSettings->intSampleResolution, + "Invalid integer formatter data resolution selected"); + return recoveryAction; + + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxInternalSlicerGpioDisable(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t slicerBit = 0U; + adi_adrv903x_GpioPinSel_e tmpPin = ADI_ADRV903X_GPIO_INVALID; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Get channel index from enum */ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx channel selected for GPIOs to be disabled. Must be in range RX0-RX7."); + return recoveryAction; + } + + /* Release any of the slicer bits from previous GPIOs */ + for (slicerBit = 0U; slicerBit < ADI_ADRV903X_MAX_RX_INT_SLICER_BITS; slicerBit++) + { + recoveryAction = adrv903x_GpioSignalFind( device, + &tmpPin, + adrv903x_RxInternalSlicerOutputSignals[slicerBit], + (adi_adrv903x_Channels_e)rxChannel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error searching for previous GPIO that was routing Rx Internal Slicer Word bit."); + return recoveryAction; + } + + if (tmpPin != ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = adrv903x_GpioSignalRelease( device, + tmpPin, + adrv903x_RxInternalSlicerOutputSignals[slicerBit], + (uint32_t)rxChannel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error releasing previous GPIO that was routing Rx Internal Slicer Word bit."); + return recoveryAction; + } + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxInternalSlicerGpioEnable(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + const adi_adrv903x_RxDataFormatModes_e intSlicerFormatSel, + const adi_adrv903x_SlicerConfigSettings_t* const slicerConfigSettings) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t NUM_BITS = 0U; + uint8_t slicerBit = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Get channel index from enum */ + switch (rxChannel) + { + case (ADI_ADRV903X_RX0): /* Fall through */ + case (ADI_ADRV903X_RX1): /* Fall through */ + case (ADI_ADRV903X_RX2): /* Fall through */ + case (ADI_ADRV903X_RX3): /* Fall through */ + case (ADI_ADRV903X_RX4): /* Fall through */ + case (ADI_ADRV903X_RX5): /* Fall through */ + case (ADI_ADRV903X_RX6): /* Fall through */ + case (ADI_ADRV903X_RX7): + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx channel selected for GPIOs to be enabled. Must be in range RX0-RX7."); + return recoveryAction; + } + + /* Set number of Slicer bits required by chosen IntSlicerFormatSel */ + switch (intSlicerFormatSel) + { + case (ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE): + NUM_BITS = 4U; + break; + case (ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_3PIN_MODE): + NUM_BITS = 3U; + break; + case (ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2PIN_MODE): + NUM_BITS = 2U; + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + intSlicerFormatSel, + "Invalid Rx Internal Slicer Format selected for GPIO setup. Must be 4PIN Mode or 3PIN mode to enable GPIOs."); + return recoveryAction; + } + + /* Route selected GPIOs for RX Internal Slicer Word bits, for this Rx Channel */ + for (slicerBit = 0U; slicerBit < NUM_BITS; slicerBit++) + { + recoveryAction = adrv903x_GpioSignalSet( device, + slicerConfigSettings->intSlicerGpioSelect[slicerBit], + adrv903x_RxInternalSlicerOutputSignals[slicerBit], + (uint32_t)rxChannel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error routing Rx Internal Slicer Word bit to GPIO pin."); + return recoveryAction; + } + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxIntEmbSlicerConfigResolve(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxDataFormatModes_e formatSelect, + const adi_adrv903x_RxSlicerEmbeddedBits_e intEmbeddedBits, + const adi_adrv903x_RxIntParity_e parity, + uint8_t * const intEmbedSlicer, + uint8_t * const intEmbedSlicerPos, + uint8_t * const intEmbedSlicerNumber, + uint8_t * const staticSlicer3bitModeEn) +{ + static const uint8_t INT_EMBED_SLICER_DISABLE = 0U; + static const uint8_t INT_EMBED_SLICER_ENABLE = 1U; + static const uint8_t INT_EMBED_SLICER_POS_MSB = 0U; + static const uint8_t INT_EMBED_SLICER_POS_LSB = 1U; + static const uint8_t INT_EMBED_SLICER_2_BITS = 0U; + static const uint8_t INT_EMBED_SLICER_1_BIT = 1U; + static const uint8_t INT_SLICER_3_BIT_MODE_DISABLE = 0U; + static const uint8_t INT_SLICER_3_BIT_MODE_ENABLE = 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intEmbedSlicer); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intEmbedSlicerPos); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intEmbedSlicerNumber); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, staticSlicer3bitModeEn); + + if ( formatSelect == ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO ) + { + /* Resolve slicer and slicer position configs */ + switch (intEmbeddedBits) + { + case ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS: + *intEmbedSlicer = INT_EMBED_SLICER_DISABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_MSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_2_BITS; + *staticSlicer3bitModeEn = INT_SLICER_3_BIT_MODE_DISABLE; + break; + case ADI_ADRV903X_EMBED_1_SLICERBIT_AT_MSB: + *intEmbedSlicer = INT_EMBED_SLICER_ENABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_MSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_1_BIT; + *staticSlicer3bitModeEn = INT_SLICER_3_BIT_MODE_DISABLE; + break; + case ADI_ADRV903X_EMBED_1_SLICERBIT_AT_LSB: + *intEmbedSlicer = INT_EMBED_SLICER_ENABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_LSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_1_BIT; + *staticSlicer3bitModeEn = INT_SLICER_3_BIT_MODE_DISABLE; + break; + case ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_3_BIT_SLICER: + *intEmbedSlicer = INT_EMBED_SLICER_ENABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_MSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_2_BITS; + *staticSlicer3bitModeEn = (parity == ADI_ADRV903X_NO_PARITY) ? + INT_SLICER_3_BIT_MODE_ENABLE : + INT_SLICER_3_BIT_MODE_DISABLE; + break; + case ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_3_BIT_SLICER: + *intEmbedSlicer = INT_EMBED_SLICER_ENABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_LSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_2_BITS; + *staticSlicer3bitModeEn = (parity == ADI_ADRV903X_NO_PARITY) ? + INT_SLICER_3_BIT_MODE_ENABLE : + INT_SLICER_3_BIT_MODE_DISABLE; + break; + case ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_4_BIT_SLICER: + *intEmbedSlicer = INT_EMBED_SLICER_ENABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_MSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_2_BITS; + *staticSlicer3bitModeEn = INT_SLICER_3_BIT_MODE_DISABLE; + break; + case ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_4_BIT_SLICER: + *intEmbedSlicer = INT_EMBED_SLICER_ENABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_LSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_2_BITS; + *staticSlicer3bitModeEn = INT_SLICER_3_BIT_MODE_DISABLE; + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + intEmbeddedBits, + "Invalid integer formatter embedded slicer mode config selected"); + return recoveryAction; + break; + } + } + else + { + /* For other data format modes set int embedded slicer config to default */ + *intEmbedSlicer = INT_EMBED_SLICER_DISABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_MSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_2_BITS; + *staticSlicer3bitModeEn = INT_SLICER_3_BIT_MODE_DISABLE; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CddcIntEmbSlicerConfigResolve(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CddcDataFormatModes_e formatSelect, + const adi_adrv903x_RxSlicerEmbeddedBits_e intEmbeddedBits, + const adi_adrv903x_RxIntParity_e parity, + uint8_t* const intEmbedSlicer, + uint8_t* const intEmbedSlicerPos, + uint8_t* const intEmbedSlicerNumber, + uint8_t* const staticSlicer3bitModeEn) +{ + static const uint8_t INT_EMBED_SLICER_DISABLE = 0U; + static const uint8_t INT_EMBED_SLICER_ENABLE = 1U; + static const uint8_t INT_EMBED_SLICER_POS_MSB = 0U; + static const uint8_t INT_EMBED_SLICER_POS_LSB = 1U; + static const uint8_t INT_EMBED_SLICER_2_BITS = 0U; + static const uint8_t INT_EMBED_SLICER_1_BIT = 1U; + static const uint8_t INT_SLICER_3_BIT_MODE_DISABLE = 0U; + static const uint8_t INT_SLICER_3_BIT_MODE_ENABLE = 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intEmbedSlicer); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intEmbedSlicerPos); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intEmbedSlicerNumber); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, staticSlicer3bitModeEn); + + if (formatSelect == ADI_ADRV903X_CDDC_INTEGER) + { + /* Resolve slicer and slicer position configs */ + switch (intEmbeddedBits) + { + case ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS: + *intEmbedSlicer = INT_EMBED_SLICER_DISABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_MSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_2_BITS; + *staticSlicer3bitModeEn = INT_SLICER_3_BIT_MODE_DISABLE; + break; + case ADI_ADRV903X_EMBED_1_SLICERBIT_AT_MSB: + *intEmbedSlicer = INT_EMBED_SLICER_ENABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_MSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_1_BIT; + *staticSlicer3bitModeEn = INT_SLICER_3_BIT_MODE_DISABLE; + break; + case ADI_ADRV903X_EMBED_1_SLICERBIT_AT_LSB: + *intEmbedSlicer = INT_EMBED_SLICER_ENABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_LSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_1_BIT; + *staticSlicer3bitModeEn = INT_SLICER_3_BIT_MODE_DISABLE; + break; + case ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_3_BIT_SLICER: + *intEmbedSlicer = INT_EMBED_SLICER_ENABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_MSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_2_BITS; + *staticSlicer3bitModeEn = (parity == ADI_ADRV903X_NO_PARITY) ? + INT_SLICER_3_BIT_MODE_ENABLE : + INT_SLICER_3_BIT_MODE_DISABLE; + break; + case ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_3_BIT_SLICER: + *intEmbedSlicer = INT_EMBED_SLICER_ENABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_LSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_2_BITS; + *staticSlicer3bitModeEn = (parity == ADI_ADRV903X_NO_PARITY) ? + INT_SLICER_3_BIT_MODE_ENABLE : + INT_SLICER_3_BIT_MODE_DISABLE; + break; + case ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_4_BIT_SLICER: + *intEmbedSlicer = INT_EMBED_SLICER_ENABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_MSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_2_BITS; + *staticSlicer3bitModeEn = INT_SLICER_3_BIT_MODE_DISABLE; + break; + case ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_4_BIT_SLICER: + *intEmbedSlicer = INT_EMBED_SLICER_ENABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_LSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_2_BITS; + *staticSlicer3bitModeEn = INT_SLICER_3_BIT_MODE_DISABLE; + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + intEmbeddedBits, + "Invalid integer formatter embedded slicer mode config selected"); + return recoveryAction; + break; + } + } + else + { + /* For other data format modes set int embedded slicer config to default */ + *intEmbedSlicer = INT_EMBED_SLICER_DISABLE; + *intEmbedSlicerPos = INT_EMBED_SLICER_POS_MSB; + *intEmbedSlicerNumber = INT_EMBED_SLICER_2_BITS; + *staticSlicer3bitModeEn = INT_SLICER_3_BIT_MODE_DISABLE; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxIntParitySupportResolve(adi_adrv903x_Device_t * const device, + const adi_adrv903x_IntegerConfigSettings_t * const integerConfigSettings, + uint8_t * const intParitySupport, + uint8_t * const intEvenParity) +{ + static const uint8_t INT_PARITY_SUPPORT_DISABLE = 0U; + static const uint8_t INT_PARITY_SUPPORT_ENABLE = 1U; + static const uint8_t INT_PARITY_EVEN = 0U; + static const uint8_t INT_PARITY_ODD = 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, integerConfigSettings); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intParitySupport); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intEvenParity); + + switch (integerConfigSettings->intParity) + { + case ADI_ADRV903X_3BIT_SLICER_ODD_PARITY: + *intParitySupport = INT_PARITY_SUPPORT_ENABLE; + *intEvenParity = INT_PARITY_ODD; + break; + case ADI_ADRV903X_3BIT_SLICER_EVEN_PARITY: + *intParitySupport = INT_PARITY_SUPPORT_ENABLE; + *intEvenParity = INT_PARITY_EVEN; + break; + case ADI_ADRV903X_NO_PARITY: + *intParitySupport = INT_PARITY_SUPPORT_DISABLE; + *intEvenParity = INT_PARITY_EVEN; + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + integerConfigSettings->intParity, + "Invalid integer formatter parity selection"); + return recoveryAction; + break; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CddcIntParitySupportResolve(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CddcIntegerConfigSettings_t* const cddcIntegerConfigSettings, + uint8_t* const intParitySupport, + uint8_t* const intEvenParity) +{ + static const uint8_t INT_PARITY_SUPPORT_DISABLE = 0U; + static const uint8_t INT_PARITY_SUPPORT_ENABLE = 1U; + static const uint8_t INT_PARITY_EVEN = 0U; + static const uint8_t INT_PARITY_ODD = 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cddcIntegerConfigSettings); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intParitySupport); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intEvenParity); + + switch (cddcIntegerConfigSettings->intParity) + { + case ADI_ADRV903X_3BIT_SLICER_ODD_PARITY: + *intParitySupport = INT_PARITY_SUPPORT_ENABLE; + *intEvenParity = INT_PARITY_ODD; + break; + case ADI_ADRV903X_3BIT_SLICER_EVEN_PARITY: + *intParitySupport = INT_PARITY_SUPPORT_ENABLE; + *intEvenParity = INT_PARITY_EVEN; + break; + case ADI_ADRV903X_NO_PARITY: + *intParitySupport = INT_PARITY_SUPPORT_DISABLE; + *intEvenParity = INT_PARITY_EVEN; + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + cddcIntegerConfigSettings->intParity, + "Invalid integer formatter parity selection"); + return recoveryAction; + break; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatSelectGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxDataFormatModes_e * const rxDataFormat) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDdcChanAddr_e baseAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + uint8_t gainCompEnStatus = 0U; + uint8_t floatingPointEn = 0U; + uint8_t rxExtSlicerModeEn = 0U; + uint8_t intEmbedSlicer = 0U; + + adi_adrv903x_EmbOverloadMonitorConfigSettings_t embOvldMonitorSettings = { ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW, + ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH, + ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_EXCEEDED, + ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_EXCEEDED, + 0U, + 0U }; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxDataFormat); + + /* Check if the requested rxChannel is valid Rx channel. */ + if ((rxChannel == ADI_ADRV903X_RX0) || + (rxChannel == ADI_ADRV903X_RX1) || + (rxChannel == ADI_ADRV903X_RX2) || + (rxChannel == ADI_ADRV903X_RX3) || + (rxChannel == ADI_ADRV903X_RX4) || + (rxChannel == ADI_ADRV903X_RX5) || + (rxChannel == ADI_ADRV903X_RX6) || + (rxChannel == ADI_ADRV903X_RX7)) + { + + /* Get Rx DDC Bitfield Address. Band0 only and assume all other bands are equivalent */ + recoveryAction = adrv903x_RxDdcBitfieldAddressGet( device, + rxChannel, + ADI_ADRV903X_RX_DDC_BAND0, + &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx DDC base address"); + return recoveryAction; + } + + + /* Check if gain comp is enabled. Read Band0 instance only, assuming all bands are set equivalently */ + recoveryAction = adrv903x_RxDdc_GainCompEnable_BfGet(device, + NULL, + baseAddr, + &gainCompEnStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GainCompEnable Readback issue"); + return recoveryAction; + } + gainCompEnStatus = gainCompEnStatus ? ADI_ENABLE : ADI_DISABLE; + + /* If gain compensation is not enabled, determine if there embedded overload monitor data is being used */ + if (gainCompEnStatus == ADI_DISABLE) + { + + recoveryAction = adrv903x_RxDataFormatEmbOvldMonitorGet(device, rxChannel, &embOvldMonitorSettings); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve embOvldMonitorSettings"); + return recoveryAction; + } + + if ((embOvldMonitorSettings.embeddedMonitorSrcLsbI == ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED) && + (embOvldMonitorSettings.embeddedMonitorSrcLsbQ == ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED) && + (embOvldMonitorSettings.embeddedMonitorSrcLsbPlusOneI == ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED) && + (embOvldMonitorSettings.embeddedMonitorSrcLsbPlusOneQ == ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED)) + { + *rxDataFormat = ADI_ADRV903X_GAIN_COMPENSATION_DISABLED; + } + else + { + *rxDataFormat = ADI_ADRV903X_EMBED_OVERLOAD_MONITOR_DATA; + } + + } + + /* If gain compensation is enabled, check if other modes are being used */ + else + { + /* Check if floating point mode is enabled */ + recoveryAction = adrv903x_RxDdc_FpEn_BfGet(device, + NULL, + baseAddr, + &floatingPointEn); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Floating Point Enable Readback issue"); + return recoveryAction; + } + + if (floatingPointEn) + { + *rxDataFormat = ADI_ADRV903X_GAIN_WITH_FLOATING_POINT; + } + else + { + /* Check if Rx Slicer Pin Control Mode = External */ + recoveryAction = adrv903x_RxDdc_SlicerPinControlMode_BfGet(device, + NULL, + baseAddr, + &rxExtSlicerModeEn); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SlicerPinControlMode Readback issue"); + return recoveryAction; + } + + if (rxExtSlicerModeEn) + { + *rxDataFormat = ADI_ADRV903X_GAIN_WITH_EXTERNAL_SLICER; + } + else + { + recoveryAction = adrv903x_RxDdc_IntEmbedSlicer_BfGet(device, + NULL, + baseAddr, + &intEmbedSlicer); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxIntEmbedSlicer Readback issue"); + return recoveryAction; + } + + if (intEmbedSlicer) + { + *rxDataFormat = ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO; + } + else + { + recoveryAction = adrv903x_RxInternalSlicerGpioEnableGet( device, + rxChannel, + rxDataFormat, + NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve rxDataFormat"); + return recoveryAction; + } + } + } + + } + } + + } /* End valid Rx Channel if block */ + + /* Check if the requested rxChannel is valid ORx channel */ + else if ((rxChannel == ADI_ADRV903X_ORX0) || + (rxChannel == ADI_ADRV903X_ORX1) ) + { + /* Only possible format for ORx channels is ADI_ADRV903X_GAIN_COMPENSATION_DISABLED */ + *rxDataFormat = ADI_ADRV903X_GAIN_COMPENSATION_DISABLED; + } /* End valid ORx Channel if block */ + + /* Otherwise, throw an error for invalid Rx channel */ + else { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for RxDataFormatSelectGet"); + return recoveryAction; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatFloatingPointGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_FloatingPointConfigSettings_t * const floatingPointConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDdcChanAddr_e baseAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + + adrv903x_Bf_RxDdc_FpRoundMode_e fpRoundModeBf = ADRV903X_BF_RX_DDC_FP_ROUND_MODE_ROUNDTIESTOEVEN; + uint8_t fpDataFormatBf = 0U; + uint8_t fpEncodeNanBf = 0U; + adrv903x_Bf_RxDdc_FpExponentBits_e fpNumExpBitsBf = ADRV903X_BF_RX_DDC_FP_EXPONENT_BITS_RX1_EXP_2; + uint8_t fpHideLeadingOneBf = 0U; + uint8_t fpAttenStepsBf = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, floatingPointConfig); + + /* Check that the requested rxChannel is valid*/ + switch( rxChannel ) + { + case ADI_ADRV903X_RX0: + case ADI_ADRV903X_RX1: + case ADI_ADRV903X_RX2: + case ADI_ADRV903X_RX3: + case ADI_ADRV903X_RX4: + case ADI_ADRV903X_RX5: + case ADI_ADRV903X_RX6: + case ADI_ADRV903X_RX7: + { + /* Get Rx DDC Bitfield Address */ + recoveryAction = adrv903x_RxDdcBitfieldAddressGet( device, + rxChannel, + ADI_ADRV903X_RX_DDC_BAND0, + &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx DDC base address"); + return recoveryAction; + } + + /* Get bitfield values */ + recoveryAction = adrv903x_RxDdc_FpRoundMode_BfGet(device, + NULL, + baseAddr, + &fpRoundModeBf); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "FpRoundMode readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_FpFloatDataFormat_BfGet(device, + NULL, + baseAddr, + &fpDataFormatBf); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "FpFloatDataFormat readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_FpNanEncEn_BfGet(device, + NULL, + baseAddr, + &fpEncodeNanBf); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "FpNanEncEn readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_FpExponentBits_BfGet(device, + NULL, + baseAddr, + &fpNumExpBitsBf); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "FpExponentBits readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_FpHideLeadingOnes_BfGet(device, + NULL, + baseAddr, + &fpHideLeadingOneBf); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "FpHideLeadingOnes readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_FpIntDataAtten_BfGet(device, + NULL, + baseAddr, + &fpAttenStepsBf); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "FpIntDataAtten readback issue"); + return recoveryAction; + } + + break; + } + + case ADI_ADRV903X_ORX0: + case ADI_ADRV903X_ORX1: + /* Do nothing */ + break; + + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for RxDataFormatFloatingPointGet read"); + return recoveryAction; + } + + /* Update the structure with read back data */ + floatingPointConfig->fpRoundMode = (adi_adrv903x_FpRoundModes_e)fpRoundModeBf; + floatingPointConfig->fpDataFormat = (adi_adrv903x_FpFloatDataFormat_e)fpDataFormatBf; + floatingPointConfig->fpEncodeNan = (adi_adrv903x_FpNanEncode_e)fpEncodeNanBf; + floatingPointConfig->fpNumExpBits = (adi_adrv903x_FpExponentModes_e)fpNumExpBitsBf; + floatingPointConfig->fpHideLeadingOne = (adi_adrv903x_FpHideLeadingOne_e)fpHideLeadingOneBf; + floatingPointConfig->fpAttenSteps = (adi_adrv903x_FpAttenSteps_e)fpAttenStepsBf; + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatIntegerGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_IntegerConfigSettings_t * const integerConfigSettings, + adi_adrv903x_SlicerConfigSettings_t * const slicerConfigSettings) +{ + static const uint8_t INT_DATA_FORMAT_2S_COMPLEMENT = 0U; + static const uint8_t INT_DATA_RESOLUTION_16BITS = 1U; + static const uint8_t INT_EMBED_SLICER_DISABLE = 0U; + static const uint8_t INT_EMBED_SLICER_POS_MSB = 0U; + static const uint8_t INT_EMBED_SLICER_2_BITS = 0U; + static const uint8_t INT_PARTIY_SUPPORT_DISABLE = 0U; + static const uint8_t INT_PARITY_EVEN = 0U; + static const uint8_t SLICER_PIN_CTRL_MODE_INTERNAL = 0U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDdcChanAddr_e baseAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + adrv903x_BfOrxDigChanAddr_e orxDigBaseAddr = (adrv903x_BfOrxDigChanAddr_e) 0U; + uint8_t slicerBit = 0U; + + /* Preset local variables to default settings */ + uint8_t intEvenParity = INT_PARITY_EVEN; + uint8_t intParitySupport = INT_PARTIY_SUPPORT_DISABLE; + uint8_t intEmbedSlicerNumber = INT_EMBED_SLICER_2_BITS; + uint8_t intEmbedSlicerPos = INT_EMBED_SLICER_POS_MSB; + uint8_t intEmbedSlicer = INT_EMBED_SLICER_DISABLE; + uint8_t intDataResolution = INT_DATA_RESOLUTION_16BITS; + uint8_t intDataFormat = INT_DATA_FORMAT_2S_COMPLEMENT; + uint8_t slicerPinCtrlMode = SLICER_PIN_CTRL_MODE_INTERNAL; + uint8_t extSlicerStepSize = 0U; + uint8_t intSlicerStepSize = 0U; + uint8_t intSlicerLsbOnQ = 0U; + + adi_adrv903x_GpioPinSel_e intSlicerPins[ADI_ADRV903X_MAX_RX_INT_SLICER_BITS] = { + ADI_ADRV903X_GPIO_INVALID, + ADI_ADRV903X_GPIO_INVALID, + ADI_ADRV903X_GPIO_INVALID, + ADI_ADRV903X_GPIO_INVALID + }; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, integerConfigSettings); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, slicerConfigSettings); + + /* Check if the requested rxChannel is a RX Channel. */ + if ((rxChannel == ADI_ADRV903X_RX0) || + (rxChannel == ADI_ADRV903X_RX1) || + (rxChannel == ADI_ADRV903X_RX2) || + (rxChannel == ADI_ADRV903X_RX3) || + (rxChannel == ADI_ADRV903X_RX4) || + (rxChannel == ADI_ADRV903X_RX5) || + (rxChannel == ADI_ADRV903X_RX6) || + (rxChannel == ADI_ADRV903X_RX7) ) + { + + /* Get Rx DDC Bitfield Address. Band0 only and assume all other bands are equivalent */ + recoveryAction = adrv903x_RxDdcBitfieldAddressGet( device, + rxChannel, + ADI_ADRV903X_RX_DDC_BAND0, + &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx DDC base address"); + return recoveryAction; + } + + /* Get bitfield values */ + recoveryAction = adrv903x_RxDdc_IntDataFormat_BfGet(device, + NULL, + baseAddr, + &intDataFormat); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntDataFormat Readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntDataResolution_BfGet(device, + NULL, + baseAddr, + &intDataResolution); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntDataResolution Readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntEmbedSlicer_BfGet(device, + NULL, + baseAddr, + &intEmbedSlicer); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntEmbedSlicer Readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntEmbedSlicerPos_BfGet(device, + NULL, + baseAddr, + &intEmbedSlicerPos); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntEmbedSlicerPos Readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntEmbedSlicerNumber_BfGet(device, + NULL, + baseAddr, + &intEmbedSlicerNumber); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntEmbedSlicerNumber Readback issue"); + return recoveryAction; + } + + + recoveryAction = adrv903x_RxDdc_IntParitySupport_BfGet(device, + NULL, + baseAddr, + &intParitySupport); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntParitySupport Readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntEvenParity_BfGet(device, + NULL, + baseAddr, + &intEvenParity); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntEvenParity Readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_SlicerPinControlMode_BfGet(device, + NULL, + baseAddr, + &slicerPinCtrlMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SlicerPinControlMode Readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_ExternalSlicerPinControlStep_BfGet(device, + NULL, + baseAddr, + &extSlicerStepSize); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "ExternalSlicerPinControlStep Readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_SlicerPinControlStep_BfGet(device, + NULL, + baseAddr, + &intSlicerStepSize); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SlicerPinControlStep Readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxDdc_IntSlicerLsbOnQ_BfGet(device, + NULL, + baseAddr, + &intSlicerLsbOnQ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntSlicerLsbOnQ Readback issue"); + return recoveryAction; + } + + + /* Find GPIOs being used for Rx Internal Slicer bits */ + for(slicerBit = 0U ; slicerBit < ADI_ADRV903X_MAX_RX_INT_SLICER_BITS ; slicerBit++) + { + recoveryAction = adrv903x_GpioSignalFind( device, + &intSlicerPins[slicerBit], + adrv903x_RxInternalSlicerOutputSignals[slicerBit], + (adi_adrv903x_Channels_e)rxChannel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error finding previous GPIO that was routing Rx Internal Slicer Word bit."); + return recoveryAction; + } + } + + /* Get chanIdx from the valid rxChannel enum */ + switch (rxChannel) + { + case ADI_ADRV903X_RX0: /* Fall through */ + case ADI_ADRV903X_RX1: /* Fall through */ + case ADI_ADRV903X_RX2: /* Fall through */ + case ADI_ADRV903X_RX3: /* Fall through */ + case ADI_ADRV903X_RX4: /* Fall through */ + case ADI_ADRV903X_RX5: /* Fall through */ + case ADI_ADRV903X_RX6: /* Fall through */ + case ADI_ADRV903X_RX7: /* Fall through */ + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for RxDataFormatIntegerGet"); + return recoveryAction; + } + + /* Populate struct fields with values */ + + /* Store internal slicer step size into intSlicerStepSize field of slicer config settings struct */ + slicerConfigSettings->intSlicerStepSize = (adi_adrv903x_IntSlicerStepSizes_e)intSlicerStepSize; + + /* Store external slicer step size in slicerConfigSettings struct */ + slicerConfigSettings->extSlicerStepSize = (adi_adrv903x_ExtSlicerStepSizes_e)extSlicerStepSize; + + /* Store internal slicer word GPIOs*/ + for (slicerBit = 0U; slicerBit < ADI_ADRV903X_MAX_RX_INT_SLICER_BITS; slicerBit++) + { + slicerConfigSettings->intSlicerGpioSelect[slicerBit] = intSlicerPins[slicerBit]; + } + + /* Store external slicer control GPIOs. Not supported so the results are static */ + slicerConfigSettings->extSlicerGpioSelect = ADI_ADRV903X_EXTSLICER_RX_GPIO_DISABLE; + + + /* Encode embedded slicer config and store in integer config settings struct */ + recoveryAction = adrv903x_RxIntEmbSlicerConfigEncode( device, + rxChannel, + intEmbedSlicer, + intEmbedSlicerPos, + intEmbedSlicerNumber, + &integerConfigSettings->intEmbeddedBits); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to encode integer embedded slicer settings"); + return recoveryAction; + } + + /* Encode parity config and store in integer config settings struct */ + recoveryAction = adrv903x_RxIntParitySupportEncode( device, + rxChannel, + intParitySupport, + intEvenParity, + &integerConfigSettings->intParity); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to encode integer parity settings"); + return recoveryAction; + } + + /* Store embedded slicer position into the intEmbeddedPos field of integer config settings struct */ + integerConfigSettings->intEmbeddedPos = (adi_adrv903x_RxSlicerEmbeddedPos_e)intSlicerLsbOnQ; + + + } /* end of Rx Channel if block */ + + /* Check if the requested rxChannel is an ORx Channel. */ + else if((rxChannel == ADI_ADRV903X_ORX0) || + (rxChannel == ADI_ADRV903X_ORX1)) + { + + /* Get ORxDig base address for this channel */ + recoveryAction = adrv903x_OrxBitfieldAddressGet( device, + rxChannel, + &orxDigBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve ORx Dig base address"); + return recoveryAction; + } + + /* Get bitfield values */ + recoveryAction = adrv903x_OrxDig_IntDataFormat_BfGet(device, + NULL, + orxDigBaseAddr, + &intDataFormat); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntDataFormat Readback issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_OrxDig_IntDataResolution_BfGet(device, + NULL, + orxDigBaseAddr, + &intDataResolution); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "IntDataResolution Readback issue"); + return recoveryAction; + } + + /* set default values in unused fields for ORx channels */ + slicerConfigSettings->extSlicerStepSize = ADI_ADRV903X_EXTSLICER_STEPSIZE_1DB; + slicerConfigSettings->intSlicerStepSize = ADI_ADRV903X_INTSLICER_STEPSIZE_1DB; + integerConfigSettings->intEmbeddedBits = ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS; + integerConfigSettings->intParity = ADI_ADRV903X_3BIT_SLICER_EVEN_PARITY; + integerConfigSettings->intEmbeddedPos = ADI_ADRV903X_LOWER_NIBBLE_ON_I; + + } /* End of ORx channel if block */ + + /* If rxChannel is not valid, throw an error */ + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for RxDataFormatIntegerGet"); + return recoveryAction; + } + + + + /* Encode the integer sample resolution and format and store in the integer config settings struct */ + /* Note: For both Rx and ORx (if ORx is eventually added here) */ + recoveryAction = adrv903x_RxIntSampleResFormatEncode( device, + intDataResolution, + intDataFormat, + &integerConfigSettings->intSampleResolution); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to encode integer sample resolution format"); + return recoveryAction; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxDataFormatEmbOvldMonitorGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_EmbOverloadMonitorConfigSettings_t* const embOvldConfigSettings) +{ + static const uint8_t LSB_POS_I_CHANNEL_ID = 0U; + static const uint8_t LSB_PLUS_ONE_POS_I_CHANNEL_ID = 1U; + static const uint8_t LSB_POS_Q_CHANNEL_ID = 0U; + static const uint8_t LSB_PLUS_ONE_POS_Q_CHANNEL_ID = 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e funcsAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + adrv903x_BfRxDdcChanAddr_e ddcAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + uint8_t apdHighSrcRegVal = 0U; + uint8_t apdLowSrcRegVal = 0U; + uint8_t hb2HighSrcRegVal = 0U; + uint8_t hb2LowSrcRegVal = 0U; + uint8_t invertHb2Flag = 0U; + uint8_t invertApdFlag = 0U; + uint8_t lsbIMonSrcRegVal = 0U; + uint8_t lsbQMonSrcRegVal = 0U; + uint8_t lsbPlusOneIMonSrcRegVal = 0U; + uint8_t lsbPlusOneQMonSrcRegVal = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, embOvldConfigSettings); + + /* Check that the requested rxChannel is valid*/ + switch( rxChannel ) + { + case ADI_ADRV903X_RX0: + case ADI_ADRV903X_RX1: + case ADI_ADRV903X_RX2: + case ADI_ADRV903X_RX3: + case ADI_ADRV903X_RX4: + case ADI_ADRV903X_RX5: + case ADI_ADRV903X_RX6: + case ADI_ADRV903X_RX7: + { + /* Get Rx Funcs Bitfield Address */ + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet( device, + rxChannel, + &funcsAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx Funcs base address"); + return recoveryAction; + } + + /* Get Rx DDC Bitfield Address */ + recoveryAction = adrv903x_RxDdcBitfieldAddressGet( device, + rxChannel, + ADI_ADRV903X_RX_DDC_BAND0, + &ddcAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx DDC base address"); + return recoveryAction; + } + + /* Get bitfield values */ + + /* Get the APD High Threshold exceeded indicator source */ + recoveryAction = adrv903x_RxFuncs_ApdHighSrcSelect_BfGet(device, + NULL, + funcsAddr, + &apdHighSrcRegVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "ApdHighSrcSelect readback issue"); + return recoveryAction; + } + + /* Get the APD Low Threshold exceeded indicator source */ + recoveryAction = adrv903x_RxFuncs_ApdLowSrcSelect_BfGet(device, + NULL, + funcsAddr, + &apdLowSrcRegVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "ApdLowSrcSelect readback issue"); + return recoveryAction; + } + + /* Get the HB2 High Threshold exceeded indicator source */ + recoveryAction = adrv903x_RxFuncs_Hb2HighSrcSelect_BfGet(device, + NULL, + funcsAddr, + &hb2HighSrcRegVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Hb2HighSrcSelect readback issue"); + return recoveryAction; + } + + /* Get the HB2 Low Threshold exceeded indicator source */ + recoveryAction = adrv903x_RxFuncs_Hb2LowSrcSelect_BfGet(device, + NULL, + funcsAddr, + &hb2LowSrcRegVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Hb2LowSrcSelect readback issue"); + return recoveryAction; + } + + /* Get invert Hb2 flag config */ + recoveryAction = adrv903x_RxFuncs_InvertHb2Low_BfGet(device, + NULL, + funcsAddr, + &invertHb2Flag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while reading invert Hb2 Flag configuration"); + return recoveryAction; + } + + /* Get invert Apd flag config */ + recoveryAction = adrv903x_RxFuncs_InvertApdLow_BfGet(device, + NULL, + funcsAddr, + &invertApdFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while reading invert Apd Flag configuration"); + return recoveryAction; + } + + /* Get I Sample LSB Posn Embedded overload indicator config */ + recoveryAction = adrv903x_RxDdc_RxMonFormatI_BfGet(device, + NULL, + ddcAddr, + LSB_POS_I_CHANNEL_ID, + &lsbIMonSrcRegVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxMonFormatI_0 readback issue"); + return recoveryAction; + } + + /* Get I Sample LSB + 1 Posn Embedded overload indicator config */ + recoveryAction = adrv903x_RxDdc_RxMonFormatI_BfGet(device, + NULL, + ddcAddr, + LSB_PLUS_ONE_POS_I_CHANNEL_ID, + &lsbPlusOneIMonSrcRegVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxMonFormatI_1 readback issue"); + return recoveryAction; + } + + + /* Get Q Sample LSB Posn Embedded overload indicator config */ + recoveryAction = adrv903x_RxDdc_RxMonFormatQ_BfGet(device, + NULL, + ddcAddr, + LSB_POS_Q_CHANNEL_ID, + &lsbQMonSrcRegVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxMonFormatQ_0 readback issue"); + return recoveryAction; + } + + /* Get Q Sample LSB + 1 Posn Embedded overload indicator config */ + recoveryAction = adrv903x_RxDdc_RxMonFormatQ_BfGet(device, + NULL, + ddcAddr, + LSB_PLUS_ONE_POS_Q_CHANNEL_ID, + &lsbPlusOneQMonSrcRegVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxMonFormatQ_1 readback issue"); + return recoveryAction; + } + + break; + } + + case ADI_ADRV903X_ORX0: + case ADI_ADRV903X_ORX1: + /* Do nothing */ + break; + + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for RxDataFormatEmbOvldMonitorGet read"); + return recoveryAction; + } + + /* Update the pointer to embOvldConfigSettings with data retrieved from the device */ + embOvldConfigSettings->embeddedMonitorApdHighSrcSel = (adi_adrv903x_RxApdHighEmbeddedMonitorSrc_e)apdHighSrcRegVal; + embOvldConfigSettings->embeddedMonitorApdLowSrcSel = (adi_adrv903x_RxApdLowEmbeddedMonitorSrc_e)apdLowSrcRegVal; + embOvldConfigSettings->embeddedMonitorHb2HighSrcSel = (adi_adrv903x_RxHb2HighEmbeddedMonitorSrc_e)hb2HighSrcRegVal; + embOvldConfigSettings->embeddedMonitorHb2LowSrcSel = (adi_adrv903x_RxHb2LowEmbeddedMonitorSrc_e)hb2LowSrcRegVal; + embOvldConfigSettings->invertHb2Flag = invertHb2Flag; + embOvldConfigSettings->invertApdFlag = invertApdFlag; + embOvldConfigSettings->embeddedMonitorSrcLsbI = (adi_adrv903x_RxEmbeddedMonitorSrc_e)lsbIMonSrcRegVal; + embOvldConfigSettings->embeddedMonitorSrcLsbQ = (adi_adrv903x_RxEmbeddedMonitorSrc_e)lsbQMonSrcRegVal; + embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneI = (adi_adrv903x_RxEmbeddedMonitorSrc_e)lsbPlusOneIMonSrcRegVal; + embOvldConfigSettings->embeddedMonitorSrcLsbPlusOneQ = (adi_adrv903x_RxEmbeddedMonitorSrc_e)lsbPlusOneQMonSrcRegVal; + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainCompExtLnaGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint8_t * const externalLnaGain) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDdcChanAddr_e baseAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + uint8_t tmpRead = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, externalLnaGain); + + switch (rxChannel) + { + /* Check if the requested rxChannel is a valid Rx Channel */ + case ADI_ADRV903X_RX0: + case ADI_ADRV903X_RX1: + case ADI_ADRV903X_RX2: + case ADI_ADRV903X_RX3: + case ADI_ADRV903X_RX4: + case ADI_ADRV903X_RX5: + case ADI_ADRV903X_RX6: + case ADI_ADRV903X_RX7: + { + /* Get Rx DDC Bitfield Address. Band0 only and assume all other bands are equivalent */ + recoveryAction = adrv903x_RxDdcBitfieldAddressGet( device, + rxChannel, + ADI_ADRV903X_RX_DDC_BAND0, + &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx DDC base address"); + return recoveryAction; + } + + /* Get bitfield */ + recoveryAction = adrv903x_RxDdc_GainCompForExtGain_BfGet(device, + NULL, + baseAddr, + &tmpRead); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GainCompForExtGain Read issue"); + return recoveryAction; + } + + /* Set return value based on bitfield readback value */ + *externalLnaGain = tmpRead ? ADI_ENABLE : ADI_DISABLE; + + break; + } + + /* Check if the requested rxChannel is a valid ORx Channel */ + case ADI_ADRV903X_ORX0: + case ADI_ADRV903X_ORX1: + /* Set return value to ADI_DISABLE */ + *externalLnaGain = ADI_DISABLE; + break; + + /* Otherwise throw an error */ + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for RxGainCompExtLnaGet"); + return recoveryAction; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainCompTempEnableGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint8_t * const tempCompensationEnable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDdcChanAddr_e baseAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + uint8_t tmpRead = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, tempCompensationEnable); + + switch (rxChannel) + { + /* Check if the requested rxChannel is a valid Rx Channel */ + case ADI_ADRV903X_RX0: + case ADI_ADRV903X_RX1: + case ADI_ADRV903X_RX2: + case ADI_ADRV903X_RX3: + case ADI_ADRV903X_RX4: + case ADI_ADRV903X_RX5: + case ADI_ADRV903X_RX6: + case ADI_ADRV903X_RX7: + { + /* Get Rx DDC Bitfield Address. Band0 only and assume all other bands are equivalent */ + recoveryAction = adrv903x_RxDdcBitfieldAddressGet( device, + rxChannel, + ADI_ADRV903X_RX_DDC_BAND0, + &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx DDC base address"); + return recoveryAction; + } + + /* Get bitfield */ + recoveryAction = adrv903x_RxDdc_GainCompForTempGain_BfGet(device, + NULL, + baseAddr, + &tmpRead); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GainCompForTempGain Read issue"); + return recoveryAction; + } + + /* Set return value based on bitfield readback value */ + *tempCompensationEnable = tmpRead ? ADI_ENABLE : ADI_DISABLE; + + break; + } + + /* Check if the requested rxChannel is a valid ORx Channel */ + case ADI_ADRV903X_ORX0: + case ADI_ADRV903X_ORX1: + /* Set return value to ADI_DISABLE */ + *tempCompensationEnable = ADI_DISABLE; + break; + + /* Otherwise throw an error */ + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for RxGainCompTempEnableGet"); + return recoveryAction; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxInternalSlicerGpioEnableGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxDataFormatModes_e * const intSlicerFormatSel, + uint8_t * const enableStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t slicerBit = 0U; + adi_adrv903x_GpioPinSel_e foundPins[ADI_ADRV903X_MAX_RX_INT_SLICER_BITS] = { + ADI_ADRV903X_GPIO_INVALID, + ADI_ADRV903X_GPIO_INVALID, + ADI_ADRV903X_GPIO_INVALID, + ADI_ADRV903X_GPIO_INVALID + }; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intSlicerFormatSel); + + /* Check that the requested rxChannel is valid. ORx not allowed */ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for RxInternalSlicerGpioEnableGet read"); + return recoveryAction; + } + + + /* Search for each slicerBit signal for this channel on any GPIO */ + for (slicerBit = 0U; slicerBit < ADI_ADRV903X_MAX_RX_INT_SLICER_BITS; slicerBit++) + { + recoveryAction = adrv903x_GpioSignalFind( device, + &foundPins[slicerBit], + adrv903x_RxInternalSlicerOutputSignals[slicerBit], + (adi_adrv903x_Channels_e)rxChannel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error finding previous GPIO that was routing Rx Internal Slicer Word bit."); + return recoveryAction; + } + } + + /* If bits[3:0] found, currently in 4pin mode */ + if ((foundPins[3U] != ADI_ADRV903X_GPIO_INVALID) && + (foundPins[2U] != ADI_ADRV903X_GPIO_INVALID) && + (foundPins[1U] != ADI_ADRV903X_GPIO_INVALID) && + (foundPins[0U] != ADI_ADRV903X_GPIO_INVALID)) + { + *intSlicerFormatSel = ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE; + if (enableStatus != NULL) + { + *enableStatus = ADI_ENABLE; + } + } + + /* Else If bits[2:0] found, currently in 3pin mode */ + else if ((foundPins[2U] != ADI_ADRV903X_GPIO_INVALID) && + (foundPins[1U] != ADI_ADRV903X_GPIO_INVALID) && + (foundPins[0U] != ADI_ADRV903X_GPIO_INVALID)) + { + *intSlicerFormatSel = ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_3PIN_MODE; + if (enableStatus != NULL) + { + *enableStatus = ADI_ENABLE; + } + } + + /* Else If bits[1:0] found, currently in 2pin mode */ + else if((foundPins[1U] != ADI_ADRV903X_GPIO_INVALID) && + (foundPins[0U] != ADI_ADRV903X_GPIO_INVALID)) + { + *intSlicerFormatSel = ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2PIN_MODE; + if (enableStatus != NULL) + { + *enableStatus = ADI_ENABLE; + } + } + + /* Else, currently GAIN COMP DISABLED mode*/ + else + { + *intSlicerFormatSel = ADI_ADRV903X_GAIN_COMPENSATION_DISABLED; + if (enableStatus != NULL) + { + *enableStatus = ADI_DISABLE; + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxIntEmbSlicerConfigEncode(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint8_t intEmbedSlicer, + const uint8_t intEmbedSlicerPos, + const uint8_t intEmbedSlicerNumber, + adi_adrv903x_RxSlicerEmbeddedBits_e * const integerConfigSettingsEmbSlicer) +{ + static const uint8_t INT_EMBED_SLICER_DISABLE = 0U; + static const uint8_t INT_EMBED_SLICER_POS_MSB = 0U; + static const uint8_t INT_EMBED_SLICER_POS_LSB = 1U; + static const uint8_t INT_EMBED_SLICER_2_BITS = 0U; + static const uint8_t INT_EMBED_SLICER_1_BIT = 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, integerConfigSettingsEmbSlicer); + + /* Check that the requested rxChannel is valid. ORx not allowed */ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for RxIntEmbSlicerConfigEncode"); + return recoveryAction; + } + + + if (intEmbedSlicer == INT_EMBED_SLICER_DISABLE) + { + *integerConfigSettingsEmbSlicer = ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS; + } + else + { + if ((intEmbedSlicerPos == INT_EMBED_SLICER_POS_LSB) && + (intEmbedSlicerNumber == INT_EMBED_SLICER_1_BIT)) + { + *integerConfigSettingsEmbSlicer = ADI_ADRV903X_EMBED_1_SLICERBIT_AT_LSB; + } + else if ((intEmbedSlicerPos == INT_EMBED_SLICER_POS_MSB) && + (intEmbedSlicerNumber == INT_EMBED_SLICER_1_BIT)) + { + *integerConfigSettingsEmbSlicer = ADI_ADRV903X_EMBED_1_SLICERBIT_AT_MSB; + } + else if ((intEmbedSlicerPos == INT_EMBED_SLICER_POS_LSB) && + (intEmbedSlicerNumber == INT_EMBED_SLICER_2_BITS)) + { + if ((device->devStateInfo.rxChannel3bitSlicerMode & (uint8_t)rxChannel) == (uint8_t)rxChannel) + { + *integerConfigSettingsEmbSlicer = ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_3_BIT_SLICER; + } + else + { + *integerConfigSettingsEmbSlicer = ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_4_BIT_SLICER; + } + } + else if ((intEmbedSlicerPos == INT_EMBED_SLICER_POS_MSB) && + (intEmbedSlicerNumber == INT_EMBED_SLICER_2_BITS)) + { + if ((device->devStateInfo.rxChannel3bitSlicerMode & (uint8_t)rxChannel) == (uint8_t)rxChannel) + { + *integerConfigSettingsEmbSlicer = ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_3_BIT_SLICER; + } + else + { + *integerConfigSettingsEmbSlicer = ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_4_BIT_SLICER; + } + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + intEmbedSlicer, + "Invalid combination of embed slicer,pos,number combination encountered while attempting to encode integer embed slicer settings"); + return recoveryAction; + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CddcIntEmbSlicerConfigEncode(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint8_t intEmbedSlicer, + const uint8_t intEmbedSlicerPos, + const uint8_t intEmbedSlicerNumber, + adi_adrv903x_RxSlicerEmbeddedBits_e* const integerConfigSettingsEmbSlicer) +{ + static const uint8_t INT_EMBED_SLICER_DISABLE = 0U; + static const uint8_t INT_EMBED_SLICER_POS_MSB = 0U; + static const uint8_t INT_EMBED_SLICER_POS_LSB = 1U; + static const uint8_t INT_EMBED_SLICER_2_BITS = 0U; + static const uint8_t INT_EMBED_SLICER_1_BIT = 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, integerConfigSettingsEmbSlicer); + + /* Check that the requested rxChannel is valid. ORx not allowed */ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for RxIntEmbSlicerConfigEncode"); + return recoveryAction; + } + + + if (intEmbedSlicer == INT_EMBED_SLICER_DISABLE) + { + *integerConfigSettingsEmbSlicer = ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS; + } + else + { + if ((intEmbedSlicerPos == INT_EMBED_SLICER_POS_LSB) && + (intEmbedSlicerNumber == INT_EMBED_SLICER_1_BIT)) + { + *integerConfigSettingsEmbSlicer = ADI_ADRV903X_EMBED_1_SLICERBIT_AT_LSB; + } + else if ((intEmbedSlicerPos == INT_EMBED_SLICER_POS_MSB) && + (intEmbedSlicerNumber == INT_EMBED_SLICER_1_BIT)) + { + *integerConfigSettingsEmbSlicer = ADI_ADRV903X_EMBED_1_SLICERBIT_AT_MSB; + } + else if ((intEmbedSlicerPos == INT_EMBED_SLICER_POS_LSB) && + (intEmbedSlicerNumber == INT_EMBED_SLICER_2_BITS)) + { + *integerConfigSettingsEmbSlicer = ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_3_BIT_SLICER; + + } + else if ((intEmbedSlicerPos == INT_EMBED_SLICER_POS_MSB) && + (intEmbedSlicerNumber == INT_EMBED_SLICER_2_BITS)) + { + *integerConfigSettingsEmbSlicer = ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_3_BIT_SLICER; + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + intEmbedSlicer, + "Invalid combination of embed slicer,pos,number combination encountered while attempting to encode integer embed slicer settings"); + return recoveryAction; + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxIntSampleResFormatEncode(adi_adrv903x_Device_t * const device, + const uint8_t intDataResolution, + const uint8_t intDataFormat, + adi_adrv903x_RxIntSampleResolution_e * const intSampleResolution) +{ + static const uint8_t INT_DATA_FORMAT_2S_COMPLEMENT = 0U; + static const uint8_t INT_DATA_FORMAT_SIGNED_MAGNITUDE = 1U; + static const uint8_t INT_DATA_RESOLUTION_12BITS = 0U; + static const uint8_t INT_DATA_RESOLUTION_16BITS = 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, intSampleResolution); + + /* Map int resolution and format to intSampleResolution enum value */ + if ((intDataResolution == INT_DATA_RESOLUTION_12BITS) && + (intDataFormat == INT_DATA_FORMAT_2S_COMPLEMENT)) + { + *intSampleResolution = ADI_ADRV903X_INTEGER_12BIT_2SCOMP; + } + else if ((intDataResolution == INT_DATA_RESOLUTION_12BITS) && + (intDataFormat == INT_DATA_FORMAT_SIGNED_MAGNITUDE)) + { + *intSampleResolution = ADI_ADRV903X_INTEGER_12BIT_SIGNED; + } + else if ((intDataResolution == INT_DATA_RESOLUTION_16BITS) && + (intDataFormat == INT_DATA_FORMAT_2S_COMPLEMENT)) + { + *intSampleResolution = ADI_ADRV903X_INTEGER_16BIT_2SCOMP; + } + else if ((intDataResolution == INT_DATA_RESOLUTION_16BITS) && + (intDataFormat == INT_DATA_FORMAT_SIGNED_MAGNITUDE)) + { + *intSampleResolution = ADI_ADRV903X_INTEGER_16BIT_SIGNED; + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + intSampleResolution, + "Unexpected resolution and format values encountered while attempting to encode integer sample resolution settings"); + return recoveryAction; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxIntParitySupportEncode(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint8_t intParitySupport, + const uint8_t intEvenParity, + adi_adrv903x_RxIntParity_e * const integerParity) +{ + static const uint8_t INT_PARTIY_SUPPORT_DISABLE = 0U; + static const uint8_t INT_PARTIY_SUPPORT_ENABLE = 1U; + static const uint8_t INT_PARITY_EVEN = 0U; + static const uint8_t INT_PARITY_ODD = 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, integerParity); + + /* Check that the requested rxChannel is valid. ORx not allowed */ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for RxIntParitySupportEncode"); + return recoveryAction; + } + + /* Check inputs intParitySupport and intEventParity for valid values */ + if ((intParitySupport != INT_PARTIY_SUPPORT_DISABLE) && + (intParitySupport != INT_PARTIY_SUPPORT_ENABLE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + intParitySupport, + "Invalid intParitySupport value encountered while attempting to encode integer parity settings"); + return recoveryAction; + } + + if ((intEvenParity != INT_PARITY_EVEN) && + (intEvenParity != INT_PARITY_ODD)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + intEvenParity, + "Invalid intEvenParity value encountered while attempting to encode integer parity settings"); + return recoveryAction; + } + + /* Map int parity support and even/odd to integerParity enum value */ + if ((intParitySupport == INT_PARTIY_SUPPORT_ENABLE) && + (intEvenParity == INT_PARITY_ODD) && + ((device->devStateInfo.rxChannel3bitSlicerMode & (uint8_t)rxChannel) == (uint8_t)rxChannel)) + { + *integerParity = ADI_ADRV903X_3BIT_SLICER_ODD_PARITY; + } + else if ((intParitySupport == INT_PARTIY_SUPPORT_ENABLE) && + (intEvenParity == INT_PARITY_EVEN) && + ((device->devStateInfo.rxChannel3bitSlicerMode & (uint8_t)rxChannel) == (uint8_t)rxChannel)) + { + *integerParity = ADI_ADRV903X_3BIT_SLICER_EVEN_PARITY; + } + else + { + *integerParity = ADI_ADRV903X_NO_PARITY; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_CddcIntParitySupportEncode(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint8_t intParitySupport, + const uint8_t intEvenParity, + adi_adrv903x_RxIntParity_e* const integerParity) +{ + static const uint8_t INT_PARTIY_SUPPORT_DISABLE = 0U; + static const uint8_t INT_PARTIY_SUPPORT_ENABLE = 1U; + static const uint8_t INT_PARITY_EVEN = 0U; + static const uint8_t INT_PARITY_ODD = 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, integerParity); + + /* Check that the requested rxChannel is valid. ORx not allowed */ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for RxIntParitySupportEncode"); + return recoveryAction; + } + + /* Check inputs intParitySupport and intEventParity for valid values */ + if ((intParitySupport != INT_PARTIY_SUPPORT_DISABLE) && + (intParitySupport != INT_PARTIY_SUPPORT_ENABLE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + intParitySupport, + "Invalid intParitySupport value encountered while attempting to encode integer parity settings"); + return recoveryAction; + } + + if ((intEvenParity != INT_PARITY_EVEN) && + (intEvenParity != INT_PARITY_ODD)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + intEvenParity, + "Invalid intEvenParity value encountered while attempting to encode integer parity settings"); + return recoveryAction; + } + + /* Map int parity support and even/odd to integerParity enum value */ + if ((intParitySupport == INT_PARTIY_SUPPORT_ENABLE) && + (intEvenParity == INT_PARITY_ODD)) + + { + *integerParity = ADI_ADRV903X_3BIT_SLICER_ODD_PARITY; + } + else if ((intParitySupport == INT_PARTIY_SUPPORT_ENABLE) && + (intEvenParity == INT_PARITY_EVEN)) + { + *integerParity = ADI_ADRV903X_3BIT_SLICER_EVEN_PARITY; + } + else + { + *integerParity = ADI_ADRV903X_NO_PARITY; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxLoSourceGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_LoSel_e* const rxLoSource) +{ + static const uint8_t RX_LO_CURRENT_MASK = 0x01U; + uint8_t rxtxLoMuxReg = 0U; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxLoSource); + + if ((rxChannel == ADI_ADRV903X_RX0) || + (rxChannel == ADI_ADRV903X_RX1) || + (rxChannel == ADI_ADRV903X_RX2) || + (rxChannel == ADI_ADRV903X_RX3)) + { + /*Read the Rx Lo Mux reg from the east side of the chip */ + recoveryAction = adrv903x_PllMemMap_SelRxLo_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_EAST_RFPLL, + &rxtxLoMuxReg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to retrieve Rx Lo Selection."); + return recoveryAction; + } + + /*For East Side, 1 = LO0, 0 = LO1*/ + if ((rxtxLoMuxReg & RX_LO_CURRENT_MASK) == RX_LO_CURRENT_MASK) + { + *rxLoSource = ADI_ADRV903X_LOSEL_LO0; + } + else + { + *rxLoSource = ADI_ADRV903X_LOSEL_LO1; + } + } + else if ((rxChannel == ADI_ADRV903X_RX4) || + (rxChannel == ADI_ADRV903X_RX5) || + (rxChannel == ADI_ADRV903X_RX6) || + (rxChannel == ADI_ADRV903X_RX7)) + { + /*Read the Rx Lo Mux reg from the west side of the chip */ + recoveryAction = adrv903x_PllMemMap_SelRxLo_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_WEST_RFPLL, + &rxtxLoMuxReg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "PllMemMap_SelRxLo_Bfget issue"); + return recoveryAction; + } + + /*For West Side, 1 = LO1, 0 = LO0*/ + if ((rxtxLoMuxReg & RX_LO_CURRENT_MASK) == RX_LO_CURRENT_MASK) + { + *rxLoSource = ADI_ADRV903X_LOSEL_LO1; + } + else + { + *rxLoSource = ADI_ADRV903X_LOSEL_LO0; + } + + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, rxChannel, "Invalid Rx Channel parameter. Valid Rx channel must be Rx0-Rx7"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxMinMaxGainIndexSetRangeCheck(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint8_t minGainIndex, + const uint8_t maxGainIndex) +{ + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /*Check that rxChannelMask is valid*/ + if (rxChannelMask == ADI_ADRV903X_RXOFF) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannelMask, + "Invalid Rx Channel mask parameter. Valid Rx channel masks include Rx0-Rx7"); + return recoveryAction; + } + + if (rxChannelMask > ADI_ADRV903X_RX_MASK_ALL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannelMask, + "Invalid Rx Channel mask parameter. Valid Rx channel masks include Rx0-Rx7"); + return recoveryAction; + } + + /*Check that requested min gain index does not exceed max gain index*/ + if (minGainIndex >= maxGainIndex) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + minGainIndex, + "minGainIndex should be less than maxGainIndex"); + return recoveryAction; + } + + /*Check that requested min gain index is not less than the absolute min gain index possible for this device*/ +#if ADI_ADRV903X_MIN_GAIN_TABLE_INDEX > 0 + if(minGainIndex < ADI_ADRV903X_MIN_GAIN_TABLE_INDEX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + minGainIndex, + "minGainIndex should be greater than or equal to ADI_ADRV903X_MIN_GAIN_TABLE_INDEX"); + return recoveryAction; + } +#endif + /*Check that requested max gain index is not greater than the absolute max gain index possible for this device*/ +#if ADI_ADRV903X_MAX_GAIN_TABLE_INDEX < 255 + if(maxGainIndex > ADI_ADRV903X_MAX_GAIN_TABLE_INDEX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + maxGainIndex, + "maxGainIndex should be less than or equal to ADI_ADRV903X_MAX_GAIN_TABLE_INDEX"); + return recoveryAction; + } +#endif + return ADI_ADRV903X_ERR_ACT_NONE; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainTableWriteRangeCheck(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint8_t gainIndexOffset, + const adi_adrv903x_RxGainTableRow_t gainTableRow[], + const uint32_t arraySize) +{ + + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + const uint8_t MAX_EXT_CTRL_WORD = 3U; + const int16_t MIN_DIG_GAIN = -360; /*Dig gain is in the range -18dB to 50db*/ + const int16_t MAX_DIG_GAIN = 1000; /*Dig gain is in the range -18dB to 50db*/ + + uint32_t gainIndex = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, gainTableRow); + + + /*Check the no. of gain indices parameter is not 0*/ + if (arraySize == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + arraySize, + "arraySize parameter is 0. Valid values from 1 - 256"); + return recoveryAction; + } + + /*Check that the gain index offset is within range*/ +#if ADI_ADRV903X_MIN_RX_GAIN_TABLE_INDEX > 0 + if (gainIndexOffset < ADI_ADRV903X_MIN_RX_GAIN_TABLE_INDEX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + gainIndexOffset, + "Invalid gainIndexOffset. Parameter gainIndexOffset should be greater than ADI_ADRV903X_MIN_RX_GAIN_TABLE_INDEX"); + return recoveryAction; + } +#endif +#if ADI_ADRV903X_START_RX_GAIN_INDEX < 255 + if (gainIndexOffset > ADI_ADRV903X_START_RX_GAIN_INDEX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + gainIndexOffset, + "Invalid gainIndexOffset. Parameter gainIndexOffset should be smaller than ADI_ADRV903X_START_RX_GAIN_INDEX"); + return recoveryAction; + } +#endif + + /*Check the no. of gain indices parameter is valid*/ + if (arraySize > (uint32_t)((gainIndexOffset - ADI_ADRV903X_MIN_RX_GAIN_TABLE_INDEX) + 1U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + arraySize, + "gainTableRow arraySize exceeds the limit. Valid range ADI_ADRV903X_MIN_RX_GAIN_TABLE_INDEX to gainIndexOffset"); + return recoveryAction; + } + + /*Check that rxChannelMask is valid*/ + + if ((rxChannelMask == ADI_ADRV903X_RXOFF) || (rxChannelMask > ADI_ADRV903X_RX_MASK_ALL)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannelMask, + "Invalid Rx Channel mask parameter. Valid Rx channel masks include Rx0-Rx7"); + return recoveryAction; + } + + /*Check that if Rx gain table is required to be loaded, Rx Profile is valid*/ + if ((rxChannelMask & ADI_ADRV903X_RX_MASK_ALL) > 0) + { + if ((device->devStateInfo.profilesValid & ADI_ADRV903X_RX_PROFILE_VALID) == 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannelMask, + "Rx gain table selected for programming but Rx profile is invalid in device structure"); + return recoveryAction; + } + } + + /*Range check individual gain table row entries*/ + for (gainIndex = 0; gainIndex < arraySize; gainIndex++) + { + /*Check that EXT_CTRL is in the range {0,1,2,3}*/ + if (gainTableRow[gainIndex].extControl > MAX_EXT_CTRL_WORD) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gainTableRow[gainIndex].extControl, + "Rx Gain Table extControl parameter exceeds the limit. Allowed values are 0,1,2,3"); + return recoveryAction; + } + + /*Check that digital gain is in the range -18dB to 50dB*/ + if ((gainTableRow[gainIndex].digGain < MIN_DIG_GAIN) || + (gainTableRow[gainIndex].digGain > MAX_DIG_GAIN)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + gainTableRow[gainIndex].digGain, + "Rx Gain Table digGain parameter exceeds the limit. Allowed values between -18dB to 50dB(-360 to +1000)"); + return recoveryAction; + } + } + + return ADI_ADRV903X_ERR_ACT_NONE; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxGainTableReadRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint8_t gainIndexOffset, + const adi_adrv903x_RxGainTableRow_t gainTableRow[], + const uint32_t arraySize) +{ + + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, gainTableRow); + + + /*Check the no. of gain indices parameter is not 0*/ + if (arraySize == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + arraySize, + "arraySize parameter is 0. Valid values from 1 - 256"); + return recoveryAction; + } + + /*Check that the gain index offset is within range*/ +#if ADI_ADRV903X_MIN_RX_GAIN_TABLE_INDEX > 0 + if (gainIndexOffset < ADI_ADRV903X_MIN_RX_GAIN_TABLE_INDEX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + gainIndexOffset, + "Invalid gainIndexOffset. Parameter gainIndexOffset should be greater than ADI_ADRV903X_MIN_RX_GAIN_TABLE_INDEX"); + return recoveryAction; + } +#endif +#if ADI_ADRV903X_START_RX_GAIN_INDEX < 255 + if (gainIndexOffset > ADI_ADRV903X_START_RX_GAIN_INDEX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + gainIndexOffset, + "Invalid gainIndexOffset. Parameter gainIndexOffset should be smaller than ADI_ADRV903X_START_RX_GAIN_INDEX"); + return recoveryAction; + } +#endif + + /*Check the no. of gain indices parameter is valid*/ + if (arraySize > (uint32_t)((gainIndexOffset - ADI_ADRV903X_MIN_RX_GAIN_TABLE_INDEX) + 1U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + arraySize, + "gainTableRow arraySize exceeds the limit. Valid range ADI_ADRV903X_MIN_RX_GAIN_TABLE_INDEX to gainIndexOffset"); + return recoveryAction; + } + + /*Check that the requested rxChannel is valid*/ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7) ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested.Valid Rx channels include Rx0-Rx7"); + return recoveryAction; + } + + return ADI_ADRV903X_ERR_ACT_NONE; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_DecPowerCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxDecimatedPowerCfg_t* const decPowerCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, decPowerCfg); + + static const uint8_t MAX_POWER_INPUT_SELECT = 3U; + static const uint8_t MAX_MEASUREMENT_DURATION = 31U; + uint32_t ALL_DEC_POWER_SELECT = (uint32_t)ADI_ADRV903X_DEC_POWER_MAIN_PATH_MEAS_BLOCK | + (uint32_t)ADI_ADRV903X_DEC_POWER_BAND_A_MEAS_BLOCK | + (uint32_t)ADI_ADRV903X_DEC_POWER_BAND_B_MEAS_BLOCK; + + if (((decPowerCfg->rxChannelMask & (~(uint32_t)ADI_ADRV903X_RX_MASK_ALL)) != 0U) || (decPowerCfg->rxChannelMask == (uint32_t)ADI_ADRV903X_RXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->rxChannelMask, + "Invalid Rx channel is selected. Valid values are any combinations of Rx0/1/2/3/4/5/6/7"); + return recoveryAction; + } + + if ((decPowerCfg->decPowerControl != ADI_ADRV903X_DEC_POWER_MEAS_OFF) && + (decPowerCfg->decPowerControl != ADI_ADRV903X_DEC_POWER_MEAS_ON) && + (decPowerCfg->decPowerControl != ADI_ADRV903X_DEC_POWER_AGC_MEAS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->decPowerControl, + "Invalid decPowerControl selection."); + return recoveryAction; + } + + if (decPowerCfg->powerInputSelect > MAX_POWER_INPUT_SELECT) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->powerInputSelect, + "Invalid powerInputSelect selection."); + return recoveryAction; + } + + if (((decPowerCfg->measBlockSelectMask & (~(uint8_t)ALL_DEC_POWER_SELECT)) != 0U) || + (decPowerCfg->measBlockSelectMask == 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->measBlockSelectMask, + "Invalid measBlockSelectMask is selected."); + return recoveryAction; + } + + if (decPowerCfg->powerMeasurementDuration > MAX_MEASUREMENT_DURATION) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->powerMeasurementDuration, + "Invalid powerMeasurementDuration selection."); + return recoveryAction; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_OrxDecPowerCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_ORxDecimatedPowerCfg_t* const decPowerCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, decPowerCfg); + + static const uint8_t ENABLE_MAX = 1U; + static const uint8_t MAX_POWER_INPUT_SELECT = 2U; + static const uint8_t MAX_MEASUREMENT_DURATION = 21U; + + if (((decPowerCfg->orxChannelMask & (~(uint32_t)ADI_ADRV903X_ORX_MASK_ALL)) != 0U) || (decPowerCfg->orxChannelMask == (uint32_t)ADI_ADRV903X_RXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->orxChannelMask, + "Invalid ORx channel is selected. Valid values are any combinations of ORx0/1"); + return recoveryAction; + } + + if (decPowerCfg->measurementEnable > ENABLE_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->measurementEnable, + "Invalid measurementEnable selection."); + return recoveryAction; + } + + if (decPowerCfg->powerInputSelect > MAX_POWER_INPUT_SELECT) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->powerInputSelect, + "Invalid powerInputSelect selection."); + return recoveryAction; + } + + if (decPowerCfg->powerMeasurementDuration > MAX_MEASUREMENT_DURATION) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->powerMeasurementDuration, + "Invalid powerMeasurementDuration selection."); + return recoveryAction; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxHb2OverloadCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint8_t enableHb2Overload, + uint8_t hb2OverloadSignalSelection, + uint8_t hb2OverloadPowerMode) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + static const uint8_t MAX_HB2_CFG_INPUT = 1U; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + static const uint64_t HB2_OVERLOAD_USE_RIN = 0x90; + static const uint32_t HB2_OVERLOAD_USE_RIN_MASK = 1U << 24; + + static const uint32_t HB2_OVERLOAD_USE_RIN_ENABLE = 1U << 24; + static const uint32_t HB2_OVERLOAD_USE_RIN_DISABLE = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + /* Invalid Rx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx channel selection"); + return recoveryAction; + } + + if (enableHb2Overload > MAX_HB2_CFG_INPUT) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + enableHb2Overload, + "Invalid enableHb2Overload selection."); + return recoveryAction; + } + + if (hb2OverloadSignalSelection >= (uint8_t) ADI_ADRV903X_MAX_SIG_MON_SRC_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + hb2OverloadSignalSelection, + "Invalid hb2OverloadSignalSelection selection."); + return recoveryAction; + } + + if (hb2OverloadPowerMode > MAX_HB2_CFG_INPUT) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + hb2OverloadPowerMode, + "Invalid hb2OverloadPowerMode selection."); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, rxChannel, &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx Channel used to determine rx func address"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_OverloadEnAgc_BfSet(device, NULL, rxFuncsBaseAddr, enableHb2Overload); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write hb2 enable bit"); + return recoveryAction; + } + + + if (hb2OverloadSignalSelection == (uint8_t) ADI_ADRV903X_SIG_MON_SRC_DEC3_INPUT) + { + if (device->devStateInfo.deviceSiRev >= 0xB0) + { + //write the new bf set for Palao B0 (hb2_overload_use_rin) + recoveryAction = adi_adrv903x_Register32Write(device, + NULL, + rxFuncsBaseAddr+HB2_OVERLOAD_USE_RIN, + HB2_OVERLOAD_USE_RIN_ENABLE, + HB2_OVERLOAD_USE_RIN_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write DEC3 input selection bit"); + return recoveryAction; + } + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, hb2OverloadSignalSelection, "SiRev does not support DEC3 selection"); + return recoveryAction; + } + } + else + { + recoveryAction = adrv903x_RxFuncs_Hb2OverloadUseHb2In_BfSet(device, NULL, rxFuncsBaseAddr, hb2OverloadSignalSelection); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write hb2 input selection bit"); + return recoveryAction; + } + /* Set hb2_overload_use_rin to 0 */ + recoveryAction = adi_adrv903x_Register32Write(device, + NULL, + rxFuncsBaseAddr+HB2_OVERLOAD_USE_RIN, + HB2_OVERLOAD_USE_RIN_DISABLE, + HB2_OVERLOAD_USE_RIN_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write HB2 input selection bit"); + return recoveryAction; + } + } + + recoveryAction = adrv903x_RxFuncs_OverloadPowerModeAgc_BfSet(device, NULL, rxFuncsBaseAddr, hb2OverloadPowerMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write hb2 power mode bit"); + return recoveryAction; + } + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_RxHb2OverloadCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint8_t * const enableHb2Overload, + uint8_t * const hb2OverloadSignalSelection, + uint8_t * const hb2OverloadPowerMode) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + static const uint64_t overload_config_addr = 0x90; + static const uint32_t HB2_OVERLOAD_USE_RIN_MASK = 1U << 24; + uint32_t hb2_overload_use_rin = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, enableHb2Overload); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, hb2OverloadSignalSelection); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, hb2OverloadPowerMode); + + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + /* Invalid Rx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx channel selection"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, rxChannel, &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx Channel used to determine rx func address"); + return recoveryAction; + } + + recoveryAction = adrv903x_RxFuncs_OverloadEnAgc_BfGet(device, NULL, rxFuncsBaseAddr, enableHb2Overload); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read hb2 enable bit"); + return recoveryAction; + } + + if ((device->devStateInfo.deviceSiRev & 0xF0U) >= 0xB0U) + { + /* Write the new bf set for Palao B0 (hb2_overload_use_rin) */ + recoveryAction = adi_adrv903x_Register32Read(device, + NULL, + rxFuncsBaseAddr + overload_config_addr, + &hb2_overload_use_rin, + HB2_OVERLOAD_USE_RIN_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read hb2_overload_use_rin bit"); + return recoveryAction; + } + if (hb2_overload_use_rin == HB2_OVERLOAD_USE_RIN_MASK) + { + *hb2OverloadSignalSelection = 2U; + } + else + { + recoveryAction = adrv903x_RxFuncs_Hb2OverloadUseHb2In_BfGet(device, NULL, rxFuncsBaseAddr, hb2OverloadSignalSelection); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read hb2 input selection bit"); + return recoveryAction; + } + } + } + else + { + recoveryAction = adrv903x_RxFuncs_Hb2OverloadUseHb2In_BfGet(device, NULL, rxFuncsBaseAddr, hb2OverloadSignalSelection); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read hb2 input selection bit"); + return recoveryAction; + } + } + + recoveryAction = adrv903x_RxFuncs_OverloadPowerModeAgc_BfGet(device, NULL, rxFuncsBaseAddr, hb2OverloadPowerMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read hb2 power mode bit"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_ORxAttenDbToRegValues(adi_adrv903x_Device_t* const device, + const uint8_t attenDb, + uint8_t* const trmAtten, + uint8_t* const trmAttenBwCapEn) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, trmAtten); + + /* Requested ORx atten to bitfield value mappings */ + /* TODO - yoda provides a mapping from attenDb to corresponding trmAtten bitfield value by way of the adrv903x_Bf_ActrlOrxWestRegmap_TrmAtten_e enumeration. + * Unfortunately that mapping is currently incorrect. See TPGRADSWL-10152. */ + + /* NOTE: The FW has these LUTs too. So, any LUT changes must be made in both places. */ + const uint8_t orxAttenDbToTrmAtten[ADI_ADRV903X_MAX_ORX_ATTEN_DB + 1] = {0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x08, 0x09, + 0x0A, 0x0B, 0x0C, 0x0D, + 0x10, 0x11, 0x12, 0x13, + 0x14, 0x15}; + const uint8_t orxAttenDbToTrmAttenBwCapEn[ADI_ADRV903X_MAX_ORX_ATTEN_DB + 1] = {0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, + 0x0F, 0x0F, 0x0F, 0x0F, + 0x0F, 0x0F}; + + if (attenDb > ADI_ADRV903X_MAX_ORX_ATTEN_DB) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + attenDb, + "attenDb outside maximum range"); + return recoveryAction; + } + + *trmAtten = orxAttenDbToTrmAtten[attenDb]; + *trmAttenBwCapEn = orxAttenDbToTrmAttenBwCapEn[attenDb]; + + return ADI_ADRV903X_ERR_ACT_NONE; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_ORxTrmAttenToDb(adi_adrv903x_Device_t* const device, + const uint8_t trmAtten, + uint8_t* const attenDb) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, attenDb); + + /* TODO - yoda provides a mapping from attenDb to corresponding trmAtten bitfield value by way of the + * adrv903x_Bf_ActrlOrxWestRegmap_TrmAtten_e enumeration. Unfortunately that mapping is currently incorrect. See + * TPGRADSWL-10152. + */ + + /* + * TrmAtten -> orxAttenDb + * ----------+------------ + * hex |dec | dB + * ----------|------------ + * 0x00 0 | 0 + * 0x01 1 | 1 + * 0x02 2 | 2 + * 0x03 3 | 3 + * 0x04 4 | 4 + * 0x05 5 | 5 + * 0x06 6 | 5 # + * 0x07 7 | 6 # + * 0x08 8 | 6 + * 0x09 9 | 7 + * 0x0A 10 | 8 + * 0x0B 11 | 9 + * 0x0C 12 | 10 + * 0x0D 13 | 11 + * 0x0E 14 | 11 # + * 0x0F 15 | 12 # + * 0x10 16 | 12 + * 0x11 17 | 13 + * 0x12 18 | 14 + * 0x13 19 | 15 + * 0x14 20 | 16 + * 0x15 21 | 17 + * '#' indicates a value interpolated from the TrmAtten <- orxAttenDb mapping to avoid confusing holes in the + * TrmAtten -> orxAttenDb mapping. + */ + + /* Resolve bitfield value to result in dB. Return an error if there is no definition of a conversion to dB from the value */ + if (trmAtten <= 5U) + { + *attenDb = trmAtten; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + else if ((8U <= trmAtten) && + (trmAtten <= 13U)) + { + *attenDb = trmAtten - 2U; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + else if ((16U <= trmAtten) && + (trmAtten <= 21U)) + { + *attenDb = trmAtten - 4U; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + attenDb, + "Invalid value for trmAtten. Cannot resolve to atten in dB."); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API uint8_t adrv903x_RxChannelsToId(const adi_adrv903x_RxChannels_e rxChannel) +{ + switch (rxChannel) + { + case ADI_ADRV903X_RX0: + return 0; + break; + + case ADI_ADRV903X_RX1: + return 1; + break; + + case ADI_ADRV903X_RX2: + return 2; + break; + + case ADI_ADRV903X_RX3: + return 3; + break; + + case ADI_ADRV903X_RX4: + return 4; + break; + + case ADI_ADRV903X_RX5: + return 5; + break; + + case ADI_ADRV903X_RX6: + return 6; + break; + + case ADI_ADRV903X_RX7: + return 7; + break; + + default: + return ADI_ADRV903X_MAX_RX_ONLY; + break; + } +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_shared_resource_manager.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_shared_resource_manager.c new file mode 100644 index 0000000000000..c7d18eb6b7bd4 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_shared_resource_manager.c @@ -0,0 +1,671 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adrv903x_shared_resource_manager.c + * \brief Contains ADRV903X shared resource related private function implementations + * + * ADRV903X API Version: 2.12.1.4 + */ + +#include "../../private/include/adrv903x_shared_resource_manager.h" + +#include "adi_adrv903x_gpio_types.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_SHARED_RESOURCE_MANAGER + +/******************************************** User Functions ********************************************************************/ + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceMgrReset(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + uint32_t sharedResourceIndex = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + for (sharedResourceIndex = 0U; sharedResourceIndex < ADRV903X_NUM_SHARED_RESOURCES; sharedResourceIndex++) + { + device->devStateInfo.sharedResourcePool[sharedResourceIndex].featureID = (uint32_t)ADRV903X_FEATURE_UNUSED; + device->devStateInfo.sharedResourcePool[sharedResourceIndex].channelMask = 0U; + device->devStateInfo.sharedResourcePool[sharedResourceIndex].semaphoreCount = 0U; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourcesAcquire(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceType_e sharedResourceType, + int32_t sharedResourceArr[], + const uint32_t numSharedResources, + const adrv903x_FeatureID_e featureID, + uint8_t* const resourceAcquistionStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + uint32_t sharedResourceIndex = 0U; + adrv903x_SharedResourceID_e sharedResourceID = ADRV903X_SHARED_RESOURCE_INVALID; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check resourceAcquistionStatus pointer is not null */ + ADI_ADRV903X_NULL_PTR_RETURN(resourceAcquistionStatus); + + /*Range check that featureID is valid*/ + if (featureID >= ADRV903X_NUM_FEATURES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, featureID, "featureID is not valid"); + return recoveryAction; + } + + /*Range Check that shared resource type is valid*/ + if (sharedResourceType >= ADRV903X_NUM_SHARED_RESOURCE_TYPES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + sharedResourceType, + "Invalid sharedResourceType encountered in adrv903x_SharedResourcesAcquire function"); + return recoveryAction; + } + + /*Loop through each shared resource. + 1) Get Shared Resource unique ID + 2) Acquire Shared Resource + 3) If the resource is in use by another feature than the one which requested return a failed status*/ + for (sharedResourceIndex = 0U; sharedResourceIndex < numSharedResources; sharedResourceIndex++) + { + recoveryAction = adrv903x_SharedResourceIdGet(device, + sharedResourceType, + sharedResourceArr[sharedResourceIndex], + &sharedResourceID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + sharedResourceID, + "Error while attempting to resolve shared resource ID for the requested share resource"); + return recoveryAction; + } + + recoveryAction = adrv903x_SharedResourceAcquire(device, + sharedResourceID, + featureID, + resourceAcquistionStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + resourceAcquistionStatus, + "Error while attempting to acquire requested share resource"); + return recoveryAction; + } + + if (*resourceAcquistionStatus == ADI_FAILURE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + resourceAcquistionStatus, + "Error acquiring requested shared resource. Please check if the resource is already in use by another feature."); + return recoveryAction; + break; + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourcesRelease(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceType_e sharedResourceType, + int32_t sharedResourceArr[], + const uint32_t numSharedResources, + const adrv903x_FeatureID_e featureID, + uint8_t* const resourceReleaseStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + uint32_t sharedResourceIndex = 0U; + adrv903x_SharedResourceID_e sharedResourceID = ADRV903X_SHARED_RESOURCE_INVALID; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check resourceReleaseStatus pointer is not null */ + ADI_ADRV903X_NULL_PTR_RETURN(resourceReleaseStatus); + + /*Range check that featureID is valid*/ + if (featureID >= ADRV903X_NUM_FEATURES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + featureID, + "featureID is not valid"); + return recoveryAction; + } + + /*Range Check that shared resource type is valid*/ + if (sharedResourceType >= ADRV903X_NUM_SHARED_RESOURCE_TYPES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + sharedResourceType, + "Invalid sharedResourceType encountered in adrv903x_SharedResourcesAcquire function"); + return recoveryAction; + } + + /*Loop through each shared resource. + 1) Get Shared Resource unique ID + 2) Release Shared Resource + 3) If the resource is in use by another feature than the one which requested return a failed status*/ + for (sharedResourceIndex = 0U; sharedResourceIndex < numSharedResources; sharedResourceIndex++) + { + recoveryAction = adrv903x_SharedResourceIdGet(device, + sharedResourceType, + sharedResourceArr[sharedResourceIndex], + &sharedResourceID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + sharedResourceID, + "Error while attempting to resolve shared resource ID for the requested share resource"); + return recoveryAction; + } + + recoveryAction = adrv903x_SharedResourceRelease(device, + sharedResourceID, + featureID, + resourceReleaseStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + resourceReleaseStatus, + "Error while attempting to release requested share resource"); + return recoveryAction; + } + + if (*resourceReleaseStatus == ADI_FAILURE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + resourceReleaseStatus, + "Error releasing requested shared resource. Please check if the resource is already in use by another feature."); + return recoveryAction; + break; + } + } + + return recoveryAction; +} + +/******************************************** Helper/Debug Functions ********************************************************************/ + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceAvailabilityCheck(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceID_e sharedResourceID, + uint8_t* const sharedResourceAvailable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check sharedResourceAvailable pointer is not null */ + ADI_ADRV903X_NULL_PTR_RETURN(sharedResourceAvailable); + + /*Range Check that shared resource ID is valid*/ + if (sharedResourceID >= ADRV903X_NUM_SHARED_RESOURCES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + sharedResourceID, + "sharedResourceID is not valid"); + return recoveryAction; + } + + /*Return success if shared resource pool index of shared resource ID has a feature other than UNUSED associated with it*/ + if (device->devStateInfo.sharedResourcePool[sharedResourceID].featureID == (uint32_t)ADRV903X_FEATURE_UNUSED) + { + *sharedResourceAvailable = (uint8_t)ADI_TRUE; + } + else + { + *sharedResourceAvailable = (uint8_t)ADI_FALSE; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceIdGet(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceType_e sharedResourceType, + int32_t sharedResource, + adrv903x_SharedResourceID_e* const sharedResourceID) +{ + static const adrv903x_SharedResourceLut_t sharedResourceLut[] = { + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_00, ADRV903X_GPIO_00 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_01, ADRV903X_GPIO_01 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_02, ADRV903X_GPIO_02 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_03, ADRV903X_GPIO_03 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_04, ADRV903X_GPIO_04 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_05, ADRV903X_GPIO_05 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_06, ADRV903X_GPIO_06 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_07, ADRV903X_GPIO_07 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_08, ADRV903X_GPIO_08 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_09, ADRV903X_GPIO_09 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_10, ADRV903X_GPIO_10 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_11, ADRV903X_GPIO_11 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_12, ADRV903X_GPIO_12 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_13, ADRV903X_GPIO_13 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_14, ADRV903X_GPIO_14 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_15, ADRV903X_GPIO_15 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_16, ADRV903X_GPIO_16 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_17, ADRV903X_GPIO_17 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_18, ADRV903X_GPIO_18 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_19, ADRV903X_GPIO_19 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_20, ADRV903X_GPIO_20 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_21, ADRV903X_GPIO_21 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_22, ADRV903X_GPIO_22 }, + { ADRV903X_SHARED_RESOURCE_GPIO, ADI_ADRV903X_GPIO_23, ADRV903X_GPIO_23 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_00, ADRV903X_GPIO_ANA_00 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_01, ADRV903X_GPIO_ANA_01 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_02, ADRV903X_GPIO_ANA_02 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_03, ADRV903X_GPIO_ANA_03 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_04, ADRV903X_GPIO_ANA_04 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_05, ADRV903X_GPIO_ANA_05 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_06, ADRV903X_GPIO_ANA_06 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_07, ADRV903X_GPIO_ANA_07 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_08, ADRV903X_GPIO_ANA_08 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_09, ADRV903X_GPIO_ANA_09 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_10, ADRV903X_GPIO_ANA_10 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_11, ADRV903X_GPIO_ANA_11 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_12, ADRV903X_GPIO_ANA_12 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_13, ADRV903X_GPIO_ANA_13 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_14, ADRV903X_GPIO_ANA_14 }, + { ADRV903X_SHARED_RESOURCE_GPIO_ANALOG, ADI_ADRV903X_GPIO_ANA_15, ADRV903X_GPIO_ANA_15 } + }; + /*****************Please add lut val for shared resources above this line*******************/ + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + uint32_t sharedResourceIndex = 0U; + uint8_t validSharedResourceTypeFlag = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_RETURN(sharedResourceID); + + /*Range Check that shared resource type is valid*/ + if (sharedResourceType >= ADRV903X_NUM_SHARED_RESOURCE_TYPES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + sharedResourceType, + "Invalid sharedResourceType encountered in adrv903x_SharedResourcesAcquire function"); + return recoveryAction; + } + + for (sharedResourceIndex = 0U; sharedResourceIndex < ADRV903X_NUM_SHARED_RESOURCES; sharedResourceIndex++) + { + if (sharedResourceLut[sharedResourceIndex].sharedResourceType == sharedResourceType) + { + if (sharedResourceLut[sharedResourceIndex].sharedResource == sharedResource) + { + *sharedResourceID = sharedResourceLut[sharedResourceIndex].sharedResourceId; + validSharedResourceTypeFlag = 1U; + break; + } + } + } + + /* Check not a valid shared resource ID found */ + if (validSharedResourceTypeFlag == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + validSharedResourceTypeFlag, + "Requested Shared Resource is not valid"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceFeatureGet(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceID_e sharedResourceID, + adrv903x_FeatureID_e* const featureID) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /*Range check that featureID is not null*/ + ADI_ADRV903X_NULL_PTR_RETURN(featureID); + + /*Range Check that shared resource ID is valid*/ + if (sharedResourceID >= ADRV903X_NUM_SHARED_RESOURCES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + sharedResourceID, + "sharedResourceID is not valid"); + return recoveryAction; + } + + /*Return the feature associated with shared resource pool*/ + *featureID = (adrv903x_FeatureID_e)device->devStateInfo.sharedResourcePool[sharedResourceID].featureID; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceChannelMaskSet(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceID_e sharedResourceID, + const uint32_t channelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /*Range Check that shared resource ID is valid*/ + if (sharedResourceID >= ADRV903X_NUM_SHARED_RESOURCES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + sharedResourceID, + "sharedResourceID is not valid"); + return recoveryAction; + } + + /*Set the channelMask associated with shared resource pool*/ + device->devStateInfo.sharedResourcePool[sharedResourceID].channelMask = channelMask; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceChannelMaskGet(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceID_e sharedResourceID, + uint32_t * const channelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /*Range check that channelMask is not null*/ + ADI_ADRV903X_NULL_PTR_RETURN(channelMask); + + /*Range Check that shared resource ID is valid*/ + if (sharedResourceID >= ADRV903X_NUM_SHARED_RESOURCES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + sharedResourceID, + "sharedResourceID is not valid"); + return recoveryAction; + } + + /*Return the channelMask associated with shared resource pool*/ + *channelMask = device->devStateInfo.sharedResourcePool[sharedResourceID].channelMask; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceFeatureMaxSemaphoreCntGet(adi_adrv903x_Device_t* const device, + const adrv903x_FeatureID_e featureID, + uint8_t* maxSemaphoreCount) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /*Range check that the maximum semaphore count pointer is not null*/ + ADI_ADRV903X_NULL_PTR_RETURN(maxSemaphoreCount); + + /*Range Check that feature ID is valid*/ + if (featureID >= ADRV903X_NUM_FEATURES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + featureID, + "The feature ID requested for retrieving maximum semaphore count is not valid"); + return recoveryAction; + } + + switch (featureID) + { + case ADRV903X_FEATURE_GPIO_ADC_TEST_GEN_ENABLE: /* Fallthrough */ + case ADRV903X_FEATURE_GPIO_AGC_GAIN_CHANGE: /* Fallthrough */ + case ADRV903X_FEATURE_GPIO_AGC_DEC_GAIN: /* Fallthrough */ + case ADRV903X_FEATURE_GPIO_AGC_INC_GAIN: /* Fallthrough */ + case ADRV903X_FEATURE_GPIO_AGC_SLOWLOOP_FREEZE_ENABLE: /* Fallthrough */ + case ADRV903X_FEATURE_GPIO_AGC_MANUAL_GAIN_LOCK: /* Fallthrough */ + case ADRV903X_FEATURE_GPIO_SELECT_S1: /* Fallthrough */ + case ADRV903X_FEATURE_GPIO_TX_ATTEN_UPD_GPIO: /* Fallthrough */ + case ADRV903X_FEATURE_GPIO_DTX_FORCE_PIN: /* Fallthrough */ + *maxSemaphoreCount = 8U; + break; + default: + *maxSemaphoreCount = 1U; + break; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceAcquire(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceID_e sharedResourceID, + const adrv903x_FeatureID_e featureID, + uint8_t* resourceAcquistionStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + uint8_t sharedResourceAvailable = (uint8_t)ADI_FALSE; + adrv903x_FeatureID_e currentFeatureID = ADRV903X_FEATURE_UNUSED; + uint8_t maxSemaphoreCount = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check resourceAcquistionStatus pointer is not null */ + ADI_ADRV903X_NULL_PTR_RETURN(resourceAcquistionStatus); + + /*Range check that featureID is valid*/ + if (featureID >= ADRV903X_NUM_FEATURES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, featureID, "featureID is not valid"); + return recoveryAction; + } + + /*Range check that sharedResourceID is valid*/ + if (sharedResourceID >= ADRV903X_NUM_SHARED_RESOURCES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + sharedResourceID, + "sharedResourceID is not valid"); + return recoveryAction; + } + + /*Initialize resourceAcquistionStatus to false and set to true only if shared resource available*/ + *resourceAcquistionStatus = ADI_FAILURE; + + /*sharedResourceID check is done in Shared Resource Available function*/ + /*Acquire resource if it is not already acquired by another feature or already acquired by the requesting feature*/ + recoveryAction = adrv903x_SharedResourceAvailabilityCheck(device, + sharedResourceID, + &sharedResourceAvailable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + sharedResourceAvailable, + "Error while checking for shared resource availability"); + return recoveryAction; + } + + if (sharedResourceAvailable == ADI_TRUE) + { + device->devStateInfo.sharedResourcePool[sharedResourceID].featureID = (uint32_t)featureID; + device->devStateInfo.sharedResourcePool[sharedResourceID].semaphoreCount++; + *resourceAcquistionStatus = ADI_SUCCESS; + } + else + { + recoveryAction = adrv903x_SharedResourceFeatureGet(device, + sharedResourceID, + ¤tFeatureID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + currentFeatureID, + "Error while acquiring shared resource feature"); + return recoveryAction; + } + + if (currentFeatureID == featureID) + { + recoveryAction = adrv903x_SharedResourceFeatureMaxSemaphoreCntGet(device, + featureID, + &maxSemaphoreCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + return recoveryAction; + } + + if (device->devStateInfo.sharedResourcePool[sharedResourceID].semaphoreCount < maxSemaphoreCount) + { + device->devStateInfo.sharedResourcePool[sharedResourceID].semaphoreCount++; + *resourceAcquistionStatus = ADI_SUCCESS; + } + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_SharedResourceRelease(adi_adrv903x_Device_t* const device, + const adrv903x_SharedResourceID_e sharedResourceID, + const adrv903x_FeatureID_e featureID, + uint8_t* const resourceReleaseStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + uint8_t sharedResourceAvailable = ADI_FALSE; + adrv903x_FeatureID_e currentFeatureID = ADRV903X_FEATURE_UNUSED; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check resourceReleaseStatus pointer is not null */ + ADI_ADRV903X_NULL_PTR_RETURN(resourceReleaseStatus); + + /*Range check that featureID is valid*/ + if (featureID >= ADRV903X_NUM_FEATURES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, featureID, "featureID is not valid"); + return recoveryAction; + } + + /*Range check that sharedResourceID is valid*/ + if (sharedResourceID >= ADRV903X_NUM_SHARED_RESOURCES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + sharedResourceID, + "sharedResourceID is not valid"); + return recoveryAction; + } + + /*Initialize resourceReleaseStatus to false and set to true only if shared resource is released successfully*/ + *resourceReleaseStatus = ADI_FAILURE; + + /*sharedResourceID check is done in Shared Resource Available function*/ + /*Release the shared resource only if the requested feature ID matches the current feature ID or is not in use currently*/ + recoveryAction = adrv903x_SharedResourceAvailabilityCheck(device, + sharedResourceID, + &sharedResourceAvailable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + sharedResourceAvailable, + "Error while checking for shared resource availability"); + return recoveryAction; + } + + if (sharedResourceAvailable == ADI_TRUE) + { + *resourceReleaseStatus = ADI_SUCCESS; + } + else + { + recoveryAction = adrv903x_SharedResourceFeatureGet(device, + sharedResourceID, + ¤tFeatureID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + currentFeatureID, + "Error while acquiring shared resource feature"); + return recoveryAction; + } + + if (currentFeatureID == featureID) + { + if (device->devStateInfo.sharedResourcePool[sharedResourceID].semaphoreCount > 0) + { + device->devStateInfo.sharedResourcePool[sharedResourceID].semaphoreCount--; + } + + if (device->devStateInfo.sharedResourcePool[sharedResourceID].semaphoreCount == 0) + { + device->devStateInfo.sharedResourcePool[sharedResourceID].featureID = (uint32_t)ADRV903X_FEATURE_UNUSED; + } + + *resourceReleaseStatus = ADI_SUCCESS; + } + } + + return recoveryAction; +} diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_struct_endian.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_struct_endian.c new file mode 100644 index 0000000000000..9d2cd450fc89e --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_struct_endian.c @@ -0,0 +1,132 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + + +#include "../../private/include/adrv903x_struct_endian.h" + +#ifndef ADI_LIBRARY_RM_FLOATS +static float byteSwapFloat(float val) +{ + float retVal; + char *valAsCharArr = (char*) &val; + char *retValAsCharArr = (char*) &retVal; + + retValAsCharArr[0] = valAsCharArr[3]; + retValAsCharArr[1] = valAsCharArr[2]; + retValAsCharArr[2] = valAsCharArr[1]; + retValAsCharArr[3] = valAsCharArr[0]; + + return retVal; +} +#endif + +void adrv903x_CpuCmd_SerdesCalStatusGet_swap(struct adrv903x_CpuCmd_SerdesCalStatusGet* _struct) +{ + (void) _struct; + + /* _struct->lane << Field length is 1 byte no endianness swap required */ +} + + +void adrv903x_SerdesInitCalStatusCmdResp_swap(struct adrv903x_SerdesInitCalStatusCmdResp* _struct) +{ + (void) _struct; + + adrv903x_SerdesInitCalStatus_swap(&_struct->details); + + _struct->cpuErrorCode = ADRV903X_BYTESWAP_L(_struct->cpuErrorCode); +} + +void adrv903x_SerdesTrackingCalStatusCmdResp_swap(struct adrv903x_SerdesTrackingCalStatusCmdResp* _struct) +{ + (void) _struct; + + adrv903x_SerdesTrackingCalStatus_swap(&_struct->details); + + _struct->cpuErrorCode = ADRV903X_BYTESWAP_L(_struct->cpuErrorCode); +} + +void adrv903x_SerdesTrackingCalStatus_swap(struct adi_adrv903x_SerdesTrackingCalStatus* _struct) +{ + (void) _struct; + + _struct->temperature = ADRV903X_BYTESWAP_S(_struct->temperature); + + /* _struct->pd << Field length is 1 byte no endianness swap required */ + + /* _struct->dllPeakPd << Field length is 1 byte no endianness swap required */ + + /* _struct->dllPeakPdDelta << Field length is 1 byte no endianness swap required */ + + /* _struct->innerUp << Field length is 1 byte no endianness swap required */ + + /* _struct->innerDown << Field length is 1 byte no endianness swap required */ + + /* _struct->outerUp << Field length is 1 byte no endianness swap required */ + + /* _struct->outerDown << Field length is 1 byte no endianness swap required */ + + /* _struct->b << Field length is 1 byte no endianness swap required */ + +#ifndef ADI_LIBRARY_RM_FLOATS + for(int i = 0; i < 2; i++) + { + _struct->ps[i] = byteSwapFloat(_struct->ps[i]); + } + + for(int i = 0; i < 16; i++) + { + _struct->yVector[i] = byteSwapFloat(_struct->yVector[i]); + } +#else + for(int i = 0; i < 2; i++) + { + _struct->ps_float[i] = ADRV903X_BYTESWAP_L(_struct->ps_float[i]); + } + + for(int i = 0; i < 16; i++) + { + _struct->yVector_float[i] = ADRV903X_BYTESWAP_L(_struct->yVector_float[i]); + } +#endif +} + +void adrv903x_SerdesInitCalStatus_swap(struct adi_adrv903x_SerdesInitCalStatus* _struct) +{ + (void) _struct; + + _struct->temperature = ADRV903X_BYTESWAP_S(_struct->temperature); + + /* _struct->lpfIndex << Field length is 1 byte no endianness swap required */ + + /* _struct->ctleIndex << Field length is 1 byte no endianness swap required */ + + /* _struct->numEyes << Field length is 1 byte no endianness swap required */ + + _struct->bsum = ADRV903X_BYTESWAP_S(_struct->bsum); + + _struct->bsum_dc = ADRV903X_BYTESWAP_S(_struct->bsum_dc); + + /* _struct->spoLeft << Field length is 1 byte no endianness swap required */ + + /* _struct->spoRight << Field length is 1 byte no endianness swap required */ + + _struct->eom = ADRV903X_BYTESWAP_S(_struct->eom); + + _struct->eomMax = ADRV903X_BYTESWAP_S(_struct->eomMax); + + /* _struct->pd << Field length is 1 byte no endianness swap required */ + + /* _struct->innerUp << Field length is 1 byte no endianness swap required */ + + /* _struct->innerDown << Field length is 1 byte no endianness swap required */ + + /* _struct->outerUp << Field length is 1 byte no endianness swap required */ + + /* _struct->outerDown << Field length is 1 byte no endianness swap required */ + + /* _struct->b << Field length is 1 byte no endianness swap required */ +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_tx.c b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_tx.c new file mode 100644 index 0000000000000..bef5a5680a073 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/private/src/adrv903x_tx.c @@ -0,0 +1,819 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adrv903x_tx.c +* +* ADRV903X API Version: 2.12.1.4 +*/ +#include "../../private/include/adrv903x_tx.h" +#include "../../private/bf/adrv903x_bf_pll_mem_map.h" +#include "../../private/include/adrv903x_cpu.h" + +#include "adi_adrv903x_tx_types.h" +#include "adi_adrv903x_tx.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PRIVATE_TX + +ADI_API uint32_t adrv903x_txAttenAddrLookup(const adi_adrv903x_TxChannels_e txChannel) +{ + uint32_t retval = 0U; + + switch (txChannel) + { + case ADI_ADRV903X_TX0: + retval = ADRV903X_ADDR_TX0_ATTEN_TABLE; + break; + + case ADI_ADRV903X_TX1: + retval = ADRV903X_ADDR_TX1_ATTEN_TABLE; + break; + + case ADI_ADRV903X_TX2: + retval = ADRV903X_ADDR_TX2_ATTEN_TABLE; + break; + + case ADI_ADRV903X_TX3: + retval = ADRV903X_ADDR_TX3_ATTEN_TABLE; + break; + + case ADI_ADRV903X_TX4: + retval = ADRV903X_ADDR_TX4_ATTEN_TABLE; + break; + + case ADI_ADRV903X_TX5: + retval = ADRV903X_ADDR_TX5_ATTEN_TABLE; + break; + + case ADI_ADRV903X_TX6: + retval = ADRV903X_ADDR_TX6_ATTEN_TABLE; + break; + + case ADI_ADRV903X_TX7: + retval = ADRV903X_ADDR_TX7_ATTEN_TABLE; + break; + + default: + retval = 0U; + break; + } + + return retval; +} + + +ADI_API uint8_t adrv903x_TxChannelsToId(const adi_adrv903x_TxChannels_e txChannel) +{ + switch (txChannel) + { + case ADI_ADRV903X_TX0: + return 0; + break; + + case ADI_ADRV903X_TX1: + return 1; + break; + + case ADI_ADRV903X_TX2: + return 2; + break; + + case ADI_ADRV903X_TX3: + return 3; + break; + + case ADI_ADRV903X_TX4: + return 4; + break; + + case ADI_ADRV903X_TX5: + return 5; + break; + + case ADI_ADRV903X_TX6: + return 6; + break; + + case ADI_ADRV903X_TX7: + return 7; + break; + + default: + return ADI_ADRV903X_TX_CHAN_ID_MAX + 1; + break; + } +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adrv903x_BfTxChanAddr_e* const txChannelBitfieldAddr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check tx bitfield channel address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, txChannelBitfieldAddr); + + if (((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & (uint32_t)txChannel) == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + device->devStateInfo.initializedChannels, + "Selected Tx channel is not initialized for this device."); + return recoveryAction; + } + + switch (txChannel) + { + case ADI_ADRV903X_TX0: + *txChannelBitfieldAddr = ADRV903X_BF_TX_CH0; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + case ADI_ADRV903X_TX1: + *txChannelBitfieldAddr = ADRV903X_BF_TX_CH1; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + case ADI_ADRV903X_TX2: + *txChannelBitfieldAddr = ADRV903X_BF_TX_CH2; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + case ADI_ADRV903X_TX3: + *txChannelBitfieldAddr = ADRV903X_BF_TX_CH3; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + case ADI_ADRV903X_TX4: + *txChannelBitfieldAddr = ADRV903X_BF_TX_CH4; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + case ADI_ADRV903X_TX5: + *txChannelBitfieldAddr = ADRV903X_BF_TX_CH5; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + case ADI_ADRV903X_TX6: + *txChannelBitfieldAddr = ADRV903X_BF_TX_CH6; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + case ADI_ADRV903X_TX7: + *txChannelBitfieldAddr = ADRV903X_BF_TX_CH7; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txChannel, + "Invalid txChannel parameter for adrv903x_TxBitfieldAddressGet() function"); + return recoveryAction; + break; + + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxFuncsBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adrv903x_BfTxFuncsChanAddr_e* const txFuncsChannelBitfieldAddr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check rx bitfield channel address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, txFuncsChannelBitfieldAddr); + + if (((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & (uint32_t)txChannel) == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + device->devStateInfo.initializedChannels, + "Selected Tx channel is not initialized for this device."); + return recoveryAction; + } + + switch (txChannel) + { + case ADI_ADRV903X_TX0: + *txFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + break; + + case ADI_ADRV903X_TX1: + *txFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_1__TX_FUNCS; + break; + + case ADI_ADRV903X_TX2: + *txFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_2__TX_FUNCS; + break; + case ADI_ADRV903X_TX3: + *txFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_3__TX_FUNCS; + break; + + case ADI_ADRV903X_TX4: + *txFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_4__TX_FUNCS; + break; + + case ADI_ADRV903X_TX5: + *txFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_5__TX_FUNCS; + break; + + case ADI_ADRV903X_TX6: + *txFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_6__TX_FUNCS; + break; + + case ADI_ADRV903X_TX7: + *txFuncsChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_7__TX_FUNCS; + break; + + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txChannel, + "Invalid txChannel parameter "); + return recoveryAction; + } + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDatapathBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adrv903x_BfTxDatapathChanAddr_e* const txDatapathChannelBitfieldAddr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check rx bitfield channel address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, txDatapathChannelBitfieldAddr); + + if (((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & (uint32_t)txChannel) == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + device->devStateInfo.initializedChannels, + "Selected Tx channel is not initialized for this device."); + return recoveryAction; + } + + switch (txChannel) + { + case ADI_ADRV903X_TX0: + *txDatapathChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_0__TX_DATAPATH; + break; + + case ADI_ADRV903X_TX1: + *txDatapathChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_1__TX_DATAPATH; + break; + + case ADI_ADRV903X_TX2: + *txDatapathChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_2__TX_DATAPATH; + break; + case ADI_ADRV903X_TX3: + *txDatapathChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_3__TX_DATAPATH; + break; + + case ADI_ADRV903X_TX4: + *txDatapathChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_4__TX_DATAPATH; + break; + + case ADI_ADRV903X_TX5: + *txDatapathChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_5__TX_DATAPATH; + break; + + case ADI_ADRV903X_TX6: + *txDatapathChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_6__TX_DATAPATH; + break; + + case ADI_ADRV903X_TX7: + *txDatapathChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_7__TX_DATAPATH; + break; + + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txChannel, + "Invalid txChannel parameter "); + return recoveryAction; + } + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDigBitfieldAddressGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adrv903x_BfTxDigChanAddr_e* const txDigChannelBitfieldAddr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check rx bitfield channel address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, txDigChannelBitfieldAddr); + + if (((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & (uint32_t)txChannel) == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + device->devStateInfo.initializedChannels, + "Selected Tx channel is not initialized for this device."); + return recoveryAction; + } + + switch (txChannel) + { + case ADI_ADRV903X_TX0: + *txDigChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_0__TX_DIG; + break; + + case ADI_ADRV903X_TX1: + *txDigChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_1__TX_DIG; + break; + + case ADI_ADRV903X_TX2: + *txDigChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_2__TX_DIG; + break; + case ADI_ADRV903X_TX3: + *txDigChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_3__TX_DIG; + break; + + case ADI_ADRV903X_TX4: + *txDigChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_4__TX_DIG; + break; + + case ADI_ADRV903X_TX5: + *txDigChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_5__TX_DIG; + break; + + case ADI_ADRV903X_TX6: + *txDigChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_6__TX_DIG; + break; + + case ADI_ADRV903X_TX7: + *txDigChannelBitfieldAddr = ADRV903X_BF_SLICE_TX_7__TX_DIG; + break; + + default: + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txChannel, + "Invalid txChannel parameter "); + return recoveryAction; + } + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxPowerMonitorCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_PowerMonitorCfg_t * const txPowerMonitorCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check txPowerMonitorCfg address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, txPowerMonitorCfg); + + + /* Valid ranges for the pa protection configuration values */ + static const uint8_t MEAS_DURATION_MAX = 0x0FU; + static const uint8_t PEAK_COUNT_MAX = 0x3FU; + static const uint8_t SINGLE_BIT_MAX = 0x01U; + + if (txPowerMonitorCfg->measDuration > MEAS_DURATION_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txPowerMonitorCfg->measDuration, + "Average/Peak duration exceeds maximum limit. Valid range 0-15"); + return recoveryAction; + } + + if (txPowerMonitorCfg->peakCount > PEAK_COUNT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txPowerMonitorCfg->peakCount, + "Peak count exceeds maximum limit. Valid range 0-63"); + return recoveryAction; + } + + + if (txPowerMonitorCfg->avgPowerEnable > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txPowerMonitorCfg->avgPowerEnable, + "Avg power enable value is invalid. Valid values 0-1"); + return recoveryAction; + } + + if (txPowerMonitorCfg->peakPowerEnable > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txPowerMonitorCfg->peakPowerEnable, + "Peak power enable value is invalid. Valid values 0-1"); + return recoveryAction; + } + + if (txPowerMonitorCfg->avgPeakRatioEnable > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txPowerMonitorCfg->avgPeakRatioEnable, + "Avg Peak power ratio enable value is invalid. Valid values 0-1"); + return recoveryAction; + } + + if (txPowerMonitorCfg->peakErrorClearRequired > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txPowerMonitorCfg->peakErrorClearRequired, + "Peak error cleared required selection is invalid. Valid values 0-1"); + return recoveryAction; + } + + if (txPowerMonitorCfg->peakPowerIrqEnable > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txPowerMonitorCfg->peakPowerIrqEnable, + "Peak power irq enable value is invalid. Valid values 0-1"); + return recoveryAction; + } + + if (txPowerMonitorCfg->avgErrorClearRequired > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txPowerMonitorCfg->avgErrorClearRequired, + "Avg error cleared required selection is invalid. Valid values 0-1"); + return recoveryAction; + } + + if (txPowerMonitorCfg->avgPowerIrqEnable > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txPowerMonitorCfg->avgPowerIrqEnable, + "Avg power irq enabled value is invalid. Valid values 0-1"); + return recoveryAction; + } + + if (txPowerMonitorCfg->inputSel > ADI_ADRV903X_TXQEC_ACTUATOR_OUTPUT) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txPowerMonitorCfg->inputSel, + "Power monitor input selection is invalid. Valid selections are COMPLEX_MULT_OUTPUT and TXQEC_ACTUATOR_OUTPUT"); + return recoveryAction; + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxSlewRateDetectorCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_SlewRateDetectorCfg_t * const txSlewRateDetectorCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Check txSlewRateDetectorCfg address pointer is not null */ + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, txSlewRateDetectorCfg); + + /* Valid ranges for the srd configuration values */ + static const uint8_t SINGLE_BIT_MAX = 0x01U; + static const uint8_t ARV_MAX_WAIT_TIME = 15U; + + ADI_FUNCTION_ENTRY_LOG(&device->common, + ADI_HAL_LOG_API_PRIV); + + if (txSlewRateDetectorCfg->inputSel > ADI_ADRV903X_TXQEC_ACTUATOR_OUTPUT) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txSlewRateDetectorCfg->inputSel, + "Input selection should be either HB1 Output or TXQEC Actuator Output"); + return recoveryAction; + } + + if (txSlewRateDetectorCfg->srdEnable > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txSlewRateDetectorCfg->srdEnable, + "srdEnable value is invalid. Valid values 0-1"); + return recoveryAction; + } + + if (txSlewRateDetectorCfg->srdIrqEnable > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txSlewRateDetectorCfg->srdIrqEnable, + "srdIrqEnable value is invalid. Valid values 0-1"); + return recoveryAction; + } + + if (txSlewRateDetectorCfg->autoRecoveryWaitTime > ARV_MAX_WAIT_TIME) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txSlewRateDetectorCfg->autoRecoveryWaitTime, + "autoRecoveryWaitTime value is invalid. Valid range [0-15]"); + return recoveryAction; + } + + if (txSlewRateDetectorCfg->autoRecoveryEnable > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txSlewRateDetectorCfg->autoRecoveryEnable, + "autoRecoveryEnable value is invalid. Valid values 0-1"); + return recoveryAction; + } + + if (txSlewRateDetectorCfg->autoRecoveryDisableTimerWhenTxOff > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txSlewRateDetectorCfg->autoRecoveryDisableTimerWhenTxOff, + "autoRecoveryDisableTimerWhenTxOff value is invalid. Valid values 0-1"); + return recoveryAction; + } + + if (txSlewRateDetectorCfg->srdStatisticsEnable > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txSlewRateDetectorCfg->srdStatisticsEnable, + "srdStatisticsEnable value is invalid. Valid values 0-1"); + return recoveryAction; + } + + if (txSlewRateDetectorCfg->srdStatisticsMode > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txSlewRateDetectorCfg->srdStatisticsMode, + "srdStatisticsMode value is invalid. Valid values 0-1"); + return recoveryAction; + } + + /* No error, set recovery outside switch statement to save code */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxLoSourceGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_LoSel_e* const txLoSource) +{ + static const uint8_t TX_LO_CURRENT_MASK = 0x01U; + uint8_t rxtxLoMuxReg = 0U; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check txPowerMonitorCfg address pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, txLoSource); + + if ((txChannel == ADI_ADRV903X_TX0) || + (txChannel == ADI_ADRV903X_TX1) || + (txChannel == ADI_ADRV903X_TX2) || + (txChannel == ADI_ADRV903X_TX3)) + { + /*Read the Tx Lo Mux reg from the east side of the chip */ + recoveryAction = adrv903x_PllMemMap_SelTxLo_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_EAST_RFPLL, + &rxtxLoMuxReg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE ) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to retrieve Rx Lo Selection."); + return recoveryAction; + } + + /*For East Side, 1 = LO0, 0 = LO1*/ + if ((rxtxLoMuxReg & TX_LO_CURRENT_MASK) == TX_LO_CURRENT_MASK) + { + *txLoSource = ADI_ADRV903X_LOSEL_LO0; + } + else + { + *txLoSource = ADI_ADRV903X_LOSEL_LO1; + } + } + else if ((txChannel == ADI_ADRV903X_TX4) || + (txChannel == ADI_ADRV903X_TX5) || + (txChannel == ADI_ADRV903X_TX6) || + (txChannel == ADI_ADRV903X_TX7)) + { + /*Read the Tx Lo Mux reg from the west side of the chip */ + recoveryAction = adrv903x_PllMemMap_SelTxLo_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_WEST_RFPLL, + &rxtxLoMuxReg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "PllMemMap_SelTxLo_Bfget issue"); + return recoveryAction; + } + + /*For West Side, 1 = LO1, 0 = LO0*/ + if ((rxtxLoMuxReg & TX_LO_CURRENT_MASK) == TX_LO_CURRENT_MASK) + { + *txLoSource = ADI_ADRV903X_LOSEL_LO1; + } + else + { + *txLoSource = ADI_ADRV903X_LOSEL_LO0; + } + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx Channel parameter. Valid Tx channel must be Tx0-Tx7"); + return recoveryAction; + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adrv903x_TxDecPowerCfgRangeCheck(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxDecimatedPowerCfg_t* const decPowerCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, decPowerCfg); + + static const uint8_t ENABLE_MAX = 1U; + static const uint8_t MAX_POWER_INPUT_SELECT = 3U; + static const uint8_t MAX_MEASUREMENT_DURATION_AX = 24U; + static const uint8_t MAX_MEASUREMENT_DURATION_B0 = 25U; + + uint8_t deviceRev = 0U; + + if (((decPowerCfg->txChannelMask & (~(uint32_t)ADI_ADRV903X_TXALL)) != 0U) || (decPowerCfg->txChannelMask == (uint32_t)ADI_ADRV903X_TXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->txChannelMask, + "Invalid Tx channel is selected. Valid values are any combinations of Tx0/1/2/3/4/5/6/7"); + return recoveryAction; + } + + if (decPowerCfg->measurementEnable > ENABLE_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->measurementEnable, + "Invalid measurementEnable selection."); + return recoveryAction; + } + + if (decPowerCfg->powerInputSelect > MAX_POWER_INPUT_SELECT) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->powerInputSelect, + "Invalid powerInputSelect selection."); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_DeviceRevGet(device, &deviceRev); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Unable to extract device Revision"); + return recoveryAction; + } + if (deviceRev >= 0xB0) + { + if (decPowerCfg->powerMeasurementDuration > MAX_MEASUREMENT_DURATION_B0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->powerMeasurementDuration, + "Invalid powerMeasurementDuration selection."); + return recoveryAction; + } + } + else if ((deviceRev & 0xA0) == 0xA0) + { + if (decPowerCfg->powerMeasurementDuration > MAX_MEASUREMENT_DURATION_AX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->powerMeasurementDuration, + "Invalid powerMeasurementDuration selection."); + return recoveryAction; + } + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + deviceRev, + "Invalid device revision."); + return recoveryAction; + } + + + if (decPowerCfg->peakToPowerMode > ENABLE_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + decPowerCfg->peakToPowerMode, + "Invalid peakToPowerMode selection."); + return recoveryAction; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_agc.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_agc.h new file mode 100644 index 0000000000000..1513755c4d61f --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_agc.h @@ -0,0 +1,577 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adi_adrv903x_agc.h + * \brief Contains ADRV903X receive related function prototypes for + * adi_adrv903x_agc.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_AGC_H_ +#define _ADI_ADRV903X_AGC_H_ + +#include "adi_adrv903x_agc_types.h" +#include "adi_adrv903x_error.h" + + +/** +* \brief Function to configure AGC block. +* +* Rx AGC block allows the receive path to control the gain automatically based on feedback from a number +* of signal detectors. There are 2 types of triggers that can be used for automatic Rx gain control. +* Peak detectors (ADC overload detector and HB2 peak detector) and power detector (decimated power +* measurement block). These triggers can be configured to be used to adjust Rx gain automatically. +* +* ADC overload detector has a configurable low threshold. +* +* HB2 peak detector has a high threshold and 3 low thresholds. The highest low threshold is used in all conditions. +* The other two low thresholds can only be used when fast recovery is enabled (agcConfig.agcEnableFastRecoveryLoop). +* +* All peak detector thresholds have an exceeded peak counter (to trigger a gain change) and gain step +* sizes (configuring how much the gain will be increased/decreased). Additionally, HB2 peak detectors have +* a common duration (agcConfig.agcPeak.hb2OverloadDurationCount) and a threshold +* count (agcConfig.agcPeak.hb2OverloadThreshCount). At least an hb2OverloadThreshCount number of individual samples +* within a batch of hb2OverloadDurationCount samples must exceed an HB2 threshold to increment that threshold's peak +* counter. This is to avoid counting a single peak multiple times due to high sample rates before decimations in the +* digital datapath. +* +* Decimated power measurements can be used by AGC to control the gain in Rx datapath. Decimated power measurement block +* in main signal path is being used for this purpose. These measurements are also available for user readback. +* Power measurements have 4 configurable thresholds and gain steps associated with these thresholds. +* Please see agcConfig.agcPower structure for details. +* +* Note: The function does not check for duplicated channel assignments across cfg structures. +* Invalid channel mask values will return an error. + +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] agcConfig array of structures of type adi_adrv903x_ AgcCfg_t which will configure one or more channels +* \param[in] numOfAgcCfgs number of configurations passed in the array +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcCfgSet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_AgcCfg_t agcConfig[], + const uint32_t numOfAgcCfgs); + +/** +* \brief This function reads AGC configuration of selected Rx channel + +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] rxChannel Rx channel selection to read AGC config from +* \param[out] agcConfigReadBack Pointer to structure which will be used to read configuration +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcCfgGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_AgcCfg_t * const agcConfigReadBack); + +/** +* \brief Halt the AGC loop which freezes the AGC gain index at it's current value. +* +* Can freeze or unfreeze multiple channels in a single call. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] rxChannelMask Bit0 (lsb) relates to Rx0, bit1 to Rx1 etc. If the bit for an +* Rx channel is not set then that channel is not affected by the call. +* \param[in] freezeEnable Bit0 (lsb) relates to Rx0, bit1 to Rx1 etc. If the channel's bit in +* rxChannelMask is set then if the channel's bit in freezeEnable is set the AGC loop for +* the channel is frozen, if the bit is clear then the AGC loop is set to run. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcFreezeSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint32_t freezeEnable); + +/** +* \brief Get the AGC freeze status for all Rx channels. +* +* This status only applied to Rx channels whose AGC loop is halted by AgcFreezeSet function not +* those which have been halted by GPIO. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[out] freezeEnable Bit0 (lsb) relates to Rx0, bit1 to Rx1 etc. If the channel's AGC +* loop is halted by AgcFreezeSet then it's bit is set in freezeEnable. Otherwise it is +* cleared. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcFreezeGet(adi_adrv903x_Device_t* const device, + uint32_t* const freezeEnable); + +/** +* \brief Allow AGC loop to run or be halted by a GPIO signal. +* +* A rising edge on the selected digital GPIO will cause the AGC loop to halt thereby fixing the +* AGC index until such time as there is a falling edge, upon which the AGC loop will continue it's +* normal operation. +* +* It is not possible to control an Rx AGC loop using GPIO_0. It is possible to control the AGC +* loop of serveral channels from a single GPIO. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] rxChannels Rx channels +* \param[in] gpioPin The digital GPIO to be used to control AGC loop. +* \param[in] enable Set to ADI_TRUE to setup AGC control by gpioPin for the channels specifed +* in rxChannels. Set to ADI_FALSE to disable AGC control by GPIO. gpioPin value as no effect +* in this case. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcFreezeOnGpioSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannels, + const adi_adrv903x_GpioPinSel_e gpioPin, + const uint8_t enable); + +/** +* \brief Get the GPIO signal, if any, configured to halt an Rx channel's AGC loop. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] rxChannel The Rx channel whose configuration to get. +* \param[out] gpioPin Is set to the digital GPIO being used to control AGC loop or to ADI_ADRV903X_GPIO_00 +* if AGC loop is not being controlled by any GPIO. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcFreezeOnGpioGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_GpioPinSel_e* const gpioPin); + +/** +* \brief Function to configure min/max gain indices allowed for AGC operation +* +* Min/Max gain indices can also be set with adi_adrv903x_AgcCfgSet() function. +* This function allows user to update min/max gain indices without configuring other AGC related parameters. +* Note: The function does not check for duplicated channel assignments across cfg structures. + Invalid channel mask values will return an error. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] agcGainRange array of structures of type adi_adrv903x_ AgcGainRange _t which will configure one or more channels +* \param[in] numOfAgcRangeCfgs number of configurations passed in the array +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcGainIndexRangeSet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_AgcGainRange_t agcGainRange[], + const uint32_t numOfAgcRangeCfgs); + +/** +* \brief Function to read AGC Gain range for selected channel +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] rxChannel Rx channel selection to read AGC gain range configuration +* \param[out] agcGainConfigReadback Pointer to gain range structure to be used to read back configuration +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcGainIndexRangeGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_AgcGainRange_t * const agcGainConfigReadback); + + +/** +* \brief Function to reset all AGC state machines and peak detector counters for selected channel/s +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] rxChannelMask Mask to select Rx channel/s of which AGC block will be reset +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcReset(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask); + + +/** +* \brief Programs the gain table settings for dual band external LNA output of selected Rx channels. +* +* +* Dual band LNA gain table has 4 rows to be programmed. User can program all 4 entries or +* a subset of it with this API function. +* +* For single GPIO (per band) mode, user can configure only first 2 rows of the gain table. +* This mode can be enabled with setting adi_adrv903x_AgcDualBandCfg_t->agcDualBandMaxGainIndex = 1 +* For 2 GPIO(per band), user should configure the gain table entries up to (including) +* adi_adrv903x_AgcDualBandCfg_t->agcDualBandMaxGainIndex. +* The gain table configs can be broadcast / multicast based on the channel mask +* parameter, rxChannelMask +* +*| rxChannelMask | Rx Channels Programmed | +*|:------------------------------------:|:-------------------------------------:| +*| bit[0] = 1 | Enables Rx0 gain table programming---| +*| bit[1] = 1 | Enables Rx1 gain table programming---| +*| bit[2] = 1 | Enables Rx2 gain table programming---| +*| bit[3] = 1 | Enables Rx3 gain table programming---| +*| bit[4] = 1 | Enables Rx4 gain table programming---| +*| bit[5] = 1 | Enables Rx5 gain table programming---| +*| bit[6] = 1 | Enables Rx6 gain table programming---| +*| bit[7] = 1 | Enables Rx7 gain table programming---| +* +* Eg: To program the same gain table to channels Rx0 and Rx4, the rxChannelMask +* should be set to 0x00000011 +* +* Eg: To program a single gain table to all channels, the rxChannelMask +* should be set to 0x000000FF +* +* Partial gain table loads can be done through this API. User can select gainIndexOffset and arraySize +* accordingly to write a partial table. This API writes 'arraySize' number of rows +* up to row 'gainIndexOffset'. For example, when gainIndexOffset=3 and arraySize=2, API loads gainTableRow[0] +* to row 2 and gainTableRow[1] to row 3. +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in,out] device Context variable - Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] rxChannelMask is the set of channels for which current gain table settings are to be programmed. +* Valid Rx channels include Rx0-Rx7 +* \param[in] gainIndexOffset is the starting gain index from which gain table is programmed (backwards direction). Maximum value is 3. +* \param[in] gainTableRow Array of gain table row entries for programming +* \param[in] arraySize is the number of gain table rows to be programmed. Maximum value is 4 +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxDualBandLnaGainTableWrite(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint8_t gainIndexOffset, + const adi_adrv903x_RxDualBandLnaGainTableRow_t gainTableRow[], + const uint32_t arraySize); + +/** +* \brief Reads the dual band external LNA gain table entries for Rx channels requested. +* +* This function can be called by the user to read back the currently programmed gain table +* for a given channel. This function reads the current gain table settings from ADRV903X gain table Static RAMs +* for the requested channel and stores it in the provided memory reference of type adi_adrv903x_RxDualBandLnaGainTableRow_t +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in,out] device Context variable - Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] rxChannelMask represents the channels for which gain table read back is requested. +* Valid Rx channels include Rx0-Rx7. Multiple channel selections are not allowed. +* \param[in] gainIndexOffset is the gain index from which gain table read back should start(backwards direction) +* \param[in,out] gainTableRow Read back array for gain table row entries which will be updated with the read back values +* \param[in] arraySize is the size of gainTableRow array. It is also the upper limit for the no. of gain indices to read +* \param[out] numGainIndicesRead is the actual no. of gain indices read from SRAM (output). A NULL can be passed +* if the value of no. of gain indices actually read is not required. +* +* \pre This function can be called by the user anytime after initialization. This API reads 'arraySize' number of rows +* up to row 'gainIndexOffset' row. For example when gainIndexOffset=3 and arraySize=2, API reads row 2 to gainTableRow[0] +* and row 3 to gainTableRow[1]. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxDualBandLnaGainTableRead(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint8_t gainIndexOffset, + adi_adrv903x_RxDualBandLnaGainTableRow_t gainTableRow[], + const uint32_t arraySize, + uint8_t* const numGainIndicesRead); + + +/** +* \brief Function to configure AGC Dual Band block. +* +* Rx Dual band AGC block allows the receive path to control external LNAs for Band A and Band B. +* 16 Analog GPIO pins can be used for this purpose. Each band can use 1 GPIO pin when 8 receivers +* are being used. Each band can use 2 GPIO pins when 4 receivers are being used. These GPIOs can be +* configured with adi_adrv903x_AgcDualBandGpioCfgSet function. +* A special gain table needs to be written for dual band AGC functionality by using adi_adrv903x_RxDualBandLnaGainTableWrite. +* This table has 4 rows, each having 2 bit external LNA control words to control 2 GPIOs at maximum. +* +* For dual band AGC, AGC block should also be configured and running with main path decimated power level detector +* enabled. +* +* +* Note: The function does not check for duplicated channel assignments across cfg structures. +* Invalid channel mask values will return an error. + +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] agcDualBandConfig array of structures of type adi_adrv903x_AgcDualBandCfg_t which will configure one or more channels +* \param[in] numOfAgcDualBandCfgs number of configurations passed in the array +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcDualBandCfgSet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_AgcDualBandCfg_t agcDualBandConfig[], + const uint32_t numOfAgcDualBandCfgs); + +/** +* \brief This function reads AGC dual band configuration of selected Rx channel +* Rx channel requested should be selected with adi_adrv903x_AgcDualBandCfg_t->rxChannelMask. +* Multiple channel selection isn't allowed + +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in,out] agcDualBandConfigReadBack Pointer to structure which will be used to read configuration +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcDualBandCfgGet(adi_adrv903x_Device_t * const device, + adi_adrv903x_AgcDualBandCfg_t * const agcDualBandConfigReadBack); + + +/** +* \brief Function to configure AGC Dual Band GPIO mapping. +* +* 16 analog GPIOs can be mapped to various external lna outputs as follows, +* +*| GPIO Analog Output | Allowed Signals | +*|:-------------------:|:-------------------------------------------------------------------------------------------:| +*| ANALOG_GPIO_0 | ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_0 or ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND0_0 | +*| ANALOG_GPIO_1 | ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_1 or ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND0_1 | +*| ANALOG_GPIO_2 | ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND1_0 or ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND1_0 | +*| ANALOG_GPIO_3 | ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND1_1 or ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND1_1 | +*| ANALOG_GPIO_4 | ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND0_0 or ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND0_0 | +*| ANALOG_GPIO_5 | ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND0_1 or ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND0_1 | +*| ANALOG_GPIO_6 | ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND1_0 or ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND1_0 | +*| ANALOG_GPIO_7 | ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND1_1 or ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND1_1 | +*| ANALOG_GPIO_8 | ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND0_0 or ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND0_0 | +*| ANALOG_GPIO_9 | ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND0_1 or ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND0_1 | +*| ANALOG_GPIO_10 | ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND1_0 or ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND1_0 | +*| ANALOG_GPIO_11 | ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND1_1 or ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND1_1 | +*| ANALOG_GPIO_12 | ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND0_0 or ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND0_0 | +*| ANALOG_GPIO_13 | ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND0_1 or ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND0_1 | +*| ANALOG_GPIO_14 | ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND1_0 or ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND1_0 | +*| ANALOG_GPIO_15 | ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND1_1 or ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND1_1 | +* +* where +* ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_0: Rx0 Band0 Ext LNA output word LSB +* ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_1: Rx0 Band0 Ext LNA output word MSB +* User can select the GPIOs desired to be configured through adi_adrv903x_AgcDualBandGpioCfg_t->gpioSelectionMask. +* API will skip configuring unselected GPIOs and analogGpioMapping[*] value for those GPIOs is a 'Don't care'. +* To release a selected GPIO, user can select ADI_ADRV903X_GPIO_SIGNAL_UNUSED. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] agcDualBandGpioConfig Dual band GPIO configuration structure +* +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcDualBandGpioCfgSet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_AgcDualBandGpioCfg_t * agcDualBandGpioConfig); + +/** +* \brief Function to read back AGC Dual Band GPIO mapping configuration. +* User can select the GPIOs desired to be readback through adi_adrv903x_AgcDualBandGpioCfg_t->gpioSelectionMask. +* This API will set the unselected GPIOs to ADI_ADRV903X_GPIO_SIGNAL_INVALID. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in,out] agcDualBandGpioConfigReadBack Dual band GPIO configuration structure +* +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcDualBandGpioCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_AgcDualBandGpioCfg_t* const agcDualBandGpioConfigReadBack); + +/** +* \brief Function to configure AGC GPIO resync functionality. This feature allows user to configure +* a GPIO to reset the gain update counter. In AGC holdover mode, adi_adrv903x_AgcCfg_t ->agcResetOnRxon = 0, +* AGC counters only reset when gain update counter expires. Gain update counter doesn't realign with TDD timing, +* and resync feature allows pulses from selected GPIO to resync gain update counter with TDD timing. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] rxChannelMask Rx channel mask to select the Rx channels to configure. Multiple channels can be selected +* \param[in] gpioSelection GPIO selection for resync feature to be configured for selected channels. ADI_ADRV903X_GPIO_INVALID +* can be selected to release a currently configured GPIO from selected channels. +* ADI_ADRV903X_GPIO_00 cannot be used for this feature. +* \param[in] enable 0:Disable resync feature, 1:Enable resync feature for selected channel/s +* +* +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcGpioReSyncSet(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + const adi_adrv903x_GpioPinSel_e gpioSelection, + const uint8_t enable); + +/** +* \brief Function to read AGC resync functionality. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] rxChannelMask Rx channel mask to select the Rx channels to configure. Multiple channels cannot be selected. +* \param[out] gpioSelection GPIO selection readback for selected channel. ADI_ADRV903X_GPIO_INVALID is returned if selected +* channel doesn't use resync functionality. +* \param[out] enable Readback value of resync enable status. 0:Resync feature is disabled, 1:Resync feature is enabled +* +* +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcGpioReSyncGet(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + adi_adrv903x_GpioPinSel_e * const gpioSelection, + uint8_t * const enable); + + +/** +* \brief Function to read active external LNA gain control word for Band A and Band B. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[in] rxChannel Rx channel selection to read band A/B active external lna control word +* \param[out] bandAExternalLnaGainWord Pointer to readback band A external lna control word +* \param[out] bandBExternalLnaGainWord Pointer to readback band B external lna control word +* +* +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcDualBandActiveExternalLnaGainWordGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint8_t * const bandAExternalLnaGainWord, + uint8_t * const bandBExternalLnaGainWord); + +/** +* \brief Function to read if the agc upper level was exceeded for all channels. The functions returns a byte +* that each bit represents a channel, from LSB being channel 0 and MSB being channel 7. Bit HIGH means the upper +* level was exceeded, and LOW it hasn't. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[out] agcULBlockerBitMask Pointer to agc_ul_blocker which bit 0 contains bitfield for channel 0, bit 1 for ch 1, and so on. +* Bit HIGH means the upper level was exceeded, and LOW it hasn't. +* +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcUpperLevelBlockerGet(adi_adrv903x_Device_t * const device, + uint8_t * const agcULBlockerBitMask); + +/** +* \brief Function to read if the agc lower level was exceeded for all channels. The functions returns a byte +* that each bit represents a channel, from LSB being channel 0 and MSB being channel 7. Bit HIGH means the lower +* level was exceeded, and LOW it hasn't. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[out] agcLLBlockerBitMask Pointer to agc_ll_blocker which bit 0 contains bitfield for channel 0, bit 1 for ch 1, and so on. +* Bit HIGH means the lower level was exceeded, and LOW it hasn't. +* +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcLowerLevelBlockerGet(adi_adrv903x_Device_t * const device, + uint8_t * const agcLLBlockerBitMask); + +/** +* \brief Function to read if the high threshold peak detector at the ADC or HB2 output was exceeded for all channels. +* The functions returns a byte that each bit represents a channel, from LSB being channel 0 and MSB being channel 7. +* Bit HIGH means the upper level was exceeded, and LOW it hasn't. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[out] thresholdPeakDetectorBitMask Pointer to byte which bit 0 contains bitfield for channel 0, bit 1 for ch 1, and so on. +* Bit HIGH means the high threshold peak detector at ADC or HB2 was exceeded, and LOW it hasn't. +* +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcHighThresholdPeakDetectorGet(adi_adrv903x_Device_t * const device, + uint8_t * const thresholdPeakDetectorBitMask); + +/** +* \brief Function to read if the low threshold peak detector at the ADC or HB2 output was exceeded for all channels. +* The functions returns a byte that each bit represents a channel, from LSB being channel 0 and MSB being channel 7. +* Bit HIGH means the lower level was exceeded, and LOW it hasn't. +* +*When high, this bit indicates that the high threshold peak detector at the Rx1 ADC or HB2 output was exceeded. +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. +* \param[out] thresholdPeakDetectorBitMask Pointer to byte which bit 0 contains bitfield for channel 0, bit 1 for ch 1, and so on. +* Bit HIGH means the low threshold peak detector at ADC or HB2 was exceeded, and LOW it hasn't. +* +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcLowThresholdPeakDetectorGet(adi_adrv903x_Device_t * const device, + uint8_t * const thresholdPeakDetectorBitMask); + + +#endif /* _ADI_ADRV903X_AGC_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_agc_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_agc_types.h new file mode 100644 index 0000000000000..1fedfc3689b5e --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_agc_types.h @@ -0,0 +1,192 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_agc_types.h + * \brief Contains ADRV903X API AGC data types + * +* ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_AGC_TYPES_H_ +#define _ADI_ADRV903X_AGC_TYPES_H_ + +#include "adi_library_types.h" +#include "adi_adrv903x_gpio_types.h" + +/** +* \brief Data structure to hold AGC peak settings +*/ +typedef struct adi_adrv903x_AgcPeak +{ + uint8_t adcOvldUpperThreshPeakExceededCnt; /*!< Number of peak events needed in excess of ADC Peak Detector's high threshold to trigger an over ranging condition. Valid range is 2 to 255 */ + uint8_t adcOvldGainStepAttack; /*!< AGC ADC overload gain index step size for attack. Valid range is 0 to 31 */ + + uint8_t adcOvldLowThresh; /*!< AGC ADC overload low threshold. Valid range is 0 to 8, where 8 means full scale of ADC. Threshold in dBFS = 20log(adcOvldLowThresh/8) */ + uint8_t adcOvldLowerThreshPeakExceededCnt; /*!< Number of peak events needed in excess of adcOvldLowThresh to prevent an under ranging condition. Valid range is 2 to 255 */ + uint8_t adcOvldGainStepRecovery; /*!< AGC ADC overload gain index step size for recovery. Valid range is 0 to 31 */ + + uint8_t hb2OverloadDurationCnt; /*!< If hb2OverloadThreshCnt number of samples exceed HB2 high/low thresholds within hb2OverloadDurationCnt sample group, + threshold exceeded signal is asserted and threshold exceeded counter is incremented. If this counter exceeds HB2 high/low + threshold exceeded counts then AGC makes the final gain adjustment. Valid range is 0 to 63.*/ + uint8_t hb2OverloadThreshCnt; /*!< If hb2OverloadThreshCnt number of samples exceed HB2 high/low thresholds within hb2OverloadDurationCnt sample group, + threshold exceeded signal is asserted and threshold exceeded counter is incremented. If this counter exceeds HB2 high/low + threshold exceeded counts then AGC makes the final gain adjustment. Valid range is 0 to 7. */ + + uint16_t hb2HighThresh; /*!< AGC HB2 output high threshold. Valid range from 0 to 16383. */ + uint8_t hb2UpperThreshPeakExceededCnt; /*!< Number of peak events needed in excess of hb2HighThresh to trigger an over ranging condition. Valid range from 1 to 255 */ + uint8_t hb2GainStepAttack; /*!< AGC HB2 output attack gain step. Valid range from 0 to 31 */ + + uint16_t hb2UnderRangeHighThresh; /*!< AGC HB2 output low threshold for 3rd interval (hb2UnderRangeHighInterval) for multiple time constant AGC mode. Valid range from 0 to 16383. */ + uint8_t hb2UnderRangeHighThreshExceededCnt; /*!< Number of peak events needed in excess of hb2UnderRangeHighThresh to prevent an under ranging condition. Valid range from 1 to 255 */ + uint8_t hb2GainStepHighRecovery; /*!< AGC HB2 gain index step size. Valid range from 0 to 31 */ + + /* Only used when fast recovery is enabled */ + uint16_t hb2UnderRangeMidThresh; /*!< AGC HB2 output low threshold for 2nd interval (hb2UnderRangeMidInterval) for multiple time constant AGC mode. Valid range from 0 to 16383 */ + uint8_t hb2UnderRangeMidThreshExceededCnt; /*!< Number of peak events needed in excess of hb2UnderRangeMidThresh to prevent an under ranging condition. Valid range from 0 to 255 */ + uint8_t hb2GainStepMidRecovery; /*!< AGC HB2 gain index step size, when the HB2 Low Overrange interval 3 triggers (under ranges). Valid range from 0 to 31 */ + + uint16_t hb2UnderRangeLowThresh; /*!< AGC HB2 output low threshold for hb2UnderRangeLowInterval. Valid range from 0 to 16383 */ + uint8_t hb2UnderRangeLowThreshExceededCnt; /*!< Number of peak events needed in excess of hb2UnderRangeLowThesh to prevent an under ranging condition. Valid range from 0 to 255 */ + uint8_t hb2GainStepLowRecovery; /*!< AGC HB2 gain index step size, when the HB2 Low Overrange interval 2 triggers (under ranges). Valid range from 0 to 31 */ + + uint16_t hb2UnderRangeLowInterval; /*!< Update interval for AGC fast recovery loop mode in AGC clock cycles. Valid range is 0 to 65535. + This update interval is used as gain update counter period when fast recovery is enabled */ + uint8_t hb2UnderRangeMidInterval; /*!< 2nd update interval for multiple time constant AGC mode. + Calculated as (hb2UnderRangeMidInterval+1)*hb2UnderRangeLowInterval_ns. Valid range is 0 to 63 */ + uint8_t hb2UnderRangeHighInterval; /*!< 3rd update interval for multiple time constant AGC mode. + Calculated as (hb2UnderRangeHighInterval+1)*2nd update interval. Valid range is 0 to 63 */ + /* Only used when fast recovery is enabled */ + + uint8_t enableHb2Overload; /*!< Enable or disables the HB2 overload peak detector. */ + uint8_t hb2OverloadPowerMode; /*!< Selects HB2 sample type 1:I^2+Q^2 // 0:max(|I|, |Q|) + 1:For this mode, HB2 thresholds can be calculated as : Threshold = 2^14 * 10^(-x dBFS / 10) where x is the desired threshold in dBFS + 0:For this mode, HB2 thresholds can be calculated as : Threshold = 2^14 * 10^(-x dBFS / 20) where x is the desired threshold in dBFS*/ + uint8_t hb2OverloadSignalSelection; /*!< HB2 peak detector signal source selection. 1:Select input of HB2 . 0:Select output of HB2*/ +} adi_adrv903x_AgcPeak_t; + +/** +* \brief Data structure to hold AGC power settings +* The evaluation software GUI for the product can be used to generate a structure with suggested settings. +*/ +typedef struct adi_adrv903x_AgcPower +{ + uint8_t underRangeHighPowerThresh; /*!< AGC power measurement detect lower 0 threshold. Valid Range from 0 to 127. Threshold_in_dBFS = (-1 * underRangeHighPowerThresh) */ + uint8_t underRangeHighPowerGainStepRecovery; /*!< AGC power measurement detect lower 0 recovery gain step. Valid range from 0 to 31 */ + + uint8_t underRangeLowPowerThresh; /*!< AGC power measurement detect lower 1 threshold. Valid offset from 0 to 31. This configures an offset from underRangeHighPowerThresh. + Offset_in_dBFS = (-1 * underRangeLowPowerThresh)*/ + uint8_t underRangeLowPowerGainStepRecovery; /*!< AGC power measurement detect lower 1 recovery gain step. Valid range from 0 to 31 */ + + uint8_t overRangeLowPowerThresh; /*!< AGC upper 0 threshold for power measurement. Valid Range from 0 to 127. Threshold_in_dBFS = (-1 * overRangeLowPowerThresh)*/ + uint8_t overRangeLowPowerGainStepAttack; /*!< AGC power measurement detect lower 0 attack gain step. Valid range from 0 to 31 */ + + uint8_t overRangeHighPowerThresh; /*!< AGC upper 1 threshold for power measurement. Valid offset from 0 to 15. This configures an offset from overRangeLowPowerThresh. + Offset_in_dBFS = (-1 * overRangeHighPowerThresh) */ + uint8_t overRangeHighPowerGainStepAttack; /*!< AGC power measurement detect lower 1 attack gain step. Valid range from 0 to 31 */ + + uint8_t powerEnableMeasurement; /*!< Enable the Rx power measurement block. (0/1) */ + uint8_t powerInputSelect; /*!< Use output of Rx for power measurement. 0: DC Offset output, 1: RFIR output, 2: QFIR output, 3:HB2 output. Valid Range from 0 to 3 */ + uint8_t powerMeasurementDuration; /*!< Average power measurement duration = 8*2^powerMeasurementDuration. Valid range from 0 to 31 */ + +} adi_adrv903x_AgcPower_t; + +/** +* \brief Data structure to hold all AGC configuration settings for initialization +* The evaluation software GUI for the product can be used to generate a structure with suggested settings. +*/ +typedef struct adi_adrv903x_AgcCfg +{ + uint32_t rxChannelMask; /*!< Channel mask of Rx channels to apply these settings to, or that settings were read from */ + uint8_t agcRxMaxGainIndex; /*!< AGC Rx max gain index. Valid range is from 0 to 255 */ + uint8_t agcRxMinGainIndex; /*!< AGC Rx min gain index. Valid range is from 0 to 255 */ + uint32_t agcGainUpdateCounter; /*!< AGC gain update time in AGC clock cycles. Valid range is from 0 to 4194303*/ + uint8_t agcChangeGainIfThreshHigh; /*!< Enable immediate gain change if high threshold counter is exceeded. + Bit 0 enables ADC high threshold, Bit 1 enables HB2 high threshold */ + uint8_t agcSlowLoopSettlingDelay; /*!< On any gain change, the AGC waits for twice this time (specified in AGC clock cycles) to allow + gain transients to flow through the Rx path before starting any measurements. Valid range is from 0 to 255 */ + uint8_t agcEnableFastRecoveryLoop; /*!< 1:Enable fast recovery. 0:Disable fast recovery */ + uint8_t agcPeakThreshGainControlMode; /*!< 1:Enable gain change based only on the signal peak threshold over-ranges. + Power based AGC changes are disabled in this mode. 0:Disable*/ + uint8_t agcLowThreshPreventGainInc; /*!< 1:Prevent gain index from incrementing (by power measurements) if peak thresholds are being exceeded 0:Don't prevent*/ + uint8_t agcResetOnRxon; /*!< 1: Reset the AGC slow loop state machine to max gain when the Rx Enable is taken low 0:Don't reset */ + uint8_t agcRxAttackDelay; /*!< On entering Rx, the Rx AGC is kept inactive for a period = agcRxAttackDelay*1us. Valid range is from 0 to 63 */ + uint8_t agcAdcResetGainStep; /*!< Indicates how much gain steps to reduce when a reset happens in the ADC. + Typically larger (1-2dB) than the agc_ovrg_gain_step. Valid range is from 0 to 31 */ + uint8_t agcPeakWaitTime; /*!< AGC peak wait time in AGC clock cycles. Valid range is from 0 to 3. Configure the duration that + the gain control algorithms wait before enabling regular operation of the peak detectors after a peak is detected*/ + adi_adrv903x_AgcPower_t agcPower; + adi_adrv903x_AgcPeak_t agcPeak; +} adi_adrv903x_AgcCfg_t; + +/** +* \brief Data structure to set/get the AGC min/max gain index for one or more Rx channels. +*/ +typedef struct adi_adrv903x_AgcGainRange +{ + uint32_t rxChannelMask; /*!< Channel mask of Rx channels to apply these settings to, or that settings were read from */ + uint8_t maxGainIndex; /*!< Max gain index the AGC can use */ + uint8_t minGainIndex; /*!< Min gain index the AGC can use */ +} adi_adrv903x_AgcGainRange_t; + + +/** +* \brief Data structure to hold AGC Dualband configuration. +*/ +typedef struct adi_adrv903x_AgcDualBandCfg +{ + uint32_t rxChannelMask; /*!< Channel mask of Rx channels to apply these settings to, or that settings were read from */ + uint8_t agcDualBandEnable; /*!< Enable AGC operation for dualband receiver */ + uint8_t agcRxDualbandExtTableUpperIndex; /*! Upper Band Power + Lower Band Power + margin, the signal contains other components + than the two bands, and AGC should behave like a single band system. Margin is in 0.5dBFS steps, i.e. margin[dBFS] = 0.5 * agcDualbandPwrMargin + Range for agcDualbandPwrMargin: [0-31] */ + uint8_t agcDualbandLnaStep; /*! Lower Band Power + margin, and Lower Band Power > Upper Band Power + margin checks). + The margin compares the powers of the bands to change the LNA of one band so that powers of the bands match. + Value is in 0.5dBFS resolution, i.e. margin[dBFS] = 0.5 * agcDualbandLnaStep */ + uint8_t agcDualbandHighLnaThreshold; /*!enableGainCompensationForExtLna is set to 1 */ + uint8_t externalControlWord; /*!< 2 bit external LNA control word. Range:[0-3] */ + +} adi_adrv903x_RxDualBandLnaGainTableRow_t; + +/** + * \brief Data structure to hold ADRV903X Rx dual band external LNA analog gpio output mapping settings + */ +typedef struct adi_adrv903x_AgcDualBandGpioCfg +{ + uint16_t gpioSelectionMask; /* User can select one or multiple analog GPIOs(out of 16 analog GPIO pins) to configure */ + adi_adrv903x_GpioSignal_e analogGpioMapping[ADI_ADRV903X_GPIO_ANALOG_COUNT]; /* Gpio signal assignments for GPIOs selected with gpioSelectionMask. gpioSelectionMask Bit0 + * selects analogGpioMapping[0], Bit1 selects analogGpioMapping[1] and so on. For unselected + * GPIOs the value of analogGpioMapping[*] is don't care. */ + +} adi_adrv903x_AgcDualBandGpioCfg_t; +#endif /* _ADI_ADRV903X_AGC_TYPES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cals.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cals.h new file mode 100644 index 0000000000000..b148611d75d36 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cals.h @@ -0,0 +1,571 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_cals.h +* \brief Contains ADRV903X processor function prototypes for +* adi_adrv903x_cals.c +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef _ADI_ADRV903X_CALS_H_ +#define _ADI_ADRV903X_CALS_H_ + +#include "adi_adrv903x_cals_types.h" +#include "adi_adrv903x_error.h" +#include "adi_adrv903x_cpu_cmd_dc_offset.h" + + +/**************************************************************************** + * Initialization functions + **************************************************************************** + */ + +/** + * \brief Runs the ADRV903X initialization calibrations + * + * \pre This function is called after the device has been initialized, and the RF PLL has been + * verified to be locked + * + * + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * \param[in] initCals A pointer to the InitCals structure which calibrations to run + * +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsRun(adi_adrv903x_Device_t* const device, + const adi_adrv903x_InitCals_t* const initCals); + +/** + * \brief Gets the device initialization calibration status + * + * This function provides updates to represent the status of the initialization calibrations + * calsSincePowerUp, calsLastRun are bit wise representations of calibration status. + * Each bit represents a calibration. adi_adrv903x_InitCalibrations_e defines the unique initialization + * calibration bit masks + * + * \pre This function may be called any time after the device has been initialized, and + * initialization calibrations have taken place + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * \param[out] initStatus Pointer passed to obtain init calibrations values. + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsDetailedStatusGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_InitCalStatus_t* const initStatus); + +/** +* \brief Performs a Lookup of the Init Cal Status +* +* \pre This function may be called any time after the device has been initialized, and +* initialization calibrations have taken place +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Context variable - A pointer to the device settings structure +* \param[out] initCalErrData Pointer passed to obtain init calibrations error data. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsDetailedStatusGet_v2( adi_adrv903x_Device_t* const device, + adi_adrv903x_InitCalErrData_t* const initCalErrData); + +/** + * \brief Blocking waits for the ADRV903X initialization calibrations to complete + * + * \pre This function is called after adi_adrv903x_InitCalsRun to wait for init cals to finish + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * \param[in] timeoutMs A timeout value in milliseconds to wait for the calibrations to complete + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsWait( adi_adrv903x_Device_t* const device, + const uint32_t timeoutMs); + +/** + * \brief Blocking waits for the initialization calibrations to complete and provides detailed status + * + * \pre This function is called after adi_adrv903x_InitCalsRun to wait for init cals to finish + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * \param[in] timeoutMs A timeout value in milliseconds to wait for the calibrations to complete + * \param[out] initCalErrData Pointer passed to obtain init calibrations error data + * Note: Optional Parameter (i.e. NULL Pointer passed will still perform the InitCalsWait) + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsWait_v2( adi_adrv903x_Device_t* const device, + const uint32_t timeoutMs, + adi_adrv903x_InitCalErrData_t* const initCalErrData); + +/** + * \brief Immediate initialization calibration completion check + * + * This function is similar to adi_adrv903x_InitCalsWait except it does + * not block the thread waiting for the enabled init calibrations to complete. + * This function returns the initialization calibration status immediately + * allowing the application layer to do other work while the calibrations are + * running. + * + * \pre This function is called after the initialization calibrations have been + * started + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * \param[out] areCalsRunning A pointer to a uint8_t return variable: Returns 1 if + * init cals are running, 0 = init cals are not running (either complete + * or have not started) + * \param[in] calErrorCheck check for InitCals error if true + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsCheckCompleteGet(adi_adrv903x_Device_t* const device, + uint8_t* const areCalsRunning, + const uint8_t calErrorCheck); + +/** +* \brief Immediate initialization calibration completion check +* +* This function is similar to adi_adrv903x_InitCalsWait except it does +* not block the thread waiting for the enabled init calibrations to complete. +* This function returns the initialization calibration status immediately +* allowing the application layer to do other work while the calibrations are +* running. +* +* \pre This function is called after the initialization calibrations have been +* started +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Context variable -A pointer to the device settings structure +* \param[out] areCalsRunning A pointer to a uint8_t return variable: Returns 1 if +* init cals are running, 0 = init cals are not running (either complete +* or have not started) + * \param[out] initCalErrData Pointer passed to obtain init calibrations error data when cals have completed + * Note: Optional Parameter (i.e. NULL Pointer passed will perform the InitCalsCheckCompleteGet) +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsCheckCompleteGet_v2( adi_adrv903x_Device_t* const device, + uint8_t* const areCalsRunning, + adi_adrv903x_InitCalErrData_t* const initCalErrData); + + +/** + * \brief Aborts an on-going CPU initialization calibration sequence + * + * The CPU init calibrations can take several seconds. This function is called when + * the BBIC needs to intercede and stop the current initialization calibration sequence. + * + * \pre This function is called any time during the initialization calibration process + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsAbort(adi_adrv903x_Device_t* const device); + + +/** + * \brief Enables or Disables Tracking Calibrations + * + * If the cal mask bit corresponding to an unconfigured Tx/Rx/ORx channel is set, that bit is ignored by this + * function (and the CPU firmware). + * + * \pre This command must be called after a full device initialization + * has taken place, all PLLs are configured and locked, Multi-Chip Sync (MCS) has taken place, and the JESD204B + * links are configured and operational. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * \param[in] calMask Mask of tracking calibrations to enable or disable. The calibration bit positions + * correspond to adi_adrv903x_TrackingCalibrationMask_e. + * \param[in] channelMask Mask of channels on which tracking calibrations should be enabled or disabled + * \param[in] enableDisableFlag Indicates if calibrations in enableMask should be enabled or disabled + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TrackingCalsEnableSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TrackingCalibrationMask_t calMask, + const uint32_t channelMask, + const adi_adrv903x_TrackingCalEnableDisable_e enableDisableFlag); + +/** +* \brief Enables or Disables Tracking Calibrations +* +* If the cal mask bit corresponding to an unconfigured Tx/Rx/ORx channel is set, that bit is ignored by this +* function (and the CPU firmware). +* +* \pre This command must be called after a full device initialization +* has taken place, all PLLs are configured and locked, Multi-Chip Sync (MCS) has taken place, and the JESD204B +* links are configured and operational. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Context variable -A pointer to the device settings structure +* \param[in] calMask Mask of tracking calibrations to enable or disable. The calibration bit positions +* correspond to adi_adrv903x_TrackingCalibrationMask_e. +* \param[in] channelMask Mask of channels in structure adi_adrv903x_ChannelTrackingCals_t on which tracking calibrations should be enabled or disabled +* \param[in] enableDisableFlag Indicates if calibrations in enableMask should be enabled or disabled +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TrackingCalsEnableSet_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TrackingCalibrationMask_e calMask, + const adi_adrv903x_ChannelTrackingCals_t* const channelMask, + const adi_adrv903x_TrackingCalEnableDisable_e enableDisableFlag); + +/** +* \brief Gets the set of tracking calibrations that are enabled +* +* In the returned set of per-channel bitmasks, each bit represents the enable/disable +* state of one of the calibrations. The calibration bit positions correspond to +* adi_adrv903x_TrackingCalibrationMask_e. The state can be interpreted as 1 = enabled +* and 0 = disabled. +* +* System calibration (e.g. ADI_ADRV903X_TC_TX_SERDES) state will be returned on channel 0 only +* (even if this channel is not configured). +* +* \pre This command must be called after a full device initialization has taken place. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Context variable -A pointer to the device settings structure +* \param[in,out] enableMasks Pointer to location in which enable/disable state should be placed +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TrackingCalsEnableGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TrackingCalEnableMasks_t* const enableMasks); + +/** +* \brief Allows reading the current state of all tracking calibrations +* +* The returned state information is indexed per channel and per calibration ID (see +* adi_adrv903x_TrackingCalibrationId_e). System calibration (e.g. ADI_ADRV903X_TC_TX_SERDES) +* state will be returned on channel 0 only, even if this channel is not configured. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Context variable -A pointer to the device settings structure +* \param[in,out] calState Pointer to tracking calibration state structure to store the read values +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TrackingCalAllStateGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TrackingCalState_t* const calState); + + +/** + * \brief Returns the status of the tracking calibration + * + * The function can be called to read back the status of the + * calibration including metrics like error codes, percentage of data + * collected for current cal, the performance of the cal and the number of + * times the cal has run and updated the hardware. + * + * \pre This function may be called any time after the device has been initialized, and + * initialization calibrations have taken place + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * \param[in] calId Indicate a type of cal tracking to get as defined in adi_adrv903x_TrackingCalibrationMask_e + * \param[in] channel Channel selection to read back cal status. Must be a single channel. + * \param[out] calStatus Status of the calibration, as a structure of type adi_adrv903x_CalStatus_t is returned to this pointer address + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TrackingCalStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TrackingCalibrationMask_e calId, + const adi_adrv903x_Channels_e channel, + adi_adrv903x_CalStatus_t* const calStatus); + + +/** + * \brief Returns the status of the init calibration + * + * The function can be called to read back the status of the + * calibration including metrics like error codes, percentage of data + * collected for current cal, the performance of the cal and the number of + * times the cal has run and updated the hardware. + * + * \pre This function may be called any time after the device has been initialized, and + * initialization calibrations have taken place + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * \param[in] calId Indicate a type of cal tracking to get as defined in adi_adrv903x_TrackingCalibrations_e + * \param[in] channel Channel selection to read back cal status. Must be a single channel. + * \param[out] calStatus Status of the calibration, as a structure of type adi_adrv903x_CalStatus_t is returned to this pointer address + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_InitCalibrations_e calId, + const adi_adrv903x_Channels_e channel, + adi_adrv903x_CalStatus_t* const calStatus); + +/** + * \brief Gets current Hrm filter coeficients for the provided channels in channelMask. + * + * \pre This function may be called any time after the device has been initialized, and + * initialization calibrations have taken place + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * \param[in] channelMask Channel mask for which channels HRM data are to be retrieved. At least one bit in must be set. + * \param[out] txHrmDataArray points to an array of adi_adrv903x_TxHrmData_t with the number of elements of the array being the number of set bits + * in channelMask. The first element in the array is the first bit set, starting from LSB. The size is expected to be + * the number of bits High in channelMask, with min size of array being 1, and max being 8. For example, for channelMask + * equal to 0b01101000, the first element in the array will contain HRM data for Tx3, and the third (and last) will be + * relative to Tx6. + * \param[in] arrayLength explicit mention of the number of elements in txHrmDataArray. Must match the number of bits set in channelMask. + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxHrmDataGet(adi_adrv903x_Device_t* const device, + const uint8_t channelMask, + adi_adrv903x_TxHrmData_t txHrmDataArray[], + uint32_t arrayLength); + +/** + * \brief Gets current Hrm filter coeficients for the provided channels in channelMask. + * The user should call this function following an LO reprogram that demands a change in HRM coefficients. + * + * \pre This function may be called any time after the device has been initialized, and + * initialization calibrations have taken place + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * \param[in] channelMask Channel mask for which channels HRM data are to be retrieved. At least one bit in must be set. + * \param[in] txHrmDataArray points to an array of adi_adrv903x_TxHrmData_t with the number of elements of the array being the number of set bits + * in channelMask. The first element in the array is the first bit set, starting from LSB. The size is expected to be + * the number of bits High in channelMask, with min size of array being 1, and max being 8. For example, for channelMask + * equal to 0b01101000, the first element in the array will contain HRM data for Tx3, and the third (and last) will be + * relative to Tx6. + * \param[in] arrayLength explicit mention of the number of elements in txHrmDataArray. Must match the number of bits set in channelMask. + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxHrmDataSet(adi_adrv903x_Device_t* const device, + const uint8_t channelMask, + const adi_adrv903x_TxHrmData_t txHrmDataArray[], + uint32_t arrayLength); + + + +/** + * \brief Returns detailed status information specific to the private calibration + * + * \pre This function may be called any time after the device has been initialized, and + * initialization calibrations have taken place + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * \param[in] channel Channel selection to read back cal status. Must be a single channel + * \param[in] objId Object ID of calibration or system component + * \param[in, out] calStatusGet Status of the calibration. Size of calStatusGet must be equal or greater than length param. + * \param[in] length Length of the configuration in bytes + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CalPvtStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Channels_e channel, + const uint32_t objId, + uint8_t calStatusGet[], + uint32_t length); + +/** + * \brief Returns status specific information calibration + * + * \pre This function may be called any time after the device has been initialized, and + * initialization calibrations have taken place + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * \param[in] channel Channel selection to read back cal status. Must be a single channel + * \param[in] objId Object ID of calibration or system component + * \param[in, out] calStatusGet Status of the calibration. Size of calStatusGet must be equal or greater than length param. + * \param[in] length Length of the configuration in bytes + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CalSpecificStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Channels_e channel, + const uint32_t objId, + uint8_t calStatusGet[], + uint32_t length); + +/** +* \brief Enables or disables Digital DC Offset Tracking for one or more channels. +* +* For both parameters use adi_adrv903x_Channels_e to construct the mask parameters. +* +* For example: +* +* rxChannelMask | rxChannelEnableDisable | Effect +* --------------+------------------------+------------------------------------------------------- +* 0x01 | 0x01 | Enables Rx0. No effect on other channels. +* 0x03 | 0x02 | Disables Rx0, Enables Rx1. No effect on other channels. +* 0xF0 | 0x00 | Disables Rx4-7. No effect on other channels. +* 0x0F | 0xFF | Enables Rx0-3. No effect on other channels. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Context variable -A pointer to the device settings structure +* \param[in] rxChannelMask Mask to select Rx channels to be affected by this function call. A channel whose bit is not +* set in this parameter will not be affected by the call. +* \param[in] rxChannelEnableDisable Each bit indicates whether to enable or disable digital DC offset tracking for the +* corresponding channel. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DigDcOffsetEnableSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint32_t rxChannelEnableDisable); + +/** +* \brief Query if Digital DC Offset Tracking is enabled or disabled for a single Rx channel. +* +* It is an error to call this function for an Rx channel that is not initialized or for an ORx channel. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Context variable -A pointer to the device settings structure +* \param[in] rxChannel The Rx channel to query. Values indicating an ORx channel are not a valid. +* \param[out] isEnabled Zero is written here if the feature is disabled. Otherwise a non-zero value is written. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DigDcOffsetEnableGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint8_t* const isEnabled); + +/** + * \brief Reset Tx LOL + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Context variable -A pointer to the device settings structure + * \param[in] txLolReset pointer with special Tx LOL channel mask and reset type + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxLolReset(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxLolReset_t* const txLolReset); + +/** +* \brief Reset Tx QEC +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Context variable -A pointer to the device settings structure +* \param[in] txQecReset pointer with special Tx QEC channel mask and reset type +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxQecReset(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxQecReset_t* const txQecReset); + +/** + * \brief Set Dig Dc offset configuration for selected channel/s. User can select 1dB corner for + * DC offset filter through dcOffsetCfg structure. FW calculates the required mshift and multiplier + * values based on this corner frequency and configures the transceiver device. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in,out] device Context variable adi_adrv903x_Device_t pointer to the device data structure + * \param [in] dcOffSetCfg Dc offset configuration to set + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DigDcOffsetCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuCmd_SetDcOffset_t* const dcOffSetCfg); + +/** + * \brief This function reads Dig Dc offset configuration for selected channel. adi_adrv903x_CpuCmd_GetDcOffset_t + * structure contains the values configured in transceiver device based upon corner frequency selected by + * adi_adrv903x_DigDcOffsetCfgSet() function call. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in,out] device Context variable adi_adrv903x_Device_t pointer to the device data structure + * \param [in,out] dcOffSetCfg Pointer to Dc offset configuration for readback + * + * \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DigDcOffsetCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_CpuCmd_GetDcOffsetResp_t* const dcOffSetCfg); +#endif /* _ADI_ADRV903X_CALS_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cals_structs.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cals_structs.h new file mode 100644 index 0000000000000..a735ffb78cd6e --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cals_structs.h @@ -0,0 +1,47 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_cals_structs.h + * + * \brief Contains ADRV903X Calibration data types + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_CAL_STRUCTS_H__ +#define __ADRV903X_CAL_STRUCTS_H__ + +#include "adi_adrv903x_platform_pack.h" + +/** + * \brief Data structure to hold common init and tracking calibration status information + */ +ADI_ADRV903X_PACK_START +typedef struct adi_adrv903x_CalStatus +{ + uint32_t errorCode; /*!< Current error condition reported by the calibration */ + uint32_t percentComplete; /*!< Percentage of completion of the last iteration + * %20 = Data captures have been started in HW + * %30 = Data captures are complete, DPD is calculating signal metrics and stability related data + * %40 = DPD is performing path delay calculation if needed + * %50 = DPD is performing sample and gain alignment + * %60 = DPD is running feature filter and Xcorr stage + * %80 = DPD is running Cholesky decomposition + * %90 = DPD is calculating robustness metrics + * %100 = DPD has finished iteration without any error + */ + uint32_t performanceMetric; /*!< Calibration-specific metric for how well the calibration is performing: + * ADI_ADRV903X_IC_TXBBF: N/A + * ADI_ADRV903X_IC_RXTIA: N/A + */ + uint32_t iterCount; /*!< Running counter that increments each time the calibration runs to completion */ + uint32_t updateCount; /*!< Running counter that increments each time the calibration updates the correction/actuator hardware */ +} adi_adrv903x_CalStatus_t; +ADI_ADRV903X_PACK_FINISH + +#endif /* __ADRV903X_CAL_STRUCTS_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cals_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cals_types.h new file mode 100644 index 0000000000000..3415b2e5bac68 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cals_types.h @@ -0,0 +1,287 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_cals_types.h + * + * \brief Contains ADRV903X Calibration data types + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_CAL_TYPES_H__ +#define __ADRV903X_CAL_TYPES_H__ + +#include "adi_adrv903x_cpu_error_codes_types.h" +#include "adi_adrv903x_cals_structs.h" + +#ifndef ADI_ADRV903X_FW +#include "adi_adrv903x_platform_pack.h" +#else +#include "adi_adrv903x_platform_pack.h" +#include "adrv903x_cpu_object_ids_types.h" +#include "adrv903x_cpu_error_codes_types.h" +#endif + +/* Number of channels that can be calibrated */ +#define ADI_ADRV903X_CPU_NUM 2U +#define ADI_ADRV903X_NUM_INIT_CAL_CHANNELS 8U +#define ADI_ADRV903X_NUM_TRACKING_CAL_CHANNELS 8U +#define ADI_ADRV903X_CHAR_ARRAY_MAX 256U + +/* Size of struct that contains TxHRM data for one channel */ +#define TX_HRM_CAL_DATA_PER_CHANNEL_SIZE 48U + +/** + * \brief Initial calibration mask + */ +typedef enum adi_adrv903x_InitCalibrations +{ + ADI_ADRV903X_IC_RX_DC_OFFSET = 2, /*!< RX DC Offet calibration */ + ADI_ADRV903X_IC_ADC_RX = 4, /*!< ADC Orx calibration */ + ADI_ADRV903X_IC_ADC_ORX = 8, /*!< ADC Orx calibration */ + ADI_ADRV903X_IC_ADC_TXLB = 16, /*!< ADC Tx loopback calibration */ + ADI_ADRV903X_IC_TXDAC = 32, /*!< Tx DAC calibration */ + ADI_ADRV903X_IC_TXBBF = 64, /*!< Tx BB filter calibration */ + ADI_ADRV903X_IC_TXLB_FILTER = 16384, /*!< Tx Loopback filter calibration */ + ADI_ADRV903X_IC_TXLB_PATH_DLY = 128, /*!< Tx LB path delay calibration */ + ADI_ADRV903X_IC_TX_ATTEN_CAL = 256, /*!< Tx atten phase/gain calibration (NOTE: not implemented) */ + ADI_ADRV903X_IC_HRM = 512, /*!< HRM initial calibration */ + ADI_ADRV903X_IC_TXQEC = 1024, /*!< TxQEC initial calibration */ + ADI_ADRV903X_IC_TXLOL = 2048, /*!< TxLOL initial calibration */ + ADI_ADRV903X_IC_SERDES = 4096, /*!< SerDes initial calibration */ + ADI_ADRV903X_IC_TXRX_PHASE = 131072, /*!< TxRxPhase initial calibration */ + + ADI_ADRV903X_IC_RXSPUR = 262144, /*!< RxSpur initial calibration. NOT included in ADI_ADRV903X_IC_ALL_CALS below, debug feature.*/ + +} adi_adrv903x_InitCalibrations_e; + +/** + * \brief JrxRepair Start up Mode + */ +typedef enum adi_adrv903x_JrxRepairInitMode +{ + ADI_ADRV903X_JRXREPAIR_INIT_NORMAL = 0x0U, /*!< JRx Repair must be performed if init cal fails, at runtime or if history is present */ + ADI_ADRV903X_JRXREPAIR_INIT_NONSCREENED = 0x2U, /*!< JRx repair is applied automatically for all the transceivers that have not been screened */ + ADI_ADRV903X_JRXREPAIR_INIT_ALL = 0x3U, /*!< JRx repair is applied automatically to all the transceivers */ +} adi_adrv903x_JrxRepairInitMode_e; + +typedef uint64_t adi_adrv903x_InitCalibrations_t; +#define ADI_ADRV903X_IC_ALL_CALS ((adi_adrv903x_InitCalibrations_t)( ADI_ADRV903X_IC_RX_DC_OFFSET \ + | ADI_ADRV903X_IC_ADC_RX \ + | ADI_ADRV903X_IC_ADC_ORX \ + | ADI_ADRV903X_IC_ADC_TXLB \ + | ADI_ADRV903X_IC_TXDAC \ + | ADI_ADRV903X_IC_TXBBF \ + | ADI_ADRV903X_IC_TXLB_FILTER \ + | ADI_ADRV903X_IC_TXLB_PATH_DLY \ + | ADI_ADRV903X_IC_HRM \ + | ADI_ADRV903X_IC_TXQEC \ + | ADI_ADRV903X_IC_TXLOL \ + | ADI_ADRV903X_IC_SERDES \ + | ADI_ADRV903X_IC_TXRX_PHASE)) + +/** +* \brief Data structure to hold initial calibration information +*/ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_InitCals +{ + adi_adrv903x_InitCalibrations_t calMask; /*!< Mask of adi_adrv903x_InitCalibrations_e to run on init */ + uint32_t rxChannelMask; /*!< Mask to hold Rx channels to run on init */ + uint32_t txChannelMask; /*!< Mask to hold Tx channels to run on init */ + uint32_t orxChannelMask; /*!< Mask to hold ORx channels to run on init */ + uint8_t warmBoot; /*!< (not supported) */ +} adi_adrv903x_InitCals_t;) + +/** +* \brief Data structure to hold initial calibration information +*/ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_ChannelTrackingCals +{ + uint32_t rxChannel; /*!< RX Tracking calibration channel */ + uint32_t orxChannel; /*!< ORX Tracking calibration channel */ + uint32_t txChannel; /*!< TX Tracking calibration channel */ + uint32_t laneSerdes; /*!< TX lane SERDES Tracking calibration channel */ +} adi_adrv903x_ChannelTrackingCals_t;) + +/** + * \brief Data structure to hold the InitCalStatus information for readback + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_InitCalStatus +{ + adi_adrv903x_CpuErrorCode_t initErrCodes[ADI_ADRV903X_NUM_INIT_CAL_CHANNELS]; /*!< Set of initial calibration error codes for Channels 1/2/3/4/5/6/7/8. */ + adi_adrv903x_InitCalibrations_t initErrCals[ADI_ADRV903X_NUM_INIT_CAL_CHANNELS]; /*!< Set of IDs of the specific initial calibration(s) reporting an error (adi_adrv903x_InitCalibrations_e) for Channels 1/2/3/4/5/6/7/8 */ + uint32_t calsDurationMsec; /*!< Duration in msec of the last initial calibration run */ + adi_adrv903x_InitCalibrations_t calsSincePowerUp[ADI_ADRV903X_NUM_INIT_CAL_CHANNELS]; /*!< Bitmask (adi_adrv903x_InitCalibrations_e) indicating calibrations run since power up for Channels 1/2/3/4/5/6/7/8 */ + adi_adrv903x_InitCalibrations_t calsLastRun[ADI_ADRV903X_NUM_INIT_CAL_CHANNELS]; /*!< Bitmask (adi_adrv903x_InitCalibrations_e) indicating calibrations run in during the previous runInitCals() call for Channels 1/2/3/4/5/6/7/8 */ +} adi_adrv903x_InitCalStatus_t;) + +/** +* \brief Data structure to hold initial calibration error information +*/ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_InitCalChannelErrData +{ + adi_adrv903x_InitCalibrations_t initErrCals; /*!< Error ID Mask for adi_adrv903x_InitCalibrations_e */ + adi_adrv903x_CpuErrorCode_t errCode; /*!< CPU Error Code */ + uint8_t errMsg[ADI_ADRV903X_CHAR_ARRAY_MAX]; /*!< Error Message */ + uint8_t errCause[ADI_ADRV903X_CHAR_ARRAY_MAX]; /*!< Error Cause */ + int64_t action; /*!< Recovery Action */ + uint8_t actionMsg[ADI_ADRV903X_CHAR_ARRAY_MAX]; /*!< Recovery Action Message */ + adi_adrv903x_InitCalibrations_t calsSincePowerUp; /*!< Cals Run Since Power Up Bitmask */ + adi_adrv903x_InitCalibrations_t calsLastRun; /*!< Cals Since Last Run Bitmask */ +} adi_adrv903x_InitCalChannelErrData_t;) + +/** +* \brief Data structure to hold initial calibration error information +*/ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_InitCalErrData +{ + adi_adrv903x_InitCalChannelErrData_t channel[ADI_ADRV903X_NUM_INIT_CAL_CHANNELS]; /*!< Init Cal Data for All Channels */ + uint32_t calsDurationMsec[ADI_ADRV903X_CPU_NUM]; /*!< Duration in msec of the last initial calibration run (Milliseconds) */ +} adi_adrv903x_InitCalErrData_t;) + +/** + * \brief Tracking calibration ID + */ +typedef enum adi_adrv903x_TrackingCalibrationId +{ + ADI_ADRV903X_TC_RX_QEC = 0, /*!< RxQEC Tracking calibration */ + ADI_ADRV903X_TC_TX_LOL = 1, /*!< TxLOL Tracking calibration */ + ADI_ADRV903X_TC_TX_QEC = 2, /*!< TxQEC Tracking calibration */ + ADI_ADRV903X_TC_TX_SERDES = 3, /*!< SERDES Tracking calibration */ + ADI_ADRV903X_TC_RX_ADC = 4, /*!< Rx ADC Tracking calibration */ + ADI_ADRV903X_TC_TX_LB_ADC = 5, /*!< TxLB ADC Tracking calibration */ + ADI_ADRV903X_TC_ORX_ADC = 6, /*!< ORx ADC Tracking calibration */ + ADI_ADRV903X_TC_RXSPUR = 7, /*!< RxSpur Tracking calibration */ + ADI_ADRV903X_TC_NUM_CALS = 7 + 1ul, /*!< Number of tracking calibrations */ +} adi_adrv903x_TrackingCalibrationId_e; + +typedef uint32_t adi_adrv903x_TrackingCalibrationId_t; + +/** + * \brief Tracking calibration mask + */ +typedef enum adi_adrv903x_TrackingCalibrationMask +{ + ADI_ADRV903X_TC_RX_QEC_MASK = 1, /*!< RxQEC Tracking calibration */ + ADI_ADRV903X_TC_TX_LOL_MASK = 2, /*!< TxLOL Tracking calibration */ + ADI_ADRV903X_TC_TX_QEC_MASK = 4, /*!< TxQEC Tracking calibration */ + ADI_ADRV903X_TC_TX_SERDES_MASK = 8, /*!< SERDES Tracking calibration */ + ADI_ADRV903X_TC_RX_ADC_MASK = 16, /*!< Rx ADC Tracking calibration */ + ADI_ADRV903X_TC_TX_LB_ADC_MASK = 32, /*!< TxLB ADC Tracking calibration */ + ADI_ADRV903X_TC_ORX_ADC_MASK = 64, /*!< ORx ADC Tracking calibration */ + ADI_ADRV903X_TC_RXSPUR_MASK = 128, /*!< RxSpur Tracking calibration */ +} adi_adrv903x_TrackingCalibrationMask_e; + +typedef uint32_t adi_adrv903x_TrackingCalibrationMask_t; + +#define ADI_ADRV903X_TC_ALL_CALS ((adi_adrv903x_TrackingCalibrationMask_t)( ADI_ADRV903X_TC_RX_QEC_MASK \ + | ADI_ADRV903X_TC_TX_LOL_MASK \ + | ADI_ADRV903X_TC_TX_QEC_MASK \ + | ADI_ADRV903X_TC_TX_SERDES_MASK \ + | ADI_ADRV903X_TC_RX_ADC_MASK \ + | ADI_ADRV903X_TC_TX_LB_ADC_MASK \ + | ADI_ADRV903X_TC_ORX_ADC_MASK \ + | ADI_ADRV903X_TC_RXSPUR_MASK)) + +/** + * \brief Data structure to hold tracking calibration enable masks + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_TrackingCalEnableMasks +{ + adi_adrv903x_TrackingCalibrationMask_t enableMask[ADI_ADRV903X_NUM_TRACKING_CAL_CHANNELS]; +} adi_adrv903x_TrackingCalEnableMasks_t;) + +/** +* \brief Tracking calibration enable/disable flags +*/ +typedef enum adi_adrv903x_TrackingCalEnableDisable +{ + ADI_ADRV903X_TRACKING_CAL_DISABLE = 0, /*!< Disable tracking cals */ + ADI_ADRV903X_TRACKING_CAL_ENABLE = 1 /*!< Enable tracking cals */ +} adi_adrv903x_TrackingCalEnableDisable_e; + +/** +* \brief Tracking calibration states +*/ +typedef enum adi_adrv903x_TrackingCalStateFlag +{ + ADI_ADRV903X_TC_STATE_SUSPENDED = 0x01, /*!< Calibration is temporarily suspended */ + ADI_ADRV903X_TC_STATE_RESUMED = 0x02, /*!< Calibration is resumed for running */ + ADI_ADRV903X_TC_STATE_INACTIVE = 0x04, /*!< Calibration is not executing */ + ADI_ADRV903X_TC_STATE_RUNNING = 0x08, /*!< Calibration is executing */ + ADI_ADRV903X_TC_STATE_ENABLED = 0x10, /*!< Calibration is enabled*/ + ADI_ADRV903X_TC_STATE_DISABLED = 0x20, /*!< Calibration is disabled*/ + ADI_ADRV903X_TC_STATE_ERROR = 0x40, /*!< Calibration has errored. BBIC should re-run the cal. */ +} adi_adrv903x_TrackingCalStateFlag_e; +typedef uint8_t adi_adrv903x_TrackingCalStateFlag_t; + +/** + * \brief Data structure to hold tracking calibration state information + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_TrackingCalState +{ + adi_adrv903x_TrackingCalibrationMask_t calError[ADI_ADRV903X_NUM_TRACKING_CAL_CHANNELS]; + adi_adrv903x_TrackingCalStateFlag_t calState[ADI_ADRV903X_NUM_TRACKING_CAL_CHANNELS][8]; +} adi_adrv903x_TrackingCalState_t;) + +/** + * \brief Data structure to HRM data for one Tx channel + */ +typedef struct adi_adrv903x_TxHrmData +{ + uint8_t hrmCalData[TX_HRM_CAL_DATA_PER_CHANNEL_SIZE]; +} adi_adrv903x_TxHrmData_t; + +/** + * \brief Tx LOL Reset Type + */ +typedef enum adi_adrv903x_TxLolResetType +{ + ADI_ADRV903X_TX_LOL_SOFT_RESET = 0U, /*!< Channel Reset, not including the Atten Table*/ + ADI_ADRV903X_TX_LOL_HARD_RESET = 1U /*!< Reset LO Leakage, Tx-to-Lb Channel & LOL Actuator Data */ +} adi_adrv903x_TxLolResetType_e; + +/** + * \brief Data structure to reset Tx channel LOL + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_TxLolReset +{ + uint32_t channelMask; /*!< selected Tx channels to be reset */ + adi_adrv903x_TxLolResetType_e resetType; /*!< reset type */ +} adi_adrv903x_TxLolReset_t;) + +/** + * \brief Tx QEC Reset Type + */ +typedef enum adi_adrv903x_TxQecResetType +{ + ADI_ADRV903X_TX_QEC_TRACKING_HARD_RESET = 0U, /*!< Combination of QEC & Channel Reset */ + ADI_ADRV903X_TX_QEC_TRACKING_QEC_RESET, /*!< Reset Model of Quadrature Error Correction; Note QEC Performance will Degrade */ + ADI_ADRV903X_TX_QEC_TRACKING_CHANNEL_RESET, /*!< Tx-to-Lb Channel Reset; Note QEC Performance is maintained */ +} adi_adrv903x_TxQecResetType_e; + +/** + * \brief Data structure to reset Tx channel QEC + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_TxQecReset +{ + uint32_t channelMask; /*!< selected Tx channels to be reset */ + adi_adrv903x_TxQecResetType_e resetType; /*!< reset type */ +} adi_adrv903x_TxQecReset_t;) + +#endif /* __ADRV903X_CAL_TYPES_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_core.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_core.h new file mode 100644 index 0000000000000..27df147842e36 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_core.h @@ -0,0 +1,584 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_core.h +* \brief Contains top level ADRV903X related function prototypes for +* adi_adrv903x_core.c +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef _ADI_ADRV903X_CORE_H_ +#define _ADI_ADRV903X_CORE_H_ + +#include "adi_adrv903x_error.h" + +/** + * \brief Acquires the device so that it can only be used only in the context of the calling + * thread until such time as adi_adrv903x_Unlock is called. + * + * Generally there is no need to explicitly lock or unlock a device before or after calling any + * API function with that device (each API function locks the device internally itself before + * carrying out it's actions and unlocks the device before returning). Any exceptions to this rule + * will be clearly documented. + * + * Uses adi_common_hal_Lock internally. See that function for important relevant information. + * + * \param[in,out] device Context variable -Pointer to ADRV903X device data structure containing settings + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + **/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Lock(adi_adrv903x_Device_t* const device); + +/** + * \brief Releases a device previously acquired by the calling thread. + * + * Only the thread that acquired the device can release the device. Attempting to release a device + * that has not been acquired by the calling thread results in undefined behavior. + * + * Uses adi_common_hal_Unlock internally. See that function for important relevant information. + * + * \param[in,out] device Context variable -Pointer to ADRV903X device data structure containing settings + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + **/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Unlock(adi_adrv903x_Device_t* const device); + +/** +* \brief Prepares the ADRV903X device for use. +* +* This function must be called on the device before any other function is called. The +* function must not be called more than once on the same device. +* +* Uses adi_adrv903x_hal_HwOpen internally. See that function for important relevant information. +* +* This API shall call the ADI HAL function adrv903x_HwOpen for +* ADRV903X Hardware initialization. This HAL function initializes all the external +* hardware blocks required in the operation of the ADRV903X device. +* This API will also set the HAL timeout limit for the HAL driver as per API +* requirements. +* +* \pre device->common.devHalInfo must be initialized with user values before this function +* is called. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to ADRV903X device data structure. adi_adrv903x_Device_t member +* devHalInfo shall be initialized with all the required information to initialize +* external Hardware required for ADRV903X operation for example +* power, pull ups, SPI master etc +* \param[in] spiSettings Pointer to adi_adrv9010_SpiSettings_t structure that contains SPI +* configuration parameters. These settings get copied into the device structure. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_HwOpen(adi_adrv903x_Device_t* const device, + const adi_adrv903x_SpiConfigSettings_t* const spiSettings); + +/** +* \brief Performs a hardware shutdown for ADRV903X Device. +* +* This API shall call the ADI HAL function adrv903x_HwClose for +* ADRV903X Hardware shutdown. This HAL function shuts down all the external +* hardware blocks required in the operation of the ADRV903X device. +* +* Uses adi_adrv903x_hal_HwClose internally. See that function for important relevant information. +* +* \pre This function may be called any time after device->common.devHalInfo has been +* initialized with user values +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to ADRV903X device data structure. adi_adrv903x_Device_t member +* devHalInfo shall be initialized with all the required information to initialize +* supporting Hardware for ADRV903X operation for example +* power, pull ups, SPI master etc +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_HwClose(adi_adrv903x_Device_t* const device); + +/** +* \brief Service to perform a HwReset for a device +* +* Calls the HAL to send the HwReset Signal and +* then reload the SPI Configuration for a given device +* +* \pre This function may be called any time after device->common.devHalInfo has been +* initialized with user values +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to ADRV903X device data structure containing settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_HwReset(adi_adrv903x_Device_t* const device); + +/** +* \brief Initializes the ADRV903X device based on the desired device settings. +* +* This function initializes the ADRV903X device, digital clocks, +* JESD204b settings, FIR Filters, digital filtering. It does not load the CPU +* or perform any of the CPU init calibrations. It leaves the +* ADRV903X in a state ready for multichip sync (which can bring up the JESD204 links), the +* CPU to be loaded, and the init calibrations run. +* +* \pre This function is the very first API to be called by the user to configure the device +* after all dependent data structures have been initialized +* +* \dep_begin +* \dep{device (all members)} +* \dep{init (all members)} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to ADRV903X device data structure +* \param[in] init Pointer to ADRV903X initialization settings structures +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Initialize(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Init_t* const init); + +/** +* \brief API To safely Shutdown ADRV903X +* +* The User should call this function to safely shutdown ADRV903X Device. +* The function performs a hardware reset to reset the ADRV903X Device into a safe +* state for shutdown or re-initialization. +* +* \pre This function may be called at any time but not before device->common.devHalInfo +* has been configured with user device settings +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to ADRV903X device data structure containing settings +* +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Shutdown(adi_adrv903x_Device_t* const device); + +/** +* \brief Sets up the transceiver to listen for incoming SYSREF pulses to synchronize the internal clock tree. +* +* When working with multiple transceivers or even only one transceiver that +* requires deterministic latency between the Tx and observation and or main +* Rx JESD204B data path, Multichip sync is necessary. This function should +* be run after all transceivers have finished the adi_adrv903x_initialize(), +* and after adi_adrv903x_CpuStart(). +* +* This function will reset the MCS state +* machine in the ADRV903X device. Calling the function again, will reset +* the state machine and expect the MCS sequence to start over. Since clocks +* will be adjusted, the transceiver should not be transmitting or receiving +* when this function is called. +* +* Typical sequence: +* 1) Initialize all ADRV903X devices in system using adi_adrv903x_initialize() +* 2) Run adi_adrv903x_MultichipSyncSet(). Make sure enableSync is 1. +* 3) Send at least 4 SYSREF pulses, and verify mcsStatus is set for each +* MCS step +* 4) Use adi_adrv903x_MultichipSyncStatusGet() to verify MCS. +* 4) Run adi_adrv903x_MultichipSyncSet(). Make sure enableSync is 0 +* to indicate end of MCS sequence. +* 5) Continue with init sequence ... init cals, etc +* +* +* \pre This function is called after the device has been initialized and PLL lock status has +* been verified. CPU must be running before calling this function. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -is a pointer to the device settings structure +* +* \param[in] enableSync is a 0/1 variable used to indicate MultiChipSync start/stop. +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_MultichipSyncSet(adi_adrv903x_Device_t* const device, + const uint8_t enableSync); +/** +* \brief Sets up the transceiver to perform MCS carrier reconfig. +* +* +* This function will reconfig the MCS state +* +* +* \pre This function is called when performing MCS reconfig +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -is a pointer to the device settings structure +* \param[in] mcsMode see adi_adrv903x_McsSyncMode_e +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_MultichipSyncSet_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_McsSyncMode_e mcsMode); + +/** +* \brief Reads back the multi-chip sync status +* +* After running adi_adrv903x_MultichipSyncSet(), this function can be used +* to verify that all the SYSREF pulses were received by the transceiver. +* +* Typical sequence: +* 1) Initialize all ADRV903X devices in system using adi_adrv903x_initialize() +* 2) Run adi_adrv903x_MultichipSyncSet() +* 3) Send at least 4 SYSREF pulses, and verify mcsStatus is set for each +* MCS step +* 4) Run adi_adrv903x_MultichipSyncStatusGet() verify mcsStatus +* 5) Continue with init sequence ... init cals, etc +* +* \pre This function is called after the device has been initialized and PLL lock status has +* been verified. CPU must be running before using the MCS functions. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -A pointer to the device settings structure +* \param[out] mcsStatus bit0 = 0 - no sync, bit0 = 1 - sync occurred; +* bit1 = 0 - reconfig no sync, bit1 = 1 - reconfig sync occurred; +* +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_MultichipSyncStatusGet(adi_adrv903x_Device_t* const device, + uint32_t* const mcsStatus); +/** +* \brief Verifies the init structure profiles are valid combinations +* +* This function checks that the Rx/Tx/ORx profiles. +* +* \pre This function is a helper function and does not need to be called +* directly by the user. +* +* \dep_begin +* \dep{device->devStateInfo} +* \dep{init-> (most members)} +* \dep_end +* +* \param[in,out] device Context variable -Structure pointer to ADRV903X device data structure +* \param[in] init Pointer to ADRV903X initialization settings structures +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ProfilesVerify(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Init_t* const init); + +/** +* \brief Sets the ADRV903X device SPI settings (3wire/4wire, msbFirst, etc). +* +* This function will use the settings in the passed spi structure parameter +* to set msbFirst/lsbFirst and 3wire/4wire mode for the ADRV903X SPI controller. +* The ADRV903X device always uses SPI MODE 0 (CPHA=0, CPOL=0) and a 16-bit +* instruction word. +* +* \pre This function is a helper function and does not need to be called +* directly by the user. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{init->spiSettings->MSBFirst} +* \dep{init->spiSettings->fourWireMode} +* \dep_end +* +* \param[in,out] device Context variable -Structure pointer to ADRV903X device data structure +* \param[in] spiCtrlSettings Pointer to ADRV903X SPI controller settings - not platform hardware SPI settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE, if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_SpiConfigSettings_t* const spiCtrlSettings); + +/** +* \brief Gets the ADRV903X device SPI settings (3wire/4wire, msbFirst, etc). +* +* This function will use the settings in the passed spi structure parameter +* to get msbFirst/lsbFirst 3wire/4wire mode for the ADRV903X SPI controller. The ADRV903X device +* always uses SPI MODE 0 (CPHA=0, CPOL=0) and a 16-bit instruction word. +* +* \pre This function is a helper function and does not need to be called +* directly by the user. +* \pre Can only call this function if config has been set or SpiVerify +* returns with no errors +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{init->spiSettings->MSBFirst} +* \dep{init->spiSettings->fourWireMode} +* \dep_end +* +* \param[in,out] device Context variable -Structure pointer to ADRV903X device data structure +* \param[out] spi Pointer to ADRV903X SPI controller settings - not platform hardware SPI settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE, if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiConfigSettings_t* const spi); + +/** +* \brief Enables/Disables ADRV903X Aux SPI interface. +* +* If enabling Aux SPI, selected GPIO pins for interface are acquired and configured for the user. +* If disabling Aux SPI, pin selections in the AuxSpiCfg input struct are ignored and any device +* GPIO pins currently selected for the interface are released and set back to default UNUSED. +* There are a limited set of GPIO pins available for use as Aux SPI Port pin. They are as follows: +* +* Aux CSB: GPIO[3], GPIO[16] +* Aux CLK: GPIO[2], GPIO[15] +* Aux SDIO: GPIO[0], GPIO[13] +* Aux SDO: GPIO[1], GPIO[14], or ADI_ADRV903X_GPIO_INVALID (if user only wants 3-wire mode Aux SPI) +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Structure pointer to ADRV903X device data structure +* \param[in] config Aux SPI Interface configuration to apply to device +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE, if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AuxSpiCfgSet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_AuxSpiConfig_t* const config); + +/** +* \brief Retrieves currently programmed Aux SPI interface configuration. +* +* This configuration includes whether the Aux SPI Interface is currently enabled or disabled. +* If AuxSPI is currently disabled, all pins in returned config struct will be set to +* ADI_ADRV903X_GPIO_INVALID. If AuxSPI is currently enabled, Aux CSB/CLK/SDIO/SDO pins in returned +* config struct will be set to the appropriate GPIO pins. If no GPIO pin is configured for a signal, +* the returned value will be ADI_ADRV903X_GPIO_INVALID. +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Structure pointer to ADRV903X device data structure +* \param[out] config Returned Aux SPI Interface configuration +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE, if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AuxSpiCfgGet( adi_adrv903x_Device_t* const device, + adi_adrv903x_AuxSpiConfig_t* const config); + +/** +* \brief Sets the ADRV903X device SPI runtime options, eg spi streaming, AHB modes. +* +* This function will return the current SPI runtime options that API functions use when deciding +* how a particular SPI transaction should be completed. For example, if a particular API is preparing +* to write a group of consecutive registers it will attempt to put the part in SPI streaming. However, by clearing +* the allowSpiStreaming bit this will prevent all APIs from using SPI streaming. +* +* SPI Streaming: This mode will automatically increment the SPI address in between SPI data words. This allows for +* faster SPI transactions since only a single address set is needed at the start of each transaction. +* Useful only when large, contiguous registers are accessed. +* +* AHB Auto Increment: Similar to SPI streaming, this mode automatically increments the register address accessed through +* the AHB indirect access (read-only). This allows for faster AHB transactions since only the start +* address is required to be written. The SPI address must be set each time the AHB data register is +* read, even if SPI Streaming is enabled. +* +* AHB FIFO Mode: Only available with SPI Streaming and AHB Auto Increment is enabled. This allows for zero wasted bytes during +* an AHB indirect access (read-only) by eliminating the need to set the SPI register address each time the +* AHB data word is read. +* +* \dep_begin +* \dep{spiOptions->allowAhbAutoIncrement} +* \dep{spiOptions->allowAhbSpiFifoMode} +* \dep{spiOptions->allowSpiStreaming} +* \dep_end +* +* \param[in,out] device Context variable -Structure pointer to ADRV903X device data structure +* \param[in] spiOptions Pointer to ADRV903X SPI runtime options settings that will return the current device settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE, if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiRuntimeOptionsSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_SpiOptions_t* const spiOptions); + +/** +* \brief Gets the ADRV903X device SPI runtime options, eg spi streaming, AHB modes. +* +* This function will return the current SPI runtime options that API functions use when deciding +* how a particular SPI transaction should be completed. For example, if a particular API is preparing +* to write a group of consecutive registers it will attempt to put the part in SPI streaming. However, by clearing +* the allowSpiStreaming bit this will prevent all APIs from using SPI streaming. +* +* \dep_begin +* \dep{spiOptions->allowAhbAutoIncrement} +* \dep{spiOptions->allowAhbSpiFifoMode} +* \dep{spiOptions->allowSpiStreaming} +* \dep_end +* +* \param[in,out] device Context variable -Structure pointer to ADRV903X device data structure +* \param[out] spiOptions Pointer to ADRV903X SPI runtime options settings that will return the current device settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE, if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiRuntimeOptionsGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiOptions_t* const spiOptions); + +/** +* \brief Verifies current SPI Configuration & Platform Driver +* +* This function validates the Platform SPI Driver can work with the SPI Modes configured via +* adi_adrv903x_SpiCfgSet & adi_adrv903x_SpiRuntimeOptionsSet. +* +* Single Register Access +* 1. Reads read only register to check SPI read operation. +* 2. Writes scratchpad register with 10110110, reads back the data +* 3. Writes scratchpad register with 01001001, reads back the data +* +* Multi Register Access (PreMcsInit/Initialize() Is Required to be complete for this step to be executed) +* 1. Write multi register scratchpad, reads back the data +* +* Depending on configuration provided to adi_adrv903x_SpiRuntimeOptionsSet, +* can be Streaming or Single Instruction Buffered Used to perform the write. +* +* See adi_adrv903x_user.h for Compile Time Debug Option ADI_ADRV903X_SPI_VERIFY +* This will enable SpiVerify() in PreMcsInit_NonBroadcast() +* +* \pre This function is a helper function and does not need to be called +* directly by the user. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Structure pointer to ADRV903X device data structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiVerify(adi_adrv903x_Device_t* const device); + +/** +* \brief Get API version number +* +* This function reads back the version number of the API +* +* \param[in,out] device Context variable -Pointer to the ADRV903X data structure +* \param[out] apiVersion Pointer to structure where API version information is returned +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ApiVersionGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_Version_t* const apiVersion); + +/** +* \brief Reads back the silicon revision for the ADRV903X Device +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Structure pointer to the ADRV903X data structure containing settings +* \param[in,out] siRevision Return value of the ADRV903X silicon revision +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeviceRevGet(adi_adrv903x_Device_t* const device, + uint8_t* const siRevision); + +/** +* \brief Reads back the Product ID for the ADRV903X Device +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Structure pointer to the ADRV903X data structure containing settings +* \param[in,out] productId Return value of the ADRV903X product Id +* +*| productId | Description | +*|:----------------:|:---------------| +*| TBD | TBD | + +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ProductIdGet(adi_adrv903x_Device_t* const device, + uint8_t* const productId); + +/** +* \brief Reads back the DeviceCapability for the ADRV903X Device +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Structure pointer to the ADRV903X data structure containing settings +* \param[out] devCapability Structure pointer to return device hardware capability +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeviceCapabilityGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_CapabilityModel_t* const devCapability); + +/** +* \brief Configures SPI DOUT pin drive strength. driveStrength is a 3 bit value where 0x00 lowest drive strength and +* 0x03 is highest strength +* +* \deprecated +* +* This function will be called with adi_adrv903x_SpiConfigSettings_t->cmosPadDrvStrength during HW opening. +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Structure pointer to the ADRV903X data structure containing settings +* \param[in] driveStrength Drive strength value to be set. IMPORTANT: adi_adrv903x_CmosPadDrvStr_e +* must be used to set these values due to backward compatiblity requirements. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiDoutPadDriveStrengthSet(adi_adrv903x_Device_t* const device, + const uint8_t driveStrength); +/** + * \brief Sets the Hysteresis for the SPI Feature + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] enable Enable Flag + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiHysteresisSet( adi_adrv903x_Device_t* const device, + const uint32_t enable); + +/** + * \brief Sets the Hysteresis for the All Digital Pin Features + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] enable Enable Flag + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DigitalHysteresisSet( adi_adrv903x_Device_t* const device, + const uint32_t enable); + +#endif diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu.h new file mode 100644 index 0000000000000..170d6d7f2aab1 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu.h @@ -0,0 +1,646 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_cpu.h +* \brief Contains ADRV903X processor function prototypes for +* adi_adrv903x_cpu.c +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef _ADI_ADRV903X_CPU_H_ +#define _ADI_ADRV903X_CPU_H_ + +#include "adi_adrv903x_cpu_types.h" +#include "adi_adrv903x_error.h" +#include "adi_adrv903x_cpu_log_types.h" +#include "adi_adrv903x_cpu_sys_types.h" +#include "adi_adrv903x_cpu_sw_bkpt_types.h" +#include "adi_adrv903x_cpu_health_monitor_types.h" +#include "adi_common_error_types.h" + +/** +* \brief Loads binary array into CPU program memory +* +* This function sets the CPU DMA control register bits for an CPU memory write, auto-incrementing +* the address. Valid memory addresses are: Program Memory (0x01000000 - 0x0104FFFF) +* +* The top level application reads the binary file, parsing it into any array, starting at the first data byte +* on the first line of the file. The array is passed to this function and writes it to CPU program memory. Any non-data +* bytes should be excluded from the binary array when parsing. +* +* \pre This function is called after the device has been initialized, PLL lock status has been verified, and +* the stream binary has been loaded +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to the ADRV903X device data structure containing settings +* \param[in] cpuType type of cpu +* \param[in] byteOffset Offset (starting from 0) of where to place the binary +* array in CPU memory (if loaded in multiple function +* calls) +* \param[in] binary Byte array containing all valid FW file data bytes +* \param[in] byteCount The number of bytes in the binary array +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuImageWrite(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const uint32_t byteOffset, + const uint8_t binary[], + const uint32_t byteCount); + +/** +* \brief Writes the ADRV903X CPU device profile binary +* +* The top level application reads the binary file, parsing it into any array, starting at the first data byte +* on the first line of the file. The array is passed to this function and writes it to CPU device profile memory. Any non-data +* bytes should be excluded from the binary array when parsing. +* +* \pre This function is called before adi_adrv903x_CpuStart(), and +* this function must be called after loading the firmware. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to the ADRV903X device data structure containing settings +* \param[in] byteOffset Offset (starting from 0) of where to place the binary +* array in CPU memory (if loaded in multiple function +* calls) +* \param[in] binary Byte array containing all valid FW file data bytes +* \param[in] byteCount The number of bytes in the binary array +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuProfileWrite(adi_adrv903x_Device_t * const device, + const uint32_t byteOffset, + const uint8_t binary[], + const uint32_t byteCount); + +/** +* \brief Start the CPU(s) +* +* Sets run bit to 1. Then wait and check for FW Status. +* +* +* \pre This function is called after the device has been initialized and before multichip-sync +* (MCS) has been completed +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{init-> (most members)} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to the ADRV903X device settings data structure +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuStart(adi_adrv903x_Device_t* const device); + +/** +* \brief A polling wait for the CPU status to be ready. +* +* Polls firmware status (fwStatus) until it becomes ADRV903X_CPU_FW_STATUS_READY, +* ADRV903X_CPU_FW_STATUS_CPU_DEBUG_READY, any of the error states or a timeout occurs. +* +* If a previous call to this function returned with fwStatus as ADRV903X_CPU_FW_STATUS_CPU_DEBUG_READY +* then even if fwStatus becomes STATUS_CPU_DEBUG_READY during the timeout period wait until the timeout +* duration to see if it becomes STATUS_READY. At that point return based on the fwStatus. +* +* Returns and error if fwStatus becomes any of the firmware error states. Calls adi_adrv903x_HwReset if +* fwStatus becomes LDO config error. +* +* \pre This function is called after the device has been initialized and before multichip-sync +* (MCS) has been completed. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to the ADRV903X device settings data structure +* \param[in] timeout_us Timeout to stop waiting for CPU to boot up. +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuStartStatusCheck(adi_adrv903x_Device_t* const device, + const uint32_t timeout_us); + +/** +* \brief Sets the specified Set Config in the adrv903x_CpuCmd_SetConfig_t structure. +* +* \pre This function can be called after the CPU has been initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] objId Object ID of calibration or system component +* \param[in] offset Offset into the configuration structure +* \param[in] configDataSet Configuration data for Set. Size of configDataSet must be equal or greater than length param. +* \param[in] length Length of the configuration in bytes +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuConfigSet( adi_adrv903x_Device_t* const device, + const uint32_t objId, + const uint16_t offset, + const uint8_t configDataSet[], + const uint32_t length); + +/** +* \brief Gets the specified Get Config in the adrv903x_CpuCmd_GetConfig_t structure. +* +* \pre This function can be called after the CPU has been initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] objId Object ID of calibration or system component +* \param[in] offset Offset into the configuration structure +* \param[in, out] configDataGet Configuration data for Get. Size of configDataGet must be equal or greater than length param. +* \param[in] length Length of the configuration in bytes +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuConfigGet( adi_adrv903x_Device_t* const device, + const uint32_t objId, + const uint16_t offset, + uint8_t configDataGet[], + const uint32_t length); + +/** +* \brief Enable CPU debug mode with enableKey. +* +* \pre This function can be called after the CPU has been initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] enableKey key to enable CPU Debug +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuDebugModeEnable(adi_adrv903x_Device_t* const device, + const uint32_t enableKey); + +/** +* \brief Set Cpu Config Unlock with configKey. +* +* \pre This function can be called after the CPU has been initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] configKey key to unlock Cpu Config +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuConfigUnlock(adi_adrv903x_Device_t* const device, + const uint32_t configKey); + + /** +* \brief Sets the specified Set Ctrl in the adrv903x_CpuCmd_SetCtrl_t structure. +* +* \pre This function can be called after the CPU has been initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] objId Object ID of calibration or system component +* \param[in] cpuCmd Command to be executed +* \param[in] channel channel enum +* \param[in] cpuCtrlData Pointer to data to send TO the CPU +* \param[in] lengthSet Length of cpuCtrlData, in bytes, if 0, cpuCtrlData can be NULL +* \param[out] lengthResp Length of data received FROM the CPU into ctrlResp buffer, in bytes +* \param[out] ctrlResp Pointer to buffer in which data FROM the CPU should be received. +* \param[in] lengthGet Size of ctrlResp buffer, in bytes. MUST be greater than or equal to lengthResp. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuControlCmdExec(adi_adrv903x_Device_t* const device, + const uint32_t objId, + const uint16_t cpuCmd, + const adi_adrv903x_Channels_e channel, + const uint8_t cpuCtrlData[], + const uint32_t lengthSet, + uint32_t* const lengthResp, + uint8_t ctrlResp[], + const uint32_t lengthGet); + +/** +* \brief Configure CPU log filter settings +* +* \pre This function can be called after the CPU has been initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] eventFilter Specifies the highest severity event to log. For example, if ADI_ADRV903X_CPU_LOG_EVENT_WARNING +* is selected, WARNING and ERROR events will be logged, but INFO and INFO_2 will not. Set to INVALID +* if this option should be ignored. +* \param[in] cpuIdFilter Bitmask that specifies the CPU(s) on which logging should be enabled. A single CPU can be specified, +* or NONE (logging disabled), or ALL. Set to INVALID if this option should be ignored. +* \param[in] objIdFilter Specifies the CPU object ID that should be logged. Setting objIdFilter.objIdFilterEnable to DISABLE allows +* logging from all object IDs (and objIdFilter.objId is ignored). Setting objIdFilter.objIdFilterEnable +* to ENABLE and setting objIdFilter.objId to a valid CPU object ID (see adrv903x_CpuObjectId_e) enables +* logging for only the specified object ID. Set to objIdFilterEnable to INVALID if this option should be +* ignored. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuLogFilterSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuLogEvent_e eventFilter, + const adi_adrv903x_CpuLogCpuId_e cpuIdFilter, + const adi_adrv903x_CpuLogObjIdFilter_t* const objIdFilter); + +/** +* \brief Sets the specified Cpu Debug command in the adrv903x_CpuCmd_Debug_t structure. +* +* \pre This function can be called after the CPU has been initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] objId Object ID of calibration or system component +* \param[in] cpuCmd Command to be executed +* \param[in] channel channel enum +* \param[in] cpuDebugData Debug data for Debug command. +* \param[in] lengthSet Length of the Debug data in bytes +* \param[out] lengthResp Length of the Control set command response in bytes +* \param[in, out] debugResp Debug response buffer. +* \param[in] lengthGet Length of response buffer in bytes.MUST be greater than or equal to lengthResp. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuDebugCmdExec( adi_adrv903x_Device_t* const device, + const uint32_t objId, + const uint16_t cpuCmd, + const adi_adrv903x_Channels_e channel, + const uint8_t cpuDebugData[], + const uint32_t lengthSet, + uint32_t* const lengthResp, + uint8_t debugResp[], + const uint32_t lengthGet); + +/** +* \brief Get the CPU index assigned to all JESD deserializer lanes in an array format. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Context variable -A pointer to the device settings structure +* \param[in, out] cpuTypes array which will contain what CPU is assigned to the associated channel number +* based on index position i.e. cpuTypes[0] is ADI_ADRV903X_CH1, cpuTypes[1] is ADI_ADRV903X_CH2, etc. +* \param[in] numSerdesLanes number of deserializer lanes desired to be inspected. Should be ADI_ADRV903X_MAX_SERDES_LANES to +* inspect all lanes. If smaller, will only inspect up to the index provided, e.g. 4 will look only up to ADI_ADRV903X_CH4 +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuChannelMappingGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_CpuType_e cpuTypes[], + const uint8_t numSerdesLanes); + +/** +* \brief Returns detailed status information specific to the private cpu system component +* +* \pre This function may be called any time after the device has been initialized, and +* initialization calibrations have taken place +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Context variable -A pointer to the device settings structure +* \param[in] channel Channel selection to read back cal status. Must be a single channel +* \param[in] objId Object ID of cpu system component +* \param[in, out] cpuSysStatusGet Status of the cpu system component. Size of cpuSysStatusGet must be equal or greater than length param. +* \param[in] length Length of the configuration in bytes +* +* \retval ADI_ADRV903X_ERR_ACT_NONE Function completed successfully, no action required +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuSysPvtStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Channels_e channel, + const uint32_t objId, + uint8_t cpuSysStatusGet[], + const uint32_t length); + + + +/** +* \brief Returns the status of the cpu system component +* +* The function can be called to read back the status of the cpu system component. +* +* \pre This function may be called any time after the device has been initialized, and +* initialization calibrations have taken place +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Context variable -A pointer to the device settings structure +* \param[in] channel Channel selection to read back cal status. Must be a single channel. +* \param[in] objId Object ID of cpu system component +* \param[out] cpuSysStatus Status of the cpu system, as a structure of type adi_adrv903x_CpuSysStatus_t is returned to this pointer address +* +* \retval ADI_ADRV903X_ERR_ACT_NONE Function completed successfully, no action required +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuSysStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Channels_e channel, + const uint32_t objId, + adi_adrv903x_CpuSysStatus_t* const cpuSysStatus); + + +/** +* \brief Reads back the FW version of the CPU binary loaded into the CPU memory +* +* This function reads the CPU memory to read back the major.minor.maint.build version +* for the CPU binary loaded into CPU memory. +* +* \pre This function may be called after the CPU binary have been initialized and loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] cpuFwVersion Pointer to four parts of CPU FW Version +* +* \retval ADI_ADRV903X_ERR_ACT_NONE Function completed successfully, no action required +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuFwVersionGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_CpuFwVersion_t* const cpuFwVersion); + +/** +* \brief Reads back health monitoring status of the CPUs +* +* \pre This function is called after the device is initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] healthMonitorStatus Pointer to memory location where health monitor CPU status readback data will be written +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_HealthMonitorCpuStatusGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_HealthMonitorCpuStatus_t* const healthMonitorStatus); + +/** +* \brief Check if CPU-exception flag is set. +* +* \pre This function may be called any time after device initialization +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] isException - Is set to non-zero if either CPU's exception flag is set. The value set is not +* defined but can be analyzed by ADI and should be included in bug reports. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \retval ADI_ADRV903X_ERR_ACT_NONE if the exception flag was read successfully. +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuCheckException(adi_adrv903x_Device_t* const device, + uint32_t* const isException); + +/** +* \brief Configures FW breakpoint for debugging purposes +* +* User can add/remove breakpoints in various FW features to debug potential issues. +* FW needs to be in debug mode to use breakpoints. When FW hits a breakpoint, +* it will stop the operation of certain subsystems. User is allowed to select which +* subsystems to halt through global halt mask, which can be configured with +* adi_adrv903x_GlobalHaltMaskSet() function. If global halt mask is configured to be 0, +* then FW will only pause the task which hits breakpoint. Others subsystems and tasks +* should continue to operate in this case. User can configure a GPIO output to monitor +* if FW hits a breakpoint during operation. This GPIO can be configured with +* adi_adrv903x_BreakpointGpioCfgSet(). This function can also be used to configure +* a GPIO to resume all tasks sleeping in FW. adi_adrv903x_BreakpointHitRead() function +* can be used to monitor which breakpoint is hit. User can either poll this function +* periodically until FW hits a breakpoint or they can monitor the GPIO output and call +* this function when GPIO is asserted. User can allow the system to resume operation +* with adi_adrv903x_BreakpointResume() function call or asserting selected GPIO if +* global halt mask is 0. If global halt mask is non-zero +* adi_adrv903x_BreakpointResumeFromHalt() function needs to be used to resume halted subsystems. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \pre This function may be called any time after device initialization. Device must be in +* debug mode. +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in] breakPointCfg Point to breakpoint configuration to set +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_SwBreakPointEntry_t * breakPointCfg); + +/** +* \brief This function reads the status of selected breakpoint +* +* User is expected to set the objId of the desired breakpoint. Channel mask and +* breakpoint mask configuration of selected breakpoint will be returned to user. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \pre This function may be called any time after device initialization. Device must be in +* debug mode. +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in,out] breakPointCfgRead Pointer to breakpoint structure to readback selected breakpoint +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SwBreakPointEntry_t * const breakPointCfgRead); + +/** +* \brief Reads back which breakpoint is hit in FW +* +* This function will read the breakpoint hit for both CPUs. It will +* return 0xFFFFFFFF value for all members of breakpoint structure if +* no breakpoint hit for that CPU. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \pre This function may be called any time after device initialization. Device must be in +* debug mode. +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in,out] cpu0BreakpointHit Pointer to breakpoint hit by CPU0 +* \param[in,out] cpu1BreakpointHit Pointer to breakpoint hit by CPU1 +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointHitRead(adi_adrv903x_Device_t* const device, + adi_adrv903x_SwBreakPointEntry_t * const cpu0BreakpointHit, + adi_adrv903x_SwBreakPointEntry_t * const cpu1BreakpointHit); + +/** +* \brief Configures a GPIO output to monitor breakpoint hit signal and +* GPIO input to resume all the tasks which are sleeping +* +* FW will use the selected GPIO to output breakpoint hit signal. This signal +* can be monitored by user and adi_adrv903x_BreakpointHitRead() function +* can be used to detect the breakpoint id once GPIO is asserted. To disable GPIO +* output feature, user can select ADI_ADRV903X_GPIO_INVALID +* +* User can configure a GPIO input to resume all sleeping tasks. ADI_ADRV903X_GPIO_INVALID +* can be selected if this feature is not needed. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \pre This function may be called any time after device initialization. Device must be in +* debug mode. +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in] gpioOutputForBreakpointHit Gpio selection to output breakpoint hit signal +* \param[in] gpioInputToResumeSleepingTasks Gpio selection to resume all sleeping tasks + +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointGpioCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpioOutputForBreakpointHit, + const adi_adrv903x_GpioPinSel_e gpioInputToResumeSleepingTasks); + +/** +* \brief This function reads back the GPIO configuration for breakpoint hit +* output signal and breakpoint resume input signals. It returns invalid GPIO +* for the signals which are not assigned to any GPIOs. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \pre This function may be called any time after device initialization. Device must be in +* debug mode. +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[out] gpioOutputForBreakpointHit Gpio selection readback for breakpoint hit signal +* \param[out] gpioInputToResumeSleepingTasks Gpio selection readback for resume all signal + +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointGpioCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioPinSel_e * const gpioOutputForBreakpointHit, + adi_adrv903x_GpioPinSel_e * const gpioInputToResumeSleepingTasks); + +/** +* \brief Allows selected tasks to resume their operation. This function should +* be used when global halt mask is configured to 0. +* ADI cannot guarantee that the system will resume safely as there can be +* instability due to subsystems are assumed to be working at real time. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \pre This function may be called any time after device initialization. Device must be in +* debug mode. +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in] breakpointToResume Selects the breakpoint and channel to resume from sleep. Breakpoint mask is ignored since this +* command will resume the breakpoint id regardless of which specific breakpoint is hit for that breakpoint id. +* \param[in] resumeAll 1:Ignore breakpointToResume selection and resume all tasks that are sleeping + 0:Use breakpointToResume to select which breakpoint to resume + + +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointResume(adi_adrv903x_Device_t* const device, + const adi_adrv903x_SwBreakPointEntry_t * breakpointToResume, + uint8_t resumeAll); + +/** +* \brief Allows halted subsystems to continue operation +* +* ADI cannot guarantee that the system will resume safely as there can be +* instability due to subsystems are assumed to be working at real time. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \pre This function may be called any time after device initialization. Device must be in +* debug mode. +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure + +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointResumeFromHalt(adi_adrv903x_Device_t* const device); + +/** +* \brief Configures a global halt mask for FW breakpoints. +* User can select which subsystems to be halted when a breakpoint is hit. +* This global halt mask is shared by all breakpoints (for both CPUs) +* When global halt mask is configured to 0, the task which hits breakpoint will sleep, +* and all other tasks and subsystems will resume operation. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \pre This function may be called any time after device initialization. Device must be in +* debug mode. +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in] globalHaltMask Global halt mask to be set + +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointGlobalHaltMaskSet(adi_adrv903x_Device_t* const device, + const uint32_t globalHaltMask); + +/** +* \brief This function reads back global halt mask for breakpoints +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \pre This function may be called any time after device initialization. Device must be in +* debug mode. +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[out] globalHaltMask Pointer to global halt mask for readback + +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointGlobalHaltMaskGet(adi_adrv903x_Device_t* const device, + uint32_t * const globalHaltMask); + +#endif /* _ADI_ADRV903X_CPU_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_cmd_dc_offset.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_cmd_dc_offset.h new file mode 100644 index 0000000000000..1719b7103bd19 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_cmd_dc_offset.h @@ -0,0 +1,70 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_cpu_cmd_dc_offset.h + * + * \brief Contains ADRV903X Rx DC Offset data structures. + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADI_ADRV903X_CPU_CMD_DC_OFFSET_H__ +#define __ADI_ADRV903X_CPU_CMD_DC_OFFSET_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cpu_error_codes_types.h" + +/** + * \brief DC Offset get command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuCmd_GetDcOffset +{ + uint8_t chanSelect; /*!< Rx channel number */ +} adi_adrv903x_CpuCmd_GetDcOffset_t;) + + +/** + * \brief lofreq set command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuCmd_GetDcOffsetResp +{ + adi_adrv903x_CpuErrorCode_t status; /*!< CPU error status code */ + uint8_t chanSelect; /*!< Rx channel number */ + uint32_t mShift; /*!< mShift setting */ + uint8_t multEnb; /*!< Multiplier Enabled */ + uint32_t mult; /*!< Multiplier value */ +} adi_adrv903x_CpuCmd_GetDcOffsetResp_t;) + + +/** + * \brief DC Offset Rx set command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuCmd_SetDcOffset +{ + uint8_t chanSelect; /*!< Rx channel number */ + uint32_t dcFilterBw_kHz; /*!< DC offset 1db filter corner */ + uint8_t multEnb; /*!< Multiplier Enabled */ +} adi_adrv903x_CpuCmd_SetDcOffset_t;) + + +/** + * \brief lofreq set command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuCmd_SetDcOffsetResp +{ + adi_adrv903x_CpuErrorCode_t status; /*!< CPU error status code */ +} adi_adrv903x_CpuCmd_SetDcOffsetResp_t;) + + + +#endif /* __ADI_ADRV903X_CPU_CMD_DC_OFFSET_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_cmd_ecc_scrub.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_cmd_ecc_scrub.h new file mode 100644 index 0000000000000..d54f915259d7d --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_cmd_ecc_scrub.h @@ -0,0 +1,50 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2022 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_cpu_cmd_ecc_scrub.h + * + * \brief Contains ADRV903X CPU ECC Scrub enable command data structures. + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADI_ADRV903X_CPU_ECC_SCRUB_CMD_H__ +#define __ADI_ADRV903X_CPU_ECC_SCRUB_CMD_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cpu_error_codes_types.h" + +/** + * \brief CPU ECC Set command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuSetEccScrubEnableCmd +{ + uint8_t eccScrubEnable; /*!< ECC scrubbing enable setting */ +} adi_adrv903x_CpuSetEccScrubEnableCmd_t;) + +/** + * \brief CPU ECC Set command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuSetEccScrubEnableCmdResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ +} adi_adrv903x_CpuSetEccScrubEnableCmdResp_t;) + +/** + * \brief CPU ECC Get command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuGetEccScrubEnableCmdResp +{ + adrv903x_CpuErrorCode_e status; /*!< CPU error status code */ + uint8_t eccScrubEnable; /*!< ECC scrubbing enable state */ +} adi_adrv903x_CpuGetEccScrubEnableCmdResp_t;) + +#endif /* __ADI_ADRV903X_CPU_ECC_SCRUB_CMD_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_cmd_run_serdes_eye_sweep.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_cmd_run_serdes_eye_sweep.h new file mode 100644 index 0000000000000..269c69a2d4f21 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_cmd_run_serdes_eye_sweep.h @@ -0,0 +1,161 @@ +/** + * \file adi_adrv903x_cpu_cmd_run_serdes_eye_sweep.h + * + * \brief Command definition for ADI_ADRV903X_CPU_CMD_ID_RUN_SERDES_EYE_SWEEP + * + * \details Command definition for ADI_ADRV903X_CPU_CMD_ID_RUN_SERDES_EYE_SWEEP + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADI_ADRV903X_CPU_CMD_RUN_SERDES_EYE_SWEEP_H__ +#define __ADI_ADRV903X_CPU_CMD_RUN_SERDES_EYE_SWEEP_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cpu_error_codes_types.h" + +/** + * \brief Deserializer lane enumeration + */ +typedef enum adi_adrv903x_CpuCmd_DeserializerLane +{ + ADI_ADRV903X_CPU_CMD_DESER_LINE0 = 0u, /*!< Deserializer lane 0 */ + ADI_ADRV903X_CPU_CMD_DESER_LINE1 = 1u, /*!< Deserializer lane 1 */ + ADI_ADRV903X_CPU_CMD_DESER_LINE2 = 2u, /*!< Deserializer lane 2 */ + ADI_ADRV903X_CPU_CMD_DESER_LINE3 = 3u, /*!< Deserializer lane 3 */ + ADI_ADRV903X_CPU_CMD_DESER_LINE4 = 4u, /*!< Deserializer lane 4 */ + ADI_ADRV903X_CPU_CMD_DESER_LINE5 = 5u, /*!< Deserializer lane 5 */ + ADI_ADRV903X_CPU_CMD_DESER_LINE6 = 6u, /*!< Deserializer lane 6 */ + ADI_ADRV903X_CPU_CMD_DESER_LINE7 = 7u, /*!< Deserializer lane 7 */ +} adi_adrv903x_CpuCmd_DeserializerLane_e; + +/** + * \brief PRBS Pattern type enumeration + */ +typedef enum adi_adrv903x_CpuCmd_PrbsPattern +{ + ADI_ADRV903X_CPU_CMD_PRBS_PATTERN7 = 0u, /*!< PRBS pattern type 7 */ + ADI_ADRV903X_CPU_CMD_PRBS_PATTERN9 = 1u, /*!< PRBS pattern type 9 */ + ADI_ADRV903X_CPU_CMD_PRBS_PATTERN15 = 2u, /*!< PRBS pattern type 15 */ + ADI_ADRV903X_CPU_CMD_PRBS_PATTERN31 = 3u, /*!< PRBS pattern type 31 */ +} adi_adrv903x_CpuCmd_PrbsPattern_e; + +/** + * \brief RUN_SERDES_EYE_SWEEP command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuCmd_RunEyeSweep +{ + adi_adrv903x_CpuCmd_DeserializerLane_e lane; /*!< Deserializer lane number */ + adi_adrv903x_CpuCmd_PrbsPattern_e prbsPattern; /*!< PRBS pattern */ + uint8_t forceUsingOuter; /*!< Flag indicating 'outer' should be used for phase detection + 0 (default) - do not use outer for phase detection, + 1 - - use outer for phase detection */ + uint32_t prbsCheckDuration_ms; /*!< Duration of PRBS check in [ms] */ +} adi_adrv903x_CpuCmd_RunEyeSweep_t;) + +/** + * \brief RUN_SERDES_EYE_SWEEP command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuCmd_RunEyeSweepResp +{ + int8_t spoLeft; /*!< SPO Left value */ + int8_t spoRight; /*!< SPO Right value */ +} adi_adrv903x_CpuCmd_RunEyeSweepResp_t;) + +/** + * \brief RUN_SERDES_VERT_EYE_SWEEP command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuCmd_RunVertEyeSweep +{ + adi_adrv903x_CpuCmd_DeserializerLane_e lane; /*!< Deserializer lane number */ +} adi_adrv903x_CpuCmd_RunVertEyeSweep_t;) + +/** + * \brief RUN_SERDES_VERT_EYE_SWEEP command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuCmd_RunVertEyeSweepResp +{ + int8_t eyeHeightsAtSpo[512]; /*!< store the upper and lower eye height at 16 SPOs*/ +} adi_adrv903x_CpuCmd_RunVertEyeSweepResp_t;) + + +/** + * \brief JESD_GET_RX_LANE_SINT_CODES command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuCmd_GetRxLaneSintCodes +{ + uint8_t lane; /*!< Serdes lane id */ +} adi_adrv903x_CpuCmd_adi_adrv903x_CpuCmd_GetRxLaneSintCodes_t;) + +/** + * \brief JESD_GET_RX_LANE_SINT_CODES command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuCmd_GetRxLaneSintCodesResp +{ + uint8_t sintCodes[8]; /*!< store the SINT Codes */ +} adi_adrv903x_CpuCmd_GetRxLaneSintCodesResp_t;) + +/** + * \brief API stable equivalent of SerdesPhyLib_fgPubCalStatus_t + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_SerdesInitCalStatus +{ + int16_t temperature; + uint8_t lpfIndex; + uint8_t ctleIndex; + uint8_t numEyes; + uint16_t bsum; + uint16_t bsum_dc; + uint8_t spoLeft; + uint8_t spoRight; + uint16_t eom; + uint16_t eomMax; + int8_t pd; + int8_t innerUp; + int8_t innerDown; + int8_t outerUp; + int8_t outerDown; + int8_t b[8U]; +} adi_adrv903x_SerdesInitCalStatus_t;) + +/** + * \brief API stable equivalent of SerdesPhyLib_bgPubCalStatus_t + */ +ADI_ADRV903X_PACK_START +typedef struct adi_adrv903x_SerdesTrackingCalStatus +{ + int16_t temperature; + int8_t pd[2U]; + int8_t dllPeakPd[2U]; + int8_t dllPeakPdDelta[2U]; + int8_t innerUp; + int8_t innerDown; + int8_t outerUp; + int8_t outerDown; + int8_t b[8U]; +#ifndef ADI_LIBRARY_RM_FLOATS + float ps[2U]; + float yVector[16U]; +#else + uint32_t ps_float[2U]; + uint32_t yVector_float[16U]; +#endif +} adi_adrv903x_SerdesTrackingCalStatus_t; +ADI_ADRV903X_PACK_FINISH + +#endif /* __ADI_ADRV903X_CPU_CMD_RUN_SERDES_EYE_SWEEP_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_error_codes_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_error_codes_types.h new file mode 100644 index 0000000000000..5cf3eff84c338 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_error_codes_types.h @@ -0,0 +1,29 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * \file adi_adrv903x_cpu_error_codes_types.h + * + * \brief Contains CPU error code definitions + * + * \details Contains CPU error code definitions + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADI_ADRV903X_CPU_ERROR_CODES_TYPES_H__ +#define __ADI_ADRV903X_CPU_ERROR_CODES_TYPES_H__ + + +#include "adi_library_types.h" + + + +/* Typedef and enumeration for CPU system-wide error codes */ +typedef uint32_t adi_adrv903x_CpuErrorCode_t; + +#endif /* __ADI_ADRV903X_CPU_ERROR_CODES_TYPES_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_fw_rev_info_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_fw_rev_info_types.h new file mode 100644 index 0000000000000..b1e4ba61de68a --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_fw_rev_info_types.h @@ -0,0 +1,31 @@ + /** + * \file adi_adrv903x_cpu_fw_rev_info_types.h + * + * \brief Contains device revision information. + * + * \details Contains device revision information. + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADI_ADRV903X_CPU_FW_REV_INFO_TYPES_H__ +#define __ADI_ADRV903X_CPU_FW_REV_INFO_TYPES_H__ + +/** +* \brief Enumerated list of FW image build options. +*/ +typedef enum adi_adrv903x_CpuFwBuildType +{ + ADI_ADRV903X_CPU_FW_BUILD_RELEASE = 0, /*!< FW release mode */ + ADI_ADRV903X_CPU_FW_BUILD_DEBUG = 1, /*!< FW debug mode */ + ADI_ADRV903X_CPU_FW_TRBLSHOOT = 8 /*!< FW troubleshoot mode */ +} adi_adrv903x_CpuFwBuildType_e; + +#endif /* __ADI_ADRV903X_CPU_FW_REV_INFO_TYPES_H__*/ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_health_monitor_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_health_monitor_types.h new file mode 100644 index 0000000000000..300c612ae7cb1 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_health_monitor_types.h @@ -0,0 +1,74 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2020 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_cpu_health_monitor_types.h + * + * \brief Contains ADRV903X CPU Health Monitor data types + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADI_ADRV903X_CPU_HEALTH_MONITOR_TYPES_H__ +#define __ADI_ADRV903X_CPU_HEALTH_MONITOR_TYPES_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cpu_error_codes_types.h" + +#ifdef __ICCARM__ +/* + * Error[Pm009]: Identifiers (internal and external) shall not rely on + * significance of more than 31 characters (MISRA C 2004 rule 5.1) + * + * To satisfy API naming conventions it is necessary to have this long common + * macro prefix. + */ +#pragma diag_suppress=Pm009 +#endif /* __ICCARM__ */ + +/** + * \brief CPU Usage enumeration and type + */ +typedef enum adi_adrv903x_CpuUsage +{ + ADI_ADRV903X_CPU_USAGE_NORMAL, /*!< CPU usage is normal */ + ADI_ADRV903X_CPU_USAGE_STARVING, /*!< Some of the cals may be starving */ + ADI_ADRV903X_CPU_USAGE_CRITICAL /*!< Cals are not getting chance to run */ +} adi_adrv903x_CpuUsage_e; +typedef uint8_t adi_adrv903x_CpuUsage_t; + +/** + * \brief Health Monitor structure for a single CPU + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_HealthMonitorCpuStatusSingle +{ + uint64_t initCalStatusMask; /*!< Status bits for all init calibrations, where bits correspond to calibrations as defined in adi_adrv903x_InitCalibrations_e. A bit will be 0 if the corresponding calibration indicated no error. A bit set to 1 indicates the corresponding calibration generated an error. The bit is cleared when the corresponding calibration is re-run. */ + uint32_t numInitCalErrors; /*!< Total number of Init Cal errors generated since powerup */ + uint64_t trackingCalStatusMask; /*!< Status bits for all tracking calibrations, where bits correspond to calibrations as defined in adi_adrv903x_TrackingCalibrationMask_e. A bit will be 0 if the corresponding calibration indicated no error. A bit set to 1 indicates the corresponding calibration generated an error. The bit is cleared when the corresponding calibration is re-run. */ + uint32_t numTrackingCalErrors; /*!< Total number of Tracking Cal errors generated since powerup */ + uint32_t numSystemErrors; /*!< Total number of System Errors that have occured since bootup. */ + uint32_t numSystemWarnings; /*!< Total number of System Warnings that have occured since bootup */ + adi_adrv903x_CpuUsage_t cpuUsage; /*!< CPU Usage level */ +} adi_adrv903x_HealthMonitorCpuStatusSingle_t;) + +/** + * \brief Health Monitor structure for all CPUs + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_HealthMonitorCpuStatus +{ + adi_adrv903x_HealthMonitorCpuStatusSingle_t cpu0; /*!< CPU Health Monitor Status info for CPU0 */ + adi_adrv903x_HealthMonitorCpuStatusSingle_t cpu1; /*!< CPU Health Monitor Status info for CPU1 */ +} adi_adrv903x_HealthMonitorCpuStatus_t;) + +#ifdef __ICCARM__ +/* Restore checking for MISRA 5.1*/ +#pragma diag_default=Pm009 +#endif + +#endif /* __ADI_ADRV903X_CPU_HEALTH_MONITOR_TYPES_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_log_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_log_types.h new file mode 100644 index 0000000000000..de75b0ad77106 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_log_types.h @@ -0,0 +1,78 @@ + /** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + + /** + * \file adi_adrv903x_cpu_log_types.h + * + * \brief Contains CPU log types + * + * \details Contains CPU log types + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADI_ADRV903X_CPU_LOG_TYPES_H__ +#define __ADI_ADRV903X_CPU_LOG_TYPES_H__ + + +#include "adi_library_types.h" + + + +/** + * \brief CPU log events + */ +typedef enum adi_adrv903x_CpuLogEvent +{ + /* LOG_EVENT = 0 is reserved */ + ADI_ADRV903X_CPU_LOG_EVENT_ERROR = 1, /*!< Error messages */ + ADI_ADRV903X_CPU_LOG_EVENT_WARNING = 2, /*!< Warning messages */ + ADI_ADRV903X_CPU_LOG_EVENT_INFO = 3, /*!< Informational messages, least verbose */ + ADI_ADRV903X_CPU_LOG_EVENT_INFO_2 = 4, /*!< Informational messages, most verbose */ + ADI_ADRV903X_CPU_LOG_EVENT_INVALID = 5 /*!< Invalid setting (ignore) */ +} adi_adrv903x_CpuLogEvent_e; +typedef uint8_t adi_adrv903x_CpuLogEvent_t; + +/** + * \brief CPU log CPU ID + */ +typedef enum adi_adrv903x_CpuLogCpuId +{ + ADI_ADRV903X_CPU_LOG_CPU_ID_NONE = 0x0, /*!< No CPUs */ + ADI_ADRV903X_CPU_LOG_CPU_ID_0 = 0x1, /*!< CPU 0 (Primary CPU) */ + ADI_ADRV903X_CPU_LOG_CPU_ID_1 = 0x2, /*!< CPU 1 */ + ADI_ADRV903X_CPU_LOG_CPU_ID_ALL = 0x3, /*!< All CPUs */ + ADI_ADRV903X_CPU_LOG_CPU_ID_INVALID = 0xFF /*!< Invalid setting (ignore) */ +} adi_adrv903x_CpuLogCpuId_e; +typedef uint8_t adi_adrv903x_CpuLogCpuId_t; + +/** + * \brief CPU log object ID + */ +typedef uint32_t adi_adrv903x_CpuLogObjId_t; + +/** + * \brief CPU log object ID filter enable + */ +typedef enum adi_adrv903x_CpuLogObjIdEnable +{ + ADI_ADRV903X_CPU_LOG_OBJ_ID_DISABLE = 0x0, /*!< Disable */ + ADI_ADRV903X_CPU_LOG_OBJ_ID_ENABLE = 0x1, /*!< Enable */ + ADI_ADRV903X_CPU_LOG_OBJ_ID_INVALID = 0xFF /*!< Invalid setting (ignore) */ +} adi_adrv903x_CpuLogObjIdEnable_e; +typedef uint8_t adi_adrv903x_CpuLogObjIdEnable_t; + +/** + * \brief CPU log object ID filter settings + */ +typedef struct adi_adrv903x_CpuLogObjIdFilter +{ + adi_adrv903x_CpuLogObjId_t objId; /*!< Object ID */ + adi_adrv903x_CpuLogObjIdEnable_t objIdFilterEnable; /*!< Filter enable/disable */ +} adi_adrv903x_CpuLogObjIdFilter_t; + +#endif /* __ADI_ADRV903X_CPU_LOG_TYPES_H__*/ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_radio_cmd.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_radio_cmd.h new file mode 100644 index 0000000000000..1543845afaad6 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_radio_cmd.h @@ -0,0 +1,22 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2022 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_cpu_radio_cmd.h + * + * \brief Contains ADRV903X CPU Radio command data structures. + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADI_ADRV903X_CPU_RADIO_CMD_H__ +#define __ADI_ADRV903X_CPU_RADIO_CMD_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cpu_error_codes_types.h" + +#endif /* __ADI_ADRV903X_CPU_RADIO_CMD_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_sw_bkpt_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_sw_bkpt_types.h new file mode 100644 index 0000000000000..85b9770ce4858 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_sw_bkpt_types.h @@ -0,0 +1,37 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_cpu_sw_bkpt_types.h + * + * \brief Contains the definitions for Software Breakpoints + * + * \details Contains the definitions for Software Breakpoints + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADI_ADRV903X_CPU_SW_BKPT_TYPES_H__ +#define __ADI_ADRV903X_CPU_SW_BKPT_TYPES_H__ + + +#include "adi_library_types.h" + + + +/** +* \brief Software breakpoint entry for each object +*/ +typedef struct adi_adrv903x_SwBreakPointEntry +{ + uint32_t objId; /*! Object ID of the module to which the break point belongs */ + uint32_t chanMask; /*! Bit mask of channels for which the break point to be enabled */ + uint32_t bkptMask; /*! Bit mask of the breakpoints to be enabled */ +} adi_adrv903x_SwBreakPointEntry_t; + +#endif /* __ADI_ADRV903X_CPU_SW_BKPT_TYPES_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_sys_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_sys_types.h new file mode 100644 index 0000000000000..6d53418d2ed20 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_sys_types.h @@ -0,0 +1,48 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2020 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_cpu_sys_types.h + * + * \brief Contains ADRV903X Calibration data types + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_CPU_SYS_TYPES_H__ +#define __ADRV903X_CPU_SYS_TYPES_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cpu_error_codes_types.h" + + +/** + * \brief Cpu System Status Mask + */ +typedef enum adi_adrv903x_CpuSysStatusMask +{ + ADI_ADRV903X_CPU_SS_ID_1_MASK = 0x01u /*!< Cpu System Status ID Mask 1 */ + +} adi_adrv903x_CpuSysStatusMask_e; + +/** + * \brief Data structure to hold common cpu system status information + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_CpuSysStatus +{ + adi_adrv903x_CpuErrorCode_t errorCode; /*!< Current error condition reported by the calibration */ + uint32_t placeHolder; /*!< example of status */ +} adi_adrv903x_CpuSysStatus_t;) + + + +#ifdef __ICCARM__ +#pragma diag_default=Pm009 +#endif /* __ICCARM__ */ + +#endif /* __ADRV903X_CPU_SYS_TYPES_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_types.h new file mode 100644 index 0000000000000..2e7220ee85e15 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_cpu_types.h @@ -0,0 +1,105 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_cpu_types.h +* +* \brief Contains ADRV903X data types for on board cpus feature +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef _ADI_ADRV903X_CPU_TYPES_H_ +#define _ADI_ADRV903X_CPU_TYPES_H_ + +#include "adi_adrv903x_utilities_types.h" +#include "adi_adrv903x_version_types.h" +#include "adi_adrv903x_cpu_fw_rev_info_types.h" +#include "adi_library_types.h" + + +#define ADI_ADRV903X_CPU_0_BINARY_IMAGE_FILE_SIZE_BYTES (ADRV903X_CPU_PM_SIZE) +#define ADI_ADRV903X_CPU_1_BINARY_IMAGE_FILE_SIZE_BYTES (ADRV903X_CPU_PM_SIZE) + +#define ADI_ADRV903X_CPU_0_BINARY_IMAGE_FILE_SIZE_MASK (ADRV903X_CPU_PM_SIZE - 1u) + +#define ADI_ADRV903X_CPU_0_PROFILE_BINARY_IMAGE_FILE_SIZE_BYTES ADRV903X_DEVICE_PROFILE_SIZE_BYTES +#define ADI_ADRV903X_LINK_ID_MAX 1U + +/** + * \brief Enumerated list of CPU Type + */ +typedef enum adi_adrv903x_CpuType +{ + ADI_ADRV903X_CPU_TYPE_UNKNOWN = -1, /*!< Unknown CPU */ + ADI_ADRV903X_CPU_TYPE_0, /*!< CPU 0 */ + ADI_ADRV903X_CPU_TYPE_1, /*!< CPU 1 */ + ADI_ADRV903X_CPU_TYPE_MAX_RADIO, /*!< Number of radio CPUs */ + ADI_ADRV903X_CPU_TYPE_MAX, /*!< total CPUs, radio and non-radio */ +} adi_adrv903x_CpuType_e; + +#ifndef CLIENT_IGNORE +/** + * \brief Structure to hold memory map of a cpu + */ +typedef struct adi_adrv903x_CpuAddr +{ + uint8_t enabled; /*!< Cpu enabled status */ + + /* subsystem registers */ + uint16_t ctlAddr; /*!< control register */ + uint32_t bootAddr; /*!< boot address */ + uint32_t stackPtrAddr; /*!< stack pointer */ + uint32_t memBankCtrlAddr; /*!< memory bank control register */ + + /* Mailbox registers */ + uint16_t cmdAddr; /*!< command. b7 = command_busy. b5:0 command */ + uint16_t extCmdAddr; /*!< command payload. 4 bytes */ + uint16_t cmdStatusAddr; /*!< command status. 16 bytes */ + + /* Program section */ + uint32_t progStartAddr; /*!< start address of program memory section */ + uint32_t progEndAddr; /*!< end address of program memory section */ + uint32_t versionAddr; /*!< 48-bytes set aside for FW Rev Info address */ + uint32_t structChecksumAddr; /*!< checksum structure address */ + uint32_t debugPointersAddr; /*!< Debug Pointers */ + uint32_t buildChecksumAddr; /*!< FW build time checksum address */ + + /* Data section */ + uint32_t dataStartAddr; /*!< start address of data memory section */ + uint32_t dataEndAddr; /*!< end address of data memory section */ + uint32_t cfrPulseAddr; /*!< */ + uint32_t mailboxSetAddr; /*!< Mailbox SET command buffer */ + uint32_t mailboxGetAddr; /*!< Mailbox GET command buffer */ + uint32_t mailboxRunInitAddr; /*!< Mailbox RUN_INIT command buffer */ + uint32_t mailboxFhmAddr; /*!< Mailbox Frequency Hopping Mode */ + uint16_t curTransactionId[ADI_ADRV903X_LINK_ID_MAX]; +} adi_adrv903x_CpuAddr_t; + +/** + * \brief CPU data structure + */ +typedef struct adi_adrv903x_Cpu +{ + adi_adrv903x_Version_t fwVersion; /*!< FW version */ + adi_adrv903x_Version_t devProfileVersion; /*!< Device profile version */ + uint32_t devProfileAddr; /*!< Device Profile structure address */ + uint32_t devDebugConfigAddr; /*!< Device Debug Config structure address */ + uint8_t devDebugIarEnable; /*!< Device Debug IAR Enable flag */ + adi_adrv903x_CpuAddr_t cpuAddr[ADI_ADRV903X_MAX_NUM_CPUS]; /*!< CPU address structures */ + adi_adrv903x_CpuMemDumpBinaryInfo_t cpuMemDumpBinaryInfo; /*!< CPU Memory Dump Binary Info structures */ +} adi_adrv903x_Cpu_t; +#endif + +/** + * \brief Data structure to FW version information + */ +typedef struct adi_adrv903x_CpuFwVersion +{ + adi_adrv903x_Version_t commVer; /*!< Common version for API and FW */ + adi_adrv903x_CpuFwBuildType_e cpuFwBuildType; /*!< BuildType for FW */ +} adi_adrv903x_CpuFwVersion_t; + +#endif /* _ADI_ADRV903X_CPU_TYPES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_datainterface.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_datainterface.h new file mode 100644 index 0000000000000..ff473116d7c99 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_datainterface.h @@ -0,0 +1,1864 @@ + /** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_datainterface.h + * \brief Contains ADRV903X API public function prototypes related to the data interface + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_DATAINTERFACE_H_ +#define _ADI_ADRV903X_DATAINTERFACE_H_ + +#ifndef __KERNEL__ +#include +#include +#endif +#include "adi_adrv903x_datainterface_types.h" +#include "adi_adrv903x_error.h" +#include "adi_adrv903x_cpu_cmd_run_serdes_eye_sweep.h" + + +/** + * \brief Initiates data capture using the Rx/ORx data capture RAM + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Pointer to the device settings structure + * \param[in] channelSelect Channel mask indicating which channel is being captured + * \param[in] captureLocation The location at which the data capture will occur + * \param[in,out] captureData An array that stores the captured data + * \param[in] captureLength The size of the data to capture; i.e. the size of captureData + * \param[in] trigger Immediate Capture (0); Triggered capture (1) + * \param[in] timeout_us Timeout value in microseconds. Maximum time to capture data. + * + * \retval adi_adrv903x_ErrAction_e - ADI_COMMON_ACT_NO_ACTION if Successful + */ + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxOrxDataCaptureStart( adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e channelSelect, + const adi_adrv903x_RxOrxDataCaptureLocation_e captureLocation, + uint32_t captureData[], + const uint32_t captureLength, + const uint8_t trigger, + const uint32_t timeout_us); + +/**************************************************************************** + * Initialization functions + **************************************************************************** + */ +/** + * \brief Sets the ADC sample crossbar for the specified ADRV903X framer + * + * + * \pre This function is called after JESD204B/C initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Pointer to the device settings structure + * \param[in] framerSel selected of framer defined in adi_adrv903x_FramerSel_e + * \param[in] adcXbar Pointer to the JESD structure adi_adrv903x_AdcSampleXbarCfg_t + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AdcSampleXbarSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + const adi_adrv903x_AdcSampleXbarCfg_t* const adcXbar); +/** + * \brief Gets the ADC sample crossbar converter configuration map for + * the chosen JESD204B/C framer converter + * + * \pre This function is called after JESD204B/C initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Pointer to the device settings structure + * \param[in] framerSel selected of framer defined in adi_adrv903x_FramerSel_e + * \param[out] adcXbar Pointer to the JESD structure adi_adrv903x_AdcSampleXbarCfg_t + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AdcSampleXbarGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + adi_adrv903x_AdcSampleXbarCfg_t* const adcXbar); + +/** + * \brief Sets the DAC sample crossbar for the specified ADRV903X deframer + * + * \pre This function is called after JESD204B/C initialization + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Pointer to the device settings structure + * \param[in] deframerSel selected of deframer defined in adi_adrv903x_DeframerSel_e + * \param[in] dacXbar Pointer to the JESD structure adi_adrv903x_DacSampleXbarCfg_t + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DacSampleXbarSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const adi_adrv903x_DacSampleXbarCfg_t* const dacXbar); +/** + * \brief Gets the DAC sample crossbar for the specified ADRV903X deframer + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Pointer to the device settings structure + * \param[in] deframerSel selected of framer defined in adi_adrv903x_DeframerSel_e + * \param[out] dacXbar Pointer to the JESD structure adi_adrv903x_DacSampleXbarCfg_t + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DacSampleXbarGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DacSampleXbarCfg_t* const dacXbar); + +/** +* \brief Gets the JESD204B/C Framer's configuration +* +* This function reads the JESD204B/C framer settings. +* +* \pre This function may be called any time after device initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to the device settings structure +* \param[in] framerSel selected of framer defined in adi_adrv903x_FramerSel_e +* \param[out] framerCfg Pointer to the JESD Framer configuration read back +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + adi_adrv903x_FramerCfg_t* const framerCfg); + +/** +* \brief Gets the JESD204B/C Deframer's configuration +* +* This function reads the JESD204B/C deframer settings. +* +* \pre This function may be called any time after device initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable -Pointer to the device settings structure +* \param[in] deframerSel selected of framer defined in adi_adrv903x_DeframerSel_e +* \param[out] deframerCfg Pointer to the JESD Deframer configuration read back +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DeframerCfg_t* const deframerCfg); +/** +* \brief Gets the JESD204B / C Deframer's scaled configuration +* +* This function reads the JESD204B / C deframer settings. +* +* \pre This function may be called any time after device initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in, out] device Context variable - Pointer to the device settings structure +* \param[in] deframerSel selected of framer defined in adi_adrv903x_DeframerSel_e +* \param[in] chanSel selected Tx channel defined in adi_adrv903x_TxChannels_e +* \param[out] deframerCfg Pointer to the JESD Deframer configuration read back +* \param[in] bypass CDUC if ADI_TRUE +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerCfgGetScaled(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const adi_adrv903x_TxChannels_e chanSel, + adi_adrv903x_DeframerCfg_t* const deframerCfg, + const uint8_t bypass); + +/** + * \brief Gets the link states for all the framers. + * + * \pre This function is called after JESD204B/C initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Pointer to the device settings structure + * \param[out] framerLinkState Pointer to the framer link states + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerLinkStateGet(adi_adrv903x_Device_t* const device, + uint8_t* const framerLinkState); + +/** + * \brief Sets the framer link states. + * + * \pre This function is called after JESD204B/C initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Pointer to the device settings structure + * \param [in] framerSelMask indicate which framers are selected. + * \param[in] enable indicate to enable(1) or disable(0) the selected framers in framerSelMask + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerLinkStateSet(adi_adrv903x_Device_t* device, + const uint8_t framerSelMask, + uint8_t const enable); + +/** + * \brief Reset Deframer PRBS Count error. + * + * \pre This function is called after JESD204B/C initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Pointer to the device settings structure + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmPrbsCountReset(adi_adrv903x_Device_t* const device); + +/** + * \brief Gets the link states for all the deframers. + * + * \pre This function is called after JESD204B/C initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Pointer to the device settings structure + * \param[out] deframerLinkState Pointer to the deframer link states + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLinkStateGet(adi_adrv903x_Device_t* device, + uint8_t* const deframerLinkState); + +/** + * \brief Sets the deframer link states. + * + * \pre This function is called after JESD204B/C initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Pointer to the device settings structure + * \param [in] deframerSelMask indicate which deframers are selected. + * \param[in] enable indicate to enable(1) or disable(0) the selected framers in framerSelMask + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLinkStateSet(adi_adrv903x_Device_t* device, + const uint8_t deframerSelMask, + uint8_t const enable); + +/** + * \brief Configures and enables or disables the transceiver's lane/sample PRBS + * checker. + * This is a debug function to be used for debug of the Tx JESD204B/C lanes. + * The Tx link(s) need to be configured and on to use this function. If the + * checkerLocation is ADI_ADRV903X_PRBSCHECK_LANEDATA, the PRBS is checked at the + * output of the deserializer. If the checkLocation is ADI_ADRV903X_PRBSCHECK_SAMPLEDATA + * the PRBS data is expected to be framed JESD204B/C data and the PRBS is checked + * after the JESD204B/C data is deframed. For the sample data, there is only + * a PRBS checker on deframer output 0. The lane PRBS has a checker on each + * deserializer lane. + * + * \pre This function is called after JESD204B/C initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable -Pointer to the device settings structure + * \param [in] dfrmPrbsCfg Pointer to adi_adrv903x_DfrmPrbsCfg_t data structure. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmPrbsCheckerStateSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DfrmPrbsCfg_t * const dfrmPrbsCfg); + +/** + * \brief Read back transceiver's lane/sample PRBS checker configuration + * + * \pre This function is called after JESD204B/C initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in,out] device Context variable -Pointer to the device settings structure + * \param [in,out] dfrmPrbsCfg Pointer to adi_adrv903x_DfrmPrbsCfg_t data structure. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmPrbsCheckerStateGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_DfrmPrbsCfg_t * const dfrmPrbsCfg); + +/** + * \brief Enables or disables the external SYSREF JESD204B/C signal to the transceiver's framers + * + * For the framer to retime its LMFC (local multi frame clock), a SYSREF rising edge is required. + * The external SYSREF signal at the pin can be gated off internally so the framer does not see + * a potential invalid SYSREF pulse before it is configured correctly. + * + * By default the SYSREF signal ungated, however, the Multichip Sync state machine + * still does not allow the external SYSREF to reach the framer until the other stages of multichip + * sync have completed. As long as the external SYSREF is correctly configured before performing MCS, + * this function may not be needed by the BBIC, since the MCS state machine gates the SYSREF to the + * framer. + * + * \pre This function is called after the device has been initialized and the JESD204B/C framer is enabled + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable -Pointer to the device settings structure + * \param [in] framerSelMask indicate which framers are selected. + * \param [in] enable indicate to enable(1) or disable(0) Sysref for the selected framers in framerSelMask + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSysrefCtrlSet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + uint8_t const enable); + +/** + * \brief Reads the bit indicating external SYSREF JESD204b signal of the transceiver's framers. Only status for + * \ one channel at a time can be read. + * + * \pre This function is called after the device has been initialized and the JESD204B/C framer is enabled + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable -Pointer to the device settings structure + * \param [in] framerSel indicate which framers are selected. + * \param [out] enable Pointer to contain value to indicate enable(1) or disable(0) the selected framer in framerSelMask + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSysrefCtrlGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + uint8_t * const enable); + +/** + * \brief Enables or disables the external SYSREF JESD204B/C signal to the transceiver's deframers + * + * \pre This function is called after the device has been initialized and the JESD204B/C deframer is enabled + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable -Pointer to the device settings structure + * \param [in] deframerSelMask indicate which deframers are selected. + * \param [in] enable indicate to enable(1) or disable(0) Sysref for the selected deframers in deframerSelMask + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerSysrefCtrlSet(adi_adrv903x_Device_t* const device, + const uint8_t deframerSelMask, + uint8_t const enable); + +/** + * \brief Reads the bit indicating external SYSREF JESD204B/C signal of the transceiver's deframers. Only status for one channel + * \ at a time can be read. + * + * + * \pre This function is called after the device has been initialized and the JESD204B/C deframer is enabled + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable -Pointer to the device settings structure + * \param [in] deframerSel indicate which deframers are selected. + * \param [out] enable Pointer to contain value to indicate enable(1) or disable(0) the selected deframer in deframerSelMask + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerSysrefCtrlGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + uint8_t * const enable); + +/** +* \brief Selects the PRBS type and enables or disables RX Framer PRBS generation + * + * This is a debug function to be used for debug of the Rx JESD204B/C lanes. + * Rx data transmission on the JESD204B/C link(s) is not possible + * when the framer test data is activated. To disable PRBS call this function + * again with the framer data source set to ADI_ADRV903X_FTD_ADC_DATA. + * + * \pre This function may be called any time after device initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in] device Context variable -Pointer to the device settings structure + * \param [in,out] frmTestDataCfg Pointer to adi_adrv903x_FrmTestDataCfg_t for PRBS configuration setting. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerTestDataSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_FrmTestDataCfg_t * const frmTestDataCfg); + +/** + * \brief Gets the PRBS Framer Test Mode and Inject Points + * + * This is a debug function to be used for debug of the Rx JESD204B/C lanes. + * Rx data transmission on the JESD204B/C link(s) is not possible + * when the framer test data is activated. + * + * \pre This function may be called any time after device initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in] device Context variable -Pointer to the device settings structure + * \param [in] framerSel contains the framer of interest + * \param [in,out] frmTestDataCfg Pointer to adi_adrv903x_FrmTestDataCfg_t for PRBS configuration setting. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerTestDataGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + adi_adrv903x_FrmTestDataCfg_t * const frmTestDataCfg); + +/** + * \brief Get the deserializer lane and deframer sample PRBS error counters + * + * In the case that the PRBS checker is set to check at the deframer output + * sample, there is only a checker on the Deframer Sample 0 output. In this + * case the lane function parameter is ignored and the sample 0 PRBS counter + * is returned. + * + * errorStatus: Index 0 contains error status if in sample mode, otherwise status are maintained per index. + * Sample Mode: 0b: Error Count, 1b: Error Flag, 2b: Clears Error. + * Data Mode: 0b: Lane inverted, 1b: invalid data flag, b2: sample/lane error flag. + * \pre If reading PRBS samples framed in the JESD204 data, the JESD204 deframer must be configured. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in] device Context variable -Pointer to the device settings structure + * \param [in,out] counters Pointer to PRBS Error counter structure to be returned + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmPrbsErrCountGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_DfrmPrbsErrCounters_t * const counters); + +/** + * \brief Reset the serializer + * + * \pre This function can be called after JESD204B/C initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in, out] device Context variable -Pointer to the device settings structure + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerializerReset(adi_adrv903x_Device_t* const device); + + +/** + * \brief Reset the serializer v2 + * + * \pre This function can be called after JESD204B/C initialization and after adi_adrv903x_SerializerReset + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in, out] device Context variable -Pointer to the device settings structure + * \param[in] pSerResetParms - Pointer to the Serializer Reset Parameter structure adrv903x_CpuCmd_SerReset_t + * \param[out] pSerResetResp - Pointer to the Serializer Reset Result Parameter structure adrv903x_CpuCmd_SerResetResp_t + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerializerReset_v2(adi_adrv903x_Device_t* const device, + adi_adrv903x_CpuCmd_SerReset_t* const pSerResetParms, + adi_adrv903x_CpuCmd_SerResetResp_t* const pSerResetResp); + +/** + * \brief Sets phase adjustment value(i.e. Lmfc offset) for selected framer. + * + * \pre This function can be called after JESD204B/C initialization + * + * Maximum value for lmfcOffset variable is (JESD K param* JESD S param) - 1 + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in, out] device Context variable -Pointer to the device settings structure + * \param[in] framerSelect Framer selection to configure lmfc offset + * \param[in] lmfcOffset Phase adjustment value for selected framer + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerLmfcOffsetSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSelect, + const uint16_t lmfcOffset); + +/** + * \brief Reads phase adjustment value(i.e. Lmfc offset) of selected framer + * + * \pre This function can be called after JESD204B/C initialization + * + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in, out] device Context variable -Pointer to the device settings structure + * \param[in] framerSelect Deframer selection to readback lmfc offset + * \param[out] lmfcOffset Pointer to readback value for phase adjustment + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerLmfcOffsetGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSelect, + uint16_t * const lmfcOffset); + +/** + * \brief Sets phase adjustment value(i.e. Lmfc offset) for selected value + * + * \pre This function can be called after JESD204B/C initialization + * + * Maximum value for lmfcOffset variable is (JESD K param* JESD S param) - 1 + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in, out] device Context variable -Pointer to the device settings structure + * \param[in] deframerSelect Deframer selection to configure lmfc offset + * \param[in] lmfcOffset Phase adjustment value for selected deframer + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmLmfcOffsetSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSelect, + const uint16_t lmfcOffset); + +/** + * \brief Reads phase adjustment value(i.e. Lmfc offset) of selected deframer + * + * \pre This function can be called after JESD204B/C initialization + * + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in, out] device Context variable -Pointer to the device settings structure + * \param[in] deframerSelect Deframer selection to readback lmfc offset + * \param[out] lmfcOffset Pointer to readback value for phase adjustment + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmLmfcOffsetGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSelect, + uint16_t * const lmfcOffset); + +/** + * \brief Reads phase diff value for selected deframer + * + * \pre This function can be called after JESD204B/C initialization + * + * This function calculates the phase diff value after the adjustment which is + * configured with adi_adrv903x_DfrmLmfcOffsetSet(). This phase difference can + * be used to determine how to set phase adjustment + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in, out] device Context variable -Pointer to the device settings structure + * \param[in] deframerSelect Deframer selection to readback lmfc offset + * \param[out] phaseDiff Pointer to readback value for phase diff + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmPhaseDiffGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSelect, + uint16_t * const phaseDiff); +/** +* \brief Get framer status for the selected framer. Support for both JESD 204B/C. +* +* \pre This function can be called after JESD204B/C initialization +* 204B and 204C: framerStatus->status bit pattern meaning: +* b0: Input cfg not supported +* b1: SYSREF phase established by framer +* b2: SYSREF phase error - a new SYSREF had different +* timing than the first that set the LMFC timing. +* b3: pclk slow error +* b4: pclk fast error +* b5: reserved +* b6: reserved +* b7: Link type: 0: 204B, 1: 204C +* +* 204B: framerStatus->qbfStateStatus numeric value: +* 0x0 CGS +* 0x1 ILA_M0R +* 0x2 ILA_M0 +* 0x3 ILA_M1R +* 0x4 ILA_M1C1 +* 0x5 ILA_M1C2 +* 0x6 ILA_M1C3 +* 0x7 ILA_M1 +* 0x8 ILA_M2R +* 0x9 ILA_M2 +* 0xA ILA_M3R +* 0xB ILA_M3 +* 0xC ILA_BP +* 0xD UDATA +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] framerSel Framer selection +* \param[out] framerStatus Pointer to structure contains status for both 204B/C framer. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerStatusGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_FramerSel_e framerSel, + adi_adrv903x_FramerStatus_t * const framerStatus); + +/** +* \brief Get deframer status for the selected deframer. Support for both JESD 204B/C. +* This function is deprecated and replaced by adi_adrv903x_DeframerStatusGet_v2() +* +* \pre This function can be called after JESD204B/C initialization +* +* Status for JESD204B: in structure adi_adrv903x_DeframerStatus_t +* deframerStatus | Bit Name | Description +* ----------------|-----------------|-------------------------------------------------- +* [7] | Reserved | This bit is deprecated. For checksum status use adi_adrv903x_DfrmIlasMismatchGet(). +* [6] | EOF Event | This bit captures the internal status of the framer End of Frame event. Value =1 if framing error during ILAS +* [5] | EOMF Event | This bit captures the internal status of the framer End of Multi-Frame event. Value =1 if framing error during ILAS +* [4] | FS Lost | This bit captures the internal status of the framer Frame Symbol event. Value =1 if framing error during ILAS or user data (invalid replacement characters) +* [3] | Reserved | Reserved +* [2] | User Data Valid | =1 when in user data (deframer link is up and sending valid DAC data) +* [1] | SYSREF Received | Deframer has received the external SYSREF signal +* [0] | Syncb level | Current level of Syncb signal internal to deframer (=1 means link is up) +* +* Status for JESD204C: in structure adi_adrv903x_DeframerStatus_t +* deframerStatus | Bit Name | Description +* ----------------|--------------------------|-------------------------------------------------- +* [2:0] | Current lock state | These 3 bits indicate state of JESD204C Lock +* +* An explanation of what each the value of the 3 bits relates to is below: +* value | Description +* ----------------|----------------------------------------------------------------------------- +* 0 | Reset +* 1 | Unlocked +* 2 | Block(Blocks aligned) +* 3 | M_Block(Lanes aligned) +* 4 | E_M_Block(Multiblock aligned) +* 5 | FEC_BUF +* 6 | FEC_READY (Good State!) +* 7 | Forced +* +* reserved: in structure adi_adrv903x_DeframerStatus_t +* Bit position | Bit Name | Description +* ----------------|--------------------------|-------------------------------------------------- +* [0] | JESD204 type | 0: 204B, 1: 204C +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] deframerSel Deframer selection +* \param[out] deframerStatus Pointer to structure contains status for both 204B/C deframer. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerStatusGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DeframerStatus_t * const deframerStatus); + +/** +* \brief Get deframer status for all lanes in the selected deframer. Support for both JESD 204B/C. +* +* \pre This function can be called after JESD204B/C initialization +* +* Structure adi_adrv903x_DeframerStatus_v2_t +* +* phyLaneMask: The lane bit masks of lanes used by this selected deframer. +* +* linkState | Bit Name | Description +* ----------------|--------------------------|-------------------------------------------------- +* [0] | Link type | 1: link type 204C. 0: link type 204B +* [1] | Link state | 1: link is up. 0: link is down +* +* laneStatus: an array to contain status of all lanes. +* +* Status for JESD204B: laneStatus +* laneStatus[X] | Bit Name | Description +* ----------------|-----------------|-------------------------------------------------- +* [7] | Reserved | This bit is deprecated. For checksum status use adi_adrv903x_DfrmIlasMismatchGet(). +* [6] | EOF Event | This bit captures the internal status of the framer End of Frame event. Value =1 if framing error during ILAS +* [5] | EOMF Event | This bit captures the internal status of the framer End of Multi-Frame event. Value =1 if framing error during ILAS +* [4] | FS Lost | This bit captures the internal status of the framer Frame Symbol event. Value =1 if framing error during ILAS or user data (invalid replacement characters) +* [3] | LaneValid | This lane is used by the selected deframer. +* [2] | User Data Valid | =1 when in user data (deframer link is up and sending valid DAC data) +* [1] | SYSREF Received | Deframer has received the external SYSREF signal +* [0] | Syncb level | Current level of Syncb signal internal to deframer (=1 means link is up) +* +* Status for JESD204C: laneStatus +* laneStatus[X] | Bit Name | Description +* ----------------|--------------------------|-------------------------------------------------- +* [2:0] | Current lock state | These 3 bits indicate state of JESD204C Lock +* [3] | LaneValid | This lane is used by the selected deframer. +* +* An explanation of what each the value of the 3 bits Current lock state [2:0] is below: +* value | Description +* ----------------|----------------------------------------------------------------------------- +* 0 | Reset +* 1 | Unlocked +* 2 | Block(Blocks aligned) +* 3 | M_Block(Lanes aligned) +* 4 | E_M_Block(Multiblock aligned) +* 5 | FEC_BUF +* 6 | FEC_READY (Good State!) +* 7 | Forced +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] deframerSel Deframer selection +* \param[out] deframerStatus Pointer to structure contains status for all lanes for the selected deframer. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerStatusGet_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DeframerStatus_v2_t * const deframerStatus); + +/** +* \brief Get deframer status for the selected deframer. Support for only JESD204B. +* +* \pre This function can be called after JESD204B initialization +* +* Lane Status of structure adi_adrv903x_DfrmErrCounterStatus_t +* Bit | Description +*---------|------------------------------------------------------------- +* [7] | UEK Error, 0 = No Error, 1 = Error +* [6] | NIT Error, 0 = No Error, 1 = Error +* [5] | ILS Status, 0 = Not Completed, 1 = Completed Successfully +* [4] | ILD Status, 0 = Not Completed, 1 = Completed Successfully +* [3] | FS Status, 0 = Not Completed, 1 = Completed Successfully +* [2] | CCS Status, 0 = Not Completed, 1 = Completed Successfully +* [1] | CGS Status, 0 = Not Completed, 1 = Completed Successfully +* [0] | BD Error, 0 = No Error, 1 = Error +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] deframerSel Deframer selection +* \param[in] laneNumber selects the lane to read (values from 0 - 7) +* \param[out] errCounterStatus Pointer to structure for returning the lane status and error count values. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmErrCounterStatusGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const uint8_t laneNumber, + adi_adrv903x_DfrmErrCounterStatus_t * const errCounterStatus); + +/** +* \brief Clear the error counters selected deframer. Support for only JESD204B. +* +* \pre This function can be called after JESD204B initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] deframerSel Deframer selection +* \param[in] laneNumber selects the lane to read (values from 0 - 7) +* \param[in] errCounterMask bitmasks to indicate which error type counters to be cleared. +* b0: BD clear, b1: INT clear, b2: UEK clear. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmErrCounterReset(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const uint8_t laneNumber, + uint32_t const errCounterMask); + +/** +* \brief Sets a threshold for CRC errors, which when exceeded, triggers the corresponding Deframer IRQ on any lane. +* Lanes error counts are considered independently not the cumulative error count across all lanes. +* A threshold value of 0, which is the default, will trigger the IRQ for any CRC error. +* +* \pre This function can be called after JESD204B/C initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in, out] device Context variable - Pointer to the ADRV903X data structure +* \param[in] threshold numbers of CRC errors to trigger the corresponding Deframer IRQ (default value: 0) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmErrCounterThresholdSet(adi_adrv903x_Device_t* const device, + const uint8_t threshold); + +/** +* \brief Get deframer status for the selected deframer. Support for only JESD204C. +* +* \pre This function can be called after JESD204C initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] deframerSel Deframer selection +* \param[in] laneNumber selects the lane to read (values from 0 - 7) +* \param[out] errCounterStatus Pointer to structure for returning the lane status and error count values. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Dfrm204cErrCounterStatusGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const uint8_t laneNumber, + adi_adrv903x_Dfrm204cErrCounterStatus_t * const errCounterStatus); + +/** +* \brief Clear the error counters selected deframer. Support for only JESD204C. +* +* \pre This function can be called after JESD204C initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] deframerSel Deframer selection +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Dfrm204cErrCounterReset(adi_adrv903x_Device_t * const device, + const adi_adrv903x_DeframerSel_e deframerSel); + +/** +* \brief to get a deframer link condition up or down. Support for both JESD204 B/C +* +* \pre This function can be called after JESD204B/C initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] deframerSel Deframer selection +* \param[out] dfrmLinkCondition pointer to a 8 bit value: 0: down, 1: up +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmLinkConditionGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_DeframerSel_e deframerSel, + uint8_t * const dfrmLinkCondition); + +/** +* \brief This function will return the elastic FIFO depth for the selected deframer. +* +* \pre This function can be called after JESD204B/C initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] deframerSel Deframer selection +* \param[in] laneNumber selects the lane to read (values from 0 - 7) +* \param[out] fifoDepth Pointer that will hold the elastic FIFO depth. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmFifoDepthGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const uint8_t laneNumber, + uint8_t * const fifoDepth); + +/** +* \brief This function will return the core buffer depth for the selected deframer. +* +* \pre This function can be called after JESD204B/C initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] deframerSel Deframer selection +* \param[out] coreBufDepth Pointer that will hold the core buffer depth. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmCoreBufDepthGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + uint8_t * const coreBufDepth); + +/** + * \brief This API is deprecated and replaced by adi_adrv903x_DfrmIlasMismatchGet_v2(). + * Compares received Lane0 ILAS configuration to ADRV903X deframer + * configuration and returns 32-bit mask indicating values that + * mismatched. Actual lane0 ILAS configuration and deframer + * configuration values can be obtained by passing a pointer to a + * structure of type adi_adrv903x_DfrmCompareData_t. + * + * \pre The Rx JESD204B link(s) needs to be configured and running to use + * this function + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * mismatch Mask| Description + * -------------|------------------------------------------ + * [14] | Lane0 Checksum, 0 = match, 1 = mismatch + * [13] | HD, 0 = match, 1 = mismatch + * [12] | CF, 0 = match, 1 = mismatch + * [11] | S, 0 = match, 1 = mismatch + * [10] | NP, 0 = match, 1 = mismatch + * [9] | CS, 0 = match, 1 = mismatch + * [8] | N, 0 = match, 1 = mismatch + * [7] | M, 0 = match, 1 = mismatch + * [6] | K, 0 = match, 1 = mismatch + * [5] | F, 0 = match, 1 = mismatch + * [4] | SCR, 0 = match, 1 = mismatch + * [3] | L, 0 = match, 1 = mismatch + * [2] | LID0, 0 = match, 1 = mismatch + * [1] | BID, 0 = match, 1 = mismatch + * [0] | DID, 0 = match, 1 = mismatch + * + * \param[in] device Context variable - Pointer to the ADRV903X data structure + * \param[in] deframerSel Deframer selection + * \param[out] dfrmData Pointer to a adi_adrv903x_DfrmCompareData_t structure that + * returns the deframer ILAS and configuration settings as well as the + * mismatch flag and zero data flag. If the zero flag is set to zero, + * then no valid ILAS data found indicating link is not enabled. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmIlasMismatchGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DfrmCompareData_t* const dfrmData); + +/** + * \brief Compares received all Lane ILAS configurations to ADRV903X deframer + * configuration and returns 32-bit mask indicating values that + * mismatched for each lane. Actual all lane ILAS configurations and deframer + * configuration values can be obtained by passing a pointer to a + * structure of type adi_adrv903x_DfrmCompareData_v2_t. + * + * \pre The Rx JESD204B link(s) needs to be configured and running to use + * this function + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * mismatch Mask| Description (adi_adrv903x_IlasMismatch_e) + * -------------|------------------------------------------ + * [14] | Lane Checksum, 0 = match, 1 = mismatch + * [13] | HD, 0 = match, 1 = mismatch + * [12] | CF, 0 = match, 1 = mismatch + * [11] | S, 0 = match, 1 = mismatch + * [10] | NP, 0 = match, 1 = mismatch + * [9] | CS, 0 = match, 1 = mismatch + * [8] | N, 0 = match, 1 = mismatch + * [7] | M, 0 = match, 1 = mismatch + * [6] | K, 0 = match, 1 = mismatch + * [5] | F, 0 = match, 1 = mismatch + * [4] | SCR, 0 = match, 1 = mismatch + * [3] | L, 0 = match, 1 = mismatch + * [2] | LID0, 0 = match, 1 = mismatch + * [1] | BID, 0 = match, 1 = mismatch + * [0] | DID, 0 = match, 1 = mismatch + * + * \param[in] device Context variable - Pointer to the ADRV903X data structure + * \param[in] deframerSel Deframer selection + * \param[out] dfrmData Pointer to a adi_adrv903x_DfrmCompareData_v2_t structure that + * returns the deframer ILAS and all lane configurations settings as well as the + * mismatch flag and zero data flag. If the zero flag is set to zero, + * then no valid ILAS data found indicating link is not enabled. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmIlasMismatchGet_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DfrmCompareData_v2_t* const dfrmData); +/** +* \brief This function will enable JESD framer loopback for the selected framer. +* The ADX Crossbar setting is changed to loopback setting. +* +* \pre This function can be called after JESD204B/C initialization +* - At least one Rx, one TX, and one deframer must be enabled. +* - IQ Sample clock for deframer and framer must match to avoid over/under-sampling. +* - Samples are sent to TX and received at RX. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] framerSel framer selection to enable loopback. Only one framer is allowed. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerLoopbackSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel); + +/** +* \brief This function will disable JESD framer loopback. adi_adrv903x_FramerLoopbackSet changes the adcCrossbar values, +* so user wants to disable the FramerLoopback and restore the previous adcCrossbar value, they must save it and call +* it as in argument of this function. +* +* \pre This function can be called after adi_adrv903x_FramerLoopbackSet +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] framerSel framer selection to disable loopback. Only one framer is allowed. +* \param[in] adcXbar pointer to intended adcXbar configuration for after FramerLoopback is disabled. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerLoopbackDisable(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + const adi_adrv903x_AdcSampleXbarCfg_t* const adcXbar); + + +/** +* \brief This function will enable JESD deframer loopback. +* +* \pre This function can be called after JESD204B/C initialization +* - Framer-0 and deframer-0 must be enabled. +* - At least one Rx, one TX must be enabled. +* - IQ Sample clock for deframer and framer must match to avoid over/under-sampling. +* - Samples are sent to RX and received at TX. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLoopbackSet(adi_adrv903x_Device_t* const device); + +/** +* \brief This function will disable JESD deframer loopback. +* +* \pre This function can be called after adi_adrv903x_FramerLoopbackSet +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLoopbackDisable(adi_adrv903x_Device_t* const device); + + +/** +* \brief This function will disable JESD deframer loopback. adi_adrv903x_DeframerLoopbackSet changes the adcCrossbar values, +* so user wants to disable the DeframerLoopback and restore the previous adcCrossbar value, they must save it and call +* it as in argument of this function. +* +* \pre This function can be called after adi_adrv903x_DeframerLoopbackSet +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] framerSel framer selection to disable loopback. Only one framer is allowed. +* \param[in] adcXbar pointer to intended adcXbar configuration for after FramerLoopback is disabled. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLoopbackDisable_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + const adi_adrv903x_AdcSampleXbarCfg_t* const adcXbar); + +/** +* \brief This function will enable JESD deframer lane loopback. +* +* \pre This function can be called after JESD204B/C initialization +* - At least one Rx, one TX, one framer, and one deframer must be enabled. +* - IQ Sample clock for deframer and framer must match to avoid over/under-sampling. +* - Samples are sent to RX and received at TX. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLaneLoopbackSet(adi_adrv903x_Device_t* const device); + +/** +* \brief This function will disable JESD deframer lane loopback. +* +* \pre This function can be called after adi_adrv903x_DeframerLaneLoopbackSet. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLaneLoopbackDisable(adi_adrv903x_Device_t* const device); + +/** + * \brief Set the framer JESD204B syncb signal mode to SPI or PIN mode + * + * \pre This function is called after the device has been initialized + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable - Pointer to the ADRV903X data structure + * \param[in] framerSelMask Select framer to set syncb mode + * \param[in] syncbMode Value to set syncb mode, '0' PIN mode, '1' SPI mode + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSyncbModeSet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + const uint8_t syncbMode); + +/** + * \brief Get the framer JESD204B syncb signal mode + * + * \pre This function is called after the device has been initialized + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable - Pointer to the ADRV903X data structure + * \param[in] framerSelMask Select framer to read syncb status, only one framer could be selected + * \param[out] syncbMode Value to readback syncb mode, '0' PIN mode, '1' SPI mode + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSyncbModeGet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + uint8_t* const syncbMode); + +/** + * \brief Set the framer JESD204B syncb signal status + * + * \pre This function is called after the device has been initialized and run in the syncb SPI mode only + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable - Pointer to the ADRV903X data structure + * \param[in] framerSelMask Select framer to set syncb status + * \param[in] syncbStatus Value to set syncb status, '1' the syncb is valid, '0' the syncb is invalid + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSyncbStatusSet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + const uint8_t syncbStatus); + +/** + * \brief Get the framer JESD204B syncb signal status + * + * \pre This function is called after the device has been initialized + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable - Pointer to the ADRV903X data structure + * \param[in] framerSelMask Select framer to read syncb status, only one framer could be selected + * \param[out] syncbStatus Value to set syncb status, '1' the syncb is valid, '0' the syncb is invalid + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSyncbStatusGet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + uint8_t* const syncbStatus); + +/** + * \brief Get the framer JESD204B syncb signal error counter + * + * \pre This function is called after the device has been initialized + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable - Pointer to the ADRV903X data structure + * \param[in] framerSelMask Select framer to read syncb error counter, only one framer could be selected + * \param[out] syncbErrCnt value to readback syncb error counter + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSyncbErrCntGet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + uint8_t* const syncbErrCnt); + +/** + * \brief Reset the framer JESD204B syncb signal error counter + * + * \pre This function is called after the device has been initialized + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable - Pointer to the ADRV903X data structure + * \param[in] framerSelMask Select framer to reset syncb error counter + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSyncbErrCntReset(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask); + +/** + * \brief Get the deframer JESD204B syncb signal error counter + * + * \pre This function is called after the device has been initialized + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable - Pointer to the ADRV903X data structure + * \param[in] deframerSelMask Select deframer to read syncb error counter, only one deframer could be selected + * \param[out] syncbErrCnt value to readback syncb error counter + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerSyncbErrCntGet(adi_adrv903x_Device_t* const device, + const uint8_t deframerSelMask, + uint8_t* const syncbErrCnt); + +/** + * \brief Reset the deframer JESD204B syncb signal error counter + * + * \pre This function is called after the device has been initialized + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable - Pointer to the ADRV903X data structure + * \param[in] deframerSelMask Select deframer to reset syncb error counter + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerSyncbErrCntReset(adi_adrv903x_Device_t* const device, + const uint8_t deframerSelMask); + +/** + * \brief Clears, Enables or disables the Framer errors: + * - PCLK related errors, i.e., whether it is faster/slower than the sample/convertor clock + * - SYSREF Phase Error + * + * \pre This function is called after the device has been initialized + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable - Pointer to the ADRV903X data structure + * \param[in] framerSel - selected framer defined in adi_adrv903x_FramerSel_e + * \param[in] action - selected error action defined in adi_adrv903x_SerdesErrAction_e + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerErrorCtrl(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + const adi_adrv903x_SerdesErrAction_e action); + + + +/** + * \brief Clears, Enables or disables the Deframer errors: + * - PCLK related errors, i.e., whether it is faster/slower than the sample/convertor clock + * - SYSREF Phase Error + * + * \pre This function is called after the device has been initialized + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in] device Context variable - Pointer to the ADRV903X data structure + * \param[in] deframerSel - selected deframer defined in adi_adrv903x_DeframerSel_e + * \param[in] action - selected error action defined in adi_adrv903x_SerdesErrAction_e + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerErrorCtrl(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const adi_adrv903x_SerdesErrAction_e action); + +/** + * \brief Reads the JESD 204B IRQ interrupt clear register. There is one common register for all deframers. + * + * This function reads the contents of the deframer 204B IRQ clear register. Use this function whenever a general purpose (GP) + * deframer IRQ asserts to find the maskable deframer IRQ sources. Note: Deframer IRQ sources Elastic Buffer Error Flag, + * Sysref Buffer Error, and the four Lane FIFO Async Error IRQ sources are always enabled and can not be masked in the + * interrupt clear register. + * + * \pre This function may be called any time after JESD204B link initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[out] irqMask Pointer to the bit mask value containing the contents of the deframer IRQ Clear Register + * + * Bit | Description + * -------------|----------------------------------------------------------------------------- + * [15] | UnUsed + * [14] | UnUsed + * [13] | UnUsed + * [12] | UnUsed + * [11] | UnUsed + * [10] | UnUsed + * [9] | UnUsed + * [8] | CMM - Configuration mismatch for lane0 0 = No Interrupt, 1 = Interrupt Asserted + * [7] | BD - Bad Disparity error counter 0 = No Interrupt, 1 = Interrupt Asserted + * [6] | Not-In-Table error counter 0 = No Interrupt, 1 = Interrupt Asserted + * [5] | Unexpected K error counter 0 = No Interrupt, 1 = Interrupt Asserted + * [4] | ILD - Inter-lane De-skew 0 = No Interrupt, 1 = Interrupt Asserted + * [3] | ILS - Initial lane sync 0 = No Interrupt, 1 = Interrupt Asserted + * [2] | GCS - Good Check Sum 0 = No Interrupt, 1 = Interrupt Asserted + * [1] | FS - Frame Sync 0 = No Interrupt, 1 = Interrupt Asserted + * [0] | CSG - Code Group Sync 0 = No Interrupt, 1 = Interrupt Asserted + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmIrqMaskGet( adi_adrv903x_Device_t* const device, + uint16_t* const irqMask); + +/** + * \brief Writes the JESD 204B IRQ interrupt clear register. There is one common register for all deframers. + * + * This function writes the specified IRQ mask value to the deframer 204B IRQ clear register. Use this function whenever a general purpose (GP) + * deframer IRQ asserts to clear the pending maskable deframer IRQ or to enable/disable deframer interrupt sources. Note: Deframer IRQ sources + * Elastic Buffer Error Flag, Sysref Buffer Error, and the four Lane FIFO Async Error IRQ sources are always enabled and can not be masked in the + * interrupt clear register. This function does not read-modify-write the interrupt clear register. To manually clear the interrupt, write + * a one (set) to disable or mask the bit of the interrupt followed by writing a zero (clear) to enable the bit of the interrupt. + * However, if the interrupt condition still exists after setting the mask bit, the corresponding IRQ vector bit will re-assert. + * + * \pre This function may be called any time after Jesd204B link initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] irqMask Pointer to the bit mask value to be written to the deframer IRQ Clear Register (this is not a read-modify-write) + * + * Bit | Description + * -------------|----------------------------------------------------------------------------- + * [15] | UnUsed + * [14] | UnUsed + * [13] | UnUsed + * [12] | UnUsed + * [11] | UnUsed + * [10] | UnUsed + * [9] | UnUsed + * [8] | CMM - Configuration mismatch for lane0 0 = No Interrupt, 1 = Interrupt Asserted + * [7] | BD - Bad Disparity error counter 0 = No Interrupt, 1 = Interrupt Asserted + * [6] | Not-In-Table error counter 0 = No Interrupt, 1 = Interrupt Asserted + * [5] | Unexpected K error counter 0 = No Interrupt, 1 = Interrupt Asserted + * [4] | ILD - Inter-lane De-skew 0 = No Interrupt, 1 = Interrupt Asserted + * [3] | ILS - Initial lane sync 0 = No Interrupt, 1 = Interrupt Asserted + * [2] | GCS - Good Check Sum 0 = No Interrupt, 1 = Interrupt Asserted + * [1] | FS - Frame Sync 0 = No Interrupt, 1 = Interrupt Asserted + * [0] | CSG - Code Group Sync 0 = No Interrupt, 1 = Interrupt Asserted + * + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmIrqMaskSet( adi_adrv903x_Device_t* const device, + const uint16_t irqMask); + +/** + * \brief Reset the JESD 204B IRQ interrupt clear register. There is one common register for all deframers. + * + * This function clears all deframer 204B IRQ sources. Use this function whenever a general purpose (GP) + * deframer IRQ asserts to clear the pending deframer IRQ. + * + * \pre This function may be called any time after JESD204b link initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmIrqSourceReset( adi_adrv903x_Device_t* const device); + +/** + * \brief Read the JESD 204B IRQ interrupt source registers for the specified deframer. + * + * This function fetches the contents of the deframer 204B IRQ Vector register and other IRQ sources. Use this function whenever + * a general purpose (GP) deframer IRQ asserts to determine the source of the deframer IRQ. Common IRQ sources are Bad Disparity (BD), + * Not-In-Table (NIT), and Unexpected K-char (UEK) counters greater than the specified error threshold count value. + * + * \pre This function may be called any time after JESD204B link initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] deframerSelect Selects the deframer to interrogate. + * \param[out] irqSourceVector Pointer to a bit mask containing the status of the IRQ Vector source register at read time. + * + * Bit | Description + * -------------|----------------------------------------------------------------------------- + * [15] | UnUsed + * [14] | UnUsed + * [13] | UnUsed + * [12] | UnUsed + * [11] | UnUsed + * [10] | UnUsed + * [9] | UnUsed + * [8] | CMM - Configuration mismatch for lane0 0 = No Interrupt, 1 = Interrupt Asserted + * [7] | BD - Bad Disparity error counter 0 = No Interrupt, 1 = Interrupt Asserted + * [6] | Not-In-Table error counter 0 = No Interrupt, 1 = Interrupt Asserted + * [5] | Unexpected K error counter 0 = No Interrupt, 1 = Interrupt Asserted + * [4] | ILD - Inter-lane De-skew 0 = No Interrupt, 1 = Interrupt Asserted + * [3] | ILS - Initial lane sync 0 = No Interrupt, 1 = Interrupt Asserted + * [2] | GCS - Good Check Sum 0 = No Interrupt, 1 = Interrupt Asserted + * [1] | FS - Frame Sync 0 = No Interrupt, 1 = Interrupt Asserted + * [0] | CSG - Code Group Sync 0 = No Interrupt, 1 = Interrupt Asserted + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmIrqSourceGet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSelect, + adi_adrv903x_DeframerIrqVector_t* const irqSourceVector); + +/** +* \brief Used to configure and reset the deframer JESD 204B Error counters Bad Disparity Error (BD), +* Not-In-Table (NIT), Unexpected K-char (UEK). +* +* This function allows individual counter enable/disable, reset, and configuration control +* for all lanes. IRQ Mask updates will affect all deframers identically. +* This function will set the error counter interrupt bits at deframer interrupt request +* mask according to interruptEnable input +* +* \pre This function may be called any time after Jesd link initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure +* \param[in] interruptEnable argument to enable/disable GPINT in case error counters overflow 255 +* \param[in] laneNumber Lane number for which to set config. +* \param[in] errCounterControl 8-bit mask for enabling/disabling and resetting individual counters. +* +* bit | Lane +* -----|------------------ +* 0 | Bad Disparity Error 0 = disable, 1 = enable +* 1 | Not-In-Table (NIT) 0 = disable, 1 = enable +* 2 | Unexpected K-char (UEK) 0 = disable, 1 = enable +* 3 | Reserved +* 4 | Bad Disparity Error 0 = Do not reset counter, 1 = Reset counter to zero +* 5 | Not-In-Table (NIT) 0 = Do not reset counter, 1 = Reset counter to zero +* 6 | Unexpected K-char (UEK) 0 = Do not reset counter, 1 = Reset counter to zero +* 7 | Reserved +* +* \param[in] errCounterHoldCfg 8-bit mask for configuring the deframer error counters to stop counting +* on overflow from 0xFF or to reset and continue counting. +* +* bit | Lane +* -----|------------------ +* 0 | Bad Disparity Error 0 = Reset and continue counting, 1 = Stop counting at 0xFF overflow +* 1 | Not-In-Table (NIT) 0 = Reset and continue counting, 1 = Stop counting at 0xFF overflow +* 2 | Unexpected K-char (UEK) 0 = Reset and continue counting, 1 = Stop counting at 0xFF overflow +* 3 | Reserved +* 4 | Reserved +* 5 | Reserved +* 6 | Reserved +* 7 | Reserved +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmErrCntrCntrlSet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_DfrmErrCounterIrqSel_e interruptEnable, + const uint8_t laneNumber, + const uint8_t errCounterControl, + const uint8_t errCounterHoldCfg); + +/** +* \brief Used to read the configuration for the deframer JESD 204B error counters Bad Disparity Error (BD), +* Not-In-Table (NIT), Unexpected K-char (UEK). Counter controls are common to all deframers. +* +* \pre This function may be called any time after Jesd link initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure +* \param[in] laneNumber Lane number for which to read config. +* \param[out] errCounterControl Pointer to 8-bit variable containing individual counters enable bits. +* +* bit | Lane +* -----|------------------ +* 0 | Bad Disparity Error 0 = disable, 1 = enable +* 1 | Not-In-Table (NIT) 0 = disable, 1 = enable +* 2 | Unexpected K-char (UEK) 0 = disable, 1 = enable +* 3 | Reserved +* 4 | Reserved +* 5 | Reserved +* 6 | Reserved +* 7 | Reserved +* +* \param[out] errCounterHoldCfg Pointer to 8-bit variable containing configuration for deframer error counters to stop counting +* on overflow from 0xFF or to reset and continue counting. +* +* bit | Lane +* -----|------------------ +* 0 | Bad Disparity Error 0 = Reset and continue counting, 1 = Stop counting at 0xFF overflow +* 1 | Not-In-Table (NIT) 0 = Reset and continue counting, 1 = Stop counting at 0xFF overflow +* 2 | Unexpected K-char (UEK) 0 = Reset and continue counting, 1 = Stop counting at 0xFF overflow +* 3 | Reserved +* 4 | Reserved +* 5 | Reserved +* 6 | Reserved +* 7 | Reserved +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmErrCntrCntrlGet( adi_adrv903x_Device_t* const device, + const uint8_t laneNumber, + uint8_t* const errCounterControl, + uint8_t* const errCounterHoldCfg); + +/** +* \brief This function will run SERDES horizontal eye sweep. +* +* \pre This function can be called after JESD204B/C initialization +* - At least one Rx, one TX, one framer, and one deframer must be enabled. +* - IQ Sample clock for deframer and framer must match to avoid over/under-sampling. +* - PRBS pattern matching the one selected in this API must be enabled on the sender side before running the test +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] runEyeSweep Eye Sweep configuration +* \param[out] runEyeSweepResp Eye Sweep Response structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RunEyeSweep(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuCmd_RunEyeSweep_t* const runEyeSweep, + adi_adrv903x_CpuCmd_RunEyeSweepResp_t* const runEyeSweepResp); + +/** +* \brief This function will run SERDES horizontal eye sweep. For larger eyes and longer dwell times +* the capture time can sometimes exceed the command server timeout especially when tracking +* calibrations are in progress. To address this issue, a new Serdes Control Command is used. +* +* \pre This function can be called after JESD204B/C initialization +* - At least one Rx, one TX, one framer, and one deframer must be enabled. +* - IQ Sample clock for deframer and framer must match to avoid over/under-sampling. +* - PRBS pattern matching the one selected in this API must be enabled on the sender side before running the test +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] runEyeSweep Eye Sweep configuration +* \param[out] runEyeSweepResp Eye Sweep Response structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RunEyeSweep_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuCmd_RunEyeSweep_t* const runEyeSweep, + adi_adrv903x_CpuCmd_RunEyeSweepResp_t* const runEyeSweepResp); + +/** +* \brief This function will run SERDES vertical eye sweep. +* +* \pre This function can be called after JESD204B/C initialization +* - At least one Rx, one TX, one framer, and one deframer must be enabled. +* - IQ Sample clock for deframer and framer must match to avoid over/under-sampling. +* - PRBS pattern matching the one selected in this API must be enabled on the sender side before running the test +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] runVerticalEyeSweep Vertical Eye Sweep configuration +* \param[out] runVerticalEyeSweepResp Vertical Eye Sweep Response structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RunVerticalEyeSweep(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuCmd_RunVertEyeSweep_t* const runVerticalEyeSweep, + adi_adrv903x_CpuCmd_RunVertEyeSweepResp_t* const runVerticalEyeSweepResp); + +/** +* \brief This function will run SERDES vertical eye sweep. For larger eyes and longer dwell times +* the capture time can sometimes exceed the command server timeout especially when tracking +* calibrations are in progress. To address this issue, a new Serdes Control Command is used. +* +* \pre This function can be called after JESD204B/C initialization +* - At least one Rx, one TX, one framer, and one deframer must be enabled. +* - IQ Sample clock for deframer and framer must match to avoid over/under-sampling. +* - PRBS pattern matching the one selected in this API must be enabled on the sender side before running the test +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in] device Context variable - Pointer to the ADRV903X data structure +* \param[in] runVerticalEyeSweep Vertical Eye Sweep configuration +* \param[out] runVerticalEyeSweepResp Vertical Eye Sweep Response structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RunVerticalEyeSweep_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuCmd_RunVertEyeSweep_t* const runVerticalEyeSweep, + adi_adrv903x_CpuCmd_RunVertEyeSweepResp_t* const runVerticalEyeSweepResp); + +/** + * \brief Injects an error into the Framer test data by inverting the data + * + * This is a debug function to be used for debug of the Rx JESD204B/C lanes. + * Rx data transmission on the JESD204B/C link(s) is not possible + * when the framer test data is activated. + * + * \pre This function is called after the framer test data is enabled. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] framerSelect Select the desired framer ADI_ADRV903X_FRAMER_0, ADI_ADRV903X_FRAMER_1, ADI_ADRV903X_FRAMER_2 + * \param[in] laneMask is an eight bit mask allowing selection of lanes 0-7 (at package balls) for the selected framer + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerTestDataInjectError(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSelect, + const uint8_t laneMask); + +/** + * \brief Sets the serializer lane configuration parameters for + * the chosen lane + * \pre This function is called after the device has been initialized + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device - Context variable, pointer to the device settings structure + * \param[in] laneNumber - Selects the serializer lane (values from 0 - 7) + * \param[in] serLaneCfg - Pointer to the Serializer Lane settings structure adi_adrv903x_SerLaneCfg_t + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerLaneCfgSet(adi_adrv903x_Device_t* const device, + const uint8_t laneNumber, + const adi_adrv903x_SerLaneCfg_t* const serLaneCfg); +/** + * \brief Gets the serializer lane configuration parameters for + * the chosen lane + * + * \pre This function is called after the device has been initialized + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device - Context variable, pointer to the device settings structure + * \param[in] laneNumber - Selects the serializer lane (values from 0 - 7) + * \param[out] serLaneCfg - Pointer to the Serializer Lane settings structure adi_adrv903x_SerLaneCfg_t + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerLaneCfgGet(adi_adrv903x_Device_t* const device, + const uint8_t laneNumber, + adi_adrv903x_SerLaneCfg_t* const serLaneCfg); + +/** + * \brief Retrieve initial calibration status for SERDIN lane. + * + * If a filename is supplied the data is also written as a single line containing a comma separated list of + * human-readable values. If the file does not exist it is created. If it does exist it is appended to. The file is + * flushed and closed before the function returns. + * + * In the case where the fuction creates the file it will first write four lines in this order: + * - a line indicating the file contains serdes calibration information + * - a line indicating the API version number + * - a header line indicating the meaning of the fields written by InitCalStatusGet() + * - a header line indicating the meaning of the fields written by TrackingCalStatusGet() + * before then writing the initial cal data line itself. The line's first field will have the value 'ic'. + * + * Other than in the header line the exact format of the line written is not defined but can be analyzed by a + * stand-alone ADI-supplied application which will recommend serdes configuration changes based on the contents. + * + * It is intended that both InitCalStatusGet() and TrackingCalStatusGet() are passed the same value for filePath. + * + * As the initial calibration only occurs once, subsequent calls to this function will return the same data as the + * initial call. + * + * \param[in,out] device Context variable - Context variable - Structure pointer to the ADRV903X device data structure + * \param[in] filePath May be NULL. If set is the filename to which to write the data + * \param[in] laneNumber Selects the SERDIN lane + * \param[in] msg May be NULL. If set this text will be included in the data written to file + * \param[out] calStatus The serdes init cal status is written out here + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerdesInitCalStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GenericStrBuf_t* const filePath, + const uint8_t laneNumber, + const adi_adrv903x_GenericStrBuf_t* const msg, + adi_adrv903x_SerdesInitCalStatus_t* const calStatus); + +/** + * \brief Retrieve tracking calibration status for SERDIN lane. + * + * Unless noted below the behaviour of this function is the same as that of SerdesInitCalStatusGet except this function + * deals with serdes tracking cal status data. + * + * In the case where the fuction creates the file it will write initial lines to the file in an identical manner as + * SerdesInitCalStatusGet()before then writing the tracking cal data line itself. The line's first field will have the + * value 'tc'. + * + * Unlike SerdesInitCalStatusGet tracking calibration status changes regularly so subsequent calls to this function + * will return different data. + * + * \param[in,out] device Context variable - Context variable - Structure pointer to the ADRV903X device data structure + * \param[in] filePath May be NULL. If set is the filename to which to write the data + * \param[in] laneNumber Selects the SERDIN lane + * \param[in] msg May be NULL. If set this text will be included in the data written to file + * \param[out] calStatus The serdes tracking cal status is written out here + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerdesTrackingCalStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GenericStrBuf_t* const filePath, + const uint8_t laneNumber, + const adi_adrv903x_GenericStrBuf_t* const msg, + adi_adrv903x_SerdesTrackingCalStatus_t* calStatus); + + +/** + * \brief Sets the Common Mode configuration for the deserializer lanes + * + * \pre This function is to be called in two scenarios: + * - At Startup: after device Hw is open, i.e., SPI communication is available, and before + * JESD/Serdes Bring up, in other words, prior to Serdes Initial Calibration; + * - At Runtime: Before calling this function, it is required to stop Serdes Tracking calibration + * with the API "TrackingCalsEnableSet(_v2)" passing the "DISABLE" value and wait for the Serdes + * Tracking Calibration state to be DISABLED, SUSPENDED and INACTIVE. This can be achieved + * using the API "TrackingCalAllStateGet" + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device - Context variable, pointer to the device settings structure + * \param[in] deserLanesVcmCfg - Deserializer lanes Common Mode Configuration + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeserLanesVcmCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeserLanesVcmCfg_t* const deserLanesVcmCfg); + +/** + * \brief Retrieve SINT Codes for the selected SERDIN lane. + * + * \param[in,out] device Context variable - Context variable - Structure pointer to the ADRV903X device data structure + * \param[in] laneNumber Selects the SERDIN lane + * \param[out] serdesRxLaneSintCodes The serdes SINT Codes for the selected lane. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerdesRxLaneSintCodesGet(adi_adrv903x_Device_t* const device, + const uint8_t laneNumber, + adi_adrv903x_CpuCmd_GetRxLaneSintCodesResp_t* const serdesRxLaneSintCodes); + +#endif /* _ADI_ADRV903X_DATAINTERFACE_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_datainterface_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_datainterface_types.h new file mode 100644 index 0000000000000..c66360765a551 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_datainterface_types.h @@ -0,0 +1,667 @@ + /** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_datainterface_types.h + * \brief Contains ADRV903X API data types related to the data interface + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_DATAINTERFACE_TYPES_H_ +#define _ADI_ADRV903X_DATAINTERFACE_TYPES_H_ + +#include "adi_common_error.h" + +/** + * \brief Data structure defining the locations where the Rx Capture RAM can be used. + */ +typedef enum adi_adrv903x_RxOrxDataCaptureLocation +{ + ADI_ADRV903X_CAPTURE_LOC_DDC0 = 0, /*!< DDC0 output */ + ADI_ADRV903X_CAPTURE_LOC_DDC1 = 1, /*!< DDC1 output */ + ADI_ADRV903X_CAPTURE_LOC_DPD = 2, /*!< pre and post DPD */ + ADI_ADRV903X_CAPTURE_LOC_DPD_PRE = 3, /*!< DPD input */ + ADI_ADRV903X_CAPTURE_LOC_DPD_POST = 4, /*!< DPD output */ + ADI_ADRV903X_CAPTURE_LOC_FSC = 10, /*!< FSC */ + ADI_ADRV903X_CAPTURE_LOC_DATAPATH = 11, /*!< ORx Formatter input */ + ADI_ADRV903X_CAPTURE_LOC_ORX_TX0 = 13, /*!< Synchronized DPD/ORX */ + ADI_ADRV903X_CAPTURE_LOC_ORX_TX1 = 14, /*!< Synchronized DPD/ORX */ + ADI_ADRV903X_CAPTURE_LOC_ORX_TX2 = 15, /*!< Synchronized DPD/ORX */ + ADI_ADRV903X_CAPTURE_LOC_ORX_TX3 = 16, /*!< Synchronized DPD/ORX */ + ADI_ADRV903X_CAPTURE_LOC_ORX_TX4 = 17, /*!< Synchronized DPD/ORX */ + ADI_ADRV903X_CAPTURE_LOC_ORX_TX5 = 18, /*!< Synchronized DPD/ORX */ + ADI_ADRV903X_CAPTURE_LOC_ORX_TX6 = 19, /*!< Synchronized DPD/ORX */ + ADI_ADRV903X_CAPTURE_LOC_ORX_TX7 = 20, /*!< Synchronized DPD/ORX */ +} adi_adrv903x_RxOrxDataCaptureLocation_e; + +#define ADI_ADRV903X_MAX_DESERIALIZER_LANES 8U +#define ADI_ADRV903X_MAX_SERIALIZER_LANES 8U +#define ADI_ADRV903X_FRAMER_CONVERTERS 24U +#define ADI_ADRV903X_NUM_DEFRAMERS_SAMPLE_XBAR 8U +#define ADI_ADRV903X_NUM_FRAMERS_SAMPLE_XBAR 64U +#define ADI_ADRV903X_NUM_LKSH_SAMPLE_XBAR 32U +#define ADI_ADRV903X_MAX_CONVERTER 64U +#define ADI_ADRV903X_MAX_CDDC_CONVERTER 32U +#define ADI_ADRV903X_MAX_FRAMERS 3U +#define ADI_ADRV903X_MAX_FRAMERS_LS 2U +#define ADI_ADRV903X_MAX_DEFRAMERS 2U + + +#define ADI_ADRV903X_NUM_DAC_SAMPLE_XBAR 16U + +/** +* \brief Enum to select desired framer +*/ +typedef enum adi_adrv903x_FramerSel +{ + ADI_ADRV903X_FRAMER_0 = 0x01U, /*!< Framer 0 selected */ + ADI_ADRV903X_FRAMER_1 = 0x02U, /*!< Framer 1 selected */ + ADI_ADRV903X_FRAMER_2 = 0x04U, /*!< Framer 2 selected */ + ADI_ADRV903X_ALL_FRAMERS = (ADI_ADRV903X_FRAMER_0 | ADI_ADRV903X_FRAMER_1 | ADI_ADRV903X_FRAMER_2) /*!< All Framers selected */ + +} adi_adrv903x_FramerSel_e; + +/** +* \brief Enum to select desired deframer +*/ +typedef enum adi_adrv903x_DeframerSel +{ + ADI_ADRV903X_DEFRAMER_0 = 0x01U, /*!< Deframer 0 selection */ + ADI_ADRV903X_DEFRAMER_1 = 0x02U, /*!< Deframer 1 selection */ + ADI_ADRV903X_ALL_DEFRAMER = (ADI_ADRV903X_DEFRAMER_0 | ADI_ADRV903X_DEFRAMER_1) /*!< Used for cases where Tx1 uses one deframer, Tx2 uses the second deframer */ +} adi_adrv903x_DeframerSel_e; + +/** +* \brief Enumerated list of ADC Sample Xbar options +*/ +typedef enum adi_adrv903x_AdcSampleXbarSel +{ + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX0_BAND_0_DATA_I = 0u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX0_BAND_0_DATA_Q = 1u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX0_BAND_1_DATA_I = 2u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX0_BAND_1_DATA_Q = 3u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX1_BAND_0_DATA_I = 4u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX1_BAND_0_DATA_Q = 5u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX1_BAND_1_DATA_I = 6u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX1_BAND_1_DATA_Q = 7u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX2_BAND_0_DATA_I = 8u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX2_BAND_0_DATA_Q = 9u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX2_BAND_1_DATA_I = 10u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX2_BAND_1_DATA_Q = 11u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX3_BAND_0_DATA_I = 12u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX3_BAND_0_DATA_Q = 13u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX3_BAND_1_DATA_I = 14u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX3_BAND_1_DATA_Q = 15u, + + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX4_BAND_0_DATA_I = 16u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX4_BAND_0_DATA_Q = 17u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX4_BAND_1_DATA_I = 18u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX4_BAND_1_DATA_Q = 19u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX5_BAND_0_DATA_I = 20u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX5_BAND_0_DATA_Q = 21u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX5_BAND_1_DATA_I = 22u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX5_BAND_1_DATA_Q = 23u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX6_BAND_0_DATA_I = 24u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX6_BAND_0_DATA_Q = 25u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX6_BAND_1_DATA_I = 26u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX6_BAND_1_DATA_Q = 27u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_0_DATA_I = 28u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_0_DATA_Q = 29u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_1_DATA_I = 30u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_1_DATA_Q = 31u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_LAST_VALID_NO_INT = ADI_ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_1_DATA_Q, + /* With no interleaving enabled */ + + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_0 = 32u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_1 = 33u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_2 = 34u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_3 = 35u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_4 = 36u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_5 = 37u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_6 = 38u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_7 = 39u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_0 = 40u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_1 = 41u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_2 = 42u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_3 = 43u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_4 = 44u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_5 = 45u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_6 = 46u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_7 = 47u, + + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_0 = 48u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_1 = 49u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_2 = 50u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_3 = 51u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_4 = 52u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_5 = 53u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_6 = 54u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_7 = 55u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_0 = 56u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_1 = 57u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_2 = 58u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_3 = 59u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_4 = 60u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_5 = 61u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_6 = 62u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_7 = 63u, + ADI_ADRV903X_JESD_FRM_SPLXBAR_LAST_VALID = ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_7, + ADI_ADRV903X_JESD_FRM_SPLXBAR_INVALID = 0x7Fu +} adi_adrv903x_AdcSampleXbarSel_e; + +/** +* \brief Data structure to hold the DAC sample crossbar information +*/ +typedef enum adi_adrv903x_DacSampleXbarSel +{ + ADI_ADRV903X_DEFRAMER_OUT0 = 0u, + ADI_ADRV903X_DEFRAMER_OUT1 = 1u, + ADI_ADRV903X_DEFRAMER_OUT2 = 2u, + ADI_ADRV903X_DEFRAMER_OUT3 = 3u, + ADI_ADRV903X_DEFRAMER_OUT4 = 4u, + ADI_ADRV903X_DEFRAMER_OUT5 = 5u, + ADI_ADRV903X_DEFRAMER_OUT6 = 6u, + ADI_ADRV903X_DEFRAMER_OUT7 = 7u, + ADI_ADRV903X_DEFRAMER_OUT8 = 8u, + ADI_ADRV903X_DEFRAMER_OUT9 = 9u, + ADI_ADRV903X_DEFRAMER_OUT10 = 10u, + ADI_ADRV903X_DEFRAMER_OUT11 = 11u, + ADI_ADRV903X_DEFRAMER_OUT12 = 12u, + ADI_ADRV903X_DEFRAMER_OUT13 = 13u, + ADI_ADRV903X_DEFRAMER_OUT14 = 14u, + ADI_ADRV903X_DEFRAMER_OUT15 = 15u, + ADI_ADRV903X_DEFRAMER_LAST_VALID = 15u, + + ADI_ADRV903X_DEFRAMER_OUT_INVALID = 0x7Fu +} adi_adrv903x_DacSampleXbarSel_e; + +/** +* \brief Enum to select desired Serializer Lane Output Driver Swing +*/ +typedef enum adi_adrv903x_SerLaneCfgOutputDriveSwing +{ + ADRV903X_DRIVE_SWING_VTT_100 = 0u, /*!< Output swing level: 1.00 * VTT */ + ADRV903X_DRIVE_SWING_VTT_85 = 1u, /*!< Output swing level: 0.85 * VTT */ + ADRV903X_DRIVE_SWING_VTT_75 = 2u, /*!< Output swing level: 0.75 * VTT */ + ADRV903X_DRIVE_SWING_VTT_50 = 3u /*!< Output swing level: 0.50 * VTT */ +} adi_adrv903x_SerLaneCfgOutputDriveSwing_e; + +/** +* \brief Enum to select desired Serializer Lane Pre-Emphasis +*/ +typedef enum adi_adrv903x_SerLaneCfgPreEmphasis +{ + ADRV903X_PRE_EMPHASIS_LEVEL_0_DB = 0u, /*!< Pre-emphasis level: 0dB */ + ADRV903X_PRE_EMPHASIS_LEVEL_3_DB = 1u, /*!< Pre-emphasis level: 3dB */ + ADRV903X_PRE_EMPHASIS_LEVEL_6_DB = 2u /*!< Pre-emphasis level: 6dB */ +} adi_adrv903x_SerLaneCfgPreEmphasis_e; + +/** +* \brief Enum to select desired Serializer Lane Post-Emphasis +*/ +typedef enum adi_adrv903x_SerLaneCfgPostEmphasis +{ + ADRV903X_POST_EMPHASIS_LEVEL_0_DB = 0u, /*!< Post-emphasis level: 0dB */ + ADRV903X_POST_EMPHASIS_LEVEL_3_DB = 1u, /*!< Post-emphasis level: 3dB */ + ADRV903X_POST_EMPHASIS_LEVEL_6_DB = 2u, /*!< Post-emphasis level: 6dB */ + ADRV903X_POST_EMPHASIS_LEVEL_9_DB = 3u, /*!< Post-emphasis level: 9dB */ + ADRV903X_POST_EMPHASIS_LEVEL_12_DB = 4u /*!< Post-emphasis level: 12dB */ +} adi_adrv903x_SerLaneCfgPostEmphasis_e; + +/** +* \brief Data structure to hold the Serializer Lane settings +*/ +typedef struct adi_adrv903x_SerLaneCfg +{ + adi_adrv903x_SerLaneCfgOutputDriveSwing_e outputDriveSwing; /*!< Serializer Lane output swing level */ + adi_adrv903x_SerLaneCfgPreEmphasis_e preEmphasis; /*!< Serializer Lane pre-emphasis */ + adi_adrv903x_SerLaneCfgPostEmphasis_e postEmphasis; /*!< Serializer Lane post-emphasis */ +} adi_adrv903x_SerLaneCfg_t; + +/** +* \brief Data structure to hold the Serializer Reset Settings +*/ +typedef struct adi_adrv903x_CpuCmd_SerReset +{ + uint8_t presetClockOffsets; /*!< Preset the clock offsets and fifo start based on 204c/204b mode */ + uint32_t serResetParm; /*!< Serializer reset parameter */ +} adi_adrv903x_CpuCmd_SerReset_t; + +/** +* \brief Data structure to hold the Serializer Reset Results +*/ +typedef struct adi_adrv903x_CpuCmd_SerResetResp +{ + uint32_t serResetResults; /*!< Ser Reset results CPU */ +} adi_adrv903x_CpuCmd_SerResetResp_t; + +/** +* \brief Data structure to hold the DAC sample crossbar settings +*/ +typedef struct adi_adrv903x_DacSampleXbarCfg +{ + adi_adrv903x_DacSampleXbarSel_e txDacChan[ADI_ADRV903X_NUM_DAC_SAMPLE_XBAR]; /*!< Sample Crossbar select for Tx I/Q channel data*/ +} adi_adrv903x_DacSampleXbarCfg_t; + +/** +* \brief Data structure to hold the ADC sample crossbar information +*/ +typedef struct adi_adrv903x_AdcSampleXbarCfg +{ + adi_adrv903x_AdcSampleXbarSel_e AdcSampleXbar[ADI_ADRV903X_NUM_FRAMERS_SAMPLE_XBAR]; +} adi_adrv903x_AdcSampleXbarCfg_t; + +/** +* \brief Data structure to hold the Framer output lane crossbar information +* +* Note that not all framers have 8 outputs. A physical lane can only be used +* on one framer at a time. +*/ +typedef struct adi_adrv903x_SerLaneXbar +{ + uint8_t laneFramerOutSel[ADI_ADRV903X_MAX_SERIALIZER_LANES]; /*!< Framer output to route to Physical Lane (valid 0-7) */ +} adi_adrv903x_SerLaneXbar_t; + +/** +* \brief Data structure to hold the Deframer input lane crossbar information +* +* Note that not all deframers have 8 inputs. +*/ +typedef struct adi_adrv903x_DeserLaneXbar +{ + uint8_t deframerInputLaneSel[ADI_ADRV903X_MAX_DESERIALIZER_LANES]; /*!< Physical lane select for deframer input (valid 0-7) */ +} adi_adrv903x_DeserLaneXbar_t; + +/** +* \brief Data structure to hold ADRV903X JESD204B/C Framer configuration settings +*/ +typedef struct adi_adrv903x_FramerCfg +{ + uint8_t enableJesd204C; /*!< 1= Enable JESD204C framer, 0 = use JESD204B framer */ + uint8_t bankId; /*!< JESD204B Configuration Bank ID extension to Device ID. Range is 0..15 */ + uint8_t deviceId; /*!< JESD204B Configuration Device ID link identification number. Range is 0..255 */ + uint8_t lane0Id; /*!< JESD204B Configuration starting Lane ID. If more than one lane is used, each lane will increment from the Lane0 ID. Range is 0..31 */ + uint8_t jesd204M; /*!< Number of ADCs (0, 2, or 4) where 2 ADCs are required per receive chain (I and Q). */ + uint16_t jesd204K; /*!< Number of frames in a multiframe. Default = 32, F*K must be modulo 4. Where, F=2*M/numberOfLanes (Max 32 for JESD204B, Max 256 for JESD204C). */ + uint8_t jesd204F; /*!< Number of bytes(octets) per frame (Valid 1, 2, 4, 8). */ + uint8_t jesd204Np; /*!< converter sample resolution (12, 16, 24). */ + uint8_t jesd204E; /*!< JESD204C E parameter. This is E -1 value. */ + uint8_t scramble; /*!< Scrambling off if framerScramble = 0, if framerScramble > 0 scrambling is enabled */ + uint8_t serializerLanesEnabled; /*!< Serializer lane select bit field. Where, [0] = Lane0 enabled, [1] = Lane1 enabled, etc */ + uint16_t lmfcOffset; /*!< LMFC offset value for deterministic latency setting. */ + uint8_t syncbInSelect; /*!< Selects SYNCb input source. Where, 0 = use SYNCBIN0 for this framer, 1 = use SYNCBIN1 for this framer, 2 = use SYNCBIN2 */ + uint8_t overSample; /*!< Selects framer bit repeat or oversampling mode for lane rate matching. Where, 0 = bitRepeat mode (changes effective lanerate), 1 = overSample (maintains same lane rate between ObsRx framer and Rx framer and oversamples the ADC samples) */ + uint8_t syncbInLvdsMode; /*!< 1 - enable LVDS input pad with 100ohm internal termination, 0 - enable CMOS input pad */ + uint8_t syncbInLvdsPnInvert; /*!< 0 - syncb LVDS PN not inverted, 1 - syncb LVDS PN inverted */ + adi_adrv903x_SerLaneXbar_t serializerLanePdCrossbar; /*!< Lane crossbar to map framer lane outputs to physical lanes */ + adi_adrv903x_AdcSampleXbarCfg_t adcCrossbar; /*!< ADC converter to framer input mapping */ + uint8_t newSysrefOnRelink; /*!< Flag for determining if SYSREF on relink should be set. Where, if > 0 = set, '0' = not set */ + uint8_t sysrefForStartup; /*!< 1 = Framer: Require a SYSREF before CGS will be output from serializer, 0: Allow CGS to output before SYSREF occurs (recommended on framer to allow deframer CDR to lock and EQ to train)*/ + uint8_t sysrefNShotEnable; /*!< 1 = Enable SYSREF NShot (ability to ignore first rising edge of SYSREF to ignore possible runt pulses.) */ + uint8_t sysrefNShotCount; /*!< Count value of which SYSREF edge to use to reset LMFC phase, valid range is 0 to 15 */ + uint8_t sysrefIgnoreWhenLinked; /*!< When JESD204 link is up and valid, 1= ignore any sysref pulses */ + uint32_t iqRate_kHz; /*!< Framer I/Q rate */ + uint32_t laneRate_kHz; /*!< Framer Lane rate */ +} adi_adrv903x_FramerCfg_t; + +/** +* \brief Data structure to hold the settings for the deframer configuration +*/ +typedef struct adi_adrv903x_DeframerCfg +{ + uint8_t enableJesd204C; /*!< 1= Enable JESD204C framer, 0 = use JESD204B framer */ + uint8_t bankId; /*!< Extension to Device ID. Range is 0..15 , bankId is not supported for Jrx, returns always 0*/ + uint8_t deviceId; /*!< Link identification number. Range is 0..255 */ + uint8_t laneId[ADI_ADRV903X_MAX_DESERIALIZER_LANES]; + uint8_t jesd204M; /*!< Number of DACs (0, 2, or 4) - 2 DACs per transmit chain (I and Q) */ + uint16_t jesd204K; /*!< Number of frames in a multiframe. Default = 32, F*K = modulo 4. Where, F=2*M/numberOfLanes (Max 32 for JESD204B, Max 256 for JESD204C) */ + uint8_t jesd204F; /*!< Number of bytes(octets) per frame . */ + uint8_t jesd204Np; /*!< converter sample resolution (12, 16) */ + uint8_t jesd204E; /*!< JESD204C E parameter. This is E -1 value. */ + uint8_t decrambling; /*!< decrambling off if decramble = 0, if decramble > 0 decrambling is enabled */ + uint8_t deserializerLanesEnabled; /*!< Deserializer lane select bit field. Where, [0] = Lane0 enabled, [1] = Lane1 enabled, etc */ + uint16_t lmfcOffset; /*!< LMFC offset value to adjust deterministic latency. */ + uint8_t syncbOutSelect; /*!< Selects deframer SYNCBOUT pin (0 = SYNCBOUT0, 1 = SYNCBOUT1, 2 = output SYNCB to SYNCBOUT0 and SYNCBOUT1, 3 = No Pin Selected) */ + uint8_t syncbOutLvdsMode; /*!< Ignored if syncbOutSelect = 3. Otherwise 1 - enable LVDS output pad, 0 - enable CMOS output pad */ + uint8_t syncbOutLvdsPnInvert ; /*!< Ignored if syncbOutSelect = 3. Otherwise 0 - syncb LVDS PN not inverted, 1 - syncb LVDS PN inverted */ + uint8_t syncbOut0CmosDriveStrength; /*!< CMOS output drive strength. Max = 15 */ + uint8_t syncbOut1CmosDriveStrength; /*!< CMOS output drive strength. Max = 15 */ + adi_adrv903x_DeserLaneXbar_t deserializerLaneCrossbar; /*!< Lane crossbar to map physical lanes to deframer inputs */ + adi_adrv903x_DacSampleXbarCfg_t dacCrossbar; /*!< Deframer output to DAC mapping */ + uint8_t newSysrefOnRelink; /*!< Flag for determining if SYSREF on relink should be set. Where, if > 0 = set, '0' = not set */ + uint8_t sysrefForStartup; /*!< Suggested to enable for deframer so deframer will not assert SYNCB to init the link until SYSREF has occurred, which resets LMFC phase */ + uint8_t sysrefNShotEnable; /*!< 1 = Enable SYSREF NShot (ability to ignore first rising edge of SYSREF to ignore possible runt pulses.) */ + uint8_t sysrefNShotCount; /*!< Count value of which SYSREF edge to use to reset LMFC phase, valid range is 0 to 15 */ + uint8_t sysrefIgnoreWhenLinked; /*!< When JESD204 link is up and valid, 1= ignore any sysref pulses */ + uint32_t iqRate_kHz; /*!< Framer I/Q rate */ + uint32_t laneRate_kHz; /*!< Framer Lane rate */ +} adi_adrv903x_DeframerCfg_t; + +/** +* \brief Enum for JESD204B/C PRBS generated types +*/ +typedef enum adi_adrv903x_DeframerPrbsOrder +{ + ADI_ADRV903X_PRBS_DISABLE = 0, /*!< Deframer PRBS pattern disable */ + ADI_ADRV903X_PRBS7, /*!< Deframer PRBS7 pattern select */ + ADI_ADRV903X_PRBS9, /*!< Deframer PRBS9 pattern select */ + ADI_ADRV903X_PRBS15, /*!< Deframer PRBS15 pattern select */ + ADI_ADRV903X_PRBS31, /*!< Deframer PRBS31 pattern select */ + ADI_ADRV903X_USERDATA /*!< Deframer user supplied pattern select */ +} adi_adrv903x_DeframerPrbsOrder_e; + +/** +* \brief Enum for JESD204B deserializer / deframer PRBS selection +*/ +typedef enum adi_adrv903x_DeframerPrbsCheckLoc +{ + ADI_ADRV903X_PRBSCHECK_LANEDATA = 0U, /*!< Check PRBS at deserializer lane output (does not require JESD204b link) */ + ADI_ADRV903X_PRBSCHECK_SAMPLEDATA /*!< Check PRBS at output of deframer (JESD204b deframed sample) */ +} adi_adrv903x_DeframerPrbsCheckLoc_e; + +/** +* \brief Data structure to hold ADRV903X JESD204b Deframer PRBS test configuration +*/ +typedef struct adi_adrv903x_DfrmPrbsCfg +{ + adi_adrv903x_DeframerPrbsOrder_e polyOrder; /*!< Deframer PRBS Order */ + adi_adrv903x_DeframerPrbsCheckLoc_e checkerLocation; /*!< Deframer PRBS Checker Location */ +} adi_adrv903x_DfrmPrbsCfg_t; + +/** +* \brief Enum of possible Framer Test Data sources +*/ +typedef enum adi_adrv903x_FramerDataSource +{ + ADI_ADRV903X_FTD_ADC_DATA = 0, /*!< Framer test data ADC data source */ + ADI_ADRV903X_FTD_CHECKERBOARD, /*!< Framer test data checkerboard data source */ + ADI_ADRV903X_FTD_TOGGLE0_1, /*!< Framer test data toggle 0 to 1 data source */ + ADI_ADRV903X_FTD_PRBS31, /*!< Framer test data PRBS31 data source */ + ADI_ADRV903X_FTD_PRBS23, /*!< Framer test data PRBS23 data source */ + ADI_ADRV903X_FTD_PRBS15, /*!< Framer test data PRBS15 data source */ + ADI_ADRV903X_FTD_PRBS9, /*!< Framer test data PRBS9 data source */ + ADI_ADRV903X_FTD_PRBS7, /*!< Framer test data PRBS7 data source */ + ADI_ADRV903X_FTD_RAMP, /*!< Framer test data ramp data source */ + ADI_ADRV903X_FTD_PATTERN_REPEAT = 14, /*!< Framer test data 16-bit programmed pattern repeat source */ + ADI_ADRV903X_FTD_PATTERN_ONCE = 15 /*!< Framer test data 16-bit programmed pattern executed once source */ +} adi_adrv903x_FramerDataSource_e; + +/** +* \brief Enum of Framer test data injection points +*/ +typedef enum adi_adrv903x_FramerDataInjectPoint +{ + ADI_ADRV903X_FTD_FRAMERINPUT = 0, /*!< Framer test data injection point at framer input */ + ADI_ADRV903X_FTD_SERIALIZER, /*!< Framer test data injection point at serializer input */ + ADI_ADRV903X_FTD_POST_LANEMAP /*!< Framer test data injection point after lane mapping */ +} adi_adrv903x_FramerDataInjectPoint_e; + +/** +* \brief Enum of Framer test data configuration +*/ +typedef struct adi_adrv903x_FrmTestDataCfg +{ + uint8_t framerSelMask; /*!< Framer selected mask */ + adi_adrv903x_FramerDataSource_e testDataSource; /*!< Framer test data source */ + adi_adrv903x_FramerDataInjectPoint_e injectPoint; /*!< Framer test data injection point */ +} adi_adrv903x_FrmTestDataCfg_t; + +/** +* \brief Data structure to hold ADRV903X JESD204B/C Deframer PRBS Error Counter values on readback +*/ +typedef struct adi_adrv903x_DfrmPrbsErrCounters +{ + adi_adrv903x_DeframerPrbsCheckLoc_e sampleSource; /*!< Sample or Lane mode. Mode error count and status use zeroth index for sample mode */ + uint8_t sampleErrors; /*!< 0b: sample error count, 1b: invalid error flag, 2b: error flag */ + uint8_t errorStatus[ADI_ADRV903X_MAX_SERIALIZER_LANES]; /*!< Array contains error status */ + uint32_t laneErrors[ADI_ADRV903X_MAX_SERIALIZER_LANES]; /*!< Lane 0 contains error counters if in sample mode, otherwise errors are maintained per lane */ +} adi_adrv903x_DfrmPrbsErrCounters_t; + +/** +* \brief Enum to select data capture length for Rx/Orx +*/ +typedef enum adi_adrv903x_RxOrxDataCaptureLength +{ + ADI_ADRV903X_CAPTURE_SIZE_12K = 0x3000, + ADI_ADRV903X_CAPTURE_SIZE_16K = 0x4000, + ADI_ADRV903X_CAPTURE_SIZE_32K = 0x8000, + ADI_ADRV903X_CAPTURE_SIZE_8K = 0x2000, + ADI_ADRV903X_CAPTURE_SIZE_4K = 0x1000, + ADI_ADRV903X_CAPTURE_SIZE_2K = 0x800, + ADI_ADRV903X_CAPTURE_SIZE_1K = 0x400, + ADI_ADRV903X_CAPTURE_SIZE_512 = 0x200, + ADI_ADRV903X_CAPTURE_SIZE_256 = 0x100, + ADI_ADRV903X_CAPTURE_SIZE_128 = 0x80, + ADI_ADRV903X_CAPTURE_SIZE_64 = 0x40, + ADI_ADRV903X_CAPTURE_SIZE_32 = 0x20 + +} adi_adrv903x_RxOrxDataCaptureLength_e; + +/** + * \brief Enum define ADRV903X JESD204B Deframer error counter reset option + */ +typedef enum adi_adrv903x_DfrmErrCounterReset +{ + ADI_ADRV903X_DFRM_BD_CLEAR = 0x01, /*!< BD Clear */ + ADI_ADRV903X_DFRM_INT_CLEAR = 0x2, /*!< Int Clear */ + ADI_ADRV903X_DFRM_UEK_CLEAR = 0x4 /*!< UEK Clear */ +} adi_adrv903x_DfrmErrCounterReset_e; + +/** +* \brief Enum to select GPINT enable/disable for deframer error counters +*/ +typedef enum adi_adrv903x_DfrmErrCounterIrqSel +{ + ADI_ADRV903X_DFRM_ERR_COUNT_DISABLE_IRQ = 0, /*!< Do not create GPINT when error counter overflows 255 */ + ADI_ADRV903X_DFRM_ERR_COUNT_ENABLE_IRQ /*!< Create GPINT when error counter overflows 255 */ +} adi_adrv903x_DfrmErrCounterIrqSel_e; + +/** +* \brief Enum to select Serdes Error to be Cleared, Enabled or Disable +*/ +typedef enum adi_adrv903x_SerdesErrAction +{ + ADI_ADRV903X_SERDES_PCLK_ERR_DISABLE = 0x01U, /*!< Disable PCLK related errors */ + ADI_ADRV903X_SERDES_SYSREF_ERR_DISABLE = 0x02U, /*!< Disable SYSREF Phase error */ + ADI_ADRV903X_SERDES_ALL_ERR_DISABLE = 0x03U, /*!< Disable both PCLK and SYSREF errors */ + ADI_ADRV903X_SERDES_PCLK_ERR_ENABLE = 0x04U, /*!< Enable PCLK related errors */ + ADI_ADRV903X_SERDES_SYSREF_ERR_ENABLE = 0x08U, /*!< Enable SYSREF Phase error */ + ADI_ADRV903X_SERDES_ALL_ERR_ENABLE = 0x0CU, /*!< Enable both PCLK and SYSREF errors */ + ADI_ADRV903X_SERDES_PCLK_ERR_CLEAR = 0x05U, /*!< Clear PCLK related errors */ + ADI_ADRV903X_SERDES_SYSREF_ERR_CLEAR = 0x0AU, /*!< Clear SYSREF Phase error */ + ADI_ADRV903X_SERDES_ALL_ERR_CLEAR = 0x0FU, /*!< Clear both PCLK and SYSREF errors */ +} adi_adrv903x_SerdesErrAction_e; + +/** +* \brief Data structure to hold ADRV903X JESD204B/C Framer status +*/ +typedef struct adi_adrv903x_FramerStatus +{ + uint8_t status; /*!< Framer status */ + uint8_t framerSyncNeCount; /*!< 204B: Count of SYNCB falling edges */ + uint8_t qbfStateStatus; /*!< 204B: QBF status */ + uint8_t syncNSel; /*!< 204B: Syncb crossbar select */ +} adi_adrv903x_FramerStatus_t; + +/** +* \brief Data structure to hold ADRV903X JESD204B/C Deframer status information +*/ +typedef struct adi_adrv903x_DeframerStatus +{ + uint8_t status; /*!< Deframer status for both 204B/C */ + uint8_t reserved; /*!< Contain additional status information */ +} adi_adrv903x_DeframerStatus_t; + +/** +* \brief Data structure to hold ADRV903X JESD204B/C Deframer status information which include physical lanes. +*/ +typedef struct adi_adrv903x_DeframerStatus_v2 +{ + uint8_t phyLaneMask; /*!< Physical lane bit mask */ + uint8_t laneStatus[8]; /*!< Deframer status for both 204B/C for physical lanes */ + uint8_t linkState; /*!< b0:204B/c, b1:link up/down */ +} adi_adrv903x_DeframerStatus_v2_t; + +/** +* \brief Data structure to hold ADRV903X JESD204b Deframer Source register bits. +*/ +typedef struct adi_adrv903x_DeframerIrqVector +{ + uint16_t lane[ADI_ADRV903X_MAX_DESERIALIZER_LANES]; /*!< IRQ vector data per physical lane */ + uint16_t deframer0; /*!< Bitwise-OR of vectors for all lanes in use by Deframer0 */ + uint16_t deframer1; /*!< Bitwise-OR of vectors for all lanes in use by Deframer1 */ +} adi_adrv903x_DeframerIrqVector_t; + +/* + * \brief Data structure to hold ADRV903X JESD204B Deframer error counter status + */ +typedef struct adi_adrv903x_DfrmErrCounterStatus +{ + uint8_t laneStatus; /*!< deframer status bits */ + uint8_t bdCntValue; /*!< Bad-Disparity error counter current value */ + uint8_t uekCntValue; /*!< UnExpected-K error counter current value */ + uint8_t nitCntValue; /*!< Not-In-Table error counter current value */ +} adi_adrv903x_DfrmErrCounterStatus_t; + +/* + * \brief Data structure to hold ADRV903X JESD204C Deframer error counter status + */ +typedef struct adi_adrv903x_Dfrm204cErrCounterStatus +{ + uint8_t shCntValue; /*!< Count of block alignment errors */ + uint8_t embCntValue; /*!< Count of extended multiblock alignment errors */ + uint8_t mbCntValue; /*!< Count of multiblock alignment errors */ + uint8_t crcCntValue; /*!< Count of CRC parity errors */ +} adi_adrv903x_Dfrm204cErrCounterStatus_t; + +/** +* \brief Data structure to hold ADRV903X JESD204b DeFramer ILAS configuration settings +*/ +typedef struct adi_adrv903x_DfrmLane0Cfg +{ + uint8_t dfrmDID; /*!< JESD204B Configuration Device ID for ILAS check */ + uint8_t dfrmBID; /*!< JESD204B Configuration Bank ID for ILAS check */ + uint8_t dfrmLID0; /*!< JESD204B Configuration starting Lane ID for ILAS check */ + uint8_t dfrmL; /*!< JESD204B Configuration L = lanes per data converter for ILAS check */ + uint8_t dfrmSCR; /*!< JESD204B Configuration scramble setting for ILAS check */ + uint8_t dfrmF; /*!< JESD204B Configuration F = octets per frame for ILAS check */ + uint8_t dfrmK; /*!< JESD204B Configuration K = frames per multiframe for ILAS check */ + uint8_t dfrmM; /*!< JESD204B Configuration M = number of data converters for ILAS check */ + uint8_t dfrmN; /*!< JESD204B Configuration N = data converter sample resolution for ILAS check */ + uint8_t dfrmCS; /*!< JESD204B Configuration CS = number of control bits transferred per sample per frame for ILAS check */ + uint8_t dfrmNP; /*!< JESD204B Configuration NP = JESD204B word size based on the highest resolution of the data converter for ILAS check */ + uint8_t dfrmS; /*!< JESD204B Configuration S = number of samples/data converter/frame for ILAS check */ + uint8_t dfrmCF; /*!< JESD204B Configuration CF = '0' = control bits appended to each sample, '1' = appended to end of frame for ILAS check */ + uint8_t dfrmHD; /*!< JESD204B Configuration HD = high density bit - samples are contained within lane (0) or divided over more than one lane (1) for ILAS check */ + uint8_t dfrmFCHK0; /*!< JESD204B Configuration checksum for ILAS check lane0 */ +} adi_adrv903x_DfrmLane0Cfg_t; + +/** +* \brief Data structure to hold ADRV903X JESD204b DeFramer ILAS configuration settings for each deframer +*/ +typedef struct adi_adrv903x_DfrmCompareData +{ + uint32_t zeroCheckFlag; /*!< Link Valid Data Flag - if returned all zero then link is not active */ + uint32_t ilasMismatchDfrm; /*!< ILAS mismatch Flag - all set bits indicated mismatch and bit position indicates incorrect value */ + adi_adrv903x_DfrmLane0Cfg_t dfrmIlasData; /*!< Captured ILAS data */ + adi_adrv903x_DfrmLane0Cfg_t dfrmCfgData; /*!< Configured ILAS data */ +} adi_adrv903x_DfrmCompareData_t; + +/** +* \brief Data structure to hold ADRV903X JESD204b DeFramer ILAS configuration settings +*/ +typedef struct adi_adrv903x_DfrmLaneCfg_v2 +{ + uint8_t jesdV; /*!< JESD204B Configuration JESD version */ + uint8_t subclassV ; /*!< JESD204B Configuration Subclass version */ + uint8_t dfrmDID; /*!< JESD204B Configuration Device ID for ILAS check */ + uint8_t dfrmBID; /*!< JESD204B Configuration Bank ID for ILAS check */ + uint8_t dfrmLID; /*!< JESD204B Configuration Lane ID for ILAS check */ + uint8_t dfrmL; /*!< JESD204B Configuration L = lanes per data converter for ILAS check */ + uint8_t dfrmSCR; /*!< JESD204B Configuration scramble setting for ILAS check */ + uint8_t dfrmF; /*!< JESD204B Configuration F = octets per frame for ILAS check */ + uint8_t dfrmK; /*!< JESD204B Configuration K = frames per multiframe for ILAS check */ + uint8_t dfrmM; /*!< JESD204B Configuration M = number of data converters for ILAS check */ + uint8_t dfrmN; /*!< JESD204B Configuration N = data converter sample resolution for ILAS check */ + uint8_t dfrmCS; /*!< JESD204B Configuration CS = number of control bits transferred per sample per frame for ILAS check */ + uint8_t dfrmNP; /*!< JESD204B Configuration NP = JESD204B word size based on the highest resolution of the data converter for ILAS check */ + uint8_t dfrmS; /*!< JESD204B Configuration S = number of samples/data converter/frame for ILAS check */ + uint8_t dfrmCF; /*!< JESD204B Configuration CF = '0' = control bits appended to each sample, '1' = appended to end of frame for ILAS check */ + uint8_t dfrmHD; /*!< JESD204B Configuration HD = high density bit - samples are contained within lane (0) or divided over more than one lane (1) for ILAS check */ + uint8_t dfrmFCHK; /*!< JESD204B Configuration checksum for ILAS check */ +} adi_adrv903x_DfrmLaneCfg_v2_t; + +/** +* \brief Enum of ILAS deframer lane mismatch bits +*/ +typedef enum adi_adrv903x_IlasMismatch +{ + ADI_ADRV903X_ILAS_DID = 0x00000001, + ADI_ADRV903X_ILAS_BID = 0x00000002, + ADI_ADRV903X_ILAS_LID = 0x00000004, + ADI_ADRV903X_ILAS_L = 0x00000008, + ADI_ADRV903X_ILAS_SCR = 0x00000010, + ADI_ADRV903X_ILAS_F = 0x00000020, + ADI_ADRV903X_ILAS_K = 0x00000040, + ADI_ADRV903X_ILAS_M = 0x00000080, + ADI_ADRV903X_ILAS_N = 0x00000100, + ADI_ADRV903X_ILAS_CS = 0x00000200, + ADI_ADRV903X_ILAS_NP = 0x00000400, + ADI_ADRV903X_ILAS_S = 0x00000800, + ADI_ADRV903X_ILAS_CF = 0x00001000, + ADI_ADRV903X_ILAS_HD = 0x00002000, + ADI_ADRV903X_ILAS_CKSM = 0x00004000, + ADI_ADRV903X_ILAS_JESDV = 0x00008000, + ADI_ADRV903X_ILAS_SUBCLASSV = 0x00010000 +} adi_adrv903x_IlasMismatch_e; + +/** +* \brief Data structure to hold ADRV903X JESD204b DeFramer ILAS configuration settings for each deframer with all lanes +*/ +typedef struct adi_adrv903x_DfrmCompareData_v2 +{ + uint8_t phyLaneEnMask; /*!< Physical enabled lane bit mask for the selected deframer */ + uint8_t laneMismatchMask; /*!< lane mismatch bit mask for the selected deframer */ + uint32_t zeroCheckFlag[ADI_ADRV903X_MAX_DESERIALIZER_LANES]; /*!< Link Valid Data Flag - see adi_adrv903x_IlasMismatch_e for bit mask. */ + uint32_t ilasMismatchDfrm[ADI_ADRV903X_MAX_DESERIALIZER_LANES]; /*!< ILAS mismatch Flag - all set bits indicated mismatch and bit position indicates incorrect value */ + uint8_t cfgDataChksum[ADI_ADRV903X_MAX_DESERIALIZER_LANES]; /*!< Configuration data checksum used to compare with each lane checksum */ + adi_adrv903x_DfrmLaneCfg_v2_t dfrmIlasData[ADI_ADRV903X_MAX_DESERIALIZER_LANES]; /*!< Captured ILAS data for all lanes */ + adi_adrv903x_DfrmLaneCfg_v2_t dfrmCfgData; /*!< Configured ILAS data for selected deframer */ +} adi_adrv903x_DfrmCompareData_v2_t; + +/* +* \brief enum to set ADC sample crossbar loopback +*/ +typedef enum adi_adrv903x_AdcSampleLoopbackXbar +{ + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX0_DATA_I = 0U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX0_DATA_Q = 1U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX1_DATA_I = 4U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX1_DATA_Q = 5U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX2_DATA_I = 8U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX2_DATA_Q = 9U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX3_DATA_I = 12U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX3_DATA_Q = 13U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX4_DATA_I = 16U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX4_DATA_Q = 17U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX5_DATA_I = 20U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX5_DATA_Q = 21U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX6_DATA_I = 24U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX6_DATA_Q = 25U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX7_DATA_I = 28U, + ADI_ADRV903X_JESD_FRM_LB_XBAR_TX7_DATA_Q = 29U, +} adi_adrv903x_AdcSampleLoopbackXbar_e; + +/** +* \brief Data structure to hold ADRV903X Deserializer lanes Common Mode Configuration +*/ +typedef struct adi_adrv903x_DeserLanesVcmCfg +{ + uint8_t vcmDriverMask; /*!< Lane Mask to configure the AMUX bus to be driven by the VCM node in the selected lane */ + uint8_t vcmReceiverMask; /*!< Lane Mask to specify which lanes use the AMUx bus to set the JRx input common mode */ +} adi_adrv903x_DeserLanesVcmCfg_t; + +#endif /* _ADI_ADRV903X_DATAINTERFACE_TYPES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_dev_temp_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_dev_temp_types.h new file mode 100644 index 0000000000000..30b4423a5141e --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_dev_temp_types.h @@ -0,0 +1,85 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_dev_temp_types.h + * + * \brief Contains ADRV903X device temperature data structures. + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_DEV_TEMP_TYPES_H__ +#define __ADRV903X_DEV_TEMP_TYPES_H__ + +#include "adi_adrv903x_platform_pack.h" + +/** + * \brief Enum of device temperature sensor IDs + */ +typedef enum adi_adrv903x_DevTempSensor +{ + ADI_ADRV903X_DEVTEMP_TX0 = 0u, /*!< Tx channel 0 temperature sensor */ + ADI_ADRV903X_DEVTEMP_TX1, /*!< Tx channel 1 temperature sensor */ + ADI_ADRV903X_DEVTEMP_TX2, /*!< Tx channel 2 temperature sensor */ + ADI_ADRV903X_DEVTEMP_TX3, /*!< Tx channel 3 temperature sensor */ + ADI_ADRV903X_DEVTEMP_TX4, /*!< Tx channel 4 temperature sensor */ + ADI_ADRV903X_DEVTEMP_TX5, /*!< Tx channel 5 temperature sensor */ + ADI_ADRV903X_DEVTEMP_TX6, /*!< Tx channel 6 temperature sensor */ + ADI_ADRV903X_DEVTEMP_TX7, /*!< Tx channel 7 temperature sensor */ + ADI_ADRV903X_DEVTEMP_CLKPLL, /*!< Clk PLL temperature sensor */ + ADI_ADRV903X_DEVTEMP_RF0PLL, /*!< RF0 PLL temperature sensor */ + ADI_ADRV903X_DEVTEMP_RF1PLL, /*!< RF1 PLL temperature sensor */ + ADI_ADRV903X_DEVTEMP_SERDESPLL, /*!< SERDES PLL temperature sensor */ + ADI_ADRV903X_DEVTEMP_MAX_SENSORS /*!< Max number of temperature sensors */ +} adi_adrv903x_DevTempSensor_e; + +/** + * \brief Enum of device temperature sensor ID masks + */ +typedef enum adi_adrv903x_DevTempSensorMask +{ + ADI_ADRV903X_DEVTEMP_MASK_TX0 = (1u << ADI_ADRV903X_DEVTEMP_TX0), + ADI_ADRV903X_DEVTEMP_MASK_TX1 = (1u << ADI_ADRV903X_DEVTEMP_TX1), + ADI_ADRV903X_DEVTEMP_MASK_TX2 = (1u << ADI_ADRV903X_DEVTEMP_TX2), + ADI_ADRV903X_DEVTEMP_MASK_TX3 = (1u << ADI_ADRV903X_DEVTEMP_TX3), + ADI_ADRV903X_DEVTEMP_MASK_TX4 = (1u << ADI_ADRV903X_DEVTEMP_TX4), + ADI_ADRV903X_DEVTEMP_MASK_TX5 = (1u << ADI_ADRV903X_DEVTEMP_TX5), + ADI_ADRV903X_DEVTEMP_MASK_TX6 = (1u << ADI_ADRV903X_DEVTEMP_TX6), + ADI_ADRV903X_DEVTEMP_MASK_TX7 = (1u << ADI_ADRV903X_DEVTEMP_TX7), + ADI_ADRV903X_DEVTEMP_MASK_CLKPLL = (1u << ADI_ADRV903X_DEVTEMP_CLKPLL), + ADI_ADRV903X_DEVTEMP_MASK_RF0PLL = (1u << ADI_ADRV903X_DEVTEMP_RF0PLL), + ADI_ADRV903X_DEVTEMP_MASK_RF1PLL = (1u << ADI_ADRV903X_DEVTEMP_RF1PLL), + ADI_ADRV903X_DEVTEMP_MASK_SERDESPLL = (1u << ADI_ADRV903X_DEVTEMP_SERDESPLL), +} adi_adrv903x_DevTempSensorMask_e; + +#define ADI_ADRV903X_DEVTEMP_INVALID ~(ADI_ADRV903X_DEVTEMP_MASK_TX0 | \ + ADI_ADRV903X_DEVTEMP_MASK_TX1 | \ + ADI_ADRV903X_DEVTEMP_MASK_TX2 | \ + ADI_ADRV903X_DEVTEMP_MASK_TX3 | \ + ADI_ADRV903X_DEVTEMP_MASK_TX4 | \ + ADI_ADRV903X_DEVTEMP_MASK_TX5 | \ + ADI_ADRV903X_DEVTEMP_MASK_TX6 | \ + ADI_ADRV903X_DEVTEMP_MASK_TX7 | \ + ADI_ADRV903X_DEVTEMP_MASK_CLKPLL | \ + ADI_ADRV903X_DEVTEMP_MASK_RF0PLL | \ + ADI_ADRV903X_DEVTEMP_MASK_RF1PLL | \ + ADI_ADRV903X_DEVTEMP_MASK_SERDESPLL) + +/** +* \brief Data structure to hold device temperature data +*/ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_DevTempData +{ + int16_t tempDegreesCelsius[ADI_ADRV903X_DEVTEMP_MAX_SENSORS]; /*!< Temperature readings from all temperature sensors */ + int16_t tempDegreesCelsiusAvg; /*!< Average temperature reading of temperature sensors specified in avgMask */ + uint16_t avgMask; /*!< Bitmask of adi_adrv903x_DevTempSensorMask_e values indicating which temperature sensors are averaged in tempDegreesCelciusAvg */ +} adi_adrv903x_DevTempData_t;) + +#endif /* __ADRV903X_DEV_TEMP_TYPES_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_error.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_error.h new file mode 100644 index 0000000000000..adcf90a433b99 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_error.h @@ -0,0 +1,62 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_error.h +* +* \brief Device Specific Abstractions for Common Error Declarations +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef _ADI_ADRV903X_ERROR_H_ +#define _ADI_ADRV903X_ERROR_H_ + +#include "adi_adrv903x_types.h" +#include "adi_adrv903x_error_types.h" + +/** + * \brief Service to Lookup the Error Message and Recovery Action for an Error Code + * + * \param[in] errSrc Error Source for the Device Type + * \param[in] errCode Error Code to be Looked Up + * \param[out] errMsgPtr Associated Error Message + * \param[out] errCausePtr Associated Error Cause + * \param[out] actionCodePtr Associated Recovery Action for the Error + * \param[out] actionMsgPtr Associated Action Message + * + * \retval ADI_ADRV903X_ERR_ACT_NONE if Lookup was Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ErrInfoGet(const adi_adrv903x_ErrSource_e errSrc, + const int64_t errCode, + const char** const errMsgPtr, + const char** const errCausePtr, + adi_adrv903x_ErrAction_e* const actionCodePtr, + const char** const actionMsgPtr); + +/** + * \brief Service to Parse Error Data from the Error Structure + * + * \param[in] device Pointer to the device + * \param[in] frameId Stack Trace Frame ID + * \param[out] errSrcPtr Error Source for the Device Type + * \param[out] errCodePtr Associated Error Code + * \param[out] errCausePtr Associated Error Message + * \param[out] errMsgPtr Associated Error Cause + * \param[out] actionCodePtr Associated Recovery Action for the Error + * \param[out] actionMsgPtr Associated Action Message + * + * \retval ADI_ADRV903X_ERR_ACT_NONE if Lookup was Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ErrDataGet(const adi_adrv903x_Device_t* const device, + const adi_common_ErrFrameId_e frameId, + adi_adrv903x_ErrSource_e* const errSrcPtr, + int64_t* const errCodePtr, + const char** const errMsgPtr, + const char** const errCausePtr, + adi_adrv903x_ErrAction_e* const actionCodePtr, + const char** const actionMsgPtr); + +#endif /* _ADI_ADRV903X_ERROR_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_error_type_action.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_error_type_action.h new file mode 100644 index 0000000000000..da70b6d50952c --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_error_type_action.h @@ -0,0 +1,49 @@ + /** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + + /** + * \file adi_adrv903x_error_type_action.h + * + * \brief Device Recovery Action Type + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_ERROR_TYPE_ACTION_H_ +#define _ADI_ADRV903X_ERROR_TYPE_ACTION_H_ + + +/** +* \brief ADI ADRV903X Recovery Actions +*/ +typedef enum adi_adrv903x_ErrAction +{ + ADI_ADRV903X_ERR_ACT_RESET_DEVICE = -500, /*!< Device NOK: HW/SW Reset Required */ + + /* All Reset Feature Unique Codes exist between -500 & -400 */ + ADI_ADRV903X_ERR_ACT_RESET_FEATURE = -400, /*!< API NOK: Feature Reset Required */ + + /* All Reset Interface Unique Codes exist between -400 & -300 */ + ADI_ADRV903X_ERR_ACT_RESET_INTERFACE = -300, /*!< API NOK: Interface Reset Required */ + + /* All Check Feature Unique Codes exist between -300 & -200 */ + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE = -200, /*!< API OK; Feature is reporting an Error */ + + /* All Check Interface Unique Codes exist between -200 & -100 */ + ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE = -100, /*!< API OK; Interface is reporting an Error */ + + /* All Development Unique Codes exist between -100 & -1 */ + ADI_ADRV903X_ERR_ACT_OPEN_DEVICE = -10, /*!< API OK; Device Not Open */ + ADI_ADRV903X_ERR_ACT_CHECK_MULTIVERSIONING = -3, /*!< API OK: Note: No other error data set */ + ADI_ADRV903X_ERR_ACT_CHECK_PARAM = -1, /*!< API OK; Invalid Parameter passed to function */ + + /* No Error/Recovery Action */ + ADI_ADRV903X_ERR_ACT_NONE = 0 /*!< API OK; No Action Required */ +} adi_adrv903x_ErrAction_e; + +#endif /* _ADI_ADRV903X_ERROR_TYPE_ACTION_H_ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_error_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_error_types.h new file mode 100644 index 0000000000000..0b8690889826b --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_error_types.h @@ -0,0 +1,436 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_error_types.h + * + * \brief Device Specific Error Types + * + * \details + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_ERROR_TYPES_H_ +#define _ADI_ADRV903X_ERROR_TYPES_H_ + +#include "adi_library_types.h" +#include "adi_common_error_types.h" +#include "adi_adrv903x_error_type_action.h" + +/* Cal Error Codes */ + + /* TODO: Implement High Level Error Codes; Reserved: 100 */ +#define ADI_ADRV903X_ERRCODE_CALS_INIT_ERROR_FLAG 100UL /* Init Cals Run Error Flag */ + +/* CPU Error Codes */ + + /* TODO: Implement High Level Error Codes; Reserved: 200 */ +#define ADI_ADRV903X_ERRCODE_CPU_CMD_ID 200UL /* Command ID Error */ +#define ADI_ADRV903X_ERRCODE_CPU_CMD_RESPONSE 201UL /* Command Response Error */ +#define ADI_ADRV903X_ERRCODE_CPU_CMD_TIMEOUT 203UL /* Command Timeout */ +#define ADI_ADRV903X_ERRCODE_CPU_IMAGE_NOT_LOADED 204UL /* CPU Image Not Loaded */ +#define ADI_ADRV903X_ERRCODE_CPU_IMAGE_WRITE 205UL /* CPU Image Write Error */ +#define ADI_ADRV903X_ERRCODE_CPU_PROFILE_WRITE 206UL /* CPU Profile Write Error */ +#define ADI_ADRV903X_ERRCODE_CPU_MAILBOX_READ 207UL /* CPU Mailbox Read Error */ +#define ADI_ADRV903X_ERRCODE_CPU_RAM_ACCESS_START 208UL /* CPU RAM Access Start Error */ +#define ADI_ADRV903X_ERRCODE_CPU_RAM_LOCK 209UL /* RAM Lock/Unlock Error Code */ +#define ADI_ADRV903X_ERRCODE_CPU_RAM_ACCESS_STOP 210UL /* CPU RAM Access Stop Error */ +#define ADI_ADRV903X_ERRCODE_CPU_PING 211UL /* CPU Ping Error */ +#define ADI_ADRV903X_ERRCODE_CPU_BOOT_TIMEOUT 212UL /* CPU Boot Timeout */ + +/* Data Interface Error Codes */ + + /* TODO: Implement High Level Error Codes; Reserved: 300 */ +#define ADI_ADRV903X_ERRCODE_DATAINTERFACE_TEST 300UL /* Example */ + +/* GPIO Error Codes */ + + /* TODO: Implement High Level Error Codes; Reserved: 500 */ +#define ADI_ADRV903X_ERRCODE_GPIO_TEST 500UL /* Example */ + +/* Device HAL Error Codes */ + +#define ADI_ADRV903X_ERRCODE_HAL_SPI_WRITE 600UL /* SPI Write Error */ +#define ADI_ADRV903X_ERRCODE_HAL_SPI_READ 601UL /* SPI Read Error */ +#define ADI_ADRV903X_ERRCODE_HAL_INVALID_DEVICE_STATE 602UL /* Invalid device state */ + +/* JESD Error Codes */ + + /* TODO: Implement High Level Error Codes; Reserved: 700 */ +#define ADI_ADRV903X_ERRCODE_JESD_TEST 700UL /* Example */ + +/* Radio Control Error Codes */ + + /* TODO: Implement High Level Error Codes; Reserved: 800 */ +#define ADI_ADRV903X_ERRCODE_RADIOCTRL_LO_CFG 800UL /* Lo Frequency Configuration Error */ + +/* RX Error Codes */ + + /* TODO: Implement High Level Error Codes; Reserved: 900 */ +#define ADI_ADRV903X_ERRCODE_RX_TEST 900UL /* Example */ + +/* TX Error Codes */ + + /* TODO: Implement High Level Error Codes; Reserved: 1000 */ +#define ADI_ADRV903X_ERRCODE_TX_TEST 1000UL /* Example */ + + /* TODO: Implement High Level Error Codes; Reserved: 1300 */ +#define ADI_ADRV903X_ERRCODE_AGC_TEST 1300UL /* Example */ + +/* +* \brief Device Specific Macro to check for Null Device & Error Pointer +* +* \param devicePtr Device Pointer +*/ +#define ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(devicePtr) \ +if (devicePtr == NULL) \ +{ \ + return ADI_ADRV903X_ERR_ACT_CHECK_PARAM; \ +} + +/* +* \brief Device Specific Macro to check for Null Common Device & Error Pointer +* +* \param commonDev Common Device Pointer, which also contains the Error Pointer +*/ +#define ADI_ADRV903X_NULL_COMMON_PTR_RETURN(commonDev) \ +if ((commonDev == NULL) || \ + (commonDev->errPtr == NULL)) \ +{ \ + return ADI_ADRV903X_ERR_ACT_CHECK_PARAM; \ +} + +/* +* \brief Device Specific Macro to check for Null Pointer +* +* \param ptr Pointer to be checked +*/ +#define ADI_ADRV903X_NULL_PTR_RETURN(ptr) \ +if (ptr == NULL) \ +{ \ + return ADI_ADRV903X_ERR_ACT_CHECK_PARAM; \ +} + +/* +* \brief Macro to perform the following: +* 1) Null Pointer Check +* 2) Report Null Pointer to Error Memory +* 3) Return ADI_COMMON_ERR_ACT_CHECK_PARAM from API + +* \param commonDev Pointer to the common Device Structure (contains a pointer to Error Memory) +* \param ptr Pointer to be checked +* +*/ +#define ADI_ADRV903X_NULL_PTR_REPORT_RETURN(commonDev, ptr) \ +{ \ + if (ptr == NULL) \ + { \ + ADI_ERROR_REPORT( commonDev, \ + ADI_ADRV903X_ERRSRC_API, \ + ADI_COMMON_ERRCODE_NULL_PTR, \ + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, \ + ptr, \ + "Null Pointer"); \ + \ + return ADI_ADRV903X_ERR_ACT_CHECK_PARAM; \ + } \ +} + +/* +* \brief Macro to perform the following: +* 1) Null Pointer Check +* 2) Report Null Pointer to Error Memory +* 3) GOTO label specified + +* \param commonDev Pointer to the common Device Structure (contains a pointer to Error Memory) +* \param ptr Pointer to be checked +* \param label Label for GOTO +* +*/ +#define ADI_ADRV903X_NULL_PTR_REPORT_GOTO(commonDev, ptr, label) \ +{ \ + if (ptr == NULL) \ + { \ + ADI_ERROR_REPORT( commonDev, \ + ADI_ADRV903X_ERRSRC_API, \ + ADI_COMMON_ERRCODE_NULL_PTR, \ + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, \ + ptr, \ + "Null Pointer"); \ + \ + goto label; \ + } \ +} + +/* +* \brief Macro to perform the following: +* 1) Report Feature Not Implemented +* 2) Return Device Specific RecoveryAction (i.e. ADI_ADRV903X_ERR_ACT_CHECK_FEATURE) +*/ +#define ADI_ADRV903X_API_NOT_IMPLEMENTED_REPORT_RETURN( commonDev) \ + \ + ADI_ERROR_REPORT( commonDev, \ + ADI_ADRV903X_ERRSRC_API, \ + ADI_COMMON_ERRCODE_FEATURE_NOT_IMPLEMENTED, \ + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, \ + ADI_NO_VARIABLE, \ + "Feature not implemented"); \ + return ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; \ + +/* +* \brief Macro to perform the following: +* 1) Report Feature Not Implemented +* 2) GOTO label specified +*/ +#define ADI_ADRV903X_API_NOT_IMPLEMENTED_REPORT_GOTO( commonDev, label) \ + \ + ADI_ERROR_REPORT( commonDev, \ + ADI_ADRV903X_ERRSRC_API, \ + ADI_COMMON_ERRCODE_FEATURE_NOT_IMPLEMENTED, \ + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, \ + ADI_NO_VARIABLE, \ + "Feature not implemented"); \ + goto label; \ + +/* +* \brief ADRV903X Error Macro +* 1) Error Table Lookup (Report Lookup Error) +* 2) Report Error Information from Lookup +* 3) Update RecoveryAction +*/ +#define ADI_ADRV903X_ERROR_INFO_GET(errSrc, errCode, variable, recoveryAction, error) \ +{ \ + if (ADI_ADRV903X_ERR_ACT_NONE != adi_adrv903x_ErrInfoGet(errSrc, \ + errCode, \ + &error.errMsg, \ + &error.errCause, \ + &error.actionCode, \ + &error.actionMsg)) \ + { \ + /* Report failure of ADRV903X error lookup */ \ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; \ + ADI_ERROR_REPORT( &device->common, \ + errSrc, \ + errCode, \ + recoveryAction, \ + variable, \ + "Raw Error Data; Cannot Find More Detailed Information"); \ + } \ +} + +/* +* \brief ADRV903X Error Macro +* 1) Error Table Lookup (Report Lookup Error) +* 2) Report Error Information from Lookup +* 3) Update RecoveryAction +*/ +#define ADI_ADRV903X_ERROR_INFO_GET_REPORT(errSrc, errCode, variable, recoveryAction) \ +{ \ + adi_adrv903x_ErrorInfo_t error = { 0, NULL, NULL, ADI_ADRV903X_ERR_ACT_NONE, NULL }; \ + \ + if (ADI_ADRV903X_ERR_ACT_NONE != adi_adrv903x_ErrInfoGet(errSrc, \ + errCode, \ + &error.errMsg, \ + &error.errCause, \ + &error.actionCode, \ + &error.actionMsg)) \ + { \ + /* Report failure of ADRV903X error lookup */ \ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; \ + ADI_ERROR_REPORT( &device->common, \ + errSrc, \ + errCode, \ + recoveryAction, \ + variable, \ + "Raw Error Data; Cannot Find More Detailed Information"); \ + } \ + else \ + { \ + /* Update Stack Trace */ \ + ADI_ERROR_REPORT( &device->common, \ + errSrc, \ + errCode, \ + error.actionCode, \ + variable, \ + error.errMsg); \ + /* Update Additional Debug Information */ \ + ADI_EXT_ERROR_REPORT( &device->common, \ + error.errCause, \ + error.actionMsg); \ + recoveryAction = error.actionCode; \ + } \ +} + +/* +* \brief ADRV903X Error Goto Macro +* 1) Error Table Lookup (Report Lookup Error) +* 2) Report Error Information from Lookup +* 3) Update RecoveryAction +* 4) Goto label with Looked Up Action +*/ +#define ADI_ADRV903X_ERROR_INFO_GET_REPORT_GOTO(errSrc, errCode, variable, recoveryAction, label) \ +{ \ + adi_adrv903x_ErrorInfo_t error = { 0, NULL, NULL, ADI_ADRV903X_ERR_ACT_NONE, NULL }; \ + \ + if(ADI_ADRV903X_ERR_ACT_NONE != adi_adrv903x_ErrInfoGet(errSrc, \ + errCode, \ + &error.errMsg, \ + &error.errCause, \ + &error.actionCode, \ + &error.actionMsg)) \ + { \ + /* Report failure of ADRV903X error lookup */ \ + ADI_ERROR_REPORT( &device->common, \ + errSrc, \ + errCode, \ + ADI_ADRV903X_ERR_ACT_CHECK_FEATURE, \ + variable, \ + "Raw Error Data; Cannot Find More Detailed Information"); \ + goto label; \ + } \ + /* Update Stack Trace */ \ + ADI_ERROR_REPORT( &device->common, \ + errSrc, \ + errCode, \ + error.actionCode, \ + variable, \ + error.errMsg); \ + /* Update Additional Debug Information */ \ + ADI_EXT_ERROR_REPORT( &device->common, \ + error.errCause, \ + error.actionMsg) \ + recoveryAction = error.actionCode; \ + goto label; \ +} +/* +* \brief ADRV903X File Abstractions +*/ +typedef enum adi_adrv903x_File +{ + ADI_ADRV903X_FILE_PUBLIC_AGC = 0x0U, + ADI_ADRV903X_FILE_PRIVATE_AGC, + ADI_ADRV903X_FILE_PUBLIC_CORE, + ADI_ADRV903X_FILE_PUBLIC_CPU, + ADI_ADRV903X_FILE_PRIVATE_CPU, + ADI_ADRV903X_FILE_PUBLIC_CALS, + ADI_ADRV903X_FILE_PRIVATE_CALS, + ADI_ADRV903X_FILE_PUBLIC_DATAINTERFACE, + ADI_ADRV903X_FILE_PRIVATE_DATAINTERFACE, + ADI_ADRV903X_FILE_PUBLIC_DPD, + ADI_ADRV903X_FILE_PRIVATE_DPD, + ADI_ADRV903X_FILE_PUBLIC_ERROR, + ADI_ADRV903X_FILE_PUBLIC_GPIO, + ADI_ADRV903X_FILE_PRIVATE_GPIO, + ADI_ADRV903X_FILE_PUBLIC_HAL, + ADI_ADRV903X_FILE_PRIVATE_HAL, + ADI_ADRV903X_FILE_PUBLIC_RADIOCTRL, + ADI_ADRV903X_FILE_PRIVATE_RADIOCTRL, + ADI_ADRV903X_FILE_PUBLIC_RX, + ADI_ADRV903X_FILE_PRIVATE_RX, + ADI_ADRV903X_FILE_PUBLIC_TX, + ADI_ADRV903X_FILE_PRIVATE_TX, + ADI_ADRV903X_FILE_PUBLIC_UTILITIES, + ADI_ADRV903X_FILE_PUBLIC_VERSION, + ADI_ADRV903X_FILE_PRIVATE_INIT, + ADI_ADRV903X_FILE_PRIVATE_SHARED_RESOURCE_MANAGER, + ADI_ADRV903X_FILE_PUBLIC_JESD, + ADI_ADRV903X_FILE_PRIVATE_JESD, + ADI_ADRV903X_FILE_PRIVATE_BINLOADER, +} adi_adrv903x_File_e; + +/** +* \brief ADRV903X Error Sources - Needs to Map onto Common Sources +*/ +typedef enum adi_adrv903x_ErrSource +{ + ADI_ADRV903X_ERRSRC_NONE = ADI_COMMON_ERRSRC_NONE_IDX, /*!< No Error/Source; Common Error Source Mapping */ + ADI_ADRV903X_ERRSRC_API = ADI_COMMON_ERRSRC_API_IDX, /*!< API; Common Error Source Mapping */ + ADI_ADRV903X_ERRSRC_HAL = ADI_COMMON_ERRSRC_HAL_IDX, /*!< HAL; Common Error Source Mapping */ + ADI_ADRV903X_ERRSRC_DEVICEBF = ADI_COMMON_ERRSRC_DEVICEBF_IDX, /*!< Device BF; Common Error Source Mapping */ + ADI_ADRV903X_ERRSRC_AGC, /*!< AGC Error */ + ADI_ADRV903X_ERRSRC_CALS, /*!< Calibration Error */ + ADI_ADRV903X_ERRSRC_CPU_BOOT, /*!< CPU Boot Error */ + ADI_ADRV903X_ERRSRC_CPU_RUNTIME, /*!< CPU Runtime Error */ + ADI_ADRV903X_ERRSRC_CPU, /*!< CPU Error */ + ADI_ADRV903X_ERRSRC_DATAINTERFACE, /*!< Data Interface Error */ + ADI_ADRV903X_ERRSRC_GPIO, /*!< GPIO Error */ + ADI_ADRV903X_ERRSRC_DEVICEHAL, /*!< Device HAL Error */ + ADI_ADRV903X_ERRSRC_JESD, /*!< JESD Error */ + ADI_ADRV903X_ERRSRC_RADIOCTRL, /*!< Radio Control Error */ + ADI_ADRV903X_ERRSRC_RX, /*!< RX Error */ + ADI_ADRV903X_ERRSRC_TX, /*!< TX Error */ + ADI_ADRV903X_ERRSRC_UNKNOWN /*!< Unknown */ +} adi_adrv903x_ErrSource_e; + +/** +* \brief ADI ADRV903X Error Table Row +*/ +typedef struct adi_adrv903x_ErrTableRow +{ + const int64_t errCode; /*!< Error code */ + const char* const errMsg; /*!< Error message */ + const adi_adrv903x_ErrAction_e action; /*!< Error action */ +} adi_adrv903x_ErrTableRow_t; + +/** +* \brief ADI ADRV903X Device Error Table Row +*/ +typedef struct adi_adrv903x_DeviceErrTableRow +{ + const int64_t errCode; /*!< Error code */ + const char* const errMsg; /*!< Error message */ + const char* const errCause; /*!< Error cause */ + const adi_adrv903x_ErrAction_e actionCode; /*!< Error action */ + const char* const actionMsg; /*!< Error msg */ +} adi_adrv903x_DeviceErrTableRow_t; + +/** +* \brief ADI Common Error Information +*/ +typedef struct adi_adrv903x_ErrorInfo +{ + int64_t errCode; /*!< Error code */ + const char* errMsg; /*!< Error msg */ + const char* errCause; /*!< Error cause */ + adi_adrv903x_ErrAction_e actionCode; /*!< Error action */ + const char* actionMsg; /*!< Error msg */ +} adi_adrv903x_ErrorInfo_t; + +/** +* \brief ADI ADRV903X Error Action Union +*/ +typedef union adi_adrv903x_ErrActionUnion +{ + adi_adrv903x_ErrAction_e deviceAction; /*!< ADRV903X Error Action Type */ + adi_common_ErrAction_t common; /*!< Common Error Action Union */ +} adi_adrv903x_ErrActionUnion_t; + +/* Type Definitions for Device Error Tables */ +typedef adi_adrv903x_ErrTableRow_t adrv903x_CalsErrCodes_t; + +typedef adi_adrv903x_ErrTableRow_t adrv903x_CpuErrCodes_t; + +typedef adi_adrv903x_DeviceErrTableRow_t adrv903x_CpuBootErrCodes_t; + +typedef adi_adrv903x_DeviceErrTableRow_t adrv903x_CpuRuntimeErrCodes_t; + +typedef adi_adrv903x_ErrTableRow_t adrv903x_DataInterfaceErrCodes_t; + +typedef adi_adrv903x_ErrTableRow_t adrv903x_AgcErrCodes_t; + +typedef adi_adrv903x_ErrTableRow_t adrv903x_GpioErrCodes_t; + +typedef adi_adrv903x_ErrTableRow_t adrv903x_HalErrCodes_t; + +typedef adi_adrv903x_ErrTableRow_t adrv903x_JesdErrCodes_t; + +typedef adi_adrv903x_ErrTableRow_t adrv903x_RadioCtrlErrCodes_t; + +typedef adi_adrv903x_ErrTableRow_t adrv903x_RxErrCodes_t; + +typedef adi_adrv903x_ErrTableRow_t adrv903x_TxErrCodes_t; +#endif /* _ADI_ADRV903X_ERROR_TYPES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_gpio.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_gpio.h new file mode 100644 index 0000000000000..35e56fb393900 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_gpio.h @@ -0,0 +1,637 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adi_adrv903x_gpio.h + * \brief Contains ADRV903X GPIO related function prototypes for + * adi_adrv903x_gpio.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_GPIO_H_ +#define _ADI_ADRV903X_GPIO_H_ + +#include "adi_adrv903x_gpio_types.h" +#include "adi_adrv903x_error.h" + +/**************************************************************************** + * GPIO related functions + **************************************************************************** + */ +/** +* \brief This API function set all digital GPIO to function as input pins. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioForceHiZAllPins(adi_adrv903x_Device_t* const device); + +/** +* \brief This API function set a given digital GPIO to be an input or output. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure +* \param[in] gpio Selected digital GPIO pin +* \param[in] oRide IF override = 0, gpio direction is set by the current OE/IE of the signal on Stg3 of pinmux. +* IF override = 1, gpio direction is forced to IE = 1. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioForceHiZ(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t oRide); + +/** + * \brief This API function returns the full status of all device GPIOs + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[out] status Full status readback for all Digital and Analog GPIO pins of the device + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioStatusRead( adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioStatus_t* const status); + + +/** + * \brief This API function returns the currently routed signal/channelMask + * for a selected digital GPIO pin. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] gpio The digital GPIO pin for which to readback the current configuration + * \param[out] signal Signal currently configured for selected digital gpio + * \param[out] channelMask Channel mask currently configured for selected digital gpio + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioConfigGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + adi_adrv903x_GpioSignal_e* const signal, + uint32_t* const channelMask); + +/** + * \brief This API function returns the currently routed signal/channelMask + * for all 24 digital GPIO pins. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[out] signalArray Array of signals currently configured for each digital GPIO + * \param[out] channelMaskArray Array of channelMasks currently configured for each digital GPIO + * \param[in] arraySize Size of user allocated arrays to hold returned signals and channel masks. + Must be at least 24. If more than 24, the remaining elements will be untouched. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioConfigAllGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioSignal_e signalArray[], + uint32_t channelMaskArray[], + const uint32_t arraySize); + +/** + * \brief This API function returns the currently routed signal/channelMask + * for a selected Analog GPIO pin. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] gpio The analog GPIO pin for which to readback the current configuration + * \param[out] signal Signal currently configured for selected analog gpio + * \param[out] channelMask Channel mask currently configured for selected analog gpio + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogConfigGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + adi_adrv903x_GpioSignal_e* const signal, + uint32_t* const channelMask); + +/** + * \brief This API function returns the currently routed signal/channelMask + * for all 16 Analog GPIO pins. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[out] signalArray Array of signals currently configured for each analog GPIO + * \param[out] channelMaskArray Array of channelMasks currently configured for each analog GPIO + * \param[in] arraySize Size of user allocated arrays to hold returned signals and channel masks. + Must be at least 16. If more than 16, the remaining elements will be untouched. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogConfigAllGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioSignal_e signalArray[], + uint32_t channelMaskArray[], + const uint32_t arraySize); + +/** + * \brief This API function configures a monitor output function for a GPIO. + * + * The monitor outputs allow visibility to some internal ADRV903X signals. Any + * monitor output signal is available on any of the low voltage GPIO[23:0] pins. + * + * If selected signal is ADI_ADRV903X_GPIO_SIGNAL_UNUSED, this function will automatically + * try to release the GPIO pin from a currently routed Monitor Output Signal. This is + * equivalent to calling adi_adrv903x_GpioMonitorOutRelease. + * Else If selected signal is not a monitor output signal, an error will be returned. + * + * If selected signal is not from a Rx/Tx/ORx channel, channel selection will be + * ignored and not range checked. + * If selected signal is from a Rx/Tx channel, channel selection must be in + * in the range 0 to 7. Otherwise an error will be returned. + * If selected signal is from a ORx channel, channel selection must be in + * in the range 0 to 1. Otherwise an error will be returned. + * + * \pre This function may be called any time after device initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] gpio GPIO pin to configure as a Monitor Output + * \param[in] signal Monitor Output signal to observe at selected GPIO + * \param[in] channel Selection of Rx/Tx/ORx channel instance of monitor output signal to observe, if applicable + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioMonitorOutSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const adi_adrv903x_GpioSignal_e signal, + const uint8_t channel); + +/** + * \brief This API function releases a GPIO if it is currently routing a monitor output function. + * + * The monitor outputs allow visibility to some internal ADRV903X signals. Any + * monitor output signal is available on any of the low voltage GPIO[23:0] pins. + * + * If GPIO pin is not routing any signal (signal == ADI_ADRV903X_GPIO_SIGNAL_UNUSED), + * then nothing will change and the function will return successfully. + * If GPIO pin is currently routing a GPIO Monitor Output signal, it will be released, + * the signal will be returned to ADI_ADRV903X_GPIO_SIGNAL_UNUSED, and the function will + * return successfully. + * If GPIO pin is currently routing another type of GPIO signal, then the GPIO will not be + * released and the function will return an error. + * + * \pre This function may be called any time after device initialization + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] gpio GPIO pin to release and disconnect from a Monitor Output function. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioMonitorOutRelease(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio); + +/** + * \brief Allocates and configures selected digital GPIO pins for Manual Input Mode. + * + * A bitmask is used to enable/disable selected GPIO pins. Note that selected pins (pins included in the bitmask) + * must be unallocated before enabling with this function. Otherwise an error is returned. Also note that de-selected pins + * (pins not included in the bitmask) will be checked for current allocation. Those pins that are currently allocated as + * Manual Inputs will be de-allocated. Pins allocated for other features will not be modified. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] gpioInputMask Bitmask to enable Manual Input mode for Digital GPIO pins. + * Mask bit0 represents GPIO[0], bit23 represents GPIO[23]. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioManualInputDirSet( adi_adrv903x_Device_t* const device, + const uint32_t gpioInputMask); + +/** + * \brief Allocates and configures selected digital GPIO pins for Manual Output Mode. + * + * A bitmask is used to enable/disable selected GPIO pins. Note that selected pins (pins included in the bitmask) + * must be unallocated before enabling with this function. Otherwise an error is returned. Also note that de-selected pins + * (pins not included in the bitmask) will be checked for current allocation. Those pins that are currently allocated as + * Manual Outputs will be de-allocated. Pins allocated for other features will not be modified. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] gpioOutputMask Bitmask to enable Manual Output mode for Digital GPIO pins. + * Mask bit0 represents GPIO[0], bit23 represents GPIO[23]. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioManualOutputDirSet( adi_adrv903x_Device_t* const device, + const uint32_t gpioOutputMask); + +/** + * \brief Retrieves input read levels for all digital GPIO pins configured as Manual Inputs. + * + * Bits in gpioInPinLevel are only valid for Digital GPIO pins configured as Manual Input. Ignore bits for all other GPIOs. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[out] gpioInPinLevel Pin levels retrieved for Digital GPIO pins configured as Manual Inputs + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioManualInputPinLevelGet( adi_adrv903x_Device_t* const device, + uint32_t * const gpioInPinLevel); +/** + * \brief Retrieves output drive levels for all digital GPIO pins configured as Manual Outputs. + * + * Bits in gpioOutPinLevel are only valid for Digital GPIO pins configured as Manual Outputs. Ignore bits for all other GPIOs. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[out] gpioOutPinLevel Pin levels retrieved for Digital GPIO pins configured as Manual Outputs + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioManualOutputPinLevelGet( adi_adrv903x_Device_t* const device, + uint32_t * const gpioOutPinLevel); + +/** + * \brief Sets output drive levels for all digital GPIO pins configured as Manual Outputs. + * + * Bits in gpioOutPinLevel are only valid for Digital GPIO pins configured as Manual Outputs. + * Bits for all other GPIOs are ignored by this function. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] gpioPinMask Pinmask to select which Digital GPIO pins will have levels set by gpioOutPinLevel + * \param[in] gpioOutPinLevel Pin levels to be set for Digital GPIO pins configured as Manual Outputs + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioManualOutputPinLevelSet( adi_adrv903x_Device_t* const device, + const uint32_t gpioPinMask, + const uint32_t gpioOutPinLevel); + +/** +* \brief This API function set all analog GPIO to be input pins. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogForceHiZAllPins(adi_adrv903x_Device_t* const device); + +/** +* \brief This API function set a given analog GPIO to be an input or output. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure +* \param[in] gpio Selected analog GPIO pin +* \param[in] oRide IF override = 0, gpio direction is set by the current OE/IE of the signal on Stg1 of pinmux. +* IF override = 1, gpio direction is forced to IE = 1. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogForceHiZ( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + const uint8_t oRide); + +/** + * \brief Allocates and configures selected analog GPIO pins for Manual Input Mode. + * + * A bitmask is used to enable/disable selected GPIO pins. Note that selected pins (pins included in the bitmask) + * must be unallocated before enabling with this function. Otherwise an error is returned. Also note that de-selected pins + * (pins not included in the bitmask) will be checked for current allocation. Those pins that are currently allocated as + * Manual Inputs will be de-allocated. Pins allocated for other features will not be modified. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] gpioAnalogInputMask Bitmask to enable Manual Input mode for Analog GPIO pins. + * Mask bit0 represents GPIO[0], bit15 represents GPIO[15]. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogManualInputDirSet( adi_adrv903x_Device_t* const device, + const uint16_t gpioAnalogInputMask); + +/** + * \brief Allocates and configures selected analog GPIO pins for Manual Output Mode. + * + * A bitmask is used to enable/disable selected GPIO pins. Note that selected pins (pins included in the bitmask) + * must be unallocated before enabling with this function. Otherwise an error is returned. Also note that de-selected pins + * (pins not included in the bitmask) will be checked for current allocation. Those pins that are currently allocated as + * Manual Outputs will be de-allocated. Pins allocated for other features will not be modified. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] gpioAnalogOutputMask Bitmask to enable Manual Output mode for Analog GPIO pins. + * Mask bit0 represents GPIO[0], bit15 represents GPIO[15]. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogManualOutputDirSet( adi_adrv903x_Device_t* const device, + const uint16_t gpioAnalogOutputMask); + +/** + * \brief Retrieves input read levels for all analog GPIO pins configured as Manual Inputs. + * + * Bits in gpioInPinLevel are only valid for Analog GPIO pins configured as Manual Input. Ignore bits for all other GPIOs. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[out] gpioAnalogInPinLevel Pin levels retrieved for Analog GPIO pins configured as Manual Inputs + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogManualInputPinLevelGet( adi_adrv903x_Device_t* const device, + uint16_t * const gpioAnalogInPinLevel); + +/** + * \brief Retrieves output drive levels for all analog GPIO pins configured as Manual Outputs. + * + * Bits in gpioOutPinLevel are only valid for Analog GPIO pins configured as Manual Outputs. Ignore bits for all other GPIOs. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[out] gpioAnalogOutPinLevel Pin levels retrieved for Analog GPIO pins configured as Manual Outputs + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogManualOutputPinLevelGet( adi_adrv903x_Device_t* const device, + uint16_t * const gpioAnalogOutPinLevel); + +/** + * \brief Sets output drive levels for all analog GPIO pins configured as Manual Outputs. + * + * Bits in gpioOutPinLevel are only valid for Analog GPIO pins configured as Manual Outputs. + * Bits for all other GPIOs are ignored by this function. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] gpioAnalogPinMask Pinmask to select which Analog GPIO pins will have levels set by gpioAnalogOutPinLevel + * \param[in] gpioAnalogOutPinLevel Pin levels to be set for Analog GPIO pins configured as Manual Outputs + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogManualOutputPinLevelSet( adi_adrv903x_Device_t* const device, + const uint16_t gpioAnalogPinMask, + const uint16_t gpioAnalogOutPinLevel); + + +/**************************************************************************** + * GP Int (General Purpose Interrupt) related functions + *************************************************************************** + */ + +/** + * \brief Sets the General Purpose (GP) Interrupt Pin Mask Config for GP Int pins: GP_INT0, GP_INT1, or both. + * Note: It is the GP interrupts corresponding to the CLEARED bit positions in pinMaskCfg.gpIntXMask that + * will cause the external GP_INTx signals to be asserted. E.g. setting all valid bits in that field to 1's + * ensures the corresponding GP_INT signal can never be asserted. + * + * GP Interrupt Bit + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] pinSelect Enum indicating the which GP Interrupt pin masks to set + * \param[in] pinMaskCfg Pointer to data structure holding the GP Interrupt Pin Mask Config to write + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpIntPinMaskCfgSet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntPinSelect_e pinSelect, + const adi_adrv903x_GpIntPinMaskCfg_t* const pinMaskCfg); + +/** + * \brief Retrieves the General Purpose (GP) Interrupt Pin Mask Config for GP Int pins: GP_INT0, GP_INT1, or both. + * Note: It is the GP interrupts corresponding to the CLEARED bit positions in returned pinMaskCfg.gpIntXMask that + * will cause the external GP_INTx signals to be asserted. If all valid bits in that field are returned as 1's + * the corresponding GP_INT signal could never be asserted. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] pinSelect Enum indicating the which GP Interrupt pin masks to retrieve + * \param[out] pinMaskCfg Pointer to data structure to contain the GP Interrupt Pin Mask Config retrieved + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpIntPinMaskCfgGet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntPinSelect_e pinSelect, + adi_adrv903x_GpIntPinMaskCfg_t* const pinMaskCfg); + +/** + * \brief Reads the General Purpose (GP) Interrupt status bits and can be used to determine what caused a GP Interrupt pin to be asserted. + * + * The status word read-back will show the current value for all interrupt sources, even if they + * are disabled by the mask. However, the GP Interrupt pin will only assert for the enabled sources. + * + * NOTE: This function DOES NOT clear any interrupt status bits. + * + * If a BBIC detects a rising edge on either General Purpose Interrupt pins GP_INT0 or GP_INT1, this function + * allows the BBIC to determine the source of the interrupt. The value returned in the status parameter will show + * one or more sources for the interrupt based on the bit positioning table found in documentation for adi_adrv903x_GpIntWord_t. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[out] gpIntStatus Pointer to data structure to contain the GP Interrupt Status word retrieved + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpIntStatusGet( adi_adrv903x_Device_t* const device, + adi_adrv903x_GpIntMask_t* const gpIntStatus); + +/** + * \brief Clears the General Purpose (GP) Interrupt status bits selected in the gpIntClear word. + * + * Note: The only status bits that can be cleared with this function are those from interrupt + * sources that are Pulse triggered. Those status bits that are Level triggered must be cleared + * in the sub-system in which the interrupt originated. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] gpIntClear Pointer to data structure containing GP Interrupt Clear word selecting the + * status bits to clear. User can pass NULL if they want to clear all status bits. + * Otherwise, a structure can be passed here that manually selects which status bits + * to clear while leaving the others untouched. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpIntStatusClear( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntMask_t* const gpIntClear); + +/** + * \brief Sets the General Purpose (GP) Int Type(Category) for all interrupt sources. + * This function uses a bitmask word to select the Type: Pulse/Edge triggered (default) vs. Level Triggered. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] gpIntStickyBitMask Pointer to data structure containing GP Interrupt word to set interrupt + * source types. Each bit in the word selects the type for the associated interrupt source: + * 0 = Pulse/Edge triggered (default), 1 = Level Triggered + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpIntStickyBitMaskSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntMask_t* const gpIntStickyBitMask); +/** + * \brief Retrieves the General Purpose (GP) Int Type(Category) for all interrupt sources. + * This function uses a bitmask word to select the Type: Pulse/Edge triggered (default) vs. Level Triggered. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[out] gpIntStickyBitMask Pointer to data structure to contain retrieved GP Interrupt Type word. + * Each bit in the word selects the type for the associated interrupt source: + * 0 = Pulse/Edge triggered (default), 1 = Level Triggered + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpIntStickyBitMaskGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpIntMask_t* const gpIntStickyBitMask); + +/** + * \brief Configures Hysteresis for a given Pin + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] pinName Pin to Configure + * \param[in] enable Enable Flag + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioHysteresisSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioDigitalPin_e pinName, + const uint32_t enable); + +/** + * \brief Gets Hysteresis Status for a given Pin + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] pinName Pin to Configure + * \param[out] enable Enable Flag + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioHysteresisGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioDigitalPin_e pinName, + uint32_t* const enable); + +/** + * \brief Sets Drive Strength Status for a given Pin + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] pinName Pin to Configure + * \param[in] driveStrength Drive Strength State + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioDriveStrengthSet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioDigitalPin_e pinName, + const adi_adrv903x_CmosPadDrvStr_e driveStrength); + + +/** + * \brief Gets Drive Strength Status for a given Pin + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] pinName Pin to Configure + * \param[out] driveStrength Drive Strength State + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioDriveStrengthGet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioDigitalPin_e pinName, + adi_adrv903x_CmosPadDrvStr_e* const driveStrength); + +#endif /* _ADI_ADRV903X_GPIO_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_gpio_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_gpio_types.h new file mode 100644 index 0000000000000..8c1d633eb1e96 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_gpio_types.h @@ -0,0 +1,1021 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adi_adrv903x_gpio_types.h + * \brief Contains functions to allow control of the General Purpose IO functions on the ADRV903X device + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_GPIO_TYPES_H_ +#define _ADI_ADRV903X_GPIO_TYPES_H_ + +#include "adi_library_types.h" + +#define ADI_ADRV903X_GPIO_COUNT 24U +#define ADI_ADRV903X_GPIO_ANALOG_COUNT 16U + + +#define ADI_ADRV903X_GPINT_MASK_LOWER_FRAMER_IRQ_0 (uint64_t)(0x0000000000000001ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_FRAMER_IRQ_1 (uint64_t)(0x0000000000000002ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_FRAMER_IRQ_2 (uint64_t)(0x0000000000000004ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_FRAMER_IRQ_3 (uint64_t)(0x0000000000000008ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_FRAMER_IRQ_4 (uint64_t)(0x0000000000000010ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_FRAMER_IRQ_5 (uint64_t)(0x0000000000000020ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_FRAMER_IRQ_6 (uint64_t)(0x0000000000000040ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_FRAMER_IRQ_7 (uint64_t)(0x0000000000000080ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_FRAMER_IRQ_8 (uint64_t)(0x0000000000000100ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_FRAMER_IRQ_9 (uint64_t)(0x0000000000000200ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_DEFRAMER_IRQ_0 (uint64_t)(0x0000000000000400ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_DEFRAMER_IRQ_1 (uint64_t)(0x0000000000000800ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_DEFRAMER_IRQ_2 (uint64_t)(0x0000000000001000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_DEFRAMER_IRQ_3 (uint64_t)(0x0000000000002000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_DEFRAMER_IRQ_4 (uint64_t)(0x0000000000004000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_DEFRAMER_IRQ_5 (uint64_t)(0x0000000000008000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_DEFRAMER_IRQ_6 (uint64_t)(0x0000000000010000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_DEFRAMER_IRQ_7 (uint64_t)(0x0000000000020000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_DEFRAMER_IRQ_8 (uint64_t)(0x0000000000040000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_DEFRAMER_IRQ_9 (uint64_t)(0x0000000000080000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_DEFRAMER_IRQ_10 (uint64_t)(0x0000000000100000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_DEFRAMER_IRQ_11 (uint64_t)(0x0000000000200000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_RX0_STREAM_ERROR (uint64_t)(0x0000000000400000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_RX1_STREAM_ERROR (uint64_t)(0x0000000000800000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_RX2_STREAM_ERROR (uint64_t)(0x0000000001000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_RX3_STREAM_ERROR (uint64_t)(0x0000000002000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_RX4_STREAM_ERROR (uint64_t)(0x0000000004000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_RX5_STREAM_ERROR (uint64_t)(0x0000000008000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_RX6_STREAM_ERROR (uint64_t)(0x0000000010000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_RX7_STREAM_ERROR (uint64_t)(0x0000000020000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_TX0_STREAM_ERROR (uint64_t)(0x0000000040000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_TX1_STREAM_ERROR (uint64_t)(0x0000000080000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_TX2_STREAM_ERROR (uint64_t)(0x0000000100000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_TX3_STREAM_ERROR (uint64_t)(0x0000000200000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_TX4_STREAM_ERROR (uint64_t)(0x0000000400000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_TX5_STREAM_ERROR (uint64_t)(0x0000000800000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_TX6_STREAM_ERROR (uint64_t)(0x0000001000000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_TX7_STREAM_ERROR (uint64_t)(0x0000002000000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_ORX0_STREAM_ERROR (uint64_t)(0x0000004000000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_ORX1_STREAM_ERROR (uint64_t)(0x0000008000000000ULL) +#define ADI_ADRV903X_GPINT_MASK_LOWER_CORE_STREAM_ERROR (uint64_t)(0x0000010000000000ULL) + +#define ADI_ADRV903X_GPINT_MASK_UPPER_ARM1_MEMORY_ECC_ERROR (uint64_t)(0x0000000000000001ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_ARM1_SYSTEM_ERROR (uint64_t)(0x0000000000000002ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_ARM1_CALIBRATION_ERROR (uint64_t)(0x0000000000000004ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_ARM1_WATCHDOG_TIMEOUT (uint64_t)(0x0000000000000008ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_ARM1_FORCE_GP_INTERRUPT (uint64_t)(0x0000000000000010ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_ARM0_MEMORY_ECC_ERROR (uint64_t)(0x0000000000000020ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_ARM0_SYSTEM_ERROR (uint64_t)(0x0000000000000040ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_ARM0_CALIBRATION_ERROR (uint64_t)(0x0000000000000080ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_ARM0_WATCHDOG_TIMEOUT (uint64_t)(0x0000000000000100ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_ARM0_FORCE_GP_INTERRUPT (uint64_t)(0x0000000000000200ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX0_POWER_ERROR (uint64_t)(0x0000000000000400ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX0_SRD_ERROR (uint64_t)(0x0000000000000800ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX1_POWER_ERROR (uint64_t)(0x0000000000001000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX1_SRD_ERROR (uint64_t)(0x0000000000002000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX2_POWER_ERROR (uint64_t)(0x0000000000004000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX2_SRD_ERROR (uint64_t)(0x0000000000008000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX3_POWER_ERROR (uint64_t)(0x0000000000010000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX3_SRD_ERROR (uint64_t)(0x0000000000020000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX4_POWER_ERROR (uint64_t)(0x0000000000040000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX4_SRD_ERROR (uint64_t)(0x0000000000080000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX5_POWER_ERROR (uint64_t)(0x0000000000100000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX5_SRD_ERROR (uint64_t)(0x0000000000200000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX6_POWER_ERROR (uint64_t)(0x0000000000400000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX6_SRD_ERROR (uint64_t)(0x0000000000800000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX7_POWER_ERROR (uint64_t)(0x0000000001000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_PA_PROTECTION_TX7_SRD_ERROR (uint64_t)(0x0000000002000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_SERDES_PLL_UNLOCK (uint64_t)(0x0000000004000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_CLKPLL_OVR_RANGE (uint64_t)(0x0000000008000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_RFPLL1_CP_OVR_RANGE (uint64_t)(0x0000000010000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_RFPLL0_CP_OVR_RANGE (uint64_t)(0x0000000020000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_CLKPLL_UNLOCK (uint64_t)(0x0000000040000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_RFPLL1_UNLOCK (uint64_t)(0x0000000080000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_RFPLL0_UNLOCK (uint64_t)(0x0000000100000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_SPI_AHB_ERROR (uint64_t)(0x0000000200000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_AUX_SPI_AHB_ERROR (uint64_t)(0x0000000400000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_SPI_CLK_EFUSE_READ_ABORT (uint64_t)(0x0000000800000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_AUX_SPI_ABORT (uint64_t)(0x0000001000000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_SPI_ABORT (uint64_t)(0x0000002000000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_AUX_SPI_CORE_ERROR (uint64_t)(0x0000004000000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_ERROR_SPI_PAGING (uint64_t)(0x0000008000000000ULL) +#define ADI_ADRV903X_GPINT_MASK_UPPER_ERROR_AUX_SPI_PAGING (uint64_t)(0x0000010000000000ULL) + +#define ADI_ADRV903X_GPINT_MASK_UPPER_WEST_RFPLL_CP_OVR_RANGE (uint64_t)(0x0000000010000000ULL) /*!< Deprecated. Use ADI_ADRV903X_GPINT_MASK_UPPER_RFPLL1_CP_OVR_RANGE instead */ +#define ADI_ADRV903X_GPINT_MASK_UPPER_EAST_RFPLL_CP_OVR_RANGE (uint64_t)(0x0000000020000000ULL) /*!< Deprecated. Use ADI_ADRV903X_GPINT_MASK_UPPER_RFPLL0_CP_OVR_RANGE instead */ +#define ADI_ADRV903X_GPINT_MASK_UPPER_WEST_RFPLL_UNLOCK (uint64_t)(0x0000000080000000ULL) /*!< Deprecated. Use ADI_ADRV903X_GPINT_MASK_UPPER_RFPLL1_UNLOCK instead */ +#define ADI_ADRV903X_GPINT_MASK_UPPER_EAST_RFPLL_UNLOCK (uint64_t)(0x0000000100000000ULL) /*!< Deprecated. Use ADI_ADRV903X_GPINT_MASK_UPPER_RFPLL0_UNLOCK instead */ + + +/**************************************************************************** + * Digital and Analog GPIO related types + **************************************************************************** + */ + +/** + * \brief Enum to select desired GPIO pin used by the API + */ +typedef enum adi_adrv903x_GpioPinSel +{ + ADI_ADRV903X_GPIO_00 = 0U, /*!< Select GPIO_00*/ + ADI_ADRV903X_GPIO_01, /*!< Select GPIO_01*/ + ADI_ADRV903X_GPIO_02, /*!< Select GPIO_02*/ + ADI_ADRV903X_GPIO_03, /*!< Select GPIO_03*/ + ADI_ADRV903X_GPIO_04, /*!< Select GPIO_04*/ + ADI_ADRV903X_GPIO_05, /*!< Select GPIO_05*/ + ADI_ADRV903X_GPIO_06, /*!< Select GPIO_06*/ + ADI_ADRV903X_GPIO_07, /*!< Select GPIO_07*/ + ADI_ADRV903X_GPIO_08, /*!< Select GPIO_08*/ + ADI_ADRV903X_GPIO_09, /*!< Select GPIO_09*/ + ADI_ADRV903X_GPIO_10, /*!< Select GPIO_10*/ + ADI_ADRV903X_GPIO_11, /*!< Select GPIO_11*/ + ADI_ADRV903X_GPIO_12, /*!< Select GPIO_12*/ + ADI_ADRV903X_GPIO_13, /*!< Select GPIO_13*/ + ADI_ADRV903X_GPIO_14, /*!< Select GPIO_14*/ + ADI_ADRV903X_GPIO_15, /*!< Select GPIO_15*/ + ADI_ADRV903X_GPIO_16, /*!< Select GPIO_16*/ + ADI_ADRV903X_GPIO_17, /*!< Select GPIO_17*/ + ADI_ADRV903X_GPIO_18, /*!< Select GPIO_18*/ + ADI_ADRV903X_GPIO_19, /*!< Select GPIO_19*/ + ADI_ADRV903X_GPIO_20, /*!< Select GPIO_20*/ + ADI_ADRV903X_GPIO_21, /*!< Select GPIO_21*/ + ADI_ADRV903X_GPIO_22, /*!< Select GPIO_22*/ + ADI_ADRV903X_GPIO_23, /*!< Select GPIO_23*/ + ADI_ADRV903X_GPIO_INVALID /*!< Invalid GPIO*/ +} adi_adrv903x_GpioPinSel_e; + +/** +* \brief Enum to select desired Analog GPIO pins used by the API +*/ +typedef enum adi_adrv903x_GpioAnaPinSel +{ + ADI_ADRV903X_GPIO_ANA_00 = 0U, /*!< Select GPIO_ANA_00*/ + ADI_ADRV903X_GPIO_ANA_01, /*!< Select GPIO_ANA_01*/ + ADI_ADRV903X_GPIO_ANA_02, /*!< Select GPIO_ANA_02*/ + ADI_ADRV903X_GPIO_ANA_03, /*!< Select GPIO_ANA_03*/ + ADI_ADRV903X_GPIO_ANA_04, /*!< Select GPIO_ANA_04*/ + ADI_ADRV903X_GPIO_ANA_05, /*!< Select GPIO_ANA_05*/ + ADI_ADRV903X_GPIO_ANA_06, /*!< Select GPIO_ANA_06*/ + ADI_ADRV903X_GPIO_ANA_07, /*!< Select GPIO_ANA_07*/ + ADI_ADRV903X_GPIO_ANA_08, /*!< Select GPIO_ANA_08*/ + ADI_ADRV903X_GPIO_ANA_09, /*!< Select GPIO_ANA_09*/ + ADI_ADRV903X_GPIO_ANA_10, /*!< Select GPIO_ANA_10*/ + ADI_ADRV903X_GPIO_ANA_11, /*!< Select GPIO_ANA_11*/ + ADI_ADRV903X_GPIO_ANA_12, /*!< Select GPIO_ANA_12*/ + ADI_ADRV903X_GPIO_ANA_13, /*!< Select GPIO_ANA_13*/ + ADI_ADRV903X_GPIO_ANA_14, /*!< Select GPIO_ANA_14*/ + ADI_ADRV903X_GPIO_ANA_15, /*!< Select GPIO_ANA_15*/ + ADI_ADRV903X_GPIO_ANA_INVALID /*!< Invalid Analog Gpio*/ +} adi_adrv903x_GpioAnaPinSel_e; + +/** + * \brief Enum for ADRV903X GPIO Signals. Must Map to Shared Resource Manager Feature + */ +typedef enum adi_adrv903x_GpioSignal +{ + ADI_ADRV903X_GPIO_SIGNAL_UNUSED = 0U, /*!< Select UNUSED signal */ + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_SDIO, /*!< Aux SPI port signal: SDIO */ + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_SDO, /*!< Aux SPI port signal: SDO */ + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_CLK, /*!< Aux SPI port signal: CLK */ + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_CSB, /*!< Aux SPI port signal: CSB */ + ADI_ADRV903X_GPIO_SIGNAL_UART_PADRXSIN, /*!< Select UART Receive Input signal */ + ADI_ADRV903X_GPIO_SIGNAL_UART_PADCTS, /*!< Select UART Clear to Send Flow control signal */ + ADI_ADRV903X_GPIO_SIGNAL_UART_PADRTSOUT, /*!< Select UART Request to Send Flow control signal */ + ADI_ADRV903X_GPIO_SIGNAL_UART_PADTXSOUT, /*!< Select UART Transmit Output signal */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_0, /*!< GPIO Manual Output (Drive) Mode: GPIO 00 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_1, /*!< GPIO Manual Output (Drive) Mode: GPIO 01 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_2, /*!< GPIO Manual Output (Drive) Mode: GPIO 02 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_3, /*!< GPIO Manual Output (Drive) Mode: GPIO 03 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_4, /*!< GPIO Manual Output (Drive) Mode: GPIO 04 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_5, /*!< GPIO Manual Output (Drive) Mode: GPIO 05 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_6, /*!< GPIO Manual Output (Drive) Mode: GPIO 06 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_7, /*!< GPIO Manual Output (Drive) Mode: GPIO 07 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_8, /*!< GPIO Manual Output (Drive) Mode: GPIO 08 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_9, /*!< GPIO Manual Output (Drive) Mode: GPIO 09 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_10, /*!< GPIO Manual Output (Drive) Mode: GPIO 10 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_11, /*!< GPIO Manual Output (Drive) Mode: GPIO 11 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_12, /*!< GPIO Manual Output (Drive) Mode: GPIO 12 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_13, /*!< GPIO Manual Output (Drive) Mode: GPIO 13 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_14, /*!< GPIO Manual Output (Drive) Mode: GPIO 14 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_15, /*!< GPIO Manual Output (Drive) Mode: GPIO 15 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_16, /*!< GPIO Manual Output (Drive) Mode: GPIO 16 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_17, /*!< GPIO Manual Output (Drive) Mode: GPIO 17 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_18, /*!< GPIO Manual Output (Drive) Mode: GPIO 18 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_19, /*!< GPIO Manual Output (Drive) Mode: GPIO 19 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_20, /*!< GPIO Manual Output (Drive) Mode: GPIO 20 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_21, /*!< GPIO Manual Output (Drive) Mode: GPIO 21 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_22, /*!< GPIO Manual Output (Drive) Mode: GPIO 22 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_23, /*!< GPIO Manual Output (Drive) Mode: GPIO 23 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_0, /*!< GPIO Manual Input (Receive) Mode: GPIO 00 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_1, /*!< GPIO Manual Input (Receive) Mode: GPIO 01 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_2, /*!< GPIO Manual Input (Receive) Mode: GPIO 02 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_3, /*!< GPIO Manual Input (Receive) Mode: GPIO 03 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_4, /*!< GPIO Manual Input (Receive) Mode: GPIO 04 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_5, /*!< GPIO Manual Input (Receive) Mode: GPIO 05 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_6, /*!< GPIO Manual Input (Receive) Mode: GPIO 06 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_7, /*!< GPIO Manual Input (Receive) Mode: GPIO 07 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_8, /*!< GPIO Manual Input (Receive) Mode: GPIO 08 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_9, /*!< GPIO Manual Input (Receive) Mode: GPIO 09 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_10, /*!< GPIO Manual Input (Receive) Mode: GPIO 10 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_11, /*!< GPIO Manual Input (Receive) Mode: GPIO 11 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_12, /*!< GPIO Manual Input (Receive) Mode: GPIO 12 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_13, /*!< GPIO Manual Input (Receive) Mode: GPIO 13 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_14, /*!< GPIO Manual Input (Receive) Mode: GPIO 14 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_15, /*!< GPIO Manual Input (Receive) Mode: GPIO 15 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_16, /*!< GPIO Manual Input (Receive) Mode: GPIO 16 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_17, /*!< GPIO Manual Input (Receive) Mode: GPIO 17 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_18, /*!< GPIO Manual Input (Receive) Mode: GPIO 18 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_19, /*!< GPIO Manual Input (Receive) Mode: GPIO 19 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_20, /*!< GPIO Manual Input (Receive) Mode: GPIO 20 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_21, /*!< GPIO Manual Input (Receive) Mode: GPIO 21 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_22, /*!< GPIO Manual Input (Receive) Mode: GPIO 22 */ + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_23, /*!< GPIO Manual Input (Receive) Mode: GPIO 23 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_0, /*!< GPIO ARM Output (Drive) Mode: GPIO 00 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_1, /*!< GPIO ARM Output (Drive) Mode: GPIO 01 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_2, /*!< GPIO ARM Output (Drive) Mode: GPIO 02 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_3, /*!< GPIO ARM Output (Drive) Mode: GPIO 03 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_4, /*!< GPIO ARM Output (Drive) Mode: GPIO 04 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_5, /*!< GPIO ARM Output (Drive) Mode: GPIO 05 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_6, /*!< GPIO ARM Output (Drive) Mode: GPIO 06 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_7, /*!< GPIO ARM Output (Drive) Mode: GPIO 07 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_8, /*!< GPIO ARM Output (Drive) Mode: GPIO 08 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_9, /*!< GPIO ARM Output (Drive) Mode: GPIO 09 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_10, /*!< GPIO ARM Output (Drive) Mode: GPIO 10 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_11, /*!< GPIO ARM Output (Drive) Mode: GPIO 11 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_12, /*!< GPIO ARM Output (Drive) Mode: GPIO 12 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_13, /*!< GPIO ARM Output (Drive) Mode: GPIO 13 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_14, /*!< GPIO ARM Output (Drive) Mode: GPIO 14 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_15, /*!< GPIO ARM Output (Drive) Mode: GPIO 15 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_16, /*!< GPIO ARM Output (Drive) Mode: GPIO 16 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_17, /*!< GPIO ARM Output (Drive) Mode: GPIO 17 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_18, /*!< GPIO ARM Output (Drive) Mode: GPIO 18 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_19, /*!< GPIO ARM Output (Drive) Mode: GPIO 19 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_20, /*!< GPIO ARM Output (Drive) Mode: GPIO 20 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_21, /*!< GPIO ARM Output (Drive) Mode: GPIO 21 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_22, /*!< GPIO ARM Output (Drive) Mode: GPIO 22 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_OUTPUT_23, /*!< GPIO ARM Output (Drive) Mode: GPIO 23 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_0, /*!< GPIO ARM Input (Receive) Mode: GPIO 00 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_1, /*!< GPIO ARM Input (Receive) Mode: GPIO 01 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_2, /*!< GPIO ARM Input (Receive) Mode: GPIO 02 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_3, /*!< GPIO ARM Input (Receive) Mode: GPIO 03 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_4, /*!< GPIO ARM Input (Receive) Mode: GPIO 04 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_5, /*!< GPIO ARM Input (Receive) Mode: GPIO 05 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_6, /*!< GPIO ARM Input (Receive) Mode: GPIO 06 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_7, /*!< GPIO ARM Input (Receive) Mode: GPIO 07 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_8, /*!< GPIO ARM Input (Receive) Mode: GPIO 08 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_9, /*!< GPIO ARM Input (Receive) Mode: GPIO 09 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_10, /*!< GPIO ARM Input (Receive) Mode: GPIO 10 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_11, /*!< GPIO ARM Input (Receive) Mode: GPIO 11 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_12, /*!< GPIO ARM Input (Receive) Mode: GPIO 12 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_13, /*!< GPIO ARM Input (Receive) Mode: GPIO 13 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_14, /*!< GPIO ARM Input (Receive) Mode: GPIO 14 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_15, /*!< GPIO ARM Input (Receive) Mode: GPIO 15 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_16, /*!< GPIO ARM Input (Receive) Mode: GPIO 16 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_17, /*!< GPIO ARM Input (Receive) Mode: GPIO 17 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_18, /*!< GPIO ARM Input (Receive) Mode: GPIO 18 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_19, /*!< GPIO ARM Input (Receive) Mode: GPIO 19 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_20, /*!< GPIO ARM Input (Receive) Mode: GPIO 20 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_21, /*!< GPIO ARM Input (Receive) Mode: GPIO 21 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_22, /*!< GPIO ARM Input (Receive) Mode: GPIO 22 */ + ADI_ADRV903X_GPIO_SIGNAL_ARM_INPUT_23, /*!< GPIO ARM Input (Receive) Mode: GPIO 23 */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_FINE_BAND_OUT_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_CALBITS_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_PLL_LOCKED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_OVERRANGE_LOW_FLAG, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_CP_OVERRANGE_HIGH_FLAG, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_COMP_OUT, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_CAL_IN_PROGRESS, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_FREQ_COARSE_BAND_OUT_8, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_8, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_9, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_ALC_WORD_OUT_10, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_8, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_9, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_10, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_VCO_TCIDAC_11, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CLKPLL_SPARE_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_FINE_BAND_OUT_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_CALBITS_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_PLL_LOCKED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_OVERRANGE_LOW_FLAG, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_CP_OVERRANGE_HIGH_FLAG, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_COMP_OUT, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_CAL_IN_PROGRESS, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_FREQ_COARSE_BAND_OUT_8, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_8, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_9, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_ALC_WORD_OUT_10, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_8, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_9, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_10, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_VCO_TCIDAC_11, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL0_SPARE_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_FINE_BAND_OUT_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_CALBITS_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_PLL_LOCKED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_OVERRANGE_LOW_FLAG, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_CP_OVERRANGE_HIGH_FLAG, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_COMP_OUT, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_CAL_IN_PROGRESS, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_FREQ_COARSE_BAND_OUT_8, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_8, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_9, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_ALC_WORD_OUT_10, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_8, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_9, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_10, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_VCO_TCIDAC_11, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFPLL1_SPARE_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_N_DES_CH_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTAG_DETECTOR_P_DES_CH_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_P_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_P_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_P_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_N_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_N_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SYNC_JTAG_DETECTOR_N_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JRX_READ_DATA_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_OUT_MUX_JTX_READ_DATA_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_UPDATE_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_UPDATE_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_UPDATE_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_CONTROL_UPDATE_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MCS_CLK_IND_CORE, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_REF_CLK, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_SPI_REG_ARM0_ERROR, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_SPI_REG_ARM1_ERROR, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_DIG_POWERGOOD, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MASTER_BIAS_CLK, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MBIAS_IGEN_PD_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MBIAS_IGEN_PD_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MBIAS_COMP_OUT_ANA_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MBIAS_COMP_OUT_ANA_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_SPI_REG_MBIAS_IGEN_PTATR_TRIM_DONE_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_SPI_REG_MBIAS_IGEN_PTATR_TRIM_DONE_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_8, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_9, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_10, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JRX_IRQ_11, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_8, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JTX_IRQ_9, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_NEW_PHASE_TOGGLE, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_JESD_MCS_CLK_IND, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_SERDES_PLL_PLL_LOCKED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_SERDES_PLL_VCO_COMP_OUT, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_POWER_ON_RESET_N, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_8, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_9, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_10, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_11, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_12, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_13, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_14, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MISR_SIGNATURE_15, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_4, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_5, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_6, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RX_SPI_SOURCE_7, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_SLICER_POSITION_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MCS_CLK_IND_RX, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFDC_UPDATE, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_SLICER_OVERFLOW, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_SEC_HIGH, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_SEC_HIGH_COUNTER_EXCEEDED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_TIA_VALID, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RXFE_VALID, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RSSI_DECPWR_READY, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_PEAK_COUNT_EXCEEDED_QEC_ANA, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_PEAK_COUNT_EXCEEDED_QEC_DIG, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RSSI_SYMBOL_READY, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RXON, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_ADC_OVERLOAD_RESET_ADC, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFDC_STATE_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFDC_STATE_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFDC_STATE_2, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFDC_STATE_3, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFDC_UPDATE_COUNTER_EXPIRED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFDC_MEASURE, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFDC_CAL_DONE, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_RFDC_MEASURE_COUNTER_EXPIRED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_LOW_INT1_COUNTER_EXCEEDED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_LOW_INT0_COUNTER_EXCEEDED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_DIG_GAIN_SAT, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_INT1_LOW, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_INT0_LOW, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_SL_STATE_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_SL_STATE_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_GAINUPDATE_COUNTER_EXPIRED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_SL_LOW_TH_EXCEEDED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_SL_HIGH_TH_EXCEEDED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_LLB_COUNTER_EXCEEDED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_LOW, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_ADCOVRG_HIGH, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_GT_GAIN_CHANGE, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_ULB_COUNTER_EXCEEDED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_LOW_COUNTER_EXCEEDED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_OVRG_HIGH_COUNTER_EXCEEDED, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_BAND_PEAK_COUNT_EXCEEDED_LOW_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_BAND_PEAK_COUNT_EXCEEDED_LOW_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_BAND_PEAK_COUNT_EXCEEDED_HIGH_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_BAND_PEAK_COUNT_EXCEEDED_HIGH_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_BAND_DECPWR_READY_TOGGLE_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_BAND_DECPWR_READY_TOGGLE_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_BAND_DECPWR_READY_0, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_BAND_DECPWR_READY_1, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MCS_CLK_IND_TX, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_PA_PROT_SRERROR, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_PA_PROT_PPERROR_OR_APERROR, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_ATTEN_RAMP_UP_PROT, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_ATTEN_RAMP_DOWN_PROT, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_ATTEN_TDD_RAMP_DOWN, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_ATTEN_TDD_RAMP_UP, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_ATTEN_LATCH_EN, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_DTX_POWER_UP_TRIGGER, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_DTX_POWER_DOWN_TRIGGER, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_TX_GAIN_CHANGE, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_TX_POWER_READY, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_PA_PROT_SRD_IRQ, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_TX_TSSI_DUC0_READY, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_ADC_SAMPLE_OVR, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_MCS_CLK_IND_ORX, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_ORX_ON, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_DECPWR_READY, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_ANY_ADC_SAMPLE_OVR, /*!< Monitor Out */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_0, /*!< Stream Processor Trigger for GPIO 0 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_1, /*!< Stream Processor Trigger for GPIO 1 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_2, /*!< Stream Processor Trigger for GPIO 2 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_3, /*!< Stream Processor Trigger for GPIO 3 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_4, /*!< Stream Processor Trigger for GPIO 4 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_5, /*!< Stream Processor Trigger for GPIO 5 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_6, /*!< Stream Processor Trigger for GPIO 6 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_7, /*!< Stream Processor Trigger for GPIO 7 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_8, /*!< Stream Processor Trigger for GPIO 8 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_9, /*!< Stream Processor Trigger for GPIO 9 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_10, /*!< Stream Processor Trigger for GPIO 10 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_11, /*!< Stream Processor Trigger for GPIO 11 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_12, /*!< Stream Processor Trigger for GPIO 12 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_13, /*!< Stream Processor Trigger for GPIO 13 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_14, /*!< Stream Processor Trigger for GPIO 14 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_15, /*!< Stream Processor Trigger for GPIO 15 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_16, /*!< Stream Processor Trigger for GPIO 16 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_17, /*!< Stream Processor Trigger for GPIO 17 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_18, /*!< Stream Processor Trigger for GPIO 18 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_19, /*!< Stream Processor Trigger for GPIO 19 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_20, /*!< Stream Processor Trigger for GPIO 20 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_21, /*!< Stream Processor Trigger for GPIO 21 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_22, /*!< Stream Processor Trigger for GPIO 22 */ + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_23, /*!< Stream Processor Trigger for GPIO 23 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PEB, /*!< PPI PEB */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_CLK, /*!< PPI CLK */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_0, /*!< PPI PDI 0 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_1, /*!< PPI PDI 1 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_2, /*!< PPI PDI 2 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_3, /*!< PPI PDI 3 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_4, /*!< PPI PDI 4 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_5, /*!< PPI PDI 5 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_6, /*!< PPI PDI 6 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_7, /*!< PPI PDI 7 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_8, /*!< PPI PDI 8 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_9, /*!< PPI PDI 9 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_10, /*!< PPI PDI 10 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_11, /*!< PPI PDI 11 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_12, /*!< PPI PDI 12 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_13, /*!< PPI PDI 13 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_14, /*!< PPI PDI 14 */ + ADI_ADRV903X_GPIO_SIGNAL_PPI16_PDI_15, /*!< PPI PDI 15 */ + ADI_ADRV903X_GPIO_SIGNAL_ADC_TEST_GEN_ENABLE, /*!< Rx Channel(s) Input ADC Test Gen Enable */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_GAIN_CHANGE, /*!< Rx Channel(s) Input AGC Gain Change */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_DEC_GAIN, /*!< Rx Channel(s) Input AGC Decrement Gain */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_INC_GAIN, /*!< Rx Channel(s) Input AGC Increment Gain */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_SLOWLOOP_FREEZE_ENABLE, /*!< Rx Channel(s) Input AGC Slowloop Freeze Enable */ + ADI_ADRV903X_GPIO_SIGNAL_AGC_MANUAL_GAIN_LOCK, /*!< Rx Channel(s) Input AGC Manual Gain Lock */ + ADI_ADRV903X_GPIO_SIGNAL_SELECT_S1, /*!< Tx Channel(s) Input Select S1 for Tx atten signal */ + ADI_ADRV903X_GPIO_SIGNAL_DTX_FORCE_PIN, /*!< Tx Channel(s) Input DTX Force Pin */ + ADI_ADRV903X_GPIO_SIGNAL_TX_ATTEN_UPD_GPIO, /*!< Tx Channel(s) Input Atten Update */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_0, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 00 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_1, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 01 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_2, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 02 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_3, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 03 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_4, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 04 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_5, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 05 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_6, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 06 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_7, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 07 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_8, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 08 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_9, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 09 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_10, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 10 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_11, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 11 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_12, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 12 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_13, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 13 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_14, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 14 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_15, /*!< GPIO Analog Manual Output (Drive) Mode: Analog GPIO 15 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_0, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 00 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_1, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 01 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_2, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 02 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_3, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 03 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_4, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 04 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_5, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 05 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_6, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 06 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_7, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 07 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_8, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 08 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_9, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 09 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_10, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 10 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_11, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 11 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_12, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 12 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_13, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 13 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_14, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 14 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_15, /*!< GPIO Analog Manual Input (Receive) Mode: Analog GPIO 15 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_0, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 00 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_1, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 01 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_2, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 02 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_3, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 03 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_4, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 04 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_5, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 05 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_6, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 06 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_7, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 07 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_8, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 08 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_9, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 09 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_10, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 10 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_11, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 11 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_12, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 12 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_13, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 13 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_14, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 14 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_OUTPUT_15, /*!< GPIO Analog ARM Output (Drive) Mode: Analog GPIO 15 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_0, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 00 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_1, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 01 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_2, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 02 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_3, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 03 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_4, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 04 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_5, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 05 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_6, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 06 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_7, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 07 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_8, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 08 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_9, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 09 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_10, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 10 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_11, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 11 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_12, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 12 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_13, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 13 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_14, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 14 */ + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_ARM_INPUT_15, /*!< GPIO Analog ARM Input (Receive) Mode: Analog GPIO 15 */ + ADI_ADRV903X_GPIO_SIGNAL_RX0_EXT_CONTROL_0, /*!< Analog GPIO output signal for RX0 Gain Control Word Bit0 */ + ADI_ADRV903X_GPIO_SIGNAL_RX0_EXT_CONTROL_1, /*!< Analog GPIO output signal for RX0 Gain Control Word Bit1 */ + ADI_ADRV903X_GPIO_SIGNAL_RX1_EXT_CONTROL_0, /*!< Analog GPIO output signal for RX1 Gain Control Word Bit0 */ + ADI_ADRV903X_GPIO_SIGNAL_RX1_EXT_CONTROL_1, /*!< Analog GPIO output signal for RX1 Gain Control Word Bit1 */ + ADI_ADRV903X_GPIO_SIGNAL_RX2_EXT_CONTROL_0, /*!< Analog GPIO output signal for RX2 Gain Control Word Bit0 */ + ADI_ADRV903X_GPIO_SIGNAL_RX2_EXT_CONTROL_1, /*!< Analog GPIO output signal for RX2 Gain Control Word Bit1 */ + ADI_ADRV903X_GPIO_SIGNAL_RX3_EXT_CONTROL_0, /*!< Analog GPIO output signal for RX3 Gain Control Word Bit0 */ + ADI_ADRV903X_GPIO_SIGNAL_RX3_EXT_CONTROL_1, /*!< Analog GPIO output signal for RX3 Gain Control Word Bit1 */ + ADI_ADRV903X_GPIO_SIGNAL_RX4_EXT_CONTROL_0, /*!< Analog GPIO output signal for RX4 Gain Control Word Bit0 */ + ADI_ADRV903X_GPIO_SIGNAL_RX4_EXT_CONTROL_1, /*!< Analog GPIO output signal for RX4 Gain Control Word Bit1 */ + ADI_ADRV903X_GPIO_SIGNAL_RX5_EXT_CONTROL_0, /*!< Analog GPIO output signal for RX5 Gain Control Word Bit0 */ + ADI_ADRV903X_GPIO_SIGNAL_RX5_EXT_CONTROL_1, /*!< Analog GPIO output signal for RX5 Gain Control Word Bit1 */ + ADI_ADRV903X_GPIO_SIGNAL_RX6_EXT_CONTROL_0, /*!< Analog GPIO output signal for RX6 Gain Control Word Bit0 */ + ADI_ADRV903X_GPIO_SIGNAL_RX6_EXT_CONTROL_1, /*!< Analog GPIO output signal for RX6 Gain Control Word Bit1 */ + ADI_ADRV903X_GPIO_SIGNAL_RX7_EXT_CONTROL_0, /*!< Analog GPIO output signal for RX7 Gain Control Word Bit0 */ + ADI_ADRV903X_GPIO_SIGNAL_RX7_EXT_CONTROL_1, /*!< Analog GPIO output signal for RX7 Gain Control Word Bit1 */ + ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_0, /*!< Dual Band Control Rx0 Band 0 Bit 0. Only for Analog GPIO 0 */ + ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_1, /*!< Dual Band Control Rx0 Band 0 Bit 1. Only for Analog GPIO 1 */ + ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND1_0, /*!< Dual Band Control Rx0 Band 1 Bit 0. Only for Analog GPIO 2 */ + ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND1_1, /*!< Dual Band Control Rx0 Band 1 Bit 1. Only for Analog GPIO 3 */ + ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND0_0, /*!< Dual Band Control Rx1 Band 0 Bit 0. Only for Analog GPIO 4 */ + ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND0_1, /*!< Dual Band Control Rx1 Band 0 Bit 1. Only for Analog GPIO 5 */ + ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND1_0, /*!< Dual Band Control Rx1 Band 1 Bit 0. Only for Analog GPIO 6 */ + ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND1_1, /*!< Dual Band Control Rx1 Band 1 Bit 1. Only for Analog GPIO 7 */ + ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND0_0, /*!< Dual Band Control Rx4 Band 0 Bit 0. Only for Analog GPIO 8 */ + ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND0_1, /*!< Dual Band Control Rx4 Band 0 Bit 1. Only for Analog GPIO 9 */ + ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND1_0, /*!< Dual Band Control Rx4 Band 1 Bit 0. Only for Analog GPIO 10 */ + ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND1_1, /*!< Dual Band Control Rx4 Band 1 Bit 1. Only for Analog GPIO 11 */ + ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND0_0, /*!< Dual Band Control Rx5 Band 0 Bit 0. Only for Analog GPIO 12 */ + ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND0_1, /*!< Dual Band Control Rx5 Band 0 Bit 1. Only for Analog GPIO 13 */ + ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND1_0, /*!< Dual Band Control Rx5 Band 1 Bit 0. Only for Analog GPIO 14 */ + ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND1_1, /*!< Dual Band Control Rx5 Band 1 Bit 1. Only for Analog GPIO 15 */ + ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND0_0, /*!< Dual Band Control Rx2 Band 0 Bit 0. Only for Analog GPIO 0 */ + ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND0_1, /*!< Dual Band Control Rx2 Band 0 Bit 1. Only for Analog GPIO 1 */ + ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND1_0, /*!< Dual Band Control Rx2 Band 1 Bit 0. Only for Analog GPIO 2 */ + ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND1_1, /*!< Dual Band Control Rx2 Band 1 Bit 1. Only for Analog GPIO 3 */ + ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND0_0, /*!< Dual Band Control Rx3 Band 0 Bit 0. Only for Analog GPIO 4 */ + ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND0_1, /*!< Dual Band Control Rx3 Band 0 Bit 1. Only for Analog GPIO 5 */ + ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND1_0, /*!< Dual Band Control Rx3 Band 1 Bit 0. Only for Analog GPIO 6 */ + ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND1_1, /*!< Dual Band Control Rx3 Band 1 Bit 1. Only for Analog GPIO 7 */ + ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND0_0, /*!< Dual Band Control Rx6 Band 0 Bit 0. Only for Analog GPIO 8 */ + ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND0_1, /*!< Dual Band Control Rx6 Band 0 Bit 1. Only for Analog GPIO 9 */ + ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND1_0, /*!< Dual Band Control Rx6 Band 1 Bit 0. Only for Analog GPIO 10 */ + ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND1_1, /*!< Dual Band Control Rx6 Band 1 Bit 1. Only for Analog GPIO 11 */ + ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND0_0, /*!< Dual Band Control Rx7 Band 0 Bit 0. Only for Analog GPIO 12 */ + ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND0_1, /*!< Dual Band Control Rx7 Band 0 Bit 1. Only for Analog GPIO 13 */ + ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND1_0, /*!< Dual Band Control Rx7 Band 1 Bit 0. Only for Analog GPIO 14 */ + ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND1_1, /*!< Dual Band Control Rx7 Band 1 Bit 1. Only for Analog GPIO 15 */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_0, /*!< No-op for GPIO 0. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_1, /*!< No-op for GPIO 1. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_2, /*!< No-op for GPIO 2. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_3, /*!< No-op for GPIO 3. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_4, /*!< No-op for GPIO 4. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_5, /*!< No-op for GPIO 5. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_6, /*!< No-op for GPIO 6. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_7, /*!< No-op for GPIO 7. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_8, /*!< No-op for GPIO 8. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_9, /*!< No-op for GPIO 9. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_10, /*!< No-op for GPIO 10. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_11, /*!< No-op for GPIO 11. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_12, /*!< No-op for GPIO 12. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_13, /*!< No-op for GPIO 13. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_14, /*!< No-op for GPIO 14. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_15, /*!< No-op for GPIO 15. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_16, /*!< No-op for GPIO 16. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_17, /*!< No-op for GPIO 17. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_18, /*!< No-op for GPIO 18. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_19, /*!< No-op for GPIO 19. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_20, /*!< No-op for GPIO 20. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_21, /*!< No-op for GPIO 21. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_22, /*!< No-op for GPIO 22. Unconnected to any function in the device, but treated as allocated. */ + ADI_ADRV903X_GPIO_SIGNAL_NOOP_23, /*!< No-op for GPIO 23. Unconnected to any function in the device, but treated as allocated. */ + /***Please add GPIO SIGNALS above this line***/ + ADI_ADRV903X_GPIO_SIGNAL_NUM_SIGNALS, /*!< Total Number of GPIO Signals */ + ADI_ADRV903X_GPIO_SIGNAL_INVALID +} adi_adrv903x_GpioSignal_e; + + +/** +* \brief Data structure to hold a full status of all GPIO configurations, both Digital and Analog +*/ +typedef struct adi_adrv903x_GpioStatus +{ + uint32_t digPinAllocated; /*!< Pinmask containing the Digital GPIOs currently allocated for use */ + adi_adrv903x_GpioSignal_e digSignal[ADI_ADRV903X_GPIO_COUNT]; /*!< Array of all Digital GPIO Signals */ + uint32_t digChMask[ADI_ADRV903X_GPIO_COUNT]; /*!< Array of all Digital GPIO Channel Masks */ + uint32_t anaPinAllocated; /*!< Pinmask containing the Analog GPIOs currently allocated for use */ + adi_adrv903x_GpioSignal_e anaSignal[ADI_ADRV903X_GPIO_ANALOG_COUNT]; /*!< Array of all Analog GPIO Signals */ + uint32_t anaChMask[ADI_ADRV903X_GPIO_ANALOG_COUNT]; /*!< Array of all Analog GPIO Channel Masks */ +} adi_adrv903x_GpioStatus_t; + +/**************************************************************************** + * GP Int (General Purpose Interrupt) related types + **************************************************************************** + */ + +/** + * \brief Enum for selecting the GP_INT channel(s) + */ +typedef enum adi_adrv903x_GpIntPinSelect +{ + ADI_ADRV903X_GPINT0, /*!< GP Interrupt Pin0 select */ + ADI_ADRV903X_GPINT1, /*!< GP Interrupt Pin1 select */ + ADI_ADRV903X_GPINTALL /*!< All GP Interrupt pins */ +} adi_adrv903x_GpIntPinSelect_e; + +/** + * \brief Data structure to hold a 96bit GP Interrupt Word. Interrupts are split into 48bit Lower/Upper Words. + * The following table specifies each GP Interrupt source and how it maps to the adi_adrv903x_GpIntWord structure: + * + * | Full(96bit)
Word Bit[n] | GP Interrupt
Mask Bit | Word | Half(48bit)
Word Bit[n] | Byte | Byte
Byte Bit[n] | + * |:--------------------------:|:-----------------------------:|:-----:|:--------------------------:|:-----:|:-------------------:| + * | 0 | FRAMER_IRQ_0 | Lower | 0 | 0 | 0 | + * | 1 | FRAMER_IRQ_1 | Lower | 1 | 0 | 1 | + * | 2 | FRAMER_IRQ_2 | Lower | 2 | 0 | 2 | + * | 3 | FRAMER_IRQ_3 | Lower | 3 | 0 | 3 | + * | 4 | FRAMER_IRQ_4 | Lower | 4 | 0 | 4 | + * | 5 | FRAMER_IRQ_5 | Lower | 5 | 0 | 5 | + * | 6 | FRAMER_IRQ_6 | Lower | 6 | 0 | 6 | + * | 7 | FRAMER_IRQ_7 | Lower | 7 | 0 | 7 | + * | 8 | FRAMER_IRQ_8 | Lower | 8 | 1 | 0 | + * | 9 | FRAMER_IRQ_9 | Lower | 9 | 1 | 1 | + * | 10 | DEFRAMER_IRQ_0 | Lower | 10 | 1 | 2 | + * | 11 | DEFRAMER_IRQ_1 | Lower | 11 | 1 | 3 | + * | 12 | DEFRAMER_IRQ_2 | Lower | 12 | 1 | 4 | + * | 13 | DEFRAMER_IRQ_3 | Lower | 13 | 1 | 5 | + * | 14 | DEFRAMER_IRQ_4 | Lower | 14 | 1 | 6 | + * | 15 | DEFRAMER_IRQ_5 | Lower | 15 | 1 | 7 | + * | 16 | DEFRAMER_IRQ_6 | Lower | 16 | 2 | 0 | + * | 17 | DEFRAMER_IRQ_7 | Lower | 17 | 2 | 1 | + * | 18 | DEFRAMER_IRQ_8 | Lower | 18 | 2 | 2 | + * | 19 | DEFRAMER_IRQ_9 | Lower | 19 | 2 | 3 | + * | 20 | DEFRAMER_IRQ_10 | Lower | 20 | 2 | 4 | + * | 21 | DEFRAMER_IRQ_11 | Lower | 21 | 2 | 5 | + * | 22 | RX0_STREAM_ERROR | Lower | 22 | 2 | 6 | + * | 23 | RX1_STREAM_ERROR | Lower | 23 | 2 | 7 | + * | 24 | RX2_STREAM_ERROR | Lower | 24 | 3 | 0 | + * | 25 | RX3_STREAM_ERROR | Lower | 25 | 3 | 1 | + * | 26 | RX4_STREAM_ERROR | Lower | 26 | 3 | 2 | + * | 27 | RX5_STREAM_ERROR | Lower | 27 | 3 | 3 | + * | 28 | RX6_STREAM_ERROR | Lower | 28 | 3 | 4 | + * | 29 | RX7_STREAM_ERROR | Lower | 29 | 3 | 5 | + * | 30 | TX0_STREAM_ERROR | Lower | 30 | 3 | 6 | + * | 31 | TX1_STREAM_ERROR | Lower | 31 | 3 | 7 | + * | 32 | TX2_STREAM_ERROR | Lower | 32 | 4 | 0 | + * | 33 | TX3_STREAM_ERROR | Lower | 33 | 4 | 1 | + * | 34 | TX4_STREAM_ERROR | Lower | 34 | 4 | 2 | + * | 35 | TX5_STREAM_ERROR | Lower | 35 | 4 | 3 | + * | 36 | TX6_STREAM_ERROR | Lower | 36 | 4 | 4 | + * | 37 | TX7_STREAM_ERROR | Lower | 37 | 4 | 5 | + * | 38 | ORX0_STREAM_ERROR | Lower | 38 | 4 | 6 | + * | 39 | ORX1_STREAM_ERROR | Lower | 39 | 4 | 7 | + * | 40 | CORE_STREAM_ERROR | Lower | 40 | 5 | 0 | + * | 41 | RESERVED | Lower | 41 | 5 | 1 | + * | 42 | RESERVED | Lower | 42 | 5 | 2 | + * | 43 | RESERVED | Lower | 43 | 5 | 3 | + * | 44 | RESERVED | Lower | 44 | 5 | 4 | + * | 45 | RESERVED | Lower | 45 | 5 | 5 | + * | 46 | RESERVED | Lower | 46 | 5 | 6 | + * | 47 | RESERVED | Lower | 47 | 5 | 7 | + * |----------------------------|-------------------------------|-------|----------------------------|-------|---------------------| + * | 48 | ARM1_MEMORY_ECC_ERROR | Upper | 0 | 6 | 0 | + * | 49 | ARM1_SYSTEM_ERROR | Upper | 1 | 6 | 1 | + * | 50 | ARM1_CALIBRATION_ERROR | Upper | 2 | 6 | 2 | + * | 51 | ARM1_WATCHDOG_TIMEOUT | Upper | 3 | 6 | 3 | + * | 52 | ARM1_FORCE_GP_INTERRUPT | Upper | 4 | 6 | 4 | + * | 53 | ARM0_MEMORY_ECC_ERROR | Upper | 5 | 6 | 5 | + * | 54 | ARM0_SYSTEM_ERROR | Upper | 6 | 6 | 6 | + * | 55 | ARM0_CALIBRATION_ERROR | Upper | 7 | 6 | 7 | + * | 56 | ARM0_WATCHDOG_TIMEOUT | Upper | 8 | 7 | 0 | + * | 57 | ARM0_FORCE_GP_INTERRUPT | Upper | 9 | 7 | 1 | + * | 58 | PA_PROTECTION_TX0_POWER_ERROR | Upper | 10 | 7 | 2 | + * | 59 | PA_PROTECTION_TX0_SRD_ERROR | Upper | 11 | 7 | 3 | + * | 60 | PA_PROTECTION_TX1_POWER_ERROR | Upper | 12 | 7 | 4 | + * | 61 | PA_PROTECTION_TX1_SRD_ERROR | Upper | 13 | 7 | 5 | + * | 62 | PA_PROTECTION_TX2_POWER_ERROR | Upper | 14 | 7 | 6 | + * | 63 | PA_PROTECTION_TX2_SRD_ERROR | Upper | 15 | 7 | 7 | + * | 64 | PA_PROTECTION_TX3_POWER_ERROR | Upper | 16 | 8 | 0 | + * | 65 | PA_PROTECTION_TX3_SRD_ERROR | Upper | 17 | 8 | 1 | + * | 66 | PA_PROTECTION_TX4_POWER_ERROR | Upper | 18 | 8 | 2 | + * | 67 | PA_PROTECTION_TX4_SRD_ERROR | Upper | 19 | 8 | 3 | + * | 68 | PA_PROTECTION_TX5_POWER_ERROR | Upper | 20 | 8 | 4 | + * | 69 | PA_PROTECTION_TX5_SRD_ERROR | Upper | 21 | 8 | 5 | + * | 70 | PA_PROTECTION_TX6_POWER_ERROR | Upper | 22 | 8 | 6 | + * | 71 | PA_PROTECTION_TX6_SRD_ERROR | Upper | 23 | 8 | 7 | + * | 72 | PA_PROTECTION_TX7_POWER_ERROR | Upper | 24 | 9 | 0 | + * | 73 | PA_PROTECTION_TX7_SRD_ERROR | Upper | 25 | 9 | 1 | + * | 74 | SERDES_PLL_UNLOCK | Upper | 26 | 9 | 2 | + * | 75 | CLKPLL_OVR_RANGE | Upper | 27 | 9 | 3 | + * | 76 | RFPLL1_CP_OVR_RANGE | Upper | 28 | 9 | 4 | + * | 77 | RFPLL0_CP_OVR_RANGE | Upper | 29 | 9 | 5 | + * | 78 | CLKPLL_UNLOCK | Upper | 30 | 9 | 6 | + * | 79 | RFPLL1_UNLOCK | Upper | 31 | 9 | 7 | + * | 80 | RFPLL0_UNLOCK | Upper | 32 | 10 | 0 | + * | 81 | SPI_AHB_ERROR | Upper | 33 | 10 | 1 | + * | 82 | AUX_SPI_AHB_ERROR | Upper | 34 | 10 | 2 | + * | 83 | SPI_CLK_EFUSE_READ_ABORT | Upper | 35 | 10 | 3 | + * | 84 | AUX_SPI_ABORT | Upper | 36 | 10 | 4 | + * | 85 | SPI_ABORT | Upper | 37 | 10 | 5 | + * | 86 | AUX_SPI_CORE_ERROR | Upper | 38 | 10 | 6 | + * | 87 | ERROR_SPI_PAGING | Upper | 39 | 10 | 7 | + * | 88 | ERROR_AUX_SPI_PAGING | Upper | 40 | 11 | 0 | + * | 89 | RESERVED | Upper | 41 | 11 | 1 | + * | 90 | RESERVED | Upper | 42 | 11 | 2 | + * | 91 | RESERVED | Upper | 43 | 11 | 3 | + * | 92 | RESERVED | Upper | 44 | 11 | 4 | + * | 93 | RESERVED | Upper | 45 | 11 | 5 | + * | 94 | RESERVED | Upper | 46 | 11 | 6 | + * | 95 | RESERVED | Upper | 47 | 11 | 7 | + * |----------------------------|-------------------------------|-------|----------------------------|-------|---------------------| +*/ + + +typedef struct adi_adrv903x_GpIntMask +{ + uint64_t lowerMask; /*!< Lower 48 GP Interrupt bits of entire 96 Bit Mask */ + uint64_t upperMask; /*!< Upper 48 GP Interrupt bits of entire 96 Bit Mask */ +} adi_adrv903x_GpIntMask_t; + +/** +* \brief Data structure holding the GP Interrupt Mask Words for all GP Int Pins +*/ +typedef struct adi_adrv903x_GpIntPinMaskCfg +{ + adi_adrv903x_GpIntMask_t gpInt0Mask; /*!< 96 bit GP Interrupt Mask Word for GP Int Pin0 */ + adi_adrv903x_GpIntMask_t gpInt1Mask; /*!< 96 bit GP Interrupt Mask Word for GP Int Pin1 */ +} adi_adrv903x_GpIntPinMaskCfg_t; + + + +/** + * \brief Digital Pin Name + */ +typedef enum adi_adrv903x_GpioDigitalPin +{ + ADI_ADRV903X_IO_GPIO_0 = 0x02U, + ADI_ADRV903X_IO_GPIO_1 = 0x01U, + ADI_ADRV903X_IO_GPIO_2 = 0x40U, + ADI_ADRV903X_IO_GPIO_3 = 0x42U, + ADI_ADRV903X_IO_GPIO_4 = 0x12U, + ADI_ADRV903X_IO_GPIO_5 = 0x00U, + ADI_ADRV903X_IO_GPIO_6 = 0x41U, + ADI_ADRV903X_IO_GPIO_7 = 0x50U, + ADI_ADRV903X_IO_GPIO_8 = 0x13U, + ADI_ADRV903X_IO_GPIO_9 = 0x51U, + ADI_ADRV903X_IO_GPIO_10 = 0x10U, + ADI_ADRV903X_IO_GPIO_11 = 0x52U, + ADI_ADRV903X_IO_GPIO_12 = 0x23U, + ADI_ADRV903X_IO_GPIO_13 = 0x65U, + ADI_ADRV903X_IO_GPIO_14 = 0x21U, + ADI_ADRV903X_IO_GPIO_15 = 0x22U, + ADI_ADRV903X_IO_GPIO_16 = 0x63U, + ADI_ADRV903X_IO_GPIO_17 = 0x60U, + ADI_ADRV903X_IO_GPIO_18 = 0x20U, + ADI_ADRV903X_IO_GPIO_19 = 0x24U, + ADI_ADRV903X_IO_GPIO_20 = 0x62U, + ADI_ADRV903X_IO_GPIO_21 = 0x61U, + ADI_ADRV903X_IO_GPIO_22 = 0x35U, + ADI_ADRV903X_IO_GPIO_23 = 0x70U, + ADI_ADRV903X_O_GPINT_0 = 0x72U, + ADI_ADRV903X_O_GPINT_1 = 0x33U, + ADI_ADRV903X_I_TRX0_EN = 0x03U, + ADI_ADRV903X_I_TRX1_EN = 0x13U, + ADI_ADRV903X_I_TRX2_EN = 0x15U, + ADI_ADRV903X_I_TRX3_EN = 0x25U, + ADI_ADRV903X_I_TRX4_EN = 0x43U, + ADI_ADRV903X_I_TRX5_EN = 0x54U, + ADI_ADRV903X_I_TRX6_EN = 0x55U, + ADI_ADRV903X_I_TRX7_EN = 0x64U, + ADI_ADRV903X_I_ORX0_EN = 0x14U, + ADI_ADRV903X_I_ORX1_EN = 0x53U, + ADI_ADRV903X_I_RESETB = 0x30U, + ADI_ADRV903X_I_SPI_ENB = 0x75U, + ADI_ADRV903X_I_SPI_CLK = 0x31U, + ADI_ADRV903X_IO_SPI_DIO = 0x32U, + ADI_ADRV903X_O_SPI_DO = 0x71U, +} adi_adrv903x_GpioDigitalPin_e; + +#endif /* _ADI_ADRV903X_GPIO_TYPES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_hal.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_hal.h new file mode 100644 index 0000000000000..47c3b56380d7a --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_hal.h @@ -0,0 +1,387 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adi_adrv903x_hal.h + * \brief Contains prototypes and macro definitions for Private ADI HAL wrapper + * functions implemented in adi_adrv903x_hal.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_HAL_H_ +#define _ADI_ADRV903X_HAL_H_ + +#include "adi_adrv903x_hal_types.h" +#include "adi_adrv903x_error.h" + +/** + * /brief Convenience macro for ADRV903X Device API functions to call adi_common_hal_ApiEnter + */ +#define ADI_ADRV903X_API_ENTRY(commonDev) \ +{ \ + adi_common_ErrAction_e _recoveryAction = adi_common_hal_ApiEnter((commonDev), __func__, ADI_TRUE); \ + \ + if(ADI_COMMON_ERR_ACT_NONE != _recoveryAction) \ + { \ + ADI_API_ERROR_REPORT(commonDev, _recoveryAction, "API Enter Issue"); \ + return (adi_adrv903x_ErrAction_e)_recoveryAction; /* Device Specific Recovery Action Required */ \ + } \ +} + +/** + * /brief Convenience macro for ADRV903X Device API functions to call adi_common_hal_ApiExit + */ +#define ADI_ADRV903X_API_EXIT(commonDev, recoveryAction) \ +{ \ + adi_common_ErrAction_e _recoveryAction = adi_common_hal_ApiExit((commonDev), __func__, ADI_TRUE); \ + \ + if (ADI_COMMON_ERR_ACT_NONE != _recoveryAction) \ + { \ + ADI_API_ERROR_REPORT(commonDev, _recoveryAction, "API Exit Issue"); \ + } \ + \ + if(ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) \ + { \ + return (adi_adrv903x_ErrAction_e) recoveryAction; /* Device Specific Recovery Action Required */ \ + } \ + \ + return (adi_adrv903x_ErrAction_e)_recoveryAction; /* Device Specific Recovery Action Required */ \ +} + +/** + * /brief Convenience macro for ADRV903X Device API functions to call adi_common_hal_ApiEnter_vLogCtl + * with ADI_COMMON_DEVICE_LOGCTL_QUIET (i.e. uses logLevel PRIV for recursive calls to the API). + */ +#define ADI_ADRV903X_API_ENTRY_QUIET(commonDev) \ +{ \ + adi_common_ErrAction_e _recoveryAction = \ + adi_common_hal_ApiEnter_vLogCtl((commonDev), __func__, ADI_TRUE, ADI_COMMON_DEVICE_LOGCTL_QUIET); \ + \ + if(ADI_COMMON_ERR_ACT_NONE != _recoveryAction) \ + { \ + ADI_API_ERROR_REPORT(&device->common, _recoveryAction, "API Enter Issue"); \ + return (adi_adrv903x_ErrAction_e)_recoveryAction; /* Device Specific Recovery Action Required */ \ + } \ +} + +/** + * /brief Convenience macro for ADRV903X Device API functions to call adi_common_hal_ApiExit_vLogCtl + * with ADI_COMMON_DEVICE_LOGCTL_QUIET (i.e. uses logLevel PRIV for recursive calls to the API). + */ +#define ADI_ADRV903X_API_EXIT_QUIET(commonDev, recoveryAction) \ +{ \ + adi_common_ErrAction_e _recoveryAction = \ + adi_common_hal_ApiExit_vLogCtl((commonDev), __func__, ADI_TRUE, ADI_COMMON_DEVICE_LOGCTL_QUIET); \ + \ + if (ADI_COMMON_ERR_ACT_NONE != _recoveryAction) \ + { \ + ADI_API_ERROR_REPORT(&device->common, _recoveryAction, "API Exit Issue"); \ + } \ + \ + if(ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) \ + { \ + return (adi_adrv903x_ErrAction_e) recoveryAction; /* Device Specific Recovery Action Required */ \ + } \ + \ + return (adi_adrv903x_ErrAction_e)_recoveryAction; /* Device Specific Recovery Action Required */ \ +} + +/** +* \brief Writes out the data array of size count. Must be packed according ADI HAL layer specs. +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure. +* \param[in] data byte array containing the data to write to SPI. Must be packed correctly. +* \param[in,out] count pointer to the number of valid bytes in data parameter. On successful +* completion it is set to 0. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +* +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiFlush(adi_adrv903x_Device_t* const device, + const uint8_t data[], + uint32_t* const count); + +/** +* \brief Writes data from memory to destination registers on the device. +* +* Supports a contiguous writes with a single start address or scattered write to several addresses. +* +* See adi_adrv903x_Registers32Read for important details. +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure. +* \param[in,out] spiCache If supplied writes operations are cached until adi_adrv903x_SpiFlush +* is used to flush the cache or a subsequent call to this function decides to flush +* the cache. Set to NULL to avoid caching. +* \param[in] addr For a contiguous write supply an array of one element containing the dest addr at which +* to start the write; The Nth element in writeData is written to addr[0] + n. +* For scattered writes supply an array of param count elements; the Nth element in writeData is written +* to addr[n]. All register addresses are 32bit regardless of the data-width of the register. +* \param[in] writeData The data to write. Each element is 32bits wide but depending on the destination +* register address either all 32bits (for addresses >= 0x4000) or only the least-significant +* 8 bits will be written (for addresses 0x0 - 0x3FFF). +* \param[in] mask NULL indicates a contiguous write (see param addr) and no masking occurs - all bits of each dest register +* will be written to. +* If not NULL each register write for each element in writeData is masked with the +* corresponding element of this array. Only the register bits set to 1 in the +* corresponding mask element are updated. Other register bits are left unchanged. +* \param[in] count Number of elements writeData array and if mask is not NULL also mask and addr arrays. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +* +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Registers32Write(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr[], + const uint32_t writeData[], + const uint32_t mask[], + const uint32_t count); + +/** +* \brief Writes a 32bits register with 32bits of data to the part. +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure. +* \param[in,out] spiCache Optional pointer to a spiCache structure if caching writes. If there is no caching passing NULL is valid. +* \param[in] addr the 32bits address of the register to write to. +* \param[in] writeData the 32bits value to write to the register. +* \param[in] mask the 32bits mask to write to the register. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +* +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Register32Write(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + uint32_t addr, + const uint32_t writeData, + const uint32_t mask); + +/** +* \brief This function serves as a helper function for adi_adrv903x_Registers32Read. This will call Registers32Read with a count value +* set to one. Depending on if addr is Direct SPI (< 0x4000) or AHB access ( all other addresses) that one will correspond to a single +* byte or a full word (4 bytes), respectively. +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure. +* \param[in,out] spiCache Optional pointer to a spiCache structure if caching writes, the cache will be written out prior to performing the read. If there is no caching passing NULL is valid. +* \param[in] addr the 32bits address of the register to read from. +* \param[out] readData a pointer to a location to write the register data to. +* \param[in] mask the desired mask to logically-and the register value with before returning in readData +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +* +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Register32Read(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + uint32_t addr, + uint32_t* const readData, + const uint32_t mask); + + +/** +* \brief Read from a contiguous range of device registers into memory. +* +* This function is used to access all SPI registers, both Core SPI addresses (addresses < 0x4000) and AHB memory (addresses >= 0x4000). +* For Core SPI addresses it uses direct SPI access. For AHB addresses, it uses the AHB interface registers. +* The only practical difference between the two for the user is the size of the registers. For Core SPI access the register size is 8-bits. +* For AHB access, the register size is 32-bits. This means for Core SPI addresses, the upper three bytes of each readData element are +* not written. +* +* Both Core & AHB register access can take advantage of SPI streaming. There is a local cache that will build up as big of a cache of SPI +* reads as possible before accessing the SPI platform layer. The spiCache parameter is only as a convenience and to keep the prototype across +* API HAL functions similar, ie if a user has an existing spiCache from previous Register(s)32Write they can pass it in here to have it be flushed +* prior to reads being performed. However, SPI reads cannot be cached across Register(s)32Read function calls. +* +* In addition to SPI streaming, there is also AHB auto-increment mode and SPI FIFO mode available for AHB address regions. +* AHB auto-increment allows reading the AHB interface data registers continuously without having to set the AHB address registers each time. +* SPI FIFO allows for SPI streaming and AHB auto-increment to be used together- it allows SPI streaming mode when reading from the same +* register over and over, eg AHB Data interface register. +* The user can set the preference for AHB auto-increment and SPI FIFO mode through adi_adrv903x_AhbReadConfigure. SPI streaming is set when +* the SPI is configured. +* Note: SPI FIFO can only be utilized if auto-increment and SPI streaming is enabled. +* +* The mask parameter allows for mask values to be applied to each register while reading. However, if masking is not necessary a NULL value +* can be used and no masking will be performed. It is recommended for large transactions that mask be NULL unless absolutely necessary. +* Keep in mind that for Direct SPI access, only the least-significant byte will have the mask applied. This means that if there's garbage passed +* into the readData array, there will still be garbage in bytes[3:1] of each readData entry. It is recommended to zero out the memory space +* allocated for readData prior to calling this function if that's a concern. +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure. +* \param[in,out] spiCache Optional pointer to a spiCache structure if caching writes, the cache will be written out prior to performing the read. +* If there is no caching passing NULL is valid. +* \param[in] addr The 32bit address of the first source register on the device from which to read. +* \param[in,out] readData The destination location to which to write the register data. Must of size at least 'count * sizeof(uint32_t)'. Each register +* is written to a separate element in readData regardless of the size of the device register. +* \param[in] mask If no masking is desired pass in NULL. Otherwise, it should be the same size as count with mask values for each register. +* \param[in] count The number of registers to read. Does NOT indicate number of bytes to read. Registers 0 - 0x3FFF are 8 bit, other registers are 32bit. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +* +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Registers32Read(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr, + uint32_t readData[], + uint32_t mask[], + const uint32_t count); + +/** +* \brief Writes data from memory to destination registers on the device using byte arrays. +* +* See adi_adrv903x_Registers32Read for important details. +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure. +* \param[in,out] spiCache Optional pointer to a spiCache structure if caching writes. If there is no +* caching passing NULL is valid. +* \param[in] addr The destination address on the device. +* \param[in] writeData The data to write. +* \param[in] count The number of bytes to write to the device. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +* +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RegistersByteWrite(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr, + const uint8_t writeData[], + const uint32_t count); + +/** +* \brief Read from a contiguous range of device registers into memory. +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure. +* \param[in,out] spiCache Optional pointer to a spiCache structure if caching writes, the cache will be written out prior to performing the read. +* If there is no caching passing NULL is valid. +* \param[in] addr The 32bit source address of the first source register on the device from which to read. +* \param[in, out] readData The destination to which to write the data. +* \param[in] mask After it is read the Nth element of readData is OR'd with Nth element of mask. Pass NULL for no masking. +* \param[in] count The number of bytes to read. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +* +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RegistersByteRead(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr, + uint8_t readData[], + const uint8_t mask[], + const uint32_t count); + +/** +* \brief Read from a contiguous range of device registers into memory. +* +* This function can only access registers that require a 32-bit read/writes. Furthermore both addr and count +* arguments must be divisible by 4. If you don't know whether a memory region is 32bOnly or not use +* Registers32Read() which will invoke this function if required. +* +* Calling flushes the spiCache before transaction to make sure the intended order of SPI transactions isn't +* changed. +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure. +* \param[in,out] spiCache Optional pointer to a spiCache structure if caching writes, the cache will be written +* out prior to performing the read. If there is no caching passing NULL is valid. +* \param[in] addr The 32bit source address on the device. Must be divisible by 4. +* \param[in,out] readData The destination buffer. Each four bytes read from the device is treated as a single 32bit +* integer and device to host endianess conversion is applied if required. +* \param[in] count The number of *bytes* to read. Must be divisible by 4. All source addresses +* from addr to addr + count - 1 must be in a 32bOnly region. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +* +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Registers32bOnlyRead(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr, + uint8_t readData[], + const uint32_t count); + +/** +* \brief Writes to a contiguous range of device registers into memory. +* +* This function is used to access only registers that *require* a 32-bit SPI transaction. This function +* flushes the spiCache before transaction to make sure the intended order of SPI transactions isn't changed. +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure. +* \param[in,out] spiCache Optional pointer to a spiCache structure if caching writes, the cache will be written out prior to performing the read. +* If there is no caching passing NULL is valid. +* \param[in] addr The 32bit address of the first source register on the device to which to write. +* \param[in] writeData The data to write. Each four elements is treated as a single 32bit integer and host to +* device endianess conversion is applied if required. +* \param[in] count The number of bytes to write. Must be divisible by 4. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +* +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Registers32bOnlyWrite(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr, + const uint8_t writeData[], + const uint32_t count); + +/** +* \brief Identical to adrv903x_Registers32bOnlyRead but allows the caller to specify if the read data should be treated +* as raw byte oriented data or as 32bit integers. This influences endianess fix-ups performed. +* +* As indicated by the lack of 'adi_' prefix this function may be called only from other API functions and not from +* applications. It's interface may change without notice. +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure. +* \param[in,out] spiCache As per adrv903x_Registers32bOnlyRead. +* \param[in] addr As per adrv903x_Registers32bOnlyRead. +* \param[in,out] readData As per adrv903x_Registers32bOnlyRead. +* \param[in] numBytesToRead As per adrv903x_Registers32bOnlyRead. +* \param[in] isByteData If set the data read is treated as 8bit integers otherwise is treated as 32bit integers. +* 32bit integer data is corrected to account for any difference in host and device endianess as it is read. +* 8bit data requires no correction and is placed in memory in the same order as it is in the device's memory. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +* +*/ +ADI_API adi_adrv903x_ErrAction_e adrv903x_Registers32bOnlyRead_vEndian(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr, + uint8_t readData[], + const uint32_t numBytesToRead, + const uint8_t isByteData); + +#endif diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_hal_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_hal_types.h new file mode 100644 index 0000000000000..5855d5ad90111 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_hal_types.h @@ -0,0 +1,70 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adi_adrv903x_hal_types.h + * \brief Contains prototypes and macro definitions for ADI HAL wrapper + * functions implemented in adi_adrv903x_hal.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_HAL_TYPES_H_ +#define _ADI_ADRV903X_HAL_TYPES_H_ + +#include "adi_platform.h" + +/* TODO: Any user changeable #defines need to be moved to adi_adrv903x_user.h */ +#define HAL_TIMEOUT_DEFAULT 100 /* 100ms */ +#define HAL_TIMEOUT_NONE 0x0 /* Non-blocking */ +#define HAL_TIMEOUT_INFINITE 0xFFFFFFFF /* Blocking */ +#define HAL_TIMEOUT_MULT 2 /* HAL timeout worse-case factor */ + +#define MAXSPILOGMESSAGE 64 + +#define ADRV903X_DIRECT_SPI_BYTES 0x3 /* Number of bytes required to use non HW_RMW direct */ +#define ADRV903X_PAGING_SPI_BYTES 0x1B /* Number of bytes required to use non HW_RMW indirect: 9 Direct SPI writes (assumed entire word written, ie mask = 0xFFFFFFFF) */ +#define ADRV903X_SPI_WRITE_POLARITY 0x00 /* Write bit polarity for ADRV903X */ + +#define ADI_ADRV903X_SPI_READ_BYTE 0 +#define ADI_ADRV903X_SPI_READ_HALFWORD 1 +#define ADI_ADRV903X_SPI_READ_WORD 2 + + +/** + * \brief Structure used to track the SPI cache + */ +typedef struct adi_adrv903x_SpiCache +{ + uint8_t data[ADI_HAL_SPI_FIFO_SIZE]; /*!< SPI data buffer. Should not be written to manually. Data gets updated through calls to adi_adrv903x_Register(s)Write */ + uint32_t count; /*!< The number of bytes filled with data buffer. Should not be written to manually. Gets updated through calls to adi_adrv903x_Register(s)Write */ + uint32_t lastSpiAddr; /*!< Address that last byte, at (count - 1) index, in buffer is written to. Should not be written to manually. Gets updated through calls to adi_adrv903x_Register(s)Write */ + uint8_t spiStreamingEn; /*!< Flag used to signal SPI streaming is enabled (1) or disabled (0). Can be changed anytime to switch between streaming & non-streaming. */ +} adi_adrv903x_SpiCache_t; + +/** + * \brief Structure to define a register map with start/end addresses + * + * Describes a memory region consisting of N separate areas. Each area has an identical size and the starting address + * of each area is constant number of bytes (strideValue) from the starting address of the preceeding area. + * + * Visually: + * + * +----------------------------------------------------------------------------------------------------------------------------+ + * | start addr + | ... | end addr + | ~ | start addr | ... | end addr | ~ | start addr + | ... | end addr + | + * | stride * 0 | ... | stride * 0 | ~ | + stride * 1 | ... | +stride * 1 | ~ | stride * | ... | stride * | + * | | | | | | | | | (numInstances - 1) | ... | (numInstances - 1) | + * +----------------------------------------------------------------------------------------------------------------------------+ + * |< ------------- strideValue -------->| + */ +typedef struct adi_adrv903x_RegisterMap +{ + uint32_t startAddr; /* 32 bit Starting address of the register map */ + uint32_t endAddr; /* 32 bit Ending address of the register map */ + uint32_t numOfInstances; /* Num of instances for this register map */ + uint32_t strideValue; /* In bytes. This is the offset between start addresses of consecutive instances, it's a 'don't care' when numOfInstances = 1*/ +} adi_adrv903x_RegisterMap_t; + +#endif diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_lo_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_lo_types.h new file mode 100644 index 0000000000000..f093f541ee39b --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_lo_types.h @@ -0,0 +1,50 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_lo_types.h + * + * \brief Contains ADRV903X LO data structures. + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADRV903X_LO_TYPES_H__ +#define __ADRV903X_LO_TYPES_H__ + +#include "adi_adrv903x_platform_pack.h" + +/** + * \brief Enum of LO selections + */ +typedef enum adi_adrv903x_LoName +{ + ADI_ADRV903X_LO0 = 0, /*!< Selects LO0 for Rx and Tx */ + ADI_ADRV903X_LO1, /*!< Selects LO1 for Rx and Tx */ +} adi_adrv903x_LoName_e; + +/** +* \brief Enum of LO Options selections. Feature is not implemented. Use 0 as default. Users are responsible for changing Band NCOs if changing RF LO. +*/ +typedef enum adi_adrv903x_LoOption +{ + ADI_ADRV903X_NCO_NO_OPTION_SELECTED = 0x00, /*!< NCO auto-update disabled - Don't re-program NCOs when programming LO */ + ADI_ADRV903X_NCO_AUTO_UPDATE_DISABLE = 0x01 /*!< Selects the NCO auto update disable */ +} adi_adrv903x_LoOption_e; + +/** + * \brief Enum of PLL selections + */ +typedef enum adi_adrv903x_Pll +{ + ADI_ADRV903X_RF0_PLL = 0, /*!< Selects RF0 PLL */ + ADI_ADRV903X_RF1_PLL, /*!< Selects RF1 PLL */ + ADI_ADRV903X_CLK_PLL, /*!< Selects Clk PLL */ + ADI_ADRV903X_SERDES_PLL /*!< Selects Serdes PLL */ +} adi_adrv903x_Pll_e; + +#endif /* __ADRV903X_LO_TYPES_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_platform_pack.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_platform_pack.h new file mode 100644 index 0000000000000..bc5a301ae0e49 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_platform_pack.h @@ -0,0 +1,63 @@ +/** + * \file adi_adrv903x_platform_pack.h + * + * \brief Contains platform pack define + * + * \details Contains platform pack define + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADI_ADRV903X_PLATFORM_PACK_H__ +#define __ADI_ADRV903X_PLATFORM_PACK_H__ + + +#include "adi_adrv903x_user.h" +#include "adi_library_types.h" + + + + + +#if (!defined(ADI_ADRV903X_PACK_START) || !defined(ADI_ADRV903X_PACK_FINISH)) +#ifdef __GNUC__ +#define ADI_ADRV903X_PACK_START _Pragma("pack(1)") +#define ADI_ADRV903X_PACK_FINISH _Pragma("pack()") +#elif defined __ICCARM__ +#define ADI_ADRV903X_PACK_START _Pragma("pack(1)") +#define ADI_ADRV903X_PACK_FINISH _Pragma("pack()") +#elif defined _MSC_VER +#define ADI_ADRV903X_PACK_START __pragma(pack(1)) +#define ADI_ADRV903X_PACK_FINISH __pragma(pack()) +#else +#error ( "Define the ADI_ADRV903X_PACK_START and ADI_ADRV903X_PACK_FINISH macros for your compiler." ) +#endif +#endif + +#ifndef ADI_ADRV903X_PACKED +#if defined __ICCARM__ +/* + * Error[Pm154]: in the definition of a function-like macro, each instance of a + * parameter shall be enclosed in parenthesis (MISRA C 2004 rule 19.10) + * + * ADI_ADRV903X_PACKED() is a macro used for structure packing. The parameter + * for this macro must be a structure definition, which cannot be enclosed in + * parenthesis (syntactically invalid). + */ +#pragma diag_suppress=Pm154 +#define ADI_ADRV903X_PACKED(d) _Pragma("pack(1)") d _Pragma("pack()") +#pragma diag_default=Pm154 +#else +#define ADI_ADRV903X_PACKED(d) ADI_ADRV903X_PACK_START d ADI_ADRV903X_PACK_FINISH +#endif +#endif + +#endif /* __ADI_ADRV903X_PLATFORM_PACK_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_radioctrl.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_radioctrl.h new file mode 100644 index 0000000000000..178d4b2ff4ee1 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_radioctrl.h @@ -0,0 +1,1129 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_radioctrl.h +* \brief Contains ADRV903X function prototypes for +* adi_adrv903x_radioctrl.c +* +* ADRV903X API Version: 2.12.1.4 +*/ + + +#ifndef _ADI_ADRV903X_RADIOCTRL_H_ +#define _ADI_ADRV903X_RADIOCTRL_H_ + +#include "adi_adrv903x_radioctrl_types.h" +#include "adi_adrv903x_error.h" + +/** +* \brief This function is used during the init sequence in order to load the stream +* processor binary images from the stream_image.bin file. The stream_image.bin +* file has a pre-defined structure this function relies on and so the user +* must load the stream_image.bin starting from the beginning. +* The user may load the file in chunks as low as 100 bytes by iterating through +* the entire stream_image.bin file and updating byteOffset on each iteration. +* Once the final chunk of stream_image.bin has been processed the function +* sets the appropriate status flag in device->devStateInfo. +* +* \pre This function is called after adi_adrv903x_Initialize before FW image is loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] byteOffset Offset (starting from 0) of where the current binary chunk is located +* in the stream_image.bin file. +* \param[in] binary Byte array containing the current chunk of stream binary file to process +* \param[in] byteCount The number of bytes in the binary parameter +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StreamImageWrite(adi_adrv903x_Device_t* const device, + uint32_t byteOffset, + const uint8_t binary[], + uint32_t byteCount); + +/** +* \brief Enables or disables all Rx, ORx and Tx channels that are in SPI control mode (see +* adi_adrv903x_RadioCtrlCfgSet. Has no effect on channels that are not set to SPI control mode. +* Furthermore channels that are not initialized will not be enabled. +* +* For use cases where pin mode is not required, this function can be used to enable/disable the +* Rx/Orx/Tx signal paths. This function should be called after initialization and loading the +* stream processor. +* +* orx/rx/tx/ChannelMask Parameters: +* The bits set in this bit-mask indicate the orx/rx/tx channels affected by this call respectively. +* Channels whose bit are not set to 1 in this parameter will not be affected by this function call. +* Whether an affected channel is to be enabled or disabled is indicated by the channel's bit in +* orx/rx/txChannelEnable parameters. The first channel is indicated by the least significant bit, +* the second channel by the next least significant and so on. It is an error to set a bit corresponding +* to a non-existent channel. +* +* orx/rx/tx/ChannelEnable Parameters: +* A bit mask indicating if the channel is to be enabled or disabled. +* Bits relate to channels in the same manner as the orx/rx/txChannelMask parameters. +* If the bit for a channel in the orx/rx/txChannelMask is not set then the channel's bit +* in these parameters has no effect. + +* \pre This function should be called after initialization and loading the stream +* processor. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] orxChannelMask Mask to select Orx channels to be affected with this function call +* \param[in] orxChannelEnable Mask to enable/disable selected Orx channels +* \param[in] rxChannelMask Mask to select Rx channels to be affected with this function call +* \param[in] rxChannelEnable Mask to enable/disable selected Rx channels +* \param[in] txChannelMask Mask to select Tx channels to be affected with this function call +* \param[in] txChannelEnable Mask to enable/disable selected Tx channels +* +* The following table lists the rxChannelMask bits and the corresponding channels +* that are enabled/disabled in SPI mode +* +*|orxChannelMask | Channel Selected/Unselected | +*|:----------------|:----------------------------------------:| +*| bit[0-7] | Reserved | +*| bit[8] | 1 = ORx0 Selected, 0 = ORx0 Unselected | +*| bit[9] | 1 = ORx1 Selected, 0 = ORx1 Unselected | +*| bit[10-31] | Reserved | +* +*|orxChannelEnable | Channel Enable/Disable | +*|:----------------|:----------------------------------------:| +*| bit[0-7] | Reserved | +*| bit[8] | 1 = ORx0 Enable, 0 = ORx0 Disable | +*| bit[9] | 1 = ORx1 Enable, 0 = ORx1 Disable | +*| bit[10-31] | Reserved | +* +*| rxChannelMask | Channel Selected/Unselected | +*|:----------------|:----------------------------------------:| +*| bit[0] | 1 = Rx0 Selected, 0 = Rx0 Unselected | +*| bit[1] | 1 = Rx1 Selected, 0 = Rx1 Unselected | +*| bit[2] | 1 = Rx2 Selected, 0 = Rx2 Unselected | +*| bit[3] | 1 = Rx3 Selected, 0 = Rx3 Unselected | +*| bit[4] | 1 = Rx4 Selected, 0 = Rx4 Unselected | +*| bit[5] | 1 = Rx5 Selected, 0 = Rx5 Unselected | +*| bit[6] | 1 = Rx6 Selected, 0 = Rx6 Unselected | +*| bit[7] | 1 = Rx7 Selected, 0 = Rx7 Unselected | +*| bit[8-31] | Reserved | + +*| rxChannelEnable | Channel Enable/Disable | +*|:----------------|:----------------------------------------:| +*| bit[0] | 1 = Rx0 Enable, 0 = Rx0 Disable | +*| bit[1] | 1 = Rx1 Enable, 0 = Rx1 Disable | +*| bit[2] | 1 = Rx2 Enable, 0 = Rx2 Disable | +*| bit[3] | 1 = Rx3 Enable, 0 = Rx3 Disable | +*| bit[4] | 1 = Rx4 Enable, 0 = Rx4 Disable | +*| bit[5] | 1 = Rx5 Enable, 0 = Rx5 Disable | +*| bit[6] | 1 = Rx6 Enable, 0 = Rx6 Disable | +*| bit[7] | 1 = Rx7 Enable, 0 = Rx7 Disable | +*| bit[8-31] | Reserved | +* +*| txChannelMask | Channel Selected/Unselected | +*|:----------------|:----------------------------------------:| +*| bit[0] | 1 = Tx0 Selected, 0 = Tx0 Unselected | +*| bit[1] | 1 = Tx1 Selected, 0 = Tx1 Unselected | +*| bit[2] | 1 = Tx2 Selected, 0 = Tx2 Unselected | +*| bit[3] | 1 = Tx3 Selected, 0 = Tx3 Unselected | +*| bit[4] | 1 = Tx4 Selected, 0 = Tx4 Unselected | +*| bit[5] | 1 = Tx5 Selected, 0 = Tx5 Unselected | +*| bit[6] | 1 = Tx6 Selected, 0 = Tx6 Unselected | +*| bit[7] | 1 = Tx7 Selected, 0 = Tx7 Unselected | +*| bit[8-31] | Reserved | + +*| txChannelEnable | Channel Enable/Disable | +*|:----------------|:----------------------------------------:| +*| bit[0] | 1 = Tx0 Enable, 0 = Tx0 Disable | +*| bit[1] | 1 = Tx1 Enable, 0 = Tx1 Disable | +*| bit[2] | 1 = Tx2 Enable, 0 = Tx2 Disable | +*| bit[3] | 1 = Tx3 Enable, 0 = Tx3 Disable | +*| bit[4] | 1 = Tx4 Enable, 0 = Tx4 Disable | +*| bit[5] | 1 = Tx5 Enable, 0 = Tx5 Disable | +*| bit[6] | 1 = Tx6 Enable, 0 = Tx6 Disable | +*| bit[7] | 1 = Tx7 Enable, 0 = Tx7 Disable | +*| bit[8-31] | Reserved | +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTxEnableSet(adi_adrv903x_Device_t* const device, + const uint32_t orxChannelMask, + const uint32_t orxChannelEnable, + const uint32_t rxChannelMask, + const uint32_t rxChannelEnable, + const uint32_t txChannelMask, + const uint32_t txChannelEnable); +/** + * \brief Retrieve the Tx, Rx, and ORx SPI mode bit masks enabled/disabled status. + * + * This function retrieves SPI mode enabling status of Rx/Tx/ORx. + * + * Please see adi_adrv903x_RxTxEnableSet() for bit-to-channel assignments of + * orxChannelMask/rxChannelMask/txChannelMask parameters. + * \pre This function may be called after the device has been fully initialized + * any time during run-time operation, but only after the CPU and GPIO + * have been configured + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X data structure + * \param[out] orxChannelMask Pointer to location of bit mask into which ORx SPI-mode enabled/disabled status will be written. + * \param[out] rxChannelMask Pointer to location of bit mask into which Rx SPI-mode enabled/disabled status will be written. + * \param[out] txChannelMask Pointer to location of bit mask into which Tx SPI-mode enabled/disabled status will be written. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTxEnableGet(adi_adrv903x_Device_t* const device, + uint32_t* const orxChannelMask, + uint32_t* const rxChannelMask, + uint32_t* const txChannelMask); + +/** + * \brief Retrieves the current effective channel enabled/disabled state regardless of whether the channel is + * under SPI-mode or pin-mode control. + * + * The state of Rx/Tx/ORx channel 0 is written to the least significant bit in the corresponding argument. The + * state of channel 1 to the next most significant bit and so on. A bit value of 1 indicates the channel is + * enabled. Bits outside the range of the number of existing channels are set to 0. + * + * Compare to adi_adrv903x_RxTxEnableGet which retrieve the Tx, Rx, and ORx SPI mode bit masks enabled/disabled + * status. + * + * \pre This function may be called after the device has been fully initialized + * any time during run-time operation, but only after the CPU and GPIO + * have been configured + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X data structure + * \param[out] orxChannelMask the current state of the ORx channels + * \param[out] rxChannelMask the current state of the Rx channels. + * \param[out] txChannelMask the current state of the Tx channels. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ChannelEnableGet(adi_adrv903x_Device_t* const device, + uint32_t* const orxChannelMask, + uint32_t* const rxChannelMask, + uint32_t* const txChannelMask); + +/** + * \brief This function sets up the mode (Pin Mode/Non-Pin Mode) through which the signal path is controlled + * + * The ADRV903X device defaults to Non-pin mode on power up. This function is used to reconfigure + * the signal path control mode of Rx, ORx, Tx signal chains. Non-Pin mode signal chain control + * can be accomplished through adi_adrv903x_RxTxEnableSet() API. The pin mode signal chain control is + * accomplished through input pins to ADRV903X device. + * + * In Pin mode, the Tx and Rx signal chains are controlled using dedicated pins TRXA_CTRL, + * TRXB_CTRL, ... TRXH_CTRL. Use adi_adrv903x_RadioCtrlTxRxEnCfgSet to configure which pins control which + * channels. + * + * \pre This function may be called after the device has been fully initialized + * any time during run-time operation, but only after the CPU and GPIO + * have been configured + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X data structure + * \param[in] radioCtrlCfg is comprised of radio control mode configurations for Rx, ORx and Tx channels + * + * In order to skip configuration for a specific signal chain, set the respective enable mode to invalid. Eg: To skip + * Tx configuration, set radioCtrlCfg->txRadioCtrlModeCfg.txEnableMode to ADI_ADRV903X_TX_EN_INVALID_MODE. Similarly + * to skip Rx configuration set radioCtrlCfg->rxRadioCtrlModeCfg.rxEnableMode to ADI_ADRV903X_RX_EN_INVALID_MODE and + * to skip ORx configuration set radioCtrlCfg->orxRadioCtrlModeCfg.orxEnableMode to ADI_ADRV903X_ORX_EN_INVALID_MODE. + * +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlCfgSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_RadioCtrlModeCfg_t* const radioCtrlCfg); + +/** + * \brief This function controls enablement of Tx & Rx channels and antenna by the eight TRX_CTRL pins: TRXA_CTRL - + * TRXH_CTRL. configurations are only valid for channels in pin-mode; for channels in SPI-mode they are ignored. + * + * The pinIndex and configSel parameters select the desired pin and config member to write. If a field within the + * adi_adrv903x_RadioCtrlTxRxEnCfg_t is not indicated by a bit in configSel parameter that field ignored. Any + * TRX_CTRL pin that is not indicated by a bit in the pinIndex also remains unaffected by the call. + * + * The txRxEnCfg parameter holds an array for Tx/Rx channel enablement and Tx/Rx antenna enablement. + * Each array has eight bytes corresponding to the eight TRX_CTRL pins. Element 0 of each array corresponds to + * TRXA_CTRL, element 1 corresponds to TRXB_CTRL pin. Within each byte bitN corresponds to channel N where bit0 + * is the least-significant bit. + * + * Example: + * txRxEnCfg->txEnMapping[0] = 0x0F --> then asserting TRXA_CTRL Pin will enable Tx Channels 0-3. + * NOTE: the configSel param must also have the TX_ENABLE bit set and the pinSel param must have PIN0 bit + * set for TRX*A* set. + * + * txRxEnCfg->rxAltMapping[3] = 0xF0 --> then asserting TRXD_CTRL Pin will power up the data path for antenna + * calibrations for Rx Channels 4-7 + * NOTE: the configSel param must also have the RX_ALT_ENABLE bit set and the pinSel param must have bit3 for TRX*D* set. + * + * Each pin can be used to control any number of Tx or Rx channels. A single channel can also + * be controlled by multiple pins. Where a single channel is configured to be controlled by multiple pins the channel + * is enable is any one of the pins is asserted. + * + * This function is used during the Post-MCS bring up phase. It can also be called during runtime for calibration + * control. + * + * \pre This function may be called after the device has been fully initialized + * any time during run-time operation, but only after the CPU and GPIO + * have been configured + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X data structure + * \param[in] txRxEnCfg is comprised of radio control TXRX Pin configurations for Rx and Tx channels + * \param[in] pinIndex is a bitmask built up of or'd adi_adrv903x_TxRxEnPin_e values + * \param[in] configSel is a bitmask built up of or'd adi_adrv903x_TxRxEnCfg_e values + * +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlTxRxEnCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RadioCtrlTxRxEnCfg_t* const txRxEnCfg, + uint8_t pinIndex, + uint8_t configSel); + +/** + * \brief This function reads the Tx & Rx GPIO configuration bitfields and stores the values in the blank + * structure passed in. + * + * \pre This function may be called after the device has been fully initialized + * any time during run-time operation, but only after the CPU and GPIO + * have been configured + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X data structure + * \param[out] txRxEnCfg blank structure to hold the current TXRX Pin settings + * +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlTxRxEnCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_RadioCtrlTxRxEnCfg_t* const txRxEnCfg); + +/** + * \brief Reads back the Tx, Rx, and ORx radio control mode configuration + * + * This function retrieves Pin mode / Non pin mode configuration of + * radio ctrl modes for Rx/Tx/ORx signal chains. For Rx, Tx, and ORx signal chains, + * a SPI or Pin mode is returned. + * + * \pre This function may be called after the device has been fully initialized + * any time during run-time operation, but only after the CPU and GPIO + * have been configured + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X data structure + * \param[in] rxChannel Receiver channel for which mode config readback is requested (valid channels Rx0-Rx7, ORx0-ORx1) + * \param[in] txChannel Transmitter channel for which mode config readback is requested (valid channels Tx0-Tx7) + * \param[out] radioCtrlCfg Pointer to radio ctrl config data structure which will be updated with read back + * values for Rx,Tx and ORx signal chain control configs. + * +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_RadioCtrlModeCfg_t* const radioCtrlCfg); + +/** +* \brief Sets the RF LO settings for the desired LO +* +* \pre This function can be called after the CPU has been initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] loConfig Pointer to the LO config settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_LoFrequencySet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoConfig_t* const loConfig); + + +/** +* \brief Gets a Local Oscillator (LO) frequency (RF carrier frequency). +* +* This function is used to get a LO current frequency. The loName field in adi_adrv903x_LoConfigReadback_t needs to be filled in with desired +* enumerate value LO0, LO1 in adi_adrv903x_LoName_e. +* +* This function reads back the maximum LO frequency(of all channels using that LO) after leaf dividers. +* \pre This function can be used after the device has been initialized, firmware loaded and the LO configured. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in,out] loConfig Pointer to the LO config read back settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_LoFrequencyGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_LoConfigReadback_t* const loConfig); + +/** +* \brief API to assign Tx and Rx Channels to PLL's during runtime. +* This API is called to configure PLL assigments for Tx and Rx channels. +* +* \pre This API function can be called after the CPU has been initialized and MCS done. +* \post After the API function is called, strictly need to re-program the PLL's. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] rf0MuxTx0_3 If set to 1 East Tx channels (Tx0-3) are connected to PLL0 (East PLL). If set to 0 Tx0-3 are connected to PLL1 (West PLL). +* \param[in] rf0MuxTx4_7 If set to 1 West Tx channels (Tx4-7) are connected to PLL0 (East PLL). If set to 0 Tx4-7 are connected to PLL1 (West PLL). +* \param[in] rf0MuxRx0_3 If set to 1 East Rx channels (Rx0-3) are connected to PLL0 (East PLL). If set to 0 Rx0-3 are connected to PLL1 (West PLL). +* \param[in] rf0MuxRx4_7 If set to 1 West Rx channels (Rx4-7) are connected to PLL0 (East PLL). If set to 0 Rx4-7 are connected to PLL1 (West PLL). +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CfgPllToChanCtrl(adi_adrv903x_Device_t* const device, + uint8_t rf0MuxTx0_3, + uint8_t rf0MuxTx4_7, + uint8_t rf0MuxRx0_3, + uint8_t rf0MuxRx4_7); + +/** +* \brief Sets the RF LO Loop filter parameters for the desired LO. +* This command only updates the loop config parameters in the internal table. +* adi_adrv903x_LoFrequencySet function needs to be called to make the new loop +* configuration effective. +* +* \pre This function can be called after the CPU has been initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] loName The RF LO selected +* \param[in] loLoopFilterConfig Pointer to the LO config settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_LoLoopFilterSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoName_e loName, + const adi_adrv903x_LoLoopFilterCfg_t* const loLoopFilterConfig); + +/** +* \brief Gets the RF LO Loop filter parameters for the desired LO +* +* \pre This function can be called after the CPU has been initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] loName The RF LO selected +* \param[in,out] loLoopFilterConfig Pointer to the LO config settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_LoLoopFilterGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoName_e loName, + adi_adrv903x_LoLoopFilterCfg_t* const loLoopFilterConfig); + +/** +* \brief Gets Local Oscillators (LO) lock status. +* +* This function is used to get all plls lock status. +* +* pllLockStatus bit 0 = CLK PLL Lock status +* pllLockStatus bit 1 = RF0 PLL Lock status +* pllLockStatus bit 2 = RF1 PLL status +* pllLockStatus bit 3 = Serdes PLL Lock Status +* +* A bit value of 1 indicates the corresponding pll is locked +* A bit value of 0 indicates the corresponding pll is unlocked. +* +* \pre This function can be used after the device has been initialized, firmware loaded and the LO configured. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] pllLockStatus Pointer to the pll lock status read back +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_PllStatusGet(adi_adrv903x_Device_t* const device, + uint32_t* const pllLockStatus); + +/** +* \brief Gets all TX and RX LO names and frequencies. +* +* \pre This function can be used after the device has been initialized, firmware loaded and the LO configured. +* It returns the LO frequencies of the RF channels after leaf dividers. +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] rxTxLoFreq Pointer to the structure contain all RX TX LO names and frequencies. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTxLoFreqGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_RxTxLoFreqReadback_t* const rxTxLoFreq); + +/** +* \brief Get temperature information for the device +* +* This function is used to get temperature information for the device. +* +* \pre This function can be used after the device has been initialized and firmware loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] avgMask Bitmask of adi_adrv903x_DevTempSensorMask_e values indicating which temperature sensor +* readings should be averaged in the tempDegreesCelsiusAvg member of the deviceTemperature structure. +* If 0 is provided, -274 will be returned for the averaged value. +* \param[in,out] deviceTemperature Pointer to structure in which device temperature data should be placed +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TemperatureGet(adi_adrv903x_Device_t* const device, + const uint16_t avgMask, + adi_adrv903x_DevTempData_t* const deviceTemperature); + +/** +* \brief Get enabled temperature sensor information for the device +* +* This function is used to get enabled temperature sensor information for the device. +* +* \pre This function can be used after the device has been initialized and firmware loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] tempEnData Pointer to uint16 in which device enabled temperature sensor data should be placed +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TemperatureEnableGet(adi_adrv903x_Device_t* const device, + uint16_t* const tempEnData); + + +/** +* \brief Set enabled temperature sensor information for the device +* +* This function is used to set enabled temperature sensor information for the device. +* +* \pre This function can be used after the device has been initialized and firmware loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in,out] tempEnData Pointer to uint16 in which device enabled temperature sensor data are set to +* in the event a temp sensor is unavailable (i.e. LDO is off for a particular PLL temp sensor) +* the returned value contains the sensors that are enabled. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TemperatureEnableSet(adi_adrv903x_Device_t* const device, + uint16_t* const tempEnData); + + +/** +* \brief This function associates a GPIO pin with stream processor GP inputs and enables stream trigger +* functionality if a valid GPIO(GPIO0-GPIO23) is assigned to the streamGpInput pins. +* +* There are 24 GPIO inputs available to trigger streams. These GPIO pins can +* be mapped to one of GPIOs[0:23]. +* GPIO input 0 must map to GPIO 0, GPIO input 1 must map to GPIO 1,,, etc.... +* +* To unmap a GPIO association with a stream GP input, please set the GPIO input +* to ADI_ADRV903X_GPIO_INVALID. +* +* \pre This function requires CPU and Stream binaries to be loaded +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] streamGpioPinCfg Pointer to the structure holding GPIO pin to stream GP input mappings (Input) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StreamGpioConfigSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_StreamGpioPinCfg_t* const streamGpioPinCfg); + +/** +* \brief This function retrieves the current Tx-ORx mapping control GPIO pins +* +* This function retrieves the GPIOs assigned for Tx-ORx mapping stream triggering +* +* \pre This function can be called anytime after ADRV903X device initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] streamGpioPinCfg Pointer to the structure which will be updated with the +* active GPIO pin to stream GP input mappings (Output) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StreamGpioConfigGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_StreamGpioPinCfg_t* const streamGpioPinCfg); + +/** +* \brief This function calculates the ORx NCO frequency shifts, given the Tx Synthesis Bandwidth limits +* +* \pre This function can be called anytime after ADRV903X device initialization +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] orxChannel The ORx channel for which the NCO frequency shifts are to be calculated +* \param[in] txSynthesisBwLower_kHz Lower limit of TX Synthesis Bandwidth +* \param[in] txSynthesisBwUpper_kHz Upper limit of TX Synthesis Bandwidth +* \param[out] ncoShiftFreqAdc_kHz Computed ORx ADC NCO frequency shift +* \param[out] ncoShiftFreqDatapath_kHz Computed ORx Datapath NCO frequency shift +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_OrxNcoFreqCalculate(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e orxChannel, + const uint32_t txSynthesisBwLower_kHz, + const uint32_t txSynthesisBwUpper_kHz, + int32_t* const ncoShiftFreqAdc_kHz, + int32_t* const ncoShiftFreqDatapath_kHz); + +/** +* \brief Configures and allocates selected GPIO pins that will trigger a Stream that handle +* Tx to Orx Mapping changes at runtime. +* +* This function will handle GPIO setup (if appropriate) and store the selected feature mode +* in the device data structure for use at runtime. +* +* \pre This function should not be called outside the initialization process of adi_adrv903x_PostMcsInit and is not called directly by the user. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingInit(adi_adrv903x_Device_t* const device); + +/** +* \brief Gets the Tx to ORx Mapping Configuration setup for the device. +* +* This function retrieves from device handle Tx to ORx mapping configuration setup during initialization. +* +* \pre This function may be called after device Post Msc Initialization. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] mappingConfig The Tx to ORx mapping configuration that was applied to the device during PostMcsInit +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingConfigGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TxToOrxMappingConfig_t * const mappingConfig); +/** +* \brief Sets the Tx to ORx external signal routing for Tx calibrations that use the ORx for observation. +* +* This function invokes the streams required to setup a Tx to ORx mapping configuration. +* +* \pre This function may be called after the Stream processor initialized and loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] mapping Tx to ORx mapping byte to apply. Corresponds to Tx to ORx Mapping Mode and +* Tx Observability Word selected during Initialization. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingSet(adi_adrv903x_Device_t* const device, + const uint8_t mapping); + +/** +* \brief Gets the Tx to ORx external signal routing for Tx calibrations that use the ORx for observation. +* +* This function retrieves from hardware the Tx channel currently mapped to the requested ORx channel +* +* \pre This function may be called after the Stream processors have been initialized and loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] orxChannel The ORx channel for which Tx channel mapping is requested +* \param[out] txChannel The Tx channel map to the ORx channel +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e orxChannel, + adi_adrv903x_TxChannels_e* const txChannel); + +/** +* \brief Updates ORx preset Atten value for selected Tx Channel(s) to be used when mapped to an ORx Channel. +* +* User also has the option to update active ORx atten, if appropriate, using immediateUpdate = 1. +* If immediate update is not desired, use immediateUpdate = 0. +* +* \pre This function may be called after device initialization is complete. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] mapping mapping for which to populate preset data to be used by Tx to ORx Mapping feature. +* (!TX_TO_ORX_EXTENDED_MAPPING_FLAG | mapping): Provide a txChannel Mask. See adi_adrv903x_TxChannels_e +* (TX_TO_ORX_EXTENDED_MAPPING_FLAG | mapping): Provide a State Mapping. See State Mappings in adi_adrv903x_TxToOrxMappingPinTable_e +* \param[in] presetAtten_dB Preset value for ORx Atten that will be automatically applied when one +* of the selected Tx Channel(s) is mapped to an ORx channel. +* \param[in] immediateUpdate Option to immediately apply the updated Tx Channel presets to any ORx Channel it is currently mapped to +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingPresetAttenSet( adi_adrv903x_Device_t* const device, + const uint32_t mapping, + const uint8_t presetAtten_dB, + const uint8_t immediateUpdate); + +/** +* \brief Retrieves ORx preset Atten value for selected Mapping to be used when mapped to an ORx Channel. +* +* \pre This function may be called after device initialization is complete. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] mapping Tx to Orx Mapping for which to retrieve preset data to be used by Tx to ORx Mapping feature. +* \param[out] presetAtten_dB Retrieved preset value for ORx Atten that will be automatically applied when the +* selected Tx Channel is mapped to an ORx channel. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingPresetAttenGet_v2( adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxToOrxMappingPinTable_e mapping, + uint8_t* const presetAtten_dB); + +/** +* \brief Retrieves ORx preset Atten value for selected Tx Channel to be used when mapped to an ORx Channel. +* +* \pre This function may be called after device initialization is complete. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txChannel Tx channel for which to retrieve preset data to be used by Tx to ORx Mapping feature. +* Valid channels include adi_adrv903x_TxChannels_TX[0-7] +* \param[out] presetAtten_dB Retrieved preset value for ORx Atten that will be automatically applied when the +* selected Tx Channel is mapped to an ORx channel. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingPresetAttenGet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + uint8_t* const presetAtten_dB); + +/** +* \brief Updates ORx preset NCO values for selected Tx Channel(s) to be used when mapped to an ORx Channel. +* +* The preset NCO setting is comprised of an ORx ADC NCO Freq and ORx Datapath NCO Freq. User also has the +* option to update active ORx NCO, if appropriate, using immediateUpdate = 1. If immediate update is not +* desired, use immediateUpdate = 0. +* +* \pre This function may be called after device initialization is complete. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] mapping mapping for which to populate preset data to be used by Tx to ORx Mapping feature. +* (!TX_TO_ORX_EXTENDED_MAPPING_FLAG | mapping): Provide a txChannel Mask. See adi_adrv903x_TxChannels_e +* (TX_TO_ORX_EXTENDED_MAPPING_FLAG | mapping): Provide a State Mapping. See State Mappings in adi_adrv903x_TxToOrxMappingPinTable_e +* \param[in] presetNco Configuration of preset values for ORx NCO Frequencies that will be automatically applied +* when one of the selected Tx Channel(s) is mapped to an ORx channel. +* \param[in] immediateUpdate Option to immediately apply the updated Tx Channel presets to any ORx Channel it is currently mapped to +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingPresetNcoSet( adi_adrv903x_Device_t* const device, + const uint32_t mapping, + const adi_adrv903x_TxToOrxMappingPresetNco_t* const presetNco, + const uint8_t immediateUpdate); + +/** +* \brief Retrieves ORx preset NCO values for selected Mapping to be used when mapped to an ORx Channel. +* +* The preset config is comprised of ORx ADC NCO Freq and ORx Datapath NCO Freq. +* +* \pre This function may be called after device initialization is complete. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] mapping Tx to Orx Mapping for which to retrieve preset data to be used by Tx to ORx Mapping feature. +* \param[out] presetNco Retrieved configuration of preset values for ORx NCO Frequencies that will be +* automatically applied when the selected Tx Channel is mapped to an ORx channel. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingPresetNcoGet_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxToOrxMappingPinTable_e mapping, + adi_adrv903x_TxToOrxMappingPresetNco_t* const presetNco); + +/** +* \brief Retrieves ORx preset NCO values for selected Tx Channel to be used when mapped to an ORx Channel. +* +* The preset config is comprised of ORx ADC NCO Freq and ORx Datapath NCO Freq. +* +* \pre This function may be called after device initialization is complete. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txChannel Tx channel for which to retrieve preset data to be used by Tx to ORx Mapping feature. +* Valid channels include adi_adrv903x_TxChannels_TX[0-7] +* \param[out] presetNco Retrieved configuration of preset values for ORx NCO Frequencies that will be +* automatically applied when the selected Tx Channel is mapped to an ORx channel. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingPresetNcoGet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxToOrxMappingPresetNco_t* const presetNco); + +/** +* \brief Reads back the version of the Stream binary loaded into the CPU memory +* +* This function reads the CPU memory to read back the major.minor.maint.build +* version for the Stream binary loaded into CPU memory. +* +* \pre This function may be called after the Stream processors have been initialized and loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] streamVersion Pointer to four parts of StreamVersion +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StreamVersionGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_Version_t* const streamVersion); + +/** +* \brief Configures the preset gain/nco variables for antenna cal +* +* Function to store predefined Antenna Cal configuration. Values in this configuration +* that correspond to user-enabled Antenna Cal options in the Stream Generator will be +* forced when Antenna Cal mode is enabled for a given Rx or Tx Channel. Configurations +* can be unique across channels. Configuration will not be forced immediately; it will +* be forced when Antenna On streams are triggered for a given Rx or Tx Channel by a +* TRX_CTRL pin. To change Tx attenuation, stream processor will use S0 index. User is +* responsible to configure the device to use S0 index(attenuation update trigger disabled) +* before using antenna cal feature. +* +* \pre This function may be called after the Stream processors have been initialized and loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] configRx Configuration structure for Rx channel +* \param[in] configTx Configuration structure for Tx channel +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalConfigSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_RxRadioCtrlAntennaCalConfig_t * const configRx, + adi_adrv903x_TxRadioCtrlAntennaCalConfig_t * const configTx); + +/** +* \brief Reads back the antenna calibration configuration for selected channel +* +* +* \pre This function may be called after the Stream processors have been initialized and loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in,out] configRx Pointer to configuration structure to be populated with readback values +* \param[in,out] configTx Pointer to configuration structure to be populated with readback values +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalConfigGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_RxRadioCtrlAntennaCalConfig_t * const configRx, + adi_adrv903x_TxRadioCtrlAntennaCalConfig_t * const configTx); + +/** +* \brief Reads back the antenna calibration error status +* +* +* \pre errStatus fields: 0b: Tx Low Stream Error (Tx antenna cal pin de-asserted when Tx channel is enabled) +* 1b: Tx High Stream Error (Tx antenna cal pin asserted when Tx channel is enabled) +* 2b: Tx Low Stream Error (Tx Low stream is triggered when antenna cal is ongoing for this channel) +* 3b: Tx High Stream Error (Tx High stream is triggered when antenna cal is ongoing for this channel) +* 4b: Rx Low Stream Error (Rx antenna cal pin de-asserted when Rx channel is enabled) +* 5b: Rx High Stream Error (Rx antenna cal pin asserted when Rx channel is enabled) +* 6b: Rx Low Stream Error (Rx Low stream is triggered when antenna cal is ongoing for this channel) +* 7b: Rx High Stream Error (Rx High stream is triggered when antenna cal is ongoing for this channel) +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] channelSel Mask to select the channel to read the configuration from. Multiple channel selection isn't allowed +* \param[out] errStatus Pointer to error status byte +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalErrorGet(adi_adrv903x_Device_t* const device, + const uint32_t channelSel, + uint8_t * const errStatus); + +/** +* \brief Function to clear error bits for selected channels - not supported in customer code +* +* For safe operation, this function must only be called when TX and/or Ant Cal state are not toggling, and also when an +* external alarm event is not active. +* +* \pre errClearMask fields: 0b: Clear Tx Low Stream Error (Tx antenna cal pin de-asserted when Tx channel is enabled) +* 1b: Clear Tx High Stream Error (Tx antenna cal pin asserted when Tx channel is enabled) +* 2b: Clear Tx Low Stream Error (Tx Low stream is triggered when antenna cal is ongoing for this channel) +* 3b: Clear Tx High Stream Error (Tx High stream is triggered when antenna cal is ongoing for this channel) +* 4b: Clear Rx Low Stream Error (Rx antenna cal pin de-asserted when Rx channel is enabled) +* 5b: Clear Rx High Stream Error (Rx antenna cal pin asserted when Rx channel is enabled) +* 6b: Clear Rx Low Stream Error (Rx Low stream is triggered when antenna cal is ongoing for this channel) +* 7b: Clear Rx High Stream Error (Rx High stream is triggered when antenna cal is ongoing for this channel) +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] channelMask Mask to select the channel to clear error bits +* \param[in] errClearMask Error clear mask +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalErrorClear(adi_adrv903x_Device_t* const device, + const uint32_t channelMask, + const uint8_t errClearMask); + +/** +* \brief Sweeps through all 20 stream processors and checks for failures and errors. +* The stream error being reported is the latest to happen. +* This function changes the error data saved from first to last. On first read the errors might be the first ones. +* +* After the errors are reported, the function clears the bits in the error registers. +* +* +* \param[in, out] device Context variable adi_adrv903x_Device_t pointer to the device data structure +* \param[out] streamErr Error array of the 20 stream processors stating which of them had errors and what these errors are +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StreamProcErrorGet( adi_adrv903x_Device_t* const device, + adi_adrv903x_StreamErrArray_t* const streamErr); + + +/** +* \brief Function to select the Rx/Tx channels to be turned on Rx/Tx antenna cal GPIO pins asserted +* GPIO pin can be selected by using Gpio*Selection fields of streamSettings structure in profile json file. +* Please check GpioFeatureSelection_e of Adrvgen6StreamSettings class. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txChannelMask Selects the Tx channels to be turned when Rx antenna cal GPIO pin asserted. Bit0:Tx0, Bit1:Tx1 and so on +* \param[in] rxChannelMask Selects the Rx channels to be turned when Tx antenna cal GPIO pin asserted. Bit0:Rx0, Bit1:Rx1 and so on +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalGpioChannelSet(adi_adrv903x_Device_t* const device, + const uint32_t txChannelMask, + const uint32_t rxChannelMask); + +/** +* \brief Function to read Tx/Rx channel selection for GPIO based antenna cal +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] txChannelMask Pointer to readback value for tx channel selection. Bit0:Tx0, Bit1:Tx1 and so on +* \param[out] rxChannelMask Pointer to readback value for rx channel selection. Bit0:Rx0, Bit1:Rx1 and so on +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalGpioChannelGet(adi_adrv903x_Device_t* const device, + uint32_t * const txChannelMask, + uint32_t * const rxChannelMask); + +/** +* \brief Configures the preset gain/nco variables for antenna cal +* +* Function to store predefined Antenna Cal configuration. Values in this configuration +* that correspond to user-enabled Antenna Cal options in the Stream Generator will be +* forced when Antenna Cal mode is enabled for a given Rx or Tx Channel. Configurations +* can be unique across channels. Configuration will not be forced immediately; it will +* be forced when Antenna On streams are triggered for a given Rx or Tx Channel by a +* TRX_CTRL pin. To change Tx attenuation, stream processor will use S0 index. User is +* responsible to configure the device to use S0 index(attenuation update trigger disabled) +* before using antenna cal feature. +* +* \pre This function may be called after the Stream processors have been initialized and loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] configRx Configuration structure for Rx channel +* \param[in] configTx Configuration structure for Tx channel +* \param[in] rxGain - gain value to apply to rx antenna cal +* \param[in] enableFreeze - enable/disable of agc freeze +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalConfigSet_v2(adi_adrv903x_Device_t* const device, + adi_adrv903x_RxRadioCtrlAntennaCalConfig_t * const configRx, + adi_adrv903x_TxRadioCtrlAntennaCalConfig_t * const configTx, + const uint8_t rxGain, + const uint8_t enableFreeze); + +/** +* \brief Configure gpio pin to control a subset of Rx or Tx channels +* +* Function to map a gpio pin to a set of rx channels in order to mimic TRx CTRL pins. Same performance +* cannot be guaranteed depending on number of features being used in stream processor. Must be called +* right after initialization phases are completed. +* +* \pre This function may be called after the Stream processors have been initialized and loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txRxCtrlGpioMap array of structs that relates the physical pin, logical pin, channels to be controlled by the gpio and if they belong to Rx or Tx. +* \param[in] numGpios size of array of gpios to be configured +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioCtrlRxTxMapSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxRxCtrlGpioMap_t txRxCtrlGpioMap[], + const uint32_t numGpios); + +/** +* \brief Gets configuration for a specific logical gpio pin. +* +* Struct output contains the mask of channels that logical pins controls and if the channels are from RX or TX. +* The physical pin connected to the logical pin must be knowning from the json profile. +* +* \pre This function may be called after the Stream processors have been initialized and loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] gpioPin gpio pin number to be used to control the channel Mask. MUST be the compatible with the info provided in the profile json. +* \param[in] gpioLogicalPin logical pin to be used that is mapped to a physical gpioPin +* \param[out] txRxCtrlGpio structure that holds the channel mask, if the channels are rx or tx, and the logical pin it refers to +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioCtrlRxTxMapGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpioPin, + const adi_adrv903x_TxRxCtrlGpioLogicalPin_e gpioLogicalPin, + adi_adrv903x_TxRxCtrlGpioMap_t* const txRxCtrlGpio); + +/** +* \brief Resets configurations set by GpioCtrlRxTxMapSet. +* +* If called for a pin with no stream configured to it, function call will fail. Logical and physical pins used +* must be in accordance to the json profile. Strucuture input can be retrieved by adi_adrv903x_GpioCtrlRxTxMapGet() +* +* \pre This function may be called after the Stream processors have been initialized and loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txRxCtrlGpioMap arrys of structures that must contain the physical, logical gpio and mapping used for that certain gpio. +* \param[in] numGpios size of array of gpios to be configured +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioCtrlRxTxMapClear(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxRxCtrlGpioMap_t txRxCtrlGpioMap[], + const uint32_t numGpios); + +#endif /* _ADI_ADRV903X_RADIOCTRL_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_radioctrl_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_radioctrl_types.h new file mode 100644 index 0000000000000..0f346c267f2e0 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_radioctrl_types.h @@ -0,0 +1,355 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_radioctrl_types.h +* \brief Contains ADRV903X data types for radio ctrl features +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef _ADI_ADRV903X_RADIOCTRL_TYPES_H_ +#define _ADI_ADRV903X_RADIOCTRL_TYPES_H_ + +#include "adi_adrv903x_lo_types.h" +#include "adi_adrv903x_dev_temp_types.h" +#include "adi_adrv903x_gpio_types.h" +#include "adi_adrv903x_rx_types.h" +#include "adi_adrv903x_tx_types.h" + +#define ADI_ADRV903X_STREAM_MAX 20 +#define ADI_ADRV903X_STREAM_BINARY_IMAGE_FILE_SIZE_BYTES (88*1024) +#define ADI_ADRV903X_TRX_CTRL_PIN_COUNT 8 +#define ADI_ADRV903X_MAX_STREAMGPIO 24 +#define ADI_ADRV903X_TX_TO_ORX_MAPPING_GPIO_MAX 8 +#define ADI_ADRV903X_TX_TO_ORX_MAPPING_PIN_TABLE_SIZE 16 +#define ADI_ADRV903X_STREAM_VERSION_ADDR 0x46A00008 + +#define ADI_ADRV903X_GPIO_AS_TRXCONTROL_MAX_NUMBER_PINS 4U + +/** +* \brief Enum of Tx Enable Modes +*/ +typedef enum adi_adrv903x_TxEnableMode +{ + ADI_ADRV903X_TX_EN_SPI_MODE = 0, /*!< Selects SPI registers to control Tx signal path on/off */ + ADI_ADRV903X_TX_EN_PIN_MODE, /*!< Selects Pin mode to control Tx signal path on/off. Tx signal path is controlled by dedicated input pins to CPU */ + ADI_ADRV903X_TX_EN_INVALID_MODE +} adi_adrv903x_TxEnableMode_e; + +/** +* \brief Enum of Rx Enable Modes +*/ +typedef enum adi_adrv903x_RxEnableMode +{ + ADI_ADRV903X_RX_EN_SPI_MODE = 0, /*!< Selects SPI registers to control Rx signal path on/off */ + ADI_ADRV903X_RX_EN_PIN_MODE, /*!< Selects Pin mode to control Rx signal path on/off. Rx signal path is controlled by dedicated input pins to CPU */ + ADI_ADRV903X_RX_EN_INVALID_MODE +} adi_adrv903x_RxEnableMode_e; + +/** +* \brief Enum of Rx Enable Modes +*/ +typedef enum adi_adrv903x_ORxEnableMode +{ + ADI_ADRV903X_ORX_EN_SPI_MODE = 0, /*!< Selects SPI registers to control ORx signal path on/off */ + ADI_ADRV903X_ORX_EN_PIN_MODE, /*!< Selects Pin mode to control ORx signal path on/off. Rx signal path is controlled by dedicated input pins to CPU */ + ADI_ADRV903X_ORX_EN_INVALID_MODE +} adi_adrv903x_ORxEnableMode_e; +/** + * \brief Enum of the eight TxRx Enable Pins + */ +typedef enum adi_adrv903x_TxRxEnPin +{ + ADI_ADRV903X_TXRXEN_PIN0 = 0x01, /*!< TxRxEn Pin0 */ + ADI_ADRV903X_TXRXEN_PIN1 = 0x02, /*!< TxRxEn Pin1 */ + ADI_ADRV903X_TXRXEN_PIN2 = 0x04, /*!< TxRxEn Pin2 */ + ADI_ADRV903X_TXRXEN_PIN3 = 0x08, /*!< TxRxEn Pin3 */ + ADI_ADRV903X_TXRXEN_PIN4 = 0x10, /*!< TxRxEn Pin4 */ + ADI_ADRV903X_TXRXEN_PIN5 = 0x20, /*!< TxRxEn Pin5 */ + ADI_ADRV903X_TXRXEN_PIN6 = 0x40, /*!< TxRxEn Pin6 */ + ADI_ADRV903X_TXRXEN_PIN7 = 0x80, /*!< TxRxEn Pin7 */ + ADI_ADRV903X_TXRXEN_PINALL = 0xFF /*!< All TxRxEn pins */ +} adi_adrv903x_TxRxEnPin_e; + +/** +* \brief Enum of the TxRx Enable Pin Configuration settings +*/ +typedef enum adi_adrv903x_TxRxEnCfg +{ + ADI_ADRV903X_TXRXEN_TX_ENABLE_MAP = 0x01, /*!< Selects the Tx Enable mapping configuration */ + ADI_ADRV903X_TXRXEN_TX_ALTENABLE_MAP = 0x02, /*!< Selects the Tx Alternate Enable mapping configuration */ + ADI_ADRV903X_TXRXEN_RX_ENABLE_MAP = 0x04, /*!< Selects the Rx Enable mapping configuration */ + ADI_ADRV903X_TXRXEN_RX_ALTENABLE_MAP = 0x08, /*!< Selects the Rx AlternateEnable mapping configuration */ + ADI_ADRV903X_TXRXEN_ALL = 0x0F /*!< Selects all members in the structure */ +} adi_adrv903x_TxRxEnCfg_e; + +/** + * \brief Enum to select desired Tx to ORx Mapping Mode to be used for GPIO/API control + */ +typedef enum adi_adrv903x_TxToOrxMappingMode +{ + ADI_ADRV903X_TX_ORX_MAPPING_MODE_2BIT = 2U, /*!< 2Bit Tx to ORx Mapping Mode*/ + ADI_ADRV903X_TX_ORX_MAPPING_MODE_3BIT = 3U, /*!< 3Bit Tx to ORx Mapping Mode*/ + ADI_ADRV903X_TX_ORX_MAPPING_MODE_4BIT = 4U, /*!< 4Bit Tx to ORx Mapping Mode*/ + ADI_ADRV903X_TX_ORX_MAPPING_MODE_6BIT = 6U, /*!< 6Bit Tx to ORx Mapping Mode*/ + ADI_ADRV903X_TX_ORX_MAPPING_MODE_8BIT = 8U, /*!< 8Bit Tx to ORx Mapping Mode*/ +} adi_adrv903x_TxToOrxMappingMode_e; + +/** + * \brief Enum to select desired Tx Channel Mapping for a GPIO Pin state + */ +typedef enum adi_adrv903x_TxToOrxMappingPinTable +{ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX0 = 0x000U, /*!< Pin state selects Tx0 */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX1 = 0x001U, /*!< Pin state selects Tx1 */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX2 = 0x002U, /*!< Pin state selects Tx2 */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX3 = 0x003U, /*!< Pin state selects Tx3 */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX4 = 0x004U, /*!< Pin state selects Tx4 */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX5 = 0x005U, /*!< Pin state selects Tx5 */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX6 = 0x006U, /*!< Pin state selects Tx6 */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX7 = 0x007U, /*!< Pin state selects Tx7 */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_NONE = 0x008U, /*!< Pin state selects No Mapping */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_NO_CHANGE = 0x00FU, /*!< Pin state causes no change in current mapping */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_0 = 0x009U, /*!< State 0 */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_1 = 0x00AU, /*!< State 1 */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_2 = 0x00BU, /*!< State 2 */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_3 = 0x00CU, /*!< State 3 */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_4 = 0x00DU, /*!< State 4 */ + ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_5 = 0x00EU /*!< State 5 */ +} adi_adrv903x_TxToOrxMappingPinTable_e; + +/** +* \brief Data structure to hold Tx Signal Path Control configurations +*/ +typedef struct adi_adrv903x_TxRadioCtrlModeCfg +{ + adi_adrv903x_TxEnableMode_e txEnableMode; /*!< Configuration for Tx Channel Enable mode */ + uint32_t txChannelMask; /*!< Tx channels for which configuration is valid */ +} adi_adrv903x_TxRadioCtrlModeCfg_t; + +/** +* \brief Data structure to hold Rx Signal Path Control configurations +*/ +typedef struct adi_adrv903x_RxRadioCtrlModeCfg +{ + adi_adrv903x_RxEnableMode_e rxEnableMode; /*!< Configuration for Rx Channel Enable mode */ + uint32_t rxChannelMask; /*!< Rx channels for which configuration is valid */ +} adi_adrv903x_RxRadioCtrlModeCfg_t; + +/** +* \brief Data structure to hold ORx Signal Path Control configurations +*/ +typedef struct adi_adrv903x_ORxRadioCtrlModeCfg +{ + adi_adrv903x_ORxEnableMode_e orxEnableMode; /*!< Configuration for ORx Channel Enable mode */ + uint32_t orxChannelMask; /*!< ORx channels for which configuration is valid */ +} adi_adrv903x_ORxRadioCtrlModeCfg_t; + +/** +* \brief Data structure to hold Signal Path Control configurations +*/ +typedef struct adi_adrv903x_RadioCtrlModeCfg +{ + adi_adrv903x_TxRadioCtrlModeCfg_t txRadioCtrlModeCfg; /*!< Tx signal path enable mode configuration */ + adi_adrv903x_RxRadioCtrlModeCfg_t rxRadioCtrlModeCfg; /*!< Rx signal path enable mode configuration */ + adi_adrv903x_ORxRadioCtrlModeCfg_t orxRadioCtrlModeCfg; /*!< ORx signal path enable mode configuration */ +} adi_adrv903x_RadioCtrlModeCfg_t; + +/** +* \brief Data structure to hold the LO configuration settings +*/ +typedef struct adi_adrv903x_LoConfig +{ + adi_adrv903x_LoName_e loName ; /*!< Select the target RF LO source */ + uint64_t loFrequency_Hz ; /*!< Desired RF LO frequency in Hz */ + adi_adrv903x_LoOption_e loConfigSel ; /*!< Select for LO config */ + } adi_adrv903x_LoConfig_t ; + +/** +* \brief Data structure to indicate to which PLL Tx and Rx Channels are connected. +*/ +typedef struct adi_adrv903x_ChanCtrlToPlls +{ + uint8_t rf0MuxTx0_3; /*!< If set to 1 East Tx channels (Tx0-3) are connected to PLL0 (East PLL). If set to 0 Tx0-3 are connected to PLL1 (West PLL) */ + uint8_t rf0MuxTx4_7; /*!< If set to 1 West Tx channels (Tx4-7) are connected to PLL0 (East PLL). If set to 0 Tx4-7 are connected to PLL1 (West PLL) */ + uint8_t rf0MuxRx0_3; /*!< If set to 1 East Rx channels (Rx0-3) are connected to PLL0 (East PLL). If set to 0 Rx0-3 are connected to PLL1 (West PLL) */ + uint8_t rf0MuxRx4_7; /*!< If set to 1 West Rx channels (Rx4-7) are connected to PLL0 (East PLL). If set to 0 Rx4-7 are connected to PLL1 (West PLL) */ +}adi_adrv903x_ChanCtrlToPlls_t ; + +/** +* \brief Data structure to hold the LO configuration read back values. +*/ +typedef struct adi_adrv903x_LoConfigReadback +{ + adi_adrv903x_LoName_e loName ; /*!< Select the target RF LO source to read back */ + uint64_t loFrequency_Hz ; /*!< RF LO frequency in Hz */ +} adi_adrv903x_LoConfigReadback_t ; + +/** +* \brief Data structure to hold the Radio Control GPIO pin information. +*/ +typedef struct adi_adrv903x_RadioCtrlTxRxEnCfg +{ + uint8_t txEnMapping[ADI_ADRV903X_TRX_CTRL_PIN_COUNT]; /*!< Tx Enable Pin bitfield. Each bit in each byte corresponds to Each Tx Channel, eg txEnMapping[0] => ADI_ADRV903X_TX0. Use adi_adrv903x_TxChannels_e to build up bitmask. */ + uint8_t txAltMapping[ADI_ADRV903X_TRX_CTRL_PIN_COUNT]; /*!< Tx Alternate Enable Pin bitfield. Each bit in each byte corresponds to Each Tx Channel, eg txAltMapping[0] => ADI_ADRV903X_TX0. Use adi_adrv903x_TxChannels_e to build up bitmask. */ + uint8_t rxEnMapping[ADI_ADRV903X_TRX_CTRL_PIN_COUNT]; /*!< Rx Enable Pin bitfield. Each bit in each byte corresponds to Each Rx Channel, eg rxEnMapping[0] => ADI_ADRV903X_RX0. Use adi_adrv903x_RxChannels_e to build up bitmask. */ + uint8_t rxAltMapping[ADI_ADRV903X_TRX_CTRL_PIN_COUNT]; /*!< Rx Alternate Enable Pin bitfield. Each bit in each byte corresponds to Each Rx Channel, eg rxAltMapping[0] => ADI_ADRV903X_RX0. Use adi_adrv903x_RxChannels_e to build up bitmask. */ +} adi_adrv903x_RadioCtrlTxRxEnCfg_t; + +/** +* \brief Data structure to hold Synthesizer RF LO Loop filter settings +*/ +typedef struct adi_adrv903x_LoLoopFilterCfg +{ + uint16_t loopBandwidth_kHz; /*!< Synthesizer LO Loop filter bandwidth. Range 60-1000 */ + uint8_t phaseMargin_degrees; /*!< Synthesizer LO Loop filter phase margin in degrees. Range 45-75 */ +} adi_adrv903x_LoLoopFilterCfg_t; + +/** +* \brief Data structure to hold Stream GPIO pin assignments. +*/ +typedef struct adi_adrv903x_StreamGpioPinCfg +{ + adi_adrv903x_GpioPinSel_e streamGpInput[ADI_ADRV903X_MAX_STREAMGPIO]; /*!< Enable GPIO pin input to ADRV903X stream processor GP input. To enable set streamGpInput[0]=GPIO_00, streamGpInput[1]=GPIO_01,,etc. To disable select ADI_ADRV903X_GPIO_INVALID */ +} adi_adrv903x_StreamGpioPinCfg_t; + +/** + * \brief Data structure to hold Tx to ORx configuration settings. + */ +typedef struct adi_adrv903x_TxToOrxMappingConfig +{ + uint16_t txObservability; /*!< Tx observability word. This is a bitmask consisting of eight 2bit-pairs (nibbles), where each nibble makes a Tx channel observable by either ORx0 (set nibble to 2'b01 = 1), ORx1 (set nibble to 2'b10 = 2), or neither (set nibble to 2'b00 = 0). It is not allowed for a single Tx channel to be observable on both ORx0 and ORx1 (e.g. setting a nibble to 2'b11 = 3 is invalid). For example, setting B0 = Tx0 obs by ORx0, B1 = Tx0 obs by Orx1, ..., B8 = Tx4 obs by Orx0, B9 = Tx4 obs on Orx1, ..., B14 = Tx7 obs by Orx0, B15 = Tx7 obs on Orx1 */ + adi_adrv903x_TxToOrxMappingMode_e mode; /*!< Tx to ORx Mapping Mode */ + adi_adrv903x_GpioPinSel_e gpioSelect[ADI_ADRV903X_TX_TO_ORX_MAPPING_GPIO_MAX]; /*!< Select up to 8 GPIO to set mapping */ + adi_adrv903x_TxToOrxMappingPinTable_e pinTableOrx0[ADI_ADRV903X_TX_TO_ORX_MAPPING_PIN_TABLE_SIZE]; /*!< ORX0 Look-Up Table for Tx Channel selection based on GPIO pin states */ + adi_adrv903x_TxToOrxMappingPinTable_e pinTableOrx1[ADI_ADRV903X_TX_TO_ORX_MAPPING_PIN_TABLE_SIZE]; /*!< ORX1 Look-Up Table for Tx Channel selection based on GPIO pin states */ + uint8_t autoSwitchOrxAttenEnable; /*!< Auto-switching of Orx Atten value enabled. 0 = Disabled. 1 = Enabled */ + uint8_t autoSwitchOrxNcoEnable; /*!< Auto-switching of Orx NCO frequency enabled. 0 = Disabled. 1 = Enabled */ +} adi_adrv903x_TxToOrxMappingConfig_t; + +/** + * \brief Structure for preset data used in Tx To Orx Mapping Auto-Update of ORx Atten and NCO Freq based on Mapping + */ +typedef struct adi_adrv903x_TxToOrxMappingPresetNco +{ + int32_t ncoFreqAdc_Khz; + int32_t ncoFreqDatapath_Khz; +} adi_adrv903x_TxToOrxMappingPresetNco_t; + +/** + * \brief loopfilter RX/TX LO command response structure + */ +typedef struct adi_adrv903x_RxTxLoFreqReadback +{ + adi_adrv903x_LoName_e rxLoName [ADI_ADRV903X_MAX_RX_ONLY]; /*!< PLL number of Rx Channels */ + uint32_t rxFreq_Khz [ADI_ADRV903X_MAX_RX_ONLY]; /*!< Freq of Rx Channels */ + adi_adrv903x_LoName_e txLoName [ADI_ADRV903X_MAX_TXCHANNELS]; /*!< PLL number of Tx Channels */ + uint32_t txFreq_Khz [ADI_ADRV903X_MAX_TXCHANNELS]; /*!< Freq of Tx Channels */ +} adi_adrv903x_RxTxLoFreqReadback_t ; + +/** +* \brief Struct for ADRV903X Antenna Cal Mode Pre-set Configuration for Rx +*/ +typedef struct adi_adrv903x_RxRadioCtrlAntennaCalConfig +{ + uint32_t rxChannelMask; /*!< Rx Channel selection */ + uint8_t rxGainIndex; /*!< Rx Gain table index to use during Antenna Cal */ + int32_t rxNcoFreqKhz; /*!< Rx NCO Frequency to use during Antenna Cal */ +} adi_adrv903x_RxRadioCtrlAntennaCalConfig_t; + +/** +* \brief Struct for ADRV903X Antenna Cal Mode Pre-set Configuration for Tx +*/ +typedef struct adi_adrv903x_TxRadioCtrlAntennaCalConfig +{ + uint32_t txChannelMask; /*!< Tx Channel selection */ + uint16_t txAttenuation_mdB; /*!< Tx Attenuation value to use during Antenna Cal [mdB] */ + int32_t txNcoFreqKhz; /*!< Tx NCO Frequency to use during Antenna Cal */ +} adi_adrv903x_TxRadioCtrlAntennaCalConfig_t; + +/** + * \brief Enum to classify the stream type being analyzed + */ +typedef enum adi_adrv903x_StreamProcType +{ + ADI_ADRV903X_STREAM_MAIN = 0U, + ADI_ADRV903X_STREAM_KFA = 1U, + ADI_ADRV903X_STREAM_RX = 2U, + ADI_ADRV903X_STREAM_TX = 3U, + ADI_ADRV903X_STREAM_ORX = 4U +} adi_adrv903x_StreamProcType_e; + +/** +* \brief Enum to indicate error cause (is the output of sp_rdbk_error_val register of each stream processor +*/ +typedef enum adi_adrv903x_StreamError +{ + ADI_ADRV903X_STREAM_ERR_NONE = 0U, + ADI_ADRV903X_STREAM_ERR_SPI_ADDR = 1U, + ADI_ADRV903X_STREAM_ERR_CHECK_INSTR = 2U, + ADI_ADRV903X_STREAM_ERR_TIMEOUT = 4U, + ADI_ADRV903X_STREAM_ERR_STACK_OVERFLOW = 8U, + ADI_ADRV903X_STREAM_ERR_INVALID_STREAM_NUM = 16U, + ADI_ADRV903X_STREAM_ERR_AHB_ADDR = 32U, + ADI_ADRV903X_STREAM_ERR_INVALID_INSTR = 64U, + ADI_ADRV903X_STREAM_ERR_EXT_TIMER = 128U, + ADI_ADRV903X_STREAM_ERR_FIFO_FULL = 256U, + ADI_ADRV903X_STREAM_ERR_POSTED_HRESP_ON_SYSBUS = 512U +} adi_adrv903x_StreamError_e; + +/** +* \brief Data structure to hold each stream processor error information (the stream processor, the stream number and the error code) +*/ +typedef struct adi_adrv903x_StreamErr +{ + uint8_t streamProcId; /*!< stream processor id. Together with streamProcType indicates the Stream Proc */ + uint8_t erroredStreamNumber; /*!< output of reading the sp_errored_stream_number_register */ + adi_adrv903x_StreamProcType_e streamProcType; /*!< would say what type of stream we are dealing with */ + adi_adrv903x_StreamError_e streamErrEnum; /*!< output of reading the sp_rdbk_error_val in enum form */ +} adi_adrv903x_StreamErr_t; + +/** +* \brief Data structure to hold all StreamErr elements inside an array. +*/ +typedef struct adi_adrv903x_StreamErrArray +{ + adi_adrv903x_StreamErr_t streamProcArray[ADI_ADRV903X_STREAM_MAX]; +} adi_adrv903x_StreamErrArray_t; + + +/** +* \brief Enum to classify the abstract gpio's used for using gpio's to trigger Rx and/or Tx channels +*/ +typedef enum adi_adrv903x_TxRxCtrlGpioLogicalPin +{ + ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_0 = 0U, + ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_1 = 1U, + ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_2 = 2U, + ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_3 = 3U +} adi_adrv903x_TxRxCtrlGpioLogicalPin_e; + +/** +* \brief Enum to classify the abstract gpio's used for using gpio's to trigger Rx and/or Tx channels +*/ +typedef enum adi_adrv903x_TxRxCtrlGpioRxOrTx +{ + ADRV903X_STREAM_TRIGGER_GPIO_TXRXMASK_RX = 0x1U, + ADRV903X_STREAM_TRIGGER_GPIO_TXRXMASK_TX = 0x2U +} adi_adrv903x_TxRxCtrlGpioRxOrTx_e; + +/** +* \brief Data structure to hold all StreamErr elements inside an array. +*/ +typedef struct adi_adrv903x_TxRxCtrlGpioMap +{ + adi_adrv903x_TxRxCtrlGpioLogicalPin_e logicalPin; /*!< Logical pin to be mapped internally with a physical gpio pin and a channel mask to control if channels are ON or OFF. */ + adi_adrv903x_GpioPinSel_e gpioPin; /*!< Physical gpio pin that when HIGH or LOW is to control the channels inside channelMask of Tx or Rx depending on rxTxMask value. */ + uint8_t channelMask; /*!< Mask containing the desired channels to be controlled. Bit 0 means channel 0 and so on. 1 means mapped to this gpio and 0 means ignored. */ + adi_adrv903x_TxRxCtrlGpioRxOrTx_e rxTxMask; /*!< Contains if the channels being controlled are for rx or tx. 1 means Rx and 2 means Tx. */ + +} adi_adrv903x_TxRxCtrlGpioMap_t; + +#endif /* RADIOCTRL_TYPES */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_rx.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_rx.h new file mode 100644 index 0000000000000..1bd145b9813d5 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_rx.h @@ -0,0 +1,809 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adi_adrv903x_rx.h + * \brief Contains ADRV903X receive related function prototypes for + * adi_adrv903x_rx.c + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_RX_H_ +#define _ADI_ADRV903X_RX_H_ + +#include "adi_adrv903x_rx_types.h" +#include "adi_adrv903x_rx_nco.h" +#include "adi_adrv903x_error.h" + +/**************************************************************************** + * Initialization functions + **************************************************************************** + */ + + /** + * \brief Programs the gain table settings for Rx channels. + * + * This function can be called by the user to load a custom gain table or + * to reconfigure the gain table.The gain table for a receiver type is set with the + * parameters passed by adi_adrv903x_RxGainTableRow_t gainTablePtr array. + * The array length (n) is dependent upon receiver type. + * The (n) value is conveyed by numGainIndicesInTable. + * All gain tables have a maximum index and a minimum index specified by + * MAX_RX_GAIN_TABLE_NUMINDICES and MIN_RX_GAIN_TABLE_INDEX + * The minimum gain index is application dependent, this can be modified + * in the user space, the absolute maximum and minimum indices are specified + * by MAX_GAIN_TABLE_INDEX and MIN_GAIN_TABLE_INDEX + * + * The Rx max gain index is user configurable. A separate call has to be made + * to adi_adrv903x_RxMinMaxGainIndexSet() API to update the min and max gain + * indices for a given Rx Channel. Updating min and max gain indices are + * decoupled from the main gain table loading so that the user has flexibility + * to load multiple gain table regions and switch between them during runtime. + * + * The gain table configs can be broadcast / multicast based on the channel mask + * parameter in adi_adrv903x_RxGainTableCfg_t structure. + * + *| rxChannelMask | Rx Channels Programmed | + *|:------------------------------------:|:-------------------------------------:| + *| bit[0] = 1 | Enables Rx0 gain table programming---| + *| bit[1] = 1 | Enables Rx1 gain table programming---| + *| bit[2] = 1 | Enables Rx2 gain table programming---| + *| bit[3] = 1 | Enables Rx3 gain table programming---| + *| bit[4] = 1 | Enables Rx4 gain table programming---| + *| bit[5] = 1 | Enables Rx5 gain table programming---| + *| bit[6] = 1 | Enables Rx6 gain table programming---| + *| bit[7] = 1 | Enables Rx7 gain table programming---| + * + * Eg: To program the same gain table to channels Rx0 and Rx4, the rxChannelMask + * should be set to 0x00000011 + * + * Eg: To program a single gain table to all channels, the rxChannelMask + * should be set to 0x000000FF + * + * Partial gain table loads can be done through this API in case of memory constraints / multiple region loading + * For example, consider a 256 row gain table which needs to be loaded in 4 consecutive calls. + * In this case the config parameters for partial loads would be + * Partial Load 1 : gainTableRow[] = gainTable[63:0], gainIndexOffset = 63, numGainIndicesInTable = 64 + * Partial Load 2 : gainTableRow[] = gainTable[127:64], gainIndexOffset = 127, numGainIndicesInTable = 64 + * Partial Load 3 : gainTableRow[] = gainTable[191:128], gainIndexOffset = 191, numGainIndicesInTable = 64 + * Partial Load 4 : gainTableRow[] = gainTable[255:192], gainIndexOffset = 255, numGainIndicesInTable = 64 + * + * Post this multiple partial gain table load, call the function adi_adrv903x_RxMinMaxGainIndexSet(minIndex = 0, maxIndex = 255). + * + * \pre This function called automatically in adi_adrv903x_Initialize() to load + * the default gain table. If the BBIC desires to change or update the + * gain table, it may call this function after initialization but before + * running init cals. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep{device->devStateInfo} + * \dep_end + * + * \param[in,out] device Context variable - Context variable - Structure pointer to the ADRV903X device data structure + * \param[in] rxChannelMask is the set of channels for which current gain table settings are to be programmed. + * Valid Rx channels include Rx0-Rx7 + * \param[in] gainIndexOffset is the starting gain index from which gain table is programmed + * \param[in] gainTableRow Array of gain table row entries for programming + * \param[in] arraySize is the number of gain table rows to be programmed + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainTableWrite(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint8_t gainIndexOffset, + const adi_adrv903x_RxGainTableRow_t gainTableRow[], + const uint32_t arraySize ); +/** +* \brief Reads the gain table entries for Rx channels requested. +* +* This function can be called by the user to read back the currently programmed gain table +* for a given channel. This function reads the current gain table settings from ADRV903X gain table Static RAMs +* for the requested channel and stores it in the provided memory reference of type adi_adrv903x_RxGainTableCfg_t +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in,out] device Context variable - Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] rxChannel represents the channels for which gain table read back is requested. +* Valid Rx channels include Rx0-Rx7 +* \param[in] gainIndexOffset is the gain index from which gain table read back should start +* \param[in,out] gainTableRow Read back array for gain table row entries which will be updated with the read back values +* \param[in] arraySize is the size of gainTableRow array. It is also the upper limit for the no. of gain indices to read +* \param[out] numGainIndicesRead is the actual no. of gain indices read from SRAM (output). A NULL can be passed +* if the value of no. of gain indices actually read is not required. +* +* \pre This function can be called by the user anytime after initialization. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainTableRead(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint8_t gainIndexOffset, + adi_adrv903x_RxGainTableRow_t gainTableRow[], + const uint32_t arraySize, + uint16_t* const numGainIndicesRead); + +/** +* \brief Updates the minimum and maximum gain indices for a requested Rx Channel +* in the device data structure +* +* This function is required to be called by the user right after loading the gain table. +* This function is decoupled from the gain table loading function so that a user has +* flexibility to load multiple gain table regions and switch between multiple gain table +* regions during runtime +* +* The gain table configs can be broadcast / multicast based on the channel mask +* parameter in adi_adrv903x_RxGainTableCfg_t structure. +* +*| rxChannelMask | Rx Channel min & max gain indices updated | +*|:------------------------------------:|:----------------------------------------------:| +*| bit[0] = 1 | Updates Rx0 min & max gain indices------------| +*| bit[1] = 1 | Updates Rx1 min & max gain indices------------| +*| bit[2] = 1 | Updates Rx2 min & max gain indices------------| +*| bit[3] = 1 | Updates Rx3 min & max gain indices------------| +*| bit[4] = 1 | Updates Rx4 min & max gain indices------------| +*| bit[5] = 1 | Updates Rx5 min & max gain indices------------| +*| bit[6] = 1 | Updates Rx6 min & max gain indices------------| +*| bit[7] = 1 | Updates Rx7 min & max gain indices------------| + +* +* Eg: To update min and max gain indices of channels Rx4 and Rx0, the rxChannelMask +* should be set to 0x00000011 +* +* Eg: To update min and max gain indices of all Rx channels, the rxChannelMask +* should be set to 0x000000FF +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in,out] device Context variable - Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] rxChannelMask channel masks for which min and max gain indices are to be updated +* \param[in] minGainIndex is the lower limit of the gain index for a given channel +* \param[in] maxGainIndex is the upper limit of the gain index for a given channel +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxMinMaxGainIndexSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint8_t minGainIndex, + const uint8_t maxGainIndex); + +/** +* \brief Enable or disable the routing of the external control word from an Rx channel's +* gain table to its external analog GPIO pins. +* +* Typically, these signals are used to control an external LNA. +* The two LSBs of the external control word for Rx channel 0 are output on GPIO_ANA[0:1] +* (the LSB itself on GPIO_ANA0) and so on for the other channels up to Rx channel 7 +* whose external control word is output on GPIO_ANA[14:15]. The mapping from Rx channel +* to analog GPIO pins is fixed. It can be enabled or disabled but the mapping cannot +* be changed. See Full Table below. +* +* If external control for a channel is disabled then it's corresponding analog GPIOs +* are placed in input/high-Z mode. +* +* If rxChannelMask = 0, this is allowed and function will reduce to a No-op command +* +* Rx Channel Analog GPIO pins Table: +* RX0 Gain Control Word [1:0] : GPIO_ANA[1:0] +* RX1 Gain Control Word [1:0] : GPIO_ANA[3:2] +* RX2 Gain Control Word [1:0] : GPIO_ANA[5:4] +* RX3 Gain Control Word [1:0] : GPIO_ANA[7:6] +* RX4 Gain Control Word [1:0] : GPIO_ANA[9:8] +* RX5 Gain Control Word [1:0] : GPIO_ANA[11:10] +* RX6 Gain Control Word [1:0] : GPIO_ANA[13:12] +* RX7 Gain Control Word [1:0] : GPIO_ANA[15:14] +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep{device->devStateInfo} +* \dep_end +* +* \param[in,out] device Context variable - Structure pointer to the ADRV903X device data structure +* \param[in] rxChannelMask Channel bit-mask indicating the Rx channels affected by the call. +* \param[in] channelEnable Enable bit-mask indicating the final state of the channels included in rxChannelMask +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainTableExtCtrlPinsSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint32_t channelEnable); + +/**************************************************************************** + * Runtime functions + **************************************************************************** + */ + + /** + * \brief Sets the Rx Channel Manual Gain Index + * + * If the value passed in the gainIndex parameter is within range of the gain + * table minimum and maximum indices, the Rx channel gain index will be written + * to the transceiver. Else, an error will be returned. The maximum index is 255 + * and the minimum index is application specific. + * + * The default gain table can take values between 0xB7 and 0xFF, + * even though every index is accessible from 0x00 to 0xFF. + * + * \pre This function may be called any time after device initialization + The device must NOT be in spi streaming mode due to this function utilizing the hal layer directly. + If the device is in spi streaming mode, this function may not behave as expected. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure + * \param[in] rxGain is the channelized gain setting parameter + * \param[in] arraySize Size of rxGain array representing no. of configs. + * + * The gain table configs can be broadcast / multicast based on the channel mask + * parameter in adi_adrv903x_RxGain_t structure. + * + *| rxGain[i]->rxChannelMask | Rx Channels to set manual gain | + *|:----------------------------------:|:----------------------------------:| + *| bit[0] | 1 = Rx0 manual gain is updated | + *| bit[1] | 1 = Rx1 manual gain is updated | + *| bit[2] | 1 = Rx2 manual gain is updated | + *| bit[3] | 1 = Rx3 manual gain is updated | + *| bit[4] | 1 = Rx4 manual gain is updated | + *| bit[5] | 1 = Rx5 manual gain is updated | + *| bit[6] | 1 = Rx6 manual gain is updated | + *| bit[7] | 1 = Rx7 manual gain is updated | + * + * Eg: To update manual gain for channels Rx3 and Rx0, the rxGain[i]->rxChannelMask + * should be set to 0x00000009 + * + * Eg: To update manual gain for all Rx channels, the rxGain[i]->rxChannelMask + * should be set to 0x000000FF + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxGain_t rxGain[], + const uint32_t arraySize); + +/** +* \brief Reads the Rx MGC Gain Index for the requested Rx channel +* +* This function reads the gain index for the passed channel Rx0-Rx7 +* +* This function reads back the Manual gain index per channel, depending on the gain control mode. +* +* \pre This function may be called any time after device initialization. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X data structure +* \param[in] rxChannel Channel selection to read back gain index for (Valid Rx0-Rx7 only) +* \param[out] rxGain Pointer to the specified channel gain index value +* which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxMgcGainGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxGain_t * const rxGain); + +/** +* \brief Reads the Rx AGC Gain Index for the requested Rx channel +* +* This function reads the gain index for the passed channel Rx0-Rx7 +* +* This function reads back the AGC gain index per channel, depending on the gain control mode. +* +* +* \pre This function may be called any time after device initialization. +* However, gain indices are tracked only after the device goes into a +* Receiver mode. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X data structure +* \param[in] rxChannel Channel selection to read back gain index for (Valid Rx0-Rx7 only) +* \param[out] rxGain Pointer to the specified channel gain index value +* which will be updated by this function +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxGain_t * const rxGain); + + +/** +* \brief Retrieves the Rx data path format configuration. +* +* This function will read the current configuration of Rx Data format over the JESD link. +* This function also reads back the current configuration of slicer and formatter blocks +* in the receive signal chain. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the device settings structure +* \param[in] rxChannel The channel for which Rx data path format configuration is requested +* \param[out] rxDataFormat Pointer to the Rx data format configuration structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxDataFormatGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxDataFormatRt_t * const rxDataFormat); + +/** +* \brief Gets the gain slicer position +* +* Before this information is valid, the Rx gain compensation feature should be enabled with +* the integer gain slicer sample format enabled. See the adrv903x_RxDataFormatSet function +* to enable gain compensation. This function is not useful in the case of using floating point +* as the gain slicer (data scaling) is applied in the floating point scaled sample. This function +* is also not valid if the selected data format is external slicer mode. +* +* The slicer position is only needed for integer 12bit and 16bit formats. The 24bit sample format +* already applies scaling in the 24bit sample. The data can be scaled in steps of 1dB, 2dB, 4dB, +* 6dB, 8dB configured through the adrv903x_RxDataFormatSet function. +* +* Slicer Position[2:0] | Description +* ---------------------|--------------------------------------------- +* 0 | 0dB gain +* 1 | Rx Data samples should be scaled by 1 x step size(dB) +* 2 | Rx Data samples should be scaled by 2 x step size(dB) +* 3 | Rx Data samples should be scaled by 3 x step size(dB) +* 4 | Rx Data samples should be scaled by 4 x step size(dB) +* 5 | Rx Data samples should be scaled by 5 x step size(dB) +* 6 | Rx Data samples should be scaled by 6 x step size(dB) +* 7 | Rx Data samples should be scaled by 7 x step size(dB) +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X data structure +* \param[in] rxChannel Channel selection to read back gain index for +* \param[out] slicerPosition Pointer to byte which returns the slicer position bits for the requested channel. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxSlicerPositionGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint8_t * const slicerPosition); + +/** +* \brief This function reads back the LO Source Mapping to the requested Rx channel. +* +* The LO source select for a given channel is configured during init time. This function +* can be used to read back the configuration during run time. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X data structure +* \param[in] rxChannel Enum to select Rx Channel +* \param[out] rxLoSource Pointer to store Rx channel LO source mapping read back +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxLoSourceGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_LoSel_e * const rxLoSource); + +/** +* \brief Sets the specified Rx NCOs to the given frequency, band number, and enable state in the adi_adrv903x_RxNcoConfig_t structure. +* +* \pre This function can be called after the CPU has been initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in,out] rxNcoConfig Pointer to the RX NCO config settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxNcoShifterSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxNcoConfig_t * const rxNcoConfig); + +/** +* \brief Gets RX NCO parameters in adi_adrv903x_RxNcoConfigReadbackResp_t structure. +* +* \pre This function can be called after the CPU has been initialized, firmware loaded and the RX NCO configured. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in,out] rxRbConfig Pointer to the RX NCO config read back settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxNcoShifterGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_RxNcoConfigReadbackResp_t* const rxRbConfig); + +/** +* \brief Sets the specified Orx NCOs to the given frequency, band number, and enable state in the adi_adrv903x_ORxNcoConfig_t structure. +* +* This function will also update all Tx To Orx Mapping preset NCO ADC frequencies when called, with the frequency passed. If no preset +* frequencies should be overwritten, refer to OrxNcoSet_v2. +* +* \pre This function can be called after the CPU has been initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in,out] orxNcoConfig Pointer to the ORX NCO config settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_OrxNcoSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_ORxNcoConfig_t * const orxNcoConfig); + +/** +* \brief Sets the specified Orx NCOs to the given frequency, band number, and enable state in the adi_adrv903x_ORxNcoConfig_t structure. +* +* Different than OrxNcoSet(), this function does not interact or update the Tx to Orx Mapping presets when called, it writes and updates +* the NCO frequencies directly. If the Tx To Orx Mapping selection is changed the NCO frequencies will revert to the preset values. +* +* \pre This function can be called after the CPU has been initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in,out] orxNcoConfig Pointer to the ORX NCO config settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_OrxNcoSet_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_ORxNcoConfig_t * const orxNcoConfig); + +/** +* \brief Gets ORX NCO parameters in adi_adrv903x_OrxNcoConfigReadback_t structure. +* +* \pre This function can be called after the CPU has been initialized, firmware loaded and the ORX NCO configured. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in,out] orxRbConfig Pointer to the ORX NCO config read back settings +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_OrxNcoGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_ORxNcoConfigReadbackResp_t* const orxRbConfig); + +/** +* \brief Function to configure Rx decimated power measurement block. +* +* This function can be used to configure decimated power measurements. User can either manually enable/disable +* decimated power measurements or allow AGC block to control power measurements. Measurement point can be selected +* for main path decimated power block only. This function configures Rx dec power block. For Orx dec power block +* please use adi_adrv903x_ORxDecimatedPowerCfgSet function +* Note: The function does not check for duplicated channel assignments across cfg structures. +* Invalid channel mask values will return an error. + +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] rxDecPowerCfg array of structures of type adi_adrv903x_RxDecimatedPowerCfg_t which will configure one or more channels +* \param[in] numOfDecPowerCfgs number of configurations passed in the array +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxDecimatedPowerCfgSet(adi_adrv903x_Device_t * const device, + adi_adrv903x_RxDecimatedPowerCfg_t rxDecPowerCfg[], + const uint32_t numOfDecPowerCfgs); + +/** +* \brief Function to read back Rx decimated power measurement configuration +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] rxChannel Rx channel selection to read decimated power block configuration +* \param[in] decPowerBlockSelection Decimated power block selection to read back configuration +* \param[out] rxDecPowerCfg Decimated power configuration of selected channel/dec power block +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxDecimatedPowerCfgGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + const adi_adrv903x_DecPowerMeasurementBlock_e decPowerBlockSelection, + adi_adrv903x_RxDecimatedPowerCfg_t * const rxDecPowerCfg); + +/** +* \brief Function to configure ORx decimated power measurement block. +* +* This function can be used to configure decimated power measurements for Orx channel. +* Measurement point and measurement duration can be selected by user through configuration structure. +* This function configures ORx dec power block. For Rx dec power block +* please use adi_adrv903x_RxDecimatedPowerCfgSet function +* +* Note: The function does not check for duplicated channel assignments across cfg structures. +* Invalid channel mask values will return an error. + +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] orxDecPowerCfg array of structures of type adi_adrv903x_ORxDecimatedPowerCfg_t which will configure one or more channels +* \param[in] numOfDecPowerCfgs number of configurations passed in the array +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ORxDecimatedPowerCfgSet(adi_adrv903x_Device_t * const device, + adi_adrv903x_ORxDecimatedPowerCfg_t orxDecPowerCfg[], + const uint32_t numOfDecPowerCfgs); + +/** +* \brief Function to read back Orx decimated power measurement configuration +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] orxChannel ORx channel selection to read decimated power block configuration +* \param[out] orxDecPowerCfg Decimated power configuration of selected channel/dec power block +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ORxDecimatedPowerCfgGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e orxChannel, + adi_adrv903x_ORxDecimatedPowerCfg_t * const orxDecPowerCfg); + +/** +* \brief Function to readback the decimated power measurement for selected Rx/Orx channel. +* Power readback value is an unsigned 8 bit value with 0.25dB resolution. +* This function can be used to read power measurements for both Rx and Orx channels + +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] rxChannel Channel selection to read decimated power measurement +* \param[in] decPowerBlockSelection Decimated power block selection (unused for Orx channel selections) +* \param[out] powerReadBack Pointer to power measurement readback value +* +* \retval adi_common_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxDecimatedPowerGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + const adi_adrv903x_DecPowerMeasurementBlock_e decPowerBlockSelection, + uint8_t * const powerReadBack); + +/** + * \brief Set the attenuation of one or several ORx channels. Attenuation is 0 - 17dB, in steps of 1dB. + * + * \pre This function can be called after the CPU has been initialized, firmware loaded and the ORX NCO configured. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in,out] device Context variable adi_adrv903x_Device_t pointer to the device data structure. + * \param [in] channelMask uint32_t indicates the channels affected. + * \param [in] attenDb uint8_t indicates the attenuation level to apply in Db. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_OrxAttenSet(adi_adrv903x_Device_t* const device, + const uint32_t channelMask, + const uint8_t attenDb); + +/** + * \brief Get the attenuation of an ORx channel. + * + * \param [in, out] device Context variable adi_adrv903x_Device_t pointer to the device data structure. + * \param [in] channelId uint8_t indicates the channels affected. + * \param [out] attenDb uint8_t the channel's attenuation value is written here. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_OrxAttenGet(adi_adrv903x_Device_t* const device, + const uint8_t channelId, + uint8_t* const attenDb); + +/** + * \brief set the Rx gain control mode + * + * \brief The Gain Control Mode for Rx signal can be set to MGC and AGC + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in,out] device Context variable adi_adrv903x_Device_t pointer to the device data structure + * \param [in] gainCtrlModeCfg array to be configured. Parameter is of structure type adi_adrv903x_RxGainCtrlModeCfg_t + * \param [in] arraySize is the no. of elements in gainCtrlModeCfg[] array + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainCtrlModeSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxGainCtrlModeCfg_t gainCtrlModeCfg[], + const uint32_t arraySize); + +/** + * \brief get the Rx gain control mode with Rx channel index + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in,out] device Context variable adi_adrv903x_Device_t pointer to the device data structure + * \param [in] rxChannel indicates the Rx channel affected. + * \param [out] gainCtrlMode is the pointer to adi_adrv903x_RxGainCtrlMode_e enum which will + * be updated with the read back config + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainCtrlModeGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxGainCtrlMode_e* gainCtrlMode); + +/** + * \brief This function sets the temperature gain compensation parameter for Rx channel only + * + * This function can be called at any point. The gain can be configured + * from -6.3 dB to 6.3 dB in 0.1 dB step. Hence allowable range is + * [-63 to +63] with 0 representing 0 dB. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in,out] device Context variable adi_adrv903x_Device_t pointer to the device data structure + * \param [in] rxChannelMask Bit mask representing channels to be programmed (can be multiple channels). + * \param [in] gainValue Gain value to set + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTempGainCompSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const int8_t gainValue); + +/** + * \brief This function gets the temperature gain compensation parameter for Rx channel only. + * Only one channel can be retrieved per call + * + * This function can be called at any point. The gain returned is in the + * range -63 to 63, this means -6.3 dB to 6.3 dB + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in,out] device Context variable adi_adrv903x_Device_t pointer to the device data structure + * \param [in] rxChannel Bit mask representing which channel to retrieve (only one channel returned per call) + * \param [out] gainValue Gain value retrieved + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTempGainCompGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + int8_t* const gainValue); + +/** + * \brief Allows the data from one or more Rx ADCs to be replaced with a test signal. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in,out] device Context variable adi_adrv903x_Device_t pointer to the device data structure + * \param [in] rxChannelMask Indicates the channels to be affected by the call. + * \param [in] rxTestDataCfg Indicates whether the ADC output signal should be replaced by a test signal for the + * channels in rxChannelMask or whether the normal ADC output should be used. Also describes the test signal. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTestDataSet(adi_adrv903x_Device_t* device, + const uint32_t rxChannelMask, + const adi_adrv903x_RxTestDataCfg_t* const rxTestDataCfg); + +/** + * \brief Check if the data from an Rx ADC is currently being replaced with a test signal and + * if so retrieves the parameters of the test signal. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param [in,out] device Context variable adi_adrv903x_Device_t pointer to the device data structure + * \param [in] rxChannel The channel whose information to get. + * \param [out] rxTestDataCfg Indicates whether the Rx ADC signal is being replaced by a test signal + * and if so also the parameters of the test signal. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTestDataGet(adi_adrv903x_Device_t* device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxTestDataCfg_t* const rxTestDataCfg); + +/** +* \brief Controls whether Rx LO mixer is powered down or not when an Rx channel is disabled. +* +* By default the LO is powered down when the Rx is disabled. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param [in,out] device Context variable adi_adrv903x_Device_t pointer to the device data structure +* \param [in] rxChannelMask The Rx channels to affect. Must include at least one channel from Rx0 to Rx7. +* \param [in] enable To change the default behavour and skip the Rx LO mixer power down for the channels in +* rxChannelMask set 'enable' to ADI_DISABLE. Restore the default by setting to ADI_ENABLE. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxLoPowerDownSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannelMask, + const uint8_t enable); +/** +* \brief API configures a custom baseband spur frequency. The spur cancellation calibration +* will aim to cancel any tone/spur found at this frequency. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param [in,out] device Context variable adi_adrv903x_Device_t pointer to the device data structure +* \param [in] rxChannelMask The Rx channels to affect. +* \param [in] bbFreqKhz Input BaseBand Freq. +* \param [in] enable or disable Tracking Cal. +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxSpurBaseBandFreqSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannelMask, + const int32_t bbFreqKhz, + const uint8_t enable); + +/** +* \brief API to readback custom baseband spur frequency. +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param [in,out] device context variable adi_adrv903x_Device_t pointer to the device data structure. +* \param [in] rxChannelMask The Rx channels to affect. Must include at least one channel from Rx0 to Rx7. +* \param[in,out] rxSpurRbConfig Pointer to struct adi_adrv903x_RxSpurFreqConfigResp_t to Readback Baseband Frequency. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxSpurBaseBandFreqGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannelMask, + adi_adrv903x_RxSpurFreqConfigResp_t* const rxSpurRbConfig); + + +#endif /* _ADI_ADRV903X_RX_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_rx_nco.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_rx_nco.h new file mode 100644 index 0000000000000..4cf26873e28a0 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_rx_nco.h @@ -0,0 +1,130 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_rx_nco.h + * + * \brief Contains ADRV903X Rx NCO data structures. + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADI_ADRV903X_RX_NCO_H__ +#define __ADI_ADRV903X_RX_NCO_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cpu_error_codes_types.h" + +typedef uint8_t adi_adrv903x_DdcNumber_t; +typedef uint8_t adi_adrv903x_OrxNcoSelect_t; + +/** + * \brief Enumeration for DDC channel number + */ +typedef enum adi_adrv903x_DdcNumber +{ + ADI_ADRV903X_DDC_BAND_0 = 0u, /*!< DDC channel 0 */ + ADI_ADRV903X_DDC_BAND_1, /*!< DDC channel 1 */ + ADI_ADRV903X_DDC_NUM_BAND +} adi_adrv903x_DdcNumber_e; + +/** + * \brief Enumeration for ORx NCO selections + */ +typedef enum adi_adrv903x_ORxNcoSelect +{ + ADI_ADRV903X_ORX_NCO_DDC = 0u, /*!< DDC NCO selected */ + ADI_ADRV903X_ORX_DATAPATH, /*!< DP NCO selected */ + ADI_ADRV903X_ORX_NUM_NCO, /*!< Number of ORX NCOs */ +} adi_adrv903x_OrxNcoSelect_e; + +/** + * \brief NCO Rx set command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_RxNcoConfig +{ + uint8_t chanSelect; /*!< Rx channel (bit mapped) */ + adi_adrv903x_DdcNumber_t bandSelect; /*!< which band */ + uint8_t enable; /*!< 0: Disable, 1: Enable */ + uint32_t phase; /*!< Phase in degrees (0 - 359) */ + int32_t frequencyKhz; /*!< Frequency in KHz */ +} adi_adrv903x_RxNcoConfig_t;) + +/** + * \brief NCO Rx set command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_RxNcoConfigReadbackResp +{ + adi_adrv903x_CpuErrorCode_t status; /*!< CPU error status code */ + uint8_t chanSelect; /*!< Rx channel (bit mapped) */ + adi_adrv903x_DdcNumber_t bandSelect; /*!< which band */ + uint8_t enabled; /*!< 0: Disabled, 1: Enabled */ + uint32_t phase; /*!< Phase in degrees (0 - 359) */ + int32_t frequencyKhz; /*!< Frequency in KHz */ +} adi_adrv903x_RxNcoConfigReadbackResp_t;) + +/** + * \brief NCO ORx set command structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_ORxNcoConfig +{ + uint8_t chanSelect; /*!< Select ORx channel (bit mapped) */ + uint8_t ncoSelect; /*!< NCO select; 0 ADC, 1 Datapath */ + uint8_t enable; /*!< 0: Disable, 1: Enable */ + uint32_t phase; /*!< Phase in degrees (0 - 359) */ + int32_t frequencyKhz; /*!< Desired frequency in KHz */ +} adi_adrv903x_ORxNcoConfig_t;) + +/** + * \brief NCO Orx set command response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_ORxNcoConfigReadbackResp +{ + adi_adrv903x_CpuErrorCode_t status; /*!< CPU error status code */ + uint8_t chanSelect; /*!< Select ORx channel (bit mapped) */ + uint8_t ncoSelect; /*!< NCO select; 0 ADC, 1 Datapath */ + uint8_t enabled; /*!< 0: Disabled, 1: Enabled */ + uint32_t phase; /*!< Phase in degrees (0 - 359) */ + int32_t frequencyKhz; /*!< Desired frequency in KHz */ +} adi_adrv903x_ORxNcoConfigReadbackResp_t;) + +/** + * \brief Rx Spur Configuration Set structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_RxSpurFreqSet +{ + uint32_t rxChannelMask; /*!< Rx Channels for which gain index needs to be updated. Bits 0-7 correspond to Rx0-Rx7 respectively */ + int32_t baseBandFreqKHz; /*!< Baseband freq at which Rx SPUR freq needs to be cancelled */ + uint8_t enable; /*!< 0: Disable, 1: Enable */ +} adi_adrv903x_RxSpurFreqSet_t;) + +/** + * \brief Rx Spur Configuration Get Structure + */ +typedef struct adi_adrv903x_RxSpurFreqGet +{ + uint32_t rxChannelMask; /*!< Rx Channels for which gain index needs to be updated. Bits 0-7 correspond to Rx0-Rx7 respectively */ +} adi_adrv903x_RxSpurFreqGet_t; + +/** + * \brief Rx Spur Configuration response structure + */ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_RxSpurFreqConfigResp +{ + adi_adrv903x_CpuErrorCode_t status; /*!< Rx Spur Frequency Config response status */ + uint32_t rxChannelMask; /*!< Rx Channel for which result is returned */ + int32_t baseBandFreqKHz; /*!< Baseband freq at which Rx SPUR freq needs to be cancelled */ + uint8_t enabled; /*!< 0: Disabled, 1: Enabled */ +} adi_adrv903x_RxSpurFreqConfigResp_t;) + +#endif /* __ADI_ADRV903X_RX_NCO_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_rx_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_rx_types.h new file mode 100644 index 0000000000000..15e452d54a225 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_rx_types.h @@ -0,0 +1,582 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_rx_types.h + * \brief Contains ADRV903X API Rx datapath data types + * +* ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_RX_TYPES_H_ +#define _ADI_ADRV903X_RX_TYPES_H_ + +#include "adi_library_types.h" +#include "adi_adrv903x_gpio_types.h" +#include "adi_adrv903x_rx_nco.h" +#include "adi_adrv903x_cpu_error_codes_types.h" + +#define ADI_ADRV903X_RX_GAIN_TABLE_SIZE_ROWS 256 +#define ADI_ADRV903X_RX_MAX_GAIN_INDEX 255 + +// TODO: This macro will be a duplicate when adi_adrv903x_types.h is eventually included in user.h +// When adi_adrv903x_types.h is available, remove this duplicate macro define. +#define ADI_ADRV903X_MAX_RX_ONLY 8U +#define ADI_ADRV903X_MAX_ORX_ONLY 2U +#define ADI_ADRV903X_MAX_RX_DDC_BANDS 2 +#define ADI_ADRV903X_MAX_RX_INT_SLICER_BITS 4 +#define ADI_ADRV903X_MAX_ORX_ATTEN_DB 17U +/** + * \brief Enum of possible Rx channel enables + */ +typedef enum adi_adrv903x_RxChannels +{ + ADI_ADRV903X_RXOFF = 0x00U, /*!< No Rx/ORx channels are enabled */ + ADI_ADRV903X_RX0 = 0x01U, /*!< Rx0 channel enabled */ + ADI_ADRV903X_RX1 = 0x02U, /*!< Rx1 channel enabled */ + ADI_ADRV903X_RX2 = 0x04U, /*!< Rx2 channel enabled */ + ADI_ADRV903X_RX3 = 0x08U, /*!< Rx3 channel enabled */ + ADI_ADRV903X_RX4 = 0x10U, /*!< Rx4 channel enabled */ + ADI_ADRV903X_RX5 = 0x20U, /*!< Rx5 channel enabled */ + ADI_ADRV903X_RX6 = 0x40U, /*!< Rx6 channel enabled */ + ADI_ADRV903X_RX7 = 0x80U, /*!< Rx7 channel enabled */ + ADI_ADRV903X_ORX0 = 0x100U, /*!< ORx0 channel enabled */ + ADI_ADRV903X_ORX1 = 0x200U /*!< ORx1 channel enabled */ +} adi_adrv903x_RxChannels_e; + +#define ADI_ADRV903X_RX_MASK_ALL ( ADI_ADRV903X_RX0 | \ + ADI_ADRV903X_RX1 | \ + ADI_ADRV903X_RX2 | \ + ADI_ADRV903X_RX3 | \ + ADI_ADRV903X_RX4 | \ + ADI_ADRV903X_RX5 | \ + ADI_ADRV903X_RX6 | \ + ADI_ADRV903X_RX7) + +#define ADI_ADRV903X_ORX_MASK_ALL (ADI_ADRV903X_ORX0 | ADI_ADRV903X_ORX1) + +/** + * \brief Enum of DDC blocks within an Rx Channel + */ +typedef enum adi_adrv903x_RxDdcs +{ + ADI_ADRV903X_RX_DDC_BAND0 = 0, + ADI_ADRV903X_RX_DDC_BAND1 = 1 +} adi_adrv903x_RxDdcs_e; + +/** + * \brief Enum of possible Rx gain table SRAM base addresses + */ +typedef enum adi_adrv903x_RxChanGainTableBaseAddr +{ + ADI_ADRV903X_RX0_GAIN_TABLE_BASEADDR = 0x600A0000, /*!< Select gain table SRAM base address for Rx0 Channel */ + ADI_ADRV903X_RX1_GAIN_TABLE_BASEADDR = 0x601A0000, /*!< Select gain table SRAM base address for Rx1 Channel */ + ADI_ADRV903X_RX2_GAIN_TABLE_BASEADDR = 0x602A0000, /*!< Select gain table SRAM base address for Rx2 Channel */ + ADI_ADRV903X_RX3_GAIN_TABLE_BASEADDR = 0x603A0000, /*!< Select gain table SRAM base address for Rx3 Channel */ + ADI_ADRV903X_RX4_GAIN_TABLE_BASEADDR = 0x604A0000, /*!< Select gain table SRAM base address for Rx4 Channel */ + ADI_ADRV903X_RX5_GAIN_TABLE_BASEADDR = 0x605A0000, /*!< Select gain table SRAM base address for Rx5 Channel */ + ADI_ADRV903X_RX6_GAIN_TABLE_BASEADDR = 0x606A0000, /*!< Select gain table SRAM base address for Rx6 Channel */ + ADI_ADRV903X_RX7_GAIN_TABLE_BASEADDR = 0x607A0000 /*!< Select gain table SRAM base address for Rx7 Channel */ +} adi_adrv903x_RxChanGainTableBaseAddr_e; + +/** + * \brief Enum to select ADRV903X Rx Data Formatting Options + */ +typedef enum adi_adrv903x_RxDataFormatModes +{ + ADI_ADRV903X_GAIN_COMPENSATION_DISABLED = 0, /*!< Gain Compensation and Data Formatting are disabled */ + ADI_ADRV903X_GAIN_WITH_FLOATING_POINT, /*!< Gain Compensation enabled with floating point data formatting enabled and internal slicer enabled */ + ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO, /*!< Gain Compensation enabled with integer data formatting and internal slicer enabled with no GPIO Slicer Position output. The slicer position is embedded in the JESD data */ + ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2PIN_MODE, /*!< Gain Compensation enabled with integer data formatting and internal slicer enabled with GPIO Slicer Position output. The least significant 2 bits of the slicer control word are output on the GPIO */ + ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_3PIN_MODE, /*!< Gain Compensation enabled with integer data formatting and internal slicer enabled with GPIO Slicer Position output. The least significant 3 bits of the slicer control word are output on the GPIO */ + ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_4PIN_MODE, /*!< Gain Compensation enabled with integer data formatting and internal slicer enabled with GPIO Slicer Position output. All 4 bits of the slicer control word are output on the GPIOs */ + ADI_ADRV903X_GAIN_WITH_EXTERNAL_SLICER, /*!< NOT SUPPORTED: Gain Compensation enabled with integer data formatting and external slicer enabled */ + ADI_ADRV903X_EMBED_OVERLOAD_MONITOR_DATA /*!< Embed 1-bit/2 bit monitor data on the 2 least significant bits of a 16-bit 2's Complement JESD Rx data */ +} adi_adrv903x_RxDataFormatModes_e; + +/** + * \brief Enum to select ADRV903X Rx Data Formatting Options + */ +typedef enum adi_adrv903x_CddcDataFormatModes +{ + ADI_ADRV903X_CDDC_DISABLED = 0, /*!< CDDC Data formatting monitoring disabled */ + ADI_ADRV903X_CDDC_FLOATING_POINT, /*!< CDDC Data formatting with floating point data formatting enabled */ + ADI_ADRV903X_CDDC_INTEGER, /*!< CDDC Data formatting with integer data formatting enabled */ + ADI_ADRV903X_CDDC_SLICER, /*!< CDDC Data formatting slicer configuration */ + ADI_ADRV903X_CDDC_EMBED_OVERLOAD_MONITOR_DATA /*!< Embed 1-bit/2 bit monitor data on the 2 least significant bits of a 16-bit 2's Complement data */ +} adi_adrv903x_CddcDataFormatModes_e; + +/** + * \brief Enum to hold ADRV903X Floating Point Formatter format which indicates order of sign significand and exponent + */ +typedef enum adi_adrv903x_FpFloatDataFormat +{ + ADI_ADRV903X_FP_FORMAT_SIGN_EXP_SIGNIFICAND = 0, /*!< Floating point format of type {Sign, Exponent, Significand} */ + ADI_ADRV903X_FP_FORMAT_SIGN_SIGNIFICAND_EXP = 1 /*!< Floating point format of type {Sign, Significand, Exponent} */ +} adi_adrv903x_FpFloatDataFormat_e; + +/** + * \brief Enum to hold ADRV903X Floating Point Formatter rounding modes for the Rx data path + */ +typedef enum adi_adrv903x_FpRoundModes +{ + ADI_ADRV903X_ROUND_TO_EVEN = 0, /*!< Round floating point ties to an even value */ + ADI_ADRV903X_ROUNDTOWARDS_POSITIVE = 1, /*!< Round floating point toward the positive direction */ + ADI_ADRV903X_ROUNDTOWARDS_NEGATIVE = 2, /*!< Round floating point toward the negative direction */ + ADI_ADRV903X_ROUNDTOWARDS_ZERO = 3, /*!< Round floating point toward the zero direction */ + ADI_ADRV903X_ROUND_FROM_EVEN = 4 /*!< Round floating point ties away from even value */ +} adi_adrv903x_FpRoundModes_e; + +/** + * \brief Enum to hold ADRV903X Floating Point Formatter number of exponent bits + */ +typedef enum adi_adrv903x_FpExponentModes +{ + ADI_ADRV903X_2_EXPONENTBITS = 0, /*!< Floating point values have 2 exponent bits, 13 significand bits, 1 sign bit */ + ADI_ADRV903X_3_EXPONENTBITS = 1, /*!< Floating point values have 3 exponent bits, 12 significand bits, 1 sign bit */ + ADI_ADRV903X_4_EXPONENTBITS = 2, /*!< Floating point values have 4 exponent bits, 11 significand bits, 1 sign bit */ + ADI_ADRV903X_5_EXPONENTBITS = 3 /*!< Floating point values have 5 exponent bits, 10 significand bits, 1 sign bit */ +} adi_adrv903x_FpExponentModes_e; + +/** + * \brief Enum to hold ADRV903X Rx attenuation values that are used when the + * floating point format is enabled + */ +typedef enum adi_adrv903x_FpAttenSteps +{ + ADI_ADRV903X_FPATTEN_24DB = 4, /*!< Set Rx attenuation to 24 dB when Rx Data format set to floating point mode */ + ADI_ADRV903X_FPATTEN_18DB = 5, /*!< Set Rx attenuation to 18 dB when Rx Data format set to floating point mode */ + ADI_ADRV903X_FPATTEN_12DB = 6, /*!< Set Rx attenuation to 12 dB when Rx Data format set to floating point mode */ + ADI_ADRV903X_FPATTEN_6DB = 7, /*!< Set Rx attenuation to 6 dB when Rx Data format set to floating point mode */ + ADI_ADRV903X_FPATTEN_0DB = 0, /*!< Set Rx attenuation to 0 dB when Rx Data format set to floating point mode */ + ADI_ADRV903X_FPATTEN_MINUS6DB = 1, /*!< Set Rx attenuation to -6 dB when Rx Data format set to floating point mode */ + ADI_ADRV903X_FPATTEN_MINUS12DB = 2, /*!< Set Rx attenuation to -12 dB when Rx Data format set to floating point mode */ + ADI_ADRV903X_FPATTEN_MINUS18DB = 3 /*!< Set Rx attenuation to -18 dB when Rx Data format set to floating point mode */ +} adi_adrv903x_FpAttenSteps_e; + +/** + * \brief Enum to hold ADRV903X Hide Leading One selection + */ +typedef enum adi_adrv903x_FpHideLeadingOne +{ + ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_DISABLE = 0, /*!< Sets leading one to be at the MSB of the significand */ + ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_ENABLE = 1 /*!< Hides the leading one in significand to be compatible to the IEEE754 specification */ +} adi_adrv903x_FpHideLeadingOne_e; + +/** + * \brief Enum to hold ADRV903X Floating Point Formatter NaN encode enable + */ +typedef enum adi_adrv903x_FpNanEncode +{ + ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_DISABLE = 0, /*!< Does not reserve highest value of exponent for NaN */ + ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_ENABLE = 1 /*!< Reserve highest value of exponent for NaN */ +} adi_adrv903x_FpNanEncode_e; + + +/** + * \brief Enum to select the overload peak detection input monitor signal source + */ +typedef enum adi_adrv903x_SignalMonitorSrc +{ + + ADI_ADRV903X_SIG_MON_SRC_HB2_OUTPUT, /*!< Use Hb2 block output as input signal */ + ADI_ADRV903X_SIG_MON_SRC_HB2_INPUT, /*!< Use Hb2 block input as input signal */ + + ADI_ADRV903X_SIG_MON_SRC_DEC3_INPUT, /*!< Use DEC3 block input as input signal */ + ADI_ADRV903X_MAX_SIG_MON_SRC_INVALID /*!< Max number of signal monitor input source */ +} adi_adrv903x_SignalMonitorSrc_e; + + +/** + * \brief Enum to hold ADRV903X integer mode number of embedded slicer bits and positions + */ +typedef enum adi_adrv903x_RxSlicerEmbeddedBits +{ + ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS = 0, /*!< Disabled all embedded slicer bits */ + ADI_ADRV903X_EMBED_1_SLICERBIT_AT_MSB, /*!< Embeds 1 slicer bits on I and 1 slicer bits on Q and the MSB position in the data frame */ + ADI_ADRV903X_EMBED_1_SLICERBIT_AT_LSB, /*!< Embeds 1 slicer bits on I and 1 slicer bits on Q and the LSB position in the data frame */ + ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_3_BIT_SLICER, /*!< Embeds 2 slicer bits on I and 2 slicer bits on Q and the MSB position in the data frame whereas only 3 bits are used for slicer ctrl (2 bits on I, 1 bit Q) */ + ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_3_BIT_SLICER, /*!< Embeds 2 slicer bits on I and 2 slicer bits on Q and the LSB position in the data frame whereas only 3 bits are used for slicer ctrl (2 bits on I, 1 bit Q) */ + ADI_ADRV903X_EMBED_2_SLICERBITS_AT_MSB_4_BIT_SLICER, /*!< Embeds 2 slicer bits on I and 2 slicer bits on Q and the MSB position in the data frame and all 4 bits are used for slicer ctrl*/ + ADI_ADRV903X_EMBED_2_SLICERBITS_AT_LSB_4_BIT_SLICER /*!< Embeds 2 slicer bits on I and 2 slicer bits on Q and the LSB position in the data frame and all 4 bits are used for slicer ctrl*/ +} adi_adrv903x_RxSlicerEmbeddedBits_e; + +/** + * \brief Enum to hold ADRV903X integer sample resolution + */ +typedef enum adi_adrv903x_RxIntSampleResolution +{ + ADI_ADRV903X_INTEGER_12BIT_2SCOMP = 0, /*!< Selects integer sample 12 bit resolution with 2s compliment */ + ADI_ADRV903X_INTEGER_12BIT_SIGNED, /*!< Selects integer sample 12 bit resolution with signed magnitude */ + ADI_ADRV903X_INTEGER_16BIT_2SCOMP, /*!< Selects integer sample 16 bit resolution with 2s compliment */ + ADI_ADRV903X_INTEGER_16BIT_SIGNED /*!< Selects integer sample 16 bit resolution with signed magnitude */ +} adi_adrv903x_RxIntSampleResolution_e; + +/** + * \brief Enum to hold ADRV903X integer mode parity selection for 3 bit slicer mode + */ +typedef enum adi_adrv903x_RxIntParity +{ + ADI_ADRV903X_3BIT_SLICER_EVEN_PARITY = 0, /*!< Even parity for the unused 4th bit in 3 bit slicer mode */ + ADI_ADRV903X_3BIT_SLICER_ODD_PARITY = 1, /*!< Odd parity for the unused 4th bit in 3 bit slicer mode */ + ADI_ADRV903X_NO_PARITY = 2 /*!< Disable parity */ +} adi_adrv903x_RxIntParity_e; + +/** + * \brief Enum to hold ADRV903X slicer control word nibble position + */ +typedef enum adi_adrv903x_RxSlicerEmbeddedPos +{ + ADI_ADRV903X_LOWER_NIBBLE_ON_I = 0, /*!< Place the lower control nibble on I and the upper control nibble on Q */ + ADI_ADRV903X_LOWER_NIBBLE_ON_Q /*!< Place the lower control nibble on Q and the upper control nibble on I */ + +} adi_adrv903x_RxSlicerEmbeddedPos_e; + +/** + * \brief Enum to hold ADRV903X Gain Slicer external pin gain step size. Slicer gain in this mode is determined by multiplying the step size by the step size selection from the base band processor. + */ +typedef enum adi_adrv903x_ExtSlicerStepSizes +{ + ADI_ADRV903X_EXTSLICER_STEPSIZE_1DB = 0, /*!< Set Gain Slicer External gain step size to 1dB */ + ADI_ADRV903X_EXTSLICER_STEPSIZE_2DB, /*!< Set Gain Slicer External gain step size to 2dB */ + ADI_ADRV903X_EXTSLICER_STEPSIZE_3DB, /*!< Set Gain Slicer External gain step size to 3dB */ + ADI_ADRV903X_EXTSLICER_STEPSIZE_4DB, /*!< Set Gain Slicer External gain step size to 4dB */ + ADI_ADRV903X_EXTSLICER_STEPSIZE_6DB /*!< Set Gain Slicer External gain step size to 6dB */ +} adi_adrv903x_ExtSlicerStepSizes_e; + +/** + * \brief Enum to hold ADRV903X Internal Gain Slicer gain step size. Slicer gain in this mode is determined by multiplying the step size by the step size selection from the base band processor. + */ +typedef enum adi_adrv903x_IntSlicerStepSizes +{ + ADI_ADRV903X_INTSLICER_STEPSIZE_1DB = 0, /*!< Set Gain Slicer Internal gain step size to 1dB */ + ADI_ADRV903X_INTSLICER_STEPSIZE_2DB, /*!< Set Gain Slicer Internal gain step size to 2dB */ + ADI_ADRV903X_INTSLICER_STEPSIZE_3DB, /*!< Set Gain Slicer Internal gain step size to 3dB */ + ADI_ADRV903X_INTSLICER_STEPSIZE_4DB, /*!< Set Gain Slicer Internal gain step size to 4dB */ + ADI_ADRV903X_INTSLICER_STEPSIZE_6DB, /*!< Set Gain Slicer Internal gain step size to 6dB */ + ADI_ADRV903X_INTSLICER_STEPSIZE_8DB /*!< Set Gain Slicer Internal gain step size to 8dB */ +} adi_adrv903x_IntSlicerStepSizes_e; + +/** + * \brief Enum to hold ADRV903X Rx Gain Slicer external pin GPIO selection options + */ +typedef enum adi_adrv903x_RxExtSlicerGpioSel +{ + ADI_ADRV903X_EXTSLICER_RX_GPIO_DISABLE = 0, /*!< No GPIO assigned to external slicer */ + ADI_ADRV903X_EXTSLICER_RX_GPIO_INVALID = 9 +} adi_adrv903x_RxExtSlicerGpioSel_e; + +/** +* \brief Enum to hold ADRV903X Embedded Monitor Mode sources +*/ +typedef enum adi_adrv903x_RxEmbeddedMonitorSrc +{ + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED = 0, /*!< Embedded overload monitor data is not embedded for the selected bit position in 16 bit Rx data */ + ADI_ADRV903X_RX_EMB_MON_SRC_HB2_LOW_THRESH = 3, /*!< Selects digital HB2 low threshold monitor data to be embedded in Rx data */ + ADI_ADRV903X_RX_EMB_MON_SRC_HB2_HIGH_THRESH = 4, /*!< Selects digital HB2 high threshold monitor data to be embedded in Rx data */ + ADI_ADRV903X_RX_EMB_MON_SRC_APD_LOW_THRESH = 5, /*!< Selects analog peak detector low threshold monitor data to be embedded in Rx data */ + ADI_ADRV903X_RX_EMB_MON_SRC_APD_HIGH_THRESH = 6, /*!< Selects analog peak detector high threshold monitor data to be embedded in Rx data */ + ADI_ADRV903X_RX_EMB_MON_SRC_BAND0_LOW_THRESH = 7, /*!< Selects band0 low threshold monitor data to be embedded in Rx data */ + ADI_ADRV903X_RX_EMB_MON_SRC_BAND0_HIGH_THRESH = 8, /*!< Selects band0 high threshold monitor data to be embedded in Rx data */ + ADI_ADRV903X_RX_EMB_MON_SRC_BAND1_LOW_THRESH = 9, /*!< Selects band1 low threshold monitor data to be embedded in Rx data */ + ADI_ADRV903X_RX_EMB_MON_SRC_BAND1_HIGH_THRESH = 10, /*!< Selects band1 high threshold monitor data to be embedded in Rx data */ + ADI_ADRV903X_RX_EMB_MON_SRC_INVALID = 11 /*!< Invalid embedded monitoring source */ +} adi_adrv903x_RxEmbeddedMonitorSrc_e; + +/** +* \brief Enum to hold ADRV903X Embedded Monitor Mode HB2 Low source +*/ +typedef enum adi_adrv903x_RxHb2LowEmbeddedMonitorSrc +{ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW = 0, /*!< Selects digital HB2 lower threshold exceeded flag as HB2 low threshold monitor data */ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW_INT0 = 1, /*!< Selects digital HB2 interval 0 lower threshold exceeded flag as HB2 low threshold monitor data */ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW_INT1 = 2, /*!< Selects digital HB2 interval 1 lower threshold exceeded flag as HB2 low threshold monitor data */ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW_THRESH_CNTR_EXCEEDED = 4, /*!< Selects digital HB2 lower threshold exceeded counter flag as HB2 low threshold monitor data */ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW_INT0_THRESH_CNTR_EXCEEDED = 5, /*!< Selects digital HB2 interval 0 lower threshold exceeded counter flag as HB2 low threshold monitor data */ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW_INT1_THRESH_CNTR_EXCEEDED = 6, /*!< Selects digital HB2 interval 1 lower threshold exceeded counter flag as HB2 low threshold monitor data */ + ADI_ADRV903X_HB2_LOW_SRC_INVALID = 7 /*!< Invalid HB2 low source */ +} adi_adrv903x_RxHb2LowEmbeddedMonitorSrc_e; + +/** +* \brief Enum to hold ADRV903X Embedded Monitor Mode HB2 High source +*/ +typedef enum adi_adrv903x_RxHb2HighEmbeddedMonitorSrc +{ + ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH = 0, /*!< Selects digital HB2 overrange high threshold exceeded flag as HB2 high threshold monitor data */ + ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH_CNTR_EXCEEDED, /*!< Selects digital HB2 overrange high threshold counter exceeded flag as HB2 high threshold monitor data */ + ADI_ADRV903X_HB2_HIGH_SRC_INVALID /*!< Invalid HB2 high source */ +} adi_adrv903x_RxHb2HighEmbeddedMonitorSrc_e; + +/** +* \brief Enum to hold ADRV903X Embedded Monitor Mode Analog Peak Detector Low source +*/ +typedef enum adi_adrv903x_RxApdLowEmbeddedMonitorSrc +{ + ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_EXCEEDED = 0, /*!< Selects analog peak detector lower level blocker exceeded flag as APD low threshold monitor data */ + ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_CNTR_EXCEEDED, /*!< Selects analog peak detector lower level blocker counter exceeded flag as APD low threshold monitor data */ + ADI_ADRV903X_APD_LOW_SRC_INVALID /*!< Invalid APD low source */ +} adi_adrv903x_RxApdLowEmbeddedMonitorSrc_e; + +/** +* \brief Enum to hold ADRV903X Embedded Monitor Mode Analog Peak Detector High source +*/ +typedef enum adi_adrv903x_RxApdHighEmbeddedMonitorSrc +{ + ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_EXCEEDED = 0, /*!< Selects analog peak detector upper level blocker exceeded flag as APD high threshold monitor data */ + ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_CNTR_EXCEEDED, /*!< Selects analog peak detector upper level blocker counter exceeded flag as APD high threshold monitor data */ + ADI_ADRV903X_APD_HIGH_SRC_INVALID /*!< Invalid APD high source */ +} adi_adrv903x_RxApdHighEmbeddedMonitorSrc_e; + + + +/** + * \brief Data structure to hold ADRV903X Rx gain table row entry + */ +typedef struct adi_adrv903x_RxGainTableRow +{ + uint8_t rxFeGain; /*!< Rx Front End gain for a given gain index */ + uint8_t extControl; /*!< External LNA control word */ + int16_t digGain; /*!< Digital gain ranging from -18dB to 50dB (68dB total range) */ + uint16_t phaseOffset; /*!< 16 bit phase offset from 0 - 2pi in resolution of 0.005 degrees */ +} adi_adrv903x_RxGainTableRow_t; + + +/** +* \brief Data structure to hold ADRV903X Rx gain index config +*/ +typedef struct adi_adrv903x_RxGain +{ + uint32_t rxChannelMask; /*!< Rx Channels for which gain index needs to be updated. Bits 0-7 correspond to Rx0-Rx7 respectively */ + uint8_t gainIndex; /*!< Gain Index for the channels selected in rxChannelMask */ +} adi_adrv903x_RxGain_t; + +/** +* \brief Data structure to hold ADRV903X Floating Point Formatter Configuration +*/ +typedef struct adi_adrv903x_FloatingPointConfigSettings +{ + adi_adrv903x_FpFloatDataFormat_e fpDataFormat; /*!< Floating point format to select between {Sign, Significand, Exponent} and {Sign, Exponent, Significand} */ + adi_adrv903x_FpRoundModes_e fpRoundMode; /*!< Rounding mode for floating point format (See enum values) */ + adi_adrv903x_FpExponentModes_e fpNumExpBits; /*!< Indicates the number of exponent and significand bits in the floating point number */ + adi_adrv903x_FpAttenSteps_e fpAttenSteps; /*!< Attenuate integer data when floating point mode enabled, see enum for values from 0dB to 42dB in 6dB steps */ + adi_adrv903x_FpHideLeadingOne_e fpHideLeadingOne; /*!< 1 = Hides the leading one in significand to be compatible to the IEEE754 specification. 0 = a leading one exists at the MSB of the significand. (Valid: 0, 1) */ + adi_adrv903x_FpNanEncode_e fpEncodeNan; /*!< 1 = encodes the highest value of Exponent to mean NaN (Not a Number) to be compatible to IEEE754 specification (Valid: 0 or 1) */ +} adi_adrv903x_FloatingPointConfigSettings_t; + +/** +* \brief Data structure to hold ADRV903X Floating Point Formatter Configuration +*/ +typedef struct adi_adrv903x_CddcFloatingPointConfigSettings +{ + adi_adrv903x_FpFloatDataFormat_e cddcFpDataFormat; /*!< Floating point format to select between {Sign, Significand, Exponent} and {Sign, Exponent, Significand} */ + adi_adrv903x_FpRoundModes_e cddcFpRoundMode; /*!< Rounding mode for floating point format (See enum values) */ + adi_adrv903x_FpExponentModes_e cddcFpNumExpBits; /*!< Indicates the number of exponent and significand bits in the floating point number */ + adi_adrv903x_FpHideLeadingOne_e cddcFpHideLeadingOne; /*!< 1 = Hides the leading one in significand to be compatible to the IEEE754 specification. 0 = a leading one exists at the MSB of the significand. (Valid: 0, 1) */ + adi_adrv903x_FpNanEncode_e cddcFpEncodeNan; /*!< 1 = encodes the highest value of Exponent to mean NaN (Not a Number) to be compatible to IEEE754 specification (Valid: 0 or 1) */ + uint8_t cddcFpEn; /*!< 1 = Floating point CDDC data formatting enabled (Valid: 0 or 1) */ +} adi_adrv903x_CddcFloatingPointConfigSettings_t; + +/** +* \brief Data structure to hold ADRV903X Integer Formatter Configuration +*/ +typedef struct adi_adrv903x_IntegerConfigSettings +{ + adi_adrv903x_RxSlicerEmbeddedBits_e intEmbeddedBits; /*!< No. of embedded slicer bits in Rx Data */ + adi_adrv903x_RxIntSampleResolution_e intSampleResolution; /*!< Resolution of Rx Data */ + adi_adrv903x_RxIntParity_e intParity; /*!< Parity - applicable only for 3bit slicer mode */ + adi_adrv903x_RxSlicerEmbeddedPos_e intEmbeddedPos; /*!< Selects the position of the upper and lower embedded slicer control word */ +} adi_adrv903x_IntegerConfigSettings_t; + +/** +* \brief Data structure to hold ADRV903X Integer Formatter Configuration +*/ +typedef struct adi_adrv903x_CddcIntegerConfigSettings +{ + adi_adrv903x_RxSlicerEmbeddedBits_e intEmbeddedBits; /*!< No. of embedded slicer bits in Rx Data */ + adi_adrv903x_RxIntSampleResolution_e intSampleResolution; /*!< Resolution of Rx Data */ + adi_adrv903x_RxIntParity_e intParity; /*!< Parity - applicable only for 3bit slicer mode */ + adi_adrv903x_RxSlicerEmbeddedPos_e intEmbeddedPos; /*!< Selects the position of the upper and lower embedded slicer control word */ +} adi_adrv903x_CddcIntegerConfigSettings_t; + +/** + * \brief Data structure to hold ADRV903X Slicer Configuration settings + */ +typedef struct adi_adrv903x_SlicerConfigSettings +{ + adi_adrv903x_ExtSlicerStepSizes_e extSlicerStepSize; /*!< Selects the external pin gain step size */ + adi_adrv903x_IntSlicerStepSizes_e intSlicerStepSize; /*!< Selects the internal pin gain step size */ + adi_adrv903x_RxExtSlicerGpioSel_e extSlicerGpioSelect; /*!< Selects the Ext Ctrl GPIO Configuration for the respective Rx Channel */ + adi_adrv903x_GpioPinSel_e intSlicerGpioSelect[ADI_ADRV903X_MAX_RX_INT_SLICER_BITS]; /*!< Selects the Int Output GPIO Configuration for the respective Rx Channel */ +} adi_adrv903x_SlicerConfigSettings_t; + +/** + * \brief Data structure to hold ADRV903X Slicer Configuration settings + */ +typedef struct adi_adrv903x_CddcSlicerConfigSettings +{ + uint8_t cddcSlicerCarrierSelect; /*!< Selects the Slicer Carrier for CDDC */ + uint8_t cddcFormatterCarrierSelect; /*!< Selects the Formatter Carrier for CDDC */ + uint8_t cddcEn3BitSlicerMode; /*!< Enable 3bit slicer mode for CDDC */ + uint8_t cddcEnSlicerAgcSync; /*!< Enable AGC Sync for CDDC Slicer */ +} adi_adrv903x_CddcSlicerConfigSettings_t; + +/** +* \brief Data structure to hold ADRV903X Rx Embedded Monitor Formatter Configuration +*/ +typedef struct adi_adrv903x_EmbOverloadMonitorConfigSettings +{ + adi_adrv903x_RxEmbeddedMonitorSrc_e embeddedMonitorSrcLsbI; /*!< Selects the monitor data to be embedded into LSB location of 16-bit Rx data - I sample */ + adi_adrv903x_RxEmbeddedMonitorSrc_e embeddedMonitorSrcLsbQ; /*!< Selects the monitor data to be embedded into LSB location of 16-bit Rx data - Q sample */ + adi_adrv903x_RxEmbeddedMonitorSrc_e embeddedMonitorSrcLsbPlusOneI; /*!< Selects the monitor data to be embedded into LSB+1 location of 16-bit Rx data - I sample */ + adi_adrv903x_RxEmbeddedMonitorSrc_e embeddedMonitorSrcLsbPlusOneQ; /*!< Selects the monitor data to be embedded into LSB+1 location of 16-bit Rx data - Q sample */ + adi_adrv903x_RxHb2LowEmbeddedMonitorSrc_e embeddedMonitorHb2LowSrcSel; /*!< If digital HB2 Low monitor is selected to be embedded into Rx data, the source of digital HB2 low threshold is selected by this param */ + adi_adrv903x_RxHb2HighEmbeddedMonitorSrc_e embeddedMonitorHb2HighSrcSel; /*!< If digital HB2 High monitor is selected to be embedded into Rx data, the source of digital HB2 high threshold is selected by this param */ + adi_adrv903x_RxApdLowEmbeddedMonitorSrc_e embeddedMonitorApdLowSrcSel; /*!< If analog peak detector low monitor is selected to be embedded into Rx data, the source of analog peak detector low threshold is selected by this param */ + adi_adrv903x_RxApdHighEmbeddedMonitorSrc_e embeddedMonitorApdHighSrcSel; /*!< If analog peak detector high monitor is selected to be embedded into Rx data, the source of analog peak detector low threshold is selected by this param */ + uint8_t invertHb2Flag; /*!< When inverted, Hb2 embedded overload monitor flag operates as active low, 0:Don't invert / Other:Invert*/ + uint8_t invertApdFlag; /*!< When inverted, Apd embedded overload monitor flag operates as active low, 0:Don't invert / Other:Invert*/ +} adi_adrv903x_EmbOverloadMonitorConfigSettings_t; + +/** +* \brief Data structure to hold ADRV903X Rx Embedded Monitor Formatter Configuration +*/ +typedef struct adi_adrv903x_CddcEmbOverloadMonitorConfigSettings +{ + uint8_t embeddedMonitorSrcLsbI; /*!< Selects the monitor data to be embedded into LSB location of 16-bit Rx data - I sample */ + uint8_t embeddedMonitorSrcLsbQ; /*!< Selects the monitor data to be embedded into LSB location of 16-bit Rx data - Q sample */ + uint8_t embeddedMonitorSrcLsbPlusOneI; /*!< Selects the monitor data to be embedded into LSB+1 location of 16-bit Rx data - I sample */ + uint8_t embeddedMonitorSrcLsbPlusOneQ; /*!< Selects the monitor data to be embedded into LSB+1 location of 16-bit Rx data - Q sample */ +} adi_adrv903x_CddcEmbOverloadMonitorConfigSettings_t; + +/** +* \brief Configuration structure for Rx Data Formatter +*/ +typedef struct adi_adrv903x_RxDataFormat +{ + adi_adrv903x_RxDataFormatModes_e formatSelect; /*!< Rx Channel format mode selects */ + adi_adrv903x_FloatingPointConfigSettings_t floatingPointConfig; /*!< Rx Channel floating point format configuration. Ignored if formatSelect is NOT set to ADI_ADRV903X_GAIN_WITH_FLOATING_POINT */ + adi_adrv903x_IntegerConfigSettings_t integerConfigSettings; /*!< Rx Channel integer format configuration. Please note that integerConfigSettings.intSampleResolution needs to be set to a valid value for all modes of formatSelect */ + adi_adrv903x_SlicerConfigSettings_t slicerConfigSettings; /*!< Rx channel integer slicer configuration. Ignored if formatSelect is NOT ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_NOGPIO, ADI_ADRV903X_GAIN_WITH_INTERNAL_SLICER_2/3/4PIN_MODE or ADI_ADRV903X_GAIN_WITH_EXTERNAL_SLICER_NO_GPIO */ + adi_adrv903x_EmbOverloadMonitorConfigSettings_t embOvldMonitorSettings; /*!< Rx channel embedded overload monitor settings. Ignored if formatSelect is NOT set to ADI_ADRV903X_EMBED_MONITOR_DATA. Embedded overload monitoring is supported for Rx channels only */ + uint8_t externalLnaGain; /*!< Selects Slicer to compensate for external dualband LNA {0 - disabled, 1 - enabled} */ + uint8_t tempCompensationEnable; /*!< Selects Slicer to compensate for temperature variations {0 - disabled, 1 - enabled} */ +} adi_adrv903x_RxDataFormat_t; + +/** +* \brief Configuration structure for CDDC Data Formatter +*/ +typedef struct adi_adrv903x_CddcDataFormat +{ + adi_adrv903x_CddcDataFormatModes_e cddcFormatSelect; /*!< Rx Channel format mode selects */ + adi_adrv903x_CddcFloatingPointConfigSettings_t cddcFloatingPointConfig; /*!< Rx Channel floating point format configuration. Ignored if formatSelect is NOT set to ADI_ADRV903X_GAIN_WITH_FLOATING_POINT */ + adi_adrv903x_CddcIntegerConfigSettings_t cddcIntegerConfigSettings; /*!< Rx Channel integer format configuration. Please note that integerConfigSettings.intSampleResolution needs to be set to a valid value for all modes of formatSelect */ + adi_adrv903x_CddcSlicerConfigSettings_t cddcSlicerConfigSettings; /*!< Rx channel slicer configuration. */ + adi_adrv903x_CddcEmbOverloadMonitorConfigSettings_t cddcEmbOvldMonitorSettings; /*!< Rx channel embedded overload monitor settings. Ignored if formatSelect is NOT set to ADI_ADRV903X_EMBED_MONITOR_DATA. Embedded overload monitoring is supported for Rx channels only */ +} adi_adrv903x_CddcDataFormat_t; + +/** +* \brief Indicates the rx channels to which an instance of adi_adrv903x_RxDataFormat_t applies +*/ +typedef struct adi_adrv903x_RxDataFormatRt +{ + uint32_t rxChannelMask; /*!< The rx channels to which rxDataFormat applies. Suggested to use adi_adrv903x_RxChannels_e to build. */ + adi_adrv903x_RxDataFormat_t rxDataFormat; /*!< RxDataFormat configuration used for channels specified in rxChannelMask */ +} adi_adrv903x_RxDataFormatRt_t; + + +/** +* \brief Indicates the rx channels to which an instance of adi_adrv903x_CddcDataFormat_t applies +*/ +typedef struct adi_adrv903x_CddcDataFormatRt +{ + uint32_t rxChannelMask; /*!< The rx channels to which rxDataFormat applies. Suggested to use adi_adrv903x_RxChannels_e to build. */ + adi_adrv903x_CddcDataFormat_t cddcDataFormat; /*!< RxDataFormat configuration used for channels specified in rxChannelMask */ +} adi_adrv903x_CddcDataFormatRt_t; + +/** +* \brief Enum to hold ADRV903X Decimated power block selection +*/ +typedef enum adi_adrv903x_DecPowerMeasurementBlock +{ + ADI_ADRV903X_DEC_POWER_MAIN_PATH_MEAS_BLOCK = 0x1, /*!< Selects main path decimated power measurement block */ + ADI_ADRV903X_DEC_POWER_BAND_A_MEAS_BLOCK = 0x2, /*!< Selects Band A decimated power measurement block */ + ADI_ADRV903X_DEC_POWER_BAND_B_MEAS_BLOCK = 0x4, /*!< Selects Band B decimated power measurement block */ +} adi_adrv903x_DecPowerMeasurementBlock_e; + +/** +* \brief Enum to select Rx Decimated power measurement control type +*/ +typedef enum adi_adrv903x_DecPowerControl +{ + ADI_ADRV903X_DEC_POWER_MEAS_OFF = 0, /*!< Disable decimated power measurement for selected block */ + ADI_ADRV903X_DEC_POWER_MEAS_ON = 1, /*!< Enable decimated power measurement for selected block. If user enables DEC power measurement with this option + AGC block won't use decimated power measurements*/ + ADI_ADRV903X_DEC_POWER_AGC_MEAS = 2 /*!< Leave decimated power measurement block control to AGC. */ +} adi_adrv903x_DecPowerControl_e; + +/** +* \brief Data structure for Rx decimated power block configuration +*/ +typedef struct adi_adrv903x_RxDecimatedPowerCfg +{ + uint32_t rxChannelMask; /*!< Rx channel selection */ + adi_adrv903x_DecPowerControl_e decPowerControl; /*!< Decimated power measurements control mode */ + uint8_t powerInputSelect; /*!< Use output of Rx for power measurement. 0: DC Offset output, 1: RFIR output, 2: QFIR output, 3:HB2 output. Valid Range from 0 to 3, only effective for main path Dec power*/ + uint8_t measBlockSelectMask; /*!< Select Main path dec power, BandA dec power and/or BandB dec power. Please use adi_adrv903x_DecPowerMeasurementBlock_e to create this mask */ + uint8_t powerMeasurementDuration; /*!< Average power measurement duration = 8*2^powerMeasurementDuration. Valid range from 0 to 31 */ +}adi_adrv903x_RxDecimatedPowerCfg_t; + +/** +* \brief Data structure for Orx decimated power block configuration +*/ +typedef struct adi_adrv903x_ORxDecimatedPowerCfg +{ + uint32_t orxChannelMask; /*!< ORx channel selection */ + uint8_t measurementEnable; /*!< 0:Disable , 1:Enable power measurements */ + uint8_t powerInputSelect; /*!< Signal selection for power measurement. 0: Hb2 input, 1: Hb2 output, 2: Hb1 output */ + uint8_t powerMeasurementDuration; /*!< Average power measurement duration = 8*2^powerMeasurementDuration. Valid range from 0 to 21 */ +}adi_adrv903x_ORxDecimatedPowerCfg_t; + +/** + * \brief Enum to set the Rx gain control mode + */ +typedef enum adi_adrv903x_RxGainCtrlMode +{ + ADI_ADRV903X_MGC = 0, /*!< MGC Mode */ + ADI_ADRV903X_AGC = 2, /*!< AGC Mode */ +} adi_adrv903x_RxGainCtrlMode_e; + +/** + * \brief Data structure to hold Rx gain control mode configurations + */ +typedef struct adi_adrv903x_RxGainCtrlModeCfg +{ + uint32_t rxChannelMask; + adi_adrv903x_RxGainCtrlMode_e gainCtrlMode; +} adi_adrv903x_RxGainCtrlModeCfg_t; + +/** + * /brief Indicates the frequency of the sine wave test signal with respect to the Rx ADC clock. e.g. DIV_40 + * indicates the sine frequency is 1/40th that of the ADC clock. + */ +typedef enum adi_adrv903x_AdcTestSineFreq +{ + ADI_ADRV903X_FS_DIV_40 = 0, + ADI_ADRV903X_FS_DIV_20 = 1, + ADI_ADRV903X_FS_DIV_10 = 2, + ADI_ADRV903X_FS_DIV_5 = 3 +} adi_adrv903x_AdcTestSineFreq_e; + +/** + * /brief Indicates if the output of an Rx ADC is to be replaced by a test signal. Also describes the test + * signal. The signal is always a full-scale sine wave. + */ +typedef struct adi_adrv903x_RxTestDataCfg +{ + adi_adrv903x_AdcTestSineFreq_e sineFreq; /*common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure. + * \param[in] txChannel The tx channel whose atten table to access. + * \param[in] txAttenIndexOffset Index in tx atten table from which to start reading. + * \param[in,out] txAttenTableRows A caller-supplied array where the table data is written. + * \param[in] numTxAttenEntries The number of rows to read from the tx atten table. + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenTableRead(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + const uint32_t txAttenIndexOffset, + adi_adrv903x_TxAttenTableRow_t txAttenTableRows[], + const uint32_t numTxAttenEntries); + +/** +* \brief This API function has to be used in order to set the Tx RF output attenuation +* for the Tx output channels +* +* The attenuation given by txAttenuation.txAttenuation_mdB will be applied to the txChannel or channels +* indicated by the txAttenuation.txChannelMask as follows +* +*| txChannel | Description | +*|:-------------------:|:---------------------------------------------:| +*| ADI_ADRV903X_TX0 | sets attenuation txAttenuation_mdB for TX0 | +*| ADI_ADRV903X_TX1 | sets attenuation txAttenuation_mdB for TX1 | +*| ADI_ADRV903X_TX2 | sets attenuation txAttenuation_mdB for TX2 | +*| ADI_ADRV903X_TX3 | sets attenuation txAttenuation_mdB for TX3 | +*| ADI_ADRV903X_TX4 | sets attenuation txAttenuation_mdB for TX4 | +*| ADI_ADRV903X_TX5 | sets attenuation txAttenuation_mdB for TX5 | +*| ADI_ADRV903X_TX6 | sets attenuation txAttenuation_mdB for TX6 | +*| ADI_ADRV903X_TX7 | sets attenuation txAttenuation_mdB for TX7 | + +* \pre This function may be called any time after device initialization +* \pre This feature requires the initialization to be complete and the attenuation table to be loaded. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure +* \param[in] txAttenuation array of structure type adi_adrv903x_TxAtten_t +* which indicates the channel and the desired TxAttenuation in milli-dB +* (Range: 0 to 41950 mdB) +* \param[in] numTxAttenConfigs array size passed in txAttenuation array +* +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenSet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxAtten_t txAttenuation[], + const uint32_t numTxAttenConfigs); + +/** +* \brief Reads back the attenuation setting for the Tx channel output for the selected channel +* +* This function reads back the Tx attenuation setting for either the Tx0, Tx1, Tx2, Tx3 , Tx4, Tx5, Tx6, Tx7 RF channel currently applied to the transmit chain. +* This function can work with SPI mode or pin controlled Tx attenuation mode using the increment/decrement GPIO +* pins. +* +* \pre This feature requires the initialization to be complete and the attenuation table to be loaded. +* \pre The Tx data path must be powered up for the current attenuation value to be valid. If the Tx data path +* is powered down or the radio is off, the last Tx attenuation setting when the Tx output was previously active will be +* read back. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device's data structure +* \param[in] txChannel channel selection to read the attenuation is of type adi_adrv903x_TxChannels_e +* \param[out] txAttenuation Pointer to structure of adi_adrv903x_TxAtten_t type to store the readback value of the desired Tx channel attenuation in milli-dB (Range: 0 to 41950 mdB) +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxAtten_t * const txAttenuation); + +/** +* \brief Configures the Tx attenuation mechanism for one or more channels. +* +* \pre This function is called after the device is initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in] chanMask a bit mask indicating the channels to be configured. If the LSB of chanMask is set Tx channel 0 +* will be configured by the call and so on. +* \param[in] txAttenCfg the Tx atten configuration to be assigned to the channels indicated by chanMask +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenCfgSet(adi_adrv903x_Device_t* const device, + const uint32_t chanMask, + adi_adrv903x_TxAttenCfg_t* const txAttenCfg); +/** +* \brief Gets the Tx atten configuration for a channel. +* +* \pre This function is called after the device is initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in] txChannel the Tx channel id whose Tx atten to fetch. +* \param[out] txAttenCfg the atten config is written here. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxAttenCfg_t* const txAttenCfg); + +/** + * \brief Set the attenuation levels in S0 or S1 registers. + * + * These registers form two of several possible sources for the Tx attenuation applied to a channel. Depending + * on other Tx attenuation-update configuration, which can be set using adi_adrv903x_TxAttenUpdateCfgSet, + * setting the S0, S1 registers may or may not result in an immediate change in a channel's Tx attenuation. + * + * \param[in,out] device Context variable - Pointer to the device data structure. + * \param[in] chanMask Indicates the channels to which the attenuation value applies. + * \param[in] levelMilliDB The Tx attenuation in 1/1000s of a decibel. Valid range 0 - 41950, equivalent to 0 - 41.95 dB. + * \param[in] isS0 If non-zero the value into channels' S0 registers otherwise into their + * S1 registers. + * + * \retval adi_common_ErrAction_e + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenS0S1Set(adi_adrv903x_Device_t* const device, + const uint32_t chanMask, + const uint32_t levelMilliDB, + const uint8_t isS0); + +/** + * \brief Get the attenuation levels in S0 or S1 registers. + * + * \param[in,out] device Context variable - Pointer to the device data structure. + * \param[in] txChannel The channel from which to read. + * \param[out] levelMilliDB The retrieved value is written here. + * \param[in] isS0 If non - zero the channels' S0 register is read otherwise the S1 register. + * + * \retval adi_common_ErrAction_e + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenS0S1Get(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + uint32_t* const levelMilliDB, + const uint8_t isS0); + +/** + * \brief Set the Tx attenuation update configuration for several channels. + * + * Each Tx channel's update configuration consists of: + * - an attenuation level source(S0, S0_OR_S1) + * - an attenuation update trigger(GPIO, SPI, NONE) + * - for the cases of GPIO trigger and S0_OR_S1 source some extra configuration information. + * + * Limitations : + * -Setting any channel to trigger on SPI will implicitly set any channels previously configured to trigger + * on GPIO to have a NONE trigger. + * -Setting any channel to trigger on GPIO will implicitly set any channels previously configured to trigger + * on SPI to have a NONE trigger. + * + * \param[in,out] device Context variable - pointer to the device data structure. + * \param[in] chanMask Tx channels to which the configuration is applied + * \param[in] cfg contains the attenuation update source and trigger settings. + * + * Return Value : + * adi_common_ErrAction_e + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenUpdateCfgSet(adi_adrv903x_Device_t* const device, + const uint32_t chanMask, + const adi_adrv903x_TxAttenUpdateCfg_t* const cfg); + +/** + * \brief Get the Tx attenuation update configuration for a channel. + * + * \param[in,out] device Context variable - pointer to the device data structure. + * \param[in] txChannel Tx channel whose update configuration to get. + * \param[out] cfg the attenuation update settings for chanId are written here. + * + * Return Value : + * adi_common_ErrAction_e + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenUpdateCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxAttenUpdateCfg_t* const cfg); + +/** + * \brief Simultaneously update the Tx attenuation level for several channels. + * + * This function only has an effect for channels that have already had their attenuation update trigger set + * to SPI using TxAttenUpdateCfgSet(). The effect of the attenuation update will be simultaneous across all + * affected channels. + * + * \param[in,out] device Context variable - pointer to the device data structure. + * \param[in] chanMask Tx channels on which to update Tx attenuation. + * + * Return Value : + * adi_common_ErrAction_e + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenUpdate(adi_adrv903x_Device_t *const device, + const uint32_t chanMask); + +/** +* \brief This function reads back the LO Source Mapping to the requested Tx channel. +* +* The LO source select for a given channel is configured during init time. This function +* can be used to read back the configuration during run time. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X data structure +* \param[in] txChannel Enum to select Tx Channel +* \param[out] txLoSource Pointer to store Tx channel LO source mapping read back +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxLoSourceGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_LoSel_e * const txLoSource); + +/** +* \brief Function to set the Tx power monitor configuration. +* +* This function can be used to configure peak power monitor and average power monitor blocks. +* A peak is detected if the signal I and Q samples are above a pre-set threshold (PowerMonitorCfg_t.peakPreThreshold) +* and (I^2+Q^2) of the signal exceeds another threshold(PowerMonitorCfg_t.peakThreshold) more than a preset +* count(PowerMonitorCfg_t.peakDetectOverloadCount) within time window configured with PowerMonitorCfg_t.peakDetectOverloadWindowSize. +* If number a valid peaks exceeds PowerMonitorCfg_t.peakCount within PowerMonitorCfg_t.peakDuration time period, peak detection +* error flag is asserted. The signal power (I^2+Q^2) is averaged over a PowerMonitorCfg_t.avgDuration time period and if +* this average value exceeds PowerMonitorCfg_t.avgPowerThreshold, average power error flag is asserted. +* +* This function takes in an array of adi_adrv903x_PowerMonitorCfgRt_t structures to program the Tx channels. +* Each structure has a separate channel mask that indicates to which Tx channels that particular configuration applies. +* Example usage with two different configurations: +* +* txPowerMonitorCfg = (adi_adrv903x_PowerMonitorCfgRt_t *)malloc(2 * sizeof(adi_adrv903x_PowerMonitorCfgRt_t)) +* +* txPowerMonitorCfg[0].txPowerMonitorCfg = txPowerMonitorCfg1; // Configuration 1 loaded with desired configuration values +* txPowerMonitorCfg[0].txChannelMask = (uint32_t)(ADI_ADRV903X_TX0 | ADI_ADRV903X_TX1 | ADI_ADRV903X_TX2 | ADI_ADRV903X_TX3); +* +* txPowerMonitorCfg[1].txPowerMonitorCfg = txPowerMonitorCfg2; // Configuration 2 loaded with desired configuration values +* txPowerMonitorCfg[1].txChannelMask = (uint32_t)(ADI_ADRV903X_TX4 | ADI_ADRV903X_TX5 | ADI_ADRV903X_TX6 | ADI_ADRV903X_TX7); +* +* retVal = adi_adrv903x_TxPowerMonitorCfgSet(device, txPowerMonitorCfg, 2); +* +* Note: The function does not check for duplicated channel assignments across cfg structures. +* Invalid channel mask values will return an error. +* Not all Tx channels must be assigned a configuration. If a channel mask is zero that configuration is ignored, ie no +* error returned. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in] txPowerMonitorCfg array of structures of type adi_adrv903x_PowerMonitorCfgRt_t which will configure one or more channels +* \param[in] numPowerProtectCfgs number of configurations passed in the array +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxPowerMonitorCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_PowerMonitorCfgRt_t txPowerMonitorCfg[], + const uint32_t numPowerProtectCfgs); + + + +/** +* \brief Function to get the Tx power monitor configuration. +* +* This function can be used to read back the power monitor configuration for selected channel. +* User can select the Tx channel by using adi_adrv903x_PowerMonitorCfgRt_t.txChannelMask +* Only one Tx channel should be selected at a time, otherwise this function will throw an error. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in,out] txPowerMonitorCfg Pointer to power monitor configuration to be populated +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxPowerMonitorCfgGet(adi_adrv903x_Device_t * const device, + adi_adrv903x_PowerMonitorCfgRt_t* const txPowerMonitorCfg); + + +/** +* \brief This function reads the status of events causing Tx power ramp down +* +* Each Tx Channel(0-7) has independent ramp-down event status bits. +* Only one Tx channel should be selected at a time, otherwise this function will throw an error. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in] txChannel Channel selection to read error flags +* \param[out] eventBits Pointer to error mask to be populated by this function +* Bit | Description +* ---------- -|----------------------------------------------------------------------------- +* [4-7] | Reserved +* [3] | Pll Unlock / Dfrm Error +* [2] | SRD error +* [1] | Pa Protection Peak Power Error +* [0] | Pa Protection Average Power Error + + +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxProtectionErrorGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + uint32_t* const eventBits); + +/** +* \brief This function clears the error flags causing Tx power ramp down +* +* Each Tx Channel(0-7) has independent ramp-down event flags. +* Only one Tx channel should be selected at a time, otherwise this function will throw an error. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in] txChannel Channel selection to clear error flags +* \param[in] eventBits Mask selecting the error flags to be cleared +* Bit | Description +* ----------- |----------------------------------------------------------------------------- +* [4-7] | Reserved +* [3] | Pll Unlock / Dfrm Error +* [2] | SRD error +* [1] | Pa Protection Peak Power Error +* [0] | Pa Protection Average Power Error + + +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxProtectionErrorClear(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + const uint32_t eventBits); + + +/** +* \brief Function to set the Tx Slew Rate Detector configuration +* Slew rate is calculated as (I[n]-I[n-1])^2+(Q[n]-Q[n-1])^2 where n is the latest sample index of both I and Q samples. +* If calculated slew is greater than a pre-set limit, txSlewRateDetectorCfg.srdOffset, slew rate error is asserted. +* User might assign slew rate event to GPIO with txSlewRateDetectorCfg.gpioSel. +* +* This function takes in an array of adi_adrv903x_SlewRateDetectorCfgRt_t structures to program the Tx channels. +* Each structure has a separate channel mask that indicates to which Tx channels that particular configuration applies. +* Example usage with two different configurations: +* +* txSlewRateDetectorCfg = (adi_adrv903x_SlewRateDetectorCfgRt_t *)malloc(2 * sizeof(adi_adrv903x_SlewRateDetectorCfgRt_t)) +* +* txSlewRateDetectorCfg[0].txSlewRateDetectorCfg = txSlewRateDetectorCfg1; // Configuration 1 loaded with desired configuration values +* txSlewRateDetectorCfg[0].txChannelMask = (uint32_t)(ADI_ADRV903X_TX0 | ADI_ADRV903X_TX1 | ADI_ADRV903X_TX2 | ADI_ADRV903X_TX3); +* +* txSlewRateDetectorCfg[1].txSlewRateDetectorCfg = txSlewRateDetectorCfg2; // Configuration 2 loaded with desired configuration values +* txSlewRateDetectorCfg[1].txChannelMask = (uint32_t)(ADI_ADRV903X_TX4 | ADI_ADRV903X_TX5 | ADI_ADRV903X_TX6 | ADI_ADRV903X_TX7); +* +* retVal = adi_adrv903x_TxSlewRateDetectorCfgSet(device, txSlewRateDetectorCfg, 2); +* +* Note: The function does not check for duplicated channel assignments across cfg structures. +* Invalid channel mask values will return an error. +* Not all Tx channels must be assigned a configuration. If a channel mask is zero that configuration is ignored, ie no +* error returned. +* +* \pre This function is called after the device is initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in] txSlewRateDetectorCfg an array holding all the Slew Rate Detector configurations required with the assigned channel mask +* \param[in] numSlewRateDetCfgs the number of elements in txSlewRateDetectorCfg array + +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxSlewRateDetectorCfgSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SlewRateDetectorCfgRt_t txSlewRateDetectorCfg[], + const uint32_t numSlewRateDetCfgs); + +/** +* \brief Function to get the Tx SRD configuration. +* +* This function can be used to read back the slew rate detector configuration for selected channel. +* User can select the Tx channel by using adi_adrv903x_SlewRateDetectorCfgRt_t.txChannelMask +* Only one Tx channel should be selected at a time, otherwise this function will throw an error. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in,out] txSlewRateDetectorCfg Pointer to SRD configuration to be populated +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxSlewRateDetectorCfgGet(adi_adrv903x_Device_t * const device, + adi_adrv903x_SlewRateDetectorCfgRt_t * const txSlewRateDetectorCfg); + +/** +* \brief This function reads SRL statistics. +* Statistics might either be the maximum slew observed or the number of samples which have been +* slew rate limited(Maximum = 65536 sample count) depending on the statistics mode. +* Statistics mode can be selected with adi_adrv903x_TxSlewRateDetectorCfgSet. +* \pre This function is called after the device is initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in] txChannel enum to select Tx channel +* \param[in] clearStats 0:Don't clear statistics after reading / 1: Clear statistics after reading. +* \param[out] statisticsReadback Pointer to memory location where readback value will be written +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxSlewRateStatisticsRead(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + const uint8_t clearStats, + uint16_t * const statisticsReadback); + +/** +* \brief This function enables/disables the sample hold for tx pa protection ramp. If +* sample hold is enabled, last good sample (the sample before pa protection error flag is +* asserted) is held after FIR1 block. Once the ramp down is completed, signal starts to travel +* in datapath again. This feature can be used to prevent offending sample to reach PA and can be +* useful especially for slew rate events. +* +* \pre This function is called after the device is initialized. +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in] txChannelMask Tx channel mask to select channel/s for which sample hold will be enabled/disabled +* \param[in] enable 1:Enable sample hold // 0:Disable sample hold + +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxProtectionRampSampleHoldEnableSet(adi_adrv903x_Device_t* const device, + const uint32_t txChannelMask, + const uint8_t enable); + +/** +* \brief This function reads back sample hold ramp down configuration for selected Tx channel +* +* \pre This function is called after the device is initialized. +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in] txChannel Tx channel to read sample hold and ramp down configuration +* \param[out] enable Pointer to sample hold and ramp down configuration +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxProtectionRampSampleHoldEnableGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + uint8_t* const enable); + + +/** +* \brief Function to set the Tx Protection Ramp configuration. This function configures Tx ramp-down in +* case of Average Power Error/Peak Power Error/SRD Error/Pll Unlock/Dfrm Irq. Each Tx channel has +* independent ramp-down configuration. +* +* Ramp down functionality uses Tx attenuation block. This would set to tx attenuation index +* to maximum value to ramp down the tx power. +* +* \pre This function is called after the device is initialized. +* +* This function takes in an array of adi_adrv903x_ProtectionRampCfgRt_t structures to program the Tx channels. +* Each structure has a separate channel mask that indicates to which Tx channels that particular configuration applies. +* Example usage with two different configurations: +* +* txProtectionRampCfg = (adi_adrv903x_ProtectionRampCfgRt_t *)malloc(2 * sizeof(adi_adrv903x_ProtectionRampCfgRt_t)) +* +* txProtectionRampCfg[0].txProtectionRampCfg = txProtectionRampCfg1; // Configuration 1 loaded with desired configuration values +* txProtectionRampCfg[0].txChannelMask = (uint32_t)(ADI_ADRV903X_TX0 | ADI_ADRV903X_TX1 | ADI_ADRV903X_TX2 | ADI_ADRV903X_TX3); +* +* txProtectionRampCfg[1].txProtectionRampCfg = txProtectionRampCfg2; // Configuration 2 loaded with desired configuration values +* txProtectionRampCfg[1].txChannelMask = (uint32_t)(ADI_ADRV903X_TX4 | ADI_ADRV903X_TX5 | ADI_ADRV903X_TX6 | ADI_ADRV903X_TX7); +* +* retVal = adi_adrv903x_TxProtectionRampCfgSet(device, txProtectionRampCfg, 2); +* +* Note: The function does not check for duplicated channel assignments across cfg structures. +* Invalid channel mask values will return an error. +* Not all Tx channels must be assigned a configuration. If a channel mask is zero that configuration is ignored, ie no +* error returned. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in] txProtectionRampCfg array of structures of type adi_adrv903x_ProtectionRampCfg_t which will configure one or more channels +* \param[in] numProtectionRampCfgs number of configurations passed in the array + +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxProtectionRampCfgSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_ProtectionRampCfgRt_t txProtectionRampCfg[], + const uint32_t numProtectionRampCfgs); + +/** +* \brief Function to read the Tx Protection Ramp configuration. +* +* User can select the Tx channel by using adi_adrv903x_TxProtectionRampCfgRt_t.txChannelMask +* Only one Tx channel should be selected at a time, otherwise this function will throw an error. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in,out] txProtectionRampCfg Pointer to ramp down configuration to be populated with readback value +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxProtectionRampCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_ProtectionRampCfgRt_t* const txProtectionRampCfg); + +/** +* \brief This function reads average and peak power, average to peak ratio(if enabled), +* average power at the time when last average power error occurred, peak power at the time +* when last peak power error occurred. Power readback will be returned 0 if corresponding +* block(Avg Power/Peak Power/Average to Peak Ratio) is not enabled. +* +* Average Power in dBFS = 10 * log10(avgPower/2^16) +* Power Error in dBFS = 10 * log10(avgErrorPower/2^16) +* Ratio calculation for avgPeakRatio : avgPower/peakPower = ((avgPeakRatio) / 2^15) + +* \pre This function can be called after the device is initialized. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the adrv903x data structure +* \param[in] txChannel enum to select Tx channel +* \param[out] powerMonitorStatus Pointer to memory location where readback value will be written +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxPowerMonitorStatusGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxPowerMonitorStatus_t * const powerMonitorStatus); + + + /** + * \brief Sets the specified Tx Mix NCO to the given frequency, band number, and enable state in the adi_adrv903x_TxNcoMixConfig_t structure. + * + * \pre This function can be called after the CPU has been initialized. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings + * \param[in] txNcoConfig Pointer to the TX NCO Mix configuration settings + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxNcoShifterSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxNcoMixConfig_t * const txNcoConfig); + +/** + * \brief Gets TX Mix NCO parameters in adi_adrv903x_TxNcoMixConfigReadbackResp_t structure. + * + * \pre This function can be called after the CPU has been initialized, firmware loaded and the TX Mix NCO configured. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings + * \param[in,out] txRbConfig Pointer to the TX NCO config read back settings + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxNcoShifterGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TxNcoMixConfigReadbackResp_t* const txRbConfig); + +/** + * \brief Sets the specified Tx Test NCO to the given frequency, band number, attenuation control, and enable state + * in the adi_adrv903x_TxTestNcoConfig_t structure. + * + * \pre This function can be called after the CPU has been initialized. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings + * \param[in] txNcoConfig Pointer to the TX NCO Test config settings + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxTestToneSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxTestNcoConfig_t * const txNcoConfig); + +/** + * \brief Gets TX Test NCO parameters in adi_adrv903x_TxTestNcoConfigReadbackResp_t structure. + * + * \pre This function can be called after the CPU has been initialized, firmware loaded and the TX Test NCO configured. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings + * \param[in,out] txRbConfig Pointer to the RX NCO config read back settings + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxTestToneGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TxTestNcoConfigReadbackResp_t* const txRbConfig); + +/** +* \brief Function to configure Tx decimated power measurement block. +* +* This function can be used to configure decimated power measurements for Tx channel. +* Measurement point and measurement duration can be selected by user through configuration structure. +* This function configures Tx dec power block. +* +* Note: The function does not check for duplicated channel assignments across cfg structures. +* Invalid channel mask values will return an error. + +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txDecPowerCfg array of structures of type adi_adrv903x_TxDecimatedPowerCfg_t which will configure one or more channels +* \param[in] numOfDecPowerCfgs number of configurations passed in the array +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxDecimatedPowerCfgSet(adi_adrv903x_Device_t * const device, + adi_adrv903x_TxDecimatedPowerCfg_t txDecPowerCfg[], + const uint32_t numOfDecPowerCfgs); + +/** +* \brief Function to read back Tx decimated power measurement configuration +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txChannel Tx channel selection to read decimated power block configuration +* \param[out] txDecPowerCfg Decimated power configuration of selected channel/dec power block +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxDecimatedPowerCfgGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxDecimatedPowerCfg_t * const txDecPowerCfg); + + +/** +* \brief Function to readback the decimated power measurement for selected Tx channel. +* Power readback value is an unsigned 8 bit value with 0.25dB resolution. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txChannel Channel selection to read decimated power measurement +* \param[out] powerReadBack Pointer to power measurement readback value +* \param[out] powerPeakReadBack Pointer to power measurement readback value +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxDecimatedPowerGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + uint8_t * const powerReadBack, + uint8_t * const powerPeakReadBack); + +/** + * \brief Sets the specified Tx Atten Phase in the adi_adrv903x_TxAttenPhaseCfg_t structure. + * + * \pre This function can be called after the CPU has been initialized. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings + * \param[in] txAttenPhaseCfg Pointer to the TX Atten Phase configuration settings + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenPhaseSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxAttenPhaseCfg_t * const txAttenPhaseCfg); + +/** + * \brief Gets TX Atten Phase in adi_adrv903x_TxAttenPhaseCfg_t structure. + * + * \pre This function can be called after the CPU has been initialized, firmware loaded and the TX Atten Phase configured. + * + * \dep_begin + * \dep{device->common.devHalInfo} + * \dep_end + * + * \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings + * \param[in,out] txRbConfig Pointer to the TX Atten Phase config read back settings + * + * \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenPhaseGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TxAttenPhaseCfg_t* const txRbConfig); + + +/** +* \brief Configures Discontinuous Transmit (DTX) features +* +* DTX provides the ability to shut down the clock to save power through three different mode: Automatic mode, SPI controlled mode, or Pin Control mode. +* dtx_mode_enable Operation Notes +* 2'b00 DTx mode disable +* 2'b01 Automatic mode. Triggers the power down stream on observing a specified number of zero samples (dtx_zero_counter) on Tx input data. Power up stream is triggered as soon as a non zero sample is seen. The number of samples defined is at the slower of the 2 DUC in clock rates. +* 2'b10 SPI controlled mode In this mode, power down is triggered on setting the dtx_force bitfield. Clearing that bit triggers the power up stream. +* 2'b11 Pin controlled mode In this mode, a GPIO pin specified by the dtx_force_gpio_select controls Power up/down. Rising edge on the pin triggers the power down stream and a falling edge triggers a power up stream +* +* Configure the DTX registers. Set the DTX Mode, DTX zero counter for the Tx channels +* +* The DTX configs can be broadcast / multicast based +* on the channel mask parameter in adi_adrv903x_DtxCfg_t structure. +* +* dtxCfg[i]->txChannelMask | Tx Channels to set DTX +* ---------------------------------|-------------------------------------- +* bit[0] | 1 = Tx0 DTX is updated +* | +* bit[1] | 1 = Tx1 DTX is updated +* | +* bit[2] | 1 = Tx2 DTX is updated +* | +* bit[3] | 1 = Tx3 DTX is updated +* | +* bit[4] | 1 = Tx4 DTX is updated +* | +* bit[5] | 1 = Tx5 DTX is updated +* | +* bit[6] | 1 = Tx6 DTX is updated +* | +* bit[7] | 1 = Tx7 DTX is updated + +* +* Eg: To update DTX for channels Tx3 and Tx0, the dtxCfg[i]->txChannelMask +* should be set to 0x00000009 +* +* Eg: To update DTX for all Tx channels, the dtxCfg[i]->txChannelMask +* should be set to 0x000000FF +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \pre This function may be called any time after device initialization +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] dtxCfg Array of the channelized DTX settings +* \param[in] numDtxCfgs Size of dtxCfg array +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DtxCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DtxCfg_t dtxCfg[], + const uint32_t numDtxCfgs); +/** +* \brief Reads the Discontinuous Transmit (DTX) settings for the requested Tx channel +* +* This function reads the DTX settings for the requested +* channel. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* +* \pre This function may be called any time after device initialization +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txChannel adi_adrv903x_TxChannels_e enum type to select channel from. +* \param[out] dtxCfg Pointer to the DTX structure for the requested channel. +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +* +* +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DtxCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_DtxCfg_t* const dtxCfg); +/** +* \brief Configures Discontinuous Transmit (DTX) GPIO features +* +* +* Given design constraints and that GPIOs are a shared resource there +* are limitations on the set of valid configurations. This API only +* configures the GPIO settings. For all other settings please use +* the adi_adrv903x_DtxCfgSet() API. +* +* The channel should be selected through dtxGpioCfg structure +* dtxGpioCfg.dtxGpioTxSel[0] = GPIO for channel 0; +* ........... +* dtxGpioCfg.dtxGpioTxSel[7] = GPIO for channel 7; +* +* Errors will be returned under the following conditions: +* - The requested GPIO is being used by another resource +* - The configuration requested is invalid +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] dtxGpioCfg Pointer to the DTX GPIO structure +* +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +* +* +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DtxGpioCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DtxGpioCfg_t* dtxGpioCfg); + +/** +* \brief Reads the Discontinuous Transmit (DTX) for the requested Tx channel +* +* This function reads the DTX GPIO settings for the requested +* channel. +* The channel should be selected through dtxGpioCfg structure +* dtxGpioCfg.dtxGpioTxSel[0] = GPIO for channel 0; +* ........... +* dtxGpioCfg.dtxGpioTxSel[7] = GPIO for channel 7; +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[out] dtxGpioCfg Pointer to the DTX GPIO structure +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DtxGpioCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_DtxGpioCfg_t* const dtxGpioCfg); + + + +/** +* \brief Set the Discontinuous Transmit (DTX) Force bit for the requested Tx channels. +* +* In SPI Mode, power down is triggered on setting the dtx_force bitfield. Clearing that bit triggers the power up stream. +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txChannelMask Tx Channels for which the DTX Force to be update. +* \param[in] dtxForce DTX status bit to be read +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DtxForceSet(adi_adrv903x_Device_t* const device, + const uint32_t txChannelMask, + const uint8_t dtxForce); + +/** +* \brief Reads the Discontinuous Transmit (DTX) status for the requested Tx channel +* +* This function reads the DTX status for the requested +* channel. +* +* Status bits logic +* bit0: set by dtx_power_down; clear by dtx_power_up ( or cleared by spi_clear_dtx_status_bit0, not required) +* bit1: set by dtx_power_down; clear by spi_clear_dtx_status_bit1 (executed at the end of power up stream) +* +* \dep_begin +* \dep{device->halDevInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txChannel Tx Channels for which the DTX Status to read. +* \param[out] dtxStatus DTX status bit to be read +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DtxStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + uint8_t * const dtxStatus); + + +/** +* \brief Write Tx PFIR coefficients +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txChannelMask Tx channels (mask of adi_adrv903x_TxChannels_e) +* \param[in] pfirCoeffs - pointer to array of PFIR i and q coefficients to be programmed into Tx channels in txChannelMask +* +* \retval adi_common_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxPfirCoeffsWrite(adi_adrv903x_Device_t* const device, + const uint32_t txChannelMask, + adi_adrv903x_TxPfirCoeff_t* const pfirCoeffs); + +/** +* \brief Read Tx PFIR coefficients +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] txChannel Tx channel from which PFIR coefficients should be read +* \param[out] pfirCoeffs - pointer to array of PFIR i and q coefficients to be written with PFIR coefficients read from single Tx channel in txChannelMask +* +* \retval adi_common_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxPfirCoeffsRead(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxPfirCoeff_t* const pfirCoeffs); + +#endif /* _ADI_ADRV903X_TX_H_ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_tx_nco.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_tx_nco.h new file mode 100644 index 0000000000000..64c2d701bb9ca --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_tx_nco.h @@ -0,0 +1,134 @@ +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * \file adi_adrv903x_tx_nco.h + * + * \brief Contains ADRV903X Tx NCO data structures. + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef __ADI_ADRV903X_TX_NCO_H__ +#define __ADI_ADRV903X_TX_NCO_H__ + +#include "adi_adrv903x_platform_pack.h" +#include "adi_adrv903x_cpu_error_codes_types.h" + +#define ADI_ADRV903X_TX_ATTEN_PHASE_SIZE (65u) + +/** + * \brief NCO set Tx MIX command structure + */ +ADI_ADRV903X_PACK_START +typedef struct adi_adrv903x_TxNcoMixConfig +{ + uint8_t chanSelect; /*!< Select the Tx channels (bit mapped) to enable/disable */ + uint8_t enable; /*!< 0: Disable, 1: Enable */ + uint32_t phase; /*!< Phase in degrees (0 - 359) */ + int32_t frequencyKhz; /*!< Desired frequency in KHz */ +} adi_adrv903x_TxNcoMixConfig_t; +ADI_ADRV903X_PACK_FINISH + +/** + * \brief Enumeration for DDC channel number + */ +typedef enum adi_adrv903x_DucNumber +{ + ADI_ADRV903X_DUC_BAND_0 = 0u, /*!< DUC channel 0 */ + ADI_ADRV903X_DUC_NUM_BAND +} adi_adrv903x_DucNumber_e; + +/** + * \brief NCO TX MIX set command response structure + */ +ADI_ADRV903X_PACK_START +typedef struct adi_adrv903x_TxNcoMixConfigReadbackResp +{ + adi_adrv903x_CpuErrorCode_t status; /*!< CPU error status code */ + uint8_t chanSelect; /*!< Tx channels (bit mapped) */ + uint8_t enable; /*!< 0: Disabled, 1: Enabled */ + uint32_t phase; /*!< Phase in degrees (0 - 359) */ + int32_t frequencyKhz; /*!< frequency in KHz */ +} adi_adrv903x_TxNcoMixConfigReadbackResp_t; +ADI_ADRV903X_PACK_FINISH + +typedef uint8_t adi_adrv903x_TxTestNcoSelect_t; +typedef uint8_t adi_adrv903x_TxTestNcoAtten_t; + +/** + * \brief NCO TX Test Tone NCO Select + */ +typedef enum adi_adrv903x_TxTestNcoSelect +{ + ADI_ADRV903X_TX_TEST_NCO_0 = 0x0u, /*!< First NCO */ + ADI_ADRV903X_TX_TEST_NCO_1 = 0x1u, /*!< Second NCO */ + ADI_ADRV903X_TX_TEST_NCO_MAX_NUM = 0x2u +} adi_adrv903x_TxTestNcoSelect_e; + +/** + * \brief NCO TX Test Tone NCO Attenuation + */ +typedef enum adi_adrv903x_TxTestNcoAtten +{ + ADI_ADRV903X_TX_TEST_NCO_ATTEN_0DB = 0x0u, /*!< 0 dB */ + ADI_ADRV903X_TX_TEST_NCO_ATTEN_6DB = 0x1u, /*!< 6 dB */ + ADI_ADRV903X_TX_TEST_NCO_ATTEN_12DB = 0x2u, /*!< 12 dB */ + ADI_ADRV903X_TX_TEST_NCO_ATTEN_18DB = 0x3u, /*!< 18 dB */ + ADI_ADRV903X_TX_TEST_NCO_ATTEN_24DB = 0x4u, /*!< 24 dB */ + ADI_ADRV903X_TX_TEST_NCO_ATTEN_30DB = 0x5u, /*!< 30 dB */ + ADI_ADRV903X_TX_TEST_NCO_ATTEN_36DB = 0x6u, /*!< 36 dB */ + ADI_ADRV903X_TX_TEST_NCO_ATTEN_42DB = 0x7u, /*!< 42 dB */ + ADI_ADRV903X_TX_TEST_NCO_ATTEN_48DB = 0x8u, /*!< 48 dB */ + ADI_ADRV903X_TX_TEST_NCO_ATTEN_MAX_NUM = 0x9 +} adi_adrv903x_TxTestNcoAtten_e; + +/** + * \brief NCO Tx Test set command structure + */ +ADI_ADRV903X_PACK_START +typedef struct adi_adrv903x_TxTestNcoConfig +{ + uint8_t chanSelect; /*!< Select Tx channel (bit mapped) */ + uint8_t enable; /*!< 0: Disable, 1: Enable */ + adi_adrv903x_TxTestNcoSelect_t ncoSelect; /*!< 0 or 1 */ + uint32_t phase; /*!< Phase in degrees (0 - 359) */ + int32_t frequencyKhz; /*!< Desired frequency in KHz */ + adi_adrv903x_TxTestNcoAtten_t attenCtrl; /*!< Attenuation control */ + /* TODO: Add summing control? */ +} adi_adrv903x_TxTestNcoConfig_t; +ADI_ADRV903X_PACK_FINISH + +/** + * \brief NCO Tx Test set command response structure + */ +ADI_ADRV903X_PACK_START +typedef struct adi_adrv903x_TxTestNcoConfigReadbackResp +{ + adi_adrv903x_CpuErrorCode_t status; /*!< CPU error status code */ + uint8_t chanSelect; /*!< Select Tx channel (bit mapped) */ + adi_adrv903x_TxTestNcoSelect_t ncoSelect; /*!< 0 or 1 */ + uint8_t enabled; /*!< 0: Disabled, 1: Enabled */ + uint32_t phase; /*!< Phase in degrees (0 - 359) */ + int32_t frequencyKhz; /*!< Desired frequency in KHz */ + adi_adrv903x_TxTestNcoAtten_t attenCtrl; /*!< Attenuation control */ +} adi_adrv903x_TxTestNcoConfigReadbackResp_t; +ADI_ADRV903X_PACK_FINISH + + +/** +* \brief Data structure for Tx Atten Phase configuration +*/ +ADI_ADRV903X_PACKED( +typedef struct adi_adrv903x_TxAttenPhaseCfg +{ + uint8_t chanSelect; /*!< Tx channel (bit mapped) */ + int16_t txAttenPhase[ADI_ADRV903X_TX_ATTEN_PHASE_SIZE]; /*!< Tx atten phase values */ +} adi_adrv903x_TxAttenPhaseCfg_t;) + +#endif /* __ADI_ADRV903X_TX_NCO_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_tx_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_tx_types.h new file mode 100644 index 0000000000000..329227f41d613 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_tx_types.h @@ -0,0 +1,355 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_tx_types.h +* \brief Contains ADRV903X API Tx datapath data types +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef _ADI_ADRV903X_TX_TYPES_H_ +#define _ADI_ADRV903X_TX_TYPES_H_ + +#include "adi_library_types.h" +#include "adi_adrv903x_tx_nco.h" +#include "adi_adrv903x_gpio_types.h" + + +#define ADRV903X_TX_ATTEN_TABLE_MAX_IDX 959 /*!< Maximum valid tx attenuation table index */ +#define ADRV903X_TX_ATTEN_VALUE_MILLI_DB_MAX 41950 /*!< Maximum Value of TX Attenuation in 1/1000s of a dB */ +#define ADRV903X_TX_ATTEN_STEP_SIZE_DIV_0P05 50 /*!< The only supported attenuation step size is 0.05dB */ +#define ADRV903X_TX_ATTEN_STEP_SIZE_DIV_0P1 100 /*!< Not supported */ +#define ADRV903X_TX_ATTEN_STEP_SIZE_DIV_0P2 200 /*!< Not supported */ +#define ADRV903X_TX_ATTEN_STEP_SIZE_DIV_0P4 400 /*!< Not supported */ + +#define ADRV903X_ADDR_TX0_ATTEN_TABLE 0x60812000 +#define ADRV903X_ADDR_TX1_ATTEN_TABLE 0x60912000 +#define ADRV903X_ADDR_TX2_ATTEN_TABLE 0x60A12000 +#define ADRV903X_ADDR_TX3_ATTEN_TABLE 0x60B12000 +#define ADRV903X_ADDR_TX4_ATTEN_TABLE 0x60C12000 +#define ADRV903X_ADDR_TX5_ATTEN_TABLE 0x60D12000 +#define ADRV903X_ADDR_TX6_ATTEN_TABLE 0x60E12000 +#define ADRV903X_ADDR_TX7_ATTEN_TABLE 0x60F12000 + +#define ADRV903X_TX_ATTEN_TABLE_HP_MASK 0x0007F000 +#define ADRV903X_TX_ATTEN_TABLE_HP_SHIFT 12 +#define ADRV903X_TX_ATTEN_TABLE_MULT_MASK 0x00000FFF +#define ADRV903X_TX_ATTEN_TABLE_MULT_SHIFT 0 + +#define ADRV903X_TX_ATTEN_HP_MIN_VALUE 1 +#define ADRV903X_TX_ATTEN_HP_MAX_VALUE 64 +#define ADRV903X_TX_ATTEN_HP_SET_ALL_VALUE 0xFF + +#define ADI_ADRV903X_MAX_TXCHANNELS 8U +#define ADI_ADRV903X_TX_CHAN_ID_MAX (ADI_ADRV903X_MAX_TXCHANNELS - 1U) +#define ADI_ADRV903X_TX_CHAN_MASK_MAX ((1U << (ADI_ADRV903X_TX_CHAN_ID_MAX + 1U)) - 1U) +#define ADI_ADRV903X_TX_PLAYBACK_DATA_MAX_NUM_SAMPLES (8192U) /*!< Maxinum number of TX playback samples */ + +#define ADI_ADRV903X_NUM_PFIR_COEF 24 + +#define TX_CDUC_GAIN_BASE_ADDR 0x608B0D60U /*!< register to be written in one SPI transaction */ +#define TX_CDUC_GAIN_SIZE (0x4U * ADI_ADRV903X_MAX_TX_CARRIERS) + +#define ADI_ADRV903X_MAX_TXCARRIERS 8U +#define ADI_ADRV903X_TX_CARRIER_ID_MAX ( - 1U) +#define ADI_ADRV903X_TX_CARRIER_MASK_MAX ((1U << (ADI_ADRV903X_TX_CARRIER_ID_MAX + 1U)) - 1U) + + +/** + * \brief Enum of possible Tx channel enables + */ +typedef enum adi_adrv903x_TxChannels +{ + ADI_ADRV903X_TXOFF = 0x00U, /*!< No Tx channels are enabled */ + ADI_ADRV903X_TX0 = 0x01U, /*!< Tx0 channel enabled */ + ADI_ADRV903X_TX1 = 0x02U, /*!< Tx1 channel enabled */ + ADI_ADRV903X_TX2 = 0x04U, /*!< Tx2 channel enabled */ + ADI_ADRV903X_TX3 = 0x08U, /*!< Tx3 channel enabled */ + ADI_ADRV903X_TX4 = 0x10U, /*!< Tx4 channel enabled */ + ADI_ADRV903X_TX5 = 0x20U, /*!< Tx5 channel enabled */ + ADI_ADRV903X_TX6 = 0x40U, /*!< Tx6 channel enabled */ + ADI_ADRV903X_TX7 = 0x80U, /*!< Tx7 channel enabled */ + ADI_ADRV903X_TXALL = 0xFFU /*!< All tx channel mask */ +} adi_adrv903x_TxChannels_e; + +/** + * \brief Holds a single row of adrv903x tx attenuation table. + */ +typedef struct adi_adrv903x_TxAttenTableRow +{ + uint16_t txAttenMult; /*!< Tx Attenuation Multiplier (0-4095) */ + uint8_t txAttenHp; /*!< Tx Attenuation HP (0-63) */ + uint8_t reserved; /*!< Reserved */ +} adi_adrv903x_TxAttenTableRow_t; + +/** +* \brief Enum select for pa protection input +*/ +typedef enum adi_adrv903x_PaProtectionInputSel +{ + ADI_ADRV903X_HB1_OUTPUT = 0x0000, /*!< Input data to Pa protection block is probed from HB1 output */ + + ADI_ADRV903X_TXQEC_ACTUATOR_OUTPUT = 0x0001 /*!< Input data to Pa protection block is probed from tx qec actuator output */ + +} adi_adrv903x_PaProtectionInputSel_e; + +/** +* \brief Enum select events for triggering ramp down +*/ +typedef enum adi_adrv903x_RampDownTrigger +{ + ADI_ADRV903X_RDT_PEAK_PA = 0x1, /*!< Use the Peak PA block to trigger ramp down event */ + ADI_ADRV903X_RDT_AVG_PA = 0x2, /*!< Use the Average PA block to trigger ramp down event */ + ADI_ADRV903X_RDT_SRD = 0x4, /*!< Use the Slew Rate Detector block to trigger ramp down event */ + ADI_ADRV903X_RDT_CLK_PLL_UNLOCK = 0x8, /*!< Use the CLK PLL unlock to trigger ramp down event */ + ADI_ADRV903X_RDT_RF_PLL1_UNLOCK = 0x10, /*!< Use the RF PLL1 unlock to trigger ramp down event - This enum is deprecated. Please use ADI_ADRV903X_RDT_RF0_PLL_UNLOCK instead */ + ADI_ADRV903X_RDT_RF_PLL2_UNLOCK = 0x20, /*!< Use the RF PLL2 unlock to trigger ramp down event - This enum is deprecated. Please use ADI_ADRV903X_RDT_RF1_PLL_UNLOCK instead */ + ADI_ADRV903X_RDT_RF0_PLL_UNLOCK = 0x10, /*!< Use the RF0 PLL unlock to trigger ramp down event */ + ADI_ADRV903X_RDT_RF1_PLL_UNLOCK = 0x20, /*!< Use the RF1 PLL unlock to trigger ramp down event */ + ADI_ADRV903X_RDT_SERDES_PLL_UNLOCK = 0x40, /*!< Use the SERDES PLL unlock to trigger ramp down event */ + ADI_ADRV903X_RDT_DFMR0_EVENT = 0x80, /*!< Use Deframer0 IRQ to trigger ramp down event - This enum is deprecated */ + ADI_ADRV903X_RDT_DFRM0_EVENT = 0x80, /*!< Use Deframer0 IRQ to trigger ramp down event */ + ADI_ADRV903X_RDT_DFRM1_EVENT = 0x100 /*!< Use Deframer1 IRQ to trigger ramp down event */ +} adi_adrv903x_RampDownTrigger_e; + +/** +* \brief Data structure to hold ADRV903X Tx Peak & Average Power Protection block configuration +*/ +typedef struct adi_adrv903x_PowerMonitorCfg +{ + adi_adrv903x_PaProtectionInputSel_e inputSel; /*!< This selects the source of input signal for power monitor block */ + uint16_t peakThreshold; /*!< Power monitor peak power threshold. Peak Threshold[dBFS] = 10 * Log10(peakThreshold/65535) */ + uint8_t measDuration; /*!< Power monitor peak and avg power measurement duration: Duration = 2^(measDuration + 7) number of cycles. Valid range [0-15] */ + uint8_t peakCount; /*!< Peak count causing peak power error. */ + uint8_t peakErrorClearRequired; /*!< Set this to make the peak power error sticky. When set, user needs to call adi_adrv903x_TxProtectionErrorClear to clear peak power error */ + uint8_t peakPowerEnable; /*!< This enables peak power measurement block. 1 = Peak power error is flagged when peak count is above peak count threshold, 0 = disabled */ + uint8_t peakPowerIrqEnable; /*!< 1 = enables peak power error interrupt, 0 = no IRQ */ + uint16_t avgThreshold; /*!< Power monitor average power threshold. Average Threshold[dBFS] = 10 * Log10(avgThreshold/65535) */ + uint8_t avgErrorClearRequired; /*!< Set this to make the average power error sticky. When set, user needs to call adi_adrv903x_TxProtectionErrorClear to clear average power error */ + uint8_t avgPowerEnable; /*!< This enables average power measurement block. 1 = PA error is flagged when average power measurement is above average power threshold, 0 = disabled */ + uint8_t avgPowerIrqEnable; /*!< 1 = enables average power error interrupt, 0 = no IRQ */ + uint8_t avgPeakRatioEnable; /*!< 1 = enables average to peak power ratio calculation block, both avgPower and peakPower calculations must be enabled before enabling ratio calculation, 0 = disabled */ +}adi_adrv903x_PowerMonitorCfg_t; + +/** + * \brief Data structure to hold ADRV903X Tx Peak & Average Power Protection block state + */ +typedef struct adi_adrv903x_PowerMonitorState +{ + uint16_t peakThreshold; /*!< Power monitor peak power threshold. Peak Threshold[dBFS] = 10 * Log10(peakThreshold/65535) */ + uint16_t avgThreshold; /*!< Power monitor average power threshold. Average Threshold[dBFS] = 10 * Log10(avgThreshold/65535) */ + uint8_t peakPowerEnable; /*!< This enables peak power measurement block. 1 = Peak power error is flagged when peak count is above peak count threshold, 0 = disabled */ + uint8_t avgPowerEnable; /*!< This enables average power measurement block. 1 = PA error is flagged when average power measurement is above average power threshold, 0 = disabled */ +}adi_adrv903x_PowerMonitorState_t; + +/** + * \brief Indicates the tx channels to which an instance of adi_adrv903x_PowerProtectionCfg_t applies + */ +typedef struct adi_adrv903x_PowerMonitorCfgRt +{ + uint32_t txChannelMask; /*!< The tx channels to which powerCfg applies. Suggested to use adi_adrv903x_TxChannels_e to build. */ + adi_adrv903x_PowerMonitorCfg_t txPowerMonitorCfg; /*!< PowerProtection configuration used for channels specified in txChannelMask */ +} adi_adrv903x_PowerMonitorCfgRt_t; + +/** + * \brief Holds the configuration for the PA protection ramp events + */ +typedef struct adi_adrv903x_ProtectionRampCfg +{ + uint32_t rampDownMask; /*!< Mask showing ramp down events. Bit descriptions can be found at adi_adrv903x_RampDownTrigger_e */ + uint8_t altEventClearReqd; /*!< 1 = user must manually clear pll_jesd_prot_clr after a PLL or JESD ramp down event, 0 = hardware clears */ +} adi_adrv903x_ProtectionRampCfg_t; + +/** + * \brief Indicates the tx channels to which an instance of adi_adrv903x_ProtectionRampCfg_t applies + */ +typedef struct adi_adrv903x_ProtectionRampCfgRt +{ + uint32_t txChannelMask; /*!< The tx channels to which protectionRampCfg applies. Suggested to use adi_adrv903x_TxChannels_e to build. */ + adi_adrv903x_ProtectionRampCfg_t protectionRampCfg; /*!< ProtectionRamp configuration used for channels specified in txChannelMask */ +} adi_adrv903x_ProtectionRampCfgRt_t; + +/** +* \brief Data structure to hold ADRV903X Tx Slew Rate Detector Configuration +*/ +typedef struct adi_adrv903x_SlewRateDetectorCfg +{ + adi_adrv903x_PaProtectionInputSel_e inputSel; /*!< This selects the source of input signal for SRD block */ + uint16_t srdOffset; /*!< These bits sets the offset (threshold) for the slew. Threshold[dBFS] = 10 * Log10(srdOffset/65535) */ + uint8_t srdEnable; /*!< 1:Enable // 0:Disable the slew rate detection block */ + uint8_t srdIrqEnable; /*!< 1:Enable // 0:Disable slew rate interrupt signal */ + uint8_t autoRecoveryWaitTime; /*!< HW will clear the SRD error after this wait time. Any new slew event during the countdown period reinitializes the timer. + This counter runs at the sample rate. Wait period in cycles = 2^(autoRecoveryWaitTime + 6). Valid Range[0-15] */ + uint8_t autoRecoveryEnable; /*!< 1:Enable 0:Disable auto-recovery. If enabled, HW will clear SRD error after autoRecoveryWaitTime. If disabled, + user needs to call adi_adrv903x_TxProtectionErrorClear to clear SRD error. */ + uint8_t autoRecoveryDisableTimerWhenTxOff; /*!< 1:Disable // 0:Enable timer when Tx off. If disabled, auto-recovery counter is disabled when TxOn is low and during txon_wait_period. */ + uint8_t srdStatisticsEnable; /*!< 1:Enable SRD statistics // 0:Disable SRD statistics. When enabled, user can read statistics through adi_adrv903x_TxSlewRateStatisticsRead */ + uint8_t srdStatisticsMode; /*!< 0:Record the maximum slew observed. 1:Record the number of samples which have slew above threshold. */ +} adi_adrv903x_SlewRateDetectorCfg_t; + +/** + * \brief Indicates the tx channels to which an instance of adi_adrv903x_SlewRateDetectorCfg_t applies + */ +typedef struct adi_adrv903x_SlewRateDetectorCfgRt +{ + uint32_t txChannelMask; /*!< The tx channels to which srlCfg applies. Suggested to use adi_adrv903x_TxChannels_e to build. */ + adi_adrv903x_SlewRateDetectorCfg_t srlCfg; /*!< SlewRateDetector configuration used for channels specified in txChannelMask */ +} adi_adrv903x_SlewRateDetectorCfgRt_t; + +/** +* \brief Data structure to hold ADRV903X Tx Power Monitor Status fields +*/ +typedef struct adi_adrv903x_TxPowerMonitorStatus_t +{ + uint16_t avgPower; /*!< Power monitor average power readback. */ + uint16_t peakPower; /*!< Power monitor peak power readback. */ + uint16_t avgErrorPower; /*!< Power monitor average power error. This shows the average + power when average power error flag is asserted. */ + uint16_t peakErrorPower; /*!< Power monitor peak power error. This shows the peak + power when peak power error flag is asserted. */ + uint16_t avgPeakRatio; /*!< Average to Peak power ratio readback. */ + +} adi_adrv903x_TxPowerMonitorStatus_t; + +/** +* \brief Data structure to hold a adrv903x device Tx attenuation calls +*/ +typedef struct adi_adrv903x_TxAtten +{ + uint32_t txChannelMask; /*!< Tx Channel mask selection */ + uint16_t txAttenuation_mdB; /*!< Tx Attenuation value in millidB */ +} adi_adrv903x_TxAtten_t; + +/** +* \brief Enum to set the Tx Attenuation step size +*/ +typedef enum adi_adrv903x_TxAttenStepSize +{ + ADI_ADRV903X_TXATTEN_0P05_DB = 0, /*!< S0, S1 registers programmed in units of 0.05dB */ + ADI_ADRV903X_TXATTEN_0P1_DB = 1, /*!< Not supported */ + ADI_ADRV903X_TXATTEN_0P2_DB = 2, /*!< Not supported */ + ADI_ADRV903X_TXATTEN_0P4_DB = 3, /*!< Not supported */ + ADI_ADRV903X_TXATTEN_INVALID = 4 +} adi_adrv903x_TxAttenStepSize_e; + +/** + * \brief Each Tx channel can have it's Tx attenuation updated from several sources. + */ +typedef enum adi_adrv903x_TxAttenUpdateSrc +{ + ADI_ADRV903X_TXATTEN_UPD_SRC_S0, /*!< The attenuation register S0 */ + ADI_ADRV903X_TXATTEN_UPD_SRC_S0_OR_S1 /*!< Either S0 or S1 depending on a GPIO input level */ +} adi_adrv903x_TxAttenUpdateSrc_e; + +/** + * \brief Tx attenuation update source plus any required extra configuration of source. + */ +typedef struct adi_adrv903x_TxAttenUpdateSrcCfg +{ + adi_adrv903x_TxAttenUpdateSrc_e updateSrc; /*!< The update source */ + + /** If updateSrc is S0_OR_S1 indicates which GPIO input selects between the two. If that GPIO input is + * high S1 is used otherwise S0 used. */ + adi_adrv903x_GpioPinSel_e s0OrS1Gpio; /*!< GPIO selection */ +}adi_adrv903x_TxAttenUpdateSrcCfg_t; + +/** + * \brief Each Tx channel has it's Tx attenuation updated on the occurrence of one of several triggers. + */ +typedef enum adi_adrv903x_TxAttenUpdateTrg_e +{ + ADI_ADRV903X_TXATTEN_UPD_TRG_NONE, + ADI_ADRV903X_TXATTEN_UPD_TRG_SPI, + ADI_ADRV903X_TXATTEN_UPD_TRG_GPIO +} adi_adrv903x_TxAttenUpdateTrg_e; + +/** + * \brief Tx Atten update trigger plus any configuration of that trigger. + */ +typedef struct adi_adrv903x_TxAttenUpdateTrgCfg_t +{ + adi_adrv903x_TxAttenUpdateTrg_e updateTrg; /*!< Update trigger selection */ + adi_adrv903x_GpioPinSel_e triggerGpio; /*!< If updateTrg is GPIO indicate which GPIO rising-edge triggers the update. */ +} adi_adrv903x_TxAttenUpdateTrgCfg_t; + +/** + * \brief Complete configuration for the Tx attenuation update trigger and source for a single channel. + */ +typedef struct adi_adrv903x_TxAttenUpdateCfg +{ + adi_adrv903x_TxAttenUpdateSrcCfg_t srcCfg; /*!< Tx attenuation update source config */ + adi_adrv903x_TxAttenUpdateTrgCfg_t trgCfg; /*!< Tx attenuation update trigger config */ +} adi_adrv903x_TxAttenUpdateCfg_t; + +/** + * \brief Configuration structure for Tx power control + */ +typedef struct adi_adrv903x_TxAttenCfg +{ + adi_adrv903x_TxAttenUpdateCfg_t updateCfg; /*!< Tx atten update configuration */ + adi_adrv903x_TxAttenStepSize_e txAttenStepSize; /*!< The units in which the S0 and S1 registers are programmed */ +} adi_adrv903x_TxAttenCfg_t; + + +/** +* \brief Data structure for Tx decimated power block configuration +*/ +typedef struct adi_adrv903x_TxDecimatedPowerCfg +{ + uint32_t txChannelMask; /*!< Tx channel selection */ + uint8_t measurementEnable; /*!< 0:Disable , 1:Enable power measurements */ + uint8_t powerInputSelect; /*!< Use output of Tx for power measurement. 0: Band DUC output, 1: DPD output 2: QEC output, 3:PFIR output. Valid Range from 0 to 3*/ + uint8_t powerMeasurementDuration; /*!< Average power measurement duration = 8*2^powerMeasurementDuration. Valid range from 0 to 31 */ + uint8_t peakToPowerMode; /*!< 0:Disable , 1:Enable peak-to-power mode. */ +}adi_adrv903x_TxDecimatedPowerCfg_t; + + +/** +* \brief Enum to set the Discontinuous Transmit (DTX) Mode +* This 2 bit bitfield is used to select the mode of operation of the DTx mode control block. +* 00 - DTx mode control disabled +* 01 - Automatic mode. Triggers the power down stream on observing a specified number of zero samples (dtx_zero_counter) on Tx input data. Power up stream is triggered as soon as a non zero sample is seen. +* 10 - SPI controlled mode - In this mode, power down is triggered on setting the dtx_force bitfield. Clearing that bit triggers the power up stream. +* 11 - Pin controlled mode - In this mode, a GPIO pin specified by the dtx_force_gpio_select controls Power up/down. Rising edge on the pin triggers the power down stream and a falling edge triggers a power up stream +*/ +typedef enum adi_adrv903x_DtxMode +{ + ADI_ADRV903X_DTXMODE_DISABLE = 0, /*!< DTX is in Disable Mode */ + ADI_ADRV903X_DTXMODE_AUTO = 1, /*!< DTX is in Automatic Mode */ + ADI_ADRV903X_DTXMODE_SPI = 2, /*!< DTX is in SPI Control Mode */ + ADI_ADRV903X_DTXMODE_PIN = 3 /*!< DTX is in PIN Control Mode */ +} adi_adrv903x_DtxMode_e; + +/** + * \brief Data structure to hold Discontinuous Transmit (DTX) configuration. + */ +typedef struct adi_adrv903x_DtxCfg +{ + uint32_t txChannelMask; /*!< Tx Channels for which the Dtx to be updated. Bits 0-7 correspond to Tx0-Tx7 */ + adi_adrv903x_DtxMode_e dtxMode; /*!< Select the Mode configuration for DTX */ + uint16_t dtxZeroCounter; /*!< DTX Zero Counter for DTX Auto Mode. When dtx_mode_enable=2'b01 (Auto mode), this bitfield specifies the number of continues zeros to trigger DTX power down */ +} adi_adrv903x_DtxCfg_t; + +/** +* \brief Data structure to hold Discontinuous Transmit (DTX) GPIO configuration. +*/ +typedef struct adi_adrv903x_DtxGpioCfg +{ + adi_adrv903x_GpioPinSel_e dtxGpioTxSel[ADI_ADRV903X_MAX_TXCHANNELS]; /*!< GPIO selection for each Tx channel. User can select ADI_ADRV903X_GPIO_INVALID if they don't need to route DTX signal to a GPIO. */ +} adi_adrv903x_DtxGpioCfg_t; + + +/** + * \brief PFIR coefficientsplayback data. It contains 1023 samples maximum + */ +typedef struct adi_adrv903x_TxPfirCoeff +{ + int16_t pfirCoefI[ADI_ADRV903X_NUM_PFIR_COEF]; /*!< An array of PFIR i coefficients - 16bit */ + int16_t pfirCoefQ[ADI_ADRV903X_NUM_PFIR_COEF]; /*!< An array of PFIR q coefficients - 16bit */ +}adi_adrv903x_TxPfirCoeff_t; + + +#endif /* _ADI_ADRV903X_TX_TYPES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_types.h new file mode 100644 index 0000000000000..4802df3bf759a --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_types.h @@ -0,0 +1,559 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/*! +* \file adi_adrv903x_types.h +* \brief Contains ADRV903X API configuration and run-time type definitions +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef _ADI_ADRV903X_TYPES_H_ +#define _ADI_ADRV903X_TYPES_H_ + +#include "adi_common.h" +#include "adi_adrv903x_user.h" +#include "adi_adrv903x_cpu_types.h" +#include "adi_adrv903x_radioctrl_types.h" +#include "adi_adrv903x_tx_types.h" +#include "adi_adrv903x_rx_types.h" +#include "adi_adrv903x_gpio_types.h" +#include "adi_adrv903x_datainterface_types.h" + +#define ADI_ADRV903X_TX_PROFILE_VALID 0x01 +#define ADI_ADRV903X_RX_PROFILE_VALID 0x02 +#define ADI_ADRV903X_ORX_PROFILE_VALID 0x04 +#define ADI_ADRV903X_NUM_SHARED_RESOURCES 40U + +#define ADRV903X_ADDR_SPI_INTERFACE_CONFIG_A 0x0000 +#define ADRV903X_CONFIG_A_SPI_LSB_FIRST 0x42 +#define ADRV903X_CONFIG_A_SPI_ADDR_ASCENSION 0x24 +#define ADRV903X_CONFIG_A_SPI_SDO_ACTIVE 0x18 +#define ADRV903X_ADDR_DIGITAL_IO_CONTROL 0x0010 +#define ADRV903X_IO_CONTROL_SPI2_OUTS_DRV_SEL 0x02 +#define ADRV903X_IO_CONTROL_SPI_OUTS_DRV_SEL 0x01 +#define ADRV903X_BF_CORE_ADDR 0U + +#define ADRV903X_ADDR_SPI_INTERFACE_CONFIG_B 0x0001 +#define ADRV903X_CONFIG_B_SINGLE_INSTRUCTION 0x80 + +#define ADI_ADRV903X_MAX_UART 4U + +#define ADI_ADRV903X_MAX_RXCHANNELS 10U +#define ADI_ADRV903X_MAX_RX_ONLY 8U +#define ADI_ADRV903X_MAX_ORX 2U + +#define ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET 12 + +#define ADI_ADRV903X_MAX_SERDES_LANES 8U /* Number of lanes in serializer and deserializer */ + +#define ADI_ADRV903X_MAX_CHANNELS 8 + +#define ADI_ADRV903X_MAX_FEATUREMASK 16 + +/** + * \brief Enum of possible channel enables + */ +typedef enum adi_adrv903x_Channels +{ + ADI_ADRV903X_CHOFF = 0x00, /*!< No channels are enabled */ + ADI_ADRV903X_CH0 = 0x01, /*!< Channel 0 enabled */ + ADI_ADRV903X_CH1 = 0x02, /*!< Channel 1 enabled */ + ADI_ADRV903X_CH2 = 0x04, /*!< Channel 2 enabled */ + ADI_ADRV903X_CH3 = 0x08, /*!< Channel 3 enabled */ + ADI_ADRV903X_CH4 = 0x10, /*!< Channel 4 enabled */ + ADI_ADRV903X_CH5 = 0x20, /*!< Channel 5 enabled */ + ADI_ADRV903X_CH6 = 0x40, /*!< Channel 6 enabled */ + ADI_ADRV903X_CH7 = 0x80 /*!< Channel 7 enabled */ +} adi_adrv903x_Channels_e; + +/** + * \brief Data structure to hold ADRV903X API State + */ +typedef enum adi_adrv903x_ApiStates +{ + ADI_ADRV903X_STATE_POWERONRESET = 0x001U, /*!< POR Complete */ + ADI_ADRV903X_STATE_INITIALIZED = 0x002U, /*!< Initialized */ + ADI_ADRV903X_STATE_STREAMLOADED = 0x004U, /*!< Stream Processor Loaded */ + ADI_ADRV903X_STATE_CPUDEBUGLOADED = 0x008U, /*!< CPU Debug SW Loaded */ + ADI_ADRV903X_STATE_CPU0LOADED = 0x010U, /*!< CPU 0 Loaded */ + ADI_ADRV903X_STATE_CPU1LOADED = 0x020U, /*!< CPU 1 Loaded */ + ADI_ADRV903X_STATE_ALLCPUSLOADED = 0x040U, /*!< All CPU's Loaded */ + ADI_ADRV903X_STATE_INITCALS_RUN = 0x080U, /*!< Init Cals Running */ + ADI_ADRV903X_STATE_RADIOON = 0x100U, /*!< Device Running */ + ADI_ADRV903X_STATE_STANDBY = 0x800U, /*!< Part is Powered down in Standby mode */ + ADI_ADRV903X_STATE_JRXREPAIRED = 0x1000U, /*!< Jrx repair has been applied */ + ADI_ADRV903X_STATE_MCSCARRIERRECONFIG = 0x2000U, /*!< Mcs carrier reconfig has been applied */ +} adi_adrv903x_ApiStates_e; + +/** + * \brief Enumerated list of CMOS pads drive strength options for SPI_DO signal. + * + * Note: These are the values used in the device's SpiCfgSettings, resource files and as arguments to + * SpiDoutPadDriveStrengthSet, and are chosen to maintain binary compatability with API versions before + * _STRENGTH_1 and _2 were added. The corresponding bitfield values written to the device differ. + */ +typedef enum adi_adrv903x_CmosPadDrvStr +{ + ADI_ADRV903X_CMOSPAD_DRV_WEAK = 0U, /*!< Minimum pad drive strength */ + ADI_ADRV903X_CMOSPAD_DRV_STRENGTH_1 = 2U, /*!< Is stronger than WEAK */ + ADI_ADRV903X_CMOSPAD_DRV_STRENGTH_2 = 3U, /*!< Is stronger than STRENGTH_1 */ + ADI_ADRV903X_CMOSPAD_DRV_STRONG = 1U, /*!< Maximum pad drive strength */ +} adi_adrv903x_CmosPadDrvStr_e; + +/** +* \brief Enumerated list of options to use to set the LO source for the Rx/Tx and ORx mixers. +*/ +typedef enum adi_adrv903x_LoSel +{ + ADI_ADRV903X_LOSEL_LO0 = 0, /*!< LO0 selection */ + ADI_ADRV903X_LOSEL_LO1 = 1, /*!< LO1 selection */ + } adi_adrv903x_LoSel_e; + +/** +* \brief Enum of possible Capability Feature enables +*/ +typedef enum adi_adrv903x_Feature +{ + ADI_ADRV903X_FEATUREOFF = 0x0000, /*!< No Capability Feature enabled */ + ADI_ADRV903X_FEATURE_RESERVED1 = 0x0001, /*!< Reserve1 feature enabled */ + ADI_ADRV903X_FEATURE_SPI2 = 0x0002, /*!< SPI2 feature enabled */ + ADI_ADRV903X_FEATURE_TXSRD = 0x0004, /*!< Tx Slew Rate Detector feature enabled */ + ADI_ADRV903X_FEATURE_RESERVED2 = 0x0008 /*!< Reserve2 feature enabled jesd compression */ +} adi_adrv903x_Feature_e; + +/** + * \brief Enum of Device Capability Features case index + */ +typedef enum adi_adrv903x_FeatureCaseIndex +{ + ADI_ADRV903X_FEATURE_SERIALIZER = 0x00, /*!< serializer feature case */ + ADI_ADRV903X_FEATURE_DESERIALIZER = 0x01, /*!< deserializer feature case */ + ADI_ADRV903X_FEATURE_TX = 0x02, /*!< txchannel feature case */ + ADI_ADRV903X_FEATURE_RX = 0x03, /*!< rxchannel feature case */ + ADI_ADRV903X_FEATURE_ORX_LOMASK = 0x04 /*!< orxchannel and lomask features case */ +} adi_adrv903x_FeatureCaseIndex_e; + +/** + * \brief MCS Sync Mode + */ +typedef enum adi_adrv903x_McsSyncMode +{ + ADI_ADRV903X_MCS_OFF = 0U, /*!< Notification that MCS is off */ + ADI_ADRV903X_MCS_START = 1U << 0, /*!< Notification that MCS is started */ +} adi_adrv903x_McsSyncMode_e; + +/** + * \brief Data structure to hold Tx data path settings + */ +typedef struct adi_adrv903x_TxChannelCfg +{ + adi_adrv903x_TxAttenCfg_t txAttenCfg; /*!< Tx attenuation config */ + uint16_t txAttenInit_mdB; /*!< Tx attenuation init time value */ + adi_adrv903x_PowerMonitorCfg_t txpowerMonitorCfg; /*!< Tx power monitor configuration */ + adi_adrv903x_SlewRateDetectorCfg_t srlCfg; /*!< Slew rate detector config */ + adi_adrv903x_ProtectionRampCfg_t protectionRampCfg; /*!< Tx Pa protection ramp config */ +} adi_adrv903x_TxChannelCfg_t; + +/** + * \brief Data structure to hold ADRV903X Tx Channel configuration settings + */ +typedef struct adi_adrv903x_TxSettings +{ + adi_adrv903x_TxChannelCfg_t txChannelCfg[ADI_ADRV903X_MAX_TXCHANNELS]; /*!< Tx settings per Tx channel */ +} adi_adrv903x_TxSettings_t; + + +/** + * \brief Data structure to hold Tx data path settings + */ +typedef struct adi_adrv903x_RxChannelCfg +{ + adi_adrv903x_RxDataFormat_t rxDataFormat; /*!< Rx Data Format settings structure */ + uint8_t rxGainIndexInit; /*!< Init Gain Index value for the channels selected */ +} adi_adrv903x_RxChannelCfg_t; + +/** + * \brief Data structure to hold ADRV903X Rx Channel configuration settings + */ +typedef struct adi_adrv903x_RxSettings +{ + adi_adrv903x_RxChannelCfg_t rxChannelCfg[ADI_ADRV903X_MAX_RXCHANNELS]; /*!< Rx settings per Rx channel */ +} adi_adrv903x_RxSettings_t; + +/* +* \brief Data structure to hold ADRV903X device capability settings +*/ +typedef struct adi_adrv903x_CapabilityModel +{ + uint8_t productId; /*!< device Product Id */ + uint8_t siRevision; /*!< device silicon version */ + uint8_t txNumber; /*!< device number of Tx */ + uint8_t rxNumber; /*!< device number of Rx */ + uint8_t orxNumber; /*!< device number of Orx */ + uint32_t txChannelMask; /*!< device ChannelMask of Tx */ + uint32_t rxChannelMask; /*!< device ChannelMask of Rx */ + uint32_t orxChannelMask; /*!< device ChannelMask of Orx */ + uint32_t featureMask; /*!< device featureMask*/ + uint32_t txMaxBw_kHz; /*!< device max BW for Tx */ + uint32_t rxMaxBw_kHz; /*!< device max BW for Rx */ + uint32_t orxMaxBw_kHz; /*!< device max BW for Orx */ + uint32_t rfFreqRangeMin_kHz; /*!< device RF Freq Range Min */ + uint32_t rfFreqRangeMax_kHz; /*!< device RF Freq Range Max */ + uint32_t loMask; /*!< Mask of Hardware Enabled LOs and the bit0 to bit2 correspond to LO1, LO2 and ext LO*/ + uint32_t rfMaxIbw_Mhz; /*!< device Instantaneous Bandwidth Max */ + uint32_t serializerLaneEnableMask; /*!< Mask of Hardware Enabled Serializer Lanes */ + uint32_t deserializerLaneEnableMask; /*!< Mask of Hardware Enabled Deserializer Lanes */ +} adi_adrv903x_CapabilityModel_t; + + +#ifndef CLIENT_IGNORE + +/** +* \brief Data Structure to hold ADRV903X device Rx Max and Min gain indices +*/ +typedef struct adi_adrv903x_GainIndex +{ + uint8_t rx0MinGainIndex; /*!< Current device minimum Rx0 gain index */ + uint8_t rx0MaxGainIndex; /*!< Current device maximum Rx0 gain index */ + uint8_t rx1MinGainIndex; /*!< Current device minimum Rx1 gain index */ + uint8_t rx1MaxGainIndex; /*!< Current device maximum Rx1 gain index */ + uint8_t rx2MinGainIndex; /*!< Current device minimum Rx2 gain index */ + uint8_t rx2MaxGainIndex; /*!< Current device maximum Rx2 gain index */ + uint8_t rx3MinGainIndex; /*!< Current device minimum Rx3 gain index */ + uint8_t rx3MaxGainIndex; /*!< Current device maximum Rx3 gain index */ + uint8_t rx4MinGainIndex; /*!< Current device minimum Rx4 gain index */ + uint8_t rx4MaxGainIndex; /*!< Current device maximum Rx4 gain index */ + uint8_t rx5MinGainIndex; /*!< Current device minimum Rx5 gain index */ + uint8_t rx5MaxGainIndex; /*!< Current device maximum Rx5 gain index */ + uint8_t rx6MinGainIndex; /*!< Current device minimum Rx6 gain index */ + uint8_t rx6MaxGainIndex; /*!< Current device maximum Rx6 gain index */ + uint8_t rx7MinGainIndex; /*!< Current device minimum Rx7 gain index */ + uint8_t rx7MaxGainIndex; /*!< Current device maximum Rx7 gain index */ +} adi_adrv903x_GainIndex_t; + +#endif // !CLIENT_IGNORE + +/** + * \brief Struct for ADRV903X SPI Configuration Settings + */ +typedef struct adi_adrv903x_SpiConfigSettings +{ + uint8_t msbFirst; /*!< 1 = MSB First, 0 = LSB First Bit order for SPI transaction */ + uint8_t fourWireMode; /*!< 1: Use 4-wire SPI, 0: 3-wire SPI (SDIO pin is bidirectional). NOTE: ADI's FPGA platform always uses 4-wire mode */ + adi_adrv903x_CmosPadDrvStr_e cmosPadDrvStrength; /*!< Drive strength of CMOS pads when used as outputs (SDIO, SDO, GP_INTERRUPT, GPIO 1, GPIO 0) */ +} adi_adrv903x_SpiConfigSettings_t; + +/** + * \brief Struct for ADRV903X Aux SPI Interface Configuration. + */ +typedef struct adi_adrv903x_AuxSpiConfig +{ + uint8_t enable; /*!< 1 = ENABLE, 0 = DISABLE */ + adi_adrv903x_GpioPinSel_e gpioCsb; /*!< GPIO[3] or GPIO[16] */ + adi_adrv903x_GpioPinSel_e gpioClk; /*!< GPIO[2] or GPIO[15] */ + adi_adrv903x_GpioPinSel_e gpioSdio; /*!< GPIO[0] or GPIO[13] */ + adi_adrv903x_GpioPinSel_e gpioSdo; /*!< GPIO[1] or GPIO[14] or INVALID */ +} adi_adrv903x_AuxSpiConfig_t; + +/** + * \brief Struct for ADRV903X SPI Configuration Settings + */ +typedef struct adi_adrv903x_SpiOptions +{ + uint8_t allowSpiStreaming; /*!< 0 = SPI Streaming not allowed. 1 = Allowed */ + uint8_t allowAhbAutoIncrement; /*!< 0 = AHB Auto Incr not allowed. 1 = Allowed */ + uint8_t allowAhbSpiFifoMode; /*!< 0 = AHB SPI FIFO use not allowed. 1 = Allowed + Note: AHB SPI FIFO value ignored unless SPI Streaming = 1 + and AHB Auto Incr */ +} adi_adrv903x_SpiOptions_t; + +/** + * \brief Data structure to hold uart settings + */ +typedef struct adi_adrv903x_UartSettings +{ + uint8_t enable; /*!< Enable(1)/Disable(0) Uart GPIO */ + adi_adrv903x_GpioPinSel_e pinSelect; /*!< Holds Uart Gpio Pin Sel. Valid Range (ADI_ADRV903X_GPIO_09|10|11|12) */ +} adi_adrv903x_UartSettings_t; + +/** +* \brief Memdump enum to represent record type +*/ +typedef enum adi_adrv903x_MemdumpRecordType +{ + ADI_ADRV903X_MEMDUMP_FIRMWARE_VER_RECORD = 1U, /* Firmware Version Record */ + ADI_ADRV903X_MEMDUMP_TELEM_RECORD = 2U, /* Relemetry Record */ + ADI_ADRV903X_MEMDUMP_ETM_TRACE_RECORD = 3U, /* ETM/Trace Record */ + ADI_ADRV903X_MEMDUMP_DEV_DRVR_STATE_RECORD = 4U, /* Device Driver State Record */ + ADI_ADRV903X_MEMDUMP_CPU_RAM_RECORD = 5U, /* CPU RAM Record */ + ADI_ADRV903X_MEMDUMP_REG_RECORD = 6U, /* Register Record */ +} adi_adrv903x_MemdumpRecordType_e; + +/** +* \brief Memdump enum to represent CPU Type +*/ +typedef enum adi_adrv903x_MemdumpCpuType +{ + ADI_ADRV903X_MEMDUMP_STREAM_CPU = 0x1U, /* Custom CPU RAM */ + + /* All arm CPU's added below */ + ADI_ADRV903X_MEMDUMP_ARM_V7 = 0x2U, /* 32 bit arm v7 */ + ADI_ADRV903X_MEMDUMP_ARM_V8 = 0x3U, /* aarch64, arm v8 */ + + /* All risc-v CPU's added below */ + ADI_ADRV903X_MEMDUMP_RISC_V_1 = 0x8000U, /* risc-v */ +} adi_adrv903x_MemdumpCpuType_e; + +/** +* \brief Memdump enum to represent FW Type +*/ +typedef enum adi_adrv903x_MemdumpFirmwareType +{ + ADI_ADRV903X_MEMDUMP_STREAM_FW = 0x1U, /* Stream FW */ + ADI_ADRV903X_MEMDUMP_RADIO_FW = 0x2U, /* Radio FW */ +} adi_adrv903x_MemdumpFirmwareType_e; + +/** + * \brief Data structure to hold digital clock settings + */ +typedef struct adi_adrv903x_ClockSettings +{ + uint8_t DevClkOnChipTermResEn; /*!< Enables the 100ohm on chip termination resistor 0: Disabled, 1: Enable */ +} adi_adrv903x_ClockSettings_t; + +/** + * \brief Data structure to hold ADRV903X device instance initialization settings + */ +typedef struct adi_adrv903x_Init +{ + adi_adrv903x_SpiOptions_t spiOptionsInit; /*!< Holds the initial SPI runtime settings */ + adi_adrv903x_ClockSettings_t clocks; /*!< Holds settings for CLKPLL and reference clock */ + adi_adrv903x_CpuMemDumpBinaryInfo_t cpuMemDump; /*!< CPU Memory Dump File Settings */ + adi_adrv903x_RxSettings_t rx; /*!< Rx settings data structure */ + adi_adrv903x_TxSettings_t tx; /*!< Tx settings data structure */ + adi_adrv903x_UartSettings_t uart[ADI_ADRV903X_MAX_UART]; /*!< Uart settings data structure */ + adi_adrv903x_GpIntPinMaskCfg_t gpIntPreInit; /*!< GP Interrupt Pin Mask Config data structure to be applied before Device Initialization */ +} adi_adrv903x_Init_t; + + +#ifndef CLIENT_IGNORE +/** +* \brief Data structure to hold clock divide ratios +*/ +typedef struct adi_adrv903x_ClkDivideRatios +{ + uint8_t armClkDivideRatio; /*!< ARM clock divide ratio w.r.t hsDigClk */ + uint8_t agcClkDivideRatio; /*!< AGC module clock divide ratio w.r.t hsDigClk */ + uint8_t regClkDivideRatio; /*!< Register bus clock divide ratio w.r.t hsDigClk */ + uint8_t txAttenDeviceClockDivideRatio; /*!< Tx Atten module clock divide ratio w.r.t hsDigClk */ +} adi_adrv903x_ClkDivideRatios_t; + +typedef struct adi_adrv903x_SharedResourcePool +{ + uint32_t featureID; /*!< Holds the feature ID of a shared resource pool member */ + uint8_t semaphoreCount; /*!< Holds the semaphore count of a shared resource pool member */ + uint32_t channelMask; /*!< Holds the channel Mask of a shared resource pool member */ +} adi_adrv903x_SharedResourcePool_t; + +/** + * \brief Data structure to hold a ADRV903X device instance status information + * + * Application layer allocates this memory, but only API writes to it to keep up with the API run time state. + */ +typedef struct adi_adrv903x_Info +{ + uint8_t deviceSiRev; /*!< ADRV903X silicon rev read during HWOpen */ + uint8_t deviceProductId; /*!< ADRV903X Product ID read during HWOpen */ + adi_adrv903x_ApiStates_e devState; /*!< Current device state of the part, i.e., radio on, radio off, arm loaded, etc., defined by deviceState enum */ + uint32_t initializedChannels; /*!< Indicates initialized & calibrated Rx/ORx/Tx chans. RxN is at bit N. TxN is at bit N + ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET */ + uint32_t profilesValid; /*!< Current device profilesValid bit field for use notification, i.e., Tx = 0x01, Rx = 0x02, Orx = 0x04 */ + adi_adrv903x_TxAttenStepSize_e txAttenStepSize[ADI_ADRV903X_MAX_TXCHANNELS]; /*!< Current tx Atten step size for each Tx channel */ + uint64_t swTest; /*!< Software Test Signal */ + uint32_t hsDigClk_kHz; /*!< Calculated in initialize() digital clock used throughout API functions */ + adi_adrv903x_ClkDivideRatios_t clkDivideRatios; /*!< Clock divide ratios w.r.t hsDigClk for various modules in the device */ + uint32_t profileAddr; /*!< Address to load Profile */ + uint32_t adcProfileAddr; /*!< Address to load ADC Profile */ + + adi_adrv903x_GainIndex_t gainIndexes; /*!< Current device Rx min max gain index values */ + uint32_t chunkStreamImageSize[ADI_ADRV903X_STREAM_MAX]; /*!< Stream Image Size */ + uint32_t chunkStreamImageOffset[ADI_ADRV903X_STREAM_MAX];/*!< Stream Image Offset */ + uint32_t currentStreamBinBaseAddr; /*!< Address to load current stream */ + uint32_t currentStreamBaseAddr; /*!< Address to load current stream base */ + uint8_t currentStreamNumberStreams; /*!< Number of Streams for current stream */ + uint8_t currentStreamImageIndex; /*!< Index of current stream */ + uint32_t currentStreamImageSize; /*!< Image size of current stream */ + uint8_t rxFramerNp; /*!< Rx Framer Np - converter sample resolution (12, 16, 24) */ + uint8_t rxChannel3bitSlicerMode; /*!< If a bit is set - corresponding Rx Channel Data format slicer ctrl is 3 bits */ + adi_adrv903x_SharedResourcePool_t sharedResourcePool[ADI_ADRV903X_NUM_SHARED_RESOURCES]; /*!< Shared resource pool for the given device instance*/ + uint8_t linkSharingEnabled; /*!< Link sharing enabled if 1, disabled otherwise */ + adi_adrv903x_Cpu_t cpu; /*!< Processor related info */ + adi_adrv903x_SpiOptions_t spiOptions; /*!< Holds the SPI runtime options used during API function calls */ + uint8_t spiFifoModeOn; /*!< Internal use only: Keeps track of current SPI FIFO mode status. */ + uint8_t autoIncrModeOn; /*!< Internal use only: Keeps track of current auto-increment mode status. */ + uint8_t spiStreamingOn; /*!< Internal use only: Keeps track of current SPI Streaming status. */ + uint32_t currentPageStartingAddress; /*!< Internal use only: Starting address of the current 4K page */ + uint32_t previousSpiStreamingAddress; /*!< Internal use only: Only valid when spiStreamingOn is asserted. Stores the previous address written to determine if a CS toggle is required */ + adi_adrv903x_TxToOrxMappingConfig_t txToOrxMappingConfig; /*!< Internal use only: Tx to Orx Mapping Configuration */ + adi_adrv903x_StreamGpioPinCfg_t streamGpioMapping; /*!< Internal use only: Stream GPIO mapping */ + +} adi_adrv903x_Info_t; + +/** + * \brief Data structure to hold band data + */ +typedef struct adi_adrv903x_BandCfgExtract +{ + uint8_t enabled; /*!< Band enabled flag */ + uint32_t rfCenterFreq_kHz; /*!< RF center frequency */ + uint32_t instBw_kHz; /*!< Instantaneous signal bandwidth */ + uint32_t sampleRate_kHz; /*!< Band sample rate */ + uint32_t bandOffset_kHz; /*!< LO and NCO offset */ +} adi_adrv903x_BandCfgExtract_t; + +/** + * \brief Data structure to hold Tx data path settings + */ +typedef struct adi_adrv903x_TxChannelCfgExtract +{ + uint32_t rfBandwidth_kHz; /*!< Tx RF passband bandwidth for the profile */ + uint32_t totalDecimation; /*!< Total DDC decimation */ + uint32_t digChanMask; /*!< Tx digital channel mask indicates which DUCs to initialize */ + uint32_t txLbAdcSampleRate_kHz; /*!< TX LB ADC Sample rate */ + uint32_t txLbAdcClkDiv; /*!< The logical (not bitfield) value of the LB ClkGen's interface divider. i.e. 5 => Div5 etc. */ + adi_adrv903x_BandCfgExtract_t bandSettings[ADI_ADRV903X_DUC_NUM_BAND]; /*!< Tx DUC settings */ + uint32_t pfirRate_kHz; /*!< Tx PFIR rate */ +} adi_adrv903x_TxChannelCfgExtract_t; + +/** + * \brief Data structure to hold ADRV903X Tx Channel configuration settings + */ +typedef struct adi_adrv903x_TxSettingsExtract +{ + uint32_t txInitChannelMask; /*!< Tx channel mask of which channels to initialize */ + adi_adrv903x_TxChannelCfgExtract_t txChannelCfg[ADI_ADRV903X_MAX_TXCHANNELS]; /*!< Tx settings per Tx channel */ +} adi_adrv903x_TxSettingsExtract_t; + +/** + * \brief Data structure to hold Rx data path settings + */ +typedef struct adi_adrv903x_RxChannelCfgExtract +{ + uint32_t rfBandwidth_kHz; /*!< Rx RF passband bandwidth for the profile */ + uint32_t rxDdc0OutputRate_kHz; /*!< Rx output sample rate per Rx channel Band 0 */ + uint32_t rxDdc1OutputRate_kHz; /*!< Rx output sample rate per Rx channel Band 1 */ + uint32_t digChanMask; /*!< Rx digital channel mask indicates which DDCs to initialize */ + uint32_t rxAdcSampleRate_kHz; /*!< Rx ADC sample rate */ + adi_adrv903x_BandCfgExtract_t bandSettings[ADI_ADRV903X_DDC_NUM_BAND]; /*!< Rx DDC settings for this channel's profile */ +} adi_adrv903x_RxChannelCfgExtract_t; + +/** + * \brief Data structure to hold ORx data path settings + */ +typedef struct adi_adrv903x_OrxChannelCfgExtract +{ + uint32_t rfBandwidth_kHz; /*!< Rx RF passband bandwidth for the profile */ + uint32_t orxOutputRate_kHz; /*!< ORx output sample rate per ORx channel */ + uint32_t orxAdcSampleRate_kHz; /*!< ORx ADC sample rate*/ +} adi_adrv903x_OrxChannelCfgExtract_t; + +/** + * \brief Data structure to hold ADRV903X Rx Channel configuration settings + */ +typedef struct adi_adrv903x_RxSettingsExtract +{ + uint32_t rxInitChannelMask; /*!< Rx channel mask of which channels to initialize */ + adi_adrv903x_RxChannelCfgExtract_t rxChannelCfg[ADI_ADRV903X_MAX_RX_ONLY]; /*!< Rx settings per Rx channel */ +} adi_adrv903x_RxSettingsExtract_t; + +/** + * \brief Data structure to hold digital clock settings + */ +typedef struct adi_adrv903x_ClockSettingsExtract +{ + uint32_t deviceClockScaled_kHz; /*!< Scaled device clock frequency in kHz */ + uint8_t padDivideRatio; /*!< Pad divider ratio calculated by configurator tool */ + uint8_t armClkDivideRatio; /*!< FW Clock Divide ratio calculated by Configurator tool */ + uint8_t armClkDevClkDivRatio; /*!< FW Clock Divide ratio calculated by Configurator tool */ + uint32_t hsDigClk_kHz; /*!< Digital clock */ +} adi_adrv903x_ClockSettingsExtract_t; + +/** + * \brief Data structure to hold Jesd Framer settings + */ +typedef struct adi_adrv903x_FramerSettingsExtract +{ + uint8_t jesdM; /*!< M value */ + uint8_t jesdNp; /*!< Np value */ + uint8_t serialLaneEnabled; /*!< lane enabled*/ + uint32_t iqRate_kHz; /*!< Framer I/Q rate */ + uint32_t laneRate_kHz; /*!< Framer Lane rate */ + uint8_t linkLsSampleXBar [ADI_ADRV903X_NUM_LKSH_SAMPLE_XBAR]; +} adi_adrv903x_FramerSettingsExtract_t; + +/** + * \brief Data structure to hold Jesd Framer settings + */ +typedef struct adi_adrv903x_DeframerSettingsExtract +{ + uint8_t jesdM; /*!< M value */ + uint8_t jesdNp; /*!< Np value */ + uint8_t deserialLaneEnabled; /*!< lane enabled */ + uint32_t iqRate_kHz; /*!< Framer I/Q rate */ + uint32_t laneRate_kHz; /*!< Framer Lane rate */ + uint32_t interleavingEnabled; /*!< Interleaver enabled */ +} adi_adrv903x_DeframerSettingsExtract_t; + +/** + * \brief Data structure to hold Jesd Framer and Deframer settings + */ +typedef struct adi_adrv903x_JesdSettingsExtract +{ + adi_adrv903x_FramerSettingsExtract_t framerSetting[ADI_ADRV903X_MAX_FRAMERS]; /*!< Framer settings */ + adi_adrv903x_DeframerSettingsExtract_t deframerSetting[ADI_ADRV903X_MAX_DEFRAMERS]; /*!< Deframer setting */ + adi_adrv903x_FramerSettingsExtract_t framerLsSetting[ADI_ADRV903X_MAX_FRAMERS_LS]; /*!< Framer Link Sharing settings */ + uint8_t rxdesQhfrate; /*!< SERDES Rate mode */ +} adi_adrv903x_JesdSettingsExtract_t; + +/* + * \brief Data structure to hold ORx channel configuration settings + */ +typedef struct adi_adrv903x_OrxSettingsExtract +{ + adi_adrv903x_OrxChannelCfgExtract_t orxChannelCfg[ADI_ADRV903X_MAX_ORX]; /*!< Orx output sample rate */ +} adi_adrv903x_OrxSettingsExtract_t; + +/** + * \brief Data structure to hold ADRV903X device instance initialization settings + */ +typedef struct adi_adrv903x_InitExtract +{ + + adi_adrv903x_ClockSettingsExtract_t clocks; /*!< Holds settings for CLKPLL and reference clock */ + adi_adrv903x_RxSettingsExtract_t rx; /*!< Rx settings data structure */ + adi_adrv903x_TxSettingsExtract_t tx; /*!< Tx settings data structure */ + adi_adrv903x_OrxSettingsExtract_t orx; /*!< ORx settings data structure */ + adi_adrv903x_JesdSettingsExtract_t jesdSetting; /*!< Jesd settings *//*!< ORx settings data structure */ + uint8_t rxTxCpuConfig[ADI_ADRV903X_MAX_CHANNELS]; /*!< Defines which CPU each channel is assigned to (Rx/Tx) */ + uint8_t orxCpuConfig[ADI_ADRV903X_MAX_ORX]; /*!< Defines which CPU each channel is assigned to (ORx) */ + uint8_t jesd204DesLaneCpuConfig[ADI_ADRV903X_MAX_SERDES_LANES]; /*!< Defines which CPU each deserializer lane calibration is assigned to */ + uint8_t chanAssign[ADI_ADRV903X_MAX_CHANNELS]; /*!< This is used to reference a channel to a rx/tx profile def'n in rxConfig/txConfig */ + uint8_t featureMask[ADI_ADRV903X_MAX_FEATUREMASK]; /*!< Device Extract information 128 bits of Feature Mask */ +} adi_adrv903x_InitExtract_t; + + +/** + * \brief Data structure to hold ADRV903X device instance settings + */ +typedef struct adi_adrv903x_Device +{ + adi_common_Device_t common; /*!< Common layer structure */ + adi_adrv903x_Info_t devStateInfo; /*!< ADRV903X run time state information container */ + adi_adrv903x_SpiConfigSettings_t spiSettings; /*!< Pointer to ADRV903X SPI Settings */ + adi_adrv903x_InitExtract_t initExtract; /*!< ADRV903X init info extract from CPU Profile container */ +} adi_adrv903x_Device_t; +#endif /* CLIENT_IGNORE */ + +#endif diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_user.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_user.h new file mode 100644 index 0000000000000..d37cb4c98791c --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_user.h @@ -0,0 +1,229 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adi_adrv903x_user.h + * \brief Contains ADRV903X API macro definitions for user to override + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_USER_H_ +#define _ADI_ADRV903X_USER_H_ + +#ifndef ADI_ADRV903X_LOGGING +#define ADI_ADRV903X_LOGGING (uint32_t) ( ADI_HAL_LOG_MSG | \ + ADI_HAL_LOG_WARN | \ + ADI_HAL_LOG_ERR | \ + ADI_HAL_LOG_API) /* LogLevel Set to API, Messages, Warnings, Error */ +#endif /* !ADI_ADRV903X_LOGGING */ + +/* + ***************************************** + * Interface Macros + ****************************************** + */ +#ifndef ADI_ADRV903X_CPU_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES + #define ADI_ADRV903X_CPU_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES 1024U /*!< Please ensure that the CPU Binary Image Size is perfectly divisible by the chunk size */ +#endif /* CPU Binary Image Chunk Loading Size */ + +#ifndef ADI_ADRV903X_CPU_PROFILE_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES +#define ADI_ADRV903X_CPU_PROFILE_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES 1024U /*!< Please ensure that the CPU Profile Binary Image Size is perfectly divisible by the chunk size */ +#endif /* CPU Profile Binary Image Chunk Loading Size */ + +#ifndef ADI_ADRV903X_STREAM_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES + #define ADI_ADRV903X_STREAM_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES 1024U /*!< Please ensure that the Stream Processor Binary Image Size is perfectly divisible by the chunk size */ +#endif /* Steam Processor Binary Image Chunk Loading Size */ + +#ifndef ADI_ADRV903X_TX_ATTEN_TABLE_CACHE_MAX + #define ADI_ADRV903X_TX_ATTEN_TABLE_CACHE_MAX 256U /*!< Cache value: up to 1024, multiple of 4 */ +#endif + +#ifndef ADI_ADRV903X_MEM_DUMP_CHUNK_SIZE + #define ADI_ADRV903X_MEM_DUMP_CHUNK_SIZE 256U /*!< Cache value: up to 1024, multiple of 4 */ +#endif + +/** + * Macro for compiler-specific structure packing directive. + * Define this if your compiler is not supported in + * devices/adrv903x/public/adi_adrv903x_platform_pack.h. + * See adi_adrv903x_platform_pack.h for examples. To use + * this macro from the list in adi_adrv903x_plaform_pack.h + * remove this definition (including ifndef) + */ +#ifndef ADI_ADRV903X_PACKED + #define ADI_ADRV903X_PACKED(d) _Pragma("pack(1)") d _Pragma("pack()") +#endif + +/* + ***************************************** + * Rx gain tables + ****************************************** + */ +#ifndef ADI_ADRV903X_RX_GAIN_TABLE_ARR_MAX + #define ADI_ADRV903X_RX_GAIN_TABLE_ARR_MAX 1U /*!< Number of Rx Gain Tables to be loaded */ +#endif /* Rx Gain Table Array Size */ + +#ifndef ADI_ADRV903X_MAX_GAIN_TABLE_INDEX + #define ADI_ADRV903X_MAX_GAIN_TABLE_INDEX 255U +#endif + + +#ifndef ADI_ADRV903X_RADIOCTRL_RANGE_CHECK + #define ADI_ADRV903X_RADIOCTRL_RANGE_CHECK 1 +#endif + +/** + * Macro for defining platform-specific byte ordering (endianness). + * Define this if your compiler is not supported in + * devices/adrv903x/private/adrv903x_platform_byte_order.h. + * See adrv903x_platform_byte_order.h for examples. + */ +/* +#ifndef ADI_ADRV903X_LITTLE_ENDIAN +#define ADI_ADRV903X_LITTLE_ENDIAN (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) +#endif +*/ + +#ifndef ADI_ADRV903X_SENDCPUCMD_TIMEOUT_US +#define ADI_ADRV903X_SENDCPUCMD_TIMEOUT_US 2000000 +#endif + +#ifndef ADI_ADRV903X_SENDCPUCMD_INTERVAL_US +#define ADI_ADRV903X_SENDCPUCMD_INTERVAL_US 1000 +#endif + +#ifndef ADI_ADRV903X_READCPURESP_TIMEOUT_US +#define ADI_ADRV903X_READCPURESP_TIMEOUT_US 1000000 +#endif + +#ifndef ADI_ADRV903X_READCPURESP_INTERVAL_US +#define ADI_ADRV903X_READCPURESP_INTERVAL_US 1000 +#endif + +#ifndef ADI_ADRV903X_INITCALSWAIT_INTERVAL_US +#define ADI_ADRV903X_INITCALSWAIT_INTERVAL_US 1000 +#endif + +#ifndef ADI_ADRV903X_TRACKCALDISABLE_TIMEOUT_US +#define ADI_ADRV903X_TRACKCALDISABLE_TIMEOUT_US 4000000 +#endif + +#ifndef ADI_ADRV903X_TRACKCALDISABLE_INTERVAL_US +#define ADI_ADRV903X_TRACKCALDISABLE_INTERVAL_US 100000 +#endif + +#ifndef ADI_ADRV903X_RUNEYESWEEP_TIMEOUT_US +#define ADI_ADRV903X_RUNEYESWEEP_TIMEOUT_US 180000000 +#endif + +#ifndef ADI_ADRV903X_RUNEYESWEEP_TIMEOUT_ONE_HOUR_IN_US +#define ADI_ADRV903X_RUNEYESWEEP_TIMEOUT_ONE_HOUR_IN_US (60UL * 60UL * 1000000UL) +#endif + +#ifndef ADI_ADRV903X_RUNEYESWEEP_INTERVAL_US +#define ADI_ADRV903X_RUNEYESWEEP_INTERVAL_US 10000 +#endif + +#ifndef ADI_ADRV903X_GETCPUBOOTUP_TIMEOUT_US +#define ADI_ADRV903X_GETCPUBOOTUP_TIMEOUT_US 120000000 +#endif + +#ifndef ADI_ADRV903X_GETCPUBOOTUP_INTERVAL_US +#define ADI_ADRV903X_GETCPUBOOTUP_INTERVAL_US 1000 +#endif + +#ifndef ADI_ADRV903X_WRITECPUEXCEPTION_TIMEOUT_US +#define ADI_ADRV903X_WRITECPUEXCEPTION_TIMEOUT_US 5000000 +#endif + +#ifndef ADI_ADRV903X_WRITECPUEXCEPTION_INTERVAL_US +#define ADI_ADRV903X_WRITECPUEXCEPTION_INTERVAL_US 1000 +#endif + +#ifndef ADI_ADRV903X_MIN_GAIN_TABLE_INDEX + #define ADI_ADRV903X_MIN_GAIN_TABLE_INDEX 0 +#endif + +#ifndef ADI_ADRV903X_START_RX_GAIN_INDEX + #define ADI_ADRV903X_START_RX_GAIN_INDEX 255 +#endif + +#ifndef ADI_ADRV903X_MIN_RX_GAIN_TABLE_INDEX + #define ADI_ADRV903X_MIN_RX_GAIN_TABLE_INDEX 0 +#endif + +#ifndef ADI_ADRV903X_FACTORY_TEMPERATURE_TEST + #define ADI_ADRV903X_FACTORY_TEMPERATURE_TEST 70 +#endif + +#ifndef ADI_ADRV903X_FACTORY_TEMPERATURE_MARGIN + #define ADI_ADRV903X_FACTORY_TEMPERATURE_MARGIN 3 +#endif + +#ifndef ADI_ADRV903X_JRXREPAIR_APPLY_WAIT_US + #define ADI_ADRV903X_JRXREPAIR_APPLY_WAIT_US 50000U +#endif + +#ifndef ADI_ADRV903X_JRXREPAIR_TEST_WAIT_US + #define ADI_ADRV903X_JRXREPAIR_TEST_WAIT_US 200000U +#endif + +#ifndef ADI_ADRV903X_RX_RANGE_CHECK + /* TODO: Turn on when current UT brings Trx CPU to a mode + * that is compatible with RxTxEnableSetRangeCheck */ + #define ADI_ADRV903X_RX_RANGE_CHECK 1 +#endif + + +#ifndef ADI_ADRV903X_API_VERSION_RANGE_CHECK + #define ADI_ADRV903X_API_VERSION_RANGE_CHECK 0 +#endif + +/** + * \brief Enable Flag for Spi Verify Check in PreMcsInit_NonBroadcast + */ + +#ifndef ADI_ADRV903X_SPI_VERIFY + #define ADI_ADRV903X_SPI_VERIFY 0 +#endif + + +/** + * \brief Enable Flag for SPI Pins Hysteresis + */ + + +#ifndef ADI_ADRV903X_SPI_HYSTERESIS + #define ADI_ADRV903X_SPI_HYSTERESIS 0 +#endif + +/** + * \brief Enable Flag for SPI Pins Hysteresis Debug + */ +#ifndef ADI_ADRV903X_SPI_HYSTERESIS_DEBUG + #define ADI_ADRV903X_SPI_HYSTERESIS_DEBUG 0 +#endif + + +/** + * \brief Drive Strength Configuration for ResetB Pin + */ + +#ifndef ADI_ADRV903X_RESETB_PIN_DRIVE_STRENGTH + #define ADI_ADRV903X_RESETB_PIN_DRIVE_STRENGTH 0 +#endif + + +/** + * \brief Enable Flag for ResetB Pin Hysteresis + */ + +#ifndef ADI_ADRV903X_RESETB_PIN_HYSTERESIS + #define ADI_ADRV903X_RESETB_PIN_HYSTERESIS 0 +#endif + +#endif + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_utilities.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_utilities.h new file mode 100644 index 0000000000000..c44dd377e41cf --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_utilities.h @@ -0,0 +1,685 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_utilities.h +* \brief Contains top level ADRV903X related function prototypes for +* adi_adrv903x_utilities.c +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef _ADI_ADRV903X_UTILITIES_H_ +#define _ADI_ADRV903X_UTILITIES_H_ + +#include "adi_adrv903x_utilities_types.h" +#include "adi_adrv903x_error.h" + + +/** +* \brief This utility function loads ADRV903X CPU Binary Image +* +* This function reads the CPU Binary Image file from a specified location (e.g. SD card) +* and programs the CPU through CpuImageWrite() API +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* Please note that a large chunk size defined by ADI_ADRV903X_CPU_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES +* in adi_adrv903x_user.h could potentially cause the stack to crash. Please optimize the chunk size +* in accordance with the stack space available +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] cpuBinaryInfo adi_adrv903x_cpuBinaryInfo_t to be loaded +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuImageLoad(adi_adrv903x_Device_t* const device, + const adi_adrv903x_cpuBinaryInfo_t* const cpuBinaryInfo); + +/** +* \brief This utility function loads ADRV903X Stream Binary Image +* +* This function reads the ADRV903X Stream Binary file from a specified location (e.g. SD card) +* and programs the Stream Processor using StreamImageWrite() API +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* Please note that a large chunk size defined by ADI_ADRV903X_STREAM_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES +* in adi_adrv90xxx_user.h could potentially cause the stack to crash. Please optimize the chunk size +* in accordance with the stack space available. +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] streamBinaryInfoPtr Pointer to adi_adrv903x_streamBinaryInfo_t for loading Stream Binary Image +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StreamImageLoad(adi_adrv903x_Device_t* const device, + const adi_adrv903x_streamBinaryInfo_t* const streamBinaryInfoPtr); + +/** +* \brief This utility function loads ADRV903X Rx Gain Table File +* +* This function reads the ADRV903X Rx Gain Table file (i.e. CSV Format) from a specified location +* (e.g. SD card) and programs the ADRV903X CPU SRAM with the gain table for the requested channels +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] rxGainTableInfo Array of adi_adrv903x_RxGainTableInfo_t for loading Rx Gain Tables +* \param[in] rxGainTableArrSize Array Size, i.e. Number of Rx gain Tables being provided to load +* +* Rx Gain Table columns should be arranged in the following order +* +* -------------------------------------------------------------------------------------------------------- +* | Gain Index | FE Control Word | Ext Control | Phase Offset | Digital Gain | +* -------------------------------------------------------------------------------------------------------- +* +* Rx Gain Indices should be arranged in ascending order for row entries starting with the lowest gain index and +* and progressing to highest gain Index +* +* Eg: If the gain table contains entries from index 192 to index 255, the table has to be arranged such that +* first line should contain row entries for index 192 and the last line should contain row entries to index 255 +* with a total of 64 entries. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainTableLoad(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxGainTableInfo_t rxGainTableInfo[], + const uint32_t rxGainTableArrSize); + +/** +* \brief This utility function extract the Init info from the ADRV903X CPU Profile Binary Image +* +* This function reads the CPU Binary Image Profile file from a specified location (e.g. SD card) +* and extract the Init Info, and save in device data structure. This is an init time function and +* is being called by adi_adrv903x_PreMcsInit(). +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] cpuProfileBinaryInfoPtr Pointer to adi_adrv903x_CpuProfileBinaryInfo_t to be loaded +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeviceInfoExtract(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuProfileBinaryInfo_t* const cpuProfileBinaryInfoPtr); + +/** +* \brief This utility function loads ADRV903X CPU Profile Binary Image +* +* This function reads the CPU Binary Image Profile file from a specified location (e.g. SD card) +* and programs the Binary Image Profile through CpuProfileWrite() API +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* Please note that a large chunk size defined by ADI_ADRV903X_CPU_PROFILE_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES +* in adi_adrv903x_user.h could potentially cause the stack to crash. Please optimize the chunk size +* in accordance with the stack space available +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] cpuProfileBinaryInfoPtr Pointer to adi_adrv903x_CpuProfileBinaryInfo_t to be loaded +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuProfileImageLoad(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuProfileBinaryInfo_t* const cpuProfileBinaryInfoPtr); + +#ifndef CLIENT_IGNORE +/** +* \brief This utility function copies ADRV903X Device Data +* +* This function reads the Device State Init Extract Information from one to another. +* DeviceCopy should be called before making the devices available to multiple threads. +* Unlike the other adrv903x device functions DeviceCopy is not thread-safe. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] deviceSrc Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in,out] deviceDest Pointer to the ADRV903X device data structure to get updated settings +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeviceCopy( adi_adrv903x_Device_t* const deviceSrc, + adi_adrv903x_Device_t* const deviceDest); +#endif /* !CLIENT_IGNORE */ + +/** +* \brief This Utility Function executes ADRV903X Pre-MCS Initialization Sequence +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in] init Pointer to the ADRV903X Init data structure +* \param[in] trxBinaryInfoPtr Pointer to all TRX File Information for loading +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_PreMcsInit(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Init_t* const init, + const adi_adrv903x_TrxFileInfo_t* const trxBinaryInfoPtr); + +/** +* \brief This utility function executes the non-broadcastable part of +* Pre-MCS init sequence +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in] init Pointer to the ADRV903X Init data structure +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_PreMcsInit_NonBroadcast(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Init_t* const init); + +/** +* \brief This Utility Function executes ADRV903X Post-MCS Initialization Sequence +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in] utilityInit Pointer to the ADRV903X utility Init data structure +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_PostMcsInit(adi_adrv903x_Device_t* const device, + const adi_adrv903x_PostMcsInit_t* const utilityInit); + +/** +* \brief This Utility function executes ADRV903X Standby Enter/Power Down Sequence +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in,out] standbyRecover Pointer to the output ADRV903X Standby Recover data structure. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StandbyEnter(adi_adrv903x_Device_t* const device, + adi_adrv903x_StandbyRecover_t* const standbyRecover); + +/** +* \brief This Utility function executes ADRV903X Power up Sequence, recovering from the power down mode. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in,out] standbyRecover Pointer to the output ADRV903X Standby Recover data structure +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StandbyRecover(adi_adrv903x_Device_t* const device, + adi_adrv903x_StandbyRecover_t* const standbyRecover); + +/** +* \brief This Utility function executes ADRV903X Standby Exit Sequence, clearing the Standby state. +* It must be called after StandbyRecover and after MCS/JESD link bring up. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in,out] standbyRecover Pointer to the ADRV903X Standby Recover data structure +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StandbyExit(adi_adrv903x_Device_t* const device, + adi_adrv903x_StandbyRecover_t* const standbyRecover); + +/** +* \brief This Utility function queries the device if the ADRV903X Standby Exit Sequence has finished +* It must be called after StandbyExit using a polling operation waiting for done to be '1' +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in,out] standbyRecover Pointer to the ADRV903X Standby Recover data structure +* \param[out] done '1', if the Standby Exit had finished +* '0', otherwise +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StandbyExitStatusGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_StandbyRecover_t* const standbyRecover, + uint8_t * const done); + + + +/** +* \brief This Utility function is used to load the repairHistory from a file that is stored in the specified filePath given +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in] fileInfo Path to the Jrx Repair History File +* \param[in,out] repairHistory Pointer to the ADRV903X Jrx Repair History data structure +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairFileLoad(adi_adrv903x_Device_t* const device, + const adi_adrv903x_JrxRepairBinaryInfo_t* const fileInfo, + adi_adrv903x_JrxRepairHistory_t* const repairHistory); + +/** +* \brief This Utility function is used to save the repairHistory calculated from the self repair process to a file that is stored in the specified filePath given +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in] fileInfo Path to the Jrx Repair History File +* \param[in,out] repairHistory Pointer to the ADRV903X Jrx Repair History data structure +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairFileSave(adi_adrv903x_Device_t* const device, + const adi_adrv903x_JrxRepairBinaryInfo_t * const fileInfo, + adi_adrv903x_JrxRepairHistory_t* const repairHistory); + +/** +* \brief This Utility is used to check if we have a history of JRx repair. +* This function will read the screen ID of the part. +* This function will execute a temperature readback. +* The result of the history check will be stored in jrxRepair->historyCheck, which can take values from adi_adrv903x_JrxRepairHistoryCheck_e +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in,out] jrxRepair Pointer to adi_adrv903x_JrxRepair_t data structure +* \param[out] checkTemp History Check output temperature readback +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairHistoryCheck(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepair_t* const jrxRepair, + int16_t* const checkTemp); + + +/** +* \brief Performs a Lane Assessment and returns a lane mask identifying which lanes have errors. +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[out] badLaneMask Deserializer lane mask, which bad lanes are selected +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairLaneAssess(adi_adrv903x_Device_t* const device, + uint8_t *const badLaneMask); + +/** +* \brief This utility function is used to initialize the JrxRepair facility +* This function sets the part in the desired state in order to execute the VCM repair. +* If serdes tracking cals were enabled, they will be disabled. +* If PRBS is needed then it will be activated. +* \brief This utility function is used to initialize the JrxRepair facility. +* +* The function stores its results in the 'jrxRepair' argument. +* +* This function changes the device state in order to execute the VCM repair. Specifically, if serdes tracking cals were enabled +* they will be disabled and if PRBS is needed then it will be activated. In order to restore these device state changes +* adi_adrv903x_JrxRepairExit must be called later. +* in order to restore this state at adi_adrv903x_JrxRepairExit() +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in,out] jrxRepair Pointer to adi_adrv903x_JrxRepair_t data structure +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairEnter(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepair_t* const jrxRepair); + +/** +* \brief This utility function is used to survey the enabled lanes in order to check if they have a potential issue. +* This function loops through various settings and calls adi_adrv903x_JrxRepairTest in every iteration. +* This function builds the adi_adrv903x_JrxRepairBiasSurvey_t that indicates the errors that occurred per lane. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in,out] repairHistory Pointer to the ADRV903X Jrx Repair History data structure +* \param[in,out] biasSurvey Pointer to the ADRV903X Jrx Repair Bias Survey data structure +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairBiasSurvey(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepairHistory_t* const repairHistory, + adi_adrv903x_JrxRepairBiasSurvey_t* const biasSurvey); + +/** +* \brief Performs Serdes InitCal in Fast Attack mode and Lookup of the Init Cal Status +* +* \pre This function may be called any time after the device has been initialized, and +* initialization calibrations have taken place. +* Serdes Tracking Calibration should be disabled before calling this function +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Context variable - A pointer to the device settings structure +* \param[out] initCalErrData Pointer passed to obtain init calibrations error data. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairFastAttackRun(adi_adrv903x_Device_t* const device, + adi_adrv903x_InitCalErrData_t* const initCalErrData); + +/** +* \brief This utility function is used to test the jesd lanes for 204B or 204C link setup, it can operate in PRBS mode if it is active or with live data. +* This function will return the test result which will be the addition of all different error types per lane or the PRBS error count per lane. +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in,out] testResult Pointer to the ADRV903X Jrx Repair Test data structure +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairTest(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepairTest_t* const testResult); + +/** +* \brief This function is used to apply the repairHistory for the jesd lanes in order to solve the issue with VCM +* The repairHistory will be checked and applied to the HW using SwC method +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in,out] repairHistory Pointer to the ADRV903X Jrx Repair History data structure +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairApply(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepairHistory_t* const repairHistory); + +/** +* \brief This function is used to query for the Deserializer Lanes SwC status +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[out] swcEnMask Deserializer lane mask, which SwC is enabled +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairSwCEnableGet(adi_adrv903x_Device_t* const device, + uint8_t* const swcEnMask); + +/** +* \brief This function is used to set enabled or disabled the Deserializer Lanes SwC status +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in] swcEnMask Deserializer lane mask, in which SwC is to be enabled +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairSwCEnableSet(adi_adrv903x_Device_t* const device, + const uint8_t swcEnMask); + + +/** +* \brief Completes the JrxRepair procedure. +* Uses information from 'jrxRepair' to restore any device state changes made by adi_adrv903x_JrxRepairEnter(). +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in,out] jrxRepair Pointer to adi_adrv903x_JrxRepair_t data structure +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairExit(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepair_t* const jrxRepair); + + +/** +* \brief Top level function for the self repair activity +* This function will call the following: +* -adi_adrv903x_JrxRepairHistoryCheck +* -adi_adrv903x_JrxRepairEnter +* -adi_adrv903x_JrxRepairSwCEnableGet +* -adi_adrv903x_JrxRepairBiasSurvey +* -adi_adrv903x_JrxRepairApply +* -adi_adrv903x_JrxRepairFastAttackRun +* -adi_adrv903x_JrxRepairTest +* -adi_adrv903x_JrxRepairExit +* +* We will need to call adi_adrv903x_JrxRepairHistoryCheck +* this function will check: +* errors +* temperature +* version +* loaded history +* In order to decide what is the next step +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X Device data structure +* \param[in,out] jrxRepair Pointer to adi_adrv903x_JrxRepair_t +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairExecute(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepair_t* const jrxRepair); + +/** +* \brief This function is used to set enabled or disabled the Deserializer Lanes SwC status +* and depending on the number of lanes used use SwC or simply turning VCMs off. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] laneMask Lanes that are required to go into the Vcm fix mode +* \param[in] enableFix If Vcm lanes fix should be enabled or disabled +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairVcmLanesFix(adi_adrv903x_Device_t* const device, + uint8_t laneMask, + uint8_t enableFix); +/** +* \brief This function is used to enable the Jrx repair at startup. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] enableRepair If Jrx repair should be enabled or disabled +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairInitialization(adi_adrv903x_Device_t* const device, + uint8_t enableRepair); + +/** +* \brief This utility function dumps the ADRV903X CPU program and data memory through Registers32Read() API +* +* This function reads the selected CPU Memory and writes the binary byte array directly to a binary file. +* The binaryFilename is opened before reading the CPU memory to verify that the filepath is has valid write access +* before reading CPU memory.A file IO exception will be thrown if write access is not valid for the binaryFilename path. +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] cpuMemDumpBinaryInfoPtr Pointer to adi_adrv903x_CpuMemDumpBinaryInfo_t to be loaded +* \param[in] forceException If set to 1 force all CPUs to exception state before dumping memory. +* \param[out] dumpSize Size of the CPU dump in bytes. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuMemDump(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuMemDumpBinaryInfo_t* const cpuMemDumpBinaryInfoPtr, + const uint8_t forceException, + uint32_t* const dumpSize); + +/** +* \brief This utility function dumps the ADRV903X CPU RAM memory through Registers32Read() API and all other regions are set to zero +* +* This function reads the selected CPU Memory and writes the binary byte array directly to a binary file. +* The binaryFilename is opened before reading the CPU memory to verify that the filepath is has valid write access +* before reading CPU memory.A file IO exception will be thrown if write access is not valid for the binaryFilename path. +* +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] cpuMemDumpBinaryInfoPtr Pointer to adi_adrv903x_CpuMemDumpBinaryInfo_t to be loaded +* \param[in] forceException If set to 1 force all CPUs to exception state before dumping memory. +* \param[out] dumpSize Size of the CPU dump in bytes. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuMemDump_vRamOnly(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuMemDumpBinaryInfo_t* const cpuMemDumpBinaryInfoPtr, + const uint8_t forceException, + uint32_t* const dumpSize); + +/** +* \brief This utility function reads ADRV903X Rx Gain table file checksum value +* +* This function reads the ADRV903X Rx Gain Table file in csv format from a specified location +* (typically in an SD card) and get checksum information, 32bit, decimal format, in the second line +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] rxGainTableInfoPtr Pointer to adi_adrv903x_RxGainTableInfo_t for loading Rx Gain Table +* \param[out] rxGainTableChecksum is Rx gain table checksum information, 32bit +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainTableChecksumRead(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxGainTableInfo_t* const rxGainTableInfoPtr, + uint32_t* const rxGainTableChecksum); +/** +* \brief This utility function calculates ADRV903X Rx Gain table file checksum value +* +* This function calculates the ADRV903X Rx Gain Table from CPU memory and calculate checksum value +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] rxChannel is Rx channel index +* \param[out] rxGainTableChecksum is Rx gain table checksum information, 32bit +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainTableChecksumCalculate(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint32_t* const rxGainTableChecksum); +/** +* \brief This utility function loads ADRV903X api version, firmware and stream versions, +* ADRV903X Init and PostMcsInit data structures from the Binary Image that also has the profile. +* +* This function reads the CPU Binary Image file from a specified location (e.g. SD card) +* and, if it contains more information than the profile, populates the structs adi_adrv903x_Version_t for +* the api version, adi_adrv903x_CpuFwVersion_t for the firmware version, adi_adrv903x_Version_t for +* the stream version, adi_adrv903x_Init_t init structure and adi_adrv903x_PostMcsInit_t postMcsInit structures. +* In case this function is called and the profile binary does not contain information for the mentioned structures +* it will exit informing such state in the checkOutput output parameter. +* +* This function should be called before adi_adrv903x_PreMcsInit, adi_adrv903x_PreMcsInit_NonBroadcast and adi_adrv903x_PostMcsInit +* as these functions require the structures to be already populated. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure containing settings +* \param[in] cpuBinaryInfo adi_adrv903x_cpuBinaryInfo_t to be loaded +* \param[out] apiVer Pointer to the ADRV903X api version data structure to be populated +* \param[out] fwVer Pointer to the ADRV903X firmware version data structure to be populated +* \param[out] streamVer Pointer to the ADRV903X stream version data structure to be populated +* \param[out] init Pointer to the ADRV903X Init data structure to be populated +* \param[out] postMcsInit Pointer to the ADRV903X PostMcsInit data structure to be populated +* \param[out] checkOutput Pointer to ADRV903X enum that constains if the profile binary provided contains the desired structures +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitDataExtract(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuProfileBinaryInfo_t* const cpuBinaryInfo, + adi_adrv903x_Version_t* const apiVer, + adi_adrv903x_CpuFwVersion_t* const fwVer, + adi_adrv903x_Version_t* const streamVer, + adi_adrv903x_Init_t* const init, + adi_adrv903x_PostMcsInit_t* const postMcsInit, + adi_adrv903x_ExtractInitDataOutput_e* const checkOutput); + +#endif /* _ADI_ADRV903X_UTILITIES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_utilities_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_utilities_types.h new file mode 100644 index 0000000000000..9cbb61b1f3e39 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_utilities_types.h @@ -0,0 +1,256 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_utilities_types.h +* \brief Contains ADRV903X API Utilities data types +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#ifndef _ADI_ADRV903X_UTILITIES_TYPES_H_ +#define _ADI_ADRV903X_UTILITIES_TYPES_H_ + +#include "adi_adrv903x_datainterface_types.h" +#include "adi_adrv903x_radioctrl_types.h" +#include "adi_adrv903x_cals_types.h" +#include "adi_adrv903x_gpio_types.h" +#include "adi_adrv903x_user.h" +#include "adi_library_types.h" + +#define ADI_ADRV903X_MAX_NUM_CPUS 2U /* Max Number of ADRV903X CPU's */ +#define ADI_ADRV903X_PRODUCT_ID_MASK 0x0100U /* Product ID, used in Memdump Tools*/ + +#define ADI_ADRV903X_MAX_NUM_LO 2U /* Max Number of ADRV903X LO's */ + +#define ADI_ADRV903X_LOAD_ALL_CPUS ADI_ADRV903X_MAX_NUM_CPUS /* Load All Available CPU's */ + +#define ADI_ADRV903X_LOAD_ALL_RXGAIN_TABLES ADI_ADRV903X_RX_GAIN_TABLE_ARR_MAX /* Load All Rx Gain Tables */ +#define ADI_ADRV903X_MAX_FILE_LENGTH 256U /* Max file length for all API files */ +#define ADI_ADRV903X_VRAM_ONLY_SIZE 4U /* vram only table size */ + +#define ADI_ADRV903X_VERSION_PREREL_SIZE 30U /* Size of Prerel string for driver/firmware version */ + +#define ADI_ADRV903X_FIRMWARE_TYPE_ID_SHIFT 24U /* Type shift for FW ID*/ + +#define ADI_ADRV903X_ETF_RAM_SIZE_OFFSET 2U /* Amount to shift (<<) ETF RSZ value */ +#define ADI_ADRV903X_TRCIDR1_ARCH_SHIFT 4U /* Amount to shift (>>) TRCIDR1 to get ETM Architecture */ +#define ADI_ADRV903X_TRCIDR1_ARCH_MASK 0x00000FF0U /* Mask for TRCIDR1 ETM Architecture positions */ +#define ADI_ADRV903X_TRACE_FORMAT_CORESIGHT 0x1U /* Coresight format for trace data */ + +#define ADI_ADRV903X_MEMDUMP_DEVICE_DRIVER_HEADER_SIZE 56U /* size of memdump device driver header */ +#define ADI_ADRV903X_MEMDUMP_FIRMWARE_VERSION_HEADER_SIZE 44U /* size of memdump firmware header */ +#define ADI_ADRV903X_MEMDUMP_CPU_RAM_HEADER_SIZE 24U /* size of memdump CPU RAM header */ +#define ADI_ADRV903X_MEMDUMP_REGISTER_HEADER_SIZE 16U /* size of memdump register header */ +#define ADI_ADRV903X_MEMDUMP_TELEM_BUFFER_HEADER_SIZE 16U /* size of memdump basic telemetry header */ +#define ADI_ADRV903X_MEMDUMP_TRACE_BUFFER_HEADER_SIZE 12U /* size of memdump basic trace header */ + +/** +* \brief Macro to restore wrOnly bit +* +* \param commonDev Device variable having wrOnly bit to be restored +* \param wrOnlyBit wrOnly bit value to restore +*/ +#define ADI_ADRV903X_WRONLY_SET(commonDev, wrOnlyBit) commonDev.wrOnly = wrOnlyBit + +/** +* \brief Extract Init Data function Output. Informs user if +* the profile bin does not contain the init structures. +*/ +typedef enum adi_adrv903x_ExtractInitDataOutput +{ + ADI_ADRV903X_EXTRACT_INIT_DATA_NOT_POPULATED = 0x00, + /*!< Default value when value is not ran yet */ + ADI_ADRV903X_EXTRACT_INIT_DATA_POPULATED = 0x02, + /*!< Profile bin contains init structures and were populated */ + ADI_ADRV903X_EXTRACT_INIT_DATA_LEGACY_PROFILE_BIN = 0x4 + /*!< Profile bin does NOT contains init structures and function exited without triggering errors */ +} adi_adrv903x_ExtractInitDataOutput_e; + +/** +* \brief Accomodate generic strings to cross client RPC interface +*/ +typedef struct adi_adrv903x_GenericStrBuf +{ + uint8_t c_str[ADI_ADRV903X_MAX_FILE_LENGTH]; /*!< String contents */ +} adi_adrv903x_GenericStrBuf_t; + +/** +* \brief Stream Binary Info Data Structure +*/ +typedef struct adi_adrv903x_streamBinaryInfo +{ + uint8_t filePath[ADI_ADRV903X_MAX_FILE_LENGTH]; /*!< File Path for Stream Binary Image */ +} adi_adrv903x_streamBinaryInfo_t; + +/** +* \brief CPU Binary Info Data Structure +*/ +typedef struct adi_adrv903x_cpuBinaryInfo +{ + uint8_t filePath[ADI_ADRV903X_MAX_FILE_LENGTH]; /*!< File Path for CPU Core Binary Image */ +} adi_adrv903x_cpuBinaryInfo_t; + +/** +* \brief CPU Profile Info Data Structure +*/ +typedef struct adi_adrv903x_CpuProfileBinaryInfo +{ + uint8_t filePath[ADI_ADRV903X_MAX_FILE_LENGTH]; /*!< File Path for CPU Profile Binary Image*/ +} adi_adrv903x_CpuProfileBinaryInfo_t; + +/** +* \brief CPU Memory Dump Info Data Structure +*/ +typedef struct adi_adrv903x_CpuMemDumpBinaryInfo +{ + uint8_t filePath[ADI_ADRV903X_MAX_FILE_LENGTH]; /*!< File Path for CPU Memory Dump Binary Image*/ +} adi_adrv903x_CpuMemDumpBinaryInfo_t; + +/** +* \brief RX Gain Table Info Data Structure +*/ +typedef struct adi_adrv903x_RxGainTableInfo +{ + uint32_t channelMask; /*!< Channel Mask (i.e. Specify Channels, that are initialized, with the given Rx Gain Table */ + uint8_t filePath[ADI_ADRV903X_MAX_FILE_LENGTH]; /*!< File Path for RX Gain Table */ +} adi_adrv903x_RxGainTableInfo_t; + +/** +* \brief TRX File Info Data Structure +*/ +typedef struct adi_adrv903x_TrxFileInfo +{ + adi_adrv903x_streamBinaryInfo_t stream; /*!< Stream File Settings */ + adi_adrv903x_cpuBinaryInfo_t cpu; /*!< CPU File Settings */ + adi_adrv903x_CpuProfileBinaryInfo_t cpuProfile; /*!< CPU Profile File Settings (may also contain init data structures) */ + adi_adrv903x_RxGainTableInfo_t rxGainTable[ADI_ADRV903X_RX_GAIN_TABLE_ARR_MAX]; /*!< Rx Gain Table Settings */ +} adi_adrv903x_TrxFileInfo_t; + +/** +* \brief Data structure to hold Utility Init structures +*/ +typedef struct adi_adrv903x_PostMcsInit +{ + adi_adrv903x_RadioCtrlModeCfg_t radioCtrlCfg; /*!< Holds the setup for the Radio Control Mode (SPI vs PIN mode) used for Radio Control */ + adi_adrv903x_RadioCtrlTxRxEnCfg_t radioCtrlGpioCfg; /*!< Holds the setup for each of the GPIO pins used for Radio Control */ + uint8_t radioCtrlTxRxEnPinSel; /*!< Holds the setup for the TxRxEn pin select used for Radio Control */ + uint8_t radioCtrlTxRxEnCfgSel; /*!< Holds the setup for the TxRxEn config select used for Radio Control */ + adi_adrv903x_GpIntPinMaskCfg_t gpIntPostInit; /*!< Holds the setup for GP Interrupt Pin Mask Config to be applied after initialization*/ + adi_adrv903x_InitCals_t initCals; /*!< Holds the setup for Cals Initialization configuration */ +} adi_adrv903x_PostMcsInit_t; + +/** +* \brief Standby mode recover data structure +*/ +typedef struct adi_adrv903x_StandbyRecover +{ + adi_adrv903x_TrackingCalEnableMasks_t tcEnableMasks; /*!< Tracking cals to be re-enabled on Power up */ + uint32_t orxEnabledMask; /*!< Corresponds to the enabled ORX channels to Recover */ + uint32_t rxEnabledMask; /*!< Corresponds to the enabled RX channels to Recover */ + uint32_t txEnabledMask; /*!< Corresponds to the enabled TX channels to Recover */ + uint32_t lo0PllPowerDownCfg; /*!< RF LO0 PLL Power Down Recover Config */ + uint32_t lo1PllPowerDownCfg; /*!< RF LO1 PLL Power Down Recover Config */ + uint32_t serdesPllPowerDownCfg; /*!< Serdes PLL Power Down Recover Config */ + uint32_t clkPllPowerDownCfg; /*!< Clk PLL Power Down Recover Config */ + uint32_t rxAdcPowerDownCtrl; /*!< Rx ADC Power Down Recover Config */ + uint32_t txLbAdcTrmPowerDownCtrl; /*!< Tx Loopback ADC Power Down Recover Config */ + uint16_t deserializerPowerDownReg; /*!< Deserializer Power Down Recover Config */ +} adi_adrv903x_StandbyRecover_t; + + +/** +* \brief Jrx Repair Mode, offer options that are applicable for adi_adrv903x_JrxRepairExecute function +*/ +typedef enum adi_adrv903x_JrxRepairRunMode +{ + ADI_ADRV903X_JRX_REPAIR_NORMAL_MODE = 0U, /*!< Normal mode, in where the bias survey is executed */ + ADI_ADRV903X_JRX_REPAIR_FAST_MODE = 1U, /*!< Fast mode, in where the SwC is applied directly and the links are tested */ +} adi_adrv903x_JrxRepairRunMode_e; + + +/** +* \brief Jrx Repair status check flags +*/ +typedef enum adi_adrv903x_JrxRepairHistoryCheck +{ + ADI_ADRV903X_JRX_REPAIR_CHECKED = 0x001U, /*!< Check function not ran */ + ADI_ADRV903X_JRX_REPAIR_LOAD_HISTORY = 0x002U, /*!< Jrx Repair History to Load */ + ADI_ADRV903X_JRX_REPAIR_ASSESS_LANES = 0x004U, /*!< Perform Lane Assessment */ + ADI_ADRV903X_JRX_REPAIR_FAULTY_VCM_AMP = 0x006U, /*!< Possible faulty VCM AMP identified */ + ADI_ADRV903X_JRX_REPAIR_SCREENED = 0x008U, /*!< Screened part */ + ADI_ADRV903X_JRX_REPAIR_UNKNOWN_ERROR = 0x010U, /*!< No Errors or unidentified Error */ + ADI_ADRV903X_JRX_REPAIR_TEMP_GT_LAST = 0x020U, /*!< Temperature greater than Last History */ + ADI_ADRV903X_JRX_REPAIR_SWC_ALREADY_ENABLED = 0x040U, /*!< SWC already enabled */ + ADI_ADRV903X_JRX_REPAIR_NO_LANE_ERRORS = 0x080U, /*!< No bad or weak lanes discovered */ + ADI_ADRV903X_JRX_REPAIR_APPLY_SUCCESS = 0x100U, /*!< Faulty VCM AMP issue has been fixed */ +} adi_adrv903x_JrxRepairHistoryCheck_e; + +/** +* \brief Jrx Repair Bias Ctrl +* +*/ +typedef enum adi_adrv903x_JrxRepairBiasCtrlFix +{ + ADI_ADRV903X_JRX_REPAIR_MIN_BIAS = 3U, + ADI_ADRV903X_JRX_REPAIR_MAX_BIAS = 4U, + ADI_ADRV903X_JRX_REPAIR_BIAS_NUM = (ADI_ADRV903X_JRX_REPAIR_MAX_BIAS - ADI_ADRV903X_JRX_REPAIR_MIN_BIAS + 1U) +} adi_adrv903x_JrxRepairBiasCtrlFix_e; + +/** +* \brief Jrx Repair history data from the last time a repair was executed +* +*/ +typedef struct adi_adrv903x_JrxRepairHistory +{ + int16_t lastTemp; /*!< readback temperature */ + uint8_t badLaneMask; /*!< Lane mask for bad performance lanes */ + uint8_t weakLaneMask; /*!< Lane mask for weak performance lanes */ + uint8_t goodLaneMask; /*!< Lane mask for good performance lanes */ +} adi_adrv903x_JrxRepairHistory_t; + +/** +* \brief Jrx Repair Lane Test Result data +* +*/ +typedef struct adi_adrv903x_JrxRepairTest +{ + uint32_t laneErrors[ADI_ADRV903X_MAX_DESERIALIZER_LANES]; /*!< Number of errors recorded on each lane */ +} adi_adrv903x_JrxRepairTest_t; + +/** +* \brief Jrx Repair Lane Bias Survey Result data +* +*/ +typedef struct adi_adrv903x_JrxRepairBiasSurvey +{ + adi_adrv903x_JrxRepairTest_t biasTests[ADI_ADRV903X_JRX_REPAIR_BIAS_NUM]; /*!< Jrx Repair Test result for each bias value */ +} adi_adrv903x_JrxRepairBiasSurvey_t; + +/** +* \brief Jrx Repair Binary Info Data Structure +* +*/ +typedef struct adi_adrv903x_JrxRepairBinaryInfo +{ + uint8_t filePath[ADI_ADRV903X_MAX_FILE_LENGTH]; /*!< File Path for Jrx Repair History Binary File */ +} adi_adrv903x_JrxRepairBinaryInfo_t; + +/** +* \brief Jrx Repair Struct that holds all the required data for using the Jrx repair facility +* +*/ +typedef struct adi_adrv903x_JrxRepair +{ + adi_adrv903x_JrxRepairBiasSurvey_t biasSurvey; /*!< Jrx Repair Lane Bias Survey Result data from PRBS */ + adi_adrv903x_JrxRepairHistory_t history; /*!< Jrx Repair history data, can be given by user, or loaded from file or calculated */ + adi_adrv903x_DfrmPrbsCfg_t dfrmPrbsCfg; /*!< Jrx Repair PRBS configuration */ + uint8_t tcEnabledLaneMask; /*!< Enabled Lanes for serdes tracking calibration before JrxRepairEnter */ + uint32_t historyCheck; /*!< Jrx Repair history check result */ + adi_adrv903x_JrxRepairBinaryInfo_t fileInfo; /*!< File Path for stored binary adi_adrv903x_JrxRepairHistory_t */ + adi_adrv903x_JrxRepairRunMode_e runMode; /*!< Run Mode for the adi_adrv903x_JrxRepairExecute function */ +} adi_adrv903x_JrxRepair_t; + +#endif /* _ADI_ADRV903X_TX_TYPES_H_ */ diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_version.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_version.h new file mode 100644 index 0000000000000..871afd101d865 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_version.h @@ -0,0 +1,21 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file adi_adrv903x_version.h + * \brief Contains the version number for the ADRV903X API + * + * ADRV903X API version: 2.12.1.4 + */ + +#ifndef _ADI_ADRV903X_VERSION_H_ +#define _ADI_ADRV903X_VERSION_H_ + +#define ADI_ADRV903X_CURRENT_MAJOR_VERSION 2 +#define ADI_ADRV903X_CURRENT_MINOR_VERSION 12 +#define ADI_ADRV903X_CURRENT_MAINTENANCE_VERSION 1 +#define ADI_ADRV903X_CURRENT_BUILD_VERSION 4 + +#endif diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_version_types.h b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_version_types.h new file mode 100644 index 0000000000000..92787b4eca7da --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/include/adi_adrv903x_version_types.h @@ -0,0 +1,29 @@ +/** + * \file adi_adrv903x_version_types.h + * + * \brief Contains ADRV903X Version data structures. + * + * ADRV903X API Version: 2.12.1.4 + */ + +/** + * Disclaimer Legal Disclaimer + * Copyright 2019 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADI_ADRV903X_VERSION_TYPES_H__ +#define __ADI_ADRV903X_VERSION_TYPES_H__ + +typedef struct adi_adrv903x_Version +{ + uint32_t majorVer; /*!< API Major Version number */ + uint32_t minorVer; /*!< API Minor Version number */ + uint32_t maintenanceVer; /*!< API Maintenance number */ + uint32_t buildVer; /*!< API Build Version number */ +} adi_adrv903x_Version_t; + +typedef adi_adrv903x_Version_t adrv903x_Version_t; + +#endif /* __ADI_ADRV903X_VERSION_TYPES_H__ */ + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_agc.c b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_agc.c new file mode 100644 index 0000000000000..9bd1b20a8aa6c --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_agc.c @@ -0,0 +1,2623 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_agc.c +* \brief Contains AGC features related function implementation defined in +* adi_adrv903x_agc.h +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#include "adi_adrv903x_agc.h" +#include "adi_adrv903x_rx.h" + +#include "../../private/bf/adrv903x_bf_rx_funcs_types.h" +#include "../../private/bf/adrv903x_bf_rx_funcs.h" +#include "../../private/bf/adrv903x_bf_rx_ddc_types.h" +#include "../../private/bf/adrv903x_bf_rx_ddc.h" +#include "../../private/bf/adrv903x_bf_rx_dig_types.h" +#include "../../private/bf/adrv903x_bf_rx_dig.h" +#include "../../private/bf/adrv903x_bf_tdr_dpath_top.h" +#include "../../private/include/adrv903x_reg_addr_macros.h" +#include "../../private/include/adrv903x_agc.h" +#include "../../private/include/adrv903x_rx.h" +#include "../../private/include/adrv903x_gpio.h" + + +#define ADI_FILE ADI_ADRV903X_FILE_PUBLIC_AGC + +static const adrv903x_BfRxFuncsChanAddr_e rxChanIdToRxFuncsChanAddr[] = +{ + ADRV903X_BF_SLICE_RX_0__RX_FUNCS, + ADRV903X_BF_SLICE_RX_1__RX_FUNCS, + ADRV903X_BF_SLICE_RX_2__RX_FUNCS, + ADRV903X_BF_SLICE_RX_3__RX_FUNCS, + ADRV903X_BF_SLICE_RX_4__RX_FUNCS, + ADRV903X_BF_SLICE_RX_5__RX_FUNCS, + ADRV903X_BF_SLICE_RX_6__RX_FUNCS, + ADRV903X_BF_SLICE_RX_7__RX_FUNCS +}; + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcGainIndexRangeSet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_AgcGainRange_t agcGainRange[], + const uint32_t numOfAgcRangeCfgs) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cfgIdx = 0U; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, agcGainRange, cleanup); + + if (numOfAgcRangeCfgs == 0U) + { + /* no valid configs */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numOfAgcRangeCfgs, "Invalid Number of AGC Range Configurations"); + goto cleanup; + } + + /* Loop through the number of configurations and perform range checks */ + for (cfgIdx = 0U; cfgIdx < numOfAgcRangeCfgs; ++cfgIdx) + { + recoveryAction = adrv903x_AgcGainRangeCfgRangeCheck(device, &agcGainRange[cfgIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AGC Min/Max Gain set Range Check Error Reported"); + goto cleanup; + } + } + + /* Write out the configurations */ + for (cfgIdx = 0U; cfgIdx < numOfAgcRangeCfgs; ++cfgIdx) + { + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_RX_ONLY; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(agcGainRange[cfgIdx].rxChannelMask, chanSel)) + { + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, (adi_adrv903x_RxChannels_e)(chanSel), &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid Rx Channel used to determine rx func address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcMaximumGainIndex_BfSet(device, NULL, rxFuncsBaseAddr, agcGainRange[cfgIdx].maxGainIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing AGC max gain index"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcMinimumGainIndex_BfSet(device, NULL, rxFuncsBaseAddr, agcGainRange[cfgIdx].minGainIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing AGC min gain index"); + goto cleanup; + } + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcGainIndexRangeGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_AgcGainRange_t * const agcGainConfigReadback) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, agcGainConfigReadback, cleanup); + + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + /* Invalid Rx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx channel selection"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, rxChannel, &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid Rx Channel used to determine rx func address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcMaximumGainIndex_BfGet(device, NULL, rxFuncsBaseAddr, &agcGainConfigReadback->maxGainIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading AGC max gain index"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcMinimumGainIndex_BfGet(device, NULL, rxFuncsBaseAddr, &agcGainConfigReadback->minGainIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading AGC min gain index"); + goto cleanup; + } + + agcGainConfigReadback->rxChannelMask = (uint32_t)rxChannel; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcCfgSet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_AgcCfg_t agcConfig[], + const uint32_t numOfAgcCfgs) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cfgIdx = 0U; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + adrv903x_BfRxChanAddr_e rxDigBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_DIG; + adrv903x_BfTdrDpathTopChanAddr_e rxAnalogChannelIBitfieldAddr = ADRV903X_BF_SLICE_RX_0__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_; + adrv903x_BfTdrDpathTopChanAddr_e rxAnalogChannelQBitfieldAddr = ADRV903X_BF_SLICE_RX_0__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_; + adi_adrv903x_AgcGainRange_t agcGainRange; + uint8_t rxRefClkCycles = 0U; + uint8_t hb2OutClkDividerVal = 0U; + uint8_t bfValue = 0U; + adi_adrv903x_RxDecimatedPowerCfg_t rxDecPowerCfg; + uint16_t preHb2Threshold = 0U; + static const uint8_t ADC_OVLD_PEAK_COUNT_SPACING = 1U; + static const uint8_t ADC_OVLD_PEAK_COUNT_THRESHOLD = 4U; + static const uint32_t ADC_OVLD_PEAK_COUNT_EXPIRATION = 10U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, agcConfig, cleanup); + + ADI_LIBRARY_MEMSET(&agcGainRange, 0, sizeof(adi_adrv903x_AgcGainRange_t)); + ADI_LIBRARY_MEMSET(&rxDecPowerCfg, 0, sizeof(adi_adrv903x_RxDecimatedPowerCfg_t)); + + if (numOfAgcCfgs == 0U) + { + /* no valid configs */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numOfAgcCfgs, "Invalid Number of AGC Configurations"); + goto cleanup; + } + + /* Loop through the number of configurations and perform range checks */ + for (cfgIdx = 0U; cfgIdx < numOfAgcCfgs; ++cfgIdx) + { + recoveryAction = adrv903x_AgcCfgRangeCheck(device, &agcConfig[cfgIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AGC Range Check Error Reported"); + goto cleanup; + } + } + + /* Write out the configurations */ + for (cfgIdx = 0U; cfgIdx < numOfAgcCfgs; ++cfgIdx) + { + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_RX_ONLY; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(agcConfig[cfgIdx].rxChannelMask, chanSel)) + { + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, (adi_adrv903x_RxChannels_e)(chanSel), &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Rx funcs address get issue"); + goto cleanup; + } + + recoveryAction = adrv903x_RxAnalogBitfieldAddressGet(device, + (adi_adrv903x_RxChannels_e)(chanSel), + &rxAnalogChannelIBitfieldAddr, + &rxAnalogChannelQBitfieldAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Rx analog address get issue"); + goto cleanup; + } + + recoveryAction = adrv903x_RxBitfieldAddressGet(device, (adi_adrv903x_RxChannels_e)(chanSel), &rxDigBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Rx digital address get issue"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDig_ReferenceClockCycles_BfGet(device, NULL, rxDigBaseAddr, &rxRefClkCycles); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Error while reading reference clock cycles"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDelayCounterBaseRate_BfSet(device, NULL, rxFuncsBaseAddr, rxRefClkCycles); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing agc delay counter base rate"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcPeakWaitTime_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeakWaitTime); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing agc peak wait delay"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcOvrgResetpdHighCount_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeakWaitTime); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing agc reset pd high count"); + goto cleanup; + } + + agcGainRange.maxGainIndex = agcConfig[cfgIdx].agcRxMaxGainIndex; + agcGainRange.minGainIndex = agcConfig[cfgIdx].agcRxMinGainIndex; + agcGainRange.rxChannelMask = chanSel; + + recoveryAction = adi_adrv903x_AgcGainIndexRangeSet(device, &agcGainRange, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting agc max/min gain"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcGainUpdateCounter_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcGainUpdateCounter); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing agc gain update counter"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcAttackDelay_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcRxAttackDelay); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing agc attack delay"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcEnableFastRecoveryLoop_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcEnableFastRecoveryLoop); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing fast recovery enable bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLowThsPreventGainInc_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcLowThreshPreventGainInc); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing prevent gain inc when crossing low threshold bit"); + goto cleanup; + } + + /* Bit0 of agcChangeGainIfThreshHigh is used for ADC overload */ + bfValue = agcConfig[cfgIdx].agcChangeGainIfThreshHigh & 0x01U; + recoveryAction = adrv903x_RxFuncs_AgcChangeGainIfUlbthHigh_BfSet(device, NULL, rxFuncsBaseAddr, bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing immediate gain change enable bit for ADC overload"); + goto cleanup; + } + + /* Bit1 of agcChangeGainIfThreshHigh is used for HB2 peak detector */ + bfValue = (agcConfig[cfgIdx].agcChangeGainIfThreshHigh >> 1U) & 0x01U; + recoveryAction = adrv903x_RxFuncs_AgcChangeGainIfAdcovrgHigh_BfSet(device, NULL, rxFuncsBaseAddr, bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing immediate gain change enable bit for Hb2 overload"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcPeakThresholdGainControlMode_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeakThreshGainControlMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing peak threshold gain control mode"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcResetOnRxon_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcResetOnRxon); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing reset on rx on bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcSlowLoopSettlingDelay_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcSlowLoopSettlingDelay); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing slow loop settling delay field"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcAdcResetGainStep_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcAdcResetGainStep); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing agc reset gain step field"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUrangeInterval0_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2UnderRangeLowInterval); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing hb2 urange low interval"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUrangeInterval1Mult_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2UnderRangeMidInterval); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing hb2 urange mid interval"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUrangeInterval2Mult_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2UnderRangeHighInterval); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing hb2 urange high interval"); + goto cleanup; + } + + recoveryAction = adrv903x_TdrDpathTop_FlashThresh_BfSet(device, + NULL, + rxAnalogChannelIBitfieldAddr, + agcConfig[cfgIdx].agcPeak.adcOvldLowThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting ADC overload low threshold for I channel"); + goto cleanup; + } + + recoveryAction = adrv903x_TdrDpathTop_FlashThresh_BfSet(device, + NULL, + rxAnalogChannelQBitfieldAddr, + agcConfig[cfgIdx].agcPeak.adcOvldLowThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting ADC overload low threshold for Q channel"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUlbThresholdExceededCounter_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.adcOvldUpperThreshPeakExceededCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing ADC overload high threshold counter"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLlbThresholdExceededCounter_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.adcOvldLowerThreshPeakExceededCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing ADC overload low threshold counter"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUlbGainStep_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.adcOvldGainStepAttack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing ADC overload high gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLlbGainStep_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.adcOvldGainStepRecovery); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing ADC overload low gain step"); + goto cleanup; + } + + if (agcConfig[cfgIdx].agcPeak.enableHb2Overload == 1U) + { + + recoveryAction = adrv903x_RxDig_Hb2OutClkDivideRatio_BfGet(device, NULL, rxDigBaseAddr, &hb2OutClkDividerVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Error while reading hb2 out clock divider value"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDig_PeakDetectClkDivideRatio_BfSet(device, NULL, rxDigBaseAddr, hb2OutClkDividerVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Error while setting peak detector clock divider value"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDig_PeakDetectClkEnable_BfSet(device, NULL, rxDigBaseAddr, ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Error while enabling peak detector clock"); + goto cleanup; + } + } + + recoveryAction = adrv903x_RxHb2OverloadCfgSet(device, + (adi_adrv903x_RxChannels_e)(chanSel), + agcConfig[cfgIdx].agcPeak.enableHb2Overload, + agcConfig[cfgIdx].agcPeak.hb2OverloadSignalSelection, + agcConfig[cfgIdx].agcPeak.hb2OverloadPowerMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 config"); + goto cleanup; + } + + /* Set prethreshold to the half of lowest underrange threshold */ + if (agcConfig[cfgIdx].agcEnableFastRecoveryLoop == 0U) + { + preHb2Threshold = agcConfig[cfgIdx].agcPeak.hb2UnderRangeHighThresh >> 1U; + } + else + { + preHb2Threshold = agcConfig[cfgIdx].agcPeak.hb2UnderRangeLowThresh >> 1U; + } + + recoveryAction = adrv903x_RxFuncs_OverloadThAgcPre_BfSet(device, NULL, rxFuncsBaseAddr, preHb2Threshold); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting prethreshold for Hb2"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_PeakWindowSizeAgc_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2OverloadDurationCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 second stage peak window"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_PeakSampleCountAgc_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2OverloadThreshCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 second stage peak threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_OverloadThAgcHigh_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2HighThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 high threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_OverloadThAgcInt0Low_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2UnderRangeLowThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 underrange low threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_OverloadThAgcInt1Low_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2UnderRangeMidThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 underrange mid threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_OverloadThAgcLow_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2UnderRangeHighThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 underrange high threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcAdcHighOvrgExceededCounter_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2UpperThreshPeakExceededCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 high threshold counter"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcAdcLowOvrgExceededCounter_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2UnderRangeHighThreshExceededCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 underrange high threshold counter"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcOvrgLowGainStep_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2GainStepHighRecovery); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 underrange high threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcOvrgLowInt0GainStep_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2GainStepLowRecovery); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 underrange low threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcOvrgLowInt1GainStep_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2GainStepMidRecovery); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 underrange mid threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcOvrgHighGainStep_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2GainStepAttack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 high threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcAdcovrgLowInt1Counter_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2UnderRangeMidThreshExceededCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 underrange mid threshold counter"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcAdcovrgLowInt0Counter_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPeak.hb2UnderRangeLowThreshExceededCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing HB2 underrange low threshold counter"); + goto cleanup; + } + + if (agcConfig[cfgIdx].agcPower.powerEnableMeasurement == 1U) + { + rxDecPowerCfg.decPowerControl = ADI_ADRV903X_DEC_POWER_AGC_MEAS; + rxDecPowerCfg.measBlockSelectMask = ADI_ADRV903X_DEC_POWER_MAIN_PATH_MEAS_BLOCK; + rxDecPowerCfg.powerInputSelect = agcConfig[cfgIdx].agcPower.powerInputSelect; + rxDecPowerCfg.powerMeasurementDuration = agcConfig[cfgIdx].agcPower.powerMeasurementDuration; + rxDecPowerCfg.rxChannelMask = chanSel; + + recoveryAction = adi_adrv903x_RxDecimatedPowerCfgSet(device, &rxDecPowerCfg, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing decimated power configuration"); + goto cleanup; + } + } + else + { + recoveryAction = adi_adrv903x_RxDecimatedPowerCfgGet(device, + (adi_adrv903x_RxChannels_e)(chanSel), + ADI_ADRV903X_DEC_POWER_MAIN_PATH_MEAS_BLOCK, + &rxDecPowerCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading Rx decimated power configuration"); + goto cleanup; + } + + if (rxDecPowerCfg.decPowerControl == ADI_ADRV903X_DEC_POWER_AGC_MEAS) + { + /* Main path measurement block is being used for AGC - we should disable it */ + rxDecPowerCfg.decPowerControl = ADI_ADRV903X_DEC_POWER_MEAS_OFF; + rxDecPowerCfg.measBlockSelectMask = ADI_ADRV903X_DEC_POWER_MAIN_PATH_MEAS_BLOCK; + rxDecPowerCfg.powerInputSelect = 0; + rxDecPowerCfg.powerMeasurementDuration = 0; + rxDecPowerCfg.rxChannelMask = chanSel; + + recoveryAction = adi_adrv903x_RxDecimatedPowerCfgSet(device, &rxDecPowerCfg, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing Rx decimated power configuration"); + goto cleanup; + } + } + } + + recoveryAction = adrv903x_RxFuncs_AgcLower0Threshold_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPower.underRangeHighPowerThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dec power underrange high threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLower1Threshold_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPower.underRangeLowPowerThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dec power underrange low threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLower0ThresholdExceededGainStep_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPower.underRangeHighPowerGainStepRecovery); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dec power underrange high threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLower1ThresholdExceededGainStep_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPower.underRangeLowPowerGainStepRecovery); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dec power underrange low threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLockLevel_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPower.overRangeLowPowerThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dec power overrange low threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUpper1Threshold_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPower.overRangeHighPowerThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dec power overrange high threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUpper1ThresholdExceededGainStep_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPower.overRangeHighPowerGainStepAttack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dec power overrange high threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUpper0ThresholdExceededGainStep_BfSet(device, NULL, rxFuncsBaseAddr, agcConfig[cfgIdx].agcPower.overRangeLowPowerGainStepAttack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dec power overrange low threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_PeakCountSpacingAgcHigh_BfSet(device, NULL, rxFuncsBaseAddr, ADC_OVLD_PEAK_COUNT_SPACING); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing peak count spacing for ADC ovld high"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_PeakCountSpacingAgcLow_BfSet(device, NULL, rxFuncsBaseAddr, ADC_OVLD_PEAK_COUNT_SPACING); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing peak count spacing for ADC ovld low"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_PeakCountThresholdAgcHigh_BfSet(device, NULL, rxFuncsBaseAddr, ADC_OVLD_PEAK_COUNT_THRESHOLD); + if(recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing peak count threshold for ADC ovld high"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_PeakCountThresholdAgcLow_BfSet(device, NULL, rxFuncsBaseAddr, ADC_OVLD_PEAK_COUNT_THRESHOLD); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing peak count threshold for ADC ovld low"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_PeakCountExpirationAgc_BfSet(device, NULL, rxFuncsBaseAddr, ADC_OVLD_PEAK_COUNT_EXPIRATION); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing peak count expiration for ADC ovld"); + goto cleanup; + } + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcCfgGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_AgcCfg_t * const agcConfigReadBack) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + adrv903x_BfTdrDpathTopChanAddr_e rxAnalogChannelIBitfieldAddr = ADRV903X_BF_SLICE_RX_0__ADC32_ANALOG_REGS_TDR_DPATH_TOP_0_; + adrv903x_BfTdrDpathTopChanAddr_e rxAnalogChannelQBitfieldAddr = ADRV903X_BF_SLICE_RX_0__ADC32_ANALOG_REGS_TDR_DPATH_TOP_1_; + adi_adrv903x_AgcGainRange_t agcGainRange; + uint8_t bfValue = 0U; + adi_adrv903x_RxDecimatedPowerCfg_t rxDecPowerCfg; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, agcConfigReadBack, cleanup); + + ADI_LIBRARY_MEMSET(&agcGainRange, 0, sizeof(adi_adrv903x_AgcGainRange_t)); + ADI_LIBRARY_MEMSET(&rxDecPowerCfg, 0, sizeof(adi_adrv903x_RxDecimatedPowerCfg_t)); + + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + /* Invalid Rx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx channel selection"); + goto cleanup; + } + + /* Read back Rx func bitfield address for selected channel */ + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, rxChannel, &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Rx funcs address get issue"); + goto cleanup; + } + + /* Read back Rx analog bitfield address for selected channel */ + recoveryAction = adrv903x_RxAnalogBitfieldAddressGet(device, + rxChannel, + &rxAnalogChannelIBitfieldAddr, + &rxAnalogChannelQBitfieldAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Rx analog address get issue"); + goto cleanup; + } + + agcConfigReadBack->rxChannelMask = (uint32_t)rxChannel; + + recoveryAction = adrv903x_RxFuncs_AgcPeakWaitTime_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeakWaitTime); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading agc peak wait delay"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_AgcGainIndexRangeGet(device, rxChannel, &agcGainRange); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading agc max/min gain"); + goto cleanup; + } + + agcConfigReadBack->agcRxMinGainIndex = agcGainRange.minGainIndex; + agcConfigReadBack->agcRxMaxGainIndex = agcGainRange.maxGainIndex; + + recoveryAction = adrv903x_RxFuncs_AgcGainUpdateCounter_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcGainUpdateCounter); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading agc gain update counter"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcAttackDelay_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcRxAttackDelay); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading agc attack delay"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcEnableFastRecoveryLoop_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcEnableFastRecoveryLoop); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading fast recovery enable bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLowThsPreventGainInc_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcLowThreshPreventGainInc); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading prevent gain inc when crossing low threshold bit"); + goto cleanup; + } + + /* Bit0 of agcChangeGainIfThreshHigh is used for ADC overload */ + bfValue = 0U; + agcConfigReadBack->agcChangeGainIfThreshHigh = 0U; + recoveryAction = adrv903x_RxFuncs_AgcChangeGainIfUlbthHigh_BfGet(device, NULL, rxFuncsBaseAddr, &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading immediate gain change enable bit for ADC overload"); + goto cleanup; + } + agcConfigReadBack->agcChangeGainIfThreshHigh |= (bfValue & 0x01U); + + /* Bit1 of agcChangeGainIfThreshHigh is used for HB2 peak detector */ + recoveryAction = adrv903x_RxFuncs_AgcChangeGainIfAdcovrgHigh_BfGet(device, NULL, rxFuncsBaseAddr, &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading immediate gain change enable bit for Hb2 overload"); + goto cleanup; + } + agcConfigReadBack->agcChangeGainIfThreshHigh |= ((bfValue & 0x01U) << 1U); + + recoveryAction = adrv903x_RxFuncs_AgcPeakThresholdGainControlMode_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeakThreshGainControlMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading peak threshold gain control mode"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcResetOnRxon_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcResetOnRxon); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading reset on rx on bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcSlowLoopSettlingDelay_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcSlowLoopSettlingDelay); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading slow loop settling delay field"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcAdcResetGainStep_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcAdcResetGainStep); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading agc reset gain step field"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUrangeInterval0_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2UnderRangeLowInterval); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading hb2 urange low interval"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUrangeInterval1Mult_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2UnderRangeMidInterval); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading hb2 urange mid interval"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUrangeInterval2Mult_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2UnderRangeHighInterval); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading hb2 urange high interval"); + goto cleanup; + } + + recoveryAction = adrv903x_TdrDpathTop_FlashThresh_BfGet(device, + NULL, + rxAnalogChannelIBitfieldAddr, + &agcConfigReadBack->agcPeak.adcOvldLowThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading ADC overload low threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUlbThresholdExceededCounter_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.adcOvldUpperThreshPeakExceededCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading ADC overload high threshold counter"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLlbThresholdExceededCounter_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.adcOvldLowerThreshPeakExceededCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading ADC overload low threshold counter"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUlbGainStep_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.adcOvldGainStepAttack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading ADC overload high gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLlbGainStep_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.adcOvldGainStepRecovery); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading ADC overload low gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxHb2OverloadCfgGet(device, + rxChannel, + &agcConfigReadBack->agcPeak.enableHb2Overload, + &agcConfigReadBack->agcPeak.hb2OverloadSignalSelection, + &agcConfigReadBack->agcPeak.hb2OverloadPowerMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 config"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_PeakWindowSizeAgc_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2OverloadDurationCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 second stage peak window"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_PeakSampleCountAgc_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2OverloadThreshCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 second stage peak threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_OverloadThAgcHigh_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2HighThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading writing HB2 high threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_OverloadThAgcInt0Low_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2UnderRangeLowThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 underrange low threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_OverloadThAgcInt1Low_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2UnderRangeMidThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 underrange mid threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_OverloadThAgcLow_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2UnderRangeHighThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 underrange high threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcAdcHighOvrgExceededCounter_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2UpperThreshPeakExceededCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 high threshold counter"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcAdcLowOvrgExceededCounter_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2UnderRangeHighThreshExceededCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 underrange high threshold counter"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcOvrgLowGainStep_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2GainStepHighRecovery); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 underrange high threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcOvrgLowInt0GainStep_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2GainStepLowRecovery); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 underrange low threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcOvrgLowInt1GainStep_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2GainStepMidRecovery); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 underrange mid threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcOvrgHighGainStep_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2GainStepAttack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 high threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcAdcovrgLowInt1Counter_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2UnderRangeMidThreshExceededCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 underrange mid threshold counter"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcAdcovrgLowInt0Counter_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPeak.hb2UnderRangeLowThreshExceededCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading HB2 underrange low threshold counter"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_RxDecimatedPowerCfgGet(device, rxChannel, ADI_ADRV903X_DEC_POWER_MAIN_PATH_MEAS_BLOCK, &rxDecPowerCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading decimated power configuration"); + goto cleanup; + } + + if (rxDecPowerCfg.decPowerControl == ADI_ADRV903X_DEC_POWER_AGC_MEAS) + { + agcConfigReadBack->agcPower.powerEnableMeasurement = 1U; + } + else + { + agcConfigReadBack->agcPower.powerEnableMeasurement = 0U; + } + + agcConfigReadBack->agcPower.powerInputSelect = rxDecPowerCfg.powerInputSelect; + agcConfigReadBack->agcPower.powerMeasurementDuration = rxDecPowerCfg.powerMeasurementDuration; + + recoveryAction = adrv903x_RxFuncs_AgcLower0Threshold_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPower.underRangeHighPowerThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dec power underrange high threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLower1Threshold_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPower.underRangeLowPowerThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dec power underrange low threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLower0ThresholdExceededGainStep_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPower.underRangeHighPowerGainStepRecovery); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dec power underrange high threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLower1ThresholdExceededGainStep_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPower.underRangeLowPowerGainStepRecovery); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dec power underrange low threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcLockLevel_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPower.overRangeLowPowerThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dec power overrange low threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUpper1Threshold_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPower.overRangeHighPowerThresh); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dec power overrange high threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUpper1ThresholdExceededGainStep_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPower.overRangeHighPowerGainStepAttack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dec power overrange high threshold gain step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcUpper0ThresholdExceededGainStep_BfGet(device, NULL, rxFuncsBaseAddr, &agcConfigReadBack->agcPower.overRangeLowPowerGainStepAttack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dec power overrange low threshold gain step"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcFreezeSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint32_t freezeEnable) + { + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + if ((rxChannelMask > (uint32_t) ADI_ADRV903X_RX_MASK_ALL) || (rxChannelMask == (uint32_t) ADI_ADRV903X_RXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannelMask, + "Invalid Rx channel is selected. Valid values are any combinations of Rx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_RX_ONLY; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(rxChannelMask, chanSel) == 0) + { + /* Do nothing to this channel. */ + continue; + } + + recoveryAction = adrv903x_RxFuncs_AgcSlowloopFreezeEnable_BfSet(device, + NULL, + rxChanIdToRxFuncsChanAddr[chanIdx], + ADRV903X_BF_EQUAL(freezeEnable, chanSel) ? 1U : 0U); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting slow loop freeze enable bitfield"); + goto cleanup; + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); + + } + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcFreezeGet(adi_adrv903x_Device_t* const device, + uint32_t* const freezeEnable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t chanIdx = 0U; + uint8_t bfVal = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, freezeEnable, cleanup); + *freezeEnable = 0U; + + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_RX_ONLY; ++chanIdx) + { + recoveryAction = adrv903x_RxFuncs_AgcSlowloopFreezeEnable_BfGet(device, NULL, rxChanIdToRxFuncsChanAddr[chanIdx], &bfVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting bitfield"); + goto cleanup; + } + + *freezeEnable |= (bfVal << chanIdx); + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); + +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcFreezeOnGpioSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannels, + const adi_adrv903x_GpioPinSel_e gpioPin, + const uint8_t enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_GpioPinSel_e gpioPinToSet = gpioPin; + adi_adrv903x_Channels_e rxChan = ADI_ADRV903X_CH0; + uint8_t i = 0; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + if ((rxChannels > (uint32_t) ADI_ADRV903X_RX_MASK_ALL) || (rxChannels == (uint32_t) ADI_ADRV903X_RXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannels, + "Invalid Rx channel is selected. Valid values are any combinations of Rx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + if (enable != ADI_ENABLE && enable != ADI_DISABLE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + enable, + "Enable must be ADI_ENABLE or ADI_DISABLE"); + goto cleanup; + } + + if (enable == ADI_ENABLE) + { + if ((gpioPinToSet < ADI_ADRV903X_GPIO_01) || (gpioPinToSet >= ADI_ADRV903X_GPIO_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + gpioPinToSet, + "Invalid GPIO pin. Note ADI_ADRV903X_GPIO_00 cannot be used to control AGC loop"); + goto cleanup; + } + + recoveryAction = adrv903x_GpioSignalSet(device, + gpioPinToSet, + ADI_ADRV903X_GPIO_SIGNAL_AGC_SLOWLOOP_FREEZE_ENABLE, + rxChannels); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_GpioSignalSet failed for AGC freeze GPIO"); + goto cleanup; + } + } + else if (enable == ADI_DISABLE) + { + /* To disable Freeze-on-GPIO we need to query for the currently configured GPIO on a channel by channel basis */ + for (i = 0; i < ADI_ADRV903X_MAX_CHANNELS; i++) + { + rxChan = (adi_adrv903x_Channels_e) (1 << i); + if ((rxChan & rxChannels) == 0) + { + /* Channel not in rxChannels. Skip it. */ + continue; + } + + /* Find the currently configured GPIO for AGC-freeze this rxChan */ + recoveryAction = adrv903x_GpioSignalFind(device, + &gpioPinToSet, + ADI_ADRV903X_GPIO_SIGNAL_AGC_SLOWLOOP_FREEZE_ENABLE, + rxChan); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Failed to find GPIO_SIGNAL_AGC_SLOWLOOP_FREEZE_ENABLE for Rx channel"); + goto cleanup; + } + + if (gpioPinToSet == ADI_ADRV903X_GPIO_INVALID) + { + /* Channel already has AGC-freeze-on-GPIO disabled. Skip it. */ + continue; + } + + recoveryAction = adrv903x_GpioSignalRelease(device, + gpioPinToSet, + ADI_ADRV903X_GPIO_SIGNAL_AGC_SLOWLOOP_FREEZE_ENABLE, + rxChannels); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Failed to release GPIO_SIGNAL_AGC_SLOWLOOP_FREEZE_ENABLE signal"); + goto cleanup; + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcFreezeOnGpioGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_GpioPinSel_e* const gpioPin) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gpioPin, cleanup); + *gpioPin = ADI_ADRV903X_GPIO_INVALID; + + if ((rxChannel != (uint32_t)ADI_ADRV903X_RX0) && + (rxChannel != (uint32_t)ADI_ADRV903X_RX1) && + (rxChannel != (uint32_t)ADI_ADRV903X_RX2) && + (rxChannel != (uint32_t)ADI_ADRV903X_RX3) && + (rxChannel != (uint32_t)ADI_ADRV903X_RX4) && + (rxChannel != (uint32_t)ADI_ADRV903X_RX5) && + (rxChannel != (uint32_t)ADI_ADRV903X_RX6) && + (rxChannel != (uint32_t)ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannel, + "Invalid Rx channel is selected. Valid values are Rx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + recoveryAction = adrv903x_GpioSignalFind(device, + gpioPin, + ADI_ADRV903X_GPIO_SIGNAL_AGC_SLOWLOOP_FREEZE_ENABLE, + (adi_adrv903x_Channels_e) rxChannel); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + *gpioPin = ADI_ADRV903X_GPIO_INVALID; + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Failed to find GPIO for AGC_SLOWLOOP_FREEZE_ENABLE for Rx channel"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcReset(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + if (((rxChannelMask & (~(uint32_t)ADI_ADRV903X_RX_MASK_ALL)) != 0U) || (rxChannelMask == (uint32_t)ADI_ADRV903X_RXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannelMask, + "Invalid Rx channel is selected. Valid values are any combinations of Rx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_RX_ONLY; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(rxChannelMask, chanSel)) + { + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, (adi_adrv903x_RxChannels_e)(chanSel), &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Invalid Rx Channel used to determine rx func address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcResetCounters_BfSet(device, NULL, rxFuncsBaseAddr, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting AGC reset counters bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcResetCounters_BfSet(device, NULL, rxFuncsBaseAddr, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while clearing AGC reset counters bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcSoftReset_BfSet(device, NULL, rxFuncsBaseAddr, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting AGC soft reset bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcSoftReset_BfSet(device, NULL, rxFuncsBaseAddr, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while clearing AGC soft reset bit"); + goto cleanup; + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxDualBandLnaGainTableWrite(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint8_t gainIndexOffset, + const adi_adrv903x_RxDualBandLnaGainTableRow_t gainTableRow[], + const uint32_t arraySize) +{ + static const uint8_t MAX_GAIN_INDEX_OFFSET = 3U; + static const uint8_t MAX_ARRAY_SIZE = 4U; + static const uint32_t NUM_BYTES_PER_GAIN_ROW = 8U; + static const uint32_t WRITE_MASK = 0x0FF00000U; /* Bit 27:20 needs to be written */ + static const uint32_t WRITE_SHIFT = 20U; /* Bit 27:20 needs to be written */ + static const uint8_t MAX_GAIN_CONTROL_WORD = 3U; + static const uint8_t MAX_GAIN_COMPENSATION_VALUE = 63U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + uint8_t baseIndex = 0U; + uint8_t i = 0U; + uint8_t rowCounter = 0U; + uint32_t dualBandRowValue = 0U; + uint32_t addressToWrite = 0U; + uint32_t registerReadVal = 0U; + uint32_t registerWriteVal = 0U; + + const uint32_t rxGainTableBaseAddr[] = + { + ADI_ADRV903X_RX0_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX1_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX2_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX3_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX4_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX5_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX6_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX7_GAIN_TABLE_BASEADDR + }; + + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gainTableRow, cleanup); + + if (((rxChannelMask & (~(uint32_t)ADI_ADRV903X_RX_MASK_ALL)) != 0U) || (rxChannelMask == (uint32_t)ADI_ADRV903X_RXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannelMask, + "Invalid Rx channel is selected. Valid values are any combinations of Rx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + if (gainIndexOffset > MAX_GAIN_INDEX_OFFSET) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + gainIndexOffset, + "Gain index offset cannot be bigger than 3"); + goto cleanup; + } + + if (arraySize > MAX_ARRAY_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + arraySize, + "Array size cannot be bigger than 4"); + goto cleanup; + } + + if (arraySize > (gainIndexOffset + 1U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + arraySize, + "Array size cannot be bigger than offset + 1"); + goto cleanup; + } + + baseIndex = (gainIndexOffset - (arraySize - 1U)); + rowCounter = 0U; + + for (i = baseIndex; i <= gainIndexOffset; ++i) + { + if (gainTableRow[rowCounter].externalControlWord > MAX_GAIN_CONTROL_WORD) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + gainTableRow[rowCounter].externalControlWord, + "Gain ctrl word cannot be greater than 3"); + goto cleanup; + } + + if (gainTableRow[rowCounter].gainCompensation > MAX_GAIN_COMPENSATION_VALUE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + gainTableRow[rowCounter].gainCompensation, + "Gain compensation value cannot be greater than 63"); + goto cleanup; + } + + dualBandRowValue = ((uint32_t)gainTableRow[rowCounter].externalControlWord & 0x03U) | (((uint32_t)gainTableRow[rowCounter].gainCompensation & 0x3FU) << 0x02U); + dualBandRowValue <<= WRITE_SHIFT; + + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_RX_ONLY; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(rxChannelMask, chanSel)) + { + /* Perform a manual read modify write, since this register map is 32b only */ + addressToWrite = rxGainTableBaseAddr[chanIdx] + ((uint32_t)i * NUM_BYTES_PER_GAIN_ROW); + recoveryAction = adi_adrv903x_Register32Read(device, + NULL, + addressToWrite, + ®isterReadVal, + 0xFFFFFFFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while reading gain row"); + goto cleanup; + } + + registerWriteVal = (registerReadVal & (~WRITE_MASK)) | dualBandRowValue; + recoveryAction = adi_adrv903x_Register32Write(device, + NULL, + addressToWrite, + registerWriteVal, + 0xFFFFFFFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while writing dual band gain row"); + goto cleanup; + } + } + } + + rowCounter++; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxDualBandLnaGainTableRead(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint8_t gainIndexOffset, + adi_adrv903x_RxDualBandLnaGainTableRow_t gainTableRow[], + const uint32_t arraySize, + uint8_t* const numGainIndicesRead) +{ + static const uint8_t MAX_GAIN_INDEX_OFFSET = 3U; + static const uint8_t MAX_ARRAY_SIZE = 4U; + static const uint32_t NUM_BYTES_PER_GAIN_ROW = 8U; + static const uint32_t READ_MASK = 0x0FF00000U; /* Bit 27:20 needs to be read */ + static const uint32_t READ_SHIFT = 20U; /* Bit 27:20 needs to be read */ + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t chanIdx = 0U; + uint8_t baseIndex = 0U; + uint8_t i = 0U; + uint8_t rowCounter = 0U; + uint32_t dualBandRowValue = 0U; + uint32_t addressToRead = 0U; + const uint32_t rxGainTableBaseAddr[] = + { + ADI_ADRV903X_RX0_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX1_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX2_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX3_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX4_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX5_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX6_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX7_GAIN_TABLE_BASEADDR + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gainTableRow, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, numGainIndicesRead, cleanup); + + if ((rxChannelMask != (uint32_t)ADI_ADRV903X_RX0) && + (rxChannelMask != (uint32_t)ADI_ADRV903X_RX1) && + (rxChannelMask != (uint32_t)ADI_ADRV903X_RX2) && + (rxChannelMask != (uint32_t)ADI_ADRV903X_RX3) && + (rxChannelMask != (uint32_t)ADI_ADRV903X_RX4) && + (rxChannelMask != (uint32_t)ADI_ADRV903X_RX5) && + (rxChannelMask != (uint32_t)ADI_ADRV903X_RX6) && + (rxChannelMask != (uint32_t)ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannelMask, + "Invalid Rx channel is selected. Valid values are Rx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + if (gainIndexOffset > MAX_GAIN_INDEX_OFFSET) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + gainIndexOffset, + "Gain index offset cannot be bigger than 3"); + goto cleanup; + } + + if (arraySize > MAX_ARRAY_SIZE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + arraySize, + "Array size cannot be bigger than 4"); + goto cleanup; + } + + if (arraySize > (gainIndexOffset + 1U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + arraySize, + "Array size cannot be bigger than offset + 1"); + goto cleanup; + } + + baseIndex = (gainIndexOffset - (arraySize - 1U)); + rowCounter = 0U; + + chanIdx = adrv903x_RxChannelsToId((adi_adrv903x_RxChannels_e)rxChannelMask); + + for (i = baseIndex; i <= gainIndexOffset; ++i) + { + addressToRead = rxGainTableBaseAddr[chanIdx] + ((uint32_t)i * NUM_BYTES_PER_GAIN_ROW); + recoveryAction = adi_adrv903x_Register32Read(device, + NULL, + addressToRead, + &dualBandRowValue, + 0xFFFFFFFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while reading dual band gain row"); + goto cleanup; + } + + dualBandRowValue &= READ_MASK; + dualBandRowValue >>= READ_SHIFT; + gainTableRow[rowCounter].externalControlWord = (uint8_t)(dualBandRowValue & 0x03U); + gainTableRow[rowCounter].gainCompensation = (uint8_t)((dualBandRowValue >> 0x02U) & 0x3FU); + + rowCounter++; + } + + /*Update no. of gain indices read*/ + if (numGainIndicesRead != NULL) + { + *numGainIndicesRead = rowCounter; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcDualBandCfgSet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_AgcDualBandCfg_t agcDualBandConfig[], + const uint32_t numOfAgcDualBandCfgs) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cfgIdx = 0U; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + adrv903x_BfRxDdcChanAddr_e rxDdcBaseAddrBand0 = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + adrv903x_BfRxDdcChanAddr_e rxDdcBaseAddrBand1 = ADRV903X_BF_SLICE_RX_0__RX_DDC_1_; + adi_adrv903x_RxDecimatedPowerCfg_t rxDecPowerCfg; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, agcDualBandConfig, cleanup); + + ADI_LIBRARY_MEMSET(&rxDecPowerCfg, 0, sizeof(adi_adrv903x_RxDecimatedPowerCfg_t)); + + if (numOfAgcDualBandCfgs == 0U) + { + /* no valid configs */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numOfAgcDualBandCfgs, "Invalid Number of AGC Dual Band Configurations"); + goto cleanup; + } + + /* Loop through the number of configurations and perform range checks */ + for (cfgIdx = 0U; cfgIdx < numOfAgcDualBandCfgs; ++cfgIdx) + { + recoveryAction = adrv903x_AgcDualBandCfgRangeCheck(device, &agcDualBandConfig[cfgIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AGC Dual Band Range Check Error Reported"); + goto cleanup; + } + } + + /* Write out the configurations */ + for (cfgIdx = 0U; cfgIdx < numOfAgcDualBandCfgs; ++cfgIdx) + { + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_RX_ONLY; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(agcDualBandConfig[cfgIdx].rxChannelMask, chanSel)) + { + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, (adi_adrv903x_RxChannels_e)(chanSel), &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Rx funcs address get issue"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdcBitfieldAddressGet(device, + (adi_adrv903x_RxChannels_e)chanSel, + ADI_ADRV903X_RX_DDC_BAND0, + &rxDdcBaseAddrBand0); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanSel, "Invalid Rx Channel used to determine rx ddc0 address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdcBitfieldAddressGet(device, + (adi_adrv903x_RxChannels_e)chanSel, + ADI_ADRV903X_RX_DDC_BAND1, + &rxDdcBaseAddrBand1); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanSel, "Invalid Rx Channel used to determine rx ddc1 address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandExtTableUpperIndex_BfSet(device, NULL, rxFuncsBaseAddr, agcDualBandConfig[cfgIdx].agcRxDualbandExtTableUpperIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dual band ext table upper index"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandExtTableLowerIndex_BfSet(device, NULL, rxFuncsBaseAddr, agcDualBandConfig[cfgIdx].agcRxDualbandExtTableLowerIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dual band ext table lower index"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandPwrMargin_BfSet(device, NULL, rxFuncsBaseAddr, agcDualBandConfig[cfgIdx].agcDualbandPwrMargin); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dual band power margin"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandLnaStep_BfSet(device, NULL, rxFuncsBaseAddr, agcDualBandConfig[cfgIdx].agcDualbandLnaStep); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dual band lna step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandHighLnaThreshold_BfSet(device, NULL, rxFuncsBaseAddr, agcDualBandConfig[cfgIdx].agcDualbandHighLnaThreshold); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dual band high lna threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandLowLnaThreshold_BfSet(device, NULL, rxFuncsBaseAddr, agcDualBandConfig[cfgIdx].agcDualbandLowLnaThreshold); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dual band low lna threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandMaxIndex_BfSet(device, NULL, rxFuncsBaseAddr, agcDualBandConfig[cfgIdx].agcDualBandMaxGainIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dual band max gain index"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_GainCompForExtGain_BfSet(device, NULL, rxDdcBaseAddrBand0, agcDualBandConfig[cfgIdx].enableGainCompensationForExtLna); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write gain compensation enable bit for ext lna"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_GainCompForExtGain_BfSet(device, NULL, rxDdcBaseAddrBand1, agcDualBandConfig[cfgIdx].enableGainCompensationForExtLna); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write gain compensation enable bit for ext lna"); + goto cleanup; + } + + if (agcDualBandConfig[cfgIdx].agcDualBandEnable == 1U) + { + rxDecPowerCfg.decPowerControl = ADI_ADRV903X_DEC_POWER_AGC_MEAS; + rxDecPowerCfg.measBlockSelectMask = (uint8_t)(ADI_ADRV903X_DEC_POWER_BAND_A_MEAS_BLOCK | ADI_ADRV903X_DEC_POWER_BAND_B_MEAS_BLOCK); + rxDecPowerCfg.powerInputSelect = 0; /* This field is 'Don't Care' when configuring Band decimated power measurements */ + rxDecPowerCfg.powerMeasurementDuration = agcDualBandConfig[cfgIdx].decPowerDdcMeasurementDuration; + rxDecPowerCfg.rxChannelMask = chanSel; + + recoveryAction = adi_adrv903x_RxDecimatedPowerCfgSet(device, &rxDecPowerCfg, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing decimated power configuration"); + goto cleanup; + } + } + else + { + recoveryAction = adi_adrv903x_RxDecimatedPowerCfgGet(device, + (adi_adrv903x_RxChannels_e)(chanSel), + ADI_ADRV903X_DEC_POWER_BAND_A_MEAS_BLOCK, + &rxDecPowerCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading Rx decimated power configuration"); + goto cleanup; + } + + if (rxDecPowerCfg.decPowerControl == ADI_ADRV903X_DEC_POWER_AGC_MEAS) + { + /* Main path measurement block is being used for AGC - we should disable it */ + rxDecPowerCfg.decPowerControl = ADI_ADRV903X_DEC_POWER_MEAS_OFF; + rxDecPowerCfg.measBlockSelectMask = (uint8_t)(ADI_ADRV903X_DEC_POWER_BAND_A_MEAS_BLOCK | ADI_ADRV903X_DEC_POWER_BAND_B_MEAS_BLOCK); + rxDecPowerCfg.powerInputSelect = 0; + rxDecPowerCfg.powerMeasurementDuration = 0; + rxDecPowerCfg.rxChannelMask = chanSel; + + recoveryAction = adi_adrv903x_RxDecimatedPowerCfgSet(device, &rxDecPowerCfg, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing Rx decimated power configuration"); + goto cleanup; + } + } + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandEnable_BfSet(device, NULL, rxFuncsBaseAddr, agcDualBandConfig[cfgIdx].agcDualBandEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dual band enable bit"); + goto cleanup; + } + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcDualBandCfgGet(adi_adrv903x_Device_t * const device, + adi_adrv903x_AgcDualBandCfg_t * const agcDualBandConfigReadBack) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + adrv903x_BfRxDdcChanAddr_e rxDdcBaseAddrBand0 = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + adi_adrv903x_RxDecimatedPowerCfg_t rxDecPowerCfg; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, agcDualBandConfigReadBack, cleanup); + + ADI_LIBRARY_MEMSET(&rxDecPowerCfg, 0, sizeof(adi_adrv903x_RxDecimatedPowerCfg_t)); + + if ((agcDualBandConfigReadBack->rxChannelMask != ADI_ADRV903X_RX0) && + (agcDualBandConfigReadBack->rxChannelMask != ADI_ADRV903X_RX1) && + (agcDualBandConfigReadBack->rxChannelMask != ADI_ADRV903X_RX2) && + (agcDualBandConfigReadBack->rxChannelMask != ADI_ADRV903X_RX3) && + (agcDualBandConfigReadBack->rxChannelMask != ADI_ADRV903X_RX4) && + (agcDualBandConfigReadBack->rxChannelMask != ADI_ADRV903X_RX5) && + (agcDualBandConfigReadBack->rxChannelMask != ADI_ADRV903X_RX6) && + (agcDualBandConfigReadBack->rxChannelMask != ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, agcDualBandConfigReadBack->rxChannelMask, "Invalid Rx channel is selected. Valid values are Rx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, (adi_adrv903x_RxChannels_e)agcDualBandConfigReadBack->rxChannelMask, &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, agcDualBandConfigReadBack->rxChannelMask, "Rx funcs address get issue"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdcBitfieldAddressGet(device, + (adi_adrv903x_RxChannels_e)agcDualBandConfigReadBack->rxChannelMask, + ADI_ADRV903X_RX_DDC_BAND0, + &rxDdcBaseAddrBand0); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, agcDualBandConfigReadBack->rxChannelMask, "Invalid Rx Channel used to determine rx ddc0 address"); + goto cleanup; + } + + + recoveryAction = adrv903x_RxFuncs_AgcDualbandExtTableUpperIndex_BfGet(device, NULL, rxFuncsBaseAddr, &agcDualBandConfigReadBack->agcRxDualbandExtTableUpperIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dual band ext table upper index"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandExtTableLowerIndex_BfGet(device, NULL, rxFuncsBaseAddr, &agcDualBandConfigReadBack->agcRxDualbandExtTableLowerIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dual band ext table lower index"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandPwrMargin_BfGet(device, NULL, rxFuncsBaseAddr, &agcDualBandConfigReadBack->agcDualbandPwrMargin); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dual band power margin"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandLnaStep_BfGet(device, NULL, rxFuncsBaseAddr, &agcDualBandConfigReadBack->agcDualbandLnaStep); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dual band lna step"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandHighLnaThreshold_BfGet(device, NULL, rxFuncsBaseAddr, &agcDualBandConfigReadBack->agcDualbandHighLnaThreshold); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dual band high lna threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandLowLnaThreshold_BfGet(device, NULL, rxFuncsBaseAddr, &agcDualBandConfigReadBack->agcDualbandLowLnaThreshold); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dual band low lna threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcDualbandMaxIndex_BfGet(device, NULL, rxFuncsBaseAddr, &agcDualBandConfigReadBack->agcDualBandMaxGainIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dual band max gain index"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_GainCompForExtGain_BfGet(device, NULL, rxDdcBaseAddrBand0, &agcDualBandConfigReadBack->enableGainCompensationForExtLna); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read gain compensation enable bit for ext lna"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_RxDecimatedPowerCfgGet(device, + (adi_adrv903x_RxChannels_e)(agcDualBandConfigReadBack->rxChannelMask), + ADI_ADRV903X_DEC_POWER_BAND_A_MEAS_BLOCK, + &rxDecPowerCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading Rx decimated power configuration"); + goto cleanup; + } + + agcDualBandConfigReadBack->decPowerDdcMeasurementDuration = rxDecPowerCfg.powerMeasurementDuration; + + recoveryAction = adrv903x_RxFuncs_AgcDualbandEnable_BfGet(device, NULL, rxFuncsBaseAddr, &agcDualBandConfigReadBack->agcDualBandEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading dual band enable bit"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); + +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcDualBandGpioCfgSet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_AgcDualBandGpioCfg_t * agcDualBandGpioConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t i = 0U; + uint16_t gpioSelMask = 0U; + adi_adrv903x_GpioSignal_e option1 = ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_0; + adi_adrv903x_GpioSignal_e option2 = ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_0; + adi_adrv903x_GpioAnaPinSel_e gpioAnalogSel = ADI_ADRV903X_GPIO_ANA_00; + adi_adrv903x_GpioSignal_e gpioSignalReadBack = ADI_ADRV903X_GPIO_SIGNAL_UNUSED; + uint32_t channelMaskReadBack = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, agcDualBandGpioConfig, cleanup); + + for (i = 0U; i < ADI_ADRV903X_GPIO_ANALOG_COUNT; ++i) + { + gpioSelMask = 1U << i; + if (ADRV903X_BF_EQUAL(agcDualBandGpioConfig->gpioSelectionMask, gpioSelMask)) + { + switch (i) + { + case 0: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_0; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND0_0; + break; + case 1: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND0_1; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND0_1; + break; + case 2: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND1_0; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND1_0; + break; + case 3: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX0_DUALBAND_CONTROL_BAND1_1; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX2_DUALBAND_CONTROL_BAND1_1; + break; + case 4: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND0_0; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND0_0; + break; + case 5: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND0_1; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND0_1; + break; + case 6: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND1_0; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND1_0; + break; + case 7: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX1_DUALBAND_CONTROL_BAND1_1; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX3_DUALBAND_CONTROL_BAND1_1; + break; + case 8: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND0_0; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND0_0; + break; + case 9: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND0_1; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND0_1; + break; + case 10: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND1_0; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND1_0; + break; + case 11: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX4_DUALBAND_CONTROL_BAND1_1; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX6_DUALBAND_CONTROL_BAND1_1; + break; + case 12: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND0_0; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND0_0; + break; + case 13: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND0_1; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND0_1; + break; + case 14: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND1_0; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND1_0; + break; + case 15: + option1 = ADI_ADRV903X_GPIO_SIGNAL_RX5_DUALBAND_CONTROL_BAND1_1; + option2 = ADI_ADRV903X_GPIO_SIGNAL_RX7_DUALBAND_CONTROL_BAND1_1; + break; + } + + if ((agcDualBandGpioConfig->analogGpioMapping[i] != option1) && + (agcDualBandGpioConfig->analogGpioMapping[i] != option2) && + (agcDualBandGpioConfig->analogGpioMapping[i] != ADI_ADRV903X_GPIO_SIGNAL_UNUSED)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, agcDualBandGpioConfig->analogGpioMapping, "Invalid GPIO selected. Please check the GPIO table given at function documentation"); + goto cleanup; + } + + gpioAnalogSel = (adi_adrv903x_GpioAnaPinSel_e)i; + if (agcDualBandGpioConfig->analogGpioMapping[i] == ADI_ADRV903X_GPIO_SIGNAL_UNUSED) + { + recoveryAction = adrv903x_GpioAnalogSignalGet(device, gpioAnalogSel, &gpioSignalReadBack, &channelMaskReadBack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while retrieving current signal for the selected gpio"); + goto cleanup; + } + + if ((gpioSignalReadBack != option1) && + (gpioSignalReadBack != option2)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GPIO selected to release is being used by other feature"); + goto cleanup; + } + + recoveryAction = adrv903x_GpioAnalogSignalRelease(device, gpioAnalogSel, gpioSignalReadBack, channelMaskReadBack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to release gpio"); + goto cleanup; + } + } + else + { + recoveryAction = adrv903x_GpioAnalogSignalSet(device, gpioAnalogSel, agcDualBandGpioConfig->analogGpioMapping[i], (uint32_t)ADI_ADRV903X_CHOFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to assign selected signal to GPIO"); + goto cleanup; + } + } + } + } + + /* No error, set recovery action to None */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); + +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcDualBandGpioCfgGet(adi_adrv903x_Device_t * const device, + adi_adrv903x_AgcDualBandGpioCfg_t * const agcDualBandGpioConfigReadBack) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t i = 0U; + uint16_t gpioSelMask = 0U; + adi_adrv903x_GpioAnaPinSel_e gpioAnalogSel = ADI_ADRV903X_GPIO_ANA_00; + adi_adrv903x_GpioSignal_e gpioSignalReadBack = ADI_ADRV903X_GPIO_SIGNAL_UNUSED; + uint32_t channelMaskReadBack = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, agcDualBandGpioConfigReadBack, cleanup); + + for (i = 0U; i < ADI_ADRV903X_GPIO_ANALOG_COUNT; ++i) + { + gpioSelMask = 1U << i; + if (ADRV903X_BF_EQUAL(agcDualBandGpioConfigReadBack->gpioSelectionMask, gpioSelMask)) + { + gpioAnalogSel = (adi_adrv903x_GpioAnaPinSel_e)i; + recoveryAction = adrv903x_GpioAnalogSignalGet(device, gpioAnalogSel, &gpioSignalReadBack, &channelMaskReadBack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while retrieving current signal for the selected gpio"); + goto cleanup; + } + + agcDualBandGpioConfigReadBack->analogGpioMapping[i] = gpioSignalReadBack; + } + else + { + agcDualBandGpioConfigReadBack->analogGpioMapping[i] = ADI_ADRV903X_GPIO_SIGNAL_INVALID; + } + } + + /* No error, set recovery action to None */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); + +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcGpioReSyncSet(adi_adrv903x_Device_t * const device, + uint32_t rxChannelMask, + adi_adrv903x_GpioPinSel_e gpioSelection, + uint8_t enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + adi_adrv903x_GpioPinSel_e gpioReadback = ADI_ADRV903X_GPIO_INVALID; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + /*Check that if requested Rx Channel valid*/ + if (((rxChannelMask & (~(uint32_t)ADI_ADRV903X_RX_MASK_ALL)) != 0U) || (rxChannelMask == (uint32_t)ADI_ADRV903X_RXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannelMask, + "Invalid Rx channel is selected. Valid values are any combinations of Rx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + if (enable > ADI_TRUE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + enable, + "enable can be either 0 or 1"); + goto cleanup; + } + + if (gpioSelection == ADI_ADRV903X_GPIO_00) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + enable, + "GPIO0 cannot be used for this feature"); + goto cleanup; + } + + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_RX_ONLY; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(rxChannelMask, chanSel)) + { + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, (adi_adrv903x_RxChannels_e)chanSel, &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannelMask, "Rx funcs address get issue"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcEnableSyncPulseForGainCounter_BfSet(device, NULL, rxFuncsBaseAddr, enable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing AGC re-sync enable bitfield"); + goto cleanup; + } + + if (gpioSelection == ADI_ADRV903X_GPIO_INVALID) + { + /* Release the signal from this Rx channel */ + + recoveryAction = adrv903x_GpioSignalFind(device, + &gpioReadback, + ADI_ADRV903X_GPIO_SIGNAL_AGC_GAIN_CHANGE, + (adi_adrv903x_Channels_e)(chanSel)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read gpio for selected signal"); + goto cleanup; + } + + recoveryAction = adrv903x_GpioSignalRelease(device, + gpioReadback, + ADI_ADRV903X_GPIO_SIGNAL_AGC_GAIN_CHANGE, + chanSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to release gpio"); + goto cleanup; + } + + } + else + { + /* Assign the signal for this channel */ + recoveryAction = adrv903x_GpioSignalSet(device, + gpioSelection, + ADI_ADRV903X_GPIO_SIGNAL_AGC_GAIN_CHANGE, + chanSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to assign selected signal to GPIO"); + goto cleanup; + } + + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcGpioReSyncGet(adi_adrv903x_Device_t * const device, + const uint32_t rxChannelMask, + adi_adrv903x_GpioPinSel_e * const gpioSelection, + uint8_t * const enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gpioSelection, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, enable, cleanup); + + /*Check that if requested Rx Channel valid*/ + if ((rxChannelMask == 0U) || ((rxChannelMask & (rxChannelMask - 1)) != 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannelMask, + "Invalid Rx channel is selected. Valid values are Rx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, (adi_adrv903x_RxChannels_e)rxChannelMask, &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannelMask, "Rx funcs address get issue"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcEnableSyncPulseForGainCounter_BfGet(device, NULL, rxFuncsBaseAddr, enable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading AGC re-sync enable bitfield"); + goto cleanup; + } + + recoveryAction = adrv903x_GpioSignalFind(device, + gpioSelection, + ADI_ADRV903X_GPIO_SIGNAL_AGC_GAIN_CHANGE, + (adi_adrv903x_Channels_e)(rxChannelMask)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read gpio for selected signal"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcDualBandActiveExternalLnaGainWordGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint8_t * const bandAExternalLnaGainWord, + uint8_t * const bandBExternalLnaGainWord) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, bandAExternalLnaGainWord, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, bandBExternalLnaGainWord, cleanup); + + /*Check that if requested Rx Channel valid*/ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + /* Invalid Rx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx channel selection"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, rxChannel, &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Rx funcs address get issue"); + goto cleanup; + } + + /* Set this field to 0, to readback the active gain index */ + recoveryAction = adrv903x_RxFuncs_ReadGainTable_BfSet(device, NULL, rxFuncsBaseAddr, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing read gain table bitfield"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_DualbandControlBandA_BfGet(device, NULL, rxFuncsBaseAddr, bandAExternalLnaGainWord); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading external control word for band A"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_DualbandControlBandB_BfGet(device, NULL, rxFuncsBaseAddr, bandBExternalLnaGainWord); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading external control word for band B"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcUpperLevelBlockerGet(adi_adrv903x_Device_t * const device, + uint8_t * const agcULBlockerBitMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + static const adrv903x_BfRxFuncsChanAddr_e rxChannelFuncs[] = { + ADRV903X_BF_SLICE_RX_0__RX_FUNCS, + ADRV903X_BF_SLICE_RX_1__RX_FUNCS, + ADRV903X_BF_SLICE_RX_2__RX_FUNCS, + ADRV903X_BF_SLICE_RX_3__RX_FUNCS, + ADRV903X_BF_SLICE_RX_4__RX_FUNCS, + ADRV903X_BF_SLICE_RX_5__RX_FUNCS, + ADRV903X_BF_SLICE_RX_6__RX_FUNCS, + ADRV903X_BF_SLICE_RX_7__RX_FUNCS + }; + + uint8_t channelBitFieldVal = 0U; + uint8_t channelId = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, agcULBlockerBitMask, cleanup); + + /* clear return byte before readings */ + *agcULBlockerBitMask = 0U; + + for (channelId = 0U; channelId < ADI_ADRV903X_MAX_RX_ONLY; channelId++) + { + recoveryAction = adrv903x_RxFuncs_AgcUlBlocker_BfGet(device, NULL, rxChannelFuncs[channelId], &channelBitFieldVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading agc upper level blocker bitfield"); + goto cleanup; + } + + *agcULBlockerBitMask = *agcULBlockerBitMask | (channelBitFieldVal << channelId); + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcLowerLevelBlockerGet(adi_adrv903x_Device_t * const device, + uint8_t * const agcLLBlockerBitMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + static const adrv903x_BfRxFuncsChanAddr_e rxChannelFuncs[] = { + ADRV903X_BF_SLICE_RX_0__RX_FUNCS, + ADRV903X_BF_SLICE_RX_1__RX_FUNCS, + ADRV903X_BF_SLICE_RX_2__RX_FUNCS, + ADRV903X_BF_SLICE_RX_3__RX_FUNCS, + ADRV903X_BF_SLICE_RX_4__RX_FUNCS, + ADRV903X_BF_SLICE_RX_5__RX_FUNCS, + ADRV903X_BF_SLICE_RX_6__RX_FUNCS, + ADRV903X_BF_SLICE_RX_7__RX_FUNCS + }; + + uint8_t channelBitFieldVal = 0U; + uint8_t channelId = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, agcLLBlockerBitMask, cleanup); + + /* clear return byte before readings */ + *agcLLBlockerBitMask = 0U; + + for (channelId = 0U; channelId < ADI_ADRV903X_MAX_RX_ONLY; channelId++) + { + recoveryAction = adrv903x_RxFuncs_AgcLlBlocker_BfGet(device, NULL, rxChannelFuncs[channelId], &channelBitFieldVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading agc lower level blocker bitfield"); + goto cleanup; + } + + *agcLLBlockerBitMask = *agcLLBlockerBitMask | (channelBitFieldVal << channelId); + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcHighThresholdPeakDetectorGet(adi_adrv903x_Device_t * const device, + uint8_t * const thresholdPeakDetectorBitMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + static const adrv903x_BfRxFuncsChanAddr_e rxChannelFuncs[] = { + ADRV903X_BF_SLICE_RX_0__RX_FUNCS, + ADRV903X_BF_SLICE_RX_1__RX_FUNCS, + ADRV903X_BF_SLICE_RX_2__RX_FUNCS, + ADRV903X_BF_SLICE_RX_3__RX_FUNCS, + ADRV903X_BF_SLICE_RX_4__RX_FUNCS, + ADRV903X_BF_SLICE_RX_5__RX_FUNCS, + ADRV903X_BF_SLICE_RX_6__RX_FUNCS, + ADRV903X_BF_SLICE_RX_7__RX_FUNCS + }; + + uint8_t channelBitFieldVal = 0U; + uint8_t channelId = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, thresholdPeakDetectorBitMask, cleanup); + + /* clear return byte before readings */ + *thresholdPeakDetectorBitMask = 0U; + + for (channelId = 0U; channelId < ADI_ADRV903X_MAX_RX_ONLY; channelId++) + { + recoveryAction = adrv903x_RxFuncs_AgcAdcovrgHigh_BfGet(device, NULL, rxChannelFuncs[channelId], &channelBitFieldVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading agc high threshold peak detector exceeded bitfield"); + goto cleanup; + } + + *thresholdPeakDetectorBitMask = *thresholdPeakDetectorBitMask | (channelBitFieldVal << channelId); + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AgcLowThresholdPeakDetectorGet(adi_adrv903x_Device_t * const device, + uint8_t * const thresholdPeakDetectorBitMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + static const adrv903x_BfRxFuncsChanAddr_e rxChannelFuncs[] = { + ADRV903X_BF_SLICE_RX_0__RX_FUNCS, + ADRV903X_BF_SLICE_RX_1__RX_FUNCS, + ADRV903X_BF_SLICE_RX_2__RX_FUNCS, + ADRV903X_BF_SLICE_RX_3__RX_FUNCS, + ADRV903X_BF_SLICE_RX_4__RX_FUNCS, + ADRV903X_BF_SLICE_RX_5__RX_FUNCS, + ADRV903X_BF_SLICE_RX_6__RX_FUNCS, + ADRV903X_BF_SLICE_RX_7__RX_FUNCS + }; + + uint8_t channelBitFieldVal = 0U; + uint8_t channelId = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, thresholdPeakDetectorBitMask, cleanup); + + /* clear return byte before readings */ + *thresholdPeakDetectorBitMask = 0U; + + for (channelId = 0U; channelId < ADI_ADRV903X_MAX_RX_ONLY; channelId++) + { + recoveryAction = adrv903x_RxFuncs_AgcAdcovrgLow_BfGet(device, NULL, rxChannelFuncs[channelId], &channelBitFieldVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading agc upper level blocker bitfield"); + goto cleanup; + } + + *thresholdPeakDetectorBitMask = *thresholdPeakDetectorBitMask | (channelBitFieldVal << channelId); + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} \ No newline at end of file diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_cals.c b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_cals.c new file mode 100644 index 0000000000000..7425c1e433d1b --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_cals.c @@ -0,0 +1,1791 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_cals.c +* \brief Contains Calibration features related function implementation defined in +* adi_adrv903x_cals.h +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#include "adi_adrv903x_cals.h" +#include "adi_adrv903x_error.h" +#include "adi_adrv903x_cpu.h" + +#include "../../private/bf/adrv903x_bf_rx_funcs.h" +#include "../../private/include/adrv903x_rx.h" +#include "../../private/include/adrv903x_cpu.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PUBLIC_CALS + +/*****************************************************************************/ +/***** Helper functions' definition ******************************************/ +/*****************************************************************************/ +static adi_adrv903x_ErrAction_e adrv903x_CalStatusGet(adi_adrv903x_Device_t* const device, + const adrv903x_CpuObjectId_e objId, + const adi_adrv903x_Channels_e channel, + adi_adrv903x_CalStatus_t* const status); + +static adi_adrv903x_ErrAction_e adrv903x_SendCalStatusCmd(adi_adrv903x_Device_t* const device, + const adrv903x_CpuCmd_CalStatusType_e type, + const adrv903x_CpuObjectId_e calObjId, + const adi_adrv903x_Channels_e channel); + +static adi_adrv903x_ErrAction_e adrv903x_GetCalStatusCmdResp(adi_adrv903x_Device_t* const device, + const adrv903x_CpuObjectId_e objId, + const adi_adrv903x_Channels_e channel, + const size_t calStatusSize, + void* const pRxBuf, + const void** const pCalStatus); + +static adrv903x_CpuObjectId_e adrv903x_InitCalToObjId(const adi_adrv903x_InitCalibrations_e calId); + +static adrv903x_CpuObjectId_e adrv903x_TrackingCalToObjId(const adi_adrv903x_TrackingCalibrationMask_e calId); + +static uint32_t adrv903x_ChanMaskToNum(const adi_adrv903x_Channels_e mask); + +static uint32_t adrv903x_GetBitPosition(const uint32_t mask); + +static adi_adrv903x_ErrAction_e adrv903x_VerifyChannel(const adi_adrv903x_Channels_e channel); + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsRun(adi_adrv903x_Device_t* const device, + const adi_adrv903x_InitCals_t* const initCals) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_RunInit_t runInitCmd; + adrv903x_CpuCmd_RunInitResp_t runInitCmdRsp; + uint32_t cpuTypeIdx = 0U; + adi_adrv903x_InitCalibrations_t validCalMask = ADI_ADRV903X_IC_ALL_CALS; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_CpuErrorCode_t cpuErrorCode = 0U; + + + validCalMask |= ADI_ADRV903X_IC_RXSPUR; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, initCals, cleanup); + ADI_LIBRARY_MEMSET(&runInitCmd, 0, sizeof(adrv903x_CpuCmd_RunInit_t)); + ADI_LIBRARY_MEMSET(&runInitCmdRsp, 0, sizeof(adrv903x_CpuCmd_RunInitResp_t)); + + if (initCals->calMask == 0U) + { + /* Don't report an error as this is a valid value. Nothing to do since the calMask is 0 so return. */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + goto cleanup; + } + + if ((initCals->calMask & ~validCalMask) != 0U) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid calMask provided."); + goto cleanup; + } + + if ((initCals->rxChannelMask == 0U) && (initCals->txChannelMask == 0U) && (initCals->orxChannelMask == 0U)) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "At least one channel mask must be non-zero."); + goto cleanup; + } + + if ((initCals->rxChannelMask & ~0xFFU) != 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, initCals->rxChannelMask, "Invalid rxChannelMask provided."); + goto cleanup; + } + + if ((initCals->txChannelMask & ~0xFFU) != 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, initCals->txChannelMask, "Invalid txChannelMask provided."); + goto cleanup; + } + + if ((initCals->orxChannelMask & ~0x3U) != 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, initCals->orxChannelMask, "Invalid orxChannelMask provided."); + goto cleanup; + } + + /* Fill out run init cmd params with user-provided params */ + runInitCmd.config.calMask = ADRV903X_HTOCLL(initCals->calMask); + runInitCmd.config.rxChannelMask = ADRV903X_HTOCL(initCals->rxChannelMask); + runInitCmd.config.txChannelMask = ADRV903X_HTOCL(initCals->txChannelMask); + runInitCmd.config.orxChannelMask = ADRV903X_HTOCL(initCals->orxChannelMask); + + runInitCmd.config.warmBoot = initCals->warmBoot; + + + runInitCmd.config.warmBoot = (initCals->warmBoot & (~ADI_ADRV903X_JRXREPAIR_INIT_ALL)); + + if ((device->devStateInfo.devState & ADI_ADRV903X_STATE_STANDBY) == ADI_ADRV903X_STATE_STANDBY) + { + /* Serdes Initcal required for jesd link bring up */ + runInitCmd.config.calMask = ADRV903X_HTOCLL(initCals->calMask & + (ADI_ADRV903X_IC_SERDES | + ADI_ADRV903X_IC_ADC_RX | /* Run RX ADC */ + ADI_ADRV903X_IC_ADC_ORX)); /* Run ORX ADC */ + + /* Skip initcals during Standby Recover sequence */ + if (runInitCmd.config.calMask == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + goto cleanup; + } + } + + /* For each CPU, send the run init command, wait for a response, and process any errors. */ + for (cpuTypeIdx = 0U; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_RUN_INIT, + (void*)&runInitCmd, + sizeof(runInitCmd), + (void*)&runInitCmdRsp, + sizeof(runInitCmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(runInitCmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + } + + device->devStateInfo.devState = (adi_adrv903x_ApiStates_e)(device->devStateInfo.devState | ADI_ADRV903X_STATE_INITCALS_RUN); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsDetailedStatusGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_InitCalStatus_t* const initStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_RunInitGetDetailedStatusResp_t runInitStatusRsp = { { { 0U }, { 0U }, 0U, { 0U }, { 0U } } }; + uint32_t i = 0U; + uint32_t cpuTypeIdx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, initStatus, cleanup); + ADI_LIBRARY_MEMSET(initStatus, 0, sizeof(adi_adrv903x_InitCalStatus_t)); + + /* For each CPU send the run init detailed status cmd and process the response */ + for (cpuTypeIdx = (uint32_t) ADI_ADRV903X_CPU_TYPE_0; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_RUN_INIT_GET_DETAILED_STATUS, + NULL, + 0U, + (void*)&runInitStatusRsp, + sizeof(runInitStatusRsp), + NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_CMD_RESPONSE, + ADI_NO_VARIABLE, + recoveryAction); + goto cleanup; + } + + /* Merge the CPU-specific response into the initStatus structure */ + + /* Calibration duration is MAX(CPU0_duration, CPU1_duration). Select the longest duration here. */ + if (initStatus->calsDurationMsec < ADRV903X_CTOHL(runInitStatusRsp.status.calsDurationMsec)) + { + initStatus->calsDurationMsec = ADRV903X_CTOHL(runInitStatusRsp.status.calsDurationMsec); + } + + /* Go through each channel-specific status item in the response */ + for (i = 0U; i < ADI_ADRV903X_NUM_INIT_CAL_CHANNELS; ++i) + { + /* For channel-specific errors, we can only set one error code. If there are multiple + * errors on this channel, we simply choose the first CPU's error. */ + if (initStatus->initErrCodes[i] == ADRV903X_CPU_NO_ERROR) + { + initStatus->initErrCodes[i] = ADRV903X_CTOHL(runInitStatusRsp.status.initErrCodes[i]); + } + + /* Setup the channel-specific cal mask items. + * Since these are channel masks, it is safe to simply + * OR in the results from each CPU (a CPU that does not run a + * particular cal will have a value of 0 here). */ + initStatus->initErrCals[i] |= ADRV903X_CTOHLL(runInitStatusRsp.status.initErrCals[i]); + initStatus->calsSincePowerUp[i] |= ADRV903X_CTOHLL(runInitStatusRsp.status.calsSincePowerUp[i]); + initStatus->calsLastRun[i] |= ADRV903X_CTOHLL(runInitStatusRsp.status.calsLastRun[i]); + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsDetailedStatusGet_v2( adi_adrv903x_Device_t* const device, + adi_adrv903x_InitCalErrData_t* const initCalErrData) +{ + adi_adrv903x_ErrAction_e apiRecoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_ErrAction_e calRecoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_RunInitGetDetailedStatusResp_t runInitStatusRsp = { { { 0U }, { 0U }, 0U, { 0U }, { 0U } } }; + adi_adrv903x_InitCalStatus_t initCalStatus; + adi_adrv903x_ErrorInfo_t error = { 0, NULL, NULL, ADI_ADRV903X_ERR_ACT_NONE, NULL }; + uint32_t idx = 0U; + uint32_t cpuTypeIdx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, initCalErrData, cleanup); + + ADI_LIBRARY_MEMSET(initCalErrData, 0, sizeof(adi_adrv903x_InitCalErrData_t)); + + ADI_LIBRARY_MEMSET(&initCalStatus, 0, sizeof(adi_adrv903x_InitCalStatus_t)); + + /* For each CPU send the run init detailed status cmd and process the response */ + for (cpuTypeIdx = (uint32_t) ADI_ADRV903X_CPU_TYPE_0; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + apiRecoveryAction = adrv903x_CpuCmdSend(device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_RUN_INIT_GET_DETAILED_STATUS, + NULL, + 0U, + (void*)&runInitStatusRsp, + sizeof(runInitStatusRsp), + NULL); + if (apiRecoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_CMD_RESPONSE, + ADI_NO_VARIABLE, + apiRecoveryAction); + goto cleanup; + } + + /* Merge the CPU-specific response into the initStatus structure */ + + /* Go through each channel-specific status item in the response */ + for (idx = 0U; idx < ADI_ADRV903X_NUM_INIT_CAL_CHANNELS; ++idx) + { + /* For channel-specific errors, we can only set one error code. If there are multiple + * errors on this channel, we simply choose the first CPU's error. */ + if (initCalStatus.initErrCodes[idx] == ADRV903X_CPU_NO_ERROR) + { + initCalStatus.initErrCodes[idx] = ADRV903X_CTOHL(runInitStatusRsp.status.initErrCodes[idx]); + } + + /* Setup the channel-specific cal mask items. + * Since these are channel masks, it is safe to simply + * OR in the results from each CPU (a CPU that does not run a + * particular cal will have a value of 0 here). */ + initCalStatus.initErrCals[idx] |= ADRV903X_CTOHLL(runInitStatusRsp.status.initErrCals[idx]); + initCalStatus.calsSincePowerUp[idx] |= ADRV903X_CTOHLL(runInitStatusRsp.status.calsSincePowerUp[idx]); + initCalStatus.calsLastRun[idx] |= ADRV903X_CTOHLL(runInitStatusRsp.status.calsLastRun[idx]); + } + + /* Pass InitCals Duration on CPU Cores Directly to adi_adrv903x_InitCalErrData_t Structure */ + initCalErrData->calsDurationMsec[cpuTypeIdx] = ADRV903X_CTOHL(runInitStatusRsp.status.calsDurationMsec); + } + + for (idx = 0U; idx < ADI_ADRV903X_NUM_INIT_CAL_CHANNELS; ++idx) + { + /* Error Detail Lookup */ + ADI_ADRV903X_ERROR_INFO_GET(ADI_ADRV903X_ERRSRC_CPU_RUNTIME, + initCalStatus.initErrCodes[idx], + ADI_NO_VARIABLE, + calRecoveryAction, + error); + + /* Populate Cal Error Information Structure */ + initCalErrData->channel[idx].initErrCals = initCalStatus.initErrCals[idx]; + initCalErrData->channel[idx].errCode = initCalStatus.initErrCodes[idx]; + (void) ADI_LIBRARY_STRNCPY((char*) &initCalErrData->channel[idx].errMsg[0U], error.errMsg, ADI_ADRV903X_CHAR_ARRAY_MAX); + (void) ADI_LIBRARY_STRNCPY((char*) &initCalErrData->channel[idx].errCause[0U], error.errCause, ADI_ADRV903X_CHAR_ARRAY_MAX); + initCalErrData->channel[idx].action = (int64_t) error.actionCode; + (void) ADI_LIBRARY_STRNCPY((char*) &initCalErrData->channel[idx].actionMsg[0U], error.actionMsg, ADI_ADRV903X_CHAR_ARRAY_MAX); + initCalErrData->channel[idx].calsSincePowerUp = initCalStatus.calsSincePowerUp[idx]; + initCalErrData->channel[idx].calsLastRun = initCalStatus.calsLastRun[idx]; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, apiRecoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsWait( adi_adrv903x_Device_t* const device, + const uint32_t timeoutMs) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t areCalsRunning = 0U; + uint32_t timeElapsedUs = 0U; + uint32_t timeoutUs = timeoutMs * 1000U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + /* While timeoutMs has not expired, execute adi_adrv903x_InitCalsCheckCompleteGet() until completion (or timeout). */ + for (timeElapsedUs = 0U; timeElapsedUs < timeoutUs; timeElapsedUs += ADI_ADRV903X_INITCALSWAIT_INTERVAL_US) + { + recoveryAction = adi_adrv903x_InitCalsCheckCompleteGet(device, &areCalsRunning, ADI_TRUE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + /* Failure indicates one or more init cals failed (and init cals are now complete) */ + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Init Cals Check Complete Issue"); + goto cleanup; + } + + /* Break out here if init cals have completed */ + if (areCalsRunning == 0U) + { + break; + } + + /* Init cals are still in progress. Wait the specified wait interval, then check again for status. */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, ADI_ADRV903X_INITCALSWAIT_INTERVAL_US); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Issue"); + goto cleanup; + } + } + + /* Check for timeout */ + if (timeElapsedUs >= timeoutUs) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + timeoutUs, + "Initialization Calibrations Timeout"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsWait_v2( adi_adrv903x_Device_t* const device, + const uint32_t timeoutMs, + adi_adrv903x_InitCalErrData_t* const initCalErrData) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t areCalsRunning = 0U; + uint32_t timeElapsedUs = 0U; + uint32_t timeoutUs = timeoutMs * 1000U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + /* While timeoutMs has not expired, execute adi_adrv903x_InitCalsCheckCompleteGet() until completion (or timeout). */ + for (timeElapsedUs = 0U; timeElapsedUs < timeoutUs; timeElapsedUs += ADI_ADRV903X_INITCALSWAIT_INTERVAL_US) + { + /* Do Not Check Init Cals Status via this function */ + recoveryAction = adi_adrv903x_InitCalsCheckCompleteGet_v2(device, &areCalsRunning, initCalErrData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Init Cals Check Complete Issue"); + goto cleanup; + } + + /* Break out here if init cals have completed */ + if (areCalsRunning == 0U) + { + break; + } + + /* Init cals are still in progress. Wait the specified wait interval, then check again for status. */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, ADI_ADRV903X_INITCALSWAIT_INTERVAL_US); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Issue"); + goto cleanup; + } + } + + /* Check for timeout */ + if (timeElapsedUs >= timeoutUs) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + timeoutUs, + "Initialization Calibrations Timeout"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsCheckCompleteGet(adi_adrv903x_Device_t* const device, + uint8_t* const areCalsRunning, + const uint8_t calErrorCheck) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_RunInitGetCompletionStatusResp_t runInitCompleteRsp; + uint8_t inProgress = 0U; + uint8_t calSuccess = 1U; + uint32_t cpuTypeIdx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, areCalsRunning, cleanup); + ADI_LIBRARY_MEMSET(&runInitCompleteRsp, 0, sizeof(adrv903x_CpuCmd_RunInitGetCompletionStatusResp_t)); + + *areCalsRunning = 0U; + + /* For each CPU, check the status of initial calibrations */ + for (cpuTypeIdx = (uint32_t) ADI_ADRV903X_CPU_TYPE_0; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_RUN_INIT_GET_COMPLETION_STATUS, + NULL, + 0U, + (void*)&runInitCompleteRsp, + sizeof(runInitCompleteRsp), + NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + /* Other Command Response Issue */ + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_CMD_RESPONSE, + ADI_NO_VARIABLE, + recoveryAction); + goto cleanup; + } + + /* Update the inProgress flag with this CPU's init cal status. + * If any CPU is in progress, the global state is set to 'in progress' */ + inProgress |= runInitCompleteRsp.inProgress; + + /* Update the calSuccess flag with this CPU's init cal status. + * Only if both CPUs are successful is the global status set to 'success' */ + calSuccess &= runInitCompleteRsp.success; + } + + /* Update status flags for caller. */ + if (inProgress == 1U) + { + /* We do not check calSuccess here because it is not valid + * if inProgress == 1 (per interface spec)*/ + *areCalsRunning = 1U; + } + else + { + *areCalsRunning = 0U; + + if (calErrorCheck == ADI_TRUE) + { + /* If cals failed, error here */ + if (calSuccess == 0U) + { + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CALS, + ADI_ADRV903X_ERRCODE_CALS_INIT_ERROR_FLAG, + ADI_NO_VARIABLE, + recoveryAction); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsCheckCompleteGet_v2( adi_adrv903x_Device_t* const device, + uint8_t* const areCalsRunning, + adi_adrv903x_InitCalErrData_t* const initCalErrData) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_RunInitGetCompletionStatusResp_t runInitCompleteRsp; + uint8_t inProgress = 0U; + uint32_t cpuTypeIdx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, areCalsRunning, cleanup); + ADI_LIBRARY_MEMSET(&runInitCompleteRsp, 0, sizeof(adrv903x_CpuCmd_RunInitGetCompletionStatusResp_t)); + + *areCalsRunning = 0U; + + /* For each CPU, check the status of initial calibrations */ + for (cpuTypeIdx = (uint32_t) ADI_ADRV903X_CPU_TYPE_0; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_RUN_INIT_GET_COMPLETION_STATUS, + NULL, + 0U, + (void*)&runInitCompleteRsp, + sizeof(runInitCompleteRsp), + NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + /* Other Command Response Issue */ + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_CMD_RESPONSE, + ADI_NO_VARIABLE, + recoveryAction); + goto cleanup; + } + + /* Update the inProgress flag with this CPU's init cal status. + * If any CPU is in progress, the global state is set to 'in progress'*/ + inProgress |= runInitCompleteRsp.inProgress; + } + + /* Update status flags for caller. */ + if (inProgress == 1U) + { + /* We do not check calSuccess here because it is not valid + * if inProgress == 1 (per interface spec)*/ + *areCalsRunning = 1U; + } + else + { + *areCalsRunning = 0U; + + if (initCalErrData != NULL) + { + ADI_LIBRARY_MEMSET(initCalErrData, 0, sizeof(adi_adrv903x_InitCalErrData_t)); + + /* Detailed Status As an Out Parameter is Optional but we'll report any error information into the error structure either way */ + recoveryAction = adi_adrv903x_InitCalsDetailedStatusGet_v2(device, initCalErrData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Initial Calibration Detailed Status Get Issue"); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalsAbort(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cpuTypeIdx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + /* For each CPU, send the abort command and verify the response */ + for (cpuTypeIdx = (uint32_t) ADI_ADRV903X_CPU_TYPE_0; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_RUN_INIT_ABORT, + NULL, + 0U, + NULL, + 0U, + NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Run Init Abort Command Send Issue"); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TrackingCalsEnableSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TrackingCalibrationMask_t calMask, + const uint32_t channelMask, + const adi_adrv903x_TrackingCalEnableDisable_e enableDisableFlag) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cpuTypeIdx = 0U; + adrv903x_CpuCmd_SetEnabledTrackingCals_t setTrackingCalCmd; + adrv903x_CpuCmd_SetEnabledTrackingCalsResp_t setTrackingCalCmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_CpuErrorCode_t cpuErrorCode = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_LIBRARY_MEMSET(&setTrackingCalCmd, 0, sizeof(adrv903x_CpuCmd_SetEnabledTrackingCals_t)); + ADI_LIBRARY_MEMSET(&setTrackingCalCmdRsp, 0, sizeof(adrv903x_CpuCmd_SetEnabledTrackingCalsResp_t)); + + if ((enableDisableFlag != ADI_ADRV903X_TRACKING_CAL_DISABLE) && (enableDisableFlag != ADI_ADRV903X_TRACKING_CAL_ENABLE)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, enableDisableFlag, "Invalid enableDisableFlag provided."); + goto cleanup; + } + + if (calMask == 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, calMask, "Invalid calMask provided."); + goto cleanup; + } + + if ((calMask & ~ADI_ADRV903X_TC_ALL_CALS) != 0U) + { + + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, calMask, "Invalid calMask provided."); + goto cleanup; + } + + /* channelMask == 0 is a valid input for system calibrations (e.g. SERDES cal), so it is not checked. */ + if ((channelMask & ~0xFFU) != 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMask, "Invalid channelMask provided."); + goto cleanup; + } + + /* Build the command */ + setTrackingCalCmd.enableDisable = (adrv903x_TrackingCalEnableDisable_t)enableDisableFlag; + setTrackingCalCmd.calMask = (adi_adrv903x_TrackingCalibrationMask_t)ADRV903X_HTOCL(calMask); + setTrackingCalCmd.channelMask = ADRV903X_HTOCL(channelMask); + + /* For each CPU, send the set-tracking-cal-enable command and verify the response */ + for (cpuTypeIdx = (uint32_t) ADI_ADRV903X_CPU_TYPE_0; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_ENABLED_TRACKING_CALS, + &setTrackingCalCmd, + sizeof(setTrackingCalCmd), + &setTrackingCalCmdRsp, + sizeof(setTrackingCalCmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(setTrackingCalCmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TrackingCalsEnableSet_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TrackingCalibrationMask_e calMask, + const adi_adrv903x_ChannelTrackingCals_t* const channelMask, + const adi_adrv903x_TrackingCalEnableDisable_e enableDisableFlag) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cpuTypeIdx = 0U; + adrv903x_CpuCmd_SetEnabledTrackingCals_v2_t setTrackingCalCmd; + adrv903x_CpuCmd_SetEnabledTrackingCalsResp_t setTrackingCalCmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_CpuErrorCode_t cpuErrorCode = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, channelMask, cleanup); + ADI_LIBRARY_MEMSET(&setTrackingCalCmd, 0, sizeof(adrv903x_CpuCmd_SetEnabledTrackingCals_t)); + ADI_LIBRARY_MEMSET(&setTrackingCalCmdRsp, 0, sizeof(adrv903x_CpuCmd_SetEnabledTrackingCalsResp_t)); + + if ((enableDisableFlag != ADI_ADRV903X_TRACKING_CAL_DISABLE) && (enableDisableFlag != ADI_ADRV903X_TRACKING_CAL_ENABLE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, enableDisableFlag, "Invalid enableDisableFlag provided."); + goto cleanup; + } + + /* calMask cannot be zero nor having invalid bits */ + if ((calMask == 0U) || + ((calMask & ~ADI_ADRV903X_TC_ALL_CALS) != 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, calMask, "Invalid calMask provided."); + goto cleanup; + } + + /* channelMask == 0 is a valid input, check for invalid bits. */ + if ((channelMask->rxChannel & ~0xFFU) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMask->rxChannel, "Invalid rxChannelMask provided."); + goto cleanup; + } + + /* txChannelMask == 0 is a valid input, check for invalid bits. */ + if ((channelMask->txChannel & ~0xFFU) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMask->txChannel, "Invalid txChannelMask provided."); + goto cleanup; + } + + /* txChannelMask == 0 is a valid input, check for invalid bits. */ + if ((channelMask->orxChannel & ~0x03U) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMask->orxChannel, "Invalid orxChannelMask provided."); + goto cleanup; + } + + /* laneSerdesMask == 0 is a valid input, check for invalid bits. */ + if ((channelMask->laneSerdes & ~0xFFU) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMask->laneSerdes, "Invalid laneSerdesMask provided."); + goto cleanup; + } + + /* Build the command */ + setTrackingCalCmd.enableDisable = (adrv903x_TrackingCalEnableDisable_t)enableDisableFlag; + setTrackingCalCmd.calMask = (adi_adrv903x_TrackingCalibrationMask_t)ADRV903X_HTOCL(calMask); + setTrackingCalCmd.rxChannel = ADRV903X_HTOCL(channelMask->rxChannel); + setTrackingCalCmd.orxChannel = ADRV903X_HTOCL(channelMask->orxChannel); + setTrackingCalCmd.txChannel = ADRV903X_HTOCL(channelMask->txChannel); + setTrackingCalCmd.laneSerdes = ADRV903X_HTOCL(channelMask->laneSerdes); + + /* For each CPU, send the set-tracking-cal-enable command and verify the response */ + for (cpuTypeIdx = (uint32_t) ADI_ADRV903X_CPU_TYPE_0; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_ENABLED_TRACKING_CALS_V2, + &setTrackingCalCmd, + sizeof(setTrackingCalCmd), + &setTrackingCalCmdRsp, + sizeof(setTrackingCalCmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(setTrackingCalCmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TrackingCalsEnableGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TrackingCalEnableMasks_t* const enableMasks) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cpuTypeIdx = 0U; + uint32_t channelIdx = 0U; + adrv903x_CpuCmd_GetEnabledTrackingCalsResp_t getTrackingCalCmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_CpuErrorCode_t cpuErrorCode = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, enableMasks, cleanup); + ADI_LIBRARY_MEMSET(&getTrackingCalCmdRsp, 0, sizeof(adrv903x_CpuCmd_GetEnabledTrackingCalsResp_t)); + + /* Initialize the caller's buffer */ + ADI_LIBRARY_MEMSET(enableMasks, 0, sizeof(*enableMasks)); + + /* For each CPU, send the get-tracking-cal-enable command and verify the response */ + for (cpuTypeIdx = (uint32_t) ADI_ADRV903X_CPU_TYPE_0; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_ENABLED_TRACKING_CALS, + NULL, + 0U, + &getTrackingCalCmdRsp, + sizeof(getTrackingCalCmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(getTrackingCalCmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + /* If the command was successful, OR the result with the existing result in enableMask. + * Each CPU will only set the enable bit for a particular cal/channel if it "owns" that + * channel. + */ + for (channelIdx = 0U; channelIdx < ADI_ADRV903X_NUM_TRACKING_CAL_CHANNELS; channelIdx++) + { + enableMasks->enableMask[channelIdx] |= ADRV903X_CTOHL(getTrackingCalCmdRsp.enableMasks.enableMask[channelIdx]); + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TrackingCalAllStateGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TrackingCalState_t* const calState) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cpuTypeIdx = 0U; + uint32_t channelIdx = 0U; + uint32_t calIdx = 0U; + adrv903x_CpuCmd_GetTrackingCalStateResp_t getStateCmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_CpuErrorCode_t cpuErrorCode = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, calState, cleanup); + + /* Initialize the caller's buffer */ + ADI_LIBRARY_MEMSET(calState, 0, sizeof(*calState)); + + ADI_LIBRARY_MEMSET(&getStateCmdRsp, 0, sizeof(adrv903x_CpuCmd_GetTrackingCalStateResp_t)); + + /* For each CPU, send the get-tracking-cal-state command and verify the response */ + for (cpuTypeIdx = (uint32_t) ADI_ADRV903X_CPU_TYPE_0; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_TRACKING_CAL_STATE, + NULL, + 0U, + &getStateCmdRsp, + sizeof(getStateCmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(getStateCmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + /* If the command was successful, OR the result with the existing result in calState. + * Each CPU will only set the state information for a particular cal/channel if it "owns" that + * channel (otherwise it will be set to 0). + */ + for (channelIdx = 0U; channelIdx < ADI_ADRV903X_NUM_TRACKING_CAL_CHANNELS; channelIdx++) + { + calState->calError[channelIdx] |= ADRV903X_CTOHL(getStateCmdRsp.calState.calError[channelIdx]); + + for (calIdx = 0U; calIdx < ADI_ADRV903X_TC_NUM_CALS; calIdx++) + { + calState->calState[channelIdx][calIdx] |= getStateCmdRsp.calState.calState[channelIdx][calIdx]; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitCalStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_InitCalibrations_e calId, + const adi_adrv903x_Channels_e channel, + adi_adrv903x_CalStatus_t* const calStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, calStatus, cleanup); + + if(((calId & (calId - 1U)) != 0U) ||/* Make sure only one bit is set*/ + (calId == 0U) ||/* No bit set */ + ((ADI_ADRV903X_IC_ALL_CALS & calId) != calId /* bit must be in ADI_ADRV903X_IC_ALL_CALS range */ + && (calId != ADI_ADRV903X_IC_RXSPUR) + )) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, calId, "Invalid calId provided."); + goto cleanup; + } + + recoveryAction = adrv903x_VerifyChannel(channel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "channel parameter is invalid."); + goto cleanup; + } + + /* Use the common cal status get handler to get the data from the CPU */ + recoveryAction = adrv903x_CalStatusGet(device, adrv903x_InitCalToObjId(calId), channel, calStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error getting init cal status."); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TrackingCalStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TrackingCalibrationMask_e calId, + const adi_adrv903x_Channels_e channel, + adi_adrv903x_CalStatus_t* const calStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, calStatus, cleanup); + + if (calId == 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, calId, "calId cannot be zero."); + goto cleanup; + } + + recoveryAction = adrv903x_VerifyChannel(channel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "channel parameter is invalid."); + goto cleanup; + } + + /* Use the common cal status get handler to get the data from the CPU */ + recoveryAction = adrv903x_CalStatusGet(device, adrv903x_TrackingCalToObjId(calId), channel, calStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error getting tracking cal status."); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxHrmDataGet(adi_adrv903x_Device_t* const device, + const uint8_t channelMask, + adi_adrv903x_TxHrmData_t txHrmDataArray[], + uint32_t arrayLength) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint8_t i = 0U; + uint8_t indexBitSet = 0U; + uint32_t lengthResp = 0U; + uint8_t numBitsSet = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txHrmDataArray, cleanup); + + static const uint16_t CMD_READ_UP_HRM_COEFF = 3U; + + if (channelMask == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMask, "channelMask cannot be zero."); + goto cleanup; + } + + for (i = 0U; i < ADI_ADRV903X_MAX_CHANNELS; i++) + { + if((channelMask & (1U << i)) == (1U << i)) + { + ++numBitsSet; + } + } + + if (numBitsSet != arrayLength) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, arrayLength, "arrayLength must match number of bits high in channelMask"); + goto cleanup; + } + + for (i = 0U; i < ADI_ADRV903X_MAX_CHANNELS; i++) + { + if ((channelMask & (1U << i)) == (1U << i)) + { + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + ADRV903X_CPU_OBJID_IC_HRM, + CMD_READ_UP_HRM_COEFF, + (adi_adrv903x_Channels_e)(1U << i), + NULL, + 0U, + &lengthResp, + (uint8_t *)&txHrmDataArray[indexBitSet], + 48U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMask, "Couldn't retrieve Hrm Data for this channelMask"); + goto cleanup; + } + ++indexBitSet; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxHrmDataSet(adi_adrv903x_Device_t* const device, + const uint8_t channelMask, + const adi_adrv903x_TxHrmData_t txHrmDataArray[], + uint32_t arrayLength) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint8_t i = 0U; + uint8_t indexBitSet = 0U; + uint32_t lengthResp = 0U; + uint8_t numBitsSet = 0U; + + adi_adrv903x_TxHrmData_t txHrmDataArrayResp[8U]; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txHrmDataArray, cleanup); + ADI_LIBRARY_MEMSET(txHrmDataArrayResp, 0U, 8U*sizeof(adi_adrv903x_TxHrmData_t)); + + static const uint16_t CMD_APPLY_HRM_COEFF = 2U; + + if (channelMask == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMask, "channelMask cannot be zero."); + goto cleanup; + } + + for (i = 0U; i < ADI_ADRV903X_MAX_CHANNELS; i++) + { + if ((channelMask & (1U << i)) == (1U << i)) + { + ++numBitsSet; + } + } + + if (numBitsSet != arrayLength) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, arrayLength, "arrayLength must match number of bits high in channelMask"); + goto cleanup; + } + + for (i = 0U; i < ADI_ADRV903X_MAX_CHANNELS; i++) + { + if ((channelMask & (1U << i)) == (1U << i)) + { + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + ADRV903X_CPU_OBJID_IC_HRM, + CMD_APPLY_HRM_COEFF, + (adi_adrv903x_Channels_e)(1U << i), + (uint8_t*)&txHrmDataArray[indexBitSet], + 48U, + &lengthResp, + (uint8_t*)&txHrmDataArrayResp[indexBitSet], + 48U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMask, "Couldn't retrieve Hrm Data for this channelMask"); + goto cleanup; + } + ++indexBitSet; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +static adi_adrv903x_ErrAction_e adrv903x_CalStatusGet(adi_adrv903x_Device_t* const device, + const adrv903x_CpuObjectId_e objId, + const adi_adrv903x_Channels_e channel, + adi_adrv903x_CalStatus_t* const status) +{ + const adi_adrv903x_CalStatus_t* pCalStatus = NULL; + const adi_adrv903x_CalStatus_t** const ppCalStatus = &pCalStatus; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + char rxBuf[ADRV903X_CPU_CMD_RESP_MAX_SIZE_BYTES] = { 0 }; + + /* Send the cal status get command to the CPU */ + recoveryAction = adrv903x_SendCalStatusCmd(device, ADRV903X_CPU_CMD_CAL_STATUS_COMMON, objId, channel); + if (recoveryAction == ADI_ADRV903X_ERR_ACT_NONE) + { + /* Get the response from the CPU */ + recoveryAction = adrv903x_GetCalStatusCmdResp(device, + objId, + channel, + sizeof(adi_adrv903x_CalStatus_t), + (void*)&rxBuf[0], + (const void** const)ppCalStatus); + if (recoveryAction == ADI_ADRV903X_ERR_ACT_NONE) + { + if (pCalStatus != NULL) + { + /* Translate the response from the CPU */ + status->errorCode = ADRV903X_CTOHL(pCalStatus->errorCode); + status->percentComplete = ADRV903X_CTOHL(pCalStatus->percentComplete); + status->performanceMetric = ADRV903X_CTOHL(pCalStatus->performanceMetric); + status->iterCount = ADRV903X_CTOHL(pCalStatus->iterCount); + status->updateCount = ADRV903X_CTOHL(pCalStatus->updateCount); + } + } + } + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_SendCalStatusCmd(adi_adrv903x_Device_t* const device, + const adrv903x_CpuCmd_CalStatusType_e type, + const adrv903x_CpuObjectId_e calObjId, + const adi_adrv903x_Channels_e channel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + char txBuf[ADRV903X_CPU_CMD_MAX_SIZE_BYTES]; + adrv903x_CpuCmd_t* pCmd = NULL; + adrv903x_CpuCmd_GetCalStatus_t* pCalStatusCmd = NULL; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + + /* Get the CPU that is responsible for the requested channel */ + recoveryAction = adrv903x_CpuChannelMappingGet(device, channel, calObjId, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid channel-to-CPU mapping"); + return recoveryAction; + } + + /* Build the CPU command */ + pCmd = (adrv903x_CpuCmd_t*)txBuf; + pCalStatusCmd = (adrv903x_CpuCmd_GetCalStatus_t*)((uint8_t*)pCmd + sizeof(adrv903x_CpuCmd_t)); + pCalStatusCmd->type = (adrv903x_CpuCmd_CalStatusType_t) type; + pCalStatusCmd->calObjId = ADRV903X_HTOCL(calObjId); + pCalStatusCmd->channelNum = ADRV903X_HTOCL(adrv903x_ChanMaskToNum(channel)); + + /* Then send it */ + recoveryAction = adrv903x_CpuCmdWrite(device, cpuType, ADRV903X_LINK_ID_0, ADRV903X_CPU_CMD_ID_GET_CAL_STATUS, pCmd, sizeof(adrv903x_CpuCmd_GetCalStatus_t)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error sending GET_CAL_STATUS command."); + } + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_GetCalStatusCmdResp(adi_adrv903x_Device_t* const device, + const adrv903x_CpuObjectId_e objId, + const adi_adrv903x_Channels_e channel, + const size_t calStatusSize, + void* const pRxBuf, + const void** const pCalStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmdId_t cmdId = 0U; + adrv903x_CpuCmdResp_t* pCmd = (adrv903x_CpuCmdResp_t*)pRxBuf; + adrv903x_CpuCmd_GetCalStatusResp_t* pCmdResp = (adrv903x_CpuCmd_GetCalStatusResp_t*)((uint8_t*)pCmd + sizeof(adrv903x_CpuCmdResp_t)); + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cmdErrorCode = ADRV903X_CPU_NO_ERROR; + + /* Get the CPU that is responsible for the requested channel */ + recoveryAction = adrv903x_CpuChannelMappingGet(device, channel, objId, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid channel-to-CPU mapping"); + return recoveryAction; + } + + /* Read the response from the CPU */ + recoveryAction = adrv903x_CpuCmdRespRead(device, cpuType, ADRV903X_LINK_ID_0, &cmdId, pCmd, sizeof(adrv903x_CpuCmd_GetCalStatusResp_t) + calStatusSize, &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + if (cmdStatus == ADRV903X_CPU_CMD_STATUS_CMD_FAILED) + { + /* If the command failed for a command-specific reason, extract the command status code and log the error. */ + cmdErrorCode = (adrv903x_CpuErrorCode_e)ADRV903X_CTOHL((uint32_t)pCmdResp->cmdStatus); + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, cmdErrorCode, "GET_CAL_STATUS command failed."); + return recoveryAction; + } + else + { + /* Otherwise log a generic command failed error */ + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error getting response for GET_CAL_STATUS command."); + return recoveryAction; + } + } + + /* Find the cal status in the response payload, and set the caller's pointer to it. */ + *pCalStatus = (void*)((uint8_t*)pCmdResp + sizeof(adrv903x_CpuCmd_GetCalStatusResp_t)); + + return recoveryAction; +} + +static adrv903x_CpuObjectId_e adrv903x_InitCalToObjId(const adi_adrv903x_InitCalibrations_e calId) +{ + return (adrv903x_CpuObjectId_e)adrv903x_GetBitPosition((uint32_t)calId); +} + +static adrv903x_CpuObjectId_e adrv903x_TrackingCalToObjId(const adi_adrv903x_TrackingCalibrationMask_e calId) +{ + adrv903x_CpuObjectId_t objId = 0U; + + objId = adrv903x_GetBitPosition((uint32_t)calId); + objId = ADRV903X_CPU_TRACKING_CAL_IDX_TO_OBJ(objId); + + return (adrv903x_CpuObjectId_e)objId; +} + +static uint32_t adrv903x_ChanMaskToNum(const adi_adrv903x_Channels_e mask) +{ + return adrv903x_GetBitPosition((uint32_t)mask); +} + +static uint32_t adrv903x_GetBitPosition(const uint32_t mask) +{ + uint32_t bitPos = 0U; + + if (mask != 0U) + { + for (bitPos = 0U; ((1U << bitPos) & mask) == 0U; bitPos++) + { + } + } + + return bitPos; +} + +static adi_adrv903x_ErrAction_e adrv903x_VerifyChannel(const adi_adrv903x_Channels_e channel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Channel must not be set to OFF */ + if (channel != ADI_ADRV903X_CHOFF) + { + /* Channel must contain a single channel number (0-7) */ + if (channel == ADI_ADRV903X_CH0 || + channel == ADI_ADRV903X_CH1 || + channel == ADI_ADRV903X_CH2 || + channel == ADI_ADRV903X_CH3 || + channel == ADI_ADRV903X_CH4 || + channel == ADI_ADRV903X_CH5 || + channel == ADI_ADRV903X_CH6 || + channel == ADI_ADRV903X_CH7) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CalPvtStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Channels_e channel, + const uint32_t objId, + uint8_t calStatusGet[], + uint32_t length) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + const void* pCalStatus = NULL; + const void** const ppCalStatus = &pCalStatus; + char rxBuf[ADRV903X_CPU_CMD_RESP_MAX_SIZE_BYTES]; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, calStatusGet, cleanup); + + recoveryAction = adrv903x_VerifyChannel(channel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "channel parameter is invalid."); + goto cleanup; + } + + if (((objId > ADRV903X_CPU_OBJID_IC_END) && + (objId < ADRV903X_CPU_OBJID_TC_START)) || + (objId > ADRV903X_CPU_OBJID_TC_END)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, length, "objId parameter is invalid."); + goto cleanup; + } + + if (length == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, length, "Length is zero."); + goto cleanup; + } + + if ((length + sizeof(adrv903x_CpuCmd_GetCalStatusResp_t) + sizeof(adrv903x_CpuCmdResp_t)) > sizeof(rxBuf)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, length, "Length exceeds maximum response size."); + goto cleanup; + } + + /* Send the cal status get command to the CPU */ + recoveryAction = adrv903x_SendCalStatusCmd(device, ADRV903X_CPU_CMD_CAL_STATUS_PRIVATE, (adrv903x_CpuObjectId_e)objId, channel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SendCalStatusCmd failed"); + goto cleanup; + } + + /* Get the response from the CPU */ + recoveryAction = adrv903x_GetCalStatusCmdResp(device, + (adrv903x_CpuObjectId_e)objId, + channel, + length, + (void*)&rxBuf[0], + ppCalStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GetCalStatusCmd failed"); + goto cleanup; + } + + if (pCalStatus == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GET_CAL_STATUS command failed"); + goto cleanup; + } + + ADI_LIBRARY_MEMCPY(calStatusGet, pCalStatus, length); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CalSpecificStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Channels_e channel, + const uint32_t objId, + uint8_t calStatusGet[], + uint32_t length) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + const void* pCalStatus = NULL; + const void** const ppCalStatus = &pCalStatus; + char rxBuf[ADRV903X_CPU_CMD_RESP_MAX_SIZE_BYTES]; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, calStatusGet, cleanup); + + recoveryAction = adrv903x_VerifyChannel(channel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "channel parameter is invalid."); + goto cleanup; + } + + if (((objId > ADRV903X_CPU_OBJID_IC_END) && + (objId < ADRV903X_CPU_OBJID_TC_START)) || + (objId > ADRV903X_CPU_OBJID_TC_END)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, length, "objId parameter is invalid."); + goto cleanup; + } + + if (length == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, length, "Length is zero."); + goto cleanup; + } + + if ((length + sizeof(adrv903x_CpuCmd_GetCalStatusResp_t) + sizeof(adrv903x_CpuCmdResp_t)) > sizeof(rxBuf)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, length, "Length exceeds maximum response size."); + goto cleanup; + } + + /* Send the cal status get command to the CPU */ + recoveryAction = adrv903x_SendCalStatusCmd(device, ADRV903X_CPU_CMD_CAL_STATUS_SPECIFIC, (adrv903x_CpuObjectId_e)objId, channel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SendCalStatusCmd failed"); + goto cleanup; + } + + /* Get the response from the CPU */ + recoveryAction = adrv903x_GetCalStatusCmdResp(device, + (adrv903x_CpuObjectId_e)objId, + channel, + length, + (void*)&rxBuf[0], + ppCalStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GetCalStatusCmd failed"); + goto cleanup; + } + + if (pCalStatus == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GET_CAL_STATUS command failed"); + goto cleanup; + } + + ADI_LIBRARY_MEMCPY(calStatusGet, pCalStatus, length); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DigDcOffsetEnableSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint32_t rxChannelEnableDisable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e baseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + adi_adrv903x_RxChannels_e rxChannel = ADI_ADRV903X_RXOFF; + uint32_t i = 0U; + uint8_t bfValue = ADI_DISABLE; + uint32_t chanSel = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Validate rxChannelMask */ + if (rxChannelMask > 0xFFU) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannelMask, "Invalid channelDisableEnableMask"); + goto cleanup; + } + + for (i = 0U; i < ADI_ADRV903X_MAX_RX_ONLY; ++i) + { + chanSel = 1U << i; + rxChannel = (adi_adrv903x_RxChannels_e)(chanSel); + + if ((rxChannel & rxChannelMask) != rxChannel) + { + /* Channel is not in mask. Skip it. */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + continue; + } + + /* Get Rx Funcs Bitfield Address */ + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, + rxChannel, + &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx Funcs base address"); + goto cleanup; + } + + if ((rxChannelEnableDisable & (uint32_t) rxChannel) == rxChannel) + { + bfValue = ADI_ENABLE; + } + else + { + bfValue = ADI_DISABLE; + } + + recoveryAction = adrv903x_RxFuncs_BbdcTrackingEnable_BfSet(device, + NULL, + baseAddr, + bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "BbdcTrackingEnable Bf Set failed."); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DigDcOffsetEnableGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint8_t* const isEnabled) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e baseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, isEnabled, cleanup); + + /* Get Rx Funcs Bitfield Address */ + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, + rxChannel, + &baseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx Funcs base address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_BbdcTrackingEnable_BfGet(device, + NULL, + baseAddr, + isEnabled); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "BbdcTrackingEnable Bf Get failed."); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxLolReset(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxLolReset_t* const txLolReset) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t i = 0U; + uint32_t txChannel = 0U; + uint32_t lengthResp = 0U; + uint8_t ctrlResp[1] = { 0U }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txLolReset, cleanup); + + /* Tx channel mask range check */ + if (txLolReset->channelMask > (uint32_t) ADI_ADRV903X_TXALL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txLolReset->channelMask, "Invalid Tx LOL Channel Mask"); + goto cleanup; + } + + if ((txLolReset->resetType != ADI_ADRV903X_TX_LOL_SOFT_RESET) && + (txLolReset->resetType != ADI_ADRV903X_TX_LOL_HARD_RESET)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txLolReset->resetType, "Invalid Tx LOL Reset Type"); + goto cleanup; + } + + for (i = 0U; i < ADI_ADRV903X_MAX_TXCHANNELS; ++i) + { + txChannel = (1U << i); + + if ((txLolReset->channelMask & txChannel) == txChannel) + { + /* Sending cpu control command with length of ctrlData set to 0 and ctrlData set to NULL. + * This way the default firmware response will never be overridden by this API function + * and no assumption can be made about firmware response. + */ + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + (uint32_t)ADRV903X_CPU_OBJID_TC_TX_LOL, + (uint16_t)(txLolReset->resetType), + (adi_adrv903x_Channels_e)txChannel, + NULL, + 0U, + &lengthResp, + ctrlResp, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Tx LOL Reset Issue"); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxQecReset(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxQecReset_t* const txQecReset) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + const uint16_t TXQEC_CMD_RESET = 5U; + uint32_t i = 0U; + uint32_t txChannel = 0U; + uint32_t lengthResp = 0U; + uint8_t ctrlData[1] = { 0U }; + uint8_t ctrlResp[1] = { 0U }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txQecReset, cleanup); + + /* Tx channel mask range check */ + if (txQecReset->channelMask > (uint32_t) ADI_ADRV903X_TXALL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txQecReset->channelMask, "Invalid Tx QEC Channel Mask"); + goto cleanup; + } + + if ((txQecReset->resetType != ADI_ADRV903X_TX_QEC_TRACKING_HARD_RESET) && + (txQecReset->resetType != ADI_ADRV903X_TX_QEC_TRACKING_QEC_RESET) && + (txQecReset->resetType != ADI_ADRV903X_TX_QEC_TRACKING_CHANNEL_RESET)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txQecReset->resetType, "Invalid Tx QEC Reset Type"); + goto cleanup; + } + + ctrlData[0U] = txQecReset->resetType; + + for (i = 0U; i < ADI_ADRV903X_MAX_TXCHANNELS; ++i) + { + txChannel = (1U << i); + + if ((txQecReset->channelMask & txChannel) == txChannel) + { + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + (uint32_t)ADRV903X_CPU_OBJID_TC_TXQEC, + TXQEC_CMD_RESET, + (adi_adrv903x_Channels_e)txChannel, + ctrlData, + 1U, + &lengthResp, + ctrlResp, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Tx QEC Reset Issue"); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DigDcOffsetCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuCmd_SetDcOffset_t* const dcOffSetCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_CpuCmd_SetDcOffset_t dcOffsetCfgToWrite; + adi_adrv903x_CpuCmd_SetDcOffsetResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_CpuErrorCode_t cpuErrorCode = 0U; + static const uint32_t MAX_CORNER_FREQ = 11513U; + static const uint32_t MIN_CORNER_FREQ = 3U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dcOffSetCfg, cleanup); + + ADI_LIBRARY_MEMSET(&dcOffsetCfgToWrite, 0, sizeof(adi_adrv903x_CpuCmd_SetDcOffset_t)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(adi_adrv903x_CpuCmd_SetDcOffsetResp_t)); + + if (dcOffSetCfg->chanSelect == ADI_ADRV903X_RXOFF) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, dcOffSetCfg->chanSelect, "Invalid chanSelect provided."); + goto cleanup; + } + + if (dcOffSetCfg->multEnb > 1U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, dcOffSetCfg->multEnb, "Invalid enable selection. Valid values are 0 and 1"); + goto cleanup; + } + + if ((dcOffSetCfg->dcFilterBw_kHz > MAX_CORNER_FREQ) || + (dcOffSetCfg->dcFilterBw_kHz < MIN_CORNER_FREQ)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, dcOffSetCfg->dcFilterBw_kHz, "Invalid corner frequency. Valid range [3-11513 kHz]"); + goto cleanup; + } + + /* Prepare the command payload */ + dcOffsetCfgToWrite.chanSelect = dcOffSetCfg->chanSelect; + dcOffsetCfgToWrite.dcFilterBw_kHz = ADRV903X_HTOCL(dcOffSetCfg->dcFilterBw_kHz); + dcOffsetCfgToWrite.multEnb = dcOffSetCfg->multEnb; + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_DCOFFSET, + (void*)&dcOffsetCfgToWrite, + sizeof(dcOffsetCfgToWrite), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DigDcOffsetCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_CpuCmd_GetDcOffsetResp_t* const dcOffSetCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_CpuCmd_GetDcOffsetResp_t cmdRsp; + adi_adrv903x_CpuCmd_GetDcOffset_t getCmd; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_CpuErrorCode_t cpuErrorCode = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dcOffSetCfg, cleanup); + + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(adi_adrv903x_CpuCmd_GetDcOffsetResp_t)); + ADI_LIBRARY_MEMSET(&getCmd, 0, sizeof(adi_adrv903x_CpuCmd_GetDcOffset_t)); + + if ((dcOffSetCfg->chanSelect != (uint8_t)ADI_ADRV903X_RX0) && + (dcOffSetCfg->chanSelect != (uint8_t)ADI_ADRV903X_RX1) && + (dcOffSetCfg->chanSelect != (uint8_t)ADI_ADRV903X_RX2) && + (dcOffSetCfg->chanSelect != (uint8_t)ADI_ADRV903X_RX3) && + (dcOffSetCfg->chanSelect != (uint8_t)ADI_ADRV903X_RX4) && + (dcOffSetCfg->chanSelect != (uint8_t)ADI_ADRV903X_RX5) && + (dcOffSetCfg->chanSelect != (uint8_t)ADI_ADRV903X_RX6) && + (dcOffSetCfg->chanSelect != (uint8_t)ADI_ADRV903X_RX7)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, dcOffSetCfg->chanSelect, "Invalid chanSelect provided."); + goto cleanup; + } + + getCmd.chanSelect = dcOffSetCfg->chanSelect; + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_DCOFFSET, + (void*)&getCmd, + sizeof(getCmd), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + /* Extract the command-specific response from the response payload */ + dcOffSetCfg->chanSelect = cmdRsp.chanSelect; + dcOffSetCfg->mShift = ADRV903X_CTOHL(cmdRsp.mShift); + dcOffSetCfg->multEnb = cmdRsp.multEnb; + dcOffSetCfg->mult = ADRV903X_CTOHL(cmdRsp.mult); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_core.c b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_core.c new file mode 100644 index 0000000000000..b933f7a5836b3 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_core.c @@ -0,0 +1,2043 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_core.c +* \brief Contains ADRV903X features related function implementation defined in +* adi_adrv903x_core.h +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_gpio.h" +#include "adi_adrv903x_error.h" + +#include "adi_adrv903x_version.h" +#include "../../private/include/adrv903x_gpio.h" +#include "../../private/include/adrv903x_cpu.h" +#include "../../private/include/adrv903x_init.h" +#include "../../private/include/adrv903x_shared_resource_manager.h" +#include "../../private/bf/adrv903x_bf_core.h" +#include "../../private/include/adrv903x_reg_addr_macros.h" +#include "../../private/bf/adrv903x_bf_pll_mem_map.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PUBLIC_CORE + +#define ADRV903X_SPI_VERIFY_SCRATCHPAD_ADDR 0x60800000U +#define ADRV903X_SPI_VERIFY_BUFFER_SIZE 50U +#define ADRV903X_SPI_VERIFY_MASK 0xFFFFFFFFU + +static adi_adrv903x_ErrAction_e adrv903x_SingleRegisterSpiVerify(adi_adrv903x_Device_t* const device); +static adi_adrv903x_ErrAction_e adrv903x_MultipleRegisterSpiVerify(adi_adrv903x_Device_t* const device); + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Lock(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + /* Effectively we call adi_common_hal_ApiEnter and exit but don't release the lock on exit */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ApiEnter(&device->common, __func__, ADI_TRUE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Entry Issue"); + return recoveryAction; + } + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ApiExit(&device->common, __func__, ADI_FALSE); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Unlock(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + /* Effectively we call adi_common_hal_ApiEnter and exit but don't take the lock on enter */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ApiEnter(&device->common, __func__, ADI_FALSE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Entry Issue"); + return recoveryAction; + } + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ApiExit(&device->common, __func__, ADI_TRUE); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_HwOpen(adi_adrv903x_Device_t* const device, + const adi_adrv903x_SpiConfigSettings_t* const spiSettings) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_ErrAction_e exitRecoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, spiSettings, cleanup); + + /* ApiEnter ADI_FALSE => Do all the normal API enter jobs *except* take the mutex + * This is because we don't have a mutex initialized until commonOpen completes. */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ApiEnter(&device->common, __func__, ADI_FALSE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Entry Issue"); + return recoveryAction; + } + + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_PlatformFunctionCheck(&device->common); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_HAL_ERR_NOT_IMPLEMENTED, + recoveryAction, + ADI_NO_VARIABLE, + "HAL Function Pointers Not Configured Correctly"); + goto cleanup; + } + + /* Store SPI config into device structure */ + if ((spiSettings->cmosPadDrvStrength != ADI_ADRV903X_CMOSPAD_DRV_WEAK) && + (spiSettings->cmosPadDrvStrength != ADI_ADRV903X_CMOSPAD_DRV_STRONG) && + (spiSettings->cmosPadDrvStrength != ADI_ADRV903X_CMOSPAD_DRV_STRENGTH_1) && + (spiSettings->cmosPadDrvStrength != ADI_ADRV903X_CMOSPAD_DRV_STRENGTH_2)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, spiSettings->cmosPadDrvStrength, "Invalid CMOS PAD driver strength."); + goto cleanup; + } + + device->spiSettings.cmosPadDrvStrength = spiSettings->cmosPadDrvStrength; + device->spiSettings.fourWireMode = spiSettings->fourWireMode; + device->spiSettings.msbFirst = spiSettings->msbFirst; + + if (!ADI_COMMON_DEVICE_STATE_IS_OPEN(device->common)) + { + /* Perform Hardware Open Once */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_HwOpen(&device->common); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Common HwOpen Issue"); + goto cleanup; + } + + /* Earliest Point for Logging */ + adi_adrv903x_LogLevelSet(&device->common, ADI_ADRV903X_LOGGING); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API); + + /* Indicate device is now open or else HwReset will fail */ + ADI_COMMON_DEVICE_STATE_OPEN_SET(device->common); + + if ((device->devStateInfo.devState & ADI_ADRV903X_STATE_POWERONRESET) != ADI_ADRV903X_STATE_POWERONRESET) + { + /* Only HwReset on first call to HwOpen, end user must explicitly call HwReset + * to reboot the part for future reset */ + /* Toggle RESETB pin */ + recoveryAction = adi_adrv903x_HwReset(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HwReset Failed"); + goto cleanup; + } + } + } + else + { + /* In case HW is already opened then reapply the SPI config setting. */ + recoveryAction = adi_adrv903x_SpiCfgSet(device, &device->spiSettings); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Config Issue"); + goto cleanup; + } + } + +cleanup: + /* ApiExit ADI_FALSE => don't release mutex as we did not take it at the top of the fn */ + exitRecoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ApiExit(&device->common, __func__, ADI_FALSE); + if (ADI_ADRV903X_ERR_ACT_NONE != exitRecoveryAction) + { + recoveryAction = exitRecoveryAction; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Exit Issue"); + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_HwClose(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_ErrAction_e exitRecoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + /* ApiEnter ADI_FALSE => Do all the normal API enter jobs *except* take the mutex + * This is because common_HwClose will be destroying the mutex. */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ApiEnter(&device->common, __func__, ADI_FALSE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Entry Issue"); + return recoveryAction; + } + + if (ADI_COMMON_DEVICE_STATE_IS_OPEN(device->common)) + { + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_HwClose(&device->common); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Common HAL HwClose Failed"); + goto cleanup; + } + /* Indicate the Device is now closed */ + ADI_COMMON_DEVICE_STATE_OPEN_CLR(device->common); + } + +cleanup: + /* ADI_FALSE to not release mutex as we did not take it at the top of the fn */ + exitRecoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ApiExit(&device->common, __func__, ADI_FALSE); + if (ADI_ADRV903X_ERR_ACT_NONE != exitRecoveryAction) + { + recoveryAction = exitRecoveryAction; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Exit Issue"); + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_HwReset(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + static const uint8_t WAIT_10_US = 10U; + static const uint8_t RESETB_LEVEL_LOW = 0U; + static const uint8_t RESETB_LEVEL_HIGH = 1U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + /* HwReset is Positive Edge Triggered */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_HwReset(&device->common, RESETB_LEVEL_LOW); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue with adi_adrv903x_hal_HwReset() setting Level Low"); + goto cleanup; + } + + { + static const uint8_t RESETB_WAIT_MS = 50U; /* move here to fix compiler warning */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_ms(&device->common, RESETB_WAIT_MS); +} + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait(ms) Failed"); + goto cleanup; + } + + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_HwReset(&device->common, RESETB_LEVEL_HIGH); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue with adi_adrv903x_hal_HwReset() setting Level High"); + goto cleanup; + } + + /* Give SPI state machine time to come out of reset */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, WAIT_10_US); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait(us) Failed"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, ADRV903X_ADDR_SPI_INTERFACE_CONFIG_B, ADRV903X_CONFIG_B_SINGLE_INSTRUCTION, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Config Setup Issue"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_SpiCfgSet(device, &device->spiSettings); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Config Issue"); + goto cleanup; + } + + device->devStateInfo.devState = ADI_ADRV903X_STATE_POWERONRESET; + + /* Reset Shared Resource Manager when HwReset occurs */ + recoveryAction = adrv903x_SharedResourceMgrReset(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Shared Resource Manager Reset Issue"); + goto cleanup; + } + + cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Initialize(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Init_t* const init) +{ + ADI_PLATFORM_LARGE_VAR_ALLOC(adi_adrv903x_Info_t, devStateInfoClearPtr); + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t idx = 0U; + uint8_t TX_SPIMODE_ENABLE_ALLCH = 0xFFU; + uint8_t RX_SPIMODE_ENABLE_ALLCH = 0xFFU; + uint8_t ORX_SPIMODE_ENABLE_ALLCH = 0x03U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, init, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, devStateInfoClearPtr, cleanup); + + /* There is no HW Reset occurring right here, so we cannot throw away current Shared Resource States */ + /* Restore Shared Resource Manager from current device structure.*/ + ADI_LIBRARY_MEMCPY(&devStateInfoClearPtr->sharedResourcePool, &device->devStateInfo.sharedResourcePool, sizeof(device->devStateInfo.sharedResourcePool)); + + /* Restore silicon revision from current device structure */ + devStateInfoClearPtr->deviceSiRev = device->devStateInfo.deviceSiRev; + devStateInfoClearPtr->swTest = device->devStateInfo.swTest; + devStateInfoClearPtr->devState = device->devStateInfo.devState; + device->devStateInfo = *devStateInfoClearPtr; + + recoveryAction = adrv903x_Core_MbiasBgCtat_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + 0U, + 0x09U); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while writing CTAT Trim0"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_MbiasBgCtat_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + 1U, + 0x09U); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while writing CTAT Trim1"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_MbiasBgPtat_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + 0U, + 0x1EU); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while writing PTAT Trim0"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_MbiasBgPtat_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + 1U, + 0x1EU); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while writing PTAT Trim1"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_SpiRuntimeOptionsSet(device, &init->spiOptionsInit); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Runtime Options Set Issue"); + goto cleanup; + } + + /* Initializes the part in non-streaming mode. The responsibility is on the API functions internally + * to use streaming when appropriate by calling adrv903x_SpiStreamingEntry when first entering the API + * and adrv903x_SpiStreamingExit when leaving the API. + * */ + recoveryAction = adrv903x_SpiStreamingExit(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI streaming exit issue"); + goto cleanup; + } + + /* Initialize GP Interrupt settings for use during device initialization*/ + recoveryAction = adrv903x_GpIntPreMcsInit(device, &init->gpIntPreInit); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GP Interrupt Initialization Issue"); + goto cleanup; + } + + device->devStateInfo.gainIndexes.rx0MaxGainIndex = ADI_ADRV903X_RX_MAX_GAIN_INDEX; + device->devStateInfo.gainIndexes.rx1MaxGainIndex = ADI_ADRV903X_RX_MAX_GAIN_INDEX; + device->devStateInfo.gainIndexes.rx2MaxGainIndex = ADI_ADRV903X_RX_MAX_GAIN_INDEX; + device->devStateInfo.gainIndexes.rx3MaxGainIndex = ADI_ADRV903X_RX_MAX_GAIN_INDEX; + device->devStateInfo.gainIndexes.rx4MaxGainIndex = ADI_ADRV903X_RX_MAX_GAIN_INDEX; + device->devStateInfo.gainIndexes.rx5MaxGainIndex = ADI_ADRV903X_RX_MAX_GAIN_INDEX; + device->devStateInfo.gainIndexes.rx6MaxGainIndex = ADI_ADRV903X_RX_MAX_GAIN_INDEX; + device->devStateInfo.gainIndexes.rx7MaxGainIndex = ADI_ADRV903X_RX_MAX_GAIN_INDEX; + + /* Disable TRX_CTRL Pin mode until after initialization to prevent any toggling + * pins from interfering with the init sequence. SPI reg to actually enable the + * channels is 0 by default after Power On Reset */ + recoveryAction = adrv903x_Core_RadioControlInterfaceTxSpiModeSel_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + TX_SPIMODE_ENABLE_ALLCH); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to enable TX Radio Control SPI Mode"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_RadioControlInterfaceRxSpiModeSel_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + RX_SPIMODE_ENABLE_ALLCH); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to enable RX Radio Control SPI Mode"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_RadioControlInterfaceOrxSpiModeSel_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + ORX_SPIMODE_ENABLE_ALLCH); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to enable ORX Radio Control SPI Mode"); + goto cleanup; + } + + /* Initialize the CPU memory bank usage */ + recoveryAction = adrv903x_CpuInitialize(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Initialization Issue"); + goto cleanup; + } + + ADI_LIBRARY_MEMCPY( device->devStateInfo.cpu.cpuMemDumpBinaryInfo.filePath, + init->cpuMemDump.filePath, + ADI_ADRV903X_MAX_FILE_LENGTH); + + recoveryAction = adrv903x_ClocksSync(device, init); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Initialization Issue"); + goto cleanup; + } + + /* Config Uart GPIO if enable */ + for (idx = 0U; idx < ADI_ADRV903X_MAX_UART; idx++) + { + if (init->uart[idx].enable == ADI_TRUE) + { + recoveryAction = adrv903x_UartCfg(device, init->uart[idx].pinSelect); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adi_adrv903x_UartCfg Issue."); + goto cleanup; + } + } + + } + + /* Disable stream pin mode until after streams are loaded */ + /* Disable Tx pin mode for all Tx, Rx and ORx channels */ + recoveryAction = adrv903x_Core_RadioControlInterfaceTxSpiEn_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + 0x00U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to disable Radio Control TX channels."); + goto cleanup; + } + + recoveryAction = adrv903x_Core_RadioControlInterfaceRxSpiEn_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + 0x00U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to disable Radio Control RX channels."); + goto cleanup; + } + + recoveryAction = adrv903x_Core_RadioControlInterfaceOrxSpiEn_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + 0x00U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to disable Radio Control ORX channels."); + goto cleanup; + } + + recoveryAction = adi_adrv903x_ProfilesVerify(device, init); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to profiles Verify."); + goto cleanup; + } + + /* Set Initialized Channels */ + if (device->devStateInfo.profilesValid & ADI_ADRV903X_TX_PROFILE_VALID) + { + device->devStateInfo.initializedChannels |= ((device->initExtract.tx.txInitChannelMask & ADI_ADRV903X_TXALL) << ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET); + } + + if (device->devStateInfo.profilesValid & ADI_ADRV903X_RX_PROFILE_VALID) + { + device->devStateInfo.initializedChannels |= (device->initExtract.rx.rxInitChannelMask & ADI_ADRV903X_RX_MASK_ALL); + } + + if (device->devStateInfo.profilesValid & ADI_ADRV903X_ORX_PROFILE_VALID) + { + device->devStateInfo.initializedChannels |= (device->initExtract.rx.rxInitChannelMask & ADI_ADRV903X_ORX_MASK_ALL); + } + device->devStateInfo.hsDigClk_kHz = device->initExtract.clocks.hsDigClk_kHz; + device->devStateInfo.devState = (adi_adrv903x_ApiStates_e)(device->devStateInfo.devState | ADI_ADRV903X_STATE_INITIALIZED); + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Shutdown(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* TODO: Function not implemented yet. */ + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_API_NOT_IMPLEMENTED_REPORT_GOTO(&device->common, cleanup); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_MultichipSyncSet(adi_adrv903x_Device_t* const device, + const uint8_t enableSync) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_StartMcsResp_t startMcsResp = { ADRV903X_CPU_SYSTEM_SIMULATED_ERROR }; + adrv903x_CpuCmd_McsCompleteResp_t mcsCompleteResp = { ADRV903X_CPU_SYSTEM_SIMULATED_ERROR }; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Verify enableSync parameter */ + if ((enableSync != 0u) && (enableSync != 1U)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, enableSync, "enableSync must be 0 or 1"); + goto cleanup; + } + + if (enableSync == 1U) + { + /* Start MCS */ + + /* Clear the MCS_STATUS register before starting. This register is write-1-clear. + * This register bit is only accessible over SPI & not AHB*/ + recoveryAction = adrv903x_Core_McsStatus_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to clear MCS status register"); + goto cleanup; + } + + /* Send Start MCS command to CPU */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_START_MCS, + NULL, + 0U, + (void*)&startMcsResp, + sizeof(startMcsResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(startMcsResp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + } + else + { + /* Stop MCS */ + + /* Notify CPU that MCS is complete */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_MCS_COMPLETE, + NULL, + 0U, + (void *)&mcsCompleteResp, + sizeof(mcsCompleteResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(mcsCompleteResp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_MultichipSyncSet_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_McsSyncMode_e mcsMode) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + switch (mcsMode) + { + case ADI_ADRV903X_MCS_OFF: + switch (device->devStateInfo.devState & ADI_ADRV903X_STATE_MCSCARRIERRECONFIG) + { + default: + recoveryAction = adi_adrv903x_MultichipSyncSet(device, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adi_adrv903x_MultichipSyncSet Failed"); + goto cleanup; + } + break; + } + break; + case ADI_ADRV903X_MCS_START: + recoveryAction = adi_adrv903x_MultichipSyncSet(device, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adi_adrv903x_MultichipSyncSet Failed"); + goto cleanup; + } + break; + default: + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, mcsMode, "mcsMode is not valid"); + goto cleanup; + break; + } +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); + +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_MultichipSyncStatusGet(adi_adrv903x_Device_t* const device, + uint32_t* const mcsStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t mcsStatusRead = 0x0U; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, mcsStatus, cleanup); + + recoveryAction = adrv903x_Core_McsStatus_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &mcsStatusRead); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get Mcs Status"); + /* If Warning we continue executing the API as normal, otherwise goto cleanup */ + goto cleanup; + } + *mcsStatus = (uint32_t)mcsStatusRead; +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ProfilesVerify(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Init_t* const init) +{ + /* Set Recovery Action to Error State */ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); /* Lock Device & Log Function Entry */ + + /* Lock must be released before exiting API; + * All Errors should result in 'goto cleanup'; Do not exit function early, i.e. return from API + */ + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, init, cleanup); + + if ((device->initExtract.tx.txInitChannelMask & ADI_ADRV903X_TXALL) != ADI_ADRV903X_TXOFF) + { + device->devStateInfo.profilesValid |= ADI_ADRV903X_TX_PROFILE_VALID; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + + if ((device->initExtract.rx.rxInitChannelMask & ADI_ADRV903X_RX_MASK_ALL) != ADI_ADRV903X_RXOFF) + { + device->devStateInfo.profilesValid |= ADI_ADRV903X_RX_PROFILE_VALID; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + + if ((device->initExtract.rx.rxInitChannelMask & ADI_ADRV903X_ORX_MASK_ALL) != ADI_ADRV903X_RXOFF) + { + device->devStateInfo.profilesValid |= ADI_ADRV903X_ORX_PROFILE_VALID; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_SpiConfigSettings_t* const spiCtrlSettings) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; /* Set Recovery Action to Error State */ + + uint8_t spiConfigA = 0U; + static const uint8_t SPICFG_MSBFIRST_OFF = 0U; + static const uint8_t SPICFG_FOURWIREMODE_OFF = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); /* Validate Device Only before Lock */ + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, spiCtrlSettings, cleanup); + + ADI_ADRV903X_API_ENTRY(&device->common); /* Lock Device & Log Function Entry */ + + /* Lock must be released before exiting API; + * All Errors should result in 'goto cleanup'; Do not exit function early, i.e. return from API + */ + + /* core.spi_interface_config_A */ + /* SPI bit is 1 = LSB first */ + if (spiCtrlSettings->msbFirst == SPICFG_MSBFIRST_OFF) + { + spiConfigA |= ADRV903X_CONFIG_A_SPI_LSB_FIRST; + } + + spiConfigA |= ADRV903X_CONFIG_A_SPI_ADDR_ASCENSION; + + if (spiCtrlSettings->fourWireMode != SPICFG_FOURWIREMODE_OFF) + { + spiConfigA |= ADRV903X_CONFIG_A_SPI_SDO_ACTIVE; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, ADRV903X_ADDR_SPI_INTERFACE_CONFIG_A, spiConfigA, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set SPI Config"); + goto cleanup; + } + + device->spiSettings.fourWireMode = spiCtrlSettings->fourWireMode; + device->spiSettings.msbFirst = spiCtrlSettings->msbFirst; + + /* Setting CMOS PAD Driver Strength */ + if (device->spiSettings.fourWireMode == ADI_TRUE) + { + recoveryAction = adi_adrv903x_GpioDriveStrengthSet(device, ADI_ADRV903X_O_SPI_DO, spiCtrlSettings->cmosPadDrvStrength); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set SPI DO drive strength"); + goto cleanup; + } + } + else + { + recoveryAction = adi_adrv903x_GpioDriveStrengthSet(device, ADI_ADRV903X_IO_SPI_DIO, spiCtrlSettings->cmosPadDrvStrength); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set SPI DIO drive strength"); + goto cleanup; + } + } + + device->spiSettings.cmosPadDrvStrength = spiCtrlSettings->cmosPadDrvStrength; + +#if ADI_ADRV903X_SPI_HYSTERESIS + { + recoveryAction = adi_adrv903x_SpiHysteresisSet(device, ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Hysteresis Configuration Issue"); + goto cleanup; + } + } +#endif + + recoveryAction = adi_adrv903x_GpioDriveStrengthSet( device, + ADI_ADRV903X_I_RESETB, + (adi_adrv903x_CmosPadDrvStr_e) ADI_ADRV903X_RESETB_PIN_DRIVE_STRENGTH); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + recoveryAction = adi_adrv903x_GpioHysteresisSet(device, ADI_ADRV903X_I_RESETB, ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiConfigSettings_t* const spi) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, spi, cleanup); + + spi->fourWireMode = device->spiSettings.fourWireMode; + spi->msbFirst = device->spiSettings.msbFirst; + spi->cmosPadDrvStrength = device->spiSettings.cmosPadDrvStrength; + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AuxSpiCfgSet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_AuxSpiConfig_t* const config) +{ + static const uint32_t NOCHAN_MASK = 0U; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_AuxSpiConfig_t readConfig; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, config, cleanup); + + ADI_LIBRARY_MEMSET(&readConfig, 0, sizeof(adi_adrv903x_AuxSpiConfig_t)); + + /* Range check enable */ + if ((config->enable != ADI_ENABLE) && + (config->enable != ADI_DISABLE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, config->enable, "Aux SPI enable can only be 0 or 1."); + goto cleanup; + } + + /* Range check GPIO selections */ + if ((config->enable == ADI_ENABLE) && + (config->gpioCsb != ADI_ADRV903X_GPIO_03) && + (config->gpioCsb != ADI_ADRV903X_GPIO_16)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, config->gpioCsb, "Aux SPI CSB GPIO pin can only be set to GPIO[3] or GPIO[16]."); + goto cleanup; + } + + if ((config->enable == ADI_ENABLE) && + (config->gpioClk != ADI_ADRV903X_GPIO_02) && + (config->gpioClk != ADI_ADRV903X_GPIO_15)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, config->gpioClk, "Aux SPI CLK GPIO pin can only be set to GPIO[2] or GPIO[15]."); + goto cleanup; + } + + if ((config->enable == ADI_ENABLE) && + (config->gpioSdio != ADI_ADRV903X_GPIO_00) && + (config->gpioSdio != ADI_ADRV903X_GPIO_13)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, config->gpioSdio, "Aux SPI SDIO GPIO pin can only be set to GPIO[0] or GPIO[13]."); + goto cleanup; + } + + if ((config->enable == ADI_ENABLE) && + (config->gpioSdo != ADI_ADRV903X_GPIO_01) && + (config->gpioSdo != ADI_ADRV903X_GPIO_14) && + (config->gpioSdo != ADI_ADRV903X_GPIO_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, config->gpioSdo, "Aux SPI SDO GPIO pin can only be set to GPIO[1], GPIO[14], or INVALID."); + goto cleanup; + } + + /* Get current config */ + recoveryAction = adi_adrv903x_AuxSpiCfgGet(device, &readConfig); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error retrieving current Aux SPI Configuration."); + goto cleanup; + } + + /* If Aux SPI is currently enabled, disable it */ + if (readConfig.enable) + { + recoveryAction = adrv903x_Core_Spi1En_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error disabling Aux SPI interface."); + goto cleanup; + } + + if (readConfig.gpioCsb != ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = adrv903x_GpioSignalRelease( device, + readConfig.gpioCsb, + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_CSB, + NOCHAN_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error releasing Aux SPI CSB GPIO pin."); + goto cleanup; + } + } + + if (readConfig.gpioClk != ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = adrv903x_GpioSignalRelease( device, + readConfig.gpioClk, + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_CLK, + NOCHAN_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error releasing Aux SPI CLK GPIO pin."); + goto cleanup; + } + } + + if (readConfig.gpioSdio != ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = adrv903x_GpioSignalRelease( device, + readConfig.gpioSdio, + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_SDIO, + NOCHAN_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error releasing Aux SPI SDIO GPIO pin."); + goto cleanup; + } + } + + if (readConfig.gpioSdo != ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = adrv903x_GpioSignalRelease( device, + readConfig.gpioSdo, + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_SDO, + NOCHAN_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error releasing Aux SPI SDO GPIO pin."); + goto cleanup; + } + } + + } + + /* Enable Aux SPI, if appropriate */ + if (config->enable == ADI_ENABLE) + { + recoveryAction = adrv903x_GpioSignalSet( device, + config->gpioCsb, + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_CSB, + NOCHAN_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error routing Aux SPI CSB GPIO pin."); + goto cleanup; + } + + recoveryAction = adrv903x_GpioSignalSet( device, + config->gpioClk, + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_CLK, + NOCHAN_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error routing Aux SPI CLK GPIO pin."); + goto cleanup; + } + + recoveryAction = adrv903x_GpioSignalSet( device, + config->gpioSdio, + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_SDIO, + NOCHAN_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error routing Aux SPI SDIO GPIO pin."); + goto cleanup; + } + + if (config->gpioSdo != ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = adrv903x_GpioSignalSet( device, + config->gpioSdo, + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_SDO, + NOCHAN_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error routing Aux SPI SDO GPIO pin."); + goto cleanup; + } + } + + recoveryAction = adrv903x_Core_Spi1En_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error enabling Aux SPI interface."); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AuxSpiCfgGet( adi_adrv903x_Device_t* const device, + adi_adrv903x_AuxSpiConfig_t* const config) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, config, cleanup); + + /* Read Aux SPI enable */ + recoveryAction = adrv903x_Core_Spi1En_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &config->enable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading Aux SPI enable setting."); + goto cleanup; + } + + /* Find GPIOs routing Aux SPI signals */ + recoveryAction = adrv903x_GpioSignalFind( device, + &config->gpioCsb, + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_CSB, + ADI_ADRV903X_CHOFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error retrieving GPIO pin routing Aux SPI CSB signal."); + goto cleanup; + } + + recoveryAction = adrv903x_GpioSignalFind( device, + &config->gpioClk, + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_CLK, + ADI_ADRV903X_CHOFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error retrieving GPIO pin routing Aux SPI CLK signal."); + goto cleanup; + } + + recoveryAction = adrv903x_GpioSignalFind( device, + &config->gpioSdio, + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_SDIO, + ADI_ADRV903X_CHOFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error retrieving GPIO pin routing Aux SPI SDIO signal."); + goto cleanup; + } + + recoveryAction = adrv903x_GpioSignalFind( device, + &config->gpioSdo, + ADI_ADRV903X_GPIO_SIGNAL_AUX_SPI_SDO, + ADI_ADRV903X_CHOFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error retrieving GPIO pin routing Aux SPI SDO signal."); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiRuntimeOptionsSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_SpiOptions_t* const spiOptions) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, spiOptions, cleanup); + + if (spiOptions->allowAhbAutoIncrement > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + spiOptions->allowAhbAutoIncrement, + "allowAhbAutoIncrement can only be 0 or 1"); + goto cleanup; + } + + if (spiOptions->allowAhbSpiFifoMode > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + spiOptions->allowAhbSpiFifoMode, + "allowAhbSpiFifoMode can only be 0 or 1"); + goto cleanup; + } + + if (spiOptions->allowSpiStreaming > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + spiOptions->allowSpiStreaming, + "allowSpiStreaming can only be 0 or 1"); + goto cleanup; + } + + device->devStateInfo.spiOptions.allowAhbAutoIncrement = spiOptions->allowAhbAutoIncrement; + device->devStateInfo.spiOptions.allowAhbSpiFifoMode = spiOptions->allowAhbSpiFifoMode; + device->devStateInfo.spiOptions.allowSpiStreaming = spiOptions->allowSpiStreaming; + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiRuntimeOptionsGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiOptions_t* const spiOptions) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, spiOptions, cleanup); + + spiOptions->allowAhbAutoIncrement = device->devStateInfo.spiOptions.allowAhbAutoIncrement; + spiOptions->allowAhbSpiFifoMode = device->devStateInfo.spiOptions.allowAhbSpiFifoMode; + spiOptions->allowSpiStreaming = device->devStateInfo.spiOptions.allowSpiStreaming; + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +static adi_adrv903x_ErrAction_e adrv903x_SingleRegisterSpiVerify(adi_adrv903x_Device_t* const device) +{ + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint16_t vendorIdReadback = 0U; + uint8_t scratchPadReadback = 0U; + static const uint16_t VENDOR_ID = 0x0456U; + static const uint8_t TEST_WORD_1 = 0xB6U; + static const uint8_t TEST_WORD_2 = 0x49U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + recoveryAction = adrv903x_Core_VendorId_BfGet( device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &vendorIdReadback); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Vendor ID Read Issue; Check Platform SPI Driver"); + return recoveryAction; + } + + if (vendorIdReadback != VENDOR_ID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + vendorIdReadback, + "Vendor ID Readback Mismatch; Check Platform SPI Driver"); + return recoveryAction; + } + + /* Writing, reading, then verifying Scratch Pad (Direct SPI access) */ + recoveryAction = adrv903x_Core_ScratchPadWord_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + TEST_WORD_1); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Scratchpad Byte Write (1) Issue; Check Platform SPI Driver"); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_ScratchPadWord_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &scratchPadReadback); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Scratchpad Byte Read (1) Issue; Check Platform SPI Driver"); + return recoveryAction; + } + + if (scratchPadReadback != TEST_WORD_1) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + scratchPadReadback, + "Scratchpad Byte Readback Mismatch (1); Check Platform SPI Driver"); + return recoveryAction; + } + + /* Writing, reading, then verifying Scratch Pad (Direct SPI access) */ + recoveryAction = adrv903x_Core_ScratchPadWord_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + TEST_WORD_2); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Scratchpad Byte Write (2) Issue; Check Platform SPI Driver"); + return recoveryAction; + } + + recoveryAction = adrv903x_Core_ScratchPadWord_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &scratchPadReadback); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Scratchpad Byte Read (2) Issue; Check Platform SPI Driver"); + return recoveryAction; + } + + if (scratchPadReadback != TEST_WORD_2) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + scratchPadReadback, + "Scratchpad Byte Readback Mismatch (2) Issue; Check Platform SPI Driver"); + return recoveryAction; + } + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_MultipleRegisterSpiVerify(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint32_t i = 0U; + + uint32_t address[ADRV903X_SPI_VERIFY_BUFFER_SIZE] = { 0U }; + uint32_t currentData[ADRV903X_SPI_VERIFY_BUFFER_SIZE] = { 0U }; + uint32_t data[ADRV903X_SPI_VERIFY_BUFFER_SIZE] = { 0U }; + uint32_t mask[ADRV903X_SPI_VERIFY_BUFFER_SIZE] = { 0U }; + uint32_t readBack[ADRV903X_SPI_VERIFY_BUFFER_SIZE] = { 0U }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + if (device->devStateInfo.spiStreamingOn == ADI_TRUE) + { + /* Put the part into streaming mode to help facilitate the large, contiguous SPI writes */ + recoveryAction = adrv903x_SpiStreamingEntry(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue Entering Spi Streaming Mode"); + goto cleanup; + } + } + + for (i = 0U; i < ADRV903X_SPI_VERIFY_BUFFER_SIZE; ++i) + { + address[i] = (ADRV903X_SPI_VERIFY_SCRATCHPAD_ADDR + (i * 4)); + + data[i] = (0x5U + (i * 4U)); + mask[i] = ADRV903X_SPI_VERIFY_MASK; + } + + recoveryAction = adi_adrv903x_Registers32Read( device, + NULL, + ADRV903X_SPI_VERIFY_SCRATCHPAD_ADDR, + ¤tData[0], + &mask[0], + ADRV903X_SPI_VERIFY_BUFFER_SIZE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Scratchpad Multi Register Read Issue; Check Platform SPI Driver"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Registers32Write( device, + NULL, + &address[0], + &data[0], + &mask[0], + ADRV903X_SPI_VERIFY_BUFFER_SIZE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Scratchpad Multi Register Write Issue; Check Platform SPI Driver"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Registers32Read( device, + NULL, + ADRV903X_SPI_VERIFY_SCRATCHPAD_ADDR, + &readBack[0], + &mask[0], + ADRV903X_SPI_VERIFY_BUFFER_SIZE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Scratchpad Multi Register Read Issue; Check Platform SPI Driver"); + goto cleanup; + } + + if (0 != ADI_LIBRARY_MEMCMP(&data[0], &readBack[0], sizeof(data))) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, readBack[0], "Scratchpad Multi Register Readback Issue; Check Platform SPI Driver"); + goto cleanup; + } + +cleanup: + if (ADI_ADRV903X_ERR_ACT_NONE != adi_adrv903x_Registers32Write( device, + NULL, + &address[0], + ¤tData[0], + &mask[0], + ADRV903X_SPI_VERIFY_BUFFER_SIZE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "ScratchPad Multi Register Cleanup Issue"); + } + + if (device->devStateInfo.spiStreamingOn == ADI_TRUE) + { + if (ADI_ADRV903X_ERR_ACT_NONE != adrv903x_SpiStreamingExit(device)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_INTERFACE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Spi Streaming Exit Issue"); + } + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiVerify(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + recoveryAction = adrv903x_SingleRegisterSpiVerify(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Single Register Spi Verify Issue"); + goto cleanup; + } + + if ((device->devStateInfo.devState & ADI_ADRV903X_STATE_INITIALIZED) == ADI_ADRV903X_STATE_INITIALIZED) + { + recoveryAction = adrv903x_MultipleRegisterSpiVerify(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Multi Register Spi Verify Issue"); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ApiVersionGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_Version_t* const apiVersion) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, apiVersion, cleanup); + + apiVersion->majorVer = ADI_ADRV903X_CURRENT_MAJOR_VERSION; + apiVersion->minorVer = ADI_ADRV903X_CURRENT_MINOR_VERSION; + apiVersion->maintenanceVer = ADI_ADRV903X_CURRENT_MAINTENANCE_VERSION; + apiVersion->buildVer = ADI_ADRV903X_CURRENT_BUILD_VERSION; + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeviceRevGet(adi_adrv903x_Device_t* const device, + uint8_t* const siRevision) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t major = 0U; + uint8_t minor = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, siRevision, cleanup); + + *siRevision = 0U; + + /* Read product_id_1 from device to obtain silicon revision code. Comprised of 2 bitfields: major and minor */ + recoveryAction = adrv903x_Core_MaskRevisionMajor_BfGet( device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &major); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Major Silicon Revision Get Issue"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_MaskRevisionMinor_BfGet( device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &minor); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Minor Silicon Revision Get Issue"); + goto cleanup; + } + + /* Construct 8'b siRevision = {4'b major, 4'b minor}*/ + *siRevision = ( (major & 0xF) << 4) | (minor & 0xF); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ProductIdGet(adi_adrv903x_Device_t* const device, + uint8_t* const productId) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + static const uint8_t EFUSE_READY_DEBOUNCE_LIMIT = 30U; + uint8_t pidReady = 0U; + uint8_t retryCount = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); /* Lock Device & Log Function Entry */ + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, productId, cleanup); + + *productId = 0U; + + /* Check the status of the Efuse State machine. + * If Efuse is ready, read the product ID + * otherwise return an error + */ + for (retryCount = 0U; retryCount < EFUSE_READY_DEBOUNCE_LIMIT; ++retryCount) + { + recoveryAction = adrv903x_Core_EfuseProductIdReady_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &pidReady); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Efuse Product Id Ready status"); + goto cleanup; + } + + if (pidReady == 1U) + { + break; + } + } + + if (pidReady == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_DEVICE; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + pidReady, + "Efuse Hardware Not Ready. Repeated Attempts Failed"); + goto cleanup; + } + + /* Read the Product ID */ + recoveryAction = adrv903x_Core_EfuseProductId_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + productId); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Product ID Get Issue"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeviceCapabilityGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_CapabilityModel_t* const devCapability) +{ + /* local variables */ + static const uint32_t ADRV903X_TX_MAX_BW_KHZ = 800000U; + static const uint32_t ADRV9044NB_TX_MAX_BW_KHZ = 600000U; + static const uint32_t ADRV9049_TX_MAX_BW_KHZ = 600000U; + static const uint32_t ADRV9044WB_TX_MAX_BW_KHZ = 200000U; + static const uint32_t ADRV903X_RX_MAX_BW_KHZ = 600000U; + static const uint32_t ADRV9044WB_RX_MAX_BW_KHZ = 200000U; + static const uint32_t ADRV903X_ORX_MAX_BW_KHZ = 800000U; + static const uint32_t ADRV9044WB_ORX_MAX_BW_KHZ = 430000U; + static const uint32_t ADRV903X_RF_FREQ_RANGE_MIN_KHZ = 650000U; + static const uint32_t ADRV903X_RF_FREQ_RANGE_MAX_KHZ = 7100000U; + static const uint32_t ADRV903X_RF_MAX_IBW_MHZ = 400U; + static const uint32_t ADRV9044NB_RF_MAX_IBW_MHZ = 200U; + static const uint32_t ADRV9044WB_RF_MAX_IBW_MHZ = 600U; + static const uint32_t ADRV9049_RF_MAX_IBW_MHZ = 600U; + static const uint32_t ADRV9049_RF_FREQ_RANGE_MAX_KHZ = 6000000U; + + static const uint8_t EXTERNAL_LO_DISABLE_POSITION = 4U; + static const uint8_t INTERNAL_LO_DISABLE_POSITION = 2U; + + uint8_t idx = 0U; + uint8_t i = 0U; + uint8_t count = 0U; + uint8_t temp = 0U; + uint8_t productId = 0U; + uint8_t siRevision = 0U; + uint8_t internalLomask = 0U; + uint8_t externalLomask = 0U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); /* Lock Device & Log Function Entry */ + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, devCapability, cleanup); + + /* Read the Product ID */ + recoveryAction = adi_adrv903x_ProductIdGet(device, &productId); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Product ID Get Issue"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_DeviceRevGet(device, &siRevision); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Device Revision ID Get Issue"); + goto cleanup; + } + + devCapability->productId = productId; + devCapability->siRevision = siRevision; + + /* PID=0 for the EX an XX open feature products,other PID value have not filled in document. */ + switch (productId) + { + case 0U: + devCapability->txMaxBw_kHz = ADRV903X_TX_MAX_BW_KHZ; + devCapability->rxMaxBw_kHz = ADRV903X_RX_MAX_BW_KHZ; + devCapability->orxMaxBw_kHz = ADRV903X_ORX_MAX_BW_KHZ; + devCapability->rfFreqRangeMin_kHz = ADRV903X_RF_FREQ_RANGE_MIN_KHZ; + devCapability->rfFreqRangeMax_kHz = ADRV903X_RF_FREQ_RANGE_MAX_KHZ; + devCapability->rfMaxIbw_Mhz = ADRV903X_RF_MAX_IBW_MHZ; + devCapability->featureMask = ADI_ADRV903X_FEATUREOFF; + break; + + case 71U: /* AD80538 - 9049 */ + devCapability->txMaxBw_kHz = ADRV9049_TX_MAX_BW_KHZ; + devCapability->rxMaxBw_kHz = ADRV903X_RX_MAX_BW_KHZ; + devCapability->orxMaxBw_kHz = ADRV903X_ORX_MAX_BW_KHZ; + devCapability->rfFreqRangeMin_kHz = ADRV903X_RF_FREQ_RANGE_MIN_KHZ; + devCapability->rfFreqRangeMax_kHz = ADRV9049_RF_FREQ_RANGE_MAX_KHZ; + devCapability->rfMaxIbw_Mhz = ADRV9049_RF_MAX_IBW_MHZ; + devCapability->featureMask = ADI_ADRV903X_FEATUREOFF; + break; + + case 72U: /* AD80539 - 9049 */ + devCapability->txMaxBw_kHz = ADRV9049_TX_MAX_BW_KHZ; + devCapability->rxMaxBw_kHz = ADRV903X_RX_MAX_BW_KHZ; + devCapability->orxMaxBw_kHz = ADRV903X_ORX_MAX_BW_KHZ; + devCapability->rfFreqRangeMin_kHz = ADRV903X_RF_FREQ_RANGE_MIN_KHZ; + devCapability->rfFreqRangeMax_kHz = ADRV9049_RF_FREQ_RANGE_MAX_KHZ; + devCapability->rfMaxIbw_Mhz = ADRV9049_RF_MAX_IBW_MHZ; + devCapability->featureMask = ADI_ADRV903X_FEATUREOFF; + break; + + case 69U: /* 9044-NB */ + devCapability->txMaxBw_kHz = ADRV9044NB_TX_MAX_BW_KHZ; + devCapability->rxMaxBw_kHz = ADRV903X_RX_MAX_BW_KHZ; + devCapability->orxMaxBw_kHz = ADRV903X_ORX_MAX_BW_KHZ; + devCapability->rfFreqRangeMin_kHz = ADRV903X_RF_FREQ_RANGE_MIN_KHZ; + devCapability->rfFreqRangeMax_kHz = ADRV903X_RF_FREQ_RANGE_MAX_KHZ; + devCapability->rfMaxIbw_Mhz = ADRV9044NB_RF_MAX_IBW_MHZ; + devCapability->featureMask = ADI_ADRV903X_FEATUREOFF; + break; + + case 70U: /* 9044-WB */ + devCapability->txMaxBw_kHz = ADRV9044WB_TX_MAX_BW_KHZ; + devCapability->rxMaxBw_kHz = ADRV9044WB_RX_MAX_BW_KHZ; + devCapability->orxMaxBw_kHz = ADRV9044WB_ORX_MAX_BW_KHZ; + devCapability->rfFreqRangeMin_kHz = ADRV903X_RF_FREQ_RANGE_MIN_KHZ; + devCapability->rfFreqRangeMax_kHz = ADRV903X_RF_FREQ_RANGE_MAX_KHZ; + devCapability->rfMaxIbw_Mhz = ADRV9044WB_RF_MAX_IBW_MHZ; + devCapability->featureMask = ADI_ADRV903X_FEATUREOFF; + break; + + case 73U: /* AD80538 - 9049 */ + devCapability->txMaxBw_kHz = ADRV9049_TX_MAX_BW_KHZ; + devCapability->rxMaxBw_kHz = ADRV903X_RX_MAX_BW_KHZ; + devCapability->orxMaxBw_kHz = ADRV903X_ORX_MAX_BW_KHZ; + devCapability->rfFreqRangeMin_kHz = ADRV903X_RF_FREQ_RANGE_MIN_KHZ; + devCapability->rfFreqRangeMax_kHz = ADRV9049_RF_FREQ_RANGE_MAX_KHZ; + devCapability->rfMaxIbw_Mhz = ADRV9049_RF_MAX_IBW_MHZ; + devCapability->featureMask = ADI_ADRV903X_FEATUREOFF; + break; + + default: + break; + } + + for (idx = 0; idx < ADI_ADRV903X_MAX_FEATUREMASK ; idx++) + { + switch (idx) + { + case ADI_ADRV903X_FEATURE_SERIALIZER : + devCapability->serializerLaneEnableMask = device->initExtract.featureMask[idx] ^ 0xFFU; + break; + case ADI_ADRV903X_FEATURE_DESERIALIZER : + devCapability->deserializerLaneEnableMask = device->initExtract.featureMask[idx] ^ 0xFFU; + break; + case ADI_ADRV903X_FEATURE_TX: + temp = 1U; + count = 0U; + for (i = 0U; i < ADI_ADRV903X_MAX_TXCHANNELS; ++i) + { + if ((device->initExtract.featureMask[idx] & temp) == 0U) + { + ++count; + } + + temp = temp << 1U; + } + + devCapability->txNumber = count; + devCapability->txChannelMask = device->initExtract.featureMask[idx] ^ 0xFF; + break; + case ADI_ADRV903X_FEATURE_RX : + temp = 1U; + count = 0U; + for (i = 0U; i < ADI_ADRV903X_MAX_RX_ONLY; ++i) + { + if ((device->initExtract.featureMask[idx] & temp) == 0U) + { + ++count; + } + + temp = temp << 1U; + } + + devCapability->rxNumber = count; + devCapability->rxChannelMask = device->initExtract.featureMask[idx] ^ 0xFF; + break; + case ADI_ADRV903X_FEATURE_ORX_LOMASK : + temp = 1U; + count = 0U; + for (i = 0U; i < ADI_ADRV903X_MAX_ORX; ++i) + { + if ((device->initExtract.featureMask[idx] & temp) == 0U) + { + ++count; + } + + temp = temp << 1U; + } + + devCapability->orxNumber = count; + devCapability->orxChannelMask = device->initExtract.featureMask[idx] ^ 0x03U; + + internalLomask = (device->initExtract.featureMask[idx] >> INTERNAL_LO_DISABLE_POSITION) & 0x03U; + externalLomask = (device->initExtract.featureMask[idx] >> EXTERNAL_LO_DISABLE_POSITION) & 0x04U; + devCapability->loMask = (internalLomask | externalLomask) ^ 0x07U; + break; + + default: + break; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiDoutPadDriveStrengthSet(adi_adrv903x_Device_t* const device, + const uint8_t driveStrength) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + static const uint8_t SPI_DOUT_PAD_DRIVE_STRENGTH_THREE_WIRE_MODE_ADDR_OFFSET = 0x03U; + static const uint8_t SPI_DOUT_PAD_DRIVE_STRENGTH_THREE_WIRE_MODE_MASK = 0x02U; + + static const uint8_t SPI_DOUT_PAD_DRIVE_STRENGTH_FOUR_WIRE_MODE_ADDR_OFFSET = 0x07U; + static const uint8_t SPI_DOUT_PAD_DRIVE_STRENGTH_FOUR_WIRE_MODE_MASK = 0x01U; + + static const uint8_t DRIVE_STRENGTH_MAX = 0x03U; + uint8_t readBackVal = 0U; + uint8_t registerAddrOffset = 0U; + uint8_t registerMaskVal = 0U; + + static const uint8_t DS_ENUM_CONVERT[] = { 0U, 3U, 1U, 2U }; + + static const uint8_t DS_VALUE_LUT[] = { 0x0U, 0x3U, 0x9U, 0xFU }; + uint8_t dsValue = DS_VALUE_LUT[DS_ENUM_CONVERT[driveStrength]]; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); /* Lock Device & Log Function Entry */ + + if (driveStrength > DRIVE_STRENGTH_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, driveStrength, "Drive strength is above the allowed value."); + goto cleanup; + } + + if (device->spiSettings.fourWireMode == 1U) + { + registerAddrOffset = SPI_DOUT_PAD_DRIVE_STRENGTH_FOUR_WIRE_MODE_ADDR_OFFSET; + registerMaskVal = SPI_DOUT_PAD_DRIVE_STRENGTH_FOUR_WIRE_MODE_MASK; + } + else + { + registerAddrOffset = SPI_DOUT_PAD_DRIVE_STRENGTH_THREE_WIRE_MODE_ADDR_OFFSET; + registerMaskVal = SPI_DOUT_PAD_DRIVE_STRENGTH_THREE_WIRE_MODE_MASK; + } + + /* Configure SPI DOUT DS0 bit, we need to do RMW since its a single bit in DS0 register */ + recoveryAction = adrv903x_Core_PadDs0_BfGet(device, NULL, (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, registerAddrOffset, &readBackVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read DS0 bit"); + goto cleanup; + } + + if (ADRV903X_BF_EQUAL(dsValue, 0x01U)) + { + readBackVal |= (uint8_t) (1U << registerMaskVal); + } + else + { + readBackVal &= (uint8_t)(0U << registerMaskVal); + } + + recoveryAction = adrv903x_Core_PadDs0_BfSet(device, NULL, (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, registerAddrOffset, readBackVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write DS0 bit"); + goto cleanup; + } + + /* Configure SPI DOUT DS1 bit, we need to do RMW since its a single bit in DS1 register */ + recoveryAction = adrv903x_Core_PadDs1_BfGet(device, NULL, (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, registerAddrOffset, &readBackVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read DS1 bit"); + goto cleanup; + } + + if (ADRV903X_BF_EQUAL(dsValue, 0x02U)) + { + readBackVal |= (uint8_t) (1U << registerMaskVal); + } + else + { + readBackVal &= (uint8_t)(0U << registerMaskVal); + } + + recoveryAction = adrv903x_Core_PadDs1_BfSet(device, NULL, (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, registerAddrOffset, readBackVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write DS1 bit"); + goto cleanup; + } + + /* Configure SPI DOUT DS2 bit, we need to do RMW since its a single bit in DS2 register */ + recoveryAction = adrv903x_Core_PadDs2_BfGet(device, NULL, (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, registerAddrOffset, &readBackVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read DS2 bit"); + goto cleanup; + } + + if (ADRV903X_BF_EQUAL(dsValue, 0x04U)) + { + readBackVal |= (uint8_t) (1U << registerMaskVal); + } + else + { + readBackVal &= (uint8_t)(0U << registerMaskVal); + } + + recoveryAction = adrv903x_Core_PadDs2_BfSet(device, NULL, (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, registerAddrOffset, readBackVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write DS2 bit"); + goto cleanup; + } + + /* Configure SPI DOUT DS3 bit, we need to do RMW since its a single bit in DS3 register */ + recoveryAction = adrv903x_Core_PadDs3_BfGet(device, NULL, (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, registerAddrOffset, &readBackVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read DS3 bit"); + goto cleanup; + } + + if (ADRV903X_BF_EQUAL(dsValue, 0x08U)) + { + readBackVal |= (uint8_t) (1U << registerMaskVal); + } + else + { + readBackVal &= (uint8_t)(0U << registerMaskVal); + } + + recoveryAction = adrv903x_Core_PadDs3_BfSet(device, NULL, (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, registerAddrOffset, readBackVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write DS3 bit"); + goto cleanup; + } + + cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiHysteresisSet( adi_adrv903x_Device_t* const device, + const uint32_t enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + if (enable > ADI_ENABLE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + enable, + "enable can only be 0 or 1"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_GpioHysteresisSet(device, ADI_ADRV903X_I_SPI_ENB, enable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + recoveryAction = adi_adrv903x_GpioHysteresisSet(device, ADI_ADRV903X_I_SPI_CLK, enable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + recoveryAction = adi_adrv903x_GpioHysteresisSet(device, ADI_ADRV903X_IO_SPI_DIO, enable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + recoveryAction = adi_adrv903x_GpioHysteresisSet(device, ADI_ADRV903X_O_SPI_DO, enable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + /* SPI Configuration Validation */ + +#if ADI_ADRV903X_SPI_HYSTERESIS_DEBUG + + recoveryAction = adi_adrv903x_GpioHysteresisGet(device, ADI_ADRV903X_I_SPI_ENB, &enableFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + enableMask |= (enableFlag << 0U); + + recoveryAction = adi_adrv903x_GpioHysteresisGet(device, ADI_ADRV903X_I_SPI_CLK, &enableFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + enableMask |= (enableFlag << 1U); + + recoveryAction = adi_adrv903x_GpioHysteresisGet(device, ADI_ADRV903X_IO_SPI_DIO, &enableFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + enableMask |= (enableFlag << 2U); + + recoveryAction = adi_adrv903x_GpioHysteresisGet(device, ADI_ADRV903X_O_SPI_DO, &enableFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + enableMask |= (enableFlag << 3U); + + if (((enable == ADI_ENABLE) ? 0x0FU : 0x00U) != enableMask) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + enableMask, + "Unexpected SPI Hysteresis Configuration"); + } + +#endif + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DigitalHysteresisSet( adi_adrv903x_Device_t* const device, + const uint32_t enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t i = 0U; + uint8_t bfValue = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + for (i = 0U; i < ADRV903X_DIGITAL_PIN_GROUP_NUM; ++i) + { + recoveryAction = adrv903x_Core_PadSt_BfSet( device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + i, + ((enable == ADI_ENABLE) ? 0x3FU : 0x00U)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + } + + for (i = 0U; i < ADRV903X_DIGITAL_PIN_GROUP_NUM; ++i) + { + recoveryAction = adrv903x_Core_PadSt_BfGet( device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + i, + &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + if (bfValue != ((enable == ADI_ENABLE) ? 0x3FU : 0x00U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + bfValue, + "Hysteresis Enable Issue"); + + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + i, + "Pad Group Number"); + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} \ No newline at end of file diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_cpu.c b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_cpu.c new file mode 100644 index 0000000000000..e241524a0c92d --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_cpu.c @@ -0,0 +1,2075 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_cpu.c +* \brief Contains CPU features related function implementation defined in +* adi_adrv903x_cpu.h +* +* ADRV903X API Version: 2.12.1.4 +*/ +#include "adi_adrv903x_cpu.h" + +#include "../../private/include/adrv903x_cpu.h" +#include "../../private/include/adrv903x_cpu_scratch_registers.h" +#include "../../private/include/adrv903x_reg_addr_macros.h" +#include "../../private/include/adrv903x_init.h" +#include "../../private/include/adrv903x_cpu_sw_bkpt_types.h" +#include "../../private/include/adrv903x_gpio.h" +#define ADI_FILE ADI_ADRV903X_FILE_PUBLIC_CPU + +static adi_adrv903x_ErrAction_e adrv903x_CpuStackPtrWrite(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const uint32_t* buf); + +static adi_adrv903x_ErrAction_e adrv903x_CpuBootAddrWrite(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const uint32_t* buf); + +static uint32_t adrv903x_ChannelToChannelId(const adi_adrv903x_Channels_e channel); + +/*****************************************************************************/ +/***** Helper functions' definition ******************************************/ +/*****************************************************************************/ +static adi_adrv903x_ErrAction_e adrv903x_CpuStackPtrWrite(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const uint32_t* buf) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + const adi_adrv903x_CpuAddr_t* cpuAddr = NULL; + const uint8_t* bytes = (const uint8_t*) buf; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + cpuAddr = &(device->devStateInfo.cpu.cpuAddr[cpuType]); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cpuAddr); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, buf); + + ADRV903X_SPIWRITEBYTE_RETURN("CPU_STACK_PTR_BYTE_0", cpuAddr->stackPtrAddr, bytes[0U], recoveryAction); + ADRV903X_SPIWRITEBYTE_RETURN("CPU_STACK_PTR_BYTE_1", cpuAddr->stackPtrAddr + 1u, bytes[1U], recoveryAction); + ADRV903X_SPIWRITEBYTE_RETURN("CPU_STACK_PTR_BYTE_2", cpuAddr->stackPtrAddr + 2u, bytes[2U], recoveryAction); + ADRV903X_SPIWRITEBYTE_RETURN("CPU_STACK_PTR_BYTE_3", cpuAddr->stackPtrAddr + 3u, bytes[3U], recoveryAction); + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_CpuBootAddrWrite(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const uint32_t* buf) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_CpuAddr_t* cpuAddr = NULL; + const uint8_t* bytes = (const uint8_t*) buf; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, buf); + + cpuAddr = &(device->devStateInfo.cpu.cpuAddr[cpuType]); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cpuAddr); + + ADRV903X_SPIWRITEBYTE_RETURN("CPU_BOOT_ADDR_BYTE_0", cpuAddr->bootAddr, bytes[0U], recoveryAction); + ADRV903X_SPIWRITEBYTE_RETURN("CPU_BOOT_ADDR_BYTE_1", cpuAddr->bootAddr + 1u, bytes[1U], recoveryAction); + ADRV903X_SPIWRITEBYTE_RETURN("CPU_BOOT_ADDR_BYTE_2", cpuAddr->bootAddr + 2u, bytes[2U], recoveryAction); + ADRV903X_SPIWRITEBYTE_RETURN("CPU_BOOT_ADDR_BYTE_3", cpuAddr->bootAddr + 3u, bytes[3U], recoveryAction); + + return recoveryAction; +} + +static uint32_t adrv903x_ChannelToChannelId(const adi_adrv903x_Channels_e channel) +{ + uint32_t div = 0U; + + for (div = 0U; div < 8U; div++) + { + if ((uint32_t)channel == (1U << div)) + { + break; + } + } + + return div; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuImageWrite(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuType_e cpuType, + const uint32_t byteOffset, + const uint8_t binary[], + const uint32_t byteCount) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_CpuAddr_t *cpuAddr = NULL; + uint32_t address[1] = { 0U }; + uint32_t debugOffset = 0U; + uint32_t profileOffset = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, binary, cleanup); + + /* Verify cpuType */ + if ((cpuType != ADI_ADRV903X_CPU_TYPE_0) && + (cpuType != ADI_ADRV903X_CPU_TYPE_1)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuType, "Invalid CPU type"); + goto cleanup; + } + + if ((byteCount == 0U) || + ((byteCount & 3U) > 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, byteCount, "Invalid Byte Count; Multiple of 4 Required"); + goto cleanup; + } + + if ((byteOffset & 3U) > 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, byteCount, "Invalid Byte Offset; Multiple of 4 Required"); + goto cleanup; + } + + /* extraction of stack pointer and boot address from top of array */ + if (byteOffset == 0U) + { + if (byteCount < 8U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, byteCount, "Invalid Byte Count; Minimum of 8 Required"); + goto cleanup; + } + + recoveryAction = adrv903x_CpuStackPtrWrite(device, cpuType, (const uint32_t *)binary); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Stack Pointer Write Issue"); + goto cleanup; + } + + recoveryAction = adrv903x_CpuBootAddrWrite(device, cpuType, (const uint32_t *)&binary[4U]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Boot Address Write Issue"); + goto cleanup; + } + } + + if (cpuType == ADI_ADRV903X_CPU_TYPE_1) + { + /* extraction of profile address */ + profileOffset = ADRV903X_PM_DEVICE_PROFILE_PTR & ADI_ADRV903X_CPU_0_BINARY_IMAGE_FILE_SIZE_MASK; + if ((profileOffset >= byteOffset) && + (profileOffset < (byteOffset + byteCount - 4U))) + { + device->devStateInfo.cpu.devProfileAddr = adrv903x_CpuIntFromBytesGet(binary + profileOffset - byteOffset, 4U); + } + } + + if (cpuType == ADI_ADRV903X_CPU_TYPE_0) + { + /* extraction of debug config address */ + debugOffset = ADRV903X_PM_DEBUG_CONFIG_BUF & ADI_ADRV903X_CPU_0_BINARY_IMAGE_FILE_SIZE_MASK; + if ((debugOffset >= byteOffset) && + (debugOffset < (byteOffset + byteCount - 4U))) + { + device->devStateInfo.cpu.devDebugConfigAddr = adrv903x_CpuIntFromBytesGet(binary + debugOffset - byteOffset, 4U); + } + +#if ADI_ADRV903X_API_VERSION_RANGE_CHECK > 0 + + /* extraction of rev data */ + { + uint32_t revOffset = 0U; + adi_adrv903x_Version_t minVersion = { 0U, 0U, 0U, 0U }; + + revOffset = ADRV903X_PM_DEVICE_REV_DATA & ADI_ADRV903X_CPU_0_BINARY_IMAGE_FILE_SIZE_MASK; + if ((revOffset >= byteOffset) && + (revOffset < (byteOffset + byteCount - 4U))) + { + device->devStateInfo.cpu.fwVersion.majorVer = adrv903x_CpuIntFromBytesGet(binary + revOffset - byteOffset, 4U); + } + + revOffset += 4U; + if ((revOffset >= byteOffset) && + (revOffset < (byteOffset + byteCount - 4U))) + { + device->devStateInfo.cpu.fwVersion.minorVer = adrv903x_CpuIntFromBytesGet(binary + revOffset - byteOffset, 4U); + } + + revOffset += 4U; + if ((revOffset >= byteOffset) && + (revOffset < (byteOffset + byteCount - 4U))) + { + device->devStateInfo.cpu.fwVersion.maintenanceVer = adrv903x_CpuIntFromBytesGet(binary + revOffset - byteOffset, 4U); + } + + revOffset += 4U; + if ((revOffset >= byteOffset) && + (revOffset < (byteOffset + byteCount - 4U))) + { + device->devStateInfo.cpu.fwVersion.buildVer = adrv903x_CpuIntFromBytesGet(binary + revOffset - byteOffset, 4U); + + recoveryAction = adi_adrv903x_ApiVersionGet(device, &minVersion); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "ApiVersionGet issue"); + goto cleanup; + } + + recoveryAction = adrv903x_ApiVersionRangeCheck(device, &device->devStateInfo.cpu.fwVersion, &minVersion, &minVersion); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "ApiVersionRangeCheck issue"); + goto cleanup; + } + } + } + #endif + } + + /* get the particular processor's address map */ + cpuAddr = &(device->devStateInfo.cpu.cpuAddr[cpuType]); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuAddr, cleanup); + + address[0U] = cpuAddr->progStartAddr + byteOffset; + + recoveryAction = adi_adrv903x_RegistersByteWrite(device, + NULL, + address[0], + binary, + byteCount); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register Write Issue"); + goto cleanup; + } + + /* mark the image loaded */ + cpuAddr->enabled = ADI_TRUE; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuProfileWrite(adi_adrv903x_Device_t* const device, + const uint32_t byteOffset, + const uint8_t binary[], + const uint32_t byteCount) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t address[1] = { device->devStateInfo.cpu.devProfileAddr + byteOffset }; + uint32_t profileByteCount = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, binary, cleanup); + + if((byteCount == 0U) || + ((byteCount & 3U) > 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, byteCount, "Invalid Byte Count; Multiple of 4 Required"); + goto cleanup; + } + + if ((byteOffset & 3U) > 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, byteCount, "Invalid Byte Offset; Multiple of 4 Required"); + goto cleanup; + } + +#if ADI_ADRV903X_API_VERSION_RANGE_CHECK > 0 + /* extraction of rev data */ + { + uint32_t revOffset = 0U; + adi_adrv903x_Version_t minVersion = { 0U, 0U, 0U, 0U }; + + if ((revOffset >= byteOffset) && + (revOffset < (byteOffset + byteCount - 4U))) + { + device->devStateInfo.cpu.devProfileVersion.majorVer = adrv903x_CpuIntFromBytesGet(binary + revOffset - byteOffset, 4U); + } + + revOffset += 4U; + if ((revOffset >= byteOffset) && + (revOffset < (byteOffset + byteCount - 4U))) + { + device->devStateInfo.cpu.devProfileVersion.minorVer = adrv903x_CpuIntFromBytesGet(binary + revOffset - byteOffset, 4U); + } + + revOffset += 4U; + if ((revOffset >= byteOffset) && + (revOffset < (byteOffset + byteCount - 4U))) + { + device->devStateInfo.cpu.devProfileVersion.maintenanceVer = adrv903x_CpuIntFromBytesGet(binary + revOffset - byteOffset, 4U); + } + + revOffset += 4U; + if ((revOffset >= byteOffset) && + (revOffset < (byteOffset + byteCount - 4U))) + { + device->devStateInfo.cpu.devProfileVersion.buildVer = adrv903x_CpuIntFromBytesGet(binary + revOffset - byteOffset, 4U); + + + recoveryAction = adi_adrv903x_ApiVersionGet(device, &minVersion); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Device Profile Version Get Issue"); + goto cleanup; + } + + recoveryAction = adrv903x_ApiVersionRangeCheck(device, &device->devStateInfo.cpu.devProfileVersion, &minVersion, &minVersion); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Device Profile Version Range Check Issue"); + goto cleanup; + } + } + } +#endif + + profileByteCount = sizeof(adrv903x_DeviceProfile_t); + if (byteOffset + byteCount > profileByteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, byteCount, "Invalid Byte Count; Must be equal or less than Device Profile"); + goto cleanup; + } + else + { + profileByteCount = byteCount; + } + + recoveryAction = adi_adrv903x_RegistersByteWrite(device, + NULL, + address[0], + binary, + byteCount); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Register Write Issue"); + goto cleanup; + } + cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuStart(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_CpuAddr_t *cpuAddr = NULL; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Set the start bit for CPU 0. CPU 0 will then start CPU 1 as required */ + cpuAddr = &(device->devStateInfo.cpu.cpuAddr[ADI_ADRV903X_CPU_TYPE_0]); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuAddr, cleanup); + + if (cpuAddr->enabled != ADI_FALSE) + { + /* Reset Mailbox */ + recoveryAction = adi_adrv903x_Register32Write( device, NULL, cpuAddr->mailboxGetAddr, 0xFFFFFFFFU, 0xFFFFFFFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Mailbox Reset Issue"); + goto cleanup; + } + + /* Clear Masking of Bus Errors before starting core */ + /* Using Direct SPI Write instead of AHB */ + recoveryAction = adrv903x_Core_Arm0MemHrespMask_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU 0 Clear Mask Bus Error Issue"); + goto cleanup; + } + + /* Set CPU0 as the primary CPU (and CPU1 as secondary) */ + recoveryAction = adrv903x_Core_ScratchReg_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ADRV903X_CPU_CPU0_IS_PRIMARY, + 0x1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Set CPU0 primary bitfield issue"); + goto cleanup; + } + recoveryAction = adrv903x_Core_ScratchReg_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ADRV903X_CPU_CPU1_IS_PRIMARY, + 0x0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Set CPU1 primary bitfield issue"); + goto cleanup; + } + + /* Start */ + /* Using Direct SPI Write instead of AHB */ + recoveryAction = adrv903x_Core_Arm0M3Run_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU 0 Start Issue"); + goto cleanup; + } + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuAddr->enabled, "CPU 0 FW image must be loaded"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuStartStatusCheck(adi_adrv903x_Device_t* const device, + const uint32_t timeout_us) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuBootStatus_e bootStatus = ADRV903X_CPU_BOOT_STATUS_POWER_UP; + uint32_t waitInterval_us = 0U; + uint32_t numEventChecks = 1U; + uint32_t eventCheck = 0U; + uint8_t cpuDebugLoaded = (device->devStateInfo.devState & ADI_ADRV903X_STATE_CPUDEBUGLOADED) ? 1U : 0U; + adi_adrv903x_CpuAddr_t* cpuAddr = NULL; + uint8_t tmpByte = 0U; + uint8_t bootFlag = 0U; + uint32_t errAddress = 0U; + uint32_t productId = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Determine the number of reads equivalent to the requested timeout */ + waitInterval_us = (ADI_ADRV903X_GETCPUBOOTUP_INTERVAL_US > timeout_us) ? timeout_us : ADI_ADRV903X_GETCPUBOOTUP_INTERVAL_US; + numEventChecks = (waitInterval_us == 0U) ? 1U : (timeout_us / waitInterval_us); + + /* Get CPU0's address map */ + cpuAddr = adrv903x_CpuAddrGet(&device->devStateInfo.cpu, ADI_ADRV903X_CPU_TYPE_0); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuAddr, cleanup); + + if (cpuAddr->enabled == ADI_FALSE) + { + /* The application has not called adi_adrv903x_CpuImageWrite successfully first */ + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_IMAGE_NOT_LOADED, + ADI_NO_VARIABLE, + recoveryAction); + goto cleanup; + } + + /* Note: There's no need to check CPU1 boot status. CPU0 will wait for CPU1 to boot before reporting + * it's own boot status as successful. + */ + + for (eventCheck = 0U; eventCheck <= numEventChecks; eventCheck++) + { + if (eventCheck == 0U) + { + /* Check CPU Boot has started */ + recoveryAction = adrv903x_Core_Arm0M3Run_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &bootFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + if (bootFlag == ADI_FALSE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, bootFlag, "CPU 0 Boot Not Started; PreMcsInit NOK"); + goto cleanup; + } + } + + /* Get the CPU boot status */ + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + ADRV903X_CPU_CPU0_BOOT_STATUS_SCRATCH_REG_ID, + &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "bootStatus read failed"); + goto cleanup; + } + + bootStatus = (adrv903x_CpuBootStatus_e)tmpByte; + + if (bootStatus == ADRV903X_CPU_BOOT_STATUS_POWER_UP || bootStatus == ADRV903X_CPU_BOOT_WAIT_FOR_CPUS) + { + /* Wait interval then check again */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, waitInterval_us); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Wait#1 failed"); + goto cleanup; + } + continue; + } + else if ((cpuDebugLoaded == 1U) && (bootStatus == ADRV903X_CPU_JTAG_BUILD_STATUS_READY)) + { + /* Wait interval then check again */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, waitInterval_us); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Wait#2 failed"); + goto cleanup; + } + continue; + } + else if ((cpuDebugLoaded == 0U) && (bootStatus == ADRV903X_CPU_JTAG_BUILD_STATUS_READY)) + { + /* CPU booted successfully into debug mode */ + device->devStateInfo.devState = (adi_adrv903x_ApiStates_e) (device->devStateInfo.devState | ADI_ADRV903X_STATE_CPUDEBUGLOADED); + break; + } + else if (bootStatus == ADRV903X_CPU_STATUS_READY) + { + /* CPU booted successfully to 'normal' mode */ + device->devStateInfo.devState = (adi_adrv903x_ApiStates_e)(device->devStateInfo.devState | ADI_ADRV903X_STATE_ALLCPUSLOADED); + break; + } + else + { + if (bootStatus == ADRV903X_CPU_BOOT_PID_PROFILE_MISMATCH_ERR) + { + /* Get Product ID for Additional Debug */ + if (ADI_ADRV903X_ERR_ACT_NONE == adi_adrv903x_Register32Read( device, + NULL, + ADRV903X_CPU_0_PM_EFUSE_SETTINGS_PTR, + &errAddress, + 0xFFFFFFFFU)) + { + (void) adi_adrv903x_Registers32Read(device, + NULL, + errAddress, + (uint32_t*) &productId, + NULL, + 1U); + productId = (uint8_t)productId; + } + + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU_BOOT, + bootStatus, + productId, + recoveryAction); + } + else + { + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU_BOOT, + bootStatus, + ADI_NO_VARIABLE, + recoveryAction); + } + + goto debug; + } + } + + if (eventCheck > numEventChecks) + { + /* Boot Timeout */ + ADI_ADRV903X_ERROR_INFO_GET_REPORT( ADI_ADRV903X_ERRSRC_CPU, + ADI_ADRV903X_ERRCODE_CPU_BOOT_TIMEOUT, + ADI_NO_VARIABLE, + recoveryAction); + goto debug; + } + +debug: + adrv903x_CpuErrorDebugCheck(device); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuConfigSet( adi_adrv903x_Device_t* const device, + const uint32_t objId, + const uint16_t offset, + const uint8_t configDataSet[], + const uint32_t length) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + char txBuf[sizeof(adrv903x_CpuCmd_SetConfigMaxSize_t)]; + adrv903x_CpuCmd_SetConfig_t* const setInfo = (adrv903x_CpuCmd_SetConfig_t *)&txBuf; + adrv903x_CpuCmd_SetConfigResp_t cmdRsp = { ADRV903X_CPU_SYSTEM_SIMULATED_ERROR }; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t i = 0U; + + adi_adrv903x_CpuType_e cpuType[] = { ADI_ADRV903X_CPU_TYPE_0, ADI_ADRV903X_CPU_TYPE_1 }; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, configDataSet, cleanup); + + if ((length > MAX_CONFIG_DATA_SIZE) || + (length == 0U)) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Length is zero or greater than MAX_CONFIG_DATA_SIZE"); + goto cleanup; + } + + ADI_LIBRARY_MEMSET(&txBuf[0U], 0, sizeof(txBuf)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(adrv903x_CpuCmd_SetConfigResp_t)); + + /* Prepare the command payload */ + setInfo->objId = ADRV903X_HTOCL(objId); + setInfo->offset = ADRV903X_HTOCS(offset); + setInfo->length = ADRV903X_HTOCS((uint16_t)length); + + ADI_LIBRARY_MEMCPY((void*)((uint8_t*)setInfo + sizeof(adrv903x_CpuCmd_SetConfig_t)), configDataSet, length) ; + + for (i = 0U; i < (uint32_t)ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++i) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + cpuType[i], + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_CONFIG, + (void*)setInfo, + sizeof(adrv903x_CpuCmd_SetConfig_t)+length, + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.cmdStatus, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuConfigGet( adi_adrv903x_Device_t* const device, + const uint32_t objId, + const uint16_t offset, + uint8_t configDataGet[], + const uint32_t length) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_GetConfig_t getInfo; + uint8_t rxBuf[sizeof(adrv903x_CpuCmd_GetConfigMaxSize_t)]; + adrv903x_CpuCmd_GetConfigResp_t* const getConfigRsp = (adrv903x_CpuCmd_GetConfigResp_t*)&rxBuf; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, configDataGet, cleanup); + + if (length > MAX_CONFIG_DATA_SIZE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Length is greater than MAX_CONFIG_DATA_SIZE"); + goto cleanup; + } + + ADI_LIBRARY_MEMSET(&rxBuf[0U], 0, sizeof(rxBuf)); + ADI_LIBRARY_MEMSET(&getInfo, 0, sizeof(adrv903x_CpuCmd_GetConfig_t)); + + /* Prepare the command payload */ + getInfo.objId = ADRV903X_HTOCL(objId); + getInfo.offset = ADRV903X_HTOCS(offset); + getInfo.length = ADRV903X_HTOCS((uint16_t)length); + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_CONFIG, + (void*)&getInfo, + sizeof(getInfo), + (void*)getConfigRsp, + sizeof(adrv903x_CpuCmd_GetConfigResp_t) + length, + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(getConfigRsp->cmdStatus, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + /* Extract the command-specific response from the response payload */ + ADI_LIBRARY_MEMCPY((void*)configDataGet, (void*)((uint8_t*)getConfigRsp + sizeof(adrv903x_CpuCmd_GetConfigResp_t)), length); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuDebugModeEnable( adi_adrv903x_Device_t* const device, + const uint32_t enableKey) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_EnterDebugMode_t setInfo = { 0 }; + adrv903x_CpuCmd_EnterDebugModeResp_t cmdRsp = { ADRV903X_CPU_SYSTEM_SIMULATED_ERROR }; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t i = 0U; + adi_adrv903x_CpuType_e cpuType[ADI_ADRV903X_CPU_TYPE_MAX_RADIO] = { ADI_ADRV903X_CPU_TYPE_0, ADI_ADRV903X_CPU_TYPE_1 }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Prepare the command payload */ + setInfo.debugModeKey = ADRV903X_HTOCL(enableKey); + + for (i = 0U; i < (uint32_t)ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++i) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + cpuType[i], + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_ENTER_DEBUG_MODE, + (void*)&setInfo, + sizeof(setInfo), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.cmdStatus, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuConfigUnlock( adi_adrv903x_Device_t* const device, + const uint32_t configKey) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_UnlockConfig_t setInfo = { 0 }; + adrv903x_CpuCmd_UnlockConfigResp_t cmdRsp = { ADRV903X_CPU_SYSTEM_SIMULATED_ERROR }; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t i = 0U; + adi_adrv903x_CpuType_e cpuType[ADI_ADRV903X_CPU_TYPE_MAX_RADIO] = { ADI_ADRV903X_CPU_TYPE_0, ADI_ADRV903X_CPU_TYPE_1 }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Prepare the command payload */ + setInfo.configKey = ADRV903X_HTOCL(configKey); + + for (i = 0U; i < (uint32_t)ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++i) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + cpuType[i], + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_UNLOCK_CONFIG, + (void*)&setInfo, + sizeof(setInfo), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.cmdStatus, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuControlCmdExec(adi_adrv903x_Device_t* const device, + const uint32_t objId, + const uint16_t cpuCmd, + const adi_adrv903x_Channels_e channel, + const uint8_t cpuCtrlData[], + const uint32_t lengthSet, + uint32_t* const lengthResp, + uint8_t ctrlResp[], + const uint32_t lengthGet) +{ + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + char txBuf[sizeof(adrv903x_CpuCmd_SetCtrlMaxSize_t)]; + char rxBuf[sizeof(adrv903x_CpuCmd_SetCtrlRespMaxSize_t)]; + adrv903x_CpuCmd_SetCtrl_t* const setInfo = (adrv903x_CpuCmd_SetCtrl_t*)&txBuf; + adrv903x_CpuCmd_SetCtrlResp_t* const cmdRsp = (adrv903x_CpuCmd_SetCtrlResp_t*)&rxBuf; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t fwChannel = 0U; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + if (lengthSet > 0U) + { + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuCtrlData, cleanup); + } + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, ctrlResp, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, lengthResp, cleanup); + + if (objId > 0xFFU) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, objId, "Ctrl command - Invalid Object ID."); + goto cleanup; + } + + /* Allow lengthSet 0 for some use cases (RX_QEC) */ + if (lengthSet > MAX_CTRL_DATA_SIZE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, lengthSet, "Ctrl command length is greater than MAX_CTRL_DATA_SIZE"); + goto cleanup; + } + + if (lengthGet <= 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, lengthGet, "Ctrl command response buffer size must be greater than 0"); + goto cleanup; + } + + /* Get the CPU that is responsible for the requested channel */ + recoveryAction = adrv903x_CpuChannelMappingGet(device, + channel, + (adrv903x_CpuObjectId_e)objId, + &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "Invalid channelMask provided"); + goto cleanup; + } + else + { + fwChannel = adrv903x_ChannelToChannelId(channel); + } + + ADI_LIBRARY_MEMSET(&txBuf[0U], 0, sizeof(txBuf)); + ADI_LIBRARY_MEMSET(&rxBuf[0U], 0, sizeof(rxBuf)); + + /* Prepare the command payload */ + setInfo->objId = ADRV903X_HTOCL(objId); + setInfo->ctrlCmd = ADRV903X_HTOCS(cpuCmd); + setInfo->channelNum = ADRV903X_HTOCL(fwChannel); + setInfo->length = ADRV903X_HTOCS((uint16_t)lengthSet); + + if (lengthSet > 0U) + { + ADI_LIBRARY_MEMCPY((void*)((uint8_t*)setInfo + sizeof(adrv903x_CpuCmd_SetCtrl_t)), cpuCtrlData, lengthSet); + } + + /* Send command and receive response. + * Since we don't know how much data the CPU will send back, + * we have to request MAX_CONFIG_DATA_SIZE bytes. We will only + * copy out cmdRsp->length bytes of it below. + */ + recoveryAction = adrv903x_CpuCmdSend( device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_CTRL, + (void*)setInfo, + sizeof(adrv903x_CpuCmd_SetCtrl_t) + lengthSet, + (void*)cmdRsp, + sizeof(adrv903x_CpuCmd_SetCtrlResp_t) + MAX_CONFIG_DATA_SIZE, + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp->cmdStatus, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + /* Read the response data from the CPU, if the caller's buffer can hold it. */ + *lengthResp = ADRV903X_CTOHS(cmdRsp->length); + if (*lengthResp <= lengthGet) + { + ADI_LIBRARY_MEMSET(ctrlResp, 0, lengthGet); + ADI_LIBRARY_MEMCPY(ctrlResp, (void*)((uint8_t*)cmdRsp + sizeof(adrv903x_CpuCmd_SetCtrlResp_t)), *lengthResp); + } + else + { + *lengthResp = 0U; + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, lengthGet, "Ctrl Cmd Response size is greater than response buffer size"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuLogFilterSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuLogEvent_e eventFilter, + const adi_adrv903x_CpuLogCpuId_e cpuIdFilter, + const adi_adrv903x_CpuLogObjIdFilter_t* const objIdFilter) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cpuTypeIdx = 0U; + adrv903x_CpuCmd_SetLogFilters_t setLogCmd; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, objIdFilter, cleanup); + + ADI_LIBRARY_MEMSET(&setLogCmd, 0, sizeof(setLogCmd)); + + if ((eventFilter < ADI_ADRV903X_CPU_LOG_EVENT_ERROR) || + (eventFilter > ADI_ADRV903X_CPU_LOG_EVENT_INVALID)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, eventFilter, "Invalid eventFilter provided."); + goto cleanup; + } + + /* cpuIdEventFilter == 0 is a valid parameter and is not checked here */ + if (((cpuIdFilter & ~ADI_ADRV903X_CPU_LOG_CPU_ID_ALL) != 0U) && + (cpuIdFilter != ADI_ADRV903X_CPU_LOG_CPU_ID_INVALID)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuIdFilter, "Invalid cpuIdFilter provided."); + goto cleanup; + } + + /* It is not possible to validate objIdFilter->objId (the list of Object IDs is sparse in the firmware) */ + if ((objIdFilter->objIdFilterEnable != ADI_ADRV903X_CPU_LOG_OBJ_ID_ENABLE) && + (objIdFilter->objIdFilterEnable != ADI_ADRV903X_CPU_LOG_OBJ_ID_DISABLE) && + (objIdFilter->objIdFilterEnable != ADI_ADRV903X_CPU_LOG_OBJ_ID_INVALID)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, objIdFilter->objIdFilterEnable, "Invalid objIdFilter.objIdFilterEnable provided."); + goto cleanup; + } + + /* Build the command */ + setLogCmd.logEventFilter = (adi_adrv903x_CpuLogEvent_t)eventFilter; + setLogCmd.cpuIdFilter = (adi_adrv903x_CpuLogCpuId_t)cpuIdFilter; + setLogCmd.objIdFilter.objIdFilterEnable = objIdFilter->objIdFilterEnable; + setLogCmd.objIdFilter.objId = ADRV903X_HTOCL(objIdFilter->objId); + + /* For each CPU, send the set-log-filters command and verify the response */ + for (cpuTypeIdx = (uint32_t) ADI_ADRV903X_CPU_TYPE_0; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_LOG_FILTERS, + &setLogCmd, + sizeof(setLogCmd), + NULL, + 0, + NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Log Filters Command Send Issue"); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuDebugCmdExec( adi_adrv903x_Device_t* const device, + const uint32_t objId, + const uint16_t cpuCmd, + const adi_adrv903x_Channels_e channel, + const uint8_t cpuDebugData[], + const uint32_t lengthSet, + uint32_t* const lengthResp, + uint8_t debugResp[], + const uint32_t lengthGet) +{ + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + char txBuf[sizeof(adrv903x_CpuCmd_DebugMaxSize_t)]; + char rxBuf[sizeof(adrv903x_CpuCmd_DebugRespMaxSize_t)]; + adrv903x_CpuCmd_Debug_t* const debugInfo = (adrv903x_CpuCmd_Debug_t*)&txBuf; + adrv903x_CpuCmd_DebugResp_t* const cmdRsp = (adrv903x_CpuCmd_DebugResp_t*)&rxBuf; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_NO_ERROR; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t fwChannel = 0U; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuDebugData, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, debugResp, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, lengthResp, cleanup); + + if (objId > 0xFFU) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, objId, "Cpu Debug command - Invalid Object ID."); + goto cleanup; + } + + if (lengthSet > MAX_DEBUG_DATA_SIZE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, lengthSet, "Cpu Debug command length is greater than MAX_CTRL_DATA_SIZE"); + goto cleanup; + } + + if (lengthSet <= 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, lengthSet, "Cpu Debug command length must be greater than 0"); + goto cleanup; + } + + if (lengthGet <= 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, lengthGet, "Cpu Debug command response buffer size must be greater than 0"); + goto cleanup; + } + + /* Get the CPU that is responsible for the requested channel */ + recoveryAction = adrv903x_CpuChannelMappingGet(device, + channel, + (adrv903x_CpuObjectId_e)objId, + &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "Invalid channelMask provided"); + goto cleanup; + } + else + { + fwChannel = adrv903x_ChannelToChannelId(channel); + } + + ADI_LIBRARY_MEMSET(&txBuf[0U], 0, sizeof(txBuf)); + ADI_LIBRARY_MEMSET(&rxBuf[0U], 0, sizeof(rxBuf)); + + /* Prepare the command payload */ + debugInfo->objId = ADRV903X_HTOCL(objId); + debugInfo->debugCmd = ADRV903X_HTOCS(cpuCmd); + debugInfo->channelNum = ADRV903X_HTOCL(fwChannel); + debugInfo->length = ADRV903X_HTOCS((uint16_t)lengthSet); + + ADI_LIBRARY_MEMCPY((void*)((uint8_t*)debugInfo + sizeof(adrv903x_CpuCmd_Debug_t)), cpuDebugData, lengthSet); + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_DEBUG, + (void*)debugInfo, + sizeof(adrv903x_CpuCmd_Debug_t)+lengthSet, + (void*)cmdRsp, + sizeof(adrv903x_CpuCmd_DebugResp_t), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp->cmdStatus, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + if (cmdRsp->length <= lengthGet) + { + ADI_LIBRARY_MEMSET(debugResp, 0, lengthGet); + *lengthResp = cmdRsp->length; + ADI_LIBRARY_MEMCPY(debugResp, ((adrv903x_CpuCmd_DebugMaxSize_t *)cmdRsp)->debugData, *lengthResp); + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, lengthGet, "Debug Cmd Response size is greater than response buffer size"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +static adi_adrv903x_ErrAction_e adrv903x_SendSysStatusCmd(adi_adrv903x_Device_t* const device, + const adrv903x_CpuCmd_SysStatusType_e type, + const adrv903x_CpuObjectId_e sysObjId, + const adi_adrv903x_Channels_e channel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + char txBuf[ADRV903X_CPU_CMD_MAX_SIZE_BYTES]; + adrv903x_CpuCmd_t* pCmd = NULL; + adrv903x_CpuCmd_GetSysStatus_t* pSysStatusCmd = NULL; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + + /* Get the CPU that is responsible for the requested channel */ + recoveryAction = adrv903x_CpuChannelMappingGet(device, channel, sysObjId, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid channel-to-CPU mapping"); + return recoveryAction; + } + + ADI_LIBRARY_MEMSET(&txBuf, 0, sizeof(txBuf)); + + /* Build the CPU command */ + pCmd = (adrv903x_CpuCmd_t*)txBuf; + pSysStatusCmd = (adrv903x_CpuCmd_GetSysStatus_t*)((uint8_t*)pCmd + sizeof(adrv903x_CpuCmd_t)); + pSysStatusCmd->type = (adrv903x_CpuCmd_SysStatusType_t)type; + pSysStatusCmd->sysObjId = ADRV903X_HTOCL(sysObjId); + pSysStatusCmd->channelNum = ADRV903X_HTOCL(adrv903x_ChannelToChannelId(channel)); + + /* Then send it */ + recoveryAction = adrv903x_CpuCmdWrite(device, cpuType, ADRV903X_LINK_ID_0, ADRV903X_CPU_CMD_ID_GET_SYS_STATUS, pCmd, sizeof(adrv903x_CpuCmd_GetSysStatus_t)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error sending GET_SYS_STATUS command."); + return recoveryAction; + } + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_GetSysStatusCmdResp(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Channels_e channel, + const size_t sysStatusSize, + void* const pRxBuf, + const void** const pSysStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmdId_t cmdId = 0U; + adrv903x_CpuCmdResp_t* pCmd = (adrv903x_CpuCmdResp_t*)pRxBuf; + adrv903x_CpuCmd_GetSysStatusResp_t* pCmdResp = (adrv903x_CpuCmd_GetSysStatusResp_t*)((uint8_t*)pCmd + sizeof(adrv903x_CpuCmdResp_t)); + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cmdErrorCode = ADRV903X_CPU_NO_ERROR; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, pRxBuf); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, pSysStatus); + + /* Get the CPU that is responsible for the requested channel */ + recoveryAction = adrv903x_CpuChannelMappingGet(device, channel, ADRV903X_CPU_OBJID_SYSTEM_END, &cpuType); /* use any objId other than ORX */ + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid channel-to-CPU mapping"); + return recoveryAction; + } + + /* Read the response from the CPU */ + recoveryAction = adrv903x_CpuCmdRespRead(device, cpuType, ADRV903X_LINK_ID_0, &cmdId, pCmd, sizeof(adrv903x_CpuCmd_GetSysStatusResp_t) + sysStatusSize, &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + if (cmdStatus == ADRV903X_CPU_CMD_STATUS_CMD_FAILED) + { + /* If the command failed for a command-specific reason, extract the command status code and log the error. */ + cmdErrorCode = (adrv903x_CpuErrorCode_e)ADRV903X_CTOHL((uint32_t)pCmdResp->cmdStatus); + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, cmdErrorCode, "GET_SYS_STATUS command failed."); + return recoveryAction; + } + else + { + /* Otherwise log a generic command failed error */ + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error getting response for GET_SYS_STATUS command."); + return recoveryAction; + } + } + + /* Find the sys status in the response payload, and set the caller's pointer to it. */ + *pSysStatus = (void*)((uint8_t*)pCmdResp + sizeof(adrv903x_CpuCmd_GetSysStatusResp_t)); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuChannelMappingGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_CpuType_e cpuTypes[], + const uint8_t numSerdesLanes) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + uint32_t chanSel = 0U; + uint8_t i = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(cpuTypes); + + + if (ADI_ADRV903X_MAX_SERDES_LANES > numSerdesLanes) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numSerdesLanes, "Invalid size of cpuTypes array. Should be equal or smaller to ADI_ADRV903X_MAX_SERDES_LANES"); + goto cleanup; + } + + for (i = 0U; i < numSerdesLanes; i++) + { + /* Get the CPU that is responsible for the requested lane. */ + chanSel = (uint32_t)(1U << i); + recoveryAction = adrv903x_CpuChannelMappingGet(device, (adi_adrv903x_Channels_e)(chanSel), ADRV903X_CPU_OBJID_IC_SERDES, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to retrieve cpuType for a particular Serdes lane."); + goto cleanup; + } + + cpuTypes[i] = cpuType; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuSysPvtStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Channels_e channel, + const uint32_t objId, + uint8_t cpuSysStatusGet[], + const uint32_t length) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + const void* pSysStatus = NULL; + const void** const ppSysStatus = &pSysStatus; + char rxBuf[ADRV903X_CPU_CMD_RESP_MAX_SIZE_BYTES]; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuSysStatusGet, cleanup); + + if ((channel != ADI_ADRV903X_CH0) && + (channel != ADI_ADRV903X_CH1) && + (channel != ADI_ADRV903X_CH2) && + (channel != ADI_ADRV903X_CH3) && + (channel != ADI_ADRV903X_CH4) && + (channel != ADI_ADRV903X_CH5) && + (channel != ADI_ADRV903X_CH6) && + (channel != ADI_ADRV903X_CH7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "channel parameter is invalid."); + goto cleanup; + } + + if ((objId <= (uint32_t) ADRV903X_CPU_OBJID_IC_END) || + ((objId >= (uint32_t) ADRV903X_CPU_OBJID_TC_START) && + (objId <= (uint32_t) ADRV903X_CPU_OBJID_TC_END)) || + (objId > (uint32_t) ADRV903X_CPU_OBJID_SYSTEM_END)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, length, "objId parameter is invalid."); + goto cleanup; + } + + if (length == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, length, "Length is zero."); + goto cleanup; + } + + if ((length + sizeof(adrv903x_CpuCmdResp_t) + sizeof(adrv903x_CpuCmd_GetSysStatusResp_t)) > sizeof(rxBuf)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, length, "Length exceeds maximum buffer size."); + goto cleanup; + } + + /* Send the system status get command to the CPU */ + recoveryAction = adrv903x_SendSysStatusCmd(device, ADRV903X_CPU_CMD_SYS_STATUS_PRIVATE, (adrv903x_CpuObjectId_e)objId, channel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SendCalStatusCmd failed"); + goto cleanup; + } + + /* Get the response from the CPU */ + recoveryAction = adrv903x_GetSysStatusCmdResp(device, channel, length, (void*)&rxBuf[0], ppSysStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GetCalStatusCmd failed"); + goto cleanup; + } + + if (pSysStatus == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GET_CAL_STATUS command failed"); + goto cleanup; + } + + ADI_LIBRARY_MEMCPY(cpuSysStatusGet, pSysStatus, length); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +static adi_adrv903x_ErrAction_e adrv903x_SysStatusGet(adi_adrv903x_Device_t* const device, + const adrv903x_CpuObjectId_e objId, + const adi_adrv903x_Channels_e channel, + adi_adrv903x_CpuSysStatus_t* const status) +{ + const adi_adrv903x_CpuSysStatus_t* pSysStatus = NULL; + const adi_adrv903x_CpuSysStatus_t** const ppSysStatus = &pSysStatus; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + char rxBuf[ADRV903X_CPU_CMD_RESP_MAX_SIZE_BYTES]; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, status); + + /* Send the sys status get command to the CPU */ + recoveryAction = adrv903x_SendSysStatusCmd(device, ADRV903X_CPU_CMD_SYS_STATUS_PUBLIC, objId, channel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SendSysStatusCmd failed"); + return recoveryAction; + } + + ADI_LIBRARY_MEMSET(&rxBuf, 0, sizeof(rxBuf)); + + /* Get the response from the CPU */ + recoveryAction = adrv903x_GetSysStatusCmdResp(device, channel, sizeof(adi_adrv903x_CpuSysStatus_t), (void*)&rxBuf[0], (const void** const)ppSysStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GetSysStatusCmdResp failed"); + return recoveryAction; + } + + if (pSysStatus != NULL) + { + /* Translate the response from the CPU */ + status->errorCode = ADRV903X_CTOHL(pSysStatus->errorCode); + status->placeHolder = ADRV903X_CTOHL(pSysStatus->placeHolder); + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuSysStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Channels_e channel, + const uint32_t objId, + adi_adrv903x_CpuSysStatus_t* const cpuSysStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuSysStatus, cleanup); + + if ((channel != ADI_ADRV903X_CH0) && + (channel != ADI_ADRV903X_CH1) && + (channel != ADI_ADRV903X_CH2) && + (channel != ADI_ADRV903X_CH3) && + (channel != ADI_ADRV903X_CH4) && + (channel != ADI_ADRV903X_CH5) && + (channel != ADI_ADRV903X_CH6) && + (channel != ADI_ADRV903X_CH7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channel, "channel parameter is invalid."); + goto cleanup; + } + + if ((objId <= (uint32_t) ADRV903X_CPU_OBJID_IC_END) || + ((objId >= (uint32_t) ADRV903X_CPU_OBJID_TC_START) && + (objId <= (uint32_t) ADRV903X_CPU_OBJID_TC_END)) || + (objId > (uint32_t) ADRV903X_CPU_OBJID_SYSTEM_END)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, objId, "objId parameter is invalid."); + goto cleanup; + } + + /* Use the common system status get handler to get the data from the CPU */ + recoveryAction = adrv903x_SysStatusGet(device, (adrv903x_CpuObjectId_e)objId, channel, cpuSysStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error getting cpu system status."); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuFwVersionGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_CpuFwVersion_t* const cpuFwVersion) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t verCpu[5U] = { 0U }; + adi_adrv903x_CpuAddr_t* cpuAddr = NULL; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_0; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuFwVersion, cleanup); + + if ((device->devStateInfo.devState & ADI_ADRV903X_STATE_CPU0LOADED) != ADI_ADRV903X_STATE_CPU0LOADED || + (device->devStateInfo.devState & ADI_ADRV903X_STATE_CPU1LOADED) != ADI_ADRV903X_STATE_CPU1LOADED) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU binary must be loaded before getting fw version"); + goto cleanup; + } + + /* Read the fw version from CPU */ + cpuType = ADI_ADRV903X_CPU_TYPE_0; + cpuAddr = adrv903x_CpuAddrGet(&device->devStateInfo.cpu, cpuType); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuAddr, cleanup); + recoveryAction = adi_adrv903x_Registers32Read(device, NULL, cpuAddr->versionAddr, verCpu, NULL, 5U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue during Reading CpuFwVersion CPU registers"); + goto cleanup; + } + + /* Store the fw Version */ + cpuFwVersion->commVer.majorVer = verCpu[0U]; + cpuFwVersion->commVer.minorVer = verCpu[1U]; + cpuFwVersion->commVer.maintenanceVer = verCpu[2U]; + cpuFwVersion->commVer.buildVer = verCpu[3U]; + + cpuFwVersion->cpuFwBuildType = (adi_adrv903x_CpuFwBuildType_e)(verCpu[4U] & (ADI_ADRV903X_CPU_FW_BUILD_DEBUG | ADI_ADRV903X_CPU_FW_BUILD_RELEASE | ADI_ADRV903X_CPU_FW_TRBLSHOOT)); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_HealthMonitorCpuStatusGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_HealthMonitorCpuStatus_t* const healthMonitorStatus) +{ + static const uint32_t CPU_HEALTH_STATUS_ADDR_MASK = 0xFFFFFFFFU; + const uint32_t BYTE_COUNT = sizeof(adi_adrv903x_HealthMonitorCpuStatus_t); + const uint32_t WORD_COUNT = ((BYTE_COUNT + 3U) / 4U); + uint32_t readData[WORD_COUNT]; + ADI_LIBRARY_MEMSET(readData, 0, 4U * WORD_COUNT); + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cpuHealthStatusAddr = 0U; + adi_adrv903x_HealthMonitorCpuStatus_t* tmpStatus = NULL; + + /* Verify inputs */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, healthMonitorStatus, cleanup); + + /* Clear memory for return data */ + ADI_LIBRARY_MEMSET(healthMonitorStatus, 0, sizeof(adi_adrv903x_HealthMonitorCpuStatus_t)); + + /* Read back cpu health status address */ + recoveryAction = adi_adrv903x_Register32Read(device, NULL, (uint32_t)(ADRV903X_PM_HEALTH_STATUS_PTR), &cpuHealthStatusAddr, CPU_HEALTH_STATUS_ADDR_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading cpu health status address"); + goto cleanup; + } + + /* Readback via shared cpu memory location */ + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, cpuHealthStatusAddr, (uint8_t *)readData, NULL, BYTE_COUNT); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading CPU Health Monitor Status"); + goto cleanup; + } + + /* Re-interrupt readData as the CPU byte-ordered struct. May leave some unused bytes at the tail of the read data. */ + tmpStatus = (adi_adrv903x_HealthMonitorCpuStatus_t*)readData; + + /* Correct byte order and copy to return struct */ + healthMonitorStatus->cpu0.initCalStatusMask = ADRV903X_CTOHLL(tmpStatus->cpu0.initCalStatusMask); + healthMonitorStatus->cpu0.numInitCalErrors = ADRV903X_CTOHL(tmpStatus->cpu0.numInitCalErrors); + healthMonitorStatus->cpu0.trackingCalStatusMask = ADRV903X_CTOHLL(tmpStatus->cpu0.trackingCalStatusMask); + healthMonitorStatus->cpu0.numTrackingCalErrors = ADRV903X_CTOHL(tmpStatus->cpu0.numTrackingCalErrors); + healthMonitorStatus->cpu0.numSystemErrors = ADRV903X_CTOHL(tmpStatus->cpu0.numSystemErrors); + healthMonitorStatus->cpu0.numSystemWarnings = ADRV903X_CTOHL(tmpStatus->cpu0.numSystemWarnings); + healthMonitorStatus->cpu0.cpuUsage = (adi_adrv903x_CpuUsage_e)(tmpStatus->cpu0.cpuUsage); + + healthMonitorStatus->cpu1.initCalStatusMask = ADRV903X_CTOHLL(tmpStatus->cpu1.initCalStatusMask); + healthMonitorStatus->cpu1.numInitCalErrors = ADRV903X_CTOHL(tmpStatus->cpu1.numInitCalErrors); + healthMonitorStatus->cpu1.trackingCalStatusMask = ADRV903X_CTOHLL(tmpStatus->cpu1.trackingCalStatusMask); + healthMonitorStatus->cpu1.numTrackingCalErrors = ADRV903X_CTOHL(tmpStatus->cpu1.numTrackingCalErrors); + healthMonitorStatus->cpu1.numSystemErrors = ADRV903X_CTOHL(tmpStatus->cpu1.numSystemErrors); + healthMonitorStatus->cpu1.numSystemWarnings = ADRV903X_CTOHL(tmpStatus->cpu1.numSystemWarnings); + healthMonitorStatus->cpu1.cpuUsage = (adi_adrv903x_CpuUsage_e)(tmpStatus->cpu1.cpuUsage); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuCheckException(adi_adrv903x_Device_t* const device, + uint32_t* const isException) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t cpuIdx = 0U; + uint32_t excpFlag = 0U; + const uint32_t cpuExceptionAddr[ADI_ADRV903X_CPU_TYPE_MAX_RADIO] = { ADRV903X_CPU_0_PM_EXCEPTION_FLAG, ADRV903X_CPU_1_PM_EXCEPTION_FLAG }; /* Exception Flag Memory */ + + /* Verify inputs */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, isException, cleanup); + + *isException = 0U; + + /* Check exception status of ARM CPUs*/ + for (cpuIdx = ADI_ADRV903X_CPU_TYPE_0; cpuIdx < ADI_ADRV903X_CPU_TYPE_MAX_RADIO; cpuIdx++) + { + recoveryAction = adi_adrv903x_Register32Read(device, NULL, cpuExceptionAddr[cpuIdx], &excpFlag, 0xFFFFFFFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Unable to Read Cpu Exception memory"); + goto cleanup; + } + if (excpFlag != 0U) + { + *isException |= (1U << cpuIdx); + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +static adi_adrv903x_ErrAction_e GetBreakPointTableIndexFromObjId(adi_adrv903x_Device_t* const device, + uint32_t objId, + uint8_t * tableId, + uint32_t * tableBaseAddr) +{ + static const uint32_t BREAKPOINT_TABLE_ADDR_MASK = 0xFFFFFFFFU; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t breakpointRowAddr = 0U; + uint32_t breakpointObjId = 0U; + uint32_t index = 0U; + + /* Read back global breakpoint table address */ + recoveryAction = adi_adrv903x_Register32Read(device, NULL, (uint32_t)(ADRV903X_PM_SW_BKPT_TABLE_PTR), tableBaseAddr, BREAKPOINT_TABLE_ADDR_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading breakpoint table address"); + return recoveryAction; + } + + for (index = 0U; index < ADRV903X_CPU_BKPT_TABLE_SIZE; index++) + { + breakpointRowAddr = (*tableBaseAddr) + (uint32_t)(sizeof(adi_adrv903x_SwBreakPointEntry_t)) * (uint32_t)index; + recoveryAction = adi_adrv903x_Register32Read(device, NULL, breakpointRowAddr, &breakpointObjId, BREAKPOINT_TABLE_ADDR_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading breakpoint object id from table"); + return recoveryAction; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + if (breakpointObjId == objId) + { + *tableId = index; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + } + } + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e GetBreakPointObjIdFromTableIndex(adi_adrv903x_Device_t* const device, + uint8_t tableId, + uint32_t * objId) +{ + static const uint32_t BREAKPOINT_TABLE_ADDR_MASK = 0xFFFFFFFFU; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t breakPointTableObjIdAddr = 0U; + uint32_t tableBaseAddr = 0U; + + /* Read back global breakpoint table address */ + recoveryAction = adi_adrv903x_Register32Read(device, NULL, (uint32_t)(ADRV903X_PM_SW_BKPT_TABLE_PTR), &tableBaseAddr, BREAKPOINT_TABLE_ADDR_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading breakpoint table address"); + return recoveryAction; + } + + breakPointTableObjIdAddr = tableBaseAddr + (uint32_t)tableId * (uint32_t)(sizeof(adi_adrv903x_SwBreakPointEntry_t)); + recoveryAction = adi_adrv903x_Register32Read(device, NULL, breakPointTableObjIdAddr, objId, BREAKPOINT_TABLE_ADDR_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading breakpoint object id from table"); + return recoveryAction; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_SwBreakPointEntry_t * breakPointCfg) +{ + static const uint32_t BREAKPOINT_TABLE_ADDR_MASK = 0xFFFFFFFFU; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t breakPointTableId = 0U; + uint32_t breakPointTableBaseAddr = 0U; + uint32_t breakPointTableChanMaskAddr = 0U; + uint32_t breakPointTableBkptMaskAddr = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, breakPointCfg, cleanup); + + static const uint32_t ALL_CHAN_MASK = ((uint32_t)ADI_ADRV903X_CH0 | + (uint32_t)ADI_ADRV903X_CH1 | + (uint32_t)ADI_ADRV903X_CH2 | + (uint32_t)ADI_ADRV903X_CH3 | + (uint32_t)ADI_ADRV903X_CH4 | + (uint32_t)ADI_ADRV903X_CH5 | + (uint32_t)ADI_ADRV903X_CH6 | + (uint32_t)ADI_ADRV903X_CH7); + + if ((breakPointCfg->chanMask & (~(uint32_t)ALL_CHAN_MASK)) != 0U) + { + /* Invalid channel mask */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, breakPointCfg->chanMask, "Invalid channel mask is selected."); + goto cleanup; + } + + recoveryAction = GetBreakPointTableIndexFromObjId(device, breakPointCfg->objId, &breakPointTableId, &breakPointTableBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading breakpoint table"); + goto cleanup; + } + + breakPointTableChanMaskAddr = breakPointTableBaseAddr + (uint32_t)breakPointTableId * (uint32_t)(sizeof(adi_adrv903x_SwBreakPointEntry_t)) + (uint32_t)(sizeof(breakPointCfg->objId)); + breakPointTableBkptMaskAddr = breakPointTableChanMaskAddr + (uint32_t)(sizeof(breakPointCfg->chanMask)); + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, breakPointTableChanMaskAddr, breakPointCfg->chanMask, BREAKPOINT_TABLE_ADDR_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing channel mask for selected breakpoint"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, breakPointTableBkptMaskAddr, breakPointCfg->bkptMask, BREAKPOINT_TABLE_ADDR_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing breakpoint mask for selected breakpoint"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SwBreakPointEntry_t * const breakPointCfgRead) +{ + static const uint32_t BREAKPOINT_TABLE_ADDR_MASK = 0xFFFFFFFFU; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t breakPointTableId = 0U; + uint32_t breakPointTableBaseAddr = 0U; + uint32_t breakPointTableChanMaskAddr = 0U; + uint32_t breakPointTableBkptMaskAddr = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, breakPointCfgRead, cleanup); + + recoveryAction = GetBreakPointTableIndexFromObjId(device, breakPointCfgRead->objId, &breakPointTableId, &breakPointTableBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading breakpoint table"); + goto cleanup; + } + + breakPointTableChanMaskAddr = breakPointTableBaseAddr + (uint32_t)breakPointTableId * (uint32_t)(sizeof(adi_adrv903x_SwBreakPointEntry_t)) + (uint32_t)(sizeof(breakPointCfgRead->objId)); + breakPointTableBkptMaskAddr = breakPointTableChanMaskAddr + (uint32_t)(sizeof(breakPointCfgRead->chanMask)); + + recoveryAction = adi_adrv903x_Register32Read(device, NULL, breakPointTableChanMaskAddr, &breakPointCfgRead->chanMask, BREAKPOINT_TABLE_ADDR_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading channel mask for selected breakpoint"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Read(device, NULL, breakPointTableBkptMaskAddr, &breakPointCfgRead->bkptMask, BREAKPOINT_TABLE_ADDR_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading breakpoint mask for selected breakpoint"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointHitRead(adi_adrv903x_Device_t* const device, + adi_adrv903x_SwBreakPointEntry_t * const cpu0BreakpointHit, + adi_adrv903x_SwBreakPointEntry_t * const cpu1BreakpointHit) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + static const uint32_t NO_BREAKPOINT_HIT_VALUE = 0xFFFFFFFFU; + uint8_t breakPointIdCpu0 = 0; + uint8_t breakPointNumCpu0 = 0; + uint8_t breakPointChIdCpu0 = 0; + uint8_t breakPointIdCpu1 = 0; + uint8_t breakPointNumCpu1 = 0; + uint8_t breakPointChIdCpu1 = 0; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpu0BreakpointHit, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpu1BreakpointHit, cleanup); + + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, (uint8_t)ADRV903X_CPU_CPU0_SWBKPT_INDEX_SCRATCH_REG_ID, &breakPointIdCpu0); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading Cpu0 breakpoint Id from scratchpad reg"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, (uint8_t)ADRV903X_CPU_CPU0_SWBKPT_BKPT_NUM_SCRATCH_REG_ID, &breakPointNumCpu0); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading Cpu0 breakpoint num from scratchpad reg"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, (uint8_t)ADRV903X_CPU_CPU0_SWBKPT_CHAN_NUM_SCRATCH_REG_ID, &breakPointChIdCpu0); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading Cpu0 breakpoint Ch Id from scratchpad reg"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, (uint8_t)ADRV903X_CPU_CPU1_SWBKPT_INDEX_SCRATCH_REG_ID, &breakPointIdCpu1); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading Cpu1 breakpoint Id from scratchpad reg"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, (uint8_t)ADRV903X_CPU_CPU1_SWBKPT_BKPT_NUM_SCRATCH_REG_ID, &breakPointNumCpu1); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading Cpu1 breakpoint num from scratchpad reg"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, (uint8_t)ADRV903X_CPU_CPU1_SWBKPT_CHAN_NUM_SCRATCH_REG_ID, &breakPointChIdCpu1); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading Cpu1 breakpoint Ch Id from scratchpad reg"); + goto cleanup; + } + + if (breakPointIdCpu0 == 0) + { + cpu0BreakpointHit->objId = NO_BREAKPOINT_HIT_VALUE; + cpu0BreakpointHit->bkptMask = NO_BREAKPOINT_HIT_VALUE; + cpu0BreakpointHit->chanMask = NO_BREAKPOINT_HIT_VALUE; + } + else + { + /* Cpu0 is hit a breakpoint */ + recoveryAction = GetBreakPointObjIdFromTableIndex(device, breakPointIdCpu0, &cpu0BreakpointHit->objId); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading CPU0 breakpoint object id"); + goto cleanup; + } + + cpu0BreakpointHit->bkptMask = (uint32_t)1U << (uint32_t)breakPointNumCpu0; + cpu0BreakpointHit->chanMask = (uint32_t)1U << (uint32_t)breakPointChIdCpu0; + } + + if (breakPointIdCpu1 == 0) + { + cpu1BreakpointHit->objId = NO_BREAKPOINT_HIT_VALUE; + cpu1BreakpointHit->bkptMask = NO_BREAKPOINT_HIT_VALUE; + cpu1BreakpointHit->chanMask = NO_BREAKPOINT_HIT_VALUE; + } + else + { + /* Cpu1 is hit a breakpoint */ + recoveryAction = GetBreakPointObjIdFromTableIndex(device, breakPointIdCpu1, &cpu1BreakpointHit->objId); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading CPU1 breakpoint object id"); + goto cleanup; + } + + cpu1BreakpointHit->bkptMask = (uint32_t)1U << (uint32_t)breakPointNumCpu1; + cpu1BreakpointHit->chanMask = (uint32_t)1U << (uint32_t)breakPointChIdCpu1; + } + + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointGpioCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpioOutputForBreakpointHit, + const adi_adrv903x_GpioPinSel_e gpioInputToResumeSleepingTasks) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Range check gpio */ + if (gpioOutputForBreakpointHit > ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gpioOutputForBreakpointHit, "Invalid GPIO selected. Out of range."); + goto cleanup; + } + + if (gpioInputToResumeSleepingTasks > ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gpioInputToResumeSleepingTasks, "Invalid GPIO selected. Out of range."); + goto cleanup; + } + + if ((gpioInputToResumeSleepingTasks == gpioOutputForBreakpointHit) && + (gpioInputToResumeSleepingTasks != ADI_ADRV903X_GPIO_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gpioInputToResumeSleepingTasks, "Invalid GPIO selected. GPIO pins can not be the same."); + goto cleanup; + } + + recoveryAction = adrv903x_CpuGpioSet(device, + gpioInputToResumeSleepingTasks, + ADRV903X_CPU_CMD_GPIO_SIGNAL_SWBKPT_RESUME_FROM_BKPT, + ADI_TRUE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while configuring the CPU GPIO input signal"); + goto cleanup; + } + + recoveryAction = adrv903x_CpuGpioSet(device, + gpioOutputForBreakpointHit, + ADRV903X_CPU_CMD_GPIO_SIGNAL_SWBKPT_BKPT_HIT, + ADI_FALSE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while configuring the CPU GPIO output signal"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointGpioCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioPinSel_e * const gpioOutputForBreakpointHit, + adi_adrv903x_GpioPinSel_e * const gpioInputToResumeSleepingTasks) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gpioOutputForBreakpointHit, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gpioInputToResumeSleepingTasks, cleanup); + + *gpioOutputForBreakpointHit = ADI_ADRV903X_GPIO_INVALID; + *gpioInputToResumeSleepingTasks = ADI_ADRV903X_GPIO_INVALID; + + recoveryAction = adrv903x_CpuGpioGet(device, gpioOutputForBreakpointHit, ADRV903X_CPU_CMD_GPIO_SIGNAL_SWBKPT_BKPT_HIT); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading GPIO pin for SW breakpoint hit signal"); + goto cleanup; + } + + recoveryAction = adrv903x_CpuGpioGet(device, gpioInputToResumeSleepingTasks, ADRV903X_CPU_CMD_GPIO_SIGNAL_SWBKPT_RESUME_FROM_BKPT); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading GPIO pin for SW resume signal"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointResume(adi_adrv903x_Device_t* const device, + const adi_adrv903x_SwBreakPointEntry_t * breakpointToResume, + uint8_t resumeAll) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_ResumeBkpt_t breakpointResumeCmd; + adrv903x_CpuCmd_ResumeBkptResp_t breakpointResumeCmdRsp; + uint32_t cpuTypeIdx = 0U; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, breakpointToResume, cleanup); + + ADI_LIBRARY_MEMSET(&breakpointResumeCmd, 0, sizeof(adrv903x_CpuCmd_ResumeBkpt_t)); + ADI_LIBRARY_MEMSET(&breakpointResumeCmdRsp, 0, sizeof(adrv903x_CpuCmd_ResumeBkptResp_t)); + + if (resumeAll > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, resumeAll, "resumeAll parameter can be either 0 or 1"); + goto cleanup; + } + + static const uint32_t ALL_CHAN_MASK = ((uint32_t)ADI_ADRV903X_CH0 | + (uint32_t)ADI_ADRV903X_CH1 | + (uint32_t)ADI_ADRV903X_CH2 | + (uint32_t)ADI_ADRV903X_CH3 | + (uint32_t)ADI_ADRV903X_CH4 | + (uint32_t)ADI_ADRV903X_CH5 | + (uint32_t)ADI_ADRV903X_CH6 | + (uint32_t)ADI_ADRV903X_CH7); + + if ((breakpointToResume->chanMask & (~(uint32_t)ALL_CHAN_MASK)) != 0U) + { + /* Invalid channel mask */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, breakpointToResume->chanMask, "Invalid channel mask is selected."); + goto cleanup; + } + + /* Fill out run bkpt resume cmd params with user-provided params */ + breakpointResumeCmd.objectID = ADRV903X_HTOCL(breakpointToResume->objId); + breakpointResumeCmd.chanMask = (uint8_t)(breakpointToResume->chanMask); + breakpointResumeCmd.bResumeAll = (uint8_t)(resumeAll); + + /* For each CPU, send the resume command, wait for a response, and process any errors. */ + for (cpuTypeIdx = 0U; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_RESUME_BKPT, + (void*)&breakpointResumeCmd, + sizeof(breakpointResumeCmd), + (void*)&breakpointResumeCmdRsp, + sizeof(breakpointResumeCmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(breakpointResumeCmdRsp.cmdStatus, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointResumeFromHalt(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + recoveryAction = adrv903x_Core_SpDbgGlobalResume_BfSet(device, NULL, ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, 0x0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to set resume bit"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointGlobalHaltMaskSet(adi_adrv903x_Device_t* const device, + const uint32_t globalHaltMask) +{ + static const uint32_t GLOBAL_HALTMASK_ADDR_MASK = 0xFFFFFFFFU; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t globalHaltMaskAddr = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Read back global halt mask address */ + recoveryAction = adi_adrv903x_Register32Read(device, NULL, (uint32_t)(ADRV903X_PM_SW_BKPT_GLOBAL_HALT_MASK_PTR), &globalHaltMaskAddr, GLOBAL_HALTMASK_ADDR_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading global halt mask address"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, globalHaltMaskAddr, globalHaltMask, GLOBAL_HALTMASK_ADDR_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing global halt mask value"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_BreakpointGlobalHaltMaskGet(adi_adrv903x_Device_t* const device, + uint32_t * const globalHaltMask) +{ + static const uint32_t GLOBAL_HALTMASK_ADDR_MASK = 0xFFFFFFFFU; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t globalHaltMaskAddr = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, globalHaltMask, cleanup); + + /* Read back global halt mask address */ + recoveryAction = adi_adrv903x_Register32Read(device, NULL, (uint32_t)(ADRV903X_PM_SW_BKPT_GLOBAL_HALT_MASK_PTR), &globalHaltMaskAddr, GLOBAL_HALTMASK_ADDR_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading global halt mask address"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Read(device, NULL, globalHaltMaskAddr, globalHaltMask, GLOBAL_HALTMASK_ADDR_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading global halt mask value"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); + +} diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_datainterface.c b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_datainterface.c new file mode 100644 index 0000000000000..462644a0706b5 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_datainterface.c @@ -0,0 +1,7908 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_datainterface.c +* \brief Contains function implementation defined in adi_adrv903x_datainterface.h +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#include "adi_adrv903x_datainterface.h" +#include "adi_adrv903x_cpu.h" +#include "adi_adrv903x_cals.h" +#include "adi_adrv903x_version.h" + +#include "../../private/include/adrv903x_datainterface.h" + +#include "../../private/include/adrv903x_cpu.h" +#include "../../private/include/adrv903x_cpu_cmd_ser_reset.h" +#include "../../private/include/adrv903x_init.h" +#include "../../private/include/adrv903x_reg_addr_macros.h" +#include "../../private/include/adrv903x_struct_endian.h" + + +#include "../../private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2.h" +#include "../../private/bf/adrv903x_bf_tx_dig.h" +#include "../../private/bf/adrv903x_bf_orx_dig.h" + + +#define ADI_FILE ADI_ADRV903X_FILE_PUBLIC_DATAINTERFACE +#define NELEMS(x) (sizeof(x) / sizeof((x)[0])) + +static adi_adrv903x_ErrAction_e adrv903x_IlasChksum(adi_adrv903x_Device_t* const device, + adi_adrv903x_DfrmCompareData_v2_t* dfrmData); + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxOrxDataCaptureStart( adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e channelSelect, + const adi_adrv903x_RxOrxDataCaptureLocation_e captureLocation, + uint32_t captureData[], + const uint32_t captureLength, + const uint8_t trigger, + const uint32_t timeout_us) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t config = 0U; + uint32_t cptCfgAddr = 0U; + adrv903x_CpuCmd_CaptureRamType_e captureRamType = ADRV903X_CPU_CMD_CAP_RAM_TYPE_DPD; + uint8_t success = 0U; + adi_adrv903x_Channels_e fwChannel = ADI_ADRV903X_CH0; + uint8_t bCptBusy = 1U; + uint32_t bStreamDbgFlag = 1U; + const uint32_t writeMask = 0xFFFFFFFFU; + uint32_t waitInterval_us = 0U; + uint32_t numEventChecks = 1U; + uint32_t eventCheck = 0U; + uint8_t curRadClkDivValue = 0U; + uint8_t newRadClkDivValue = 0U; + uint8_t streamingEnabled = 0U; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, captureData, cleanup); + + /* range check the capture data length parameter */ + if ((channelSelect == ADI_ADRV903X_ORX0 || + channelSelect == ADI_ADRV903X_ORX1) && + (captureLength == ADI_ADRV903X_CAPTURE_SIZE_16K || + captureLength == ADI_ADRV903X_CAPTURE_SIZE_32K)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, captureLength, "Error in captureLength size parameter. The captureLength for the ORx capture should be 12k or less"); + goto cleanup; + } + if (captureLength != ADI_ADRV903X_CAPTURE_SIZE_16K && + captureLength != ADI_ADRV903X_CAPTURE_SIZE_32K && + captureLength != ADI_ADRV903X_CAPTURE_SIZE_12K && + captureLength != ADI_ADRV903X_CAPTURE_SIZE_8K && + captureLength != ADI_ADRV903X_CAPTURE_SIZE_4K && + captureLength != ADI_ADRV903X_CAPTURE_SIZE_2K && + captureLength != ADI_ADRV903X_CAPTURE_SIZE_1K && + captureLength != ADI_ADRV903X_CAPTURE_SIZE_512 && + captureLength != ADI_ADRV903X_CAPTURE_SIZE_256 && + captureLength != ADI_ADRV903X_CAPTURE_SIZE_128 && + captureLength != ADI_ADRV903X_CAPTURE_SIZE_64 && + captureLength != ADI_ADRV903X_CAPTURE_SIZE_32) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, captureLength, "Error in captureLength size parameter."); + goto cleanup; + } + + /* range check the channel selection parameter */ + if (channelSelect != ADI_ADRV903X_RX0 && + channelSelect != ADI_ADRV903X_RX1 && + channelSelect != ADI_ADRV903X_RX2 && + channelSelect != ADI_ADRV903X_RX3 && + channelSelect != ADI_ADRV903X_RX4 && + channelSelect != ADI_ADRV903X_RX5 && + channelSelect != ADI_ADRV903X_RX6 && + channelSelect != ADI_ADRV903X_RX7 && + channelSelect != ADI_ADRV903X_ORX0 && + channelSelect != ADI_ADRV903X_ORX1 + ) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelSelect, "Error in the channel selection parameter. Invalid channel selected for capture or readback"); + goto cleanup; + } + + /* range check the capture location parameter */ + if (captureLocation != ADI_ADRV903X_CAPTURE_LOC_DDC0 && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_DATAPATH && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_DPD && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_DPD_PRE && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_DPD_POST && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_FSC && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_ORX_TX0 && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_ORX_TX1 && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_ORX_TX2 && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_ORX_TX3 && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_ORX_TX4 && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_ORX_TX5 && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_ORX_TX6 && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_ORX_TX7 && + captureLocation != ADI_ADRV903X_CAPTURE_LOC_DDC1) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, captureLocation, "Error in the data capture location parameter. Invalid location selected for capture"); + goto cleanup; + } + + /* Determine the number of reads equivalent to the requested timeout */ + waitInterval_us = (1000U > timeout_us) ? timeout_us : 1000U; + numEventChecks = (waitInterval_us == 0U) ? 1U : (timeout_us / waitInterval_us); + numEventChecks = (numEventChecks == 1) ? 2U : numEventChecks; /* Iterate at least twice through the for loops below so we wait at least once */ + + /* resolve the channel and ram type for the firmware */ + if (channelSelect == ADI_ADRV903X_ORX0) + { + captureRamType = ADRV903X_CPU_CMD_CAP_RAM_TYPE_ORX; + fwChannel = ADI_ADRV903X_CH0; + } + else if (channelSelect == ADI_ADRV903X_ORX1) + { + captureRamType = ADRV903X_CPU_CMD_CAP_RAM_TYPE_ORX; + fwChannel = ADI_ADRV903X_CH1; + } + else + { + fwChannel = (adi_adrv903x_Channels_e) channelSelect; + } + + /* Set the configuration */ + recoveryAction = adrv903x_RxOrxDataCaptureConfigSet(device, captureLocation, captureLength, &config); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, captureLocation, "Error setting the data capture configuration"); + goto cleanup; + } + + /* figure out what address the config register is in */ + recoveryAction = adrv903x_RxOrxDataCaptureConfigAddressGet(device, channelSelect, &cptCfgAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error determining the data capture configuration register base address"); + goto cleanup; + } + + /* Write the configuration to the capture control register */ + recoveryAction = adi_adrv903x_Register32Write(device, NULL, cptCfgAddr, config, writeMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to the data capture configuration register"); + goto cleanup; + } + + /* Retrieve the current divider n value so it can be reset after the capture completes */ + if (channelSelect == ADI_ADRV903X_ORX0 || + channelSelect == ADI_ADRV903X_ORX1) + { + recoveryAction = adrv903x_OrxDig_ObsCapMemClkDivideRatio_BfGet(device, + NULL, + (adrv903x_BfOrxDigChanAddr_e) (cptCfgAddr & ADI_ADRV903X_CAPTURE_LOC_SLICE_MASK), + &curRadClkDivValue); + } + else + { + recoveryAction = adrv903x_TxDig_RadClkDivideRatio_BfGet(device, + NULL, + (adrv903x_BfTxDigChanAddr_e) (cptCfgAddr & ADI_ADRV903X_CAPTURE_LOC_SLICE_MASK), + &curRadClkDivValue); + } + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from the capture memory clock divider bit field"); + goto cleanup; + } + + /* Calculate what the divider n value needs to be to match the capture clock rate to the sample rate */ + recoveryAction = adrv903x_RadClkDividerValueCalculate(device, + channelSelect, + captureLocation, + &newRadClkDivValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error calculating the capture memory clock divider value"); + goto cleanup; + } + + /* Set the capture clock divider n value */ + if (channelSelect == ADI_ADRV903X_ORX0 || + channelSelect == ADI_ADRV903X_ORX1) + { + recoveryAction = adrv903x_OrxDig_ObsCapMemClkDivideRatio_BfSet(device, + NULL, + (adrv903x_BfOrxDigChanAddr_e) (cptCfgAddr & ADI_ADRV903X_CAPTURE_LOC_SLICE_MASK), + newRadClkDivValue); + } + else + { + recoveryAction = adrv903x_TxDig_RadClkDivideRatio_BfSet(device, + NULL, + (adrv903x_BfTxDigChanAddr_e) (cptCfgAddr & ADI_ADRV903X_CAPTURE_LOC_SLICE_MASK), + newRadClkDivValue); + } + + /* Send firmware command to request access to the RAM */ + recoveryAction = adrv903x_CpuRamAccessStart(device, captureRamType, fwChannel, &success); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error during firmware interaction"); + goto cleanup; + } + + /* Check that RAM access has been granted */ + if (success == 1) + { + /* RAM is available for capture and read back + * if trigger is 0 immediately trigger the capture + * otherwise capture is triggered by the stream processor + */ + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to the capture memory clock divider bit field"); + goto cleanup; + } + + if (!trigger) + { + /* API sets the capture enable bit ; offset is accounted for in bf function so cptCfgAddr is masked to get the slice base address */ + if (channelSelect == ADI_ADRV903X_ORX0 || + channelSelect == ADI_ADRV903X_ORX1) + { + recoveryAction = adrv903x_OrxDig_CptTrigger_BfSet(device, + NULL, + (adrv903x_BfOrxDigChanAddr_e) (cptCfgAddr & ADI_ADRV903X_CAPTURE_LOC_SLICE_MASK), + (uint8_t) 1U); + } + else + { + recoveryAction = adrv903x_TxDig_TxCptTrigger_BfSet(device, + NULL, + (adrv903x_BfTxDigChanAddr_e) (cptCfgAddr & ADI_ADRV903X_CAPTURE_LOC_SLICE_MASK), + (uint8_t) 1U); + } + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to the data capture configuration register"); + goto cleanup; + } + } + } + else + { + /* RAM is not available for capture or read back */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error gaining access to the capture memory resource"); + goto cleanup; + } + + if (trigger) + { + /* poll the stream debug register scratch 1 */ + for (eventCheck = 0U; eventCheck <= numEventChecks; eventCheck++) + { + recoveryAction = adrv903x_RxOrxDataCaptureStreamDebugPoll(device, channelSelect, &bStreamDbgFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from stream debug register"); + goto cleanup; + } + + if (bStreamDbgFlag == 0) + { + break; + } + + if (eventCheck < numEventChecks) /* Don't wait on last iteration */ + { + /* Wait the specified wait interval, then check again for status. */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, waitInterval_us); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Issue"); + goto cleanup; + } + } + + } + + if (bStreamDbgFlag > 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Timed out waiting for the data capture to start"); + goto cleanup; + } + } + + /* poll the capture status register until capture busy goes low. */ + for (eventCheck = 0U; eventCheck <= numEventChecks; eventCheck++) + { + recoveryAction = adrv903x_StatusRegisterPoll(device, channelSelect, &bCptBusy); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from capture memory status register"); + goto cleanup; + } + + if (bCptBusy == 0) + { + break; + } + + if (eventCheck < numEventChecks) /* Don't wait on last iteration */ + { + /* Wait the specified wait interval, then check again for status. */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, waitInterval_us); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Issue"); + goto cleanup; + } + } + } + + if (bCptBusy > 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Timed out waiting for Internal RAM capture to complete"); + goto cleanup; + } + + /* API clears the capture enable bit ; offset is accounted for in bf function so cptCfgAddr is masked to get the slice base address */ + if (channelSelect == ADI_ADRV903X_ORX0 || + channelSelect == ADI_ADRV903X_ORX1) + { + recoveryAction = adrv903x_OrxDig_CptTrigger_BfSet( device, + NULL, + (adrv903x_BfOrxDigChanAddr_e) (cptCfgAddr & ADI_ADRV903X_CAPTURE_LOC_SLICE_MASK), + (uint8_t) 0U); + } + else + { + recoveryAction = adrv903x_TxDig_TxCptTrigger_BfSet( device, + NULL, + (adrv903x_BfTxDigChanAddr_e) (cptCfgAddr & ADI_ADRV903X_CAPTURE_LOC_SLICE_MASK), + (uint8_t) 0U); + } + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to the data capture configuration register"); + goto cleanup; + } + + /* Put the part into streaming mode to help facilitate the large, contiguous SPI reads in RAM */ + recoveryAction = adrv903x_SpiStreamingEntry(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue with entering Spi Streaming mode"); + goto cleanup; + } + streamingEnabled = 1U; + + /* Read back data from capture memory */ + recoveryAction = adrv903x_RxOrxDataCaptureRead(device, channelSelect, captureData, captureLength, captureLocation); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from capture memory bank 0"); + goto cleanup; + } + + /* Send firmware command to stop accessing the ram */ + if (success == 1U) + { + /* TODO: This breaks ORx readback */ + /* clear success */ + success = 0U; + recoveryAction = adrv903x_CpuRamAccessStop(device, captureRamType, fwChannel, &success); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error during firmware interaction"); + goto cleanup; + } + } + /* Check that RAM access has been revoked */ + if (success != 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to revoke access to the capture memory resource"); + goto cleanup; + } + + /* Set the capture clock divider n value back to what it was before the capture */ + if (channelSelect == ADI_ADRV903X_ORX0 || + channelSelect == ADI_ADRV903X_ORX1) + { + recoveryAction = adrv903x_OrxDig_ObsCapMemClkDivideRatio_BfSet(device, + NULL, + (adrv903x_BfOrxDigChanAddr_e) (cptCfgAddr & ADI_ADRV903X_CAPTURE_LOC_SLICE_MASK), + curRadClkDivValue); + } + else + { + recoveryAction = adrv903x_TxDig_RadClkDivideRatio_BfSet(device, + NULL, + (adrv903x_BfTxDigChanAddr_e) (cptCfgAddr & ADI_ADRV903X_CAPTURE_LOC_SLICE_MASK), + curRadClkDivValue); + } + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to the capture memory clock divider bit field"); + goto cleanup; + } + +cleanup: + if (streamingEnabled) + { + if (ADI_ADRV903X_ERR_ACT_NONE != adrv903x_SpiStreamingExit(device)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_INTERFACE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Spi Streaming Exit Issue"); + } + } + + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AdcSampleXbarSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + const adi_adrv903x_AdcSampleXbarCfg_t* const adcXbar) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + uint8_t adcIdx = 0U; + uint8_t validAdc = ADI_FALSE; + uint8_t mValue = 0U; + uint32_t i = 0U; + adi_adrv903x_AdcSampleXbarSel_e validAdcXbar[] = + { + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX0_BAND_0_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX0_BAND_0_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX0_BAND_1_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX0_BAND_1_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX1_BAND_0_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX1_BAND_0_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX1_BAND_1_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX1_BAND_1_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX2_BAND_0_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX2_BAND_0_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX2_BAND_1_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX2_BAND_1_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX3_BAND_0_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX3_BAND_0_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX3_BAND_1_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX3_BAND_1_DATA_Q, + + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX4_BAND_0_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX4_BAND_0_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX4_BAND_1_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX4_BAND_1_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX5_BAND_0_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX5_BAND_0_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX5_BAND_1_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX5_BAND_1_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX6_BAND_0_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX6_BAND_0_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX6_BAND_1_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX6_BAND_1_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_0_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_0_DATA_Q, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_1_DATA_I, + ADI_ADRV903X_JESD_FRM_SPLXBAR_RX7_BAND_1_DATA_Q, + + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_0, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_1, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_2, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_3, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_4, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_5, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_6, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_I_7, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_0, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_1, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_2, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_3, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_4, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_5, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_6, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX0_DATA_Q_7, + + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_0, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_1, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_2, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_3, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_4, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_5, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_6, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_I_7, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_0, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_1, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_2, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_3, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_4, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_5, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_6, + ADI_ADRV903X_JESD_FRM_SPLXBAR_ORX1_DATA_Q_7, + ADI_ADRV903X_JESD_FRM_SPLXBAR_INVALID + }; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, adcXbar, cleanup); + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, framerSel, &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + goto cleanup; + } + + /* Get the number of converters (M) */ + recoveryAction = adrv903x_JtxLink_JtxMCfg_BfGet(device, + NULL, + framerBaseAddr, + &mValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of converters for the selected framer"); + goto cleanup; + } + mValue += 1; + + if (mValue > ADI_ADRV903X_NUM_FRAMERS_SAMPLE_XBAR) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid M value read from the selected framer"); + goto cleanup; + } + + /* ADC Xbar values validation */ + for (adcIdx = 0; adcIdx < mValue; adcIdx++) + { + validAdc = ADI_FALSE; + for (i = 0; i < (sizeof(validAdcXbar) / sizeof(*validAdcXbar)); i++) + { + if (adcXbar->AdcSampleXbar[adcIdx] != validAdcXbar[i]) + { + continue; + } + else + { + validAdc = ADI_TRUE; + break; + } + } + + /* Expect validAdc to be true (1U) */ + if (validAdc == ADI_FALSE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid ADC Sample Crossbar selection"); + goto cleanup; + } + } + + + /* program the converters */ + for (adcIdx = 0; adcIdx < ADI_ADRV903X_NUM_FRAMERS_SAMPLE_XBAR; adcIdx++) + { + if (adcIdx < mValue) + { + recoveryAction = adrv903x_JtxLink_JtxConvSel_BfSet(device, + NULL, + framerBaseAddr, + adcIdx, + (uint8_t) adcXbar->AdcSampleXbar[adcIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting sample crossbar for the selected framer"); + goto cleanup; + } + } + else + { + /* Write ADI_ADRV903X_JESD_FRM_SPLXBAR_INVALID to unsed converters */ + recoveryAction = adrv903x_JtxLink_JtxConvSel_BfSet(device, + NULL, + framerBaseAddr, + adcIdx, + (uint8_t) ADI_ADRV903X_JESD_FRM_SPLXBAR_INVALID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting sample crossbar for the selected framer"); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_AdcSampleXbarGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + adi_adrv903x_AdcSampleXbarCfg_t* const adcXbar) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t xbarIdx = 0U; + uint8_t bfValue = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, adcXbar, cleanup); + + + { + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, framerSel, &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + goto cleanup; + } + + for (xbarIdx = 0U; xbarIdx < ADI_ADRV903X_NUM_FRAMERS_SAMPLE_XBAR; xbarIdx++) + { + /* Get the sample xbar converter */ + recoveryAction = adrv903x_JtxLink_JtxConvSel_BfGet(device, + NULL, + framerBaseAddr, + xbarIdx, + &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get sample xbar converter."); + goto cleanup; + } + adcXbar->AdcSampleXbar[xbarIdx] = (adi_adrv903x_AdcSampleXbarSel_e) bfValue; + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DacSampleXbarSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const adi_adrv903x_DacSampleXbarCfg_t* const dacXbar) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + uint8_t dacIdx = 0U; + uint8_t mValue = 0U; + uint8_t disabledCount = 0U; + uint8_t validDac = ADI_FALSE; + uint32_t i = 0U; + adi_adrv903x_DacSampleXbarSel_e validDacXbar[] = + { + ADI_ADRV903X_DEFRAMER_OUT0, + ADI_ADRV903X_DEFRAMER_OUT1, + ADI_ADRV903X_DEFRAMER_OUT2, + ADI_ADRV903X_DEFRAMER_OUT3, + ADI_ADRV903X_DEFRAMER_OUT4, + ADI_ADRV903X_DEFRAMER_OUT5, + ADI_ADRV903X_DEFRAMER_OUT6, + ADI_ADRV903X_DEFRAMER_OUT7, + ADI_ADRV903X_DEFRAMER_OUT8, + ADI_ADRV903X_DEFRAMER_OUT9, + ADI_ADRV903X_DEFRAMER_OUT10, + ADI_ADRV903X_DEFRAMER_OUT11, + ADI_ADRV903X_DEFRAMER_OUT12, + ADI_ADRV903X_DEFRAMER_OUT13, + ADI_ADRV903X_DEFRAMER_OUT14, + ADI_ADRV903X_DEFRAMER_OUT15, + ADI_ADRV903X_DEFRAMER_OUT_INVALID + }; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dacXbar, cleanup); + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + /* DAC Xbar values validation */ + for (dacIdx = 0; dacIdx < ADI_ADRV903X_NUM_DAC_SAMPLE_XBAR; dacIdx++) + { + /* validate each I and Q of a channel */ + validDac = ADI_FALSE; + for (i = 0; i < (sizeof(validDacXbar) / sizeof(*validDacXbar)); i++) + { + if (dacXbar->txDacChan[dacIdx] != validDacXbar[i]) + { + continue; + } + else + { + validDac = ADI_TRUE; + break; + } + } + + /* Expect validDac to be true (1U) */ + if (validDac == ADI_FALSE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid DAC Sample Crossbar selection"); + goto cleanup; + } + } + + /* Counting the disable sample xbar */ + for (dacIdx = 0; dacIdx < ADI_ADRV903X_NUM_DAC_SAMPLE_XBAR; dacIdx++) + { + /* Counting the disable ones */ + if (dacXbar->txDacChan[dacIdx] == ADI_ADRV903X_DEFRAMER_OUT_INVALID) + + { + disabledCount++; + } + } + + /* get M - Number of converters per device */ + recoveryAction = adrv903x_JrxLink_JrxCoreMCfg_BfGet(device, + NULL, + deframerBaseAddr, + &mValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of converters per device"); + goto cleanup; + } + + mValue += 1; + + /* Verify number of disabled selections, this should be equal to 'ADI_ADRV903X_NUM_DAC_SAMPLE_XBAR -mValue ' */ + if (disabledCount != (ADI_ADRV903X_NUM_DAC_SAMPLE_XBAR - mValue)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Number of valid converter selections doesn't match with deframer M value"); + goto cleanup; + } + + for (dacIdx = 0; dacIdx < ADI_ADRV903X_NUM_DAC_SAMPLE_XBAR; dacIdx++) + { + recoveryAction = adrv903x_JrxLink_JrxCoreConvSel_BfSet(device, + NULL, + deframerBaseAddr, + dacIdx, + (uint8_t) dacXbar->txDacChan[dacIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to Set sample xbar converter."); + goto cleanup; + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DacSampleXbarGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DacSampleXbarCfg_t* const dacXbar) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dacXbar, cleanup); + + recoveryAction = adrv903x_DacSampleXbarGet(device, + deframerSel, + dacXbar); + + if(recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting sample crossbar value for the selected deframer"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + adi_adrv903x_FramerCfg_t* const framerCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + uint8_t converter = 0U; + uint8_t enabledFramers = 0U; + uint8_t framerIdx = 0U; + uint8_t tmpByte = 0U; + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, framerCfg, cleanup); + ADI_LIBRARY_MEMSET(framerCfg, 0, sizeof(adi_adrv903x_FramerCfg_t)); + + /* Get all framers link state */ + recoveryAction =adrv903x_JesdCommon_JtxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &enabledFramers); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get framer link state failed"); + goto cleanup; + } + + /* currently not used */ + framerCfg->overSample = 0; + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, framerSel, &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + goto cleanup; + } + + /* Get the framer link type */ + recoveryAction = adrv903x_JtxLink_JtxLinkType_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->enableJesd204C); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link type for the selected framer"); + goto cleanup; + } + + /* Get the framer band ID */ + recoveryAction = adrv903x_JtxLink_JtxBidCfg_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->bankId); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get band ID for the selected framer"); + goto cleanup; + } + + /* Get the framer device link ID */ + recoveryAction = adrv903x_JtxLink_JtxDidCfg_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->deviceId); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get device link ID for the selected framer"); + goto cleanup; + } + + /* Get the framer lane ID */ + recoveryAction = adrv903x_JtxLink_JtxLidCfg_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->lane0Id); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane ID for the selected framer"); + goto cleanup; + } + + /* Get the number of converters (M) */ + recoveryAction = adrv903x_JtxLink_JtxMCfg_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->jesd204M); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of converters for the selected framer"); + goto cleanup; + } + ++framerCfg->jesd204M; + + /* Get the number of frames in a multi-frame/block (K) */ + recoveryAction = adrv903x_JtxLink_JtxKCfg_BfGet(device, + NULL, + framerBaseAddr, + &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of frames in a multi-frame/block for the selected framer"); + goto cleanup; + } + + framerCfg->jesd204K = tmpByte + 1; + + /* Get the number of octets per lane (F) */ + recoveryAction = adrv903x_JtxLink_JtxFCfg_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->jesd204F); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of octets per frame for the selected framer"); + goto cleanup; + } + ++framerCfg->jesd204F; + + /* Get the total number of bits per sample */ + recoveryAction = adrv903x_JtxLink_JtxNpCfg_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->jesd204Np); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get total number of bits per sample for the selected framer"); + goto cleanup; + } + ++framerCfg->jesd204Np; + + /* Get the number of multiblocks in extended multiblocks (E) */ + framerCfg->jesd204E = 0; + if (framerCfg->enableJesd204C) + { + recoveryAction = adrv903x_JtxLink_JtxECfg_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->jesd204E); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of multiblocks in extended multiblocks for the selected framer"); + goto cleanup; + } + } + + /* Get the scrambler enable */ + recoveryAction = adrv903x_JtxLink_JtxScrCfg_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->scramble); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get alternative scrambler enable for the selected framer"); + goto cleanup; + } + + /* Get the lane crossbar selection and physical lane crossbar */ + recoveryAction = adrv903x_FramerLaneEnableGet(device, framerSel, framerCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane crossbar selection and physical lane"); + goto cleanup; + } + + /* Get the LMFC phase adjustment */ + recoveryAction = adrv903x_JtxLink_JtxTplPhaseAdjust_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->lmfcOffset); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get the LMFC phase adjustment for the selected framer"); + goto cleanup; + } + + /* Get the Sysref for Relink */ + recoveryAction = adrv903x_JtxLink_JtxSysrefForRelink_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->newSysrefOnRelink); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get the Sysref Relink for the selected framer"); + goto cleanup; + } + + /* Get the Sync-N */ + recoveryAction = adrv903x_JtxLink_JtxSyncNSel_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->syncbInSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get the Sync-N for the selected framer"); + goto cleanup; + } + + /* Get the Sync In LVDS Mode Enable */ + recoveryAction = adrv903x_Core_SyncInLvdsSelectCmosUnselect_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &framerCfg->syncbInLvdsMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get the Sync In LVDS Mode Enable"); + goto cleanup; + } + + /* Get the Sync In LVDS Pn Invert */ + recoveryAction = adrv903x_Core_SyncInLvdsPnInvert_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + &framerCfg->syncbInLvdsPnInvert); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get the Sync In LVDS Pn Invert"); + goto cleanup; + } + + { + /* Get the ADC Sample Xbar */ + recoveryAction = adi_adrv903x_AdcSampleXbarGet(device, + framerSel, + &framerCfg->adcCrossbar); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get sample crossbar converter."); + goto cleanup; + } + } + + /* Check jesd204M for number of ADCs, mark the unused ones as ADI_ADRV903X_JESD_FRM_SPLXBAR_INVALID */ + for (converter = framerCfg->jesd204M; converter < ADI_ADRV903X_MAX_CONVERTER; converter++) + { + framerCfg->adcCrossbar.AdcSampleXbar[converter] = ADI_ADRV903X_JESD_FRM_SPLXBAR_INVALID; + } + + /* Get the sysref for start up */ + recoveryAction = adrv903x_JtxLink_JtxSysrefForStartup_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->sysrefForStartup); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get the sysref for start up"); + goto cleanup; + } + + /* Get the sysref-N shot enable */ + recoveryAction = adrv903x_JtxLink_JtxTplSysrefNShotEnable_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->sysrefNShotEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get the sysref-N shot enable"); + goto cleanup; + } + + /* Get the sysref-N shot count */ + recoveryAction = adrv903x_JtxLink_JtxTplSysrefNShotCount_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->sysrefNShotCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get the sysref-N shot count"); + goto cleanup; + } + + /* Get the sysref ignore when linked */ + recoveryAction = adrv903x_JtxLink_JtxTplSysrefIgnoreWhenLinked_BfGet(device, + NULL, + framerBaseAddr, + &framerCfg->sysrefIgnoreWhenLinked); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get the sysref ignore when linked"); + goto cleanup; + } + + /* Get the Framer IQ Rate and Lane Rate */ + switch ((int32_t) framerSel) + { + case ADI_ADRV903X_FRAMER_0: + framerIdx = 0; + break; + + case ADI_ADRV903X_FRAMER_1: + framerIdx = 1; + break; + + case ADI_ADRV903X_FRAMER_2: + framerIdx = 2; + break; + } + framerCfg->iqRate_kHz = device->initExtract.jesdSetting.framerSetting[framerIdx].iqRate_kHz; + framerCfg->laneRate_kHz = device->initExtract.jesdSetting.framerSetting[framerIdx].laneRate_kHz; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DeframerCfg_t* const deframerCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, deframerCfg, cleanup); + ADI_LIBRARY_MEMSET(deframerCfg, 0, sizeof(adi_adrv903x_DeframerCfg_t)); + + recoveryAction = adrv903x_DeframerCfgGet(device, + deframerSel, + ADI_ADRV903X_TXOFF, /* not used */ + deframerCfg, + true, + false /* No param scaling */ + ); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get deframer config failed"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerCfgGetScaled(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const adi_adrv903x_TxChannels_e chanSel, + adi_adrv903x_DeframerCfg_t* const deframerCfg, + const uint8_t bBypass) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, deframerCfg, cleanup); + ADI_LIBRARY_MEMSET(deframerCfg, 0, sizeof(adi_adrv903x_DeframerCfg_t)); + + recoveryAction = adrv903x_DeframerCfgGet(device, + deframerSel, + ADI_ADRV903X_TXOFF, /* not used */ + deframerCfg, + ADI_TRUE, + true /* param scaling */ + ); + (void)bBypass; + (void)chanSel; + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get scaled deframer config failed"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerLinkStateSet(adi_adrv903x_Device_t* device, + const uint8_t framerSelMask, + uint8_t const enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t framerLinkSet = 0U; + uint8_t framerIdx = 0U; + uint8_t framerSel = 0U; + + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Validate parameters */ + if (((framerSelMask & ~ADI_ADRV903X_ALL_FRAMERS) > 0U) || (framerSelMask == 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid framerSelMask."); + goto cleanup; + } + + if ((enable & ~(1U)) > 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid enable parameter."); + goto cleanup; + } + + /* Read the current framer link state */ + recoveryAction = adrv903x_JesdCommon_JtxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &framerLinkSet); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get framer link state"); + goto cleanup; + } + + for (framerIdx = 0; framerIdx < ADI_ADRV903X_MAX_FRAMERS; framerIdx++) + { + framerSel = 1U << framerIdx; + /* Skip unselected framer */ + if ((framerSel & framerSelMask) == 0) + { + continue; + } + + if (enable) + { + framerLinkSet |= framerSel; + } + else /* disable */ + { + framerLinkSet &= ~framerSel; + } + } + + recoveryAction = adrv903x_JesdCommon_JtxLinkEn_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + framerLinkSet); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set framer link state"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerLinkStateGet(adi_adrv903x_Device_t* const device, + uint8_t* const framerLinkState) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, framerLinkState, cleanup); + + /* Read the current framer link state */ + recoveryAction = adrv903x_JesdCommon_JtxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + framerLinkState); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get framer link state"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLinkStateSet(adi_adrv903x_Device_t* device, + const uint8_t deframerSelMask, + uint8_t const enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t deframerLinkSet = 0U; + uint8_t deframerIdx = 0U; + uint8_t deframerSel = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Validate parameters */ + if (((deframerSelMask & ~ADI_ADRV903X_ALL_DEFRAMER) > 0U) || (deframerSelMask == 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid deframerSelMask."); + goto cleanup; + } + + if ((enable & ~(1U)) > 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid enable parameter."); + goto cleanup; + } + + /* Get all deframers link state */ + recoveryAction = adrv903x_JesdCommon_JrxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &deframerLinkSet); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get deframer link state"); + goto cleanup; + } + + /* Prepare for deframers enabling and disabling */ + for (deframerIdx = 0; deframerIdx < ADI_ADRV903X_MAX_DEFRAMERS; deframerIdx++) + { + deframerSel = 1U << deframerIdx; + if ((deframerSel & deframerSelMask) > 0) + { + if (enable) + { + deframerLinkSet |= deframerSel; + } + else /* disable */ + { + deframerLinkSet &= ~deframerSel; + } + } + } + + recoveryAction = adrv903x_JesdCommon_JrxLinkEn_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + deframerLinkSet); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set deframer link state"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLinkStateGet(adi_adrv903x_Device_t* device, + uint8_t* const deframerLinkState) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, deframerLinkState, cleanup); + + /* Get all deframers link state */ + recoveryAction = adrv903x_JesdCommon_JrxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + deframerLinkState); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get deframer link state"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmPrbsCountReset(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + recoveryAction = adrv903x_JesdCommon_JrxTestLaneClearErrors_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to clear test lane JRX error"); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JrxTestLaneClearErrors_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to perform PRBS Count Reset"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmPrbsCheckerStateSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DfrmPrbsCfg_t * const dfrmPrbsCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dfrmPrbsCfg, cleanup); + + /* Validate parameters */ + if (dfrmPrbsCfg->polyOrder > ADI_ADRV903X_USERDATA) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid parameter: test mode"); + goto cleanup; + } + + /* Clear error counter for all lanes */ + recoveryAction = adi_adrv903x_DfrmPrbsCountReset(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to reset PRBS Count error"); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JrxTestSource_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + dfrmPrbsCfg->checkerLocation); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set Checker Location."); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JrxTestMode_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + dfrmPrbsCfg->polyOrder); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set Test Mode."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmPrbsCheckerStateGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_DfrmPrbsCfg_t * const dfrmPrbsCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t regValue = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dfrmPrbsCfg, cleanup); + + recoveryAction = adrv903x_JesdCommon_JrxTestSource_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + ®Value); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Checker Location."); + goto cleanup; + } + + dfrmPrbsCfg->checkerLocation = (adi_adrv903x_DeframerPrbsCheckLoc_e) regValue; + + recoveryAction = adrv903x_JesdCommon_JrxTestMode_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + ®Value); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Test Mode."); + goto cleanup; + } + + dfrmPrbsCfg->polyOrder = (adi_adrv903x_DeframerPrbsOrder_e) regValue; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSysrefCtrlSet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + uint8_t const enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t maskSysref = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Validate parameters */ + if (((framerSelMask & ~ADI_ADRV903X_ALL_FRAMERS) > 0U) || (framerSelMask == 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid framerSelMask."); + goto cleanup; + } + + if ((enable & ~(1U)) > 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid enable parameter."); + goto cleanup; + } + + /* Converting enable value to sysref mask value. + * Note that the sysref mask when high, mask any incoming SYSREF to 0 + */ + maskSysref = (enable == 0U) ? 1U : 0U; + + if (framerSelMask & ADI_ADRV903X_FRAMER_0) + { + recoveryAction = adrv903x_JtxLink_JtxTplSysrefMask_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_, + maskSysref); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set SYSREF CRTL for framer 0."); + goto cleanup; + } + } + + if (framerSelMask & ADI_ADRV903X_FRAMER_1) + { + recoveryAction = adrv903x_JtxLink_JtxTplSysrefMask_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_, + maskSysref); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set SYSREF CRTL for framer 1."); + goto cleanup; + } + } + + if (framerSelMask & ADI_ADRV903X_FRAMER_2) + { + recoveryAction = adrv903x_JtxLink_JtxTplSysrefMask_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_, + maskSysref); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set SYSREF CRTL for framer 2."); + goto cleanup; + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSysrefCtrlGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + uint8_t * const enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + uint8_t maskSysref = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, enable, cleanup); + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, framerSel, &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + goto cleanup; + } + + /* Read the current framer SYSREF CTRL */ + recoveryAction = adrv903x_JtxLink_JtxTplSysrefMask_BfGet(device, + NULL, + framerBaseAddr, + &maskSysref); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get framer SYSREF CTRL"); + goto cleanup; + } + + *enable = ((~maskSysref) & 0x01); + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerSysrefCtrlSet(adi_adrv903x_Device_t* const device, + const uint8_t deframerSelMask, + uint8_t const enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t maskSysref = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Validate parameters */ + if (((deframerSelMask & ~ADI_ADRV903X_ALL_DEFRAMER) > 0U) || (deframerSelMask == 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid deframerSelMask."); + goto cleanup; + } + + if ((enable & ~(1U)) > 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid enable parameter."); + goto cleanup; + } + + /* Converting enable value to sysref mask value. + * Note that the sysref mask when low, mask any incoming SYSREF to 0 + */ + maskSysref = enable; + + if (deframerSelMask & ADI_ADRV903X_DEFRAMER_0) + { + recoveryAction = adrv903x_JrxLink_JrxCoreSysrefEnable_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_, + maskSysref); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set SYSREF CRTL for deframer 0."); + goto cleanup; + } + } + + if (deframerSelMask & ADI_ADRV903X_DEFRAMER_1) + { + recoveryAction = adrv903x_JrxLink_JrxCoreSysrefEnable_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_, + maskSysref); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set SYSREF CRTL for deframer 1."); + goto cleanup; + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerSysrefCtrlGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + uint8_t * const enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + uint8_t regValue = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, enable, cleanup); + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + /* Read the current framer SYSREF CTRL */ + recoveryAction = adrv903x_JrxLink_JrxCoreSysrefEnable_BfGet(device, + NULL, + deframerBaseAddr, + ®Value); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get deframer SYSREF CTRL"); + goto cleanup; + } + + *enable = regValue; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerTestDataSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_FrmTestDataCfg_t * const frmTestDataCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t framerLinkState; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, frmTestDataCfg, cleanup); + + /* Validate parameters */ + if (((frmTestDataCfg->framerSelMask & ~ADI_ADRV903X_ALL_FRAMERS) > 0U) || + (frmTestDataCfg->framerSelMask == 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid framerSelMask."); + goto cleanup; + } + + if (frmTestDataCfg->framerSelMask & ADI_ADRV903X_FRAMER_0) + { + recoveryAction = adrv903x_JtxLink_JtxTestGenMode_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_, + (uint8_t) frmTestDataCfg->testDataSource); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set PRBS Test Gen Mode for framer 0."); + goto cleanup; + } + + recoveryAction = adrv903x_JtxLink_JtxTestGenSel_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_, + (uint8_t) frmTestDataCfg->injectPoint); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set PRBS Test Inject Point for framer 0."); + goto cleanup; + } + } + + if (frmTestDataCfg->framerSelMask & ADI_ADRV903X_FRAMER_1) + { + recoveryAction = adrv903x_JtxLink_JtxTestGenMode_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_, + (uint8_t) frmTestDataCfg->testDataSource); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set PRBS Test Gen Mode for framer 1."); + goto cleanup; + } + + recoveryAction = adrv903x_JtxLink_JtxTestGenSel_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_, + (uint8_t) frmTestDataCfg->injectPoint); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set PRBS Test Inject Point for framer 1."); + goto cleanup; + } + } + + if (frmTestDataCfg->framerSelMask & ADI_ADRV903X_FRAMER_2) + { + recoveryAction = adrv903x_JtxLink_JtxTestGenMode_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_, + (uint8_t) frmTestDataCfg->testDataSource); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set PRBS Test Gen Mode for framer 2."); + goto cleanup; + } + + recoveryAction = adrv903x_JtxLink_JtxTestGenSel_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_, + (uint8_t) frmTestDataCfg->injectPoint); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set PRBS Test Inject Point for framer 2."); + goto cleanup; + } + } + + /* Toggle framer link enable changing to PRBS otherwise PRBS might get stuck */ + /* Read the current framer link state */ + recoveryAction = adrv903x_JesdCommon_JtxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &framerLinkState); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get framer link state"); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JtxLinkEn_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + 0u); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set framer link state"); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JtxLinkEn_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + framerLinkState); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set framer link state"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerTestDataGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + adi_adrv903x_FrmTestDataCfg_t * const frmTestDataCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + uint8_t tmpByte = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, frmTestDataCfg, cleanup); + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, framerSel, &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + goto cleanup; + } + + /* Read the current framer PRBS Gen Mode */ + recoveryAction = adrv903x_JtxLink_JtxTestGenMode_BfGet(device, + NULL, + framerBaseAddr, + &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get framer PRBS Gen Mode"); + goto cleanup; + } + + frmTestDataCfg->testDataSource = (adi_adrv903x_FramerDataSource_e)tmpByte; + + /* Read the current framer PRBS Inject Point */ + recoveryAction = adrv903x_JtxLink_JtxTestGenSel_BfGet(device, + NULL, + framerBaseAddr, + &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get framer PRBS Inject Point"); + goto cleanup; + } + + frmTestDataCfg->injectPoint = (adi_adrv903x_FramerDataInjectPoint_e)tmpByte; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmPrbsErrCountGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_DfrmPrbsErrCounters_t * const counters) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t regData = 0U; + uint8_t laneIdx = 0U; + uint8_t tmpByte = 0U; + + adi_adrv903x_DfrmPrbsCfg_t dfrmPrbsCfg; + + ADI_LIBRARY_MEMSET(&dfrmPrbsCfg, 0, sizeof(adi_adrv903x_DfrmPrbsCfg_t)); + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, counters, cleanup); + + recoveryAction = adi_adrv903x_DfrmPrbsCheckerStateGet(device, &dfrmPrbsCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get the PRBS mode"); + goto cleanup; + } + + counters->sampleSource = dfrmPrbsCfg.checkerLocation; + if ( (dfrmPrbsCfg.checkerLocation == ADI_ADRV903X_PRBSCHECK_SAMPLEDATA) && (dfrmPrbsCfg.polyOrder != ADI_ADRV903X_USERDATA) ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error: The HW isn't configured as expected for sample data mode. Call adi_adrv903x_DfrmPrbsCheckerStateSet() with the appropriate config"); + goto cleanup; + } + + if (counters->sampleSource == ADI_ADRV903X_PRBSCHECK_SAMPLEDATA) + { + /* Trigger update of the sample error counters */ + recoveryAction = adrv903x_JesdCommon_JrxTestSampleUpdateErrorCount_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to update test sample error count."); + goto cleanup; + } + + /* Now read the sample counter value. We use the zeroth index only in sample mode. */ + recoveryAction = adrv903x_JesdCommon_JrxTestSampleErrorCount_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get test sample error count."); + goto cleanup; + } + + counters->laneErrors[0] = tmpByte; + + recoveryAction = adrv903x_JesdCommon_JrxTestSampleErrorFlag_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get test sample error flag."); + goto cleanup; + } + counters->errorStatus[0] |= ((regData & 1U) << 1); + + recoveryAction = adrv903x_JesdCommon_JrxTestSampleClearErrors_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get test sample error flag."); + goto cleanup; + } + counters->errorStatus[0] |= ((regData & 1U) << 2); + } + + if (counters->sampleSource == ADI_ADRV903X_PRBSCHECK_LANEDATA) + { + /* Trigger update of lane error counters */ + recoveryAction = adrv903x_JesdCommon_JrxTestLaneUpdateErrorCount_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to update test lane error count."); + goto cleanup; + } + + for (laneIdx = 0; laneIdx < ADI_ADRV903X_MAX_DESERIALIZER_LANES; laneIdx++) + { + recoveryAction = adrv903x_JesdCommon_JrxTestLaneErrorCount_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + &counters->laneErrors[laneIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get test lane error count."); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JrxTestLaneInv_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get test lane error count."); + goto cleanup; + } + + counters->errorStatus[laneIdx] = regData; + + recoveryAction = adrv903x_JesdCommon_JrxTestLaneInvalidDataFlag_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get test lane invalid data flag."); + goto cleanup; + } + + counters->errorStatus[laneIdx] |= ((regData & 1U) << 1U); + + recoveryAction = adrv903x_JesdCommon_JrxTestLaneErrorFlag_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get test lane error flag."); + goto cleanup; + } + + counters->errorStatus[laneIdx] |= ((regData & 1U) << 2U); + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerializerReset(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t framerLinkType = 0U; + uint8_t phyLanePd = 0U; + uint8_t phyLanePdMask = 0U; + uint8_t phyLaneIdx = 0U; + adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e laneSerdesPhyBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_0_; + adrv903x_CpuCmd_JtxLanePower_t jtxPwrCmd; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_LIBRARY_MEMSET(&jtxPwrCmd, 0, sizeof(jtxPwrCmd)); + + /* Get the framer link type: 204B or 204C - Check link0 type only */ + recoveryAction = adrv903x_JtxLink_JtxLinkType_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_, + &framerLinkType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link type for the selected framer"); + goto cleanup; + } + + /* The reset sequence differs for 204c/204b mode */ + if (framerLinkType == 0U) + { + /* 204B case: + * 1. Set the clock offset to 4 for powered-up lanes + * 2. Then send CPU_CMD_ID_JESD_SER_RESET */ + + /* Iterate over each jtx lane. If lane is powered-up set the clock offset to 4. */ + for(phyLaneIdx = 0U ; phyLaneIdx < ADI_ADRV903X_MAX_SERDES_LANES ; phyLaneIdx++) + { + recoveryAction = (adi_adrv903x_ErrAction_e) adrv903x_FramerLaneSerdesPhyBitfieldAddressGet(device, + phyLaneIdx, + &laneSerdesPhyBitfieldAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane serdes PHY address."); + goto cleanup; + } + + recoveryAction = adrv903x_GetJtxLanePoweredDown(device, + laneSerdesPhyBitfieldAddr, + &phyLanePd); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading Jtx lane power-up status"); + goto cleanup; + } + + if (phyLanePd == 0U) + { + /* Jtx lane is powered-up; set Clockoffset to 4 */ + recoveryAction = adrv903x_SerdesTxdigPhyRegmapCore1p2_ClkoffsetSerRc_BfSet( device, + NULL, + laneSerdesPhyBitfieldAddr, + 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing to serializer clock offset"); + goto cleanup; + } + } + } /* End for loop to set clock offset on powered lanes */ + + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + + adrv903x_CpuCmd_SerReset_t serReset; + adrv903x_CpuCmd_SerResetResp_t serResetResp; + ADI_LIBRARY_MEMSET(&serReset, 0, sizeof(adrv903x_CpuCmd_SerReset_t)); + ADI_LIBRARY_MEMSET(&serResetResp, 0, sizeof(adrv903x_CpuCmd_SerResetResp_t)); + + /* Use default reset parameter */ + serReset.serResetParm = ADRV903X_HTOCL(1u); + /* Send serializer reset command */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_JESD_SER_RESET, + (void*)&serReset, + sizeof(serReset), + (void*)&serResetResp, + sizeof(serResetResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(serResetResp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + } /* End 204b case */ + else + { + /* 204C case: + * 1. Power down currenty powered up lanes and set their FIFO addrs and clk offsets. + * 2. Power up ALL lanes. + * 3. Power down the originally powered down lanes. */ + for (phyLaneIdx = 0U; phyLaneIdx < ADI_ADRV903X_MAX_SERDES_LANES; phyLaneIdx++) + { + recoveryAction = (adi_adrv903x_ErrAction_e) adrv903x_FramerLaneSerdesPhyBitfieldAddressGet(device, + phyLaneIdx, + &laneSerdesPhyBitfieldAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane serdes PHY address."); + goto cleanup; + } + + recoveryAction = adrv903x_GetJtxLanePoweredDown(device, + laneSerdesPhyBitfieldAddr, + &phyLanePd); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading Jtx lane power-up status"); + goto cleanup; + } + + /* Keep track of powered-down lanes */ + phyLanePdMask |= phyLanePd << phyLaneIdx; + + if (phyLanePd == 0U) + { + /* Lane is powered up; power it down */ + /* Prepare the command payload to power-down the lane. uint8_t fields don't require HTOC conversion. */ + jtxPwrCmd.jtxLaneMask = 1U << phyLaneIdx; + jtxPwrCmd.jtxLanePower = 0x00; + + /* Send command. There is no cmd-specific response expected. + * This command is always sent to CPU0 regardless of lane-CPU assignment. */ + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_JESD_TX_LANE_POWER, + (void*)&jtxPwrCmd, + sizeof(jtxPwrCmd), + NULL, + 0U, + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to call CPU cmd ADRV903X_CPU_CMD_ID_JESD_TX_LANE_POWER"); + goto cleanup; + } + + /* set FIFO Start Addr to 1 */ + recoveryAction = adrv903x_SerdesTxdigPhyRegmapCore1p2_FifoStartAddr_BfSet( device, + NULL, + laneSerdesPhyBitfieldAddr, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing Fifo Start Address"); + goto cleanup; + } + + /* set Clockoffset to 1 */ + recoveryAction = adrv903x_SerdesTxdigPhyRegmapCore1p2_ClkoffsetSerRc_BfSet( device, + NULL, + laneSerdesPhyBitfieldAddr, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing digital logic clock shift"); + goto cleanup; + } + } + } /* end for loop per lane to set clk offset and fifo */ + + /* Power up all lanes */ + /* uint8_t fields don't require HTOC conversion. */ + jtxPwrCmd.jtxLaneMask = 0xFF; + jtxPwrCmd.jtxLanePower = 0xFF; + + /* Send command. There is no cmd-specific response expected. + * This command is always sent to CPU0 regardless of lane-CPU assignment. */ + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_JESD_TX_LANE_POWER, + (void*)&jtxPwrCmd, + sizeof(jtxPwrCmd), + NULL, + 0U, + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to call CPU cmd ADRV903X_CPU_CMD_ID_JESD_TX_LANE_POWER"); + goto cleanup; + } + + /* Now put the lanes that were powered down before this fn was called back into power-down. */ + jtxPwrCmd.jtxLaneMask = phyLanePdMask; + jtxPwrCmd.jtxLanePower = 0x00; + + /* Send command. There is no cmd-specific response expected. + * This command is always sent to CPU0 regardless of lane-CPU assignment. */ + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_JESD_TX_LANE_POWER, + (void*)&jtxPwrCmd, + sizeof(jtxPwrCmd), + NULL, + 0U, + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to re-powerdown disabled lanes."); + goto cleanup; + } + + } /* End 204c if */ + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerLmfcOffsetSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSelect, + const uint16_t lmfcOffset) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + uint16_t kValue = 0U; + uint8_t sValue = 0U; + uint8_t tmpByte = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, framerSelect, &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + goto cleanup; + } + + /* get K - Number of frames in extended multiblocks */ + recoveryAction = adrv903x_JtxLink_JtxKCfg_BfGet(device, + NULL, + framerBaseAddr, + &tmpByte); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of frames in extended multiblocks"); + goto cleanup; + } + + kValue = tmpByte + 1; + + /* get S - Samples per converter per frame */ + recoveryAction = adrv903x_JtxLink_JtxSCfg_BfGet(device, + NULL, + framerBaseAddr, + &sValue); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get samples per frame"); + goto cleanup; + } + ++sValue; + + if (lmfcOffset > ((kValue * sValue) - 1)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, lmfcOffset, "lmfcOffet should be less than or equal to K*S-1"); + goto cleanup; + } + + recoveryAction = adrv903x_JtxLink_JtxTplPhaseAdjust_BfSet(device, + NULL, + framerBaseAddr, + lmfcOffset); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing phase adjust value for the selected framer"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerLmfcOffsetGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSelect, + uint16_t * const lmfcOffset) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, lmfcOffset, cleanup); + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, framerSelect, &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + goto cleanup; + } + + recoveryAction = adrv903x_JtxLink_JtxTplPhaseAdjust_BfGet(device, + NULL, + framerBaseAddr, + lmfcOffset); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading phase adjust value for selected framer"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmLmfcOffsetSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSelect, + const uint16_t lmfcOffset) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + uint16_t kValue = 0U; + uint8_t sValue = 0U; + uint8_t tmpByte = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSelect, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + /* get K - Number of frames in extended multiblocks */ + recoveryAction = adrv903x_JrxLink_JrxCoreKCfg_BfGet(device, + NULL, + deframerBaseAddr, + &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of frames in extended multiblocks"); + goto cleanup; + } + + kValue = tmpByte + 1; + + /* get S - Samples per converter per frame */ + recoveryAction = adrv903x_JrxLink_JrxCoreSCfg_BfGet(device, + NULL, + deframerBaseAddr, + &sValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get samples per frame"); + goto cleanup; + } + ++sValue; + + if (lmfcOffset > ((kValue * sValue) - 1)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, lmfcOffset, "lmfcOffet should be less than or equal to K*S-1"); + goto cleanup; + } + + recoveryAction = adrv903x_JrxLink_JrxCorePhaseAdjust_BfSet(device, + NULL, + deframerBaseAddr, + lmfcOffset); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing phase adjust value"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmLmfcOffsetGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSelect, + uint16_t * const lmfcOffset) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, lmfcOffset, cleanup); + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSelect, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + recoveryAction = adrv903x_JrxLink_JrxCorePhaseAdjust_BfGet(device, + NULL, + deframerBaseAddr, + lmfcOffset); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading phase adjust value"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmPhaseDiffGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSelect, + uint16_t * const phaseDiff) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + uint16_t kValue = 0U; + uint8_t sValue = 0U; + uint16_t phaseDiffReadback = 0U; + uint16_t phaseAdjReadback = 0U; + uint16_t kTimesS = 0U; + uint8_t tmpByte = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, phaseDiff, cleanup); + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSelect, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + /* get K - Number of frames in extended multiblocks */ + recoveryAction = adrv903x_JrxLink_JrxCoreKCfg_BfGet(device, + NULL, + deframerBaseAddr, + &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get number of frames in extended multiblocks"); + goto cleanup; + } + + kValue = tmpByte + 1; + + /* get S - Samples per converter per frame */ + recoveryAction = adrv903x_JrxLink_JrxCoreSCfg_BfGet(device, + NULL, + deframerBaseAddr, + &sValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get samples per frame"); + goto cleanup; + } + ++sValue; + + /* get phase diff for selected deframer */ + recoveryAction = adrv903x_JrxLink_JrxCorePhaseDiff_BfGet(device, + NULL, + deframerBaseAddr, + &phaseDiffReadback); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading phase diff value from device"); + goto cleanup; + } + + recoveryAction = adrv903x_JrxLink_JrxCorePhaseAdjust_BfGet(device, + NULL, + deframerBaseAddr, + &phaseAdjReadback); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading phase adjust value"); + goto cleanup; + } + + kTimesS = (uint16_t)kValue * (uint16_t)sValue; + + /* Calculate the phase diff after the adjustment by using K*S circular buffer */ + *phaseDiff = (kTimesS + phaseDiffReadback - phaseAdjReadback) % kTimesS; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + adi_adrv903x_FramerStatus_t * const framerStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + uint8_t framerLinkType = 0U; + uint8_t regData = 0U; + const uint8_t linkType204C = 0x80U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, framerStatus, cleanup); + ADI_LIBRARY_MEMSET(framerStatus, 0, sizeof(adi_adrv903x_FramerStatus_t)); + + framerStatus->status = 0U; + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, framerSel, &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + goto cleanup; + } + + /* Get the framer link type: 204B or 204C */ + recoveryAction = adrv903x_JtxLink_JtxLinkType_BfGet(device, + NULL, + framerBaseAddr, + &framerLinkType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link type for the selected framer"); + goto cleanup; + } + + /* Get TPL CFG Invalid bit */ + recoveryAction = adrv903x_JtxLink_JtxTplCfgInvalid_BfGet(device, + NULL, + framerBaseAddr, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get TPL CFG invalid bit for the selected framer"); + goto cleanup; + } + framerStatus->status |= ((regData & 1U) << 0U); /* set bit 0 */ + + /* Get TPL Sysref Received bit */ + if (framerLinkType != 0U) /* 204C case */ + { + framerStatus->status |= linkType204C; /* set 204C bit */ + recoveryAction = adrv903x_JtxLink_JtxDl204cSysrefRcvd_BfGet(device, + NULL, + framerBaseAddr, + ®Data); + } + else /* 204B */ + { + framerStatus->status &= ~linkType204C; /* clear 204C bit */ + + recoveryAction = adrv903x_JtxLink_JtxTplSysrefRcvd_BfGet(device, + NULL, + framerBaseAddr, + ®Data); + } + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get TPL Sysref Received bit for the selected framer"); + goto cleanup; + } + framerStatus->status |= ((regData & 1U) << 1U); /* set bit 1 */ + + /* Get TPL Sysref Phase Err bit */ + recoveryAction = adrv903x_JtxLink_JtxTplSysrefPhaseErr_BfGet(device, + NULL, + framerBaseAddr, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get TPL Sysref Phase Err bit for the selected framer"); + goto cleanup; + } + framerStatus->status |= ((regData & 1U) << 2U); /* set bit 2 */ + + /* Get Pclk Slow Error bit */ + recoveryAction = adrv903x_JtxLink_JtxPclkSlowError_BfGet(device, + NULL, + framerBaseAddr, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Pclk Slow Error bit for the selected framer"); + goto cleanup; + } + framerStatus->status |= ((regData & 1U) << 3U); /* set bit 3 */ + + /* Get Pclk Fast Error bit */ + recoveryAction = adrv903x_JtxLink_JtxPclkFastError_BfGet(device, + NULL, + framerBaseAddr, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Pclk Fast Error bit for the selected framer"); + goto cleanup; + } + framerStatus->status |= ((regData & 1U) << 4U); /* set bit 4 */ + + if (framerLinkType != 0U) /* 204C case */ + { + goto cleanup; /* Done for 204C case */ + } + + /* Get SyncN Sel */ + recoveryAction = adrv903x_JtxLink_JtxSyncNSel_BfGet(device, + NULL, + framerBaseAddr, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get SyncN Sel for the selected framer"); + goto cleanup; + } + + /* Reset framer address to active framer depending to value of Sync Sel value */ + if (regData == 0) + { + framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + } + else if (regData == 1) + { + framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_1_; + } + else if (regData == 2) + { + framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_2_; + } + else + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SyncN Sel is invalid for the selected framer"); + goto cleanup; + } + + /* Get 204B SyncN */ + recoveryAction = adrv903x_JtxLink_JtxDl204bSyncN_BfGet(device, + NULL, + framerBaseAddr, + &framerStatus->syncNSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get SyncN for the selected framer"); + goto cleanup; + } + + /* Get 204B SyncNe Count */ + recoveryAction = adrv903x_JtxLink_JtxDl204bSyncNeCount_BfGet(device, + NULL, + framerBaseAddr, + &framerStatus->framerSyncNeCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get SyncNe Count for the selected framer"); + goto cleanup; + } + + /* Get 204B QBF State */ + recoveryAction = adrv903x_JtxLink_JtxDl204bState_BfGet(device, + NULL, + framerBaseAddr, + &framerStatus->qbfStateStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get QBF State for the selected framer"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DeframerStatus_t * const deframerStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + adi_adrv903x_DeframerCfg_t deframerCfg; /* Initialized later on */ + uint8_t deframerLinkType = 0U; + uint8_t laneId = 0U; + uint8_t laneSel = 0U; + uint8_t laneIdx = 0U; + uint8_t regData = 0U; + const uint8_t linkType204C = 0x01U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, deframerStatus, cleanup); + + ADI_LIBRARY_MEMSET(&deframerCfg, 0, sizeof(adi_adrv903x_DeframerCfg_t)); + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + /* Get the deframer link type: 204B or 204C */ + recoveryAction = adrv903x_JrxLink_JrxLinkType_BfGet(device, + NULL, + deframerBaseAddr, + &deframerLinkType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link type for the selected deframer"); + goto cleanup; + } + + /* Get Deframer Lane Crossbar information */ + recoveryAction = adrv903x_DeframerLaneEnableGet(device, deframerSel, &deframerCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane cross bar the selected deframer"); + goto cleanup; + } + + for (laneId = 0U; laneId < ADI_ADRV903X_MAX_SERDES_LANES; ++laneId) + { + laneSel = 1U << laneId; + if ((deframerCfg.deserializerLanesEnabled & laneSel) == laneSel) + { + /* Find first lane in use. */ + laneIdx = laneId; + break; + } + } + + if (deframerLinkType != 0) /* 204C case */ + { + deframerStatus->reserved |= linkType204C; /* Set 204C indication bit */ + + recoveryAction = adrv903x_JesdCommon_JrxDl204cState_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + &deframerStatus->status); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get 204C status for the selected deframer"); + goto cleanup; + } + + goto cleanup; /* Done for 204C case */ + } + + deframerStatus->reserved &= ~linkType204C; /* Clear 204C indication bit */ + + /* Get 204B SyncN Sel */ + recoveryAction = adrv903x_JrxLink_JrxCoreSyncNSel_BfGet(device, + NULL, + deframerBaseAddr, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get SyncN Sel for the selected deframer"); + goto cleanup; + } + deframerStatus->status |= ((regData & 1U) << 0U); /* set bit 0 */ + + /* Get 204B Sysref Received */ + recoveryAction = adrv903x_JrxLink_JrxCoreSysrefRcvd_BfGet(device, + NULL, + deframerBaseAddr, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Sysref Received for the selected deframer"); + goto cleanup; + } + deframerStatus->status |= ((regData & 1U) << 1U); /* set bit 1 */ + + /* Get 204B User Data */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bUserData_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get User Data for the selected deframer"); + goto cleanup; + } + deframerStatus->status |= ((regData & 1U) << 2U); /* set bit 2 */ + + /* deframerStatus->status bit 3 is reserved */ + + /* Get 204B FS Lost */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bFsLost_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get FS Lost for the selected deframer"); + goto cleanup; + } + deframerStatus->status |= ((regData & 1U) << 4U); /* set bit 4 */ + + /* Get 204B EOMF Event */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bEomfEvent_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get EOMF Event for the selected deframer"); + goto cleanup; + } + deframerStatus->status |= ((regData & 1U) << 5U); /* set bit 5 */ + + /* Get 204B EOF Event */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bEofEvent_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get EOF Event for the selected deframer"); + goto cleanup; + } + deframerStatus->status |= ((regData & 1U) << 6U); /* set bit 6 */ + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerStatusGet_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DeframerStatus_v2_t * const deframerStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + adi_adrv903x_DeframerCfg_t deframerCfg; /* Initialized later on */ + uint8_t deframerLinkType = 0U; + uint8_t laneId = 0U; + uint8_t phyLaneId = 0U; + uint8_t regData = 0U; + const uint8_t linkType204C = 0x01U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, deframerStatus, cleanup); + + ADI_LIBRARY_MEMSET(&deframerCfg, 0, sizeof(adi_adrv903x_DeframerCfg_t)); + ADI_LIBRARY_MEMSET(deframerStatus, 0, sizeof(adi_adrv903x_DeframerStatus_v2_t)); + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + /* Get deframer link up/down status and set linkState bit 1 */ + recoveryAction = adrv903x_JrxLink_JrxCoreUsrDataRdy_BfGet(device, + NULL, + deframerBaseAddr, + ®Data); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link condition for the selected deframer"); + goto cleanup; + } + + if (regData == 1U) + { + deframerStatus->linkState |= 1U << 1U; /* Set linkState bit 1 */ + } + else + { + deframerStatus->linkState &= ~(1U << 1U); /* Clear linkState bit 1 */ + } + + /* Get Deframer Lane Crossbar information and set phyLaneMask */ + recoveryAction = adrv903x_DeframerLaneEnableGet(device, deframerSel, &deframerCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane cross bar the selected deframer"); + goto cleanup; + } + + /* Get the deframer link type: 204B or 204C */ + recoveryAction = adrv903x_JrxLink_JrxLinkType_BfGet(device, + NULL, + deframerBaseAddr, + &deframerLinkType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link type for the selected deframer"); + goto cleanup; + } + + if (deframerLinkType != 0U) + { + /* 204C link type case */ + deframerStatus->linkState |= linkType204C; /* Set linkState bit 0 to indicate link type 204C */ + } + else + { + /* 204B link type case */ + deframerStatus->linkState &= ~linkType204C; /* Clear linkState bit 0 to indicate link type 204B */ + } + + for (laneId = 0U; laneId < ADI_ADRV903X_MAX_SERDES_LANES; ++laneId) + { + phyLaneId = deframerCfg.deserializerLaneCrossbar.deframerInputLaneSel[laneId]; + + /* verify that physical lane is enabled */ + if (phyLaneId < ADI_ADRV903X_MAX_SERDES_LANES) + { + deframerStatus->phyLaneMask |= (0x1U << phyLaneId); /* enable phy lane in Mask */ + deframerStatus->laneStatus[phyLaneId] |= (1U << 3U); /* Set bit 3 to indicate this lane is enabled */ + } + else + { + continue; /* out of range phyLaneId means not enabled */ + } + + /* 204C link type case */ + if (deframerLinkType != 0U) + { + recoveryAction = adrv903x_JesdCommon_JrxDl204cState_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + phyLaneId, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get 204C status for the selected deframer"); + goto cleanup; + } + + deframerStatus->laneStatus[phyLaneId] |= (regData & 0x07U); /* Get lane status bit 0, 1, and 2 */ + continue; /* Get next lane status */ + } + + /* Get 204B SyncN Sel */ + recoveryAction = adrv903x_JrxLink_JrxCoreSyncNSel_BfGet(device, + NULL, + deframerBaseAddr, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get SyncN Sel for the selected deframer"); + goto cleanup; + } + deframerStatus->laneStatus[phyLaneId] |= ((regData & 1U) << 0U); /* set bit 0 */ + + /* Get 204B Sysref Received */ + recoveryAction = adrv903x_JrxLink_JrxCoreSysrefRcvd_BfGet(device, + NULL, + deframerBaseAddr, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Sysref Received for the selected deframer"); + goto cleanup; + } + deframerStatus->laneStatus[phyLaneId] |= ((regData & 1U) << 1U); /* set bit 1 */ + + /* Get 204B User Data */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bUserData_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + phyLaneId, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get User Data for the selected deframer"); + goto cleanup; + } + deframerStatus->laneStatus[phyLaneId] |= ((regData & 1U) << 2U); /* set bit 2 */ + + /* deframerStatus->status bit 3 is reserved */ + + /* Get 204B FS Lost */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bFsLost_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + phyLaneId, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get FS Lost for the selected deframer"); + goto cleanup; + } + deframerStatus->laneStatus[phyLaneId] |= ((regData & 1U) << 4U); /* set bit 4 */ + + /* Get 204B EOMF Event */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bEomfEvent_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + phyLaneId, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get EOMF Event for the selected deframer"); + goto cleanup; + } + deframerStatus->laneStatus[phyLaneId] |= ((regData & 1U) << 5U); /* set bit 5 */ + + /* Get 204B EOF Event */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bEofEvent_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + phyLaneId, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get EOF Event for the selected deframer"); + goto cleanup; + } + deframerStatus->laneStatus[phyLaneId] |= ((regData & 1U) << 6U); /* set bit 6 */ + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmErrCounterStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const uint8_t laneNumber, + adi_adrv903x_DfrmErrCounterStatus_t * const errCounterStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + uint8_t regData = 0U; + uint8_t deframerLinkType = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, errCounterStatus, cleanup); + + if (laneNumber >= ADI_ADRV903X_MAX_SERDES_LANES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid laneNumber for the selected deframer."); + goto cleanup; + } + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + /* Get the deframer link type: 204B or 204C */ + recoveryAction = adrv903x_JrxLink_JrxLinkType_BfGet(device, + NULL, + deframerBaseAddr, + &deframerLinkType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link type for the selected deframer"); + goto cleanup; + } + + if (deframerLinkType != 0U) /* 204C */ + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid link type: only supports 204B link."); + goto cleanup; + } + + /* Get 204B BDE */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bBde_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Bad Disparity errors for the selected deframer"); + goto cleanup; + } + errCounterStatus->laneStatus |= ((regData & 1U) << 0U); /* set bit 0 */ + + /* Get 204B CGS */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bCgs_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Code Group Sync for the selected deframer"); + goto cleanup; + } + errCounterStatus->laneStatus |= ((regData & 1U) << 1U); /* set bit 1 */ + + /* Get 204B CKS */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bCks_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Computed CheckSum status for the selected deframer"); + goto cleanup; + } + errCounterStatus->laneStatus |= ((regData & 1U) << 2U); /* set bit 2 */ + + /* Get 204B FS */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bFs_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Frame Sync status for the selected deframer"); + goto cleanup; + } + errCounterStatus->laneStatus |= ((regData & 1U) << 3U); /* set bit 3 */ + + /* Get 204B ILD */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bIld_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Inter-Lane De-skew status for the selected deframer"); + goto cleanup; + } + errCounterStatus->laneStatus |= ((regData & 1U) << 4U); /* set bit 4 */ + + /* Get 204B ILS */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bIls_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Initial Lane Synchronization status for the selected deframer"); + goto cleanup; + } + errCounterStatus->laneStatus |= ((regData & 1U) << 5U); /* set bit 5 */ + + /* Get 204B NIT */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bNit_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Not-In-Table errors status for the selected deframer"); + goto cleanup; + } + errCounterStatus->laneStatus |= ((regData & 1U) << 6U); /* set bit 6 */ + + /* Get 204B UEK */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bUek_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Unexpected K-character errors status for the selected deframer"); + goto cleanup; + } + errCounterStatus->laneStatus |= ((regData & 1U) << 7U); /* set bit 7 */ + + /* Get 204B BD-Cnt */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bBdCnt_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + &errCounterStatus->bdCntValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Bad Disparity 8-bit error counters for the selected deframer"); + goto cleanup; + } + + /* Get 204B UEK-Cnt */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bUekCnt_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + &errCounterStatus->uekCntValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Unexpected K-character 8-bit error counters for the selected deframer"); + goto cleanup; + } + + /* Get 204B NIT-Cnt */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bNitCnt_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + &errCounterStatus->nitCntValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Not-In-Table 8-bit error counters for the selected deframer"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmErrCounterReset(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const uint8_t laneNumber, + uint32_t const errCounterMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + uint8_t deframerLinkType = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + if (laneNumber >= ADI_ADRV903X_MAX_SERDES_LANES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid laneNumber for the selected deframer."); + goto cleanup; + } + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + /* Get the deframer link type: 204B or 204C */ + recoveryAction = adrv903x_JrxLink_JrxLinkType_BfGet(device, + NULL, + deframerBaseAddr, + &deframerLinkType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link type for the selected deframer"); + goto cleanup; + } + + if (deframerLinkType != 0U) /* 204C */ + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid link type: only supports 204B link."); + goto cleanup; + } + + if ((errCounterMask & (uint32_t) ADI_ADRV903X_DFRM_BD_CLEAR) != 0U) + { + recoveryAction = adrv903x_JesdCommon_JrxDl204bEcntRst_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + 0x01); /* bit 0 for BD */ + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to clear Bad Disparity counter for the selected deframer"); + goto cleanup; + } + } + + if ((errCounterMask & (uint32_t) ADI_ADRV903X_DFRM_INT_CLEAR) != 0U) + { + recoveryAction = adrv903x_JesdCommon_JrxDl204bEcntRst_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + 0x02); /* bit 1 for INT */ + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to clear Not-In-Table counter for the selected deframer"); + goto cleanup; + } + } + + if ((errCounterMask & (uint32_t) ADI_ADRV903X_DFRM_UEK_CLEAR) != 0U) + { + recoveryAction = adrv903x_JesdCommon_JrxDl204bEcntRst_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + 0x04); /* bit 2 for INT */ + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to clearUnexpected K-character counter for the selected deframer"); + goto cleanup; + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmErrCounterThresholdSet(adi_adrv903x_Device_t* const device, + const uint8_t threshold) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + recoveryAction = adrv903x_JesdCommon_JrxCrcErrCntThreshold_BfSet(device, NULL, ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, threshold); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set Threshold of CRC errors"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Dfrm204cErrCounterStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const uint8_t laneNumber, + adi_adrv903x_Dfrm204cErrCounterStatus_t * const errCounterStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + uint8_t deframerLinkType = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, errCounterStatus, cleanup); + + if (laneNumber >= ADI_ADRV903X_MAX_SERDES_LANES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid laneNumber for the selected deframer."); + goto cleanup; + } + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + /* Get the deframer link type: 204B or 204C */ + recoveryAction = adrv903x_JrxLink_JrxLinkType_BfGet(device, + NULL, + deframerBaseAddr, + &deframerLinkType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link type for the selected deframer"); + goto cleanup; + } + + if (deframerLinkType == 0U) /* 204B */ + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid link type: only supports 204C link."); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JrxDl204cShErrCnt_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + &errCounterStatus->shCntValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get block alignment errors counter for the selected deframer"); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JrxDl204cEmbErrCnt_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + &errCounterStatus->embCntValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get extended multiblocks alignment errors counter for the selected deframer"); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JrxDl204cMbErrCnt_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + &errCounterStatus->mbCntValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get multiblocks alignment errors counter for the selected deframer"); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JrxDl204cCrcErrCnt_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneNumber, + &errCounterStatus->crcCntValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CRC parity errors counter for the selected deframer"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Dfrm204cErrCounterReset(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + uint8_t deframerLinkType = 0U; + + uint8_t writeGpIntPin1Bool = 0U; + uint8_t writeGpIntPin0Bool = 0U; + uint8_t gpintTmpByteData[2] = { 0U }; + uint8_t gpintPin1ByteData[2] = { 0U }; + uint8_t gpintPin0ByteData[2] = { 0U }; + + static const uint8_t GPINT_DFRM0_204C_LL_CRC_BYTE1_MASK = (1U << 2U); + static const uint8_t GPINT_DFRM1_204C_LL_CRC_BYTE2_MASK = (1U << 0U); + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + /* Get the deframer link type: 204B or 204C */ + recoveryAction = adrv903x_JrxLink_JrxLinkType_BfGet(device, + NULL, + deframerBaseAddr, + &deframerLinkType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link type for the selected deframer"); + goto cleanup; + } + + if (deframerLinkType == 0U) /* 204B */ + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid link type: only supports 204C link."); + goto cleanup; + } + + /* Read GPINT registers */ + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, ADRV903X_ADDR_GPINT_MASK_PIN1_BYTE1, gpintPin1ByteData, NULL, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adi_adrv903x_RegistersByteRead GPINT_PIN1 issue"); + goto cleanup; + } + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, ADRV903X_ADDR_GPINT_MASK_PIN0_BYTE1, gpintPin0ByteData, NULL, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adi_adrv903x_RegistersByteRead GPINT_PIN0 issue"); + goto cleanup; + } + + /* Disable GPINT while clearing Error Counter */ + gpintTmpByteData[0] = gpintPin1ByteData[0] | GPINT_DFRM0_204C_LL_CRC_BYTE1_MASK; + gpintTmpByteData[1] = gpintPin1ByteData[1] | GPINT_DFRM1_204C_LL_CRC_BYTE2_MASK; + writeGpIntPin1Bool = (gpintTmpByteData[0] != gpintPin1ByteData[0]) || (gpintTmpByteData[1] != gpintPin1ByteData[1]); + if (writeGpIntPin1Bool) + { + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_GPINT_MASK_PIN1_BYTE1, gpintTmpByteData, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adi_adrv903x_RegistersByteWrite Disable GPINT_PIN1 issue"); + goto cleanup; + } + } + + gpintTmpByteData[0] = gpintPin0ByteData[0] | GPINT_DFRM0_204C_LL_CRC_BYTE1_MASK; + gpintTmpByteData[1] = gpintPin0ByteData[1] | GPINT_DFRM1_204C_LL_CRC_BYTE2_MASK; + writeGpIntPin0Bool = (gpintTmpByteData[0] != gpintPin0ByteData[0]) || (gpintTmpByteData[1] != gpintPin0ByteData[1]); + if (writeGpIntPin0Bool) + { + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_GPINT_MASK_PIN0_BYTE1, gpintTmpByteData, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adi_adrv903x_RegistersByteWrite Disable GPINT_PIN0 issue"); + goto cleanup; + } + } + + recoveryAction = adrv903x_JesdCommon_JrxDl204cClrErrCnt_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to clear error counters for the selected deframer"); + goto cleanup; + } + + /* 204C Clear Err Counter bit is not self clearing bit so it must be set back to 0 */ + recoveryAction = adrv903x_JesdCommon_JrxDl204cClrErrCnt_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to clear error bit for the selected deframer"); + goto cleanup; + } + + /* Clear GPINT status bits */ + gpintTmpByteData[0] = GPINT_DFRM0_204C_LL_CRC_BYTE1_MASK; + gpintTmpByteData[1] = GPINT_DFRM1_204C_LL_CRC_BYTE2_MASK; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_GPINT_STATUS_BYTE1, gpintTmpByteData, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error clearing GP Interrupt Status bits."); + return recoveryAction; + } + + /* Restore GPINT config */ + if (writeGpIntPin1Bool) + { + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_GPINT_MASK_PIN1_BYTE1, gpintPin1ByteData, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adi_adrv903x_RegistersByteWrite Restore GPINT_PIN1 issue"); + goto cleanup; + } + } + + if (writeGpIntPin0Bool) + { + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_GPINT_MASK_PIN0_BYTE1, gpintPin0ByteData, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adi_adrv903x_RegistersByteWrite Restore GPINT_PIN0 issue"); + goto cleanup; + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmLinkConditionGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + uint8_t * const dfrmLinkCondition) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dfrmLinkCondition, cleanup); + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + recoveryAction = adrv903x_JrxLink_JrxCoreUsrDataRdy_BfGet(device, + NULL, + deframerBaseAddr, + dfrmLinkCondition); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link condition for the selected deframer"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmFifoDepthGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const uint8_t laneNumber, + uint8_t * const fifoDepth) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, fifoDepth, cleanup); + + if (laneNumber >= ADI_ADRV903X_MAX_SERDES_LANES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid laneNumber for the selected deframer."); + goto cleanup; + } + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + recoveryAction = adrv903x_JrxLink_JrxTplBufDepth_BfGet(device, + NULL, + deframerBaseAddr, + laneNumber, + fifoDepth); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get elastic FIFO depth for the selected deframer"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmCoreBufDepthGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + uint8_t * const coreBufDepth) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, coreBufDepth, cleanup); + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + recoveryAction = adrv903x_JrxLink_JrxCoreBufDepth_BfGet(device, + NULL, + deframerBaseAddr, + coreBufDepth); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get core buffer depth for the selected deframer"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerLoopbackSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_AdcSampleXbarCfg_t adcCrossbar; /* Initialized below */ + uint8_t framerEnabled = 0; + uint8_t deframerEnabled = 0; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_LIBRARY_MEMSET(&adcCrossbar, 0, sizeof(adi_adrv903x_AdcSampleXbarCfg_t)); + + /* Verify only one framer is selected */ + if ((framerSel == 0) || /* one framer must be selected */ + (framerSel & (framerSel - 1)) || /* ensure no more than one framer is selected */ + ((framerSel & ~ADI_ADRV903X_ALL_FRAMERS) != 0)) /* ensure non-framer bits are not set */ + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid framer selection"); + goto cleanup; + } + + /* Get all framers link state */ + recoveryAction = adrv903x_JesdCommon_JtxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &framerEnabled); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get framer link state failed"); + goto cleanup; + } + + /* Verify the select framer is enabled */ + if ((framerEnabled & framerSel) == 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error: The selected framer must be enabled."); + goto cleanup; + } + + /* Verify at least one deframer is enabled */ + recoveryAction = adrv903x_JesdCommon_JrxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &deframerEnabled); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get deframer link state failed"); + goto cleanup; + } + + /* Verify the select deframer is enabled */ + if ((deframerEnabled & (uint8_t) ADI_ADRV903X_ALL_DEFRAMER) == 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error: at least one deframer must be enabled."); + goto cleanup; + } + + /* Configuring ADC Crossbar for loopback */ + adcCrossbar.AdcSampleXbar[ 0] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX0_DATA_I; + adcCrossbar.AdcSampleXbar[ 1] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX0_DATA_Q; + adcCrossbar.AdcSampleXbar[ 2] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX1_DATA_I; + adcCrossbar.AdcSampleXbar[ 3] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX1_DATA_Q; + adcCrossbar.AdcSampleXbar[ 4] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX2_DATA_I; + adcCrossbar.AdcSampleXbar[ 5] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX2_DATA_Q; + adcCrossbar.AdcSampleXbar[ 6] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX3_DATA_I; + adcCrossbar.AdcSampleXbar[ 7] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX3_DATA_Q; + adcCrossbar.AdcSampleXbar[ 8] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX4_DATA_I; + adcCrossbar.AdcSampleXbar[ 9] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX4_DATA_Q; + adcCrossbar.AdcSampleXbar[10] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX5_DATA_I; + adcCrossbar.AdcSampleXbar[11] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX5_DATA_Q; + adcCrossbar.AdcSampleXbar[12] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX6_DATA_I; + adcCrossbar.AdcSampleXbar[13] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX6_DATA_Q; + adcCrossbar.AdcSampleXbar[14] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX7_DATA_I; + adcCrossbar.AdcSampleXbar[15] = (adi_adrv903x_AdcSampleXbarSel_e) ADI_ADRV903X_JESD_FRM_LB_XBAR_TX7_DATA_Q; + + recoveryAction = adi_adrv903x_AdcSampleXbarSet(device, framerSel, &adcCrossbar); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set ADC Xbar loopback for the selected framer."); + goto cleanup; + } + + /* Enable framer loopback */ + recoveryAction = adrv903x_JesdCommon_JtxSampleLoopback_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + framerSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to enable loopback for the selected framer"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerLoopbackDisable(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + const adi_adrv903x_AdcSampleXbarCfg_t* const adcXbar) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t framerEnabled = 0U; + uint8_t framerLoopbackEnabled = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, adcXbar, cleanup); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Verify only one framer is selected */ + if ((framerSel == 0U) || /* one framer must be selected */ + (framerSel & (framerSel - 1)) || /* ensure no more than one framer is selected */ + ((framerSel & ~ADI_ADRV903X_ALL_FRAMERS) != 0U)) /* ensure non-framer bits are not set */ + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, framerSel, "Invalid framer selection"); + goto cleanup; + } + + /* Get all framers link state */ + recoveryAction = adrv903x_JesdCommon_JtxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &framerEnabled); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get framer link state failed"); + goto cleanup; + } + + /* Verify the select framer is enabled */ + if ((framerEnabled & framerSel) == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, framerSel, "Error: The selected framer must be enabled."); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JtxSampleLoopback_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &framerLoopbackEnabled); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to read which framers have enabled loopbacks"); + goto cleanup; + } + + /* Verify the select framer has its loopback enabled */ + if ((framerLoopbackEnabled & framerSel) == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, framerSel, "Error: The selected framer loopback has not been enabled."); + goto cleanup; + } + + /* Disable framer loopback for that particular framer*/ + recoveryAction = adrv903x_JesdCommon_JtxSampleLoopback_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + (framerLoopbackEnabled & ~framerSel)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to disable loopback for the selected framer"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_AdcSampleXbarSet(device, framerSel, adcXbar); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set ADC Xbar loopback for the selected framer."); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLoopbackSet(adi_adrv903x_Device_t* const device) +{ + static const uint32_t START_OF_JTX_LINK_0 = ADRV903X_ADDR_JESD_JTX_LINK0_SAMPLE_XBAR0; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t framerEnabled = 0U; + uint8_t deframerEnabled = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Get all framers link state */ + recoveryAction = adrv903x_JesdCommon_JtxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &framerEnabled); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get framer link state failed"); + goto cleanup; + } + + /* Verify at least one framer is enabled */ + if ((framerEnabled & (uint8_t) ADI_ADRV903X_ALL_FRAMERS) == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error: At least one framer must be enabled."); + goto cleanup; + } + + /* Verify at least one deframer is enabled */ + recoveryAction = adrv903x_JesdCommon_JrxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &deframerEnabled); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get deframer link state failed"); + goto cleanup; + } + + if ((deframerEnabled & (uint8_t) ADI_ADRV903X_ALL_DEFRAMER) == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error: deframer-0 must be enabled."); + goto cleanup; + } + + /* If framer 0 not enabled, enable it to use it as loopback */ + if ((framerEnabled & (uint8_t) ADI_ADRV903X_FRAMER_0) == 0U) + { + framerEnabled = framerEnabled | ADI_ADRV903X_FRAMER_0; + recoveryAction = adrv903x_JesdCommon_JtxLinkEn_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + framerEnabled); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get framer link state failed"); + goto cleanup; + } + } + + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x00U, 0x00, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x04U, 0x01, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x10U, 0x04, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x14U, 0x05, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x20U, 0x08, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x24U, 0x09, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x30U, 0x0C, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x34U, 0x0D, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x40U, 0x10, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x44U, 0x11, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x50U, 0x14, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x54U, 0x15, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x60U, 0x18, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x64U, 0x19, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x70U, 0x1C, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, START_OF_JTX_LINK_0 + 0x74U, 0x1D, 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Jtx link register"); + goto cleanup; + } + + /* Enable deframer loopback */ + recoveryAction = adrv903x_JesdCommon_JrxSampleLoopback_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to enable deframer loopback"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLoopbackDisable(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Disable deframer loopback */ + recoveryAction = adrv903x_JesdCommon_JrxSampleLoopback_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to disable deframer loopback"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLoopbackDisable_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + const adi_adrv903x_AdcSampleXbarCfg_t* const adcXbar) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t framerEnabled = 0U; + uint8_t deframerLoopbackEnabled = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, adcXbar, cleanup); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Verify only one deframer is selected */ + if ((framerSel == 0U) || /* one deframer must be selected */ + (framerSel & (framerSel - 1U)) || /* ensure no more than one deframer is selected */ + ((framerSel & ~ADI_ADRV903X_ALL_DEFRAMER) != 0U)) /* ensure non-deframer bits are not set */ + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, framerSel, "Invalid deframer selection"); + goto cleanup; + } + + /* Get all framers link state */ + recoveryAction = adrv903x_JesdCommon_JtxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &framerEnabled); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get deframer link state failed"); + goto cleanup; + } + + /* Verify the select deframer is enabled */ + if ((framerEnabled & framerSel) == 0U) //TODO: does this framer NEED to be framer 0?? + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, framerSel, "Error: The selected framer must be enabled."); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JrxSampleLoopback_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &deframerLoopbackEnabled); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to read which deframers have enabled loopbacks"); + goto cleanup; + } + + /* Verify the deframer has its loopback enabled */ + if (deframerLoopbackEnabled == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, deframerLoopbackEnabled, "Error: The deframer loopback has not been enabled."); + goto cleanup; + } + + /* Disable deframer loopback */ + recoveryAction = adrv903x_JesdCommon_JrxSampleLoopback_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to disable deframer loopback"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_AdcSampleXbarSet(device, framerSel, adcXbar); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set ADC Xbar loopback for the selected framer."); + goto cleanup; + } + + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLaneLoopbackSet(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t framerEnabled = 0; + uint8_t deframerEnabled = 0; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Get all framers link state */ + recoveryAction = adrv903x_JesdCommon_JtxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &framerEnabled); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get framer link state failed"); + goto cleanup; + } + + /* Verify at least one framer is enabled */ + if ((framerEnabled & (uint8_t) ADI_ADRV903X_ALL_FRAMERS) == 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error: at least one framer must be enabled."); + goto cleanup; + } + + /* Verify at least one deframer is enabled */ + recoveryAction = adrv903x_JesdCommon_JrxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + &deframerEnabled); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get deframer link state failed"); + goto cleanup; + } + + if ((deframerEnabled & (uint8_t) ADI_ADRV903X_ALL_DEFRAMER) == 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error: at least one deframer must be enabled."); + goto cleanup; + } + + /* Enable deframer lane loopback */ + recoveryAction = adrv903x_JesdCommon_JrxLaneLoopback_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to enable deframer lane loopback"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerLaneLoopbackDisable(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Disable deframer lane loopback */ + recoveryAction = adrv903x_JesdCommon_JrxLaneLoopback_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to disable deframer lane loopback"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSyncbModeSet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + const uint8_t syncbMode) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + adi_adrv903x_FramerSel_e framerSel = ADI_ADRV903X_FRAMER_0; + uint32_t framerSelection = 0U; + + uint32_t i = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Check framer id */ + if ((framerSelMask < (uint8_t)ADI_ADRV903X_FRAMER_0) || + (framerSelMask > (uint8_t)ADI_ADRV903X_ALL_FRAMERS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid framer selection"); + goto cleanup; + } + + /* Check syncb mode */ + if ((syncbMode != 1U) && + (syncbMode != 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid framer syncb mode value"); + goto cleanup; + } + + /* Framer syncb mode set */ + for (i = 0U; i < ADI_ADRV903X_MAX_FRAMERS; i++) + { + framerSelection = 1U << i; + framerSel = (adi_adrv903x_FramerSel_e)(framerSelection); + + if ((framerSelMask & (uint8_t)framerSelection) != 0U) + { + /* Get framer base address */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, + framerSel, + &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting base address for framer"); + goto cleanup; + } + + /* Set syncb mode */ + recoveryAction = adrv903x_JtxLink_JtxDl204bSyncNForceEn_BfSet(device, + NULL, + framerBaseAddr, + syncbMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting syncb mode for framer"); + goto cleanup; + } + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSyncbModeGet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + uint8_t* const syncbMode) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, syncbMode, cleanup); + + /* Get framer base address */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, + (adi_adrv903x_FramerSel_e)framerSelMask, + &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting base address for framer"); + goto cleanup; + } + + /* Framer syncb mode get */ + recoveryAction = adrv903x_JtxLink_JtxDl204bSyncNForceEn_BfGet(device, + NULL, + framerBaseAddr, + syncbMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting syncb mode for framer"); + goto cleanup; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSyncbStatusSet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + const uint8_t syncbStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + adi_adrv903x_FramerSel_e framerSel = ADI_ADRV903X_FRAMER_0; + uint32_t framerSelection = 0U; + uint32_t i = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Check framer id */ + if ((framerSelMask < (uint8_t)ADI_ADRV903X_FRAMER_0) || + (framerSelMask > (uint8_t)ADI_ADRV903X_ALL_FRAMERS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid framer selection"); + goto cleanup; + } + + /* Check syncb force enable value */ + if ((syncbStatus != 1U) && + (syncbStatus != 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid framer syncb status value"); + goto cleanup; + } + + /* Framer syncb status set */ + for (i = 0U; i < ADI_ADRV903X_MAX_FRAMERS; i++) + { + framerSelection = 1U << i; + framerSel = (adi_adrv903x_FramerSel_e)(framerSelection); + + if ((framerSelMask & (uint8_t)framerSelection) != 0U) + { + /* Get framer base address */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, + framerSel, + &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting base address for framer"); + goto cleanup; + } + + /* Set syncb status enable */ + recoveryAction = adrv903x_JtxLink_JtxDl204bSyncNForceVal_BfSet(device, + NULL, + framerBaseAddr, + syncbStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting syncb status for framer"); + goto cleanup; + } + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSyncbStatusGet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + uint8_t* const syncbStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, syncbStatus, cleanup); + + /* Get framer base address */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, + (adi_adrv903x_FramerSel_e)framerSelMask, + &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting base address for framer"); + goto cleanup; + } + + /* Framer syncb status get */ + recoveryAction = adrv903x_JtxLink_JtxDl204bSyncN_BfGet(device, + NULL, + framerBaseAddr, + syncbStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting syncb status for framer"); + goto cleanup; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSyncbErrCntGet(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask, + uint8_t* const syncbErrCnt) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, syncbErrCnt, cleanup); + + /* Get framer base address */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, + (adi_adrv903x_FramerSel_e)framerSelMask, + &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting base address for framer"); + goto cleanup; + } + + /* Framer syncb error counter get */ + recoveryAction = adrv903x_JtxLink_JtxDl204bSyncNeCount_BfGet(device, + NULL, + framerBaseAddr, + syncbErrCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting syncb error counter for framer"); + goto cleanup; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerSyncbErrCntReset(adi_adrv903x_Device_t* const device, + const uint8_t framerSelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + adi_adrv903x_FramerSel_e framerSel = ADI_ADRV903X_FRAMER_0; + uint32_t framerSelection = 0U; + uint32_t i = 0U; + const uint8_t syncbErrCntClear = 1U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Check framer id */ + if ((framerSelMask < (uint8_t)ADI_ADRV903X_FRAMER_0) || + (framerSelMask > (uint8_t)ADI_ADRV903X_ALL_FRAMERS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid framer selection"); + goto cleanup; + } + + /* Framer syncb error counter clear */ + for (i = 0U; i < ADI_ADRV903X_MAX_FRAMERS; i++) + { + framerSelection = 1U << i; + framerSel = (adi_adrv903x_FramerSel_e)(framerSelection); + + if ((framerSelMask & (uint8_t)framerSelection) != 0U) + { + /* Get framer base address */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, + framerSel, + &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting base address for framer"); + goto cleanup; + } + + /* Clear syncb error counter */ + recoveryAction = adrv903x_JtxLink_JtxDl204bClearSyncNeCount_BfSet(device, + NULL, + framerBaseAddr, + syncbErrCntClear); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while clearing syncb error counter for framer"); + goto cleanup; + } + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerSyncbErrCntGet(adi_adrv903x_Device_t* const device, + const uint8_t deframerSelMask, + uint8_t* const syncbErrCnt) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, syncbErrCnt, cleanup); + + /* Get deframer base address */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, + (adi_adrv903x_DeframerSel_e)deframerSelMask, + &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting base address for deframer"); + goto cleanup; + } + + /* Deframer syncb error counter get */ + recoveryAction = adrv903x_JrxLink_JrxCoreSyncNeCount_BfGet(device, + NULL, + deframerBaseAddr, + syncbErrCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting syncb error counter for deframer"); + goto cleanup; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerSyncbErrCntReset(adi_adrv903x_Device_t* const device, + const uint8_t deframerSelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + adi_adrv903x_DeframerSel_e deframerSel = ADI_ADRV903X_DEFRAMER_0; + uint32_t deframerSelection = 0U; + uint32_t i = 0U; + const uint8_t syncbErrCntClear = 1U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Check deframer id */ + if ((deframerSelMask < (uint8_t)ADI_ADRV903X_DEFRAMER_0) || + (deframerSelMask > (uint8_t)ADI_ADRV903X_ALL_DEFRAMER)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid deframer selection"); + goto cleanup; + } + + /* Deframer syncb error counter clear */ + for (i = 0U; i < ADI_ADRV903X_MAX_DEFRAMERS; i++) + { + deframerSelection = 1U << i; + deframerSel = (adi_adrv903x_DeframerSel_e)(deframerSelection); + + if ((deframerSelMask & (uint8_t)deframerSelection) != 0U) + { + /* Get deframer base address */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, + deframerSel, + &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting base address for deframer"); + goto cleanup; + } + + /* Clear syncb error counter */ + recoveryAction = adrv903x_JrxLink_JrxCoreClearSyncNeCount_BfSet(device, + NULL, + deframerBaseAddr, + syncbErrCntClear); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while clearing syncb error counter for deframer"); + goto cleanup; + } + + /* Reset syncb error counter after clear */ + recoveryAction = adrv903x_JrxLink_JrxCoreClearSyncNeCount_BfSet(device, + NULL, + deframerBaseAddr, + 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while resetting syncb error counter for deframer"); + goto cleanup; + } + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerErrorCtrl(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSel, + const adi_adrv903x_SerdesErrAction_e action) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + + uint32_t framerIdx = 0U; + uint8_t errClr = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + if (((uint32_t)action & ADI_ADRV903X_SERDES_ALL_ERR_CLEAR) == 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, action, "Invalid Serdes Error Action Selected"); + goto cleanup; + } + + for (framerIdx = 0U; framerIdx < (uint32_t)ADI_ADRV903X_MAX_FRAMERS; framerIdx++) + { + if ((((1U << framerIdx) & (uint32_t)framerSel) == 0U) || + ((device->initExtract.jesdSetting.framerSetting[framerIdx].serialLaneEnabled == 0U) && (framerSel == ADI_ADRV903X_ALL_FRAMERS))) + { + /* skip if framer is not selected or if it is an unused framer and all framer is selected */ + continue; + } + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, (adi_adrv903x_FramerSel_e)(1U << framerIdx), &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + goto cleanup; + } + + /* Handle PCLK Errors */ + if ((action & ADI_ADRV903X_SERDES_PCLK_ERR_CLEAR) == ADI_ADRV903X_SERDES_PCLK_ERR_CLEAR) + { + /* Read PCLK error clear bitfield */ + recoveryAction = adrv903x_JtxLink_JtxPclkErrorClear_BfGet(device, NULL, framerBaseAddr, &errClr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, framerIdx, "Failed to Read Framer PCLK Error Clear status"); + goto cleanup; + } + } + else + { + errClr = 0U; + } + + if ((action & ADI_ADRV903X_SERDES_PCLK_ERR_DISABLE) == ADI_ADRV903X_SERDES_PCLK_ERR_DISABLE) + { + /* Set the bitfield to 1 disables the Error and clears it */ + recoveryAction = adrv903x_JtxLink_JtxPclkErrorClear_BfSet(device, NULL, framerBaseAddr, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, framerIdx, "Failed to Clear/Disable Framer PCLK Error"); + goto cleanup; + } + } + + if ((action & ADI_ADRV903X_SERDES_PCLK_ERR_ENABLE) == ADI_ADRV903X_SERDES_PCLK_ERR_ENABLE) + { + /* Set the bitfield to 0 enables the Error */ + recoveryAction = adrv903x_JtxLink_JtxPclkErrorClear_BfSet(device, NULL, framerBaseAddr, errClr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, framerIdx, "Failed to Enable Framer PCLK Error"); + goto cleanup; + } + } + + /* Handle SYSREF Phase Error */ + if ((action & ADI_ADRV903X_SERDES_SYSREF_ERR_CLEAR) == ADI_ADRV903X_SERDES_SYSREF_ERR_CLEAR) + { + /* Read Sysref phase error clear bitfield */ + recoveryAction = adrv903x_JtxLink_JtxTplSysrefClrPhaseErr_BfGet(device, NULL, framerBaseAddr, &errClr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, framerIdx, "Failed to Read Framer Sysref Phase Error Clear status"); + goto cleanup; + } + } + else + { + errClr = 0U; + } + + if ((action & ADI_ADRV903X_SERDES_SYSREF_ERR_DISABLE) == ADI_ADRV903X_SERDES_SYSREF_ERR_DISABLE) + { + /* Set the bitfield to 1 disables the Error and clears it */ + recoveryAction = adrv903x_JtxLink_JtxTplSysrefClrPhaseErr_BfSet(device, NULL, framerBaseAddr, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, framerIdx, "Failed to Clear/Disable Framer Sysref Phase Error"); + goto cleanup; + } + } + + if ((action & ADI_ADRV903X_SERDES_SYSREF_ERR_ENABLE) == ADI_ADRV903X_SERDES_SYSREF_ERR_ENABLE) + { + /* Set the bitfield to 0 enables the Error */ + recoveryAction = adrv903x_JtxLink_JtxTplSysrefClrPhaseErr_BfSet(device, NULL, framerBaseAddr, errClr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, framerIdx, "Failed to Enable Framer Sysref Phase Error"); + goto cleanup; + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeframerErrorCtrl(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + const adi_adrv903x_SerdesErrAction_e action) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + + uint32_t deframerIdx = 0U; + uint8_t errClr = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + if (((uint32_t)action & ADI_ADRV903X_SERDES_ALL_ERR_CLEAR) == 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, action, "Invalid Serdes Error Action Selected"); + goto cleanup; + } + + for (deframerIdx = 0U; deframerIdx < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; deframerIdx++) + { + if ((((1U << deframerIdx) & (uint32_t)deframerSel) == 0U) || + ((device->initExtract.jesdSetting.deframerSetting[deframerIdx].deserialLaneEnabled == 0U) && (deframerSel == ADI_ADRV903X_ALL_DEFRAMER))) + { + /* skip if deframer is not selected or if it is an unused deframer and all deframer is selected */ + continue; + } + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, (adi_adrv903x_DeframerSel_e)(1U << deframerIdx), &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + /* Handle PCLK Errors */ + if ((action & ADI_ADRV903X_SERDES_PCLK_ERR_CLEAR) == ADI_ADRV903X_SERDES_PCLK_ERR_CLEAR) + { + /* Read PCLK error clear bitfield */ + recoveryAction = adrv903x_JrxLink_JrxCorePclkErrorClear_BfGet(device, NULL, deframerBaseAddr, &errClr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, deframerIdx, "Failed to Read Deframer PCLK Error Clear status"); + goto cleanup; + } + } + else + { + errClr = 0U; + } + + if ((action & ADI_ADRV903X_SERDES_PCLK_ERR_DISABLE) == ADI_ADRV903X_SERDES_PCLK_ERR_DISABLE) + { + /* Set the bitfield to 1 disables the Error and clears it */ + recoveryAction = adrv903x_JrxLink_JrxCorePclkErrorClear_BfSet(device, NULL, deframerBaseAddr, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, deframerIdx, "Failed to Clear/Disable Deframer PCLK Error"); + goto cleanup; + } + } + + if ((action & ADI_ADRV903X_SERDES_PCLK_ERR_ENABLE) == ADI_ADRV903X_SERDES_PCLK_ERR_ENABLE) + { + /* Set the bitfield to 0 enables the Error */ + recoveryAction = adrv903x_JrxLink_JrxCorePclkErrorClear_BfSet(device, NULL, deframerBaseAddr, errClr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, deframerIdx, "Failed to Enable Deframer PCLK Error"); + goto cleanup; + } + } + + /* Handle SYSREF Phase Error */ + if ((action & ADI_ADRV903X_SERDES_SYSREF_ERR_CLEAR) == ADI_ADRV903X_SERDES_SYSREF_ERR_CLEAR) + { + /* Read Sysref phase error clear bitfield */ + recoveryAction = adrv903x_JrxLink_JrxCoreSysrefClrPhaseErr_BfGet(device, NULL, deframerBaseAddr, &errClr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, deframerIdx, "Failed to Read Deframer Sysref Phase Error Clear status"); + goto cleanup; + } + } + else + { + errClr = 0U; + } + + if ((action & ADI_ADRV903X_SERDES_SYSREF_ERR_DISABLE) == ADI_ADRV903X_SERDES_SYSREF_ERR_DISABLE) + { + /* Set the bitfield to 1 disables the Error and clears it */ + recoveryAction = adrv903x_JrxLink_JrxCoreSysrefClrPhaseErr_BfSet(device, NULL, deframerBaseAddr, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, deframerIdx, "Failed to Clear/Disable Deframer Sysref Phase Error"); + goto cleanup; + } + } + + if ((action & ADI_ADRV903X_SERDES_SYSREF_ERR_ENABLE) == ADI_ADRV903X_SERDES_SYSREF_ERR_ENABLE) + { + /* Set the bitfield to 0 enables the Error */ + recoveryAction = adrv903x_JrxLink_JrxCoreSysrefClrPhaseErr_BfSet(device, NULL, deframerBaseAddr, errClr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, deframerIdx, "Failed to Enable Deframer Sysref Phase Error"); + goto cleanup; + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmIlasMismatchGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DfrmCompareData_t* const dfrmData) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + adi_adrv903x_DeframerCfg_t deframerCfg; /* Initialized later on */ + uint8_t deframerLinkType = 0U; + uint8_t laneId = 0U; + uint8_t laneSel = 0U; + uint8_t laneIdx = 0xFF; + uint8_t regData = 0U; + uint8_t cfgData = 0U; + uint32_t ilasIdx = 0U; + uint32_t zeroData = 0U; + /* uint16_t irqVec = 0U; */ + /* uint16_t cfgMismatch = 0U; */ + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dfrmData, cleanup); + ADI_LIBRARY_MEMSET(&deframerCfg, 0U, sizeof(adi_adrv903x_DeframerCfg_t)); + ADI_LIBRARY_MEMSET(dfrmData, 0U, sizeof(adi_adrv903x_DfrmCompareData_t)); + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JrxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading deframer enabled status"); + goto cleanup; + } + + /* Check if deframer requested is enabled, if not return error */ + if ((regData & deframerSel) == 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error: Requested deframer not enabled"); + goto cleanup; + } + + /* Get the deframer link type: 204B or 204C */ + recoveryAction = adrv903x_JrxLink_JrxLinkType_BfGet(device, + NULL, + deframerBaseAddr, + &deframerLinkType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading link type from device"); + goto cleanup; + } + + if (deframerLinkType != 0U) /* 204C is not supported */ + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid link type: only supports 204B link."); + goto cleanup; + } + + /* Get Deframer Lane Crossbar information to find the first lane in used */ + recoveryAction = adrv903x_DeframerLaneEnableGet(device, deframerSel, &deframerCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane cross bar the selected deframer"); + goto cleanup; + } + + for (laneId = 0U; laneId < ADI_ADRV903X_MAX_SERDES_LANES; ++laneId) + { + laneSel = 1U << laneId; + if ((deframerCfg.deserializerLanesEnabled & laneSel) == laneSel) + { + /* Find first lane in use. */ + laneIdx = laneId; + break; + } + } + + if (laneIdx == 0xFF) /* No active lane found - Still have initialized value */ + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to find active lane for the selected deframer"); + goto cleanup; + } + + + /* TODO: We can not use this field, because hw calculates checksum with BankID =0, + * Add code to calculate checksum in SW */ + + /* Checking IRQ Vector if HW reporting any CFG mismatch */ + /* + recoveryAction = adrv903x_JesdCommon_JrxDl204bIrqVec_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + &irqVec); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get IRQ Vector for the selected deframer"); + goto cleanup; + } + */ + /* cfgMismatch = irqVec >> 8U; */ + + /*** Comparing DID ***/ + /* ILAS DID */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS DID for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmDID = regData; + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG DID */ + recoveryAction = adrv903x_JrxLink_JrxCoreDidCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG DID cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmDID = cfgData; + + /* Compare ILAS & CFG DID */ + if (dfrmData->dfrmIlasData.dfrmDID != dfrmData->dfrmCfgData.dfrmDID) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing BID ***/ + /* ILAS BID */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg1_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS BID for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmBID = (regData & 0x0F); + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG BID is not supported so deframer assign it to ILAS read */ + dfrmData->dfrmCfgData.dfrmBID = dfrmData->dfrmIlasData.dfrmBID; + + /* Compare ILAS & CFG BID */ + if (dfrmData->dfrmIlasData.dfrmBID != dfrmData->dfrmCfgData.dfrmBID) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing LID ***/ + /* ILAS LID */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg2_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS LID for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmLID0 = (regData & 0x1F); + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG LID */ + recoveryAction = adrv903x_JrxLink_JrxCoreLidCfg_BfGet(device, + NULL, + deframerBaseAddr, + laneIdx, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG LID cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmLID0 = cfgData; + + /* Compare ILAS & CFG LID */ + if (dfrmData->dfrmIlasData.dfrmLID0 != dfrmData->dfrmCfgData.dfrmLID0) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing L ***/ + /* ILAS L */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg3_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS L for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmL = (regData & 0x1F); + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG L */ + recoveryAction = adrv903x_JrxLink_JrxCoreLCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG L cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmL = cfgData; + + /* Compare ILAS & CFG L */ + if (dfrmData->dfrmIlasData.dfrmL != dfrmData->dfrmCfgData.dfrmL) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing DSCR ***/ + /* ILAS DSCR */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg3_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS DSCR for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmSCR = ((regData & 0x80) >> 7); + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG DSCR */ + recoveryAction = adrv903x_JrxLink_JrxCoreDscrCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG DSCR cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmSCR = cfgData; + + /* Compare ILAS & CFG DSCR */ + if (dfrmData->dfrmIlasData.dfrmSCR != dfrmData->dfrmCfgData.dfrmSCR) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing F ***/ + /* ILAS F */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg4_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS F for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmF = regData; + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG F */ + recoveryAction = adrv903x_JrxLink_JrxCoreFCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG F cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmF = cfgData; + + /* Compare ILAS & CFG F */ + if (dfrmData->dfrmIlasData.dfrmF != dfrmData->dfrmCfgData.dfrmF) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing K ***/ + /* ILAS K */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg5_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS K for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmK = (regData & 0x1F); + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG K */ + recoveryAction = adrv903x_JrxLink_JrxCoreKCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG K cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmK = cfgData; + + /* Compare ILAS & CFG K */ + if (dfrmData->dfrmIlasData.dfrmK != dfrmData->dfrmCfgData.dfrmK) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing M ***/ + /* ILAS M */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg6_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS M for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmM = regData; + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG M */ + recoveryAction = adrv903x_JrxLink_JrxCoreMCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG M cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmM = cfgData; + + /* Compare ILAS & CFG M */ + if (dfrmData->dfrmIlasData.dfrmM != dfrmData->dfrmCfgData.dfrmM) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing N ***/ + /* ILAS N */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg7_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS N for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmN = (regData & 0x1F); + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG N */ + recoveryAction = adrv903x_JrxLink_JrxCoreNCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG N cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmN = cfgData; + + /* Compare ILAS & CFG N */ + if (dfrmData->dfrmIlasData.dfrmN != dfrmData->dfrmCfgData.dfrmN) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing CS ***/ + /* ILAS CS */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg7_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS CS for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmCS = ((regData & 0xC0) >> 6); + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG CS */ + recoveryAction = adrv903x_JrxLink_JrxCoreCsCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG CS cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmCS = cfgData; + + /* Compare ILAS & CFG CS */ + if (dfrmData->dfrmIlasData.dfrmCS != dfrmData->dfrmCfgData.dfrmCS) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing NP ***/ + /* ILAS NP */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg8_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS NP for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmNP = (regData & 0X1F); + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG NP */ + recoveryAction = adrv903x_JrxLink_JrxCoreNpCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG NP cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmNP = cfgData; + + /* Compare ILAS & CFG NP */ + if (dfrmData->dfrmIlasData.dfrmNP != dfrmData->dfrmCfgData.dfrmNP) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing S ***/ + /* ILAS S */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg9_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS S for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmS = (regData & 0X1F); + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG S */ + recoveryAction = adrv903x_JrxLink_JrxCoreSCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG S cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmS = cfgData; + + /* Compare ILAS & CFG S */ + if (dfrmData->dfrmIlasData.dfrmS != dfrmData->dfrmCfgData.dfrmS) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing CF ***/ + /* ILAS CF */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg10_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS CF for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmCF = (regData & 0X1F); + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG CF */ + /* CF is not supported so deframer assign it to value read */ + dfrmData->dfrmCfgData.dfrmCF = dfrmData->dfrmIlasData.dfrmCF; + + /* Compare ILAS & CFG CF */ + if (dfrmData->dfrmIlasData.dfrmCF != dfrmData->dfrmCfgData.dfrmCF) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing HD ***/ + /* ILAS HD */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg10_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS HD for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmHD = ((regData & 0x80) >> 7); + zeroData = (regData == 0) ? zeroData : (zeroData | (1U << ilasIdx)); + + /* CFG HD */ + recoveryAction = adrv903x_JrxLink_JrxCoreHdCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG HD cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmHD = cfgData; + + /* Compare ILAS & CFG HD */ + if (dfrmData->dfrmIlasData.dfrmHD != dfrmData->dfrmCfgData.dfrmHD) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + /*** Comparing CHKSUM ***/ + /* ILAS CHKSUM */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg13_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS CHKSUM for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData.dfrmFCHK0 = regData; + + /* CFG CHKSUM */ + recoveryAction = adrv903x_JrxLink_JrxCoreChksumCfg_BfGet(device, + NULL, + deframerBaseAddr, + laneIdx, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG CHKSUM cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmFCHK0 = cfgData; + + /* Compare ILAS & CFG CHKSUM */ + if (dfrmData->dfrmIlasData.dfrmFCHK0 != dfrmData->dfrmCfgData.dfrmFCHK0) + { + dfrmData->ilasMismatchDfrm |= (1U << ilasIdx); + } + ilasIdx++; + + dfrmData->zeroCheckFlag = zeroData; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +static adi_adrv903x_ErrAction_e adrv903x_IlasChksum(adi_adrv903x_Device_t* const device, + adi_adrv903x_DfrmCompareData_v2_t* dfrmData) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t laneIdx = 0U; + uint8_t chksum = 0U; + uint8_t preChksum = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_PTR_RETURN(dfrmData); + + + + /* Calculate checksum for common fields */ + preChksum = dfrmData->dfrmCfgData.jesdV; /* JESDV */ + preChksum += dfrmData->dfrmCfgData.subclassV; /* SUBCLASSV */ + preChksum += dfrmData->dfrmCfgData.dfrmDID; /* DID */ + preChksum += dfrmData->dfrmCfgData.dfrmL; /* L */ + preChksum += dfrmData->dfrmCfgData.dfrmF; /* F */ + preChksum += dfrmData->dfrmCfgData.dfrmK; /* K */ + preChksum += dfrmData->dfrmCfgData.dfrmM; /* M */ + preChksum += dfrmData->dfrmCfgData.dfrmN; /* N */ + preChksum += dfrmData->dfrmCfgData.dfrmCS; /* CS */ + preChksum += dfrmData->dfrmCfgData.dfrmNP; /* NP */ + preChksum += dfrmData->dfrmCfgData.dfrmS; /* S */ + preChksum += dfrmData->dfrmCfgData.dfrmHD; /* HD */ + preChksum += dfrmData->dfrmCfgData.dfrmSCR; /* SCR */ + preChksum += dfrmData->dfrmCfgData.dfrmCF; /* CF */ + + /* Continue to calculate checksum to include lane dependency */ + for (laneIdx = 0; laneIdx < ADI_ADRV903X_MAX_SERDES_LANES; laneIdx++) + { + chksum = preChksum; + chksum += dfrmData->dfrmIlasData[laneIdx].dfrmBID; /* use lane BID */ + chksum += dfrmData->dfrmIlasData[laneIdx].dfrmLID; /* use lane LID */ + + dfrmData->cfgDataChksum[laneIdx] = chksum; + + if (dfrmData->cfgDataChksum[laneIdx] != dfrmData->dfrmIlasData[laneIdx].dfrmFCHK) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_CKSM; + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmIlasMismatchGet_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSel, + adi_adrv903x_DfrmCompareData_v2_t* const dfrmData) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJrxLinkChanAddr_e deframerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + adi_adrv903x_DeframerCfg_t deframerCfg; /* Initialized later on */ + uint8_t deframerLinkType = 0U; + uint8_t laneIdx = 0U; + uint8_t regData = 0U; + uint8_t cfgData = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dfrmData, cleanup); + ADI_LIBRARY_MEMSET(&deframerCfg, 0U, sizeof(adi_adrv903x_DeframerCfg_t)); + ADI_LIBRARY_MEMSET(dfrmData, 0U, sizeof(adi_adrv903x_DfrmCompareData_v2_t)); + + /* Get the base address of the selected deframer */ + recoveryAction = adrv903x_DeframerBitfieldAddressGet(device, deframerSel, &deframerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected deframer"); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JrxLinkEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading deframer enabled status"); + goto cleanup; + } + + /* Check if deframer requested is enabled, if not return error */ + if ((regData & deframerSel) == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error: Requested deframer not enabled"); + goto cleanup; + } + + /* Get the deframer link type: 204B or 204C */ + recoveryAction = adrv903x_JrxLink_JrxLinkType_BfGet(device, + NULL, + deframerBaseAddr, + &deframerLinkType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading link type from device"); + goto cleanup; + } + + if (deframerLinkType != 0U) /* 204C is not supported */ + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid link type: only supports 204B link."); + goto cleanup; + } + + /* Get Deframer Lane Crossbar information to find the first lane in used */ + recoveryAction = adrv903x_DeframerLaneEnableGet(device, deframerSel, &deframerCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane cross bar the selected deframer"); + goto cleanup; + } + dfrmData->phyLaneEnMask = deframerCfg.deserializerLanesEnabled; + + /***** Read all necessary configuration of the selected deframer for comparison *****/ + + /* CFG DID */ + recoveryAction = adrv903x_JrxLink_JrxCoreDidCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG DID cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmDID = cfgData; + + /* CFG L */ + recoveryAction = adrv903x_JrxLink_JrxCoreLCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG L cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmL = cfgData; + + /* CFG DSCR */ + recoveryAction = adrv903x_JrxLink_JrxCoreDscrCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG DSCR cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmSCR = cfgData; + + /* CFG F */ + recoveryAction = adrv903x_JrxLink_JrxCoreFCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG F cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmF = cfgData; + + /* CFG K */ + recoveryAction = adrv903x_JrxLink_JrxCoreKCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG K cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmK = cfgData; + + /* CFG M */ + recoveryAction = adrv903x_JrxLink_JrxCoreMCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG M cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmM = cfgData; + + /* CFG N */ + recoveryAction = adrv903x_JrxLink_JrxCoreNCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG N cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmN = cfgData; + + /* CFG CS */ + recoveryAction = adrv903x_JrxLink_JrxCoreCsCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG CS cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmCS = cfgData; + + /* CFG NP */ + recoveryAction = adrv903x_JrxLink_JrxCoreNpCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG NP cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmNP = cfgData; + + /* CFG S */ + recoveryAction = adrv903x_JrxLink_JrxCoreSCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG S cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmS = cfgData; + + /* CFG HD */ + recoveryAction = adrv903x_JrxLink_JrxCoreHdCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG HD cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.dfrmHD = cfgData; + + /* CFG CF is always zero */ + dfrmData->dfrmCfgData.dfrmCF = 0U; + + /* CFG JESDV */ + recoveryAction = adrv903x_JrxLink_JrxCoreJesdvCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG JESDV cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.jesdV = cfgData; + + /* CFG SUBCLASSV */ + recoveryAction = adrv903x_JrxLink_JrxCoreSubclassvCfg_BfGet(device, + NULL, + deframerBaseAddr, + &cfgData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get CFG SUBCLASSV cfg for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmCfgData.subclassV = cfgData; + + /***** Read configuration for each lane and compare with the selected deframer configuration *****/ + + for (laneIdx = 0U; laneIdx < ADI_ADRV903X_MAX_SERDES_LANES; laneIdx++) + { + if ((dfrmData->phyLaneEnMask & (1U << laneIdx)) == 0U) + { + continue; /* skip lane that is not enabled */ + } + + /*** Read and comparing lane DID ***/ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS DID for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData[laneIdx].dfrmDID = regData; + + if (dfrmData->dfrmIlasData[laneIdx].dfrmDID != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_DID; + } + + if (dfrmData->dfrmIlasData[laneIdx].dfrmDID != dfrmData->dfrmCfgData.dfrmDID) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_DID; + } + + /*** Read and comparing lane BID ***/ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg1_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS BID for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData[laneIdx].dfrmBID = (regData & 0x0FU); + + if (dfrmData->dfrmIlasData[laneIdx].dfrmBID != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_BID; + } + + /* CFG BID is not supported so deframer assign it to lane ILAS read */ + dfrmData->dfrmCfgData.dfrmBID = dfrmData->dfrmIlasData[laneIdx].dfrmBID; + + if (dfrmData->dfrmIlasData[laneIdx].dfrmBID != dfrmData->dfrmCfgData.dfrmBID) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_BID; + } + + /*** Read and comparing lane LID ***/ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg2_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS LID for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData[laneIdx].dfrmLID = (regData & 0x1FU); + + if (dfrmData->dfrmIlasData[laneIdx].dfrmLID != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_LID; + } + + if (dfrmData->dfrmIlasData[laneIdx].dfrmLID != dfrmData->dfrmCfgData.dfrmLID) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_LID; + } + + /*** Read and comparing lane L and SCR ***/ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg3_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS L and SCR for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData[laneIdx].dfrmL = (regData & 0x1FU); + dfrmData->dfrmIlasData[laneIdx].dfrmSCR = ((regData & 0x80U) >> 7U); + + if (dfrmData->dfrmIlasData[laneIdx].dfrmL != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_L; + } + + if (dfrmData->dfrmIlasData[laneIdx].dfrmL != dfrmData->dfrmCfgData.dfrmL) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_L; + } + + /*** Comparing lane DSCR ***/ + if (dfrmData->dfrmIlasData[laneIdx].dfrmSCR != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_SCR; + } + + if (dfrmData->dfrmIlasData[laneIdx].dfrmSCR != dfrmData->dfrmCfgData.dfrmSCR) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_SCR; + } + + /*** Read and comparing lane F ***/ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg4_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS F for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData[laneIdx].dfrmF = regData; + + if (dfrmData->dfrmIlasData[laneIdx].dfrmF != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_F; + } + + if (dfrmData->dfrmIlasData[laneIdx].dfrmF != dfrmData->dfrmCfgData.dfrmF) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_F; + } + + /*** Read and comparing lane K ***/ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg5_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS K for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData[laneIdx].dfrmK = (regData & 0x1FU); + + if (dfrmData->dfrmIlasData[laneIdx].dfrmK != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_K; + } + + if (dfrmData->dfrmIlasData[laneIdx].dfrmK != dfrmData->dfrmCfgData.dfrmK) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_K; + } + + /*** Read and comparing lane M ***/ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg6_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS M for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData[laneIdx].dfrmM = regData; + + if (dfrmData->dfrmIlasData[laneIdx].dfrmM != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_M; + } + + if (dfrmData->dfrmIlasData[laneIdx].dfrmM != dfrmData->dfrmCfgData.dfrmM) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_M; + } + + /*** Read and comparing lane N and CS ***/ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg7_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS N and CS for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData[laneIdx].dfrmN = (regData & 0x1FU); + dfrmData->dfrmIlasData[laneIdx].dfrmCS = ((regData & 0xC0U) >> 6U); + + if (dfrmData->dfrmIlasData[laneIdx].dfrmN != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_N; + } + + if (dfrmData->dfrmIlasData[laneIdx].dfrmN != dfrmData->dfrmCfgData.dfrmN) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_N; + } + + /*** Comparing lane CS ***/ + if (dfrmData->dfrmIlasData[laneIdx].dfrmCS != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_CS; + } + + if (dfrmData->dfrmIlasData[laneIdx].dfrmCS != dfrmData->dfrmCfgData.dfrmCS) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_CS; + } + + /*** Read and comparing lane NP and JESDV ***/ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg8_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS NP and JESDV for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData[laneIdx].dfrmNP = (regData & 0X1FU); + dfrmData->dfrmIlasData[laneIdx].jesdV = (regData & 0XE0U) >> 5U; + + if (dfrmData->dfrmIlasData[laneIdx].dfrmNP != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_NP; + } + + if (dfrmData->dfrmIlasData[laneIdx].dfrmNP != dfrmData->dfrmCfgData.dfrmNP) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_NP; + } + + /*** Comparing lane JESDV ***/ + if (dfrmData->dfrmIlasData[laneIdx].jesdV != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_JESDV; + } + + if (dfrmData->dfrmIlasData[laneIdx].jesdV != dfrmData->dfrmCfgData.jesdV) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_JESDV; + } + + /*** Read and comparing lane S ***/ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg9_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS S for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData[laneIdx].dfrmS = (regData & 0X1FU); + dfrmData->dfrmIlasData[laneIdx].subclassV = (regData & 0XE0) >> 5U; + + if (dfrmData->dfrmIlasData[laneIdx].dfrmS != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_S; + } + + if (dfrmData->dfrmIlasData[laneIdx].dfrmS != dfrmData->dfrmCfgData.dfrmS) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_S; + } + + /*** Comparing lane SUBCLASSV ***/ + if (dfrmData->dfrmIlasData[laneIdx].subclassV != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_SUBCLASSV; + } + + if (dfrmData->dfrmIlasData[laneIdx].subclassV != dfrmData->dfrmCfgData.subclassV) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_SUBCLASSV; + } + + /*** Read and comparing lane CF ***/ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg10_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS CF and HD for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData[laneIdx].dfrmCF = (regData & 0X1FU); + dfrmData->dfrmIlasData[laneIdx].dfrmHD = ((regData & 0x80U) >> 7U); + + if (dfrmData->dfrmIlasData[laneIdx].dfrmCF != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_CF; + } + + if (dfrmData->dfrmIlasData[laneIdx].dfrmCF != dfrmData->dfrmCfgData.dfrmCF) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_CF; + } + + /*** Comparing lane HD ***/ + if (dfrmData->dfrmIlasData[laneIdx].dfrmHD != 0U) + { + dfrmData->zeroCheckFlag[laneIdx] |= ADI_ADRV903X_ILAS_HD; + } + + if (dfrmData->dfrmIlasData[laneIdx].dfrmHD != dfrmData->dfrmCfgData.dfrmHD) + { + dfrmData->ilasMismatchDfrm[laneIdx] |= ADI_ADRV903X_ILAS_HD; + } + + /*** Read lane CHKSUM ***/ + recoveryAction = adrv903x_JesdCommon_JrxDl204bL0Rxcfg13_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, + laneIdx, + ®Data); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get ILAS CHKSUM for the selected deframer"); + goto cleanup; + } + dfrmData->dfrmIlasData[laneIdx].dfrmFCHK = regData; + + /*** Set lane mismatch bit map */ + if (dfrmData->ilasMismatchDfrm[laneIdx] != 0U) + { + dfrmData->laneMismatchMask |= 1U << laneIdx; + } + } + + /*** Calculate and compare CHKSUM ***/ + recoveryAction = adrv903x_IlasChksum(device, dfrmData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to compare ILAS CHKSUM for the selected deframer"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmIrqMaskGet( adi_adrv903x_Device_t* const device, + uint16_t* const irqMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJesdCommonChanAddr_e commonBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, irqMask, cleanup); + *irqMask = 0U; + + /* Read back the Dfrm IRQ Mask Vector for deframers */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bIrqClr_BfGet( device, + NULL, + commonBaseAddr, + irqMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading 204B Irq Mask for Deframers"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmIrqMaskSet( adi_adrv903x_Device_t* const device, + const uint16_t irqMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJesdCommonChanAddr_e commonBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Set the Dfrm IRQ Mask Vector for deframers */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bIrqClr_BfSet( device, + NULL, + commonBaseAddr, + irqMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting 204B Irq Mask for Deframers"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmIrqSourceReset( adi_adrv903x_Device_t* const device) +{ + static const uint16_t irqMask_Clr = 0xFFFFU; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJesdCommonChanAddr_e commonBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON; + uint16_t irqMask_Save = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Read back the Dfrm IRQ Vector, clear interrupts, restore original mask */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bIrqClr_BfGet( device, + NULL, + commonBaseAddr, + &irqMask_Save); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error saving initial 204B Irq Mask for Deframers"); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JrxDl204bIrqClr_BfSet( device, + NULL, + commonBaseAddr, + irqMask_Clr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error clearing all 204B Irqs for Deframers"); + goto cleanup; + } + + recoveryAction = adrv903x_JesdCommon_JrxDl204bIrqClr_BfSet( device, + NULL, + commonBaseAddr, + irqMask_Save); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error restoring initial 204B Irq Mask for Deframers"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmIrqSourceGet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeframerSel_e deframerSelect, + adi_adrv903x_DeframerIrqVector_t* const irqSourceVector) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJesdCommonChanAddr_e commonBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON; + adi_adrv903x_DeframerCfg_t deframerCfg[ADI_ADRV903X_MAX_DEFRAMERS]; + uint8_t deframerIdx = 0U; + uint8_t laneIdx = 0U; + uint8_t laneSel = 0U; + + ADI_LIBRARY_MEMSET(&deframerCfg, 0, sizeof(deframerCfg)); + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, irqSourceVector, cleanup); + + /* Range Check deframerSelect */ + if ((deframerSelect != ADI_ADRV903X_DEFRAMER_0) && + (deframerSelect != ADI_ADRV903X_DEFRAMER_1) && + (deframerSelect != ADI_ADRV903X_ALL_DEFRAMER)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, deframerSelect, "Invalid JESD Deframer Select Value. Must select Deframer 0, 1, or All."); + goto cleanup; + } + + /* Clear irqSourceVector */ + ADI_LIBRARY_MEMSET(irqSourceVector, 0, sizeof(adi_adrv903x_DeframerIrqVector_t)); + + /* Determine which lane vectors are used by each deframer */ + for (deframerIdx = 0U; deframerIdx < ADI_ADRV903X_MAX_DEFRAMERS; deframerIdx++) + { + recoveryAction = adi_adrv903x_DeframerCfgGet(device, ADI_ADRV903X_DEFRAMER_0, &deframerCfg[deframerIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error retrieving deframer configuration"); + goto cleanup; + } + } + + /* Read back Dfrm IRQ Vectors for all lanes enabled for any selected deframer */ + for (laneIdx = 0U; laneIdx < ADI_ADRV903X_MAX_DESERIALIZER_LANES; laneIdx++) + { + laneSel = 1U << laneIdx; + + // Read this lane if enabled for a selected deframer + if ((deframerSelect == ADI_ADRV903X_DEFRAMER_0) || + (deframerSelect == ADI_ADRV903X_ALL_DEFRAMER)) + { + if ((deframerCfg[0U].deserializerLanesEnabled & laneSel) != 0U) + { + recoveryAction = adrv903x_JesdCommon_JrxDl204bIrqVec_BfGet( device, + NULL, + commonBaseAddr, + laneIdx, + &irqSourceVector->lane[laneIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading Irq Source Vector for a deserialized lane enabled for Deframer0."); + goto cleanup; + } + + irqSourceVector->deframer0 |= irqSourceVector->lane[laneIdx]; + } + } + + if ((deframerSelect == ADI_ADRV903X_DEFRAMER_1) || + (deframerSelect == ADI_ADRV903X_ALL_DEFRAMER)) + { + if ((deframerCfg[1U].deserializerLanesEnabled & laneSel) != 0U) + { + recoveryAction = adrv903x_JesdCommon_JrxDl204bIrqVec_BfGet( device, + NULL, + commonBaseAddr, + laneIdx, + &irqSourceVector->lane[laneIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading Irq Source Vector for a deserialized lane enabled for Deframer0."); + goto cleanup; + } + + irqSourceVector->deframer1 |= irqSourceVector->lane[laneIdx]; + } + } + + } + + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmErrCntrCntrlSet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_DfrmErrCounterIrqSel_e interruptEnable, + const uint8_t laneNumber, + const uint8_t errCounterControl, + const uint8_t errCounterHoldCfg) +{ + static const uint16_t IRQERRCOUNTERMASK = 0x00E0U; + static const uint8_t ERRCOUNTERRSTMASK = 0X70U; + static const uint8_t ERRCOUNTERCNTRLMASK = 0x07U; + static const uint8_t ERRCOUNTERHOLDMASK = 0x07U; + static const uint8_t ERRCOUNTERRSTSHIFT = 4U; + static const uint8_t CLEAR_RESET = 0x00U; + static const uint8_t MAX_COUNTER = 0xFFU; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJesdCommonChanAddr_e commonBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON; + uint16_t irqMask = 0U; + uint8_t errorCounterReset = 0x00U; + uint8_t errorCounterConfig = 0x00U; + uint8_t lcl_errCounterHoldCfg = 0x00U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Check interrupt enable is valid */ + if ((interruptEnable != ADI_ADRV903X_DFRM_ERR_COUNT_ENABLE_IRQ) && + (interruptEnable != ADI_ADRV903X_DFRM_ERR_COUNT_DISABLE_IRQ)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, interruptEnable, "Invalid JESD 204b Deframer Error Counter Interrupt Enable value. Must select Enable or Disable."); + goto cleanup; + } + + /* Check lane number */ + if (laneNumber >= ADI_ADRV903X_MAX_DESERIALIZER_LANES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, laneNumber, "Invalid Lane Number value selected. Must Select lane 0-7."); + goto cleanup; + } + + /* Read current irq mask for read/modify/write */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bIrqClr_BfGet( device, + NULL, + commonBaseAddr, + &irqMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error saving initial 204B Irq Mask for Deframers"); + goto cleanup; + } + + /* Mask or unmask the three 204B Error-Counter based IRQs (BD/NIT/UnexpectedK) */ + if (interruptEnable == ADI_ADRV903X_DFRM_ERR_COUNT_ENABLE_IRQ) + { + irqMask &= (~IRQERRCOUNTERMASK); + } + else + { + irqMask |= IRQERRCOUNTERMASK; + } + + /* Write modified irqMask to device */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bIrqClr_BfSet( device, + NULL, + commonBaseAddr, + irqMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting new 204B Irq Mask for Deframers"); + goto cleanup; + } + + /* Extract 3 reset bits from input argument */ + errorCounterReset = (errCounterControl & ERRCOUNTERRSTMASK) >> ERRCOUNTERRSTSHIFT; + + /* Mask 3 config bits from input argument */ + errorCounterConfig = errCounterControl & ERRCOUNTERCNTRLMASK; + lcl_errCounterHoldCfg = errCounterHoldCfg & ERRCOUNTERHOLDMASK; + + /* Reset the requested error counters */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bEcntRst_BfSet( device, + NULL, + commonBaseAddr, + laneNumber, + errorCounterReset); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to reset error counters."); + goto cleanup; + } + + /* Clear reset bits */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bEcntRst_BfSet( device, + NULL, + commonBaseAddr, + laneNumber, + CLEAR_RESET); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to clear reset flag for error counters."); + goto cleanup; + } + + /* Set error counter threshold to 255 */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bEth_BfSet( device, + NULL, + commonBaseAddr, + MAX_COUNTER); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to clear set error threshold."); + goto cleanup; + } + + /* Write counter enable bits */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bEcntEna_BfSet( device, + NULL, + commonBaseAddr, + laneNumber, + errorCounterConfig); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write error counter enable."); + goto cleanup; + } + + /* Write the error counter hold configuration */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bEcntTch_BfSet( device, + NULL, + commonBaseAddr, + laneNumber, + lcl_errCounterHoldCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write error counter hold configuration."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DfrmErrCntrCntrlGet( adi_adrv903x_Device_t* const device, + const uint8_t laneNumber, + uint8_t* const errCounterControl, + uint8_t* const errCounterHoldCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfJesdCommonChanAddr_e commonBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, errCounterControl, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, errCounterHoldCfg, cleanup); + + /* Check lane number */ + if (laneNumber >= ADI_ADRV903X_MAX_DESERIALIZER_LANES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, laneNumber, "Invalid Lane Number value selected. Must Select lane 0-7."); + goto cleanup; + } + + /* Read out the contents of the error counter control */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bEcntEna_BfGet( device, + NULL, + commonBaseAddr, + laneNumber, + errCounterControl); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read error counter control."); + goto cleanup; + } + + /* Read out the contents of the error counter hold configuration */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bEcntTch_BfGet( device, + NULL, + commonBaseAddr, + laneNumber, + errCounterHoldCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read error counter hold configuration."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RunEyeSweep(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuCmd_RunEyeSweep_t* const runEyeSweep, + adi_adrv903x_CpuCmd_RunEyeSweepResp_t* const runEyeSweepResp) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_RunEyeSweep_t runEyeSweepCmd; + adrv903x_CpuCmd_RunEyeSweepResp_t runEyeSweepCmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + uint32_t chanSel = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, runEyeSweep, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, runEyeSweepResp, cleanup); + ADI_LIBRARY_MEMSET(&runEyeSweepCmd, 0, sizeof(adrv903x_CpuCmd_RunEyeSweep_t)); + ADI_LIBRARY_MEMSET(&runEyeSweepCmdRsp, 0, sizeof(adrv903x_CpuCmd_RunEyeSweepResp_t)); + + if (runEyeSweep->lane > 7U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, runEyeSweep->lane, "Invalid lane provided."); + goto cleanup; + } + + if (runEyeSweep->prbsPattern > 3U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, runEyeSweep->prbsPattern, "Invalid prbsPattern provided."); + goto cleanup; + } + + if (runEyeSweep->forceUsingOuter > 1U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, runEyeSweep->forceUsingOuter, "Invalid forceUsingOuter provided."); + goto cleanup; + } + + if (runEyeSweep->prbsCheckDuration_ms == 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, runEyeSweep->prbsCheckDuration_ms, "Invalid prbsCheckDuration_ms provided."); + goto cleanup; + } + + /* Get the CPU that is responsible for the requested lane. */ + chanSel = 1U << (uint32_t)runEyeSweep->lane; + recoveryAction = adrv903x_CpuChannelMappingGet(device, (adi_adrv903x_Channels_e)(chanSel), ADRV903X_CPU_OBJID_IC_SERDES, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, runEyeSweep->lane, "Invalid lane provided"); + goto cleanup; + } + + /* Prepare the command payload */ + runEyeSweepCmd.lane = (uint8_t)runEyeSweep->lane; + runEyeSweepCmd.prbsPattern = (uint8_t)runEyeSweep->prbsPattern; + runEyeSweepCmd.forceUsingOuter = (uint8_t)runEyeSweep->forceUsingOuter; + runEyeSweepCmd.prbsCheckDuration_ms = ADRV903X_HTOCL(runEyeSweep->prbsCheckDuration_ms); + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_RUN_SERDES_EYE_SWEEP, + (void*)&runEyeSweepCmd, + sizeof(runEyeSweepCmd), + (void*)&runEyeSweepCmdRsp, + sizeof(runEyeSweepCmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(runEyeSweepCmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + /* Extract the command-specific response from the response payload */ + runEyeSweepResp->spoLeft = runEyeSweepCmdRsp.spoLeft; + runEyeSweepResp->spoRight = runEyeSweepCmdRsp.spoRight; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RunEyeSweep_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuCmd_RunEyeSweep_t* const runEyeSweep, + adi_adrv903x_CpuCmd_RunEyeSweepResp_t* const runEyeSweepResp) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t chanSel = 0U; + uint32_t lengthResp = 0U; + uint32_t timeElapsedUs = 0U; + uint32_t le32PrbsCheckDuration_ms = 0U; + adi_adrv903x_CpuCmd_RunEyeSweepResp_t* runEyeSweepCmdRsp = NULL; + uint8_t ctrlDataSet[ADRV903X_SERDES_HORIZ_EYE_SWEEP_CMD_SIZE_BYTES]; + uint8_t ctrlDataGet[ADRV903X_SERDES_HORIZ_EYE_SWEEP_CMD_SIZE_BYTES]; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, runEyeSweep, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, runEyeSweepResp, cleanup); + + ADI_LIBRARY_MEMSET((void*)ctrlDataSet, 0, sizeof(ctrlDataSet)); + ADI_LIBRARY_MEMSET((void*)ctrlDataGet, 0, sizeof(ctrlDataGet)); + + /* Verify Parameters*/ + if (runEyeSweep->lane > 7U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, runEyeSweep->lane, "Invalid lane provided."); + goto cleanup; + } + + if (runEyeSweep->prbsPattern > 3U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, runEyeSweep->prbsPattern, "Invalid prbsPattern provided."); + goto cleanup; + } + + if (runEyeSweep->prbsCheckDuration_ms == 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, runEyeSweep->prbsCheckDuration_ms, "Invalid prbsCheckDuration_ms provided."); + goto cleanup; + } + + le32PrbsCheckDuration_ms = ADRV903X_HTOCL(runEyeSweep->prbsCheckDuration_ms); + + /* Get channel corresponded to the requested lane. */ + chanSel = 1U << (uint32_t)runEyeSweep->lane; + + /* Prepare the command payload */ + ctrlDataSet[0] = (uint8_t)runEyeSweep->lane; + ctrlDataSet[1] = (uint8_t)ADRV903X_SERDES_TEST_CMD; + ctrlDataSet[2] = (uint8_t)ADRV903X_SERDES_TEST_HORIZ_EYE_SWEEP; + ctrlDataSet[3] = 0x01U; + ctrlDataSet[4] = (uint8_t)runEyeSweep->prbsPattern; + ctrlDataSet[8] = (uint8_t)(le32PrbsCheckDuration_ms & 0xFFU); + ctrlDataSet[9] = (uint8_t)((le32PrbsCheckDuration_ms >> 8U) & 0xFFU); + ctrlDataSet[10] = (uint8_t)((le32PrbsCheckDuration_ms >> 16U) & 0xFFU); + ctrlDataSet[11] = (uint8_t)((le32PrbsCheckDuration_ms >> 24U) & 0xFFU); + ctrlDataSet[12] = 0x01U; + + /* Exec command */ + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + ADRV903X_CPU_OBJID_IC_SERDES, + ADRV903X_SERDES_CTRL_SET_FSM_CMD, + (adi_adrv903x_Channels_e)(chanSel), + ctrlDataSet, + sizeof(ctrlDataSet), + &lengthResp, + ctrlDataGet, + sizeof(ctrlDataGet)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + chanSel, + "Failed to Run Horizontal Eye Sweep"); + goto cleanup; + } + + runEyeSweepCmdRsp = (adi_adrv903x_CpuCmd_RunEyeSweepResp_t*)((uint8_t*)ctrlDataGet + ADRV903X_SERDES_CTRL_FSM_CMD_RSP_HDR_SIZE_BYTES); + + /* Poll Serdes Calibration Status for completion of the Eye Sweep */ + for (timeElapsedUs = 0U; timeElapsedUs < ADI_ADRV903X_RUNEYESWEEP_TIMEOUT_ONE_HOUR_IN_US; timeElapsedUs += ADI_ADRV903X_RUNEYESWEEP_INTERVAL_US) + { + /* Get Serdes Calibration Status */ + recoveryAction = adi_adrv903x_CalSpecificStatusGet( device, + (adi_adrv903x_Channels_e)(chanSel), + ADRV903X_CPU_OBJID_TC_SERDES, + ctrlDataGet, + sizeof(ctrlDataGet)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get Serdes calibration status failed"); + goto cleanup; + } + + /* Break out here if Eye sweep have been completed */ + if (ctrlDataGet[1] == (uint8_t)ADRV903X_SERDES_TEST_CMD_DONE) + { + break; + } + + /* Eye Sweep is still in progress. Wait the specified wait interval, then check again for status. */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, ADI_ADRV903X_RUNEYESWEEP_INTERVAL_US); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Issue"); + goto cleanup; + } + } + + /* Check for timeout */ + if (timeElapsedUs >= ADI_ADRV903X_RUNEYESWEEP_TIMEOUT_ONE_HOUR_IN_US) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_TIMEOUT, + recoveryAction, + timeElapsedUs, + "Run Horizontal Eye Sweep Timeout"); + goto cleanup; + } + + /* Extract the command-specific response from the response payload */ + runEyeSweepResp->spoLeft = runEyeSweepCmdRsp->spoLeft; + runEyeSweepResp->spoRight = runEyeSweepCmdRsp->spoRight; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RunVerticalEyeSweep(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuCmd_RunVertEyeSweep_t* const runVerticalEyeSweep, + adi_adrv903x_CpuCmd_RunVertEyeSweepResp_t* const runVerticalEyeSweepResp) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_RunVertEyeSweep_t runVerticalEyeSweepCmd; + adrv903x_CpuCmd_RunVertEyeSweepResp_t runVerticalEyeSweepCmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + uint32_t chanSel = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, runVerticalEyeSweep, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, runVerticalEyeSweepResp, cleanup); + + ADI_LIBRARY_MEMSET(&runVerticalEyeSweepCmd, 0, sizeof(adrv903x_CpuCmd_RunVertEyeSweep_t)); + ADI_LIBRARY_MEMSET(&runVerticalEyeSweepCmdRsp, 0, sizeof(adrv903x_CpuCmd_RunVertEyeSweepResp_t)); + + if (runVerticalEyeSweep->lane > 7U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, runVerticalEyeSweep->lane, "Invalid lane provided."); + goto cleanup; + } + + /* Get the CPU that is responsible for the requested lane. */ + chanSel = (uint32_t)(1U << runVerticalEyeSweep->lane); + recoveryAction = adrv903x_CpuChannelMappingGet(device, (adi_adrv903x_Channels_e)(chanSel), ADRV903X_CPU_OBJID_IC_SERDES, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, runVerticalEyeSweep->lane, "Invalid lane provided"); + goto cleanup; + } + + /* Prepare the command payload */ + runVerticalEyeSweepCmd.lane = (uint8_t)runVerticalEyeSweep->lane; + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_RUN_SERDES_VERT_EYE_SWEEP, + (void*)&runVerticalEyeSweepCmd, + sizeof(runVerticalEyeSweepCmd), + (void*)&runVerticalEyeSweepCmdRsp, + sizeof(runVerticalEyeSweepCmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(runVerticalEyeSweepCmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + /* Extract the command-specific response from the response payload */ + ADI_LIBRARY_MEMCPY(&runVerticalEyeSweepResp->eyeHeightsAtSpo, runVerticalEyeSweepCmdRsp.eyeHeightsAtSpo, sizeof(runVerticalEyeSweepCmdRsp.eyeHeightsAtSpo)); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RunVerticalEyeSweep_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuCmd_RunVertEyeSweep_t* const runVerticalEyeSweep, + adi_adrv903x_CpuCmd_RunVertEyeSweepResp_t* const runVerticalEyeSweepResp) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t chanSel = 0U; + uint32_t lengthResp = 0U; + uint32_t timeElapsedUs = 0U; + adi_adrv903x_CpuCmd_RunVertEyeSweepResp_t* runEyeSweepCmdRsp = NULL; + uint8_t ctrlDataSet[ADRV903X_SERDES_VERT_EYE_SWEEP_CMD_SIZE_BYTES]; + uint8_t ctrlDataGet[sizeof(adi_adrv903x_CpuCmd_RunVertEyeSweepResp_t) + ADRV903X_SERDES_CTRL_FSM_CMD_RSP_HDR_SIZE_BYTES]; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, runVerticalEyeSweep, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, runVerticalEyeSweepResp, cleanup); + + ADI_LIBRARY_MEMSET((void*)ctrlDataSet, 0, sizeof(ctrlDataSet)); + ADI_LIBRARY_MEMSET((void*)ctrlDataGet, 0, sizeof(ctrlDataGet)); + + if (runVerticalEyeSweep->lane > 7U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, runVerticalEyeSweep->lane, "Invalid lane provided."); + goto cleanup; + } + + /* Get channel corresponded to the requested lane. */ + chanSel = 1U << (uint32_t)runVerticalEyeSweep->lane; + + /* Prepare the command payload */ + ctrlDataSet[0] = (uint8_t)runVerticalEyeSweep->lane; + ctrlDataSet[1] = (uint8_t)ADRV903X_SERDES_TEST_CMD; + ctrlDataSet[2] = (uint8_t)ADRV903X_SERDES_TEST_VERT_EYE_SWEEP; + ctrlDataSet[3] = 0x01U; + ctrlDataSet[4] = 0x10U; + ctrlDataSet[5] = 0x01U; + + /* Exec command */ + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + ADRV903X_CPU_OBJID_IC_SERDES, + ADRV903X_SERDES_CTRL_SET_FSM_CMD, + (adi_adrv903x_Channels_e)(chanSel), + ctrlDataSet, + sizeof(ctrlDataSet), + &lengthResp, + ctrlDataGet, + sizeof(ctrlDataGet)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + chanSel, + "Failed to Run Vertical Eye Sweep"); + goto cleanup; + } + + runEyeSweepCmdRsp = (adi_adrv903x_CpuCmd_RunVertEyeSweepResp_t*)((uint8_t*)ctrlDataGet + ADRV903X_SERDES_CTRL_FSM_CMD_RSP_HDR_SIZE_BYTES); + + /* Poll Serdes Calibration Status for completion of the Eye Sweep */ + for (timeElapsedUs = 0U; timeElapsedUs < ADI_ADRV903X_RUNEYESWEEP_TIMEOUT_US; timeElapsedUs += ADI_ADRV903X_RUNEYESWEEP_INTERVAL_US) + { + /* Get Serdes Calibration Status */ + recoveryAction = adi_adrv903x_CalSpecificStatusGet( device, + (adi_adrv903x_Channels_e)(chanSel), + ADRV903X_CPU_OBJID_TC_SERDES, + ctrlDataGet, + sizeof(ctrlDataGet)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get Serdes calibration status failed"); + goto cleanup; + } + + /* Break out here if Eye sweep have been completed */ + if (ctrlDataGet[1] == (uint8_t)ADRV903X_SERDES_TEST_CMD_DONE) + { + break; + } + + /* Eye Sweep is still in progress. Wait the specified wait interval, then check again for status. */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, ADI_ADRV903X_RUNEYESWEEP_INTERVAL_US); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Issue"); + goto cleanup; + } + } + + /* Check for timeout */ + if (timeElapsedUs >= ADI_ADRV903X_RUNEYESWEEP_TIMEOUT_US) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_TIMEOUT, + recoveryAction, + timeElapsedUs, + "Run Vertical Eye Sweep Timeout"); + goto cleanup; + } + + /* Extract the command-specific response from the response payload */ + ADI_LIBRARY_MEMCPY(&runVerticalEyeSweepResp->eyeHeightsAtSpo, runEyeSweepCmdRsp->eyeHeightsAtSpo, sizeof(runEyeSweepCmdRsp->eyeHeightsAtSpo)); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerializerReset_v2(adi_adrv903x_Device_t* const device, + adi_adrv903x_CpuCmd_SerReset_t* const pSerResetParms, + adi_adrv903x_CpuCmd_SerResetResp_t* const pSerResetResp) +{ + uint8_t framerLinkType = 0U; + uint8_t phyLanePd = 0U; + uint8_t phyLaneIdx = 0U; + adrv903x_BfSerdesTxdigPhyRegmapCore1p2ChanAddr_e laneSerdesPhyBitfieldAddr = ADRV903X_BF_DIGITAL_CORE_JESD_SERIALIZER_SER_PHY_0_; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + adrv903x_CpuCmd_SerReset_t serReset; + adrv903x_CpuCmd_SerResetResp_t serResetResp; + uint8_t presetClockOffsets = 0U; + adrv903x_CpuCmd_JtxLanePower_t jtxPwrCmd; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, pSerResetParms, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, pSerResetResp, cleanup); + + ADI_LIBRARY_MEMSET(&serReset, 0, sizeof(adrv903x_CpuCmd_SerReset_t)); + ADI_LIBRARY_MEMSET(&serResetResp, 0, sizeof(adrv903x_CpuCmd_SerResetResp_t)); + ADI_LIBRARY_MEMSET(&jtxPwrCmd, 0, sizeof(jtxPwrCmd)); + + /* copy parameter */ + serReset.serResetParm = ADRV903X_HTOCL(pSerResetParms->serResetParm); + presetClockOffsets = pSerResetParms->presetClockOffsets; + + /* Get the framer link type: 204B or 204C - Check link0 type only */ + recoveryAction = adrv903x_JtxLink_JtxLinkType_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_, + &framerLinkType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link type for the selected framer"); + goto cleanup; + } + + if (presetClockOffsets) + { + for (phyLaneIdx = 0U; phyLaneIdx < ADI_ADRV903X_MAX_SERDES_LANES; phyLaneIdx++) + { + recoveryAction = (adi_adrv903x_ErrAction_e) adrv903x_FramerLaneSerdesPhyBitfieldAddressGet(device, + phyLaneIdx, + &laneSerdesPhyBitfieldAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane serdes PHY address."); + goto cleanup; + } + + recoveryAction = adrv903x_GetJtxLanePoweredDown(device, + laneSerdesPhyBitfieldAddr, + &phyLanePd); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading Jtx lane power-up status"); + goto cleanup; + } + + if (phyLanePd == 0U) + { + /* Lane is powered up; Determine the reset sequence based on the 204c/204b mode */ + if (framerLinkType == 0U) + { + /* 204b case set Clockoffset to 4 */ + recoveryAction = adrv903x_SerdesTxdigPhyRegmapCore1p2_ClkoffsetSerRc_BfSet( device, + NULL, + laneSerdesPhyBitfieldAddr, + 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing to serializer clock offset"); + goto cleanup; + } + + } + else + { + /* 204C - set FIFO Start Addr to 1 */ + recoveryAction = adrv903x_SerdesTxdigPhyRegmapCore1p2_FifoStartAddr_BfSet( device, + NULL, + laneSerdesPhyBitfieldAddr, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing Fifo Start Address"); + goto cleanup; + } + + /* set Clockoffset to 1 */ + recoveryAction = adrv903x_SerdesTxdigPhyRegmapCore1p2_ClkoffsetSerRc_BfSet( device, + NULL, + laneSerdesPhyBitfieldAddr, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing digital logic clock shift"); + goto cleanup; + } + } + } + } /* End for loop per lane */ + } + + /* Send serializer reset command */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_JESD_SER_RESET, + (void*)&serReset, + sizeof(serReset), + (void*)&serResetResp, + sizeof(serResetResp), + &cmdStatus); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(serResetResp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + /* Extract the command-specific response from the response payload */ + pSerResetResp->serResetResults = ADRV903X_CTOHL(serResetResp.serResetResults); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerLaneCfgGet(adi_adrv903x_Device_t* const device, + const uint8_t laneNumber, + adi_adrv903x_SerLaneCfg_t* const serLaneCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_GetJesdSerLaneCfg_t getJesdSerLaneCfg; + adrv903x_CpuCmd_GetJesdSerLaneCfgResp_t getJesdSerLaneCfgResp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + uint32_t chanSel = 0U; + + ADI_LIBRARY_MEMSET(&getJesdSerLaneCfg, 0, sizeof(adrv903x_CpuCmd_GetJesdSerLaneCfg_t)); + ADI_LIBRARY_MEMSET(&getJesdSerLaneCfgResp, 0, sizeof(adrv903x_CpuCmd_GetJesdSerLaneCfgResp_t)); + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, serLaneCfg, cleanup); + + if (laneNumber > 7U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, laneNumber, "Invalid lane provided."); + goto cleanup; + } + + ADI_LIBRARY_MEMSET(serLaneCfg, 0, sizeof(adi_adrv903x_SerLaneCfg_t)); + + /* Get the CPU that is responsible for the requested lane. TODO: Using channel mapping for now */ + chanSel = 1U << (uint32_t)laneNumber; + recoveryAction = adrv903x_CpuChannelMappingGet(device, (adi_adrv903x_Channels_e)(chanSel), ADRV903X_CPU_OBJID_SYSTEM_END, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, laneNumber, "Invalid lane provided"); + goto cleanup; + } + + /* Prepare the command payload */ + getJesdSerLaneCfg.lane = (uint8_t)laneNumber; + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_JESD_SER_LANE_GET_CFG, + (void*)&getJesdSerLaneCfg, + sizeof(getJesdSerLaneCfg), + (void*)&getJesdSerLaneCfgResp, + sizeof(getJesdSerLaneCfgResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(getJesdSerLaneCfgResp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + /* Extract the command-specific response from the response payload */ + serLaneCfg->outputDriveSwing = (adi_adrv903x_SerLaneCfgOutputDriveSwing_e)getJesdSerLaneCfgResp.outputDriveSwing; + serLaneCfg->preEmphasis = (adi_adrv903x_SerLaneCfgPreEmphasis_e)getJesdSerLaneCfgResp.preEmphasis; + serLaneCfg->postEmphasis = (adi_adrv903x_SerLaneCfgPostEmphasis_e)getJesdSerLaneCfgResp.postEmphasis; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerLaneCfgSet(adi_adrv903x_Device_t* const device, + const uint8_t laneNumber, + const adi_adrv903x_SerLaneCfg_t* const serLaneCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_SetJesdSerLaneCfg_t setJesdSerLaneCfg; + adrv903x_CpuCmd_SetJesdSerLaneCfgResp_t setJesdSerLaneCfgResp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_CpuErrorCode_t cpuErrorCode = 0U; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + uint32_t chanSel = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, serLaneCfg, cleanup); + ADI_LIBRARY_MEMSET(&setJesdSerLaneCfg, 0, sizeof(adrv903x_CpuCmd_SetJesdSerLaneCfg_t)); + ADI_LIBRARY_MEMSET(&setJesdSerLaneCfgResp, 0, sizeof(adrv903x_CpuCmd_SetJesdSerLaneCfgResp_t)); + + if (laneNumber > 7U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, laneNumber, "Invalid lane provided."); + goto cleanup; + } + + /* Get the CPU that is responsible for the requested lane. TODO: Using channel mapping for now */ + chanSel = 1U << (uint32_t)laneNumber; + recoveryAction = adrv903x_CpuChannelMappingGet(device, (adi_adrv903x_Channels_e)(chanSel), ADRV903X_CPU_OBJID_SYSTEM_END, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, laneNumber, "Invalid lane provided"); + goto cleanup; + } + + /* Prepare the command payload */ + setJesdSerLaneCfg.lane = (uint8_t)laneNumber; + setJesdSerLaneCfg.outputDriveSwing = (uint8_t)serLaneCfg->outputDriveSwing; + setJesdSerLaneCfg.preEmphasis = (uint8_t)serLaneCfg->preEmphasis; + setJesdSerLaneCfg.postEmphasis = (uint8_t)serLaneCfg->postEmphasis; + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_JESD_SER_LANE_SET_CFG, + (void*)&setJesdSerLaneCfg, + sizeof(setJesdSerLaneCfg), + (void*)&setJesdSerLaneCfgResp, + sizeof(setJesdSerLaneCfgResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(setJesdSerLaneCfgResp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_FramerTestDataInjectError(adi_adrv903x_Device_t* const device, + const adi_adrv903x_FramerSel_e framerSelect, + const uint8_t laneMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + adrv903x_BfJtxLinkChanAddr_e framerBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + uint8_t ballLane = 0U; + uint8_t invert = 0U; + uint8_t pnInvertBit = 0U; + uint8_t dieLaneId = 0U; + uint8_t framerOutForLane = 0U; + + static const uint8_t framerLaneLamTbl[ADI_ADRV903X_MAX_SERIALIZER_LANES] = { 1u, /* [0] SEROUT A */ + 3u, /* [1] SEROUT B */ + 5u, /* [2] SEROUT C */ + 7u, /* [3] SEROUT D */ + 0u, /* [4] SEROUT E */ + 2u, /* [5] SEROUT F */ + 4u, /* [6] SEROUT G */ + 6u /* [7] SEROUT H */ + }; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Get the base address of the selected framer */ + recoveryAction = adrv903x_FramerBitfieldAddressGet(device, framerSelect, &framerBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get base address for the selected framer"); + goto cleanup; + } + + for (ballLane = 0U; ballLane < ADI_ADRV903X_MAX_SERIALIZER_LANES ; ballLane++) + { + invert = ((laneMask >> ballLane) & 0x01U); + + if (invert == 1) + { + dieLaneId = framerLaneLamTbl[ballLane]; + + /* PN Invert occurs at framer output before lane crossbar */ + recoveryAction = adrv903x_JtxLink_JtxLaneSel_BfGet(device, + NULL, + framerBaseAddr, + dieLaneId, + &framerOutForLane); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get lane select for the selected framer"); + goto cleanup; + } + + if (framerOutForLane < ADI_ADRV903X_MAX_SERIALIZER_LANES) + { + /* Read current PN invert setting and set it back at end*/ + recoveryAction = adrv903x_JtxLink_JtxLaneInv_BfGet(device, + NULL, + framerBaseAddr, + framerOutForLane, + &pnInvertBit); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get pn invert bit for the selected framer"); + goto cleanup; + } + + recoveryAction = adrv903x_JtxLink_JtxLaneInv_BfSet(device, + NULL, + framerBaseAddr, + framerOutForLane, + ((~pnInvertBit) & 0x01U)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set pn invert bit for the selected framer"); + goto cleanup; + } + + recoveryAction = adrv903x_JtxLink_JtxLaneInv_BfSet(device, + NULL, + framerBaseAddr, + framerOutForLane, + pnInvertBit); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to set pn invert bit for the selected framer"); + goto cleanup; + } + + } + else + { + /* Lane disabled - do not invert */ + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +#ifndef __KERNEL__ +/* Open 'filePath' for logging serdes cal status. + * + * Create the file if required. Ensure the header information is written to start of the file. + * + * On success return a FILE* to the opened file; On failure return NULL. + */ +static FILE* adrv903x_openSerdesCalStatusLogFile(const adi_adrv903x_GenericStrBuf_t* const filePath) +{ + FILE* filePtr = NULL; + long filePos = 0; + +#ifdef __GNUC__ + filePtr = ADI_LIBRARY_FOPEN((const char *)filePath->c_str, "a"); +#else + if (ADI_LIBRARY_FOPEN_S(&filePtr, (const char*)filePath->c_str, "a") != 0) +#endif + + if (filePtr == NULL) + { + return NULL; + } + + filePos = ADI_LIBRARY_FTELL(filePtr); + + if (filePos == 0) + { + /* The file was created by fopen or was empty when opened; Write the header lines. */ + ADI_LIBRARY_FPRINTF(filePtr, "Per-lane Serdes initCal (ic) and trackingCal (tc) status\n"); + ADI_LIBRARY_FPRINTF(filePtr, + "APIver: %d.%d.%d.%d\n", + ADI_ADRV903X_CURRENT_MAJOR_VERSION, + ADI_ADRV903X_CURRENT_MINOR_VERSION, + ADI_ADRV903X_CURRENT_MAINTENANCE_VERSION, + ADI_ADRV903X_CURRENT_BUILD_VERSION); + ADI_LIBRARY_FPRINTF(filePtr, + "laneId,\"ic\",msg,temperature,lpfIndex,ctleIndex,numEyes,bsum,bsum_dc,spoLeft,spoRight,eom," + "eomMax,pd,innerUp,innerDown,outerUp,outerDown,b[]\n"); + ADI_LIBRARY_FPRINTF(filePtr, + "laneId,\"tc\",msg,temperature,pd[],dllPeakPd[],dllPeakPdDelta[],innerUp,innerDown,outerUp,outerDown," + "b[],ps[],yVector[]\n"); + } + + if (ADI_LIBRARY_FERROR(filePtr) != 0) + { + /* Open worked, write failed; Close file and return NULL. */ + ADI_LIBRARY_FCLOSE(filePtr); + return NULL; + } + + /* Success */ + return filePtr; +} +#endif /* __KERNEL__ */ + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerdesInitCalStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GenericStrBuf_t* const filePath, + const uint8_t laneNumber, + const adi_adrv903x_GenericStrBuf_t* const msg, + adi_adrv903x_SerdesInitCalStatus_t* const calStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + adrv903x_CpuCmd_SerdesCalStatusGet_t cpuCmd; + adrv903x_SerdesInitCalStatusCmdResp_t cmdResp; + FILE* filePtr = NULL; + uint32_t i = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, calStatus, cleanup); + /* filePath and msg may be NULL */ + + ADI_LIBRARY_MEMSET(&cpuCmd, 0, sizeof(cpuCmd)); + ADI_LIBRARY_MEMSET(&cmdResp, 0, sizeof(cmdResp)); + + if (laneNumber >= ADRV903X_JESD_MAX_DESERIALIZER_LANES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, ADI_ADRV903X_ERR_ACT_CHECK_PARAM, laneNumber, "Invalid laneNumber value"); + goto cleanup; + } + + /* Get the CPU that is responsible for the requested lane. */ + recoveryAction = adrv903x_CpuChannelMappingGet(device, (adi_adrv903x_Channels_e)(1U << laneNumber), ADRV903X_CPU_OBJID_IC_SERDES, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, laneNumber, "Lane to CPU lookup failed"); + goto cleanup; + } + + /* Prepare the command payload */ + cpuCmd.lane = laneNumber; + CTOH_STRUCT(cpuCmd, adrv903x_CpuCmd_SerdesCalStatusGet); + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_SERDES_FG_METRICS, + (void*)&cpuCmd, + sizeof(cpuCmd), + (void*)&cmdResp, + sizeof(cmdResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to call CPU cmd SERDES_TEST_GET_FG_METRICS"); + goto cleanup; + } + + CTOH_STRUCT(cmdResp, adrv903x_SerdesInitCalStatusCmdResp); + + if (cmdStatus != ADRV903X_CPU_CMD_STATUS_NO_ERROR) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_ERROR_REPORT(&device->common, + ADI_COMMON_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + cmdResp.cpuErrorCode, + "CPU cmd SERDES_TEST_GET_FG_METRICS failed"); + goto cleanup; + } + + *calStatus = cmdResp.details; + + if (filePath == NULL || filePath->c_str[0] == '\0') + { + /* No log file has been supplied; We're done. */ + goto cleanup; + } +#ifndef __KERNEL__ + /* Log file supplied; Write data to it. */ + filePtr = adrv903x_openSerdesCalStatusLogFile(filePath); +#endif + if (filePtr == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, filePath, "Unable to open serdes init cal status log file"); + goto cleanup; + } + + /* File is open and header line, if required, has been written; Write data line.*/ + ADI_LIBRARY_FPRINTF(filePtr, + "%u,ic,%s,%d,%u,%u,%u,%u,%u,%u,%u,%u,%u,%d,%d,%d,%d,%d,[", + laneNumber, + msg ? (const char*) msg->c_str : "", + calStatus->temperature, + calStatus->lpfIndex, + calStatus->ctleIndex, + calStatus->numEyes, + calStatus->bsum, + calStatus->bsum_dc, + calStatus->spoLeft, + calStatus->spoRight, + calStatus->eom, + calStatus->eomMax, + calStatus->pd, + calStatus->innerUp, + calStatus->innerDown, + calStatus->outerUp, + calStatus->outerDown); + + for (i = 0U; i < NELEMS(calStatus->b); i++) + { + ADI_LIBRARY_FPRINTF(filePtr, "%d ", calStatus->b[i]); + } + ADI_LIBRARY_FPRINTF(filePtr, "]\n"); + ADI_LIBRARY_FFLUSH(filePtr); + + if (ADI_LIBRARY_FERROR(filePtr) != 0) + { + /* Some part of write to file failed. */ + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, filePath, "Failed to write to serdes init cal status log file"); + goto cleanup; + } + +cleanup: + if (filePtr != NULL) + { + ADI_LIBRARY_FCLOSE(filePtr); + } + + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerdesTrackingCalStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GenericStrBuf_t* const filePath, + const uint8_t laneNumber, + const adi_adrv903x_GenericStrBuf_t* const msg, + adi_adrv903x_SerdesTrackingCalStatus_t* const calStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + adrv903x_CpuCmd_SerdesCalStatusGet_t cpuCmd; + adrv903x_SerdesTrackingCalStatusCmdResp_t cmdResp; + FILE* filePtr = NULL; + uint32_t i = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, calStatus, cleanup); + /* msg and filePath may be NULL */ + + ADI_LIBRARY_MEMSET(&cpuCmd, 0, sizeof(cpuCmd)); + ADI_LIBRARY_MEMSET(&cmdResp, 0, sizeof(cmdResp)); + + if (laneNumber >= ADRV903X_JESD_MAX_DESERIALIZER_LANES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, ADI_ADRV903X_ERR_ACT_CHECK_PARAM, laneNumber, "Invalid laneNumber value"); + goto cleanup; + } + + /* Get the CPU that is responsible for the requested lane. */ + recoveryAction = adrv903x_CpuChannelMappingGet(device, (adi_adrv903x_Channels_e)(1U << laneNumber), ADRV903X_CPU_OBJID_IC_SERDES, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, laneNumber, "Lane to CPU lookup failed"); + goto cleanup; + } + + /* Prepare the command payload */ + cpuCmd.lane = laneNumber; + CTOH_STRUCT(cpuCmd, adrv903x_CpuCmd_SerdesCalStatusGet); + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_SERDES_BG_METRICS, //SERDES_TEST_GET_FG_METRICS && SERDES_TEST_GET_BG_METRICS + (void*)&cpuCmd, + sizeof(cpuCmd), + (void*)&cmdResp, + sizeof(cmdResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to call CPU cmd SERDES_TEST_GET_BG_METRICS"); + goto cleanup; + } + + CTOH_STRUCT(cmdResp, adrv903x_SerdesTrackingCalStatusCmdResp); + + if (cmdStatus != ADRV903X_CPU_CMD_STATUS_NO_ERROR) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_ERROR_REPORT(&device->common, + ADI_COMMON_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + cmdResp.cpuErrorCode, + "CPU cmd SERDES_TEST_GET_BG_METRICS failed"); + goto cleanup; + } + + *calStatus = cmdResp.details; + + if (filePath == NULL || filePath->c_str[0] == '\0') + { + /* No log file has been supplied; We're done. */ + goto cleanup; + } +#ifndef __KERNEL__ + /* Log file supplied; Write data to it. */ + filePtr = adrv903x_openSerdesCalStatusLogFile(filePath); +#endif + if (filePtr == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, filePath, "Unable to open serdes init cal status log file"); + goto cleanup; + } + + /* File is open and header line, if required, has been written; Write data line.*/ + ADI_LIBRARY_FPRINTF(filePtr, + "%u,tc,%s,%d,[", + laneNumber, + msg ? (const char*) msg->c_str : "", + calStatus->temperature); + + for (i = 0U; i < NELEMS(calStatus->pd); i++) + { + ADI_LIBRARY_FPRINTF(filePtr, "%d ", calStatus->pd[i]); + } + ADI_LIBRARY_FPRINTF(filePtr, "],["); + + for (i = 0U; i < NELEMS(calStatus->dllPeakPd); i++) + { + ADI_LIBRARY_FPRINTF(filePtr, "%d ", calStatus->dllPeakPd[i]); + } + ADI_LIBRARY_FPRINTF(filePtr, "],["); + + for (i = 0U; i < NELEMS(calStatus->dllPeakPdDelta); i++) + { + ADI_LIBRARY_FPRINTF(filePtr, "%d ", calStatus->dllPeakPdDelta[i]); + } + ADI_LIBRARY_FPRINTF(filePtr, "],%d,%d,%d,%d,[", calStatus->innerUp, calStatus->innerDown, calStatus->outerUp, calStatus->outerDown); + + for (i = 0U; i < NELEMS(calStatus->b); i++) + { + ADI_LIBRARY_FPRINTF(filePtr, "%d ", calStatus->b[i]); + } + ADI_LIBRARY_FPRINTF(filePtr, "],["); +#ifndef ADI_LIBRARY_RM_FLOATS + for (i = 0U; i < NELEMS(calStatus->ps); i++) + { + ADI_LIBRARY_FPRINTF(filePtr, "%f ", calStatus->ps[i]); + } + ADI_LIBRARY_FPRINTF(filePtr, "],["); + + for (i = 0U; i < NELEMS(calStatus->yVector); i++) + { + ADI_LIBRARY_FPRINTF(filePtr, "%f ", calStatus->yVector[i]); + } + ADI_LIBRARY_FPRINTF(filePtr, "]\n"); +#else + for (i = 0U; i < NELEMS(calStatus->ps_float); i++) + { + ADI_LIBRARY_FPRINTF(filePtr, "0x%x ", calStatus->ps_float[i]); + } + ADI_LIBRARY_FPRINTF(filePtr, "],["); + + for (i = 0U; i < NELEMS(calStatus->yVector_float); i++) + { + ADI_LIBRARY_FPRINTF(filePtr, "0x%x ", calStatus->yVector_float[i]); + } + ADI_LIBRARY_FPRINTF(filePtr, "]\n"); +#endif + ADI_LIBRARY_FFLUSH(filePtr); + + if (ADI_LIBRARY_FERROR(filePtr) != 0) + { + /* Write to file failed. */ + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, filePath, "Failed to write to tracking cal status log file"); + goto cleanup; + } + +cleanup: + if (filePtr != NULL) + { + ADI_LIBRARY_FCLOSE(filePtr); + } + + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeserLanesVcmCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DeserLanesVcmCfg_t* const deserLanesVcmCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t baseAddr = 0U; + uint32_t deframerIdx = 0U; + uint8_t usedDeserLanes = 0U; + uint8_t laneId = 0U; + uint8_t laneSel = 0U; + uint8_t afePdVcm = 0U; + uint8_t amuxSel = 0U; + + const uint8_t RXDES_AMUX_SEL_VCM_REF = 30U; + const uint8_t RXDES_AMUX_SEL_VCM_FB = 29U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, deserLanesVcmCfg, cleanup); + + /* Testing if vcmDriverMask lane mask has more than one lane slected */ + if ((deserLanesVcmCfg->vcmDriverMask != 0U) && + (((deserLanesVcmCfg->vcmDriverMask - 1) & deserLanesVcmCfg->vcmDriverMask) != 0U)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, deserLanesVcmCfg->vcmDriverMask, "vcmInDriver with more than one lane selected"); + goto cleanup; + } + + for (deframerIdx = 0U; deframerIdx < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; deframerIdx++) + { + usedDeserLanes |= device->initExtract.jesdSetting.deframerSetting[deframerIdx].deserialLaneEnabled; + } + + /* No need to drive for no receiver lane */ + if ((deserLanesVcmCfg->vcmDriverMask != 0U) && (deserLanesVcmCfg->vcmReceiverMask == 0U)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, deserLanesVcmCfg->vcmReceiverMask, "Invalid vcmInReceiver lane selection"); + goto cleanup; + } + + /* Lane cannot drive and receive at the same time */ + if ((deserLanesVcmCfg->vcmDriverMask & deserLanesVcmCfg->vcmReceiverMask) != 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, deserLanesVcmCfg->vcmReceiverMask, "Invalid vcmDriverMask lane selection"); + goto cleanup; + } + + if ((usedDeserLanes | deserLanesVcmCfg->vcmDriverMask) != usedDeserLanes) + { + /* Power up Alternate/Spare lane */ + recoveryAction = adrv903x_SerdesRxdig8packRegmapCore1p2_RxdesPdCh_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK, + ~(usedDeserLanes | deserLanesVcmCfg->vcmDriverMask)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while enabling Alternate Lane"); + goto cleanup; + } + } + + for (laneId = 0U, + baseAddr = (uint32_t)ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_0_; + laneId < ADI_ADRV903X_MAX_DESERIALIZER_LANES; + laneId++, + baseAddr += 0x800U) + { + laneSel = (1U << laneId); + /* Default values */ + afePdVcm = ADI_DISABLE; /* Powered up */ + amuxSel = ADI_DISABLE; /* Disconnected */ + + if ((deserLanesVcmCfg->vcmReceiverMask & laneSel) != 0U) + { + /* Disable VCM bias amplifier */ + afePdVcm = ADI_ENABLE; + if ((usedDeserLanes & laneSel) != 0U) + { + amuxSel = RXDES_AMUX_SEL_VCM_REF; + } + } + + if (((deserLanesVcmCfg->vcmDriverMask & laneSel) != 0U) && + (deserLanesVcmCfg->vcmReceiverMask != 0U)) + { + if ((usedDeserLanes & laneSel) != 0U) + { + amuxSel = RXDES_AMUX_SEL_VCM_REF; + } + else + { + amuxSel = RXDES_AMUX_SEL_VCM_FB; + } + } + + recoveryAction = adrv903x_SerdesRxdigPhyRegmapCore1p2_AfePdVcm_BfSet(device, NULL, (adrv903x_BfSerdesRxdigPhyRegmapCore1p2ChanAddr_e) baseAddr, afePdVcm); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, laneId, "Error while setting the VCM bias amplifier"); + goto cleanup; + } + + recoveryAction = adrv903x_SerdesRxdigPhyRegmapCore1p2_RxdesAmuxSel_BfSet(device, NULL, (adrv903x_BfSerdesRxdigPhyRegmapCore1p2ChanAddr_e) baseAddr, amuxSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, laneId, "Error while setting the VCM source"); + goto cleanup; + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SerdesRxLaneSintCodesGet(adi_adrv903x_Device_t* const device, + const uint8_t laneNumber, + adi_adrv903x_CpuCmd_GetRxLaneSintCodesResp_t* const sintCodes) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + adrv903x_CpuCmd_GetSintCodes_t cpuCmd; + adrv903x_CpuCmd_GetSintCodesResp_t cmdResp; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_LIBRARY_MEMSET(&cpuCmd, 0, sizeof(adrv903x_CpuCmd_GetSintCodes_t)); + ADI_LIBRARY_MEMSET(&cmdResp, 0, sizeof(adrv903x_CpuCmd_GetSintCodesResp_t)); + + if (laneNumber >= ADRV903X_JESD_MAX_DESERIALIZER_LANES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, ADI_ADRV903X_ERR_ACT_CHECK_PARAM, laneNumber, "Invalid laneNumber value"); + goto cleanup; + } + + /* Get the CPU that is responsible for the requested lane. */ + recoveryAction = adrv903x_CpuChannelMappingGet(device, (adi_adrv903x_Channels_e)(1U << laneNumber), ADRV903X_CPU_OBJID_IC_SERDES, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, laneNumber, "Lane to CPU lookup failed"); + goto cleanup; + } + + /* Prepare the command payload */ + cpuCmd.lane = laneNumber; + CTOH_STRUCT(cpuCmd, adrv903x_CpuCmd_GetRxLaneSintCodes_t); + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_JESD_GET_RX_LANE_SINT_CODES, + (void*)&cpuCmd, + sizeof(cpuCmd), + (void*)&cmdResp, + sizeof(cmdResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to call CPU cmd JESD_GET_RX_LANE_SINT_CODES"); + goto cleanup; + } + + CTOH_STRUCT(cmdResp, adrv903x_CpuCmd_GetRxLaneSintCodesResp_t); + + if (cmdStatus != ADRV903X_CPU_CMD_STATUS_NO_ERROR) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_ERROR_REPORT(&device->common, + ADI_COMMON_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + cmdResp.cpuErrorCode, + "CPU cmd JESD_GET_RX_LANE_SINT_CODES failed"); + goto cleanup; + } + + /* Copy the codes from the command response to the supplied out parameter*/ + *sintCodes = cmdResp.details; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_error.c b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_error.c new file mode 100644 index 0000000000000..f5534b56512f5 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_error.c @@ -0,0 +1,394 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_error.c +* +* \brief Device Specific Abstractions for Common Error Definitions +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#include "adi_adrv903x_error.h" + +#include "../../private/include/adrv903x_cpu_error_tables.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PUBLIC_ERROR + + +/* Error Code Tables */ + +/* API ADRV903X Module Specific Error Tables */ + +static const adrv903x_CalsErrCodes_t adrv903x_CalsErrTable[] = +{ + { ADI_ADRV903X_ERRCODE_CALS_INIT_ERROR_FLAG, ADI_STRING("Init Cals Error - Please Perform a InitCalsDetailedStatusGet for more Information"), ADI_ADRV903X_ERR_ACT_CHECK_FEATURE } +}; + +static const adrv903x_CpuErrCodes_t adrv903x_CpuErrTable[] = +{ + { ADI_ADRV903X_ERRCODE_CPU_CMD_ID, ADI_STRING("CPU Command ID Error"), ADI_ADRV903X_ERR_ACT_CHECK_PARAM }, + { ADI_ADRV903X_ERRCODE_CPU_CMD_RESPONSE, ADI_STRING("CPU Command Response Error"), ADI_ADRV903X_ERR_ACT_RESET_FEATURE }, + { ADI_ADRV903X_ERRCODE_CPU_CMD_TIMEOUT, ADI_STRING("CPU Command Timeout"), ADI_ADRV903X_ERR_ACT_CHECK_FEATURE }, + { ADI_ADRV903X_ERRCODE_CPU_IMAGE_NOT_LOADED, ADI_STRING("CPU Image Write Required before Boot Status Check"), ADI_ADRV903X_ERR_ACT_CHECK_PARAM }, + { ADI_ADRV903X_ERRCODE_CPU_IMAGE_WRITE, ADI_STRING("CPU Image Write Error"), ADI_ADRV903X_ERR_ACT_CHECK_FEATURE }, + { ADI_ADRV903X_ERRCODE_CPU_PROFILE_WRITE, ADI_STRING("CPU Profile Write Error"), ADI_ADRV903X_ERR_ACT_CHECK_PARAM }, + { ADI_ADRV903X_ERRCODE_CPU_MAILBOX_READ, ADI_STRING("CPU Mailbox Error"), ADI_ADRV903X_ERR_ACT_CHECK_FEATURE }, + { ADI_ADRV903X_ERRCODE_CPU_RAM_ACCESS_START, ADI_STRING("RAM Access Start Issue"), ADI_ADRV903X_ERR_ACT_CHECK_PARAM }, + { ADI_ADRV903X_ERRCODE_CPU_RAM_LOCK, ADI_STRING("RAM Lock Issue"), ADI_ADRV903X_ERR_ACT_RESET_FEATURE }, + { ADI_ADRV903X_ERRCODE_CPU_RAM_ACCESS_STOP, ADI_STRING("RAM Access Stop Issue"), ADI_ADRV903X_ERR_ACT_CHECK_PARAM }, + { ADI_ADRV903X_ERRCODE_CPU_PING, ADI_STRING("CPU Ping Issue"), ADI_ADRV903X_ERR_ACT_RESET_FEATURE }, + { ADI_ADRV903X_ERRCODE_CPU_BOOT_TIMEOUT, ADI_STRING("CPU Boot Timeout"), ADI_ADRV903X_ERR_ACT_RESET_DEVICE } +}; + +/* CPU Boot & Runtime Errors are device error tables provided by firmware */ + +static const adrv903x_DataInterfaceErrCodes_t adrv903x_DataInterfaceErrTable[] = +{ + { ADI_ADRV903X_ERRCODE_DATAINTERFACE_TEST, ADI_STRING("Implement Data Interfaces Errors"), ADI_ADRV903X_ERR_ACT_CHECK_PARAM } +}; + +static const adrv903x_AgcErrCodes_t adrv903x_AgcErrTable[] = +{ + { ADI_ADRV903X_ERRCODE_AGC_TEST, ADI_STRING("Implement AGC Errors"), ADI_ADRV903X_ERR_ACT_CHECK_PARAM } +}; + +static const adrv903x_GpioErrCodes_t adrv903x_GpioErrTable[] = +{ + { ADI_ADRV903X_ERRCODE_GPIO_TEST, ADI_STRING("Implement Gpio Errors"), ADI_ADRV903X_ERR_ACT_CHECK_PARAM } +}; + +static const adrv903x_HalErrCodes_t adrv903x_HalErrTable[] = +{ + { ADI_ADRV903X_ERRCODE_HAL_SPI_WRITE, ADI_STRING("SPI Write Error"), ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE }, + { ADI_ADRV903X_ERRCODE_HAL_SPI_READ, ADI_STRING("SPI Read Error"), ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE } +}; + +static const adrv903x_JesdErrCodes_t adrv903x_JesdErrTable[] = +{ + { ADI_ADRV903X_ERRCODE_JESD_TEST, ADI_STRING("Implement JESD Errors"), ADI_ADRV903X_ERR_ACT_CHECK_PARAM } +}; + +static const adrv903x_RadioCtrlErrCodes_t adrv903x_RadioCtrlErrTable[] = +{ + { ADI_ADRV903X_ERRCODE_RADIOCTRL_LO_CFG, ADI_STRING("Lo Frequency Configuration Error"), ADI_ADRV903X_ERR_ACT_CHECK_PARAM } +}; + +static const adrv903x_RxErrCodes_t adrv903x_RxErrTable[] = +{ + { ADI_ADRV903X_ERRCODE_RX_TEST, ADI_STRING("Implement Rx Errors"), ADI_ADRV903X_ERR_ACT_CHECK_PARAM } +}; + +static const adrv903x_TxErrCodes_t adrv903x_TxErrTable[] = +{ + { ADI_ADRV903X_ERRCODE_TX_TEST, ADI_STRING("Implement Tx Errors"), ADI_ADRV903X_ERR_ACT_CHECK_PARAM } +}; +/*****************************************************************************/ +/***** Local functions' prototypes *******************************************/ +/*****************************************************************************/ + +/** +* \brief Service to Lookup a specified Error Table +* +* \param[in] errTable Error Table to be Looked Up +* \param[in] errTableSize Error Table Size +* \param[in] errCode Error Code to be Looked Up +* \param[out] errMsgPtr Associated Error Message from Look Up Table +* \param[out] errActionPtr Associated Error Action from Look Up Table +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +static adi_adrv903x_ErrAction_e adrv903x_ErrTableLookUp(const adi_adrv903x_ErrTableRow_t errTable[], + const size_t errTableSize, + const uint32_t errCode, + const char** const errMsgPtr, + adi_adrv903x_ErrAction_e* const errActionPtr); + +/** +* \brief Service to Lookup a specified Device Error Table +* +* \param[in] errTable Device Error Table to be Looked Up +* \param[in] errTableSize Error Table Size +* \param[in] errCode Error Code to be Looked Up +* \param[out] errMsgPtr Associated Error Message from Look Up Table +* \param[out] errCausePtr Associated Error Cause from Look Up Table +* \param[out] actionCodePtr Associated Error Action from Look Up Table +* \param[out] actionMsgPtr Associated Error Cause from Look Up Table +* +* \retval adi_adrv903x_ErrAction_e - ADI_ADRV903X_ERR_ACT_NONE if Successful +*/ +static adi_adrv903x_ErrAction_e adrv903x_DeviceErrTableLookUp(const adi_adrv903x_DeviceErrTableRow_t errTable[], + const size_t errTableSize, + const uint32_t errCode, + const char** const errMsgPtr, + const char** const errCausePtr, + adi_adrv903x_ErrAction_e* const actionCodePtr, + const char** const actionMsgPtr); + + +/*****************************************************************************/ +/***** Local data types ******************************************************/ +/*****************************************************************************/ + + +/*****************************************************************************/ +/***** Functions' definition *************************************************/ +/*****************************************************************************/ +static adi_adrv903x_ErrAction_e adrv903x_ErrTableLookUp(const adi_adrv903x_ErrTableRow_t errTable[], + const size_t errTableSize, + const uint32_t errCode, + const char** const errMsgPtr, + adi_adrv903x_ErrAction_e* const actionCodePtr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t idx = 0U; + + ADI_ADRV903X_NULL_PTR_RETURN(errMsgPtr); + + ADI_ADRV903X_NULL_PTR_RETURN(actionCodePtr); + + if (errTableSize >= sizeof(adi_adrv903x_ErrTableRow_t)) + { + for (idx = 0U; (idx < (errTableSize / sizeof(adi_adrv903x_ErrTableRow_t))); ++idx) + { + if (errCode == errTable[idx].errCode) + { + *errMsgPtr = errTable[idx].errMsg; + *actionCodePtr = errTable[idx].action; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + } + } + } + + return recoveryAction; +} + +static adi_adrv903x_ErrAction_e adrv903x_DeviceErrTableLookUp(const adi_adrv903x_DeviceErrTableRow_t errTable[], + const size_t errTableSize, + const uint32_t errCode, + const char** const errMsgPtr, + const char** const errCausePtr, + adi_adrv903x_ErrAction_e* const actionCodePtr, + const char** const actionMsgPtr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t idx = 0U; + + ADI_ADRV903X_NULL_PTR_RETURN(errMsgPtr); + + ADI_ADRV903X_NULL_PTR_RETURN(errCausePtr); + + ADI_ADRV903X_NULL_PTR_RETURN(actionCodePtr); + + ADI_ADRV903X_NULL_PTR_RETURN(actionMsgPtr); + + if (errTableSize >= sizeof(adi_adrv903x_DeviceErrTableRow_t)) + { + for (idx = 0U; (idx < (errTableSize / sizeof(adi_adrv903x_DeviceErrTableRow_t))); ++idx) + { + if (errCode == errTable[idx].errCode) + { + *errMsgPtr = errTable[idx].errMsg; + *errCausePtr = errTable[idx].errCause; + *actionCodePtr = errTable[idx].actionCode; + *actionMsgPtr = errTable[idx].actionMsg; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + break; + } + } + } + + return recoveryAction; +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ErrInfoGet(const adi_adrv903x_ErrSource_e errSrc, + const int64_t errCode, + const char** const errMsgPtr, + const char** const errCausePtr, + adi_adrv903x_ErrAction_e* const actionCodePtr, + const char** const actionMsgPtr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Validate Arguments */ + ADI_ADRV903X_NULL_PTR_RETURN(errMsgPtr); + + ADI_ADRV903X_NULL_PTR_RETURN(errCausePtr); + + ADI_ADRV903X_NULL_PTR_RETURN(actionCodePtr); + + ADI_ADRV903X_NULL_PTR_RETURN(actionMsgPtr); + + /* Default Values */ + *errMsgPtr = NULL; + *errCausePtr = NULL; + *actionCodePtr = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + *actionMsgPtr = NULL; + + switch (errSrc) + { + case ADI_ADRV903X_ERRSRC_API: + case ADI_ADRV903X_ERRSRC_HAL: + case ADI_ADRV903X_ERRSRC_DEVICEBF: + /* Sources using Common Errors */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_ErrorGet(errCode, + errMsgPtr, + (adi_common_ErrAction_e* const) actionCodePtr); + break; + + case ADI_ADRV903X_ERRSRC_DEVICEHAL: + recoveryAction = adrv903x_ErrTableLookUp(adrv903x_HalErrTable, + sizeof(adrv903x_HalErrTable), + errCode, + errMsgPtr, + actionCodePtr); + break; + + case ADI_ADRV903X_ERRSRC_CALS: + recoveryAction = adrv903x_ErrTableLookUp(adrv903x_CalsErrTable, + sizeof(adrv903x_CalsErrTable), + errCode, + errMsgPtr, + actionCodePtr); + break; + + case ADI_ADRV903X_ERRSRC_CPU_BOOT: + recoveryAction = adrv903x_DeviceErrTableLookUp( adrv903x_CpuBootErrTable, + sizeof(adrv903x_CpuBootErrTable), + errCode, + errMsgPtr, + errCausePtr, + actionCodePtr, + actionMsgPtr); + break; + + case ADI_ADRV903X_ERRSRC_CPU_RUNTIME: + recoveryAction = adrv903x_DeviceErrTableLookUp(adrv903x_CpuRunTimeErrTable, + sizeof(adrv903x_CpuRunTimeErrTable), + errCode, + errMsgPtr, + errCausePtr, + actionCodePtr, + actionMsgPtr); + break; + + case ADI_ADRV903X_ERRSRC_CPU: + recoveryAction = adrv903x_ErrTableLookUp(adrv903x_CpuErrTable, + sizeof(adrv903x_CpuErrTable), + errCode, + errMsgPtr, + actionCodePtr); + break; + + case ADI_ADRV903X_ERRSRC_DATAINTERFACE: + recoveryAction = adrv903x_ErrTableLookUp(adrv903x_DataInterfaceErrTable, + sizeof(adrv903x_DataInterfaceErrTable), + errCode, + errMsgPtr, + actionCodePtr); + break; + + case ADI_ADRV903X_ERRSRC_AGC: + recoveryAction = adrv903x_ErrTableLookUp(adrv903x_AgcErrTable, + sizeof(adrv903x_AgcErrTable), + errCode, + errMsgPtr, + actionCodePtr); + break; + case ADI_ADRV903X_ERRSRC_GPIO: + recoveryAction = adrv903x_ErrTableLookUp(adrv903x_GpioErrTable, + sizeof(adrv903x_GpioErrTable), + errCode, + errMsgPtr, + actionCodePtr); + break; + + case ADI_ADRV903X_ERRSRC_JESD: + recoveryAction = adrv903x_ErrTableLookUp(adrv903x_JesdErrTable, + sizeof(adrv903x_JesdErrTable), + errCode, + errMsgPtr, + actionCodePtr); + break; + + case ADI_ADRV903X_ERRSRC_RADIOCTRL: + recoveryAction = adrv903x_ErrTableLookUp(adrv903x_RadioCtrlErrTable, + sizeof(adrv903x_RadioCtrlErrTable), + errCode, + errMsgPtr, + actionCodePtr); + break; + + case ADI_ADRV903X_ERRSRC_RX: + recoveryAction = adrv903x_ErrTableLookUp(adrv903x_RxErrTable, + sizeof(adrv903x_RxErrTable), + errCode, + errMsgPtr, + actionCodePtr); + break; + + case ADI_ADRV903X_ERRSRC_TX: + recoveryAction = adrv903x_ErrTableLookUp(adrv903x_TxErrTable, + sizeof(adrv903x_TxErrTable), + errCode, + errMsgPtr, + actionCodePtr); + break; + case ADI_ADRV903X_ERRSRC_NONE: + case ADI_ADRV903X_ERRSRC_UNKNOWN: + /* Fall Through */ + + default: + /* Invalid Error Source; No Lookup can be performed */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + break; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ErrDataGet(const adi_adrv903x_Device_t* const device, + const adi_common_ErrFrameId_e frameId, + adi_adrv903x_ErrSource_e* const errSrcPtr, + int64_t* const errCodePtr, + const char** const errMsgPtr, + const char** const errCausePtr, + adi_adrv903x_ErrAction_e* const actionCodePtr, + const char** const actionMsgPtr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_common_ErrFrame_t errFrame = { ADI_COMMON_ERR_ACT_NONE, { 0, NULL, 0U }, { 0U, NULL, 0U }, { NULL, 0 } }; + + + /* Validate Arguments */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_NULL_PTR_RETURN(errSrcPtr); + + ADI_ADRV903X_NULL_PTR_RETURN(errCodePtr); + + ADI_ADRV903X_NULL_PTR_RETURN(errMsgPtr); + + ADI_ADRV903X_NULL_PTR_RETURN(actionCodePtr); + + /* Parse Error Frame */ + recoveryAction = (adi_adrv903x_ErrAction_e) ADI_ERROR_FRAME_GET(&device->common, frameId, &errFrame); + if (ADI_ADRV903X_ERR_ACT_NONE == recoveryAction) + { + /* Convert to adrv903x Error Source */ + *errSrcPtr = (adi_adrv903x_ErrSource_e) errFrame.errInfo.errSrc; + *errCodePtr = errFrame.errInfo.errCode; + recoveryAction = adi_adrv903x_ErrInfoGet( *errSrcPtr, + *errCodePtr, + errMsgPtr, + errCausePtr, + actionCodePtr, + actionMsgPtr); + } + + return recoveryAction; +} \ No newline at end of file diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_gpio.c b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_gpio.c new file mode 100644 index 0000000000000..356679792649f --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_gpio.c @@ -0,0 +1,1937 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_gpio.c +* \brief Contains GPIO feature related function implementation defined in +* adi_adrv903x_gpio.h +* +* ADRV903X API Version: 2.12.1.4 +*/ +#include "adi_adrv903x_gpio.h" + +#include "../../private/include/adrv903x_gpio.h" +#include "../../private/include/adrv903x_radioctrl.h" +#include "../../private/bf/adrv903x_bf_core.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PUBLIC_GPIO + +static const adi_adrv903x_GpioSignal_e manualModeInputSignal[ADI_ADRV903X_GPIO_COUNT] = { + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_0, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_1, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_2, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_3, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_4, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_5, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_6, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_7, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_8, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_9, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_10, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_11, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_12, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_13, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_14, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_15, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_16, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_17, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_18, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_19, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_20, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_21, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_22, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_INPUT_23 +}; + +static const adi_adrv903x_GpioSignal_e manualModeOutputSignal[ADI_ADRV903X_GPIO_COUNT] = { + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_0, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_1, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_2, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_3, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_4, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_5, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_6, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_7, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_8, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_9, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_10, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_11, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_12, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_13, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_14, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_15, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_16, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_17, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_18, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_19, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_20, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_21, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_22, + ADI_ADRV903X_GPIO_SIGNAL_MANUAL_MODE_OUTPUT_23 +}; + +static const adi_adrv903x_GpioSignal_e analogManualModeInputSignal[ADI_ADRV903X_GPIO_ANALOG_COUNT] = { + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_0, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_1, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_2, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_3, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_4, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_5, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_6, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_7, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_8, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_9, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_10, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_11, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_12, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_13, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_14, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_INPUT_15 +}; + +static const adi_adrv903x_GpioSignal_e analogManualModeOutputSignal[ADI_ADRV903X_GPIO_ANALOG_COUNT] = { + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_0, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_1, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_2, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_3, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_4, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_5, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_6, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_7, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_8, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_9, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_10, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_11, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_12, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_13, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_14, + ADI_ADRV903X_GPIO_SIGNAL_ANALOG_MANUAL_MODE_OUTPUT_15 +}; + +/**************************************************************************** + * GPIO related functions + **************************************************************************** + */ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioForceHiZAllPins(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + uint8_t gpioPin; + uint8_t override = 1; + for(gpioPin = ADI_ADRV903X_GPIO_00; gpioPin <= ADI_ADRV903X_GPIO_23; gpioPin++) + { + recoveryAction = adrv903x_GpioIeOverride(device, (adi_adrv903x_GpioPinSel_e)gpioPin, override); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write gpio source control override."); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioForceHiZ(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const uint8_t override) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + recoveryAction = adrv903x_GpioIeOverride(device, gpio, override); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write gpio source control override."); + } + + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogForceHiZAllPins(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + uint8_t gpioPin; + uint8_t override = 1; + for(gpioPin = ADI_ADRV903X_GPIO_ANA_00; gpioPin <= ADI_ADRV903X_GPIO_ANA_15; gpioPin++) + { + recoveryAction = adrv903x_GpioAnalogIeOverride(device, (adi_adrv903x_GpioAnaPinSel_e)gpioPin, override); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write gpio source control override."); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); + +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogForceHiZ( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + const uint8_t override) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + recoveryAction = adrv903x_GpioAnalogIeOverride(device, gpio, override); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write gpio source control override."); + } + + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); + +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioStatusRead( adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioStatus_t* const status) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_GpioStatus_t read; + uint8_t i = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, status, cleanup); + + /* Clear out readback structure*/ + ADI_LIBRARY_MEMSET(&read, 0, sizeof(adi_adrv903x_GpioStatus_t)); + + /* Readback Digital GPIO configs */ + recoveryAction = adi_adrv903x_GpioConfigAllGet(device, read.digSignal, read.digChMask, ADI_ADRV903X_GPIO_COUNT); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading back the status of all Digital GPIOs"); + goto cleanup; + } + + /* Readback Analog GPIO configs */ + recoveryAction = adi_adrv903x_GpioAnalogConfigAllGet(device, read.anaSignal, read.anaChMask, ADI_ADRV903X_GPIO_COUNT); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading back the status of all Analog GPIOs"); + goto cleanup; + } + + /* Build pinmask for allocated digital pins */ + read.digPinAllocated = 0U; + for (i = 0U; i < ADI_ADRV903X_GPIO_COUNT; i++) + { + if (read.digSignal[i] != ADI_ADRV903X_GPIO_SIGNAL_UNUSED) + { + read.digPinAllocated |= (1U << i); + } + } + + /* Build pinmask for allocated analog pins */ + read.anaPinAllocated = 0U; + for (i = 0U; i < ADI_ADRV903X_GPIO_ANALOG_COUNT; i++) + { + if (read.anaSignal[i] != ADI_ADRV903X_GPIO_SIGNAL_UNUSED) + { + read.anaPinAllocated |= (1U << i); + } + } + + /* Set status to readback structure */ + *status = read; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioConfigGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + adi_adrv903x_GpioSignal_e* const signal, + uint32_t* const channelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, signal, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, channelMask, cleanup); + + /* Range check gpio */ + if ((gpio < ADI_ADRV903X_GPIO_00) || + (gpio >= ADI_ADRV903X_GPIO_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, gpio, "Invalid GPIO selected. Out of range."); + goto cleanup; + } + + /* Call utility to retrieve current signal/channelMask for selected gpio */ + recoveryAction = adrv903x_GpioSignalGet( device, gpio, signal, channelMask ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while obtaining current GPIO configuration"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioConfigAllGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioSignal_e signalArray[], + uint32_t channelMaskArray[], + const uint32_t arraySize) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t gpioIdx = 0U; + adi_adrv903x_GpioPinSel_e tmpGpio = ADI_ADRV903X_GPIO_INVALID; + adi_adrv903x_GpioSignal_e tmpSig = ADI_ADRV903X_GPIO_SIGNAL_INVALID; + uint32_t tmpMask = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, signalArray, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, channelMaskArray, cleanup); + + /* Range check arraySize */ + if ( arraySize < ADI_ADRV903X_GPIO_INVALID ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, arraySize, "Insufficient arraySize provided by user to store GPIO signalArray and channelMaskArray. arraySize must be greater than or equal to 24."); + goto cleanup; + } + + /* Iterate through all gpios */ + for ( gpioIdx = 0U; gpioIdx < ADI_ADRV903X_GPIO_INVALID; gpioIdx++ ) + { + /* Call utility to retrieve signal/channelMask for the gpio */ + tmpGpio = (adi_adrv903x_GpioPinSel_e)gpioIdx; + recoveryAction = adrv903x_GpioSignalGet( device, tmpGpio, &tmpSig, &tmpMask ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while obtaining current GPIO configuration"); + goto cleanup; + } + + /* Store results into arrays */ + signalArray[gpioIdx] = tmpSig; + channelMaskArray[gpioIdx] = tmpMask; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogConfigGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioAnaPinSel_e gpio, + adi_adrv903x_GpioSignal_e* const signal, + uint32_t* const channelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, signal, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, channelMask, cleanup); + + /* Range check gpio */ + if ((gpio < ADI_ADRV903X_GPIO_ANA_00) || + (gpio >= ADI_ADRV903X_GPIO_ANA_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, gpio, "Invalid GPIO selected. Out of range."); + goto cleanup; + } + + /* Call utility to retrieve current signal/channelMask for selected gpio */ + recoveryAction = adrv903x_GpioAnalogSignalGet( device, gpio, signal, channelMask ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while obtaining current GPIO configuration"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogConfigAllGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpioSignal_e signalArray[], + uint32_t channelMaskArray[], + const uint32_t arraySize) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t gpioIdx = 0U; + adi_adrv903x_GpioAnaPinSel_e tmpGpio = ADI_ADRV903X_GPIO_ANA_INVALID; + adi_adrv903x_GpioSignal_e tmpSig = ADI_ADRV903X_GPIO_SIGNAL_INVALID; + uint32_t tmpMask = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, signalArray, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, channelMaskArray, cleanup); + + /* Range check arraySize */ + if ( arraySize < ADI_ADRV903X_GPIO_ANA_INVALID ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, arraySize, "Insufficient arraySize provided by user to store GPIO signalArray and channelMaskArray. arraySize must be greater than or equal to 24."); + goto cleanup; + } + + /* Iterate through all gpios */ + for ( gpioIdx = 0U; gpioIdx < ADI_ADRV903X_GPIO_ANA_INVALID; gpioIdx++ ) + { + /* Call utility to retrieve signal/channelMask for the gpio */ + tmpGpio = (adi_adrv903x_GpioAnaPinSel_e)gpioIdx; + recoveryAction = adrv903x_GpioAnalogSignalGet( device, tmpGpio, &tmpSig, &tmpMask ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while obtaining current GPIO configuration"); + goto cleanup; + } + + /* Store results into arrays */ + signalArray[gpioIdx] = tmpSig; + channelMaskArray[gpioIdx] = tmpMask; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioMonitorOutSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio, + const adi_adrv903x_GpioSignal_e signal, + const uint8_t channel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_GpioSignalInfo_t info = { ADI_ADRV903X_GPIO_SIGNAL_UNUSED, ADRV903X_GPIO_DOMAIN_NONE, ADRV903X_GPIO_ROUTE_OFF, 0U, 0U, 0 }; + uint32_t channelMask = 0U; + uint8_t isValidFlag = ADI_FALSE; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Range check gpio */ + if ((gpio < ADI_ADRV903X_GPIO_00) || + (gpio >= ADI_ADRV903X_GPIO_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, gpio, "Invalid GPIO selected. Out of range."); + goto cleanup; + } + + /* Range check signal */ + if ((signal < ADI_ADRV903X_GPIO_SIGNAL_UNUSED) || + (signal >= ADI_ADRV903X_GPIO_SIGNAL_NUM_SIGNALS)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, signal, "Invalid signal selected. Out of range."); + goto cleanup; + } + + /* If signal is UNUSED, automatically try to release this pin from Monitor Output routing */ + if (signal == ADI_ADRV903X_GPIO_SIGNAL_UNUSED) + { + /* Done whether successfully released or not */ + recoveryAction = adi_adrv903x_GpioMonitorOutRelease(device, gpio); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while releasing GPIO from a Monitor Output"); + } + goto cleanup; + } + + /* Get signal info struct */ + recoveryAction = adrv903x_GpioSignalInfoGet(device, signal, &info); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while obtaining signal info"); + goto cleanup; + } + + /* Check if signal is a valid monitor output signal using the route */ + recoveryAction = adrv903x_GpioMonitorOutSignalValidCheck(device, signal, channel, &isValidFlag, &channelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error checking Monitor Out signal validity"); + goto cleanup; + } + if (isValidFlag != ADI_TRUE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, signal, "GPIO signal is not a valid GPIO Monitor Output."); + goto cleanup; + } + + /* Set the signal to the GPIO */ + recoveryAction = adrv903x_GpioSignalSet( device, gpio, signal, channelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while routing selected monitor output signal to GPIO."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioMonitorOutRelease(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpio) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_GpioSignal_e signal = ADI_ADRV903X_GPIO_SIGNAL_UNUSED; + uint8_t isValidFlag = ADI_FALSE; + uint32_t channelMask = 0U; + uint8_t channel = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Range check gpio */ + if ((gpio < ADI_ADRV903X_GPIO_00) || + (gpio >= ADI_ADRV903X_GPIO_INVALID)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, gpio, "Invalid GPIO selected. Out of range."); + goto cleanup; + } + + /* Retrieve gpio's current signal */ + recoveryAction = adrv903x_GpioSignalGet(device, gpio, &signal, &channelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while retreiving currently routed GPIO signal."); + goto cleanup; + } + + /* Check for UNUSED. If UNUSED, nothing to do */ + if (signal == ADI_ADRV903X_GPIO_SIGNAL_UNUSED) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + goto cleanup; + } + + /* Convert channelMask to channel index */ + switch (channelMask) + { + case 0x01U: + channel = 0U; + break; + case 0x02U: + channel = 1U; + break; + case 0x04U: + channel = 2U; + break; + case 0x08U: + channel = 3U; + break; + case 0x10U: + channel = 4U; + break; + case 0x20U: + channel = 5U; + break; + case 0x40U: + channel = 6U; + break; + case 0x80U: + channel = 7U; + break; + default: + channel = 0U; + break; + } + + /* Check for if the gpio is currently routing a valid Monitor Out Signal */ + recoveryAction = adrv903x_GpioMonitorOutSignalValidCheck(device, signal, channel, &isValidFlag, NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error checking Monitor Out signal validity"); + goto cleanup; + } + if (isValidFlag != ADI_TRUE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, signal, "GPIO signal is not a valid GPIO Monitor Output."); + goto cleanup; + } + + /* Release GPIO */ + recoveryAction = adrv903x_GpioSignalRelease(device, gpio, signal, channelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error releasing GPIO from Monitor Out signal."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioManualInputDirSet( adi_adrv903x_Device_t* const device, + const uint32_t gpioInputMask) +{ + static const uint32_t channelMask = 0U; + static const uint32_t RANGE_CHECK_MASK = 0xFF000000U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_GpioSignal_e prevSignalArray[ADI_ADRV903X_GPIO_COUNT] = { ADI_ADRV903X_GPIO_SIGNAL_UNUSED }; + uint32_t channelMaskArray[ADI_ADRV903X_GPIO_COUNT] = { 0U }; + uint32_t idx = 0U; + uint32_t tmpMask = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Range check input */ + if ((gpioInputMask & RANGE_CHECK_MASK) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, gpioInputMask, "Invalid GPIO Input Mask. Out of range."); + goto cleanup; + } + + /* Get current GPIO configs */ + recoveryAction = adi_adrv903x_GpioConfigAllGet( device, prevSignalArray, channelMaskArray, ADI_ADRV903X_GPIO_COUNT ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while retreiving current GPIO configurations."); + goto cleanup; + } + + /* Check that all set-pins are unused or already allocated as Manual Inputs */ + for ( idx = 0U; idx < ADI_ADRV903X_GPIO_COUNT; idx++ ) + { + tmpMask = 1U << idx; + if (((gpioInputMask & tmpMask) != 0U) && + (prevSignalArray[idx] != ADI_ADRV903X_GPIO_SIGNAL_UNUSED) && + (prevSignalArray[idx] != manualModeInputSignal[idx])) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, gpioInputMask, "Invalid GPIO Input Mask. A selected pin is already in use by another feature."); + goto cleanup; + } + } + + /* Deallocate and disconnect any unset-pins that were previously allocated as Manual Inputs */ + for ( idx = 0U; idx < ADI_ADRV903X_GPIO_COUNT; idx++ ) + { + tmpMask = 1U << idx; + if (((gpioInputMask & tmpMask) == 0U) && + (prevSignalArray[idx] == manualModeInputSignal[idx])) + { + recoveryAction = adrv903x_GpioSignalRelease( device, (adi_adrv903x_GpioPinSel_e)idx, prevSignalArray[idx], channelMaskArray[idx] ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while releasing a GPIO from use as a Manual Input."); + goto cleanup; + } + } + } + + /* Configure all set-pins */ + for ( idx = 0U; idx < ADI_ADRV903X_GPIO_COUNT; idx++ ) + { + tmpMask = 1U << idx; + if ((gpioInputMask & tmpMask) != 0U) + { + recoveryAction = adrv903x_GpioSignalSet( device, (adi_adrv903x_GpioPinSel_e)idx, manualModeInputSignal[idx], channelMask ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while configuring a GPIO for use as a Manual Input."); + goto cleanup; + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioManualOutputDirSet( adi_adrv903x_Device_t* const device, + const uint32_t gpioOutputMask) +{ + static const uint32_t channelMask = 0U; + static const uint32_t RANGE_CHECK_MASK = 0xFF000000U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_GpioSignal_e prevSignalArray[ADI_ADRV903X_GPIO_COUNT] = { ADI_ADRV903X_GPIO_SIGNAL_UNUSED }; + uint32_t channelMaskArray[ADI_ADRV903X_GPIO_COUNT] = { 0U }; + uint32_t idx = 0U; + uint32_t tmpMask = 0U; + uint32_t clearDrivePins = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Range check input */ + if ((gpioOutputMask & RANGE_CHECK_MASK) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, gpioOutputMask, "Invalid GPIO Output Mask. Out of range."); + goto cleanup; + } + + /* Get current GPIO configs */ + recoveryAction = adi_adrv903x_GpioConfigAllGet( device, prevSignalArray, channelMaskArray, ADI_ADRV903X_GPIO_COUNT ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while retreiving current GPIO configurations."); + goto cleanup; + } + + /* Check that all set-pins are unused or already allocated as Manual Outputs */ + for ( idx = 0U; idx < ADI_ADRV903X_GPIO_COUNT; idx++ ) + { + tmpMask = 1U << idx; + if (((gpioOutputMask & tmpMask) != 0U) && + (prevSignalArray[idx] != ADI_ADRV903X_GPIO_SIGNAL_UNUSED) && + (prevSignalArray[idx] != manualModeOutputSignal[idx])) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, gpioOutputMask, "Invalid GPIO Output Mask. A selected pin is already in use by another feature."); + goto cleanup; + } + } + + /* Deallocate and disconnect any unset-pins that were previously allocated as Manual Outputs */ + for ( idx = 0U; idx < ADI_ADRV903X_GPIO_COUNT; idx++ ) + { + tmpMask = 1U << idx; + if (((gpioOutputMask & tmpMask) == 0U) && + (prevSignalArray[idx] == manualModeOutputSignal[idx])) + { + recoveryAction = adrv903x_GpioSignalRelease( device, (adi_adrv903x_GpioPinSel_e)idx, prevSignalArray[idx], channelMaskArray[idx] ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while releasing a GPIO from use as a Manual Output."); + goto cleanup; + } + + clearDrivePins |= tmpMask; + } + } + + /* Clear the GpioFromMaster drive bits from any deallocated pins */ + recoveryAction = adrv903x_Core_GpioFromMasterClear_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + clearDrivePins); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while clearing drive levels for GPIOs previously allocated as Manual Mode Outputs."); + goto cleanup; + } + + /* Configure all set-pins */ + for ( idx = 0U; idx < ADI_ADRV903X_GPIO_COUNT; idx++ ) + { + tmpMask = 1U << idx; + if ((gpioOutputMask & tmpMask) != 0U) + { + recoveryAction = adrv903x_GpioSignalSet( device, (adi_adrv903x_GpioPinSel_e)idx, manualModeOutputSignal[idx], channelMask ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while configuring a GPIO for use as a Manual Output."); + goto cleanup; + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioManualInputPinLevelGet( adi_adrv903x_Device_t* const device, + uint32_t * const gpioInPinLevel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gpioInPinLevel, cleanup); + + /* Readback bitfield */ + /* Using Direct SPI instead of AHB */ + recoveryAction = adrv903x_Core_GpioSpiRead_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + gpioInPinLevel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while reading back GPIO Manual Mode Input Word values."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioManualOutputPinLevelGet( adi_adrv903x_Device_t* const device, + uint32_t * const gpioOutPinLevel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gpioOutPinLevel, cleanup); + + /* Readback bitfield */ + /* Using Direct SPI instead of AHB */ + recoveryAction = adrv903x_Core_GpioFromMaster_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + gpioOutPinLevel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while reading back GPIO Manual Mode Output Word values."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioManualOutputPinLevelSet( adi_adrv903x_Device_t* const device, + const uint32_t gpioPinMask, + const uint32_t gpioOutPinLevel) +{ + static const uint32_t VALID_RANGE_MASK = 0x00FFFFFFU; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t channelMaskArray[ADI_ADRV903X_GPIO_COUNT] = { 0U }; + uint32_t currentLevel = 0U; + uint32_t toggleLevel = 0U; + uint32_t idx = 0U; + uint32_t tmpMask = 0U; + uint32_t allocatedMask = 0U; + adi_adrv903x_GpioSignal_e signalArray[ADI_ADRV903X_GPIO_COUNT] = + { + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Range check input */ + if ((gpioOutPinLevel & VALID_RANGE_MASK) != gpioOutPinLevel) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gpioOutPinLevel, "Invalid GPIO Output pin levels. Out of range."); + goto cleanup; + } + + /* Range check pinmask */ + if ((gpioPinMask & VALID_RANGE_MASK) != gpioPinMask) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gpioPinMask, "Invalid GPIO pinmask. Out of range."); + goto cleanup; + } + + /* Readback all GPIO allocations */ + recoveryAction = adi_adrv903x_GpioConfigAllGet(device, signalArray, channelMaskArray, ADI_ADRV903X_GPIO_COUNT); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while retreiving current GPIO configurations."); + goto cleanup; + } + + /* Build mask containing only/all pins allocated for this feature */ + for (idx = 0U; idx < ADI_ADRV903X_GPIO_COUNT; idx++) + { + tmpMask = 1U << idx; + if (signalArray[idx] == manualModeOutputSignal[idx]) + { + allocatedMask |= tmpMask; + } + else + { + tmpMask = ~tmpMask; + allocatedMask &= tmpMask; + } + } + + /* Check that gpioPinMask contains only pins that are allocated for this feature */ + if ((gpioPinMask & allocatedMask) != gpioPinMask) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gpioPinMask, "Invalid GPIO pinmask. Includes pins that are not allocated as Manual Mode Outputs."); + goto cleanup; + } + + /* Readback current drive state of Digital GPIO pins */ + recoveryAction = adi_adrv903x_GpioManualOutputPinLevelGet(device, ¤tLevel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while retrieving current GPIO Manual Mode drive levels."); + goto cleanup; + } + + /* XOR with current levels with target levels to determine which pins need to toggle */ + toggleLevel = currentLevel ^ gpioOutPinLevel; + + /* Mask out pins that are not in the requested gpioPinMask. They should not be toggled. */ + toggleLevel &= gpioPinMask; + + /* Toggle appropriate pins to achieve target levels */ + recoveryAction = adrv903x_Core_GpioFromMasterToggle_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + toggleLevel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting GPIO output levels."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogManualInputDirSet(adi_adrv903x_Device_t* const device, + const uint16_t gpioAnalogInputMask) +{ + static const uint32_t channelMask = 0U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_GpioSignal_e prevSignalArray[ADI_ADRV903X_GPIO_ANALOG_COUNT] = { ADI_ADRV903X_GPIO_SIGNAL_UNUSED }; + uint32_t channelMaskArray[ADI_ADRV903X_GPIO_ANALOG_COUNT] = { 0U }; + uint32_t idx = 0U; + uint32_t tmpMask = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Get current GPIO configs */ + recoveryAction = adi_adrv903x_GpioAnalogConfigAllGet( device, prevSignalArray, channelMaskArray, ADI_ADRV903X_GPIO_ANALOG_COUNT ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while retreiving current Analog GPIO configurations."); + goto cleanup; + } + + /* Check that all set-pins are unused or already allocated as Manual Inputs */ + for ( idx = 0U; idx < ADI_ADRV903X_GPIO_ANALOG_COUNT; idx++ ) + { + tmpMask = 1U << idx; + if (((gpioAnalogInputMask & tmpMask) != 0U) && + (prevSignalArray[idx] != ADI_ADRV903X_GPIO_SIGNAL_UNUSED) && + (prevSignalArray[idx] != analogManualModeInputSignal[idx])) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, gpioAnalogInputMask, "Invalid Analog GPIO Input Mask. A selected pin is already in use by another feature."); + goto cleanup; + } + } + + /* Deallocate and disconnect any unset-pins that were previously allocated as Manual Inputs */ + for ( idx = 0U; idx < ADI_ADRV903X_GPIO_ANALOG_COUNT; idx++ ) + { + tmpMask = 1U << idx; + if (((gpioAnalogInputMask & tmpMask) == 0U) && + (prevSignalArray[idx] == analogManualModeInputSignal[idx])) + { + recoveryAction = adrv903x_GpioAnalogSignalRelease(device, (adi_adrv903x_GpioAnaPinSel_e)idx, prevSignalArray[idx], channelMaskArray[idx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while releasing an Analog GPIO from use as a Manual Input."); + goto cleanup; + } + } + } + + /* Configure all set-pins */ + for ( idx = 0U; idx < ADI_ADRV903X_GPIO_ANALOG_COUNT; idx++ ) + { + tmpMask = 1U << idx; + if ((gpioAnalogInputMask & tmpMask) != 0U) + { + recoveryAction = adrv903x_GpioAnalogSignalSet(device, (adi_adrv903x_GpioAnaPinSel_e)idx, analogManualModeInputSignal[idx], channelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while configuring an Analog GPIO for use as a Manual Input."); + goto cleanup; + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogManualOutputDirSet( adi_adrv903x_Device_t* const device, + const uint16_t gpioAnalogOutputMask) +{ + static const uint32_t channelMask = 0U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_GpioSignal_e prevSignalArray[ADI_ADRV903X_GPIO_ANALOG_COUNT] = { ADI_ADRV903X_GPIO_SIGNAL_UNUSED }; + uint32_t channelMaskArray[ADI_ADRV903X_GPIO_ANALOG_COUNT] = { 0U }; + uint32_t idx = 0U; + uint32_t tmpMask = 0U; + uint32_t clearDrivePins = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Get current GPIO configs */ + recoveryAction = adi_adrv903x_GpioAnalogConfigAllGet( device, prevSignalArray, channelMaskArray, ADI_ADRV903X_GPIO_ANALOG_COUNT ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while retreiving current Analog GPIO configurations."); + goto cleanup; + } + + /* Check that all set-pins are unused or already allocated as Manual Inputs */ + for ( idx = 0U; idx < ADI_ADRV903X_GPIO_ANALOG_COUNT; idx++ ) + { + tmpMask = 1U << idx; + if (((gpioAnalogOutputMask & tmpMask) != 0U) && + (prevSignalArray[idx] != ADI_ADRV903X_GPIO_SIGNAL_UNUSED) && + (prevSignalArray[idx] != analogManualModeOutputSignal[idx])) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, gpioAnalogOutputMask, "Invalid Analog GPIO Output Mask. A selected pin is already in use by another feature."); + goto cleanup; + } + } + + /* Deallocate and disconnect any unset-pins that were previously allocated as Analog Manual Outputs */ + for ( idx = 0U; idx < ADI_ADRV903X_GPIO_ANALOG_COUNT; idx++ ) + { + tmpMask = 1U << idx; + if (((gpioAnalogOutputMask & tmpMask) == 0U) && + (prevSignalArray[idx] == analogManualModeOutputSignal[idx])) + { + recoveryAction = adrv903x_GpioAnalogSignalRelease( device, (adi_adrv903x_GpioAnaPinSel_e)idx, prevSignalArray[idx], channelMaskArray[idx] ); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while releasing an Analog GPIO from use as a Manual Output."); + goto cleanup; + } + + clearDrivePins |= tmpMask; + } + } + + /* Clear the GpioFromMaster drive bits from any deallocated pins */ + recoveryAction = adrv903x_Core_GpioAnalogFromMasterClear_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + clearDrivePins); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while clearing drive levels for GPIOs previously allocated as Manual Mode Outputs."); + goto cleanup; + } + + /* Configure all set-pins */ + for ( idx = 0U; idx < ADI_ADRV903X_GPIO_ANALOG_COUNT; idx++ ) + { + tmpMask = 1U << idx; + if ((gpioAnalogOutputMask & tmpMask) != 0U) + { + recoveryAction = adrv903x_GpioAnalogSignalSet(device, (adi_adrv903x_GpioAnaPinSel_e)idx, analogManualModeOutputSignal[idx], channelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while configuring an Analog GPIO for use as a Manual Output."); + goto cleanup; + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogManualInputPinLevelGet( adi_adrv903x_Device_t* const device, + uint16_t * const gpioAnalogInPinLevel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gpioAnalogInPinLevel, cleanup); + + /* Readback bitfield */ + /* Using Direct SPI instead of AHB */ + recoveryAction = adrv903x_Core_GpioAnalogSpiRead_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + gpioAnalogInPinLevel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while reading back ANalog GPIO Manual Mode Input Word values."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogManualOutputPinLevelGet(adi_adrv903x_Device_t* const device, + uint16_t * const gpioAnalogOutPinLevel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gpioAnalogOutPinLevel, cleanup); + + /* Readback bitfield */ + /* Using Direct SPI instead of AHB */ + recoveryAction = adrv903x_Core_GpioAnalogFromMaster_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + gpioAnalogOutPinLevel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "Error while reading back Analog GPIO Manual Mode Output Word values."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioAnalogManualOutputPinLevelSet(adi_adrv903x_Device_t* const device, + const uint16_t gpioAnalogPinMask, + const uint16_t gpioAnalogOutPinLevel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t channelMaskArray[ADI_ADRV903X_GPIO_COUNT] = { 0U }; + uint16_t currentLevel = 0U; + uint32_t toggleLevel = 0U; + uint32_t idx = 0U; + uint16_t tmpMask = 0U; + uint32_t allocatedMask = 0U; + adi_adrv903x_GpioSignal_e signalArray[ADI_ADRV903X_GPIO_ANALOG_COUNT] = + { + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED, + ADI_ADRV903X_GPIO_SIGNAL_UNUSED + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Readback all Analog GPIO allocations */ + recoveryAction = adi_adrv903x_GpioAnalogConfigAllGet(device, signalArray, channelMaskArray, ADI_ADRV903X_GPIO_ANALOG_COUNT); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while retreiving current Analog GPIO configurations."); + goto cleanup; + } + + /* Build mask containing only/all pins allocated for this features */ + for (idx = 0U; idx < ADI_ADRV903X_GPIO_ANALOG_COUNT; idx++) + { + tmpMask = 1U << idx; + if (signalArray[idx] == analogManualModeOutputSignal[idx]) + { + allocatedMask |= tmpMask; + } + else + { + tmpMask = ~tmpMask; + allocatedMask &= tmpMask; + } + } + + /* Check that gpioAnalogPinMask contains only pins that are allocated for this feature */ + if ((gpioAnalogPinMask & allocatedMask) != gpioAnalogPinMask) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gpioAnalogPinMask, "Invalid Analog GPIO pinmask. Includes pins that are not allocated as Analog Manual Mode Outputs."); + goto cleanup; + } + + /* Readback current drive state of Digital GPIO pins */ + recoveryAction = adi_adrv903x_GpioAnalogManualOutputPinLevelGet(device, ¤tLevel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while retrieving current Analog GPIO Manual Mode drive levels."); + goto cleanup; + } + + /* XOR with current levels with target levels to determine which pins need to toggle */ + toggleLevel = (uint32_t)(currentLevel ^ gpioAnalogOutPinLevel); + + /* Mask out pins that are not in the requested gpioAnalogPinMask. They should not be toggled. */ + toggleLevel &= gpioAnalogPinMask; + + /* Toggle appropriate pins to achieve target levels */ + recoveryAction = adrv903x_Core_GpioAnalogFromMasterToggle_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + toggleLevel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting Analog GPIO output levels."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +/**************************************************************************** + * GP Int (General Purpose Interrupt) related functions + *************************************************************************** + */ + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpIntPinMaskCfgSet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntPinSelect_e pinSelect, + const adi_adrv903x_GpIntPinMaskCfg_t* const pinMaskCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Validate inputs */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, pinMaskCfg, cleanup); + + if ((pinSelect != ADI_ADRV903X_GPINT0) && + (pinSelect != ADI_ADRV903X_GPINT1) && + (pinSelect != ADI_ADRV903X_GPINTALL)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, pinSelect, "Invalid GP Interrupt pin(s) selected. Out of range."); + goto cleanup; + } + + /* Set GPINT0 Mask */ + if ((pinSelect == ADI_ADRV903X_GPINT0) || + (pinSelect == ADI_ADRV903X_GPINTALL)) + { + recoveryAction = adrv903x_Core_GpInterruptsMaskLowerWordPin0_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + pinMaskCfg->gpInt0Mask.lowerMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing GP Interrupt Mask Lower Word for GP Int0."); + goto cleanup; + } + + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + pinMaskCfg->gpInt0Mask.upperMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing GP Interrupt Mask Upper Word for GP Int0."); + goto cleanup; + } + } + + /* Set GPINT1 Mask */ + if ((pinSelect == ADI_ADRV903X_GPINT1) || + (pinSelect == ADI_ADRV903X_GPINTALL)) + { + recoveryAction = adrv903x_Core_GpInterruptsMaskLowerWordPin1_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + pinMaskCfg->gpInt1Mask.lowerMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing GP Interrupt Mask Lower Word for GP Int1."); + goto cleanup; + } + + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + pinMaskCfg->gpInt1Mask.upperMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing GP Interrupt Mask Upper Word for GP Int1."); + goto cleanup; + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpIntPinMaskCfgGet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntPinSelect_e pinSelect, + adi_adrv903x_GpIntPinMaskCfg_t* const pinMaskCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Validate inputs */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, pinMaskCfg, cleanup); + + if ((pinSelect != ADI_ADRV903X_GPINT0) && + (pinSelect != ADI_ADRV903X_GPINT1) && + (pinSelect != ADI_ADRV903X_GPINTALL)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, pinSelect, "Invalid GP Interrupt pin(s) selected. Out of range."); + goto cleanup; + } + + /* Get GPINT0 Mask */ + if ((pinSelect == ADI_ADRV903X_GPINT0) || + (pinSelect == ADI_ADRV903X_GPINTALL)) + { + recoveryAction = adrv903x_Core_GpInterruptsMaskLowerWordPin0_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &pinMaskCfg->gpInt0Mask.lowerMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading GP Interrupt Mask Lower Word for GP Int0."); + goto cleanup; + } + + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin0_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &pinMaskCfg->gpInt0Mask.upperMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading GP Interrupt Mask Upper Word for GP Int0."); + goto cleanup; + } + } + + /* Get GPINT1 Mask */ + if ((pinSelect == ADI_ADRV903X_GPINT1) || + (pinSelect == ADI_ADRV903X_GPINTALL)) + { + recoveryAction = adrv903x_Core_GpInterruptsMaskLowerWordPin1_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &pinMaskCfg->gpInt1Mask.lowerMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading GP Interrupt Mask Lower Word for GP Int1."); + goto cleanup; + } + + recoveryAction = adrv903x_Core_GpInterruptsMaskUpperWordPin1_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &pinMaskCfg->gpInt1Mask.upperMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading GP Interrupt Mask Upper Word for GP Int1."); + goto cleanup; + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpIntStatusGet( adi_adrv903x_Device_t* const device, + adi_adrv903x_GpIntMask_t* const gpIntStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Validate inputs */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gpIntStatus, cleanup); + + /* Get GP interrupt status bits */ + recoveryAction = adrv903x_Core_GpInterruptsStatusLowerWord_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &gpIntStatus->lowerMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading GP Interrupt Status Lower Word."); + goto cleanup; + } + + recoveryAction = adrv903x_Core_GpInterruptsStatusUpperWord_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &gpIntStatus->upperMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading GP Interrupt Status Upper Word."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpIntStatusClear( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntMask_t* const gpIntClear) +{ + static const uint64_t GP_INT_48BIT_ALL = 0x0000FFFFFFFFFFFFULL; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint64_t tmpLower = 0ULL; + uint64_t tmpUpper = 0ULL; + + /* Validate inputs */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* If gpIntClear is NULL ptr, simply clear all GP Int source status bits */ + tmpLower = (gpIntClear == NULL) ? GP_INT_48BIT_ALL : gpIntClear->lowerMask; + tmpUpper = (gpIntClear == NULL) ? GP_INT_48BIT_ALL : gpIntClear->upperMask; + + /* Clear selected GP Interrupt status bits*/ + recoveryAction = adrv903x_Core_GpInterruptsStatusLowerWord_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + tmpLower); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error clearing selected GP Interrupt Status Lower Word bits."); + goto cleanup; + } + + recoveryAction = adrv903x_Core_GpInterruptsStatusUpperWord_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + tmpUpper); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error clearing selected GP Interrupt Status Upper Word bits."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpIntStickyBitMaskSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpIntMask_t* const gpIntStickyBitMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Validate inputs */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gpIntStickyBitMask, cleanup); + + /* Setup proper GP Interrupt Type defaults (Level vs Edge Triggered) */ + recoveryAction = adrv903x_GpIntTypeSet(device, gpIntStickyBitMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing default GP Interrupt Types."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpIntStickyBitMaskGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_GpIntMask_t* const gpIntStickyBitMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Validate inputs */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gpIntStickyBitMask, cleanup); + + /* Setup proper GP Interrupt Type defaults (Level vs Edge Triggered) */ + recoveryAction = adrv903x_GpIntTypeGet(device, gpIntStickyBitMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing default GP Interrupt Types."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioHysteresisSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioDigitalPin_e pinName, + const uint32_t enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t bfValue = 0U; + + const uint8_t PAD_DS_GROUP = (uint8_t) ((pinName & 0xF0U) >> 4U); + const uint8_t PAD_DS_PIN_INDEX = (uint8_t) (pinName & 0x0FU); + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + if (PAD_DS_GROUP > ADRV903X_DIGITAL_PIN_GROUP_NUM) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + PAD_DS_GROUP, + "Invalid Pin ID"); + goto cleanup; + } + + if (PAD_DS_PIN_INDEX > ADRV903X_DIGITAL_PIN_PER_GROUP_NUM) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + PAD_DS_PIN_INDEX, + "Invalid Pin ID"); + goto cleanup; + } + + if (enable > ADI_ENABLE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + enable, + "GPIO Hysterisis Enable Flag can only be 0 or 1"); + goto cleanup; + } + + /* Read Modify Write */ + + recoveryAction = adrv903x_Core_PadSt_BfGet( device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + if (enable == ADI_ENABLE) + { + bfValue = (bfValue | (1U << PAD_DS_PIN_INDEX)); + } + else + { + bfValue = (bfValue & (0U << PAD_DS_PIN_INDEX)); + } + + recoveryAction = adrv903x_Core_PadSt_BfSet( device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioHysteresisGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioDigitalPin_e pinName, + uint32_t* const enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t bfValue = 0U; + + const uint8_t PAD_DS_GROUP = (uint8_t) ((pinName & 0xF0U) >> 4U); + const uint8_t PAD_DS_PIN_INDEX = (uint8_t) (pinName & 0x0FU); + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, enable, cleanup); + + *enable = 0U; + + if (PAD_DS_GROUP > ADRV903X_DIGITAL_PIN_GROUP_NUM) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + PAD_DS_GROUP, + "Invalid Pin ID"); + goto cleanup; + } + + if (PAD_DS_PIN_INDEX > ADRV903X_DIGITAL_PIN_PER_GROUP_NUM) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + PAD_DS_PIN_INDEX, + "Invalid Pin ID"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_PadSt_BfGet( device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + *enable = ((bfValue & (1U << PAD_DS_PIN_INDEX)) != 0U) ? ADI_ENABLE : ADI_DISABLE; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioDriveStrengthSet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioDigitalPin_e pinName, + const adi_adrv903x_CmosPadDrvStr_e driveStrength) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t dsRead[] = { 0U, 0U, 0U, 0U }; + uint8_t dsWrite[] = { 0U, 0U, 0U, 0U }; + uint8_t i = 0U; + + const uint8_t PAD_DS_GROUP = (uint8_t) ((pinName & 0xF0U) >> 4U); + const uint8_t PAD_DS_PIN_INDEX = (uint8_t) (pinName & 0x0FU); + + static const uint8_t DS_ENUM_CONVERT[] = { 0U, 3U, 1U, 2U }; + + const uint8_t IDX = DS_ENUM_CONVERT[driveStrength]; + + static const uint8_t DS_VALUE[] = { 0x0U, 0x3U, 0x9U, 0xFU }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + if (PAD_DS_GROUP > ADRV903X_DIGITAL_PIN_GROUP_NUM) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + PAD_DS_GROUP, + "Invalid Pin ID"); + goto cleanup; + } + + if (PAD_DS_PIN_INDEX > ADRV903X_DIGITAL_PIN_PER_GROUP_NUM) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + PAD_DS_PIN_INDEX, + "Invalid Pin ID"); + goto cleanup; + } + + if (driveStrength > ADI_ADRV903X_CMOSPAD_DRV_STRENGTH_2) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + driveStrength, + "Invalid GPIO Drive Strength Setting"); + goto cleanup; + } + + /* Read Modify Write */ + + /* 1) Read */ + recoveryAction = adrv903x_Core_PadDs0_BfGet( device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + &dsRead[0]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + recoveryAction = adrv903x_Core_PadDs1_BfGet( device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + &dsRead[1]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + recoveryAction = adrv903x_Core_PadDs2_BfGet( device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + &dsRead[2]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + recoveryAction = adrv903x_Core_PadDs3_BfGet( device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + &dsRead[3]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + /* 2) Modify */ + + for (i = 0U; i < sizeof(dsWrite); ++i) + { + /* Checking DS Bit of the DS Value to be Used */ + if ((DS_VALUE[IDX] & (1U << i)) != 0U) + { + dsWrite[i] = (uint8_t)(dsRead[i] | (1U << PAD_DS_PIN_INDEX)); + } + else + { + dsWrite[i] = (uint8_t)(dsRead[i] & (0U << PAD_DS_PIN_INDEX)); + } + } + + /* 3) Write */ + + if (dsWrite[0] != dsRead[0]) + { + recoveryAction = adrv903x_Core_PadDs0_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + dsWrite[0]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + } + + if (dsWrite[1] != dsRead[1]) + { + recoveryAction = adrv903x_Core_PadDs1_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + dsWrite[1]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + } + + if (dsWrite[2] != dsRead[2]) + { + recoveryAction = adrv903x_Core_PadDs2_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + dsWrite[2]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + } + + if (dsWrite[3] != dsRead[3]) + { + recoveryAction = adrv903x_Core_PadDs3_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + dsWrite[3]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioDriveStrengthGet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioDigitalPin_e pinName, + adi_adrv903x_CmosPadDrvStr_e* const driveStrength) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t dsRead[] = { 0U, 0U, 0U, 0U }; + uint8_t i = 0U; + + uint8_t dsValue = 0U; + + const uint8_t PAD_DS_GROUP = (uint8_t) ((pinName & 0xF0U) >> 4U); + const uint8_t PAD_DS_PIN_INDEX = (uint8_t) (pinName & 0x0FU); + + static const adi_adrv903x_CmosPadDrvStr_e ENUM_DS_CONVERT[] = { ADI_ADRV903X_CMOSPAD_DRV_WEAK, ADI_ADRV903X_CMOSPAD_DRV_STRENGTH_1, ADI_ADRV903X_CMOSPAD_DRV_STRENGTH_2, ADI_ADRV903X_CMOSPAD_DRV_STRONG }; + + static const uint8_t DS_VALUE_IDX[] = { 0x0U, 0x3U, 0x9U, 0xFU }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, driveStrength, cleanup); + + *driveStrength = (adi_adrv903x_CmosPadDrvStr_e) (0xFFU); + + if (PAD_DS_GROUP > ADRV903X_DIGITAL_PIN_GROUP_NUM) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + PAD_DS_GROUP, + "Invalid Pin ID"); + goto cleanup; + } + + if (PAD_DS_PIN_INDEX > ADRV903X_DIGITAL_PIN_PER_GROUP_NUM) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + PAD_DS_PIN_INDEX, + "Invalid Pin ID"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_PadDs0_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + &dsRead[0]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + recoveryAction = adrv903x_Core_PadDs1_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + &dsRead[1]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + recoveryAction = adrv903x_Core_PadDs2_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + &dsRead[2]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + recoveryAction = adrv903x_Core_PadDs3_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + PAD_DS_GROUP, + &dsRead[3]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + for (i = 0U; i < sizeof(dsRead); ++i) + { + if ((dsRead[i] & (1U << PAD_DS_PIN_INDEX)) != 0U) + { + dsValue |= (uint8_t) (1U << i); + } + } + + for (i = 0U; i < sizeof(DS_VALUE_IDX); ++i) + { + if (DS_VALUE_IDX[i] == dsValue) + { + *driveStrength = ENUM_DS_CONVERT[i]; + } + } + + if (*driveStrength == (adi_adrv903x_CmosPadDrvStr_e)(0xFFU)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + dsValue, + "Invalid Drive Strength Value"); + + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + *driveStrength, + "Invalid Drive Strength Value"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} \ No newline at end of file diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_hal.c b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_hal.c new file mode 100644 index 0000000000000..dac010992747f --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_hal.c @@ -0,0 +1,2626 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_hal.c +* \brief Contains ADI Transceiver Hardware Abstraction functions +* Analog Devices maintains and provides updates to this code layer. +* The end user should not modify this file or any code in this directory. +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#include "adi_adrv903x_hal.h" +#include "adi_adrv903x_tx_types.h" +#include "adi_adrv903x_error.h" + +#include "../../private/include/adrv903x_reg_addr_macros.h" +#include "../../private/include/adrv903x_platform_byte_order.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PUBLIC_HAL + +/* + * Private Helpers + * + **/ + +/* Used to re-write single byte AHB register read/writes to equivalent + * but faster SPI register read/writes. */ +static const uint32_t SPI_ONLY_REGS_ADDR = 0x47000000U; +static const uint32_t DIRECT_SPI_REGION_LEN = 0x4000U; + +/** +* \brief Helper function to check the address passed into the Registers32bOnlyRead and Registers32bOnlyWrite functions +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure. +* \param[in] addr The 32bit address that is checked to see if it lies in a region of the register map that requires +* a 32-bit spi transaction to be performed. +* \param[in] count The number of bytes to read or write. Count should be greater than 0 and a multiple of 4. Furthermore, +* for semaphore registers the count needs to be exactly 4. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +* +*/ +static adi_adrv903x_ErrAction_e adrv903x_ThirtyTwoBitAhbAccessRangeCheck(adi_adrv903x_Device_t* const device, + const uint32_t addr, + const uint32_t count); + +/** +* \brief Encodes a write to a 'Direct SPI' device register. Appends encoded data to a caller +* supplied buffer and may flush that buffer using SpiFlush(). +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure. +* \param[out] wrData caller supplied buffer to hold the encoded data byte array. Must be large enough to +* hold the required data. +* \param[out] numWrBytes is set to the number of valid bytes in wrData after the call. The caller +* must monitor this value and manually call SpiFlush if a call to this function would overrun the +* buffer. If the buffer is flushed during the call numWrBytes will be set to 0 (unless the call appends +* further bytes after the flush). +* \param[in] addr the device register to write to. Must be 'Direct SPI' register i.e. less that DIRECT_SPI_REGION_LEN. +* \param[in] mask Only the register bits where the corresponding bit in mask are set to 1 will be written to. +* The other register bits at addr will be left unchanged. +* \param[in] data the data to write. +* \param[in] writeFlag +* +* If the device is in streaming or FIFO mode it's possible that only the data byte needs to be appended to wrData. +* numWrBytes will only increment by one in this case. +* +* If mask is anything except 0xFF, hardware masking will be utilized automatically. This requires additional SPI +* writes to the masking register. These additional register writes are added through recursive calls to DirectSpiDataPack. +* It will also result in existing wrData contents being flushed. +*/ +static adi_adrv903x_ErrAction_e adrv903x_DirectSpiDataPack(adi_adrv903x_Device_t* const device, + uint8_t* const wrData, + uint32_t* const numWrBytes, + const uint16_t addr, + const uint8_t mask, + const uint8_t data, + const uint8_t writeFlag) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t initialDataByte = (*numWrBytes == 0) ? 1U : 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, wrData); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, numWrBytes); + + if (mask == 0xFFU) + { + /* mask = 0xFF => No write to device masking register required */ + + /* Three conditions need to be met to add only the data & not the addr to the byte array: + * - device is in streaming mode, AND + * - This is not the first data byte going across SPI, AND + * - The current address is the next sequentially from the previous address + * ---or--- + * - device is in SPI FIFO mode, AND + * - This is not the first data byte going across SPI, AND + * - the address is equal to the previous address + * */ + if (((device->devStateInfo.spiStreamingOn == 1U) && + (initialDataByte != 1U) && + (addr == device->devStateInfo.previousSpiStreamingAddress + 1U)) || + ((device->devStateInfo.spiFifoModeOn == 1U) && + (initialDataByte != 1U) && + (addr == device->devStateInfo.previousSpiStreamingAddress))) + { + /* No need to write address. Just data required. */ + wrData[(*numWrBytes)++] = (uint8_t)data; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + else + { + /* Need to write an address to wrData */ + if ((device->devStateInfo.spiStreamingOn == 1U) && (initialDataByte != 1U)) + { + /* Streaming mode and buffer has an existing write it it. Flush out and start new write */ + if (writeFlag == ADRV903X_SPI_WRITE_POLARITY) + { + recoveryAction = adi_adrv903x_SpiFlush( device, wrData, numWrBytes); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flushing Issue"); + return recoveryAction; + } + } + else + { + /* Because we have to flush and don't have a way to send the read data back to the user */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + writeFlag, + "Non consecutive reads cannot be packed together in streaming mode"); + return recoveryAction; + } + } + + /* Address Format: + * + * | Byte 0 | Byte 1 | + * | Bit 7 6 5 - 0 | 7 - 0 | + * +--------------------------+-----------------+------------+------------+ + * | read/write | Addr[14] | Addr[13:8] | Addr[7:0] | + * | SPI_WRITE_POLARITY read | 0 direct region | | | + * |!SPI_WRITE_POLARITY write | 1 paged region | | | + * +--------------------------+-----------------+------------+------------+ + */ + + wrData[(*numWrBytes)++] = (uint8_t)(((writeFlag & 0x01U) << 7U) | ((addr >> 8U) & 0x7FU)); + wrData[(*numWrBytes)++] = (uint8_t)(addr); + /* coverity will trigger an error which is OK in this case. */ + wrData[(*numWrBytes)++] = (uint8_t)data; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + } + else + { + /* mask != 0xFF requires a mask value to be written to device masking register */ + + if (device->devStateInfo.spiStreamingOn == 0U) + { + recoveryAction = adrv903x_DirectSpiDataPack(device, + wrData, + numWrBytes, + ADRV903X_ADDR_SPI0_MASK_7TO0, + 0xFFU, + mask, + writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + recoveryAction = adrv903x_DirectSpiDataPack(device, + wrData, + numWrBytes, + addr, + 0xFFU, + data, + writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + } + else + { + /* Masked write in streaming mode. */ + + /* Flush current wrData. */ + recoveryAction = adi_adrv903x_SpiFlush( device, wrData, numWrBytes); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flushing Issue"); + return recoveryAction; + } + + /* Flush out a write to the h/w mask register */ + recoveryAction = adrv903x_DirectSpiDataPack( device, wrData, numWrBytes, ADRV903X_ADDR_SPI0_MASK_7TO0, 0xFF, mask, writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_SpiFlush( device, wrData, numWrBytes); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flushing Issue"); + return recoveryAction; + } + + /* Flush out a write to the destination register */ + recoveryAction = adrv903x_DirectSpiDataPack( device, wrData, numWrBytes, addr, 0xFFU, data, writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_SpiFlush( device, wrData, numWrBytes); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flushing Issue"); + return recoveryAction; + } + } + } + + device->devStateInfo.previousSpiStreamingAddress = addr; + + return recoveryAction; +} + +/** +* \brief Encodes a write to a AHB device register. Appends encoded data to a caller +* supplied buffer and may flush that buffer using SpiFlush(). +* +* Writes to AHB registers are effected by writes to special paging registers to select the correct page (only +* if not alredy selected) and then Direct SPI write to the currently selected page. Therefore this function does +* not write directly to wrData itself but delegates adrv903x_DirectSpiDataPack to do so. +* +* \param[in,out] device Context variable - Pointer to the ADRV903X device data structure. +* \param[out] wrData caller supplied buffer to hold the encoded data byte array. Must be large enough to +* hold the required data. +* \param[out] numWrBytes is set to the number of valid of bytes in wrData after the call. The caller +* must monitor this value and manually call SpiFlush if a call to this function would overrun the +* buffer. If buffer flushed during the call numWrBytes will be set to 0 (unless the call appends +* further bytes after the flush). +* \param[in] addr the device register to write to. Must be 'Direct SPI' register i.e. less that DIRECT_SPI_REGION_LEN. +* \param[in] mask Only the register bits where the corresponding bit in mask are set to 1 will be written to. +* The other register bits at addr will be left unchanged. +* \param[in] data the data to write. +* \param[in] writeFlag The value to be bitwise OR'd into the MSB of the 16-bit address. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +static adi_adrv903x_ErrAction_e adrv903x_PagingSpiDataPack(adi_adrv903x_Device_t* const device, + uint8_t* const wrData, + uint32_t* const numWrBytes, + uint32_t addr, + uint32_t mask, + uint32_t data, + const uint8_t writeFlag) +{ + static const uint16_t SPI_MASK = 0x3FFFU; + uint16_t SPI_PAGING = (uint16_t) DIRECT_SPI_REGION_LEN; + uint32_t dataOffset = 0U; /* Offset from pageAddr to the highest byte address within pageMask that contains set bits */ + + /* SPI Paging variables: */ + uint32_t byteShiftVal = 0; /* The offset from pageAddr to dest addres */ + uint32_t pageAddr = 0; /* The 32bit-aligned address before dest address */ + uint64_t pageMask = 0; /* Equivalent to mask param but to be applied to pageAddr */ + uint64_t pageData = 0; /* Equivalent to data param but to be applied to pageAddr */ + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, wrData); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, numWrBytes); + + /* Calculate paging variables. + * + * For example when addr is one up from a 32b aligned address: + * + * <----------------------------- pageMask (64b) ------------------------------------------> + * Vars <----------------------------- pageData (64b) ------------------------------------------> + * <-------------------- mask (32b) ------------------> + * <-------------------- data (32b) ------------------> + * Device Reg. + * Addr b...00 b...01 b...10 b...11 b...00 b...01 b...10 b...11 + * | 32b | 32b | + * | aligned | aligned | + * +----------+------------+------------+------------+------------+------------+------------+------------+ + * Vars | pageAddr | addr | | | | | | | + * |----------+------------+------------+------------|------------+------------+------------+------------+ + * + **/ + + byteShiftVal = addr - (addr & ~0x3U); + pageAddr = (addr & ~0x3U); + pageMask = ((uint64_t)mask) << (8U * byteShiftVal) ; + pageData = ((uint64_t)(data)) << (8U * byteShiftVal); + + if ((pageMask & 0x00FF000000000000ULL) > 0U) + { + dataOffset = 6U; + } + else if ((pageMask & 0x0000FF0000000000ULL) > 0U) + { + dataOffset = 5U; + } + else if ((pageMask & 0x000000FF00000000ULL) > 0U) + { + dataOffset = 4U; + } + else if ((pageMask & 0xFF000000ULL) > 0U) + { + dataOffset = 3U; + } + else if ((pageMask & 0x00FF0000ULL) > 0U) + { + dataOffset = 2U; + } + else if ((pageMask & 0x0000FF00ULL) > 0U) + { + dataOffset = 1U; + } + else if ((pageMask & 0x000000FFULL) > 0U) + { + dataOffset = 0U; + } + else + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing invalid mask"); + return recoveryAction; + } + + /* SPI InDirect address. Write paging registers */ + /* Update page addr is less than current page starting address OR greater than page size (4k) from starting address */ + if ((pageAddr < device->devStateInfo.currentPageStartingAddress) || ((pageAddr + dataOffset) > (device->devStateInfo.currentPageStartingAddress + SPI_MASK))) + { + /* The write affects bits outside of the page currently selected by the device page registers. Update them. */ + recoveryAction = adrv903x_DirectSpiDataPack(device, wrData, numWrBytes, ADRV903X_ADDR_SPI0_PAGE_31TO24, 0xFFU, (uint8_t)(pageAddr >> 24U), writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + recoveryAction = adrv903x_DirectSpiDataPack(device, wrData, numWrBytes, ADRV903X_ADDR_SPI0_PAGE_23TO16, 0xFFU, (uint8_t)(pageAddr >> 16U), writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + recoveryAction = adrv903x_DirectSpiDataPack(device, wrData, numWrBytes, ADRV903X_ADDR_SPI0_PAGE_15TO8, 0xFFU, (uint8_t)(pageAddr >> 8U), writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + recoveryAction = adrv903x_DirectSpiDataPack(device, wrData, numWrBytes, ADRV903X_ADDR_SPI0_PAGE_7TO0, 0xFFU, (uint8_t)(pageAddr >> 0U), writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + recoveryAction = adrv903x_DirectSpiDataPack(device, wrData, numWrBytes, ADRV903X_ADDR_SPI0_PAGING_CONTROL, 0xFFU, (uint8_t)(0U), writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + + device->devStateInfo.currentPageStartingAddress = pageAddr; + } + + /* Update addr from AHB address space to offset into currently selected page */ + addr = pageAddr - device->devStateInfo.currentPageStartingAddress; + + /* Depending on the mask bits set and the offset of addr from next lower 32bit aligned + * addr at most most four of a possible seven writes releative to the 32bit alinged addr + * will be generated. */ + if ((pageMask & 0x000000FFULL) > 0U) + { + recoveryAction = adrv903x_DirectSpiDataPack(device, wrData, numWrBytes, (uint16_t)(SPI_PAGING | ((addr & SPI_MASK) + 0U)), (uint8_t)(pageMask >> 0U), (uint8_t)(pageData >> 0U), writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + } + if ((pageMask & 0x0000FF00ULL) > 0U) + { + recoveryAction = adrv903x_DirectSpiDataPack(device, wrData, numWrBytes, (uint16_t)(SPI_PAGING | ((addr & SPI_MASK) + 1U)), (uint8_t)(pageMask >> 8U), (uint8_t)(pageData >> 8U), writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + } + if ((pageMask & 0x00FF0000ULL) > 0U) + { + recoveryAction = adrv903x_DirectSpiDataPack(device, wrData, numWrBytes, (uint16_t)(SPI_PAGING | ((addr & SPI_MASK) + 2U)), (uint8_t)(pageMask >> 16U), (uint8_t)(pageData >> 16U), writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + } + if ((pageMask & 0xFF000000ULL) > 0U) + { + recoveryAction = adrv903x_DirectSpiDataPack(device, wrData, numWrBytes, (uint16_t)(SPI_PAGING | ((addr & SPI_MASK) + 3)), (uint8_t)(pageMask >> 24), (uint8_t)(pageData >> 24), writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + } + if ((pageMask & 0x000000FF00000000ULL) > 0U) + { + recoveryAction = adrv903x_DirectSpiDataPack(device, wrData, numWrBytes, (uint16_t)(SPI_PAGING | ((addr & SPI_MASK) + 4)), (uint8_t)(pageMask >> 32), (uint8_t)(pageData >> 32), writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + } + if ((pageMask & 0x0000FF0000000000ULL) > 0ULL) + { + recoveryAction = adrv903x_DirectSpiDataPack(device, wrData, numWrBytes, (uint16_t)(SPI_PAGING | ((addr & SPI_MASK) + 5)), (uint8_t)(pageMask >> 40), (uint8_t)(pageData >> 40), writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + } + if ((pageMask & 0x00FF000000000000ULL) > 0ULL) + { + recoveryAction = adrv903x_DirectSpiDataPack(device, wrData, numWrBytes, (uint16_t)(SPI_PAGING | ((addr & SPI_MASK) + 6)), (uint8_t)(pageMask >> 48), (uint8_t)(pageData >> 48), writeFlag); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + } + + return recoveryAction; +} + + +/** +* \brief Writes out the data array of size count and returns parsed return data. Must be packed according ADIHAL layer specs. +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param device Pointer to the ADRV903X device data structure. +* \param txData byte array containing the data to write to SPI. Must be packed correctly. +* \param byteCount pointer to the number of bytes in data parameter. +* \param rxData empty array that will hold the raw SPI data. Must be at least as large as txData array +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +* +*/ +static adi_adrv903x_ErrAction_e adrv903x_SpiFlushWithRead(adi_adrv903x_Device_t* const device, + const uint8_t txData[], + const uint16_t byteCount, + uint8_t rxData[]) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_hal_Err_e halError = ADI_HAL_ERR_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, txData); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxData); + + halError = adrv903x_SpiRead(device->common.devHalInfo, &txData[0U], rxData, byteCount); + if (ADI_HAL_ERR_OK == halError) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + else + { + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ErrCodeConvert(halError); + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_DEVICEHAL, + ADI_ADRV903X_ERRCODE_HAL_SPI_READ, + recoveryAction, + halError, + "SPI Read Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +/** +* \brief Extracts the register data from the raw data received on a SPI transaction to a byte array. +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param device Pointer to the ADRV903X device data structure. +* \param rxData array of raw data bytes from a recent SPI read, e.g from calling adrv903x_SpiFlushWithRead +* \param rxDataCount the number of bytes included in rxData +* \param parsedData blank array that will hold the parsed data from rxData +* \param parsedDataCount The number of bytes to extract from rxData +* \param parsedDataStride Nth byte extracted is written to parsedData[parsedDataStride * n]. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +* +*/ +static adi_adrv903x_ErrAction_e adrv903x_SpiDataParse(adi_adrv903x_Device_t* const device, + const uint8_t rxData[], + const uint16_t rxDataCount, + uint8_t parsedData[], + const uint32_t parsedDataCount, + const uint8_t parsedDataStride) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t i = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + if (device->devStateInfo.spiStreamingOn == 0U) + { + /* Two address bytes + 1 data byte for each parsedDataCount --> must also be a multiple of three */ + if (((rxDataCount % 3U) != 0U) || (parsedDataCount != (rxDataCount / 3U))) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + parsedDataCount, + "Number of bytes read does not match requested number of registers"); + return recoveryAction; + } + + for (i = 0U; i < parsedDataCount; ++i) + { + /* + * stride = 3 bytes (if not streaming stride = word size * 3) + * offset = 2 for initial 2-byte address + */ + parsedData[i * parsedDataStride] = rxData[(i * 3U) + 2U]; + } + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + else + { + /* byteCount should include the two extra bytes for starting address */ + if (parsedDataCount != ((uint32_t)rxDataCount - 2U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + parsedDataCount, + "Number of bytes read does not match requested number of registers"); + return recoveryAction; + } + + for (i = 0U; i < parsedDataCount; ++i) + { + /* + * stride = 1 byte (if streaming stride = word size) + * offset = 2 for initial 2-byte address + */ + parsedData[i * parsedDataStride] = rxData[i + 2U]; + } + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + + return recoveryAction; +} + +/* + * \brief Writes the AHB address to the AHB interface SPI registers and performs SpiFlush + **/ +static adi_adrv903x_ErrAction_e adrv903x_DmaAddrSet(adi_adrv903x_Device_t* const device, + const uint32_t address) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t localSpiCache[12U] = { 0U }; /* 12 bytes is max needed to set address when non-streaming mode */ + uint32_t localCacheCount = 0U; + uint8_t spiReg = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + recoveryAction = adrv903x_DirectSpiDataPack(device, &localSpiCache[0U], &localCacheCount, ADRV903X_ADDR_SPIDMA0_ADDR3, 0xFFU, (uint8_t)(address >> 24U), ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "DMA Address Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + ADRV903X_ADDR_SPIDMA0_ADDR3, + (uint8_t)(address >> 24U), + 0xFFU); + + recoveryAction = adrv903x_DirectSpiDataPack(device, &localSpiCache[0U], &localCacheCount, ADRV903X_ADDR_SPIDMA0_ADDR2, 0xFFU, (uint8_t)(address >> 16U), ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "DMA Address Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + ADRV903X_ADDR_SPIDMA0_ADDR2, + (uint8_t) (address >> 16U), + 0xFFU); + + recoveryAction = adrv903x_DirectSpiDataPack(device, &localSpiCache[0U], &localCacheCount, ADRV903X_ADDR_SPIDMA0_ADDR1, 0xFFU, (uint8_t)(address >> 8U), ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "DMA Address Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + ADRV903X_ADDR_SPIDMA0_ADDR1, + (uint8_t) (address >> 8U), + 0xFFU); + + recoveryAction = adrv903x_DirectSpiDataPack(device, &localSpiCache[0U], &localCacheCount, ADRV903X_ADDR_SPIDMA0_ADDR0, 0xFFU, (uint8_t)address, ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "DMA Address Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + ADRV903X_ADDR_SPIDMA0_ADDR0, + (uint8_t) address, + 0xFFU); + + recoveryAction = adi_adrv903x_SpiFlush(device, localSpiCache, &localCacheCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flushing Issue"); + return recoveryAction; + } + + if ((device->devStateInfo.autoIncrModeOn == ADI_TRUE) && + (device->devStateInfo.spiStreamingOn == ADI_TRUE) && + (device->devStateInfo.spiOptions.allowAhbSpiFifoMode == ADI_TRUE)) + { + /* 0x1U = enable FIFO for byte mode (hard coded to byte mode) */ + spiReg = ADI_TRUE; + device->devStateInfo.spiFifoModeOn = ADI_TRUE; + + recoveryAction = adrv903x_DirectSpiDataPack(device, + &localSpiCache[0U], + &localCacheCount, + ADRV903X_ADDR_SPIFIFO_MODE, + 0xFFU, + spiReg, + ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "DMA Address Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + ADRV903X_ADDR_SPIFIFO_MODE, + spiReg, + 0xFFU); + + recoveryAction = adi_adrv903x_SpiFlush(device, localSpiCache, &localCacheCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flushing Issue"); + return recoveryAction; + } + } + + return recoveryAction; +} + +/* + * \brief Writes the AHB configuration (from device structure) + * to the AHB interface SPI registers and performs SpiFlush. + * Sets the file-scoped global variables for SPI FIFO and Auto-Increment. + **/ +static adi_adrv903x_ErrAction_e adrv903x_IndirectReadSetup(adi_adrv903x_Device_t* const device, + uint8_t enAhbAutoIncrement) +{ + uint8_t localSpiCache[6U] = { 0U }; /* 6 bytes is max needed to configure AHB interface */ + uint32_t localCacheCount = 0U; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + /* Bit shifts in Ctrl register */ + static const uint8_t SPIDMA0_AUTO_INCR = 1U; + static const uint8_t SPIDMA0_RD_WRB = 7U; + uint8_t spiReg = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Setup ctrl word for AHB read */ + spiReg |= (1U << SPIDMA0_RD_WRB); + /* Hard coded use of byte mode for Direct & Indirect access */ + /* spiReg |= (device->devStateInfo.ahbBusSize & 0x3U) << SPIDMA0_BUS_SIZE; */ + if (enAhbAutoIncrement == 1U) + { + spiReg |= (1U << SPIDMA0_AUTO_INCR); + device->devStateInfo.autoIncrModeOn = ADI_ENABLE; + } + else + { + device->devStateInfo.autoIncrModeOn = ADI_DISABLE; + } + + recoveryAction = adrv903x_DirectSpiDataPack(device, + &localSpiCache[0U], + &localCacheCount, + ADRV903X_ADDR_SPIDMA0_CTL, + 0xFFU, + spiReg, + ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + + recoveryAction = adi_adrv903x_SpiFlush(device, localSpiCache, &localCacheCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flushing Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +/* + * \brief Clears the AHB configuration and performs SpiFlush. + * Clears the file-scoped global variables for SPI FIFO and Auto-Increment. + * + * NOTE: Public API's Clear Error Structure On Entry + * - Clean Up Functions Cannot Call Public API's + * - API could have already logged error information to Error Structure + */ +static adi_adrv903x_ErrAction_e adrv903x_IndirectReadTeardown(adi_adrv903x_Device_t* const device) +{ + uint8_t localSpiCache[6U] = { 0U }; /* 6 bytes is max needed to configure AHB interface */ + uint32_t localCacheCount = 0U; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t spiReg = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + recoveryAction = adrv903x_DirectSpiDataPack(device, + &localSpiCache[0U], + &localCacheCount, + ADRV903X_ADDR_SPIDMA0_CTL, + 0xFFU, + spiReg, + ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "Direct Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + ADRV903X_ADDR_SPIDMA0_CTL, + spiReg, + 0xFFU); + + device->devStateInfo.spiFifoModeOn = ADI_FALSE; + device->devStateInfo.autoIncrModeOn = ADI_FALSE; + + recoveryAction = adrv903x_DirectSpiDataPack(device, + &localSpiCache[0U], + &localCacheCount, + ADRV903X_ADDR_SPIFIFO_MODE, + 0xFFU, + spiReg, + ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + return recoveryAction; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "Direct Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + ADRV903X_ADDR_SPIFIFO_MODE, + spiReg, + 0xFFU); + + recoveryAction = adi_adrv903x_SpiFlush(device, localSpiCache, &localCacheCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Tear down SPI Flushing Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +/** +* \brief Transmits txData on SPI, parses received data and extracts payload. +* +* Calls adrv903x_SpiFlushWithRead followed by adrv903x_SpiDataParse. +* +* \dep_begin +* \dep{device->halInfo} +* \dep_end +* +* \param device Pointer to the ADRV903X device data structure. +* \param txData bytes to transmit on SPI +* \param byteCount number of bytes in txData +* \param finalDataOut Register data parsed from SPI rx data is written here +* \param finalDataOutCount Number of bytes expected to be in rxData +* \param finalDataOutStride Nth byte extracted from rxData is written to parsedData[parsedDataStride * n]. +* +* \retval adi_adrv903x_ErrAction_e, ADI_ADRV903X_ERR_ACT_NONE if successful +*/ +static adi_adrv903x_ErrAction_e adrv903x_FlushParse(adi_adrv903x_Device_t* const device, + const uint8_t txData[], + const uint16_t byteCount, + uint8_t finalDataOut[], + const uint32_t finalDataOutCount, + const uint8_t finalDataOutStride) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t rxData[ADI_HAL_SPI_FIFO_SIZE] = { 0U }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + /* Final flush before exiting the function. */ + recoveryAction = adrv903x_SpiFlushWithRead(device, txData, byteCount, rxData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush with Read Issue"); + return recoveryAction; + } + + recoveryAction = adrv903x_SpiDataParse(device, rxData, byteCount, finalDataOut, finalDataOutCount, finalDataOutStride); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Data Parsing Issue"); + return recoveryAction; + } + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adrv903x_Registers32bOnlyRead_vEndian(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr, + uint8_t readData[], + const uint32_t numBytesToRead, + uint8_t isByteData) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t i = 0U; /* loop index */ + uint32_t readDataIndex = 0U; + uint8_t spiDmaCtl[1] = { 0x88U }; + uint8_t lclByte[1] = { 0U }; + const uint8_t AUTOINCMASK = 0x2U; + uint8_t devSpiOptionsAllowAutoIncr = 0U; + uint8_t initialAutoIncrHwState = 0U; + uint32_t i32 = 0U; + uint8_t* i32Bytes = (uint8_t*) &i32; /* Hold the big endian version of AHB DMA Read back data [32:0] */ + uint32_t localAddr = addr; /* In case auto-increment is disabled we'll use this to keep track of the current address to read from */ + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, readData); + + if (spiCache != NULL) + { + recoveryAction = adi_adrv903x_SpiFlush(device, spiCache->data, &spiCache->count); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush Issue After CPU Mailbox Buffer Write"); + goto cleanup; + } + } + + /* Check that the range of addresses meets the criteria for 32bOnly read.*/ + recoveryAction = adrv903x_ThirtyTwoBitAhbAccessRangeCheck(device, addr, numBytesToRead); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Range check failed. Address does not require a 32-bit SPI transaction."); + goto cleanup; + } + + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, ADRV903X_ADDR_SPIDMA0_CTL, lclByte, NULL, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from the spi dma control register."); + goto cleanup; + } + + /* Is the auto-incr bit set? */ + if ((lclByte[0] & AUTOINCMASK) == AUTOINCMASK) + { + initialAutoIncrHwState = 1U; + } + + /* read/wrb | sys_codeb | bus_waiting | bus_response | bus_size[1] | bus_size[0] | auto_incr | bus_sel */ + if (device->devStateInfo.spiOptions.allowAhbAutoIncrement) + { + spiDmaCtl[0] = lclByte[0] | (uint8_t) 0x8AU; /* Read, word-mode, auto-increment enabled */ + devSpiOptionsAllowAutoIncr = 1U; + } + else + { + spiDmaCtl[0] = lclByte[0] | (uint8_t) 0x88U; /* Read, word-mode, auto-increment disabled */ + } + + /* Write the DMA control register */ + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_SPIDMA0_CTL, spiDmaCtl, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to the spi dma control register."); + goto cleanup; + } + + /* Write the bus address */ + recoveryAction = adrv903x_DmaAddrSet(device, localAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to the spi dma address registers."); + goto cleanup; + } + + /* Foreach 4-bytes to read except the last one (in order to avoid side-effects of DMA's read-ahead). */ + for (i = 0U; i < numBytesToRead / 4U - 1U; ++i) + { + /* Read the data */ + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, ADRV903X_ADDR_SPIDMA0_DATA3, &i32Bytes[0], NULL, 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from the spi dma data registers."); + goto cleanup; + } + + /* The 32b-only regions are read via the DMA registers which are BE. So i32Bytes is BE at this point. */ + if (isByteData != 0) + { + /* Data in i32 byte-oriented. Convert to device endianess so that byte order here in the host is the same as + * that on the device. */ + i32 = ADRV903X_NTOCL(i32); + } + else + { + /* Data in i32 BE 32bit integer. Convert to host endianess. */ + i32 = ADRV903X_NTOHL(i32); + } + + readData[readDataIndex] = i32Bytes[0]; + readData[readDataIndex + 1] = i32Bytes[1]; + readData[readDataIndex + 2] = i32Bytes[2]; + readData[readDataIndex + 3] = i32Bytes[3]; + + readDataIndex += 4U; + localAddr += 4U; + + if (devSpiOptionsAllowAutoIncr == ADI_FALSE) + { + /* Device's auto-increment feature is off; We must explicity write to the DMA dest addr register. */ + recoveryAction = adrv903x_DmaAddrSet(device, localAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to the spi dma address registers."); + goto cleanup; + } + } + } + + /* Now do the last 4 bytes but without auto-increment enabled. + * Auto-incr will always read 4 bytes ahead of the last requested address which can have unintended effects + * such as access violations or triggering clear-on-read. */ + + if (devSpiOptionsAllowAutoIncr != 0U) + { + /* Auto-incr is set on in the device. Turn it off */ + spiDmaCtl[0U] = spiDmaCtl[0U] & (uint8_t)(~AUTOINCMASK); + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_SPIDMA0_CTL, spiDmaCtl, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to the spi dma control register."); + goto cleanup; + } + } + + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, ADRV903X_ADDR_SPIDMA0_DATA3, &i32Bytes[0], NULL, 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading from the spi dma data registers."); + goto cleanup; + } + + /* The 32b-only regions are read via the DMA registers which are BE. So i32Bytes is BE at this point. */ + if (isByteData != 0) + { + /* Data in i32 byte-oriented. Convert to device endianess so that byte order here in the host is the same as + * that on the device. */ + i32 = ADRV903X_NTOCL(i32); + } + else + { + /* Data in i32 BE 32bit integer. Convert to host endianess. */ + i32 = ADRV903X_NTOHL(i32); + } + + readData[readDataIndex] = i32Bytes[0]; + readData[readDataIndex + 1] = i32Bytes[1]; + readData[readDataIndex + 2] = i32Bytes[2]; + readData[readDataIndex + 3] = i32Bytes[3]; + + if (initialAutoIncrHwState) + { + /* Auto-increment was on when we entered, turn it back on before we exit */ + spiDmaCtl[0] = spiDmaCtl[0U] | AUTOINCMASK; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_SPIDMA0_CTL, spiDmaCtl, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to the spi dma control register."); + goto cleanup; + } + } + +cleanup: + return recoveryAction; +} + + +/* + * Public Functions + * + **/ +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_SpiFlush(adi_adrv903x_Device_t* const device, + const uint8_t data[], + uint32_t* const count) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_hal_Err_e halError = ADI_HAL_ERR_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY_QUIET(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, count, cleanup); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, data, cleanup); + + if (*count == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + goto cleanup; + } + + halError = adrv903x_SpiWrite(device->common.devHalInfo, &data[0U], *count); + if (ADI_HAL_ERR_OK == halError) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + else + { + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ErrCodeConvert(halError); + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_DEVICEHAL, + ADI_ADRV903X_ERRCODE_HAL_SPI_WRITE, + recoveryAction, + halError, + "SPI Write Issue"); + goto cleanup; + } + + *count = 0U; + +cleanup : + ADI_ADRV903X_API_EXIT_QUIET(&device->common, recoveryAction); +} + +/** + * Defines certain memory regions on the device that are: + * - big endian + * - must be accessed at a 32bit aligned address + * - must be accessed with 32bit wide reads, writes. + * + * Each array element defines a single memory region. Each region consists of N memory areas as per adi_adrv903x_RegisterMap_t. + */ +static const adi_adrv903x_RegisterMap_t adrv903x_ThirtyTwoBitRegisterMapArray[] = +{ + /* First mem area startAddr, first area endAddr, num mem areas, offset between area start addrs */ + { (uint32_t)ADRV903X_ORX_ANALOG_ADC_ADDR_BASE, (uint32_t)(ADRV903X_ORX_ANALOG_ADC_ADDR_BASE + ADRV903X_ORX_ANALOG_ADC_REG_LEN), (uint32_t)ADI_ADRV903X_MAX_ORX, (uint32_t)ADRV903X_AHB_ADDR_STRIDE }, + { (uint32_t)ADRV903X_ORX_RAM_ADDR_BASE, (uint32_t)(ADRV903X_ORX_RAM_ADDR_BASE + ADRV903X_ORX_RAM_REG_LEN), (uint32_t)ADI_ADRV903X_MAX_ORX, (uint32_t)ADRV903X_AHB_ADDR_STRIDE }, + { (uint32_t)ADRV903X_RX_GAIN_TABLE_ADDR_BASE, (uint32_t)(ADRV903X_RX_GAIN_TABLE_ADDR_BASE + ADRV903X_RX_GAIN_TABLE_REG_LEN), (uint32_t)ADI_ADRV903X_MAX_RX_ONLY, (uint32_t)ADRV903X_AHB_ADDR_STRIDE }, + { (uint32_t)ADRV903X_TX_DPD_RAM_ADDR_BASE, (uint32_t)(ADRV903X_TX_DPD_RAM_ADDR_BASE + ADRV903X_TX_DPD_RAM_REG_LEN), (uint32_t)ADI_ADRV903X_MAX_TXCHANNELS, (uint32_t)ADRV903X_AHB_ADDR_STRIDE }, + { (uint32_t)ADRV903X_TX_ATTEN_TABLE_ADDR_BASE, (uint32_t)(ADRV903X_TX_ATTEN_TABLE_ADDR_BASE + ADRV903X_TX_ATTEN_TABLE_REG_LEN), (uint32_t)ADI_ADRV903X_MAX_TXCHANNELS, (uint32_t)ADRV903X_AHB_ADDR_STRIDE }, + { (uint32_t)ADRV903X_UART_ADDR_BASE, (uint32_t)(ADRV903X_UART_ADDR_BASE + ADRV903X_UART_REG_LEN), 1U, 0U }, + { (uint32_t)ADRV903X_SPI_MASTER_ADDR_BASE, (uint32_t)(ADRV903X_SPI_MASTER_ADDR_BASE + ADRV903X_SPI_MASTER_REG_LEN), 1U, 0U }, + { (uint32_t)ADRV903X_INTR_TSMTR_ADDR_BASE, (uint32_t)(ADRV903X_INTR_TSMTR_ADDR_BASE + ADRV903X_INTR_TSMTR_REG_LEN), 1U, 0U }, + { (uint32_t)ADRV903X_TELEMETRY_ADDR_BASE, (uint32_t)(ADRV903X_TELEMETRY_ADDR_BASE + ADRV903X_TELEMETRY_REG_LEN), 1U, 0U }, + { (uint32_t)ADRV903X_SEMAPHORE_ADDR_BASE, (uint32_t)(ADRV903X_SEMAPHORE_ADDR_BASE + ADRV903X_SEMAPHORE_ADDR_STRIDE), 32U, (uint32_t)ADRV903X_SEMAPHORE_ADDR_STRIDE } + }; + +/* + * Return ADI_TRUE if the entire adrv903x memory area starting at addr and of length numBytes lies within a 32bOnly region. + * + * Does not check alignment of the memory area. + */ +static uint8_t adrv903x_Is32BitAccess(const uint32_t addr, + const uint32_t numBytes) +{ + uint8_t sizeOfRegMapArray = (uint8_t)(sizeof(adrv903x_ThirtyTwoBitRegisterMapArray) / sizeof(adrv903x_ThirtyTwoBitRegisterMapArray[0])); + uint8_t is32BitAccess = 0U; + uint8_t i = 0U; + uint32_t j = 0U; + + for (i = 0U; i < sizeOfRegMapArray; i++) + { + for (j = 0U; j < adrv903x_ThirtyTwoBitRegisterMapArray[i].numOfInstances; j++) + { + if ((addr >= (adrv903x_ThirtyTwoBitRegisterMapArray[i].startAddr + (adrv903x_ThirtyTwoBitRegisterMapArray[i].strideValue * j))) && + (addr < (adrv903x_ThirtyTwoBitRegisterMapArray[i].endAddr + (adrv903x_ThirtyTwoBitRegisterMapArray[i].strideValue * j))) && + ((addr + numBytes - 1U) >= (adrv903x_ThirtyTwoBitRegisterMapArray[i].startAddr + (adrv903x_ThirtyTwoBitRegisterMapArray[i].strideValue * j))) && + ((addr + numBytes - 1U) < (adrv903x_ThirtyTwoBitRegisterMapArray[i].endAddr + (adrv903x_ThirtyTwoBitRegisterMapArray[i].strideValue * j)))) + { + is32BitAccess = 1U; + return is32BitAccess; + } + } + } + + return is32BitAccess; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Register32Write(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + uint32_t addr, + const uint32_t writeData, + const uint32_t mask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY_QUIET(&device->common); + + /* Re-write addresses so that writes to 0x4700'0000 - 0x4700'3FFF are done + * via the faster direct spi protocol. Possible as that memory region is aliased to 0x0 - 0x3FFF. */ + if ((addr >= SPI_ONLY_REGS_ADDR) && + (addr < (SPI_ONLY_REGS_ADDR + DIRECT_SPI_REGION_LEN) && + mask <= 0xFFU)) + { + addr -= SPI_ONLY_REGS_ADDR; + } + + recoveryAction = adi_adrv903x_Registers32Write(device, spiCache, &addr, &writeData, &mask, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32Write Issue"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT_QUIET(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Registers32Write(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr[], + const uint32_t writeData[], + const uint32_t mask[], + const uint32_t count) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint16_t SPI_PAGING = (uint16_t) DIRECT_SPI_REGION_LEN; + uint32_t i = 0U; + uint32_t numWrBytes = 0U; + uint8_t wrData[ADI_HAL_SPI_FIFO_SIZE] = { 0U }; + uint32_t *numWrBytesPtr = NULL; + uint8_t *wrDataPtr = NULL; + uint32_t writeData32 = 0U; + uint32_t writeMask32 = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY_QUIET(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, addr, cleanup); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, writeData, cleanup); + + if (spiCache == NULL) + { + wrDataPtr = &wrData[0U]; + numWrBytesPtr = &numWrBytes; + } + else + { + wrDataPtr = spiCache->data; + numWrBytesPtr = &spiCache->count; + } + + if (mask != NULL) + { + /* This is a scattered (non-contiguous) write: + * - each element of addr[] param indicates dest addr for each corresponding element in writeData[] param + * - each element of mask[] param indicates write mask for each corresponding element in writeData[] param + */ + for (i = 0U; i < count; ++i) + { + writeData32 = writeData[i]; + writeMask32 = mask[i]; + + if (adrv903x_Is32BitAccess(addr[i], 1U) == ADI_TRUE) + { + /* Address is a 32bOnly area use adi_adrv903x_Registers32bOnlyWrite */ + /* Manual flush so that we can call Registers32bOnlyWrite with a null spiCache */ + recoveryAction = adi_adrv903x_SpiFlush(device, wrDataPtr, numWrBytesPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush Issue"); + goto cleanup; + } + + if (mask[i] != 0xFFFFFFFFU) + { + /* Mask must be all Fs for 32bOnly regions */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + mask[i], + "Address is in 32bit register map, mask should be 0xFFFFFFFFU"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Registers32bOnlyWrite(device, + NULL, + addr[i], + (uint8_t*) &writeData32, + 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32bOnlyWrite Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "32-Bit Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32")", + addr[i], + writeData32); + } + else if (addr[i] < SPI_PAGING) + { + /* This is a scattered (non-contiguous) write to the Direct Area */ + if ((writeData32 & writeMask32) > 0xFFU) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + writeData, + "Overflow data on a Direct SPI write"); + goto cleanup; + } + if ((*numWrBytesPtr + ADRV903X_DIRECT_SPI_BYTES) > ADI_HAL_SPI_FIFO_SIZE) + { + recoveryAction = adi_adrv903x_SpiFlush( device, wrDataPtr, numWrBytesPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush Issue"); + goto cleanup; + } + } + + recoveryAction = adrv903x_DirectSpiDataPack(device, + wrDataPtr, + numWrBytesPtr, + addr[i], + writeMask32, + writeData32, + ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "Direct Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + addr[i], + writeData32, + writeMask32); + } + else + { + /* This is a scattered (non-contiguous) write to the AHB area. Uses paging. */ + if ((*numWrBytesPtr + ADRV903X_PAGING_SPI_BYTES) > ADI_HAL_SPI_FIFO_SIZE) + { + recoveryAction = adi_adrv903x_SpiFlush( device, wrDataPtr, numWrBytesPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush Issue"); + goto cleanup; + } + } + + recoveryAction = adrv903x_PagingSpiDataPack(device, + wrDataPtr, + numWrBytesPtr, + addr[i], + writeMask32, + writeData32, + ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Paging SPI Data Packing Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "Page Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + addr[i], + writeData32, + writeMask32); + } + } + } + else + { + /* mask == NULL => this is a contiguous write: + * - addr[0] is taken as the dest address. mask[] param is ignored. + * - writeData[0] is written to addr[0], writeData[1] is written to next address. + * Next address is addr + 1 for addrs in SPI_PAGING area. addr + 4 for others. + */ + + uint32_t baseAddr = addr[0U]; + + if (adrv903x_Is32BitAccess(baseAddr, 1U) == ADI_TRUE) + { + /* Address is a 32bOnly area use adi_adrv903x_Registers32bOnlyWrite */ + for (i = 0U; i < count; ++i) + { + writeData32 = writeData[i]; + /* Manual flush so that we can call Registers32bOnlyWrite with a null spiCache */ + recoveryAction = adi_adrv903x_SpiFlush(device, wrDataPtr, numWrBytesPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush Issue"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Registers32bOnlyWrite(device, + NULL, + baseAddr, + (uint8_t*) &writeData32, + 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32bOnlyWrite Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "32-Bit Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32")", + baseAddr, + writeData32); + + baseAddr = baseAddr + 4U; + } + } + else if (baseAddr < SPI_PAGING) + { + /* Contiguous/non-masked direct-area write. */ + for (i = 0U; i < count; ++i) + { + writeData32 = writeData[i]; + + if ((writeData32) > 0xFFU) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + writeData, + "Overflow data on a Direct SPI write"); + goto cleanup; + } + + if ((*numWrBytesPtr + ADRV903X_DIRECT_SPI_BYTES) > ADI_HAL_SPI_FIFO_SIZE) + { + recoveryAction = adi_adrv903x_SpiFlush( device, wrDataPtr, numWrBytesPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush Issue"); + goto cleanup; + } + } + + recoveryAction = adrv903x_DirectSpiDataPack(device, + wrDataPtr, + numWrBytesPtr, + baseAddr, + 0xFFU, + writeData32, + ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "Bulk Direct Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + baseAddr, + writeData32, + 0xFFU); + + baseAddr = baseAddr + 1U; + } + } + else + { + /* Contiguous/non-masked AHB write. Uses paging area. */ + for (i = 0U; i < count; ++i) + { + writeData32 = writeData[i]; + + if ((*numWrBytesPtr + ADRV903X_PAGING_SPI_BYTES) > ADI_HAL_SPI_FIFO_SIZE) + { + recoveryAction = adi_adrv903x_SpiFlush( device, wrDataPtr, numWrBytesPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush Issue"); + goto cleanup; + } + } + + recoveryAction = adrv903x_PagingSpiDataPack(device, + wrDataPtr, + numWrBytesPtr, + baseAddr, + 0xFFFFFFFFU, + writeData32, + ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Paging SPI Data Packing Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "Page Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + baseAddr, + writeData[i], + 0xFFFFFFFFU); + + baseAddr = baseAddr + 4U; + } + } + } + + if (spiCache == NULL) + { + recoveryAction = adi_adrv903x_SpiFlush( device, wrDataPtr, numWrBytesPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flushing Issue"); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT_QUIET(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Register32Read(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + uint32_t addr, + uint32_t* const readData, + const uint32_t mask) +{ + uint8_t readBytes[4] = { 0U, 0U, 0U, 0U }; + uint32_t count = 0U; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY_QUIET(&device->common); + + /* Re-write addresses so that writes to 0x4700'0000 - 0x4700'3FFF are done + * via the faster direct spi protocol. That memory region is aliased to 0x0 to 0x4000. */ + if((addr >= SPI_ONLY_REGS_ADDR) && + (addr < (SPI_ONLY_REGS_ADDR + DIRECT_SPI_REGION_LEN) && + mask <= 0xFFU)) + { + addr -= SPI_ONLY_REGS_ADDR; + } + + /* Lazy read with RegistersByteRead only the amount of bytes that the mask needs. + * It avoids 0xFF54 errors on the firmware side when adi_adrv903x_Register32Read + * is used in BfGet functions and simplifies SPI transactions */ + count = (mask <= 0xFFU) ? 1U : ((mask <= 0xFFFFU) ? 2U : ((mask <= 0xFFFFFFU) ? 3U : 4U)); + + recoveryAction = adi_adrv903x_RegistersByteRead(device, spiCache, addr, readBytes, NULL, count); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RegistersByteRead issue"); + goto cleanup; + } + + /* Device are LE; Convert host-endianness */ + *readData = ( ((uint32_t)readBytes[0] << 0U) | + ((uint32_t)readBytes[1] << 8U) | + ((uint32_t)readBytes[2] << 16U) | + ((uint32_t)readBytes[3] << 24U)); + *readData &= mask; + +cleanup : + ADI_ADRV903X_API_EXIT_QUIET(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Registers32Read(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr, + uint32_t readData[], + uint32_t mask[], + const uint32_t count) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_ErrAction_e exitRecoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint16_t SPI_PAGING = (uint16_t) DIRECT_SPI_REGION_LEN; + + uint32_t i = 0U; + uint32_t j = 0U; + uint32_t localCacheCount = 0U; /* Number of total bytes packed into the byte array for SPI transactions */ + uint32_t currentRdCount = 0U; /* Number of registers that are to be read in the current byte array. Different than localCacheCount b/c it doesn't include address packing */ + uint32_t readDataIndex = 0U; /* The current index in readData where data should be placed after it is read. Since it's possible multiple SPI transactions can occur based on the number of bytes requested */ + uint8_t localCache[ADI_HAL_SPI_FIFO_SIZE] = { 0U }; + uint32_t currentAddress = addr; /* In the case when we need to flush in the middle of byte packing we need to keep track of where the next buffer will start from */ + uint8_t *readDataBytes; /* Used to cast readData array to a byte array */ + uint8_t parsedDataStride = 0U; /* Used when parsing data to determine where the next register value should be placed in readData */ + uint32_t lastByteBool = 0U; + uint32_t disableAutoIncrement = 0U; + const uint32_t numRegistersToRead = count; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY_QUIET(&device->common); + + if (device->common.wrOnly == ADI_TRUE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE; + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_DEVICEHAL, + ADI_ADRV903X_ERRCODE_HAL_INVALID_DEVICE_STATE, + recoveryAction, + device->common.wrOnly, + "Device is currently in write-only mode"); + goto cleanup; + } + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, readData, cleanup); + + readDataBytes = (uint8_t *)readData; + + if (spiCache != NULL) + { + /* spiCache is a parameter to this function as a convenience. It is only used to flush any previous writes that have been cached. */ + recoveryAction = adi_adrv903x_SpiFlush( device, spiCache->data, &spiCache->count); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flushing Issue"); + goto cleanup; + } + } + + if (adrv903x_Is32BitAccess(addr, numRegistersToRead * 4) == ADI_TRUE) + { + /* Address is a 32bOnly area use adi_adrv903x_Registers32bOnlyRead */ + for (i = 0U; i < numRegistersToRead; ++i) + { + if ((mask != NULL) && (mask[i] != 0xFFFFFFFFU)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + mask, + "Address is in 32bit register map, mask should be 0xFFFFFFFFU"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Registers32bOnlyRead( device, + NULL, + addr + (4U * i), + (uint8_t*) &readData[i], + 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32bOnlyRead Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "32-Bit Read( Address: 0x%08" PRIX32" Data: 0x%08" PRIX32")", + (addr + (4U * i)), + readData[i]); + } + /* There is no need to fix up endianess like in the 'addr < SPI_PAGING' and 'non-32bOnly' scenarios + * as adi_adrv903x_Registers32bOnlyRead has already done it. */ + } + else if (addr < SPI_PAGING) + { + /* For Direct SPI we're processing bytes that need to be indexed into a uint32_t array */ + parsedDataStride = 4U; /* Each byte read from device is copied an element of uint32_t readData[] */ + + for (i = 0U; i < numRegistersToRead; ++i) + { + /* For direct SPI reads we can handle any number of bytes and only initiate a SPI transaction when the + * buffer is full or after we've packed all the reads together */ + if ((localCacheCount + ADRV903X_DIRECT_SPI_BYTES) > ADI_HAL_SPI_FIFO_SIZE) + { + recoveryAction = adrv903x_FlushParse( device, + localCache, + localCacheCount, + &readDataBytes[readDataIndex * parsedDataStride], + currentRdCount, + parsedDataStride); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AHB Flushing issue."); + goto cleanup; + } + localCacheCount = 0U; + readDataIndex += currentRdCount; + currentRdCount = 0U; + } + + recoveryAction = adrv903x_DirectSpiDataPack(device, + localCache, + &localCacheCount, + currentAddress, + 0xFFU, + 0x00U, + ~ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Pack Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "Direct Read (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + currentAddress, + readDataBytes[readDataIndex * parsedDataStride], + 0xFFU); + + /* Keeping track of how many registers in this localCache instance. + * This will get cleared on a all to adrv_FlushParse. + * */ + currentRdCount++; + + /* Keeping track of which AHB address we're looking at. + * This will NOT get cleared on a all to adrv_FlushParse. + * */ + currentAddress++; + } + + recoveryAction = adrv903x_FlushParse( device, + localCache, + localCacheCount, + &readDataBytes[readDataIndex * parsedDataStride], + currentRdCount, + parsedDataStride); + + for (i = 0; i < numRegistersToRead; ++i) + { + readData[i] = ADRV903X_CTOHL(readData[i]); + } + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AHB Flushing issue."); + goto cleanup; + } + } + else + { + /* Src addr is AHB region. We are processing bytes and treating the readData array as a byte array */ + parsedDataStride = 1U; + + /* Pack the ctrl and first addr then flush to write immediately */ + /* Using the configCache to keep things separate */ + recoveryAction = adrv903x_IndirectReadSetup(device, device->devStateInfo.spiOptions.allowAhbAutoIncrement); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "DMA Ctrl Issue"); + goto cleanup; + } + + /* No matter what we always need to set the address for the first read. */ + recoveryAction = adrv903x_DmaAddrSet(device, currentAddress); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "DMA Address Pack Issue"); + goto cleanup; + } + + for (i = 0U; i < numRegistersToRead; ++i) + { + + if ((localCacheCount + (ADRV903X_DIRECT_SPI_BYTES * 4U)) > ADI_HAL_SPI_FIFO_SIZE) + { + recoveryAction = adrv903x_FlushParse( device, + localCache, + localCacheCount, + &readDataBytes[readDataIndex], + currentRdCount, + parsedDataStride); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AHB Flushing issue."); + goto cleanup; + } + localCacheCount = 0U; + readDataIndex += currentRdCount; + currentRdCount = 0U; + } + + /* This loops reads each byte of the current 32-bit AHB register */ + for (j = 0U; j < 4U; j++) + { + lastByteBool = (i == (numRegistersToRead - 1)) && (j == 3); + disableAutoIncrement = (i == (numRegistersToRead - 1)) && (j == 2); + + recoveryAction = adrv903x_DirectSpiDataPack(device, localCache, &localCacheCount, ADRV903X_ADDR_SPIDMA0_DATA0, 0xFF, 0x00, ~ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "Page Read (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + currentAddress, + readDataBytes[readDataIndex], + 0xFFU); + + /* Keeping track of how many registers in this localCache instance. + * This will get cleared on a all to adrv_FlushParse. + * */ + ++currentRdCount; + + /* Keeping track of which AHB address we're looking at. + * This will NOT get cleared on a all to adrv_FlushParse. + * */ + ++currentAddress; + + /* Cases where we need to flush prior to reading next word: + * - SPI streaming WITHOUT Spi FIFO mode enabled + * - because reading the same register over & over again will throw an error + * in SPI streaming + * - auto-increment is turned off + * - because we need to set the address for the next byte + * */ + if (((device->devStateInfo.spiStreamingOn == 1U) && (device->devStateInfo.spiFifoModeOn == 0U)) || + (device->devStateInfo.autoIncrModeOn == 0U)) + { + recoveryAction = adrv903x_FlushParse( device, + localCache, + localCacheCount, + &readDataBytes[readDataIndex], + currentRdCount, + parsedDataStride); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AHB Flushing issue."); + goto cleanup; + } + localCacheCount = 0U; + readDataIndex += currentRdCount; + currentRdCount = 0U; + } + + /* Set the address on the first byte or each time if auto-increment is off. + * This also ensures we will NOT set the address when SPI FIFO mode because we cannot + * be in SPI FIFO mode with auto increment off. + * */ + if ((lastByteBool == 0U) && (device->devStateInfo.autoIncrModeOn == 0U)) + { + recoveryAction = adrv903x_DmaAddrSet(device, currentAddress); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "DMA Address Pack Issue"); + goto cleanup; + } + } + else if (disableAutoIncrement == 1U) + { + /* auto-increment can cause invalid memory regions to be accessed. + * Because of that, on the final word to read turn off auto increment. + */ + recoveryAction = adrv903x_FlushParse( device, + localCache, + localCacheCount, + &readDataBytes[readDataIndex], + currentRdCount, + parsedDataStride); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AHB Flushing issue."); + goto cleanup; + } + localCacheCount = 0U; + readDataIndex += currentRdCount; + currentRdCount = 0U; + + /* Pack the ctrl and first addr then flush to write immediately */ + /* Using the configCache to keep things separate */ + recoveryAction = adrv903x_IndirectReadSetup(device, ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "DMA Ctrl Issue"); + goto cleanup; + } + } + } /* foreach byte of 32bit register */ + } /* foreach 32bit register to read */ + + /* Final flush before exit in case there's still cached up reads. */ + if (localCacheCount != 0U) + { + recoveryAction = adrv903x_FlushParse( device, + localCache, + localCacheCount, + &readDataBytes[readDataIndex], + currentRdCount, + parsedDataStride); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AHB Flushing issue."); + goto cleanup; + } + } + + /* Convert endianess all AHB register reads from device to host byte-order */ + for (i = 0; i < numRegistersToRead; i++) + { + readData[i] = ADRV903X_CTOHL(readData[i]); + } + } + + /* Clean up the data for the following cases: + * - If masking is required + */ + if (mask != NULL) + { + for (i = 0U; i < numRegistersToRead; ++i) + { + readData[i] &= mask[i]; + } + } + +cleanup: + if (addr >= SPI_PAGING) + { + /* Reset any indirect configurations if used. */ + exitRecoveryAction = adrv903x_IndirectReadTeardown(device); + if (ADI_ADRV903X_ERR_ACT_NONE != exitRecoveryAction) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_INTERFACE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Exit Issue"); + } + } + + ADI_ADRV903X_API_EXIT_QUIET(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RegistersByteWrite(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr, + const uint8_t writeData[], + const uint32_t count) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint16_t SPI_PAGING = (uint16_t) DIRECT_SPI_REGION_LEN; + uint32_t i = 0U; + uint32_t numWrBytes = 0U; + uint8_t wrData[ADI_HAL_SPI_FIFO_SIZE] = {0U}; + uint32_t *numWrBytesPtr = NULL; + uint8_t *wrDataPtr = NULL; + uint32_t baseAddr = addr; + uint32_t wordWriteCount = 0U; /* Word Write Count */ + uint32_t wordWriteIndex = 0U; /* Word Write Index */ + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY_QUIET(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, writeData, cleanup); + + if (spiCache == NULL) + { + wrDataPtr = &wrData[0U]; + numWrBytesPtr = &numWrBytes; + } + else + { + wrDataPtr = spiCache->data; + numWrBytesPtr = &spiCache->count; + } + + if (adrv903x_Is32BitAccess(addr, count) == ADI_TRUE) + { + /* Write to 32bOnly area */ + /* Calculate Number of 32 Bit Register Write Transactions Required */ + if ((count & 3U) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, count, "32-Bit Access Requires Count to be Multiples of 4"); + goto cleanup; + } + + wordWriteCount = count >> 2U; + wordWriteIndex = wordWriteCount - 1U; + + /* Manual flush so that we can call Registers32bOnlyWrite with a null spiCache */ + recoveryAction = adi_adrv903x_SpiFlush(device, wrDataPtr, numWrBytesPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush Issue"); + goto cleanup; + } + + for (i = 0U; i < wordWriteCount; ++i) + { + recoveryAction = adi_adrv903x_Registers32bOnlyWrite(device, + NULL, + addr + (4U * wordWriteIndex), + &writeData[4U * wordWriteIndex], + 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32bOnlyRead Issue"); + goto cleanup; + } + ++wordWriteIndex; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "32-Bit Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32")", + addr, + writeData); + } + else if (baseAddr < SPI_PAGING) + { + /* Write to direct area */ + for (i = 0U; i < count; ++i) + { + if ((*numWrBytesPtr + ADRV903X_DIRECT_SPI_BYTES) > ADI_HAL_SPI_FIFO_SIZE) + { + recoveryAction = adi_adrv903x_SpiFlush(device, wrDataPtr, numWrBytesPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush Issue"); + goto cleanup; + } + } + + recoveryAction = adrv903x_DirectSpiDataPack(device, + wrDataPtr, + numWrBytesPtr, + baseAddr, + 0xFFU, + writeData[i], + ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "Direct Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + baseAddr, + writeData[i], + 0xFFU); + + baseAddr = baseAddr + 1U; + } + } + else + { + /* Write to AHB address. Uses paging. */ + for (i = 0U; i < count; ++i) + { + if ((*numWrBytesPtr + ADRV903X_PAGING_SPI_BYTES) > ADI_HAL_SPI_FIFO_SIZE) + { + recoveryAction = adi_adrv903x_SpiFlush(device, wrDataPtr, numWrBytesPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush Issue"); + goto cleanup; + } + } + + recoveryAction = adrv903x_PagingSpiDataPack(device, + wrDataPtr, + numWrBytesPtr, + baseAddr, + 0xFFU, + (uint32_t) writeData[i], + ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Paging SPI Data Packing Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "Page Write (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + baseAddr, + writeData[i], + 0xFFU); + + baseAddr = baseAddr + 1U; + } + } + + if (adrv903x_Is32BitAccess(addr, count) != ADI_TRUE) + { + if (spiCache == NULL) + { + recoveryAction = adi_adrv903x_SpiFlush(device, wrDataPtr, numWrBytesPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flushing Issue"); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT_QUIET(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RegistersByteRead(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr, + uint8_t readData[], + const uint8_t mask[], + const uint32_t count) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_ErrAction_e exitRecoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint16_t SPI_PAGING = (uint16_t) DIRECT_SPI_REGION_LEN; + + uint32_t i = 0U; + uint32_t localCacheCount = 0U; /* Number of total bytes packed into the byte array for SPI transactions */ + uint32_t currentRdCount = 0U; /* Number of registers that are to be read in the current byte array. Different than localCacheCount b/c it doesn't include address packing */ + uint32_t readDataIndex = 0U; /* The current index in readData where data should be placed after it is read. Since it's possible multiple SPI transactions can occur based on the number of bytes requested */ + uint8_t localCache[ADI_HAL_SPI_FIFO_SIZE] = { 0U }; + uint32_t currentAddress = 0U; /* In the case when we need to flush in the middle of byte packing we need to keep track of where the next buffer will start from */ + uint8_t *readDataBytes; /* Used to cast readData array to a byte array */ + uint8_t parsedDataStride = 0U; /* Used when parsing data to determine where the next register value should be placed in readData */ + uint32_t wordReadCount = 0U; /* Word Read Count */ + uint32_t addrActual = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY_QUIET(&device->common); + + /* Re-write addresses so that writes to 0x4700'0000 - 0x4700'3FFF are done + * via the faster direct spi protocol. Possible as that memory region is aliased to 0x0 to 0x4000. */ + if ((addr >= SPI_ONLY_REGS_ADDR) && + (addr < (SPI_ONLY_REGS_ADDR + DIRECT_SPI_REGION_LEN))) + { + addrActual = addr - SPI_ONLY_REGS_ADDR; + } + else + { + addrActual = addr; + } + + currentAddress = addrActual; + + if (device->common.wrOnly == ADI_TRUE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE; + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_DEVICEHAL, + ADI_ADRV903X_ERRCODE_HAL_INVALID_DEVICE_STATE, + recoveryAction, + device->common.wrOnly, + "Device is currently in write-only mode"); + goto cleanup; + } + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, readData, cleanup); + + readDataBytes = (uint8_t *)readData; + + if (spiCache != NULL) + { + /* spiCache is a parameter to this function as a convenience. It is only used to flush any previous writes that have been cached. */ + recoveryAction = adi_adrv903x_SpiFlush( device, spiCache->data, &spiCache->count); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flushing Issue"); + goto cleanup; + } + } + + if (adrv903x_Is32BitAccess(addrActual, count) == ADI_TRUE) + { + /* Calculate Number of 32 Bit Register Read Transactions Required */ + if ((count & 3U) != 0U) + { + wordReadCount = (count >> 2U) + 1U; + } + else + { + wordReadCount = count >> 2U; + } + + for (i = 0U; i < wordReadCount; ++i) + { + /* Address is in the 32b register maps, force adi_adrv903x_Registers32bOnlyRead */ + if ((mask != NULL) && (mask[i] != 0xFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + mask, + "Address is in 32bit register map, mask should be 0xFFFFFFFF"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Registers32bOnlyRead( device, + NULL, + addrActual + (4U * i), + &readData[(4U * i)], + 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32bOnlyRead Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "32-Bit Read (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32")", + (addrActual + (4U * i)), + readData[(4U * i)]); + } + } + else if (addrActual < SPI_PAGING) + { + /* For Direct SPI we're processing bytes that need to be indexed into a uint8_t array */ + parsedDataStride = 1U; + + for (i = 0U; i < count; ++i) + { + /* For direct SPI reads we can handle any number of bytes and only initiate a SPI transaction when the buffer is full + * or after we've packed all the reads together */ + if ((localCacheCount + ADRV903X_DIRECT_SPI_BYTES) > ADI_HAL_SPI_FIFO_SIZE) + { + recoveryAction = adrv903x_FlushParse(device, + localCache, + localCacheCount, + &readDataBytes[readDataIndex * parsedDataStride], + currentRdCount, + parsedDataStride); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AHB Flushing issue."); + goto cleanup; + } + localCacheCount = 0U; + readDataIndex += currentRdCount; + currentRdCount = 0U; + } + + recoveryAction = adrv903x_DirectSpiDataPack(device, + localCache, + &localCacheCount, + currentAddress, + 0xFFU, + 0x00U, + ~ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Pack Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "Direct Read (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + currentAddress, + readDataBytes[readDataIndex * parsedDataStride], + 0xFFU); + + /* Keeping track of how many registers in this localCache instance. + * This will get cleared on a all to adrv_FlushParse. + * */ + ++currentRdCount; + + /* Keeping track of which AHB address we're looking at. + * This will NOT get cleared on a all to adrv_FlushParse. + * */ + ++currentAddress; + } + + recoveryAction = adrv903x_FlushParse(device, + localCache, + localCacheCount, + &readDataBytes[readDataIndex * parsedDataStride], + currentRdCount, + parsedDataStride); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AHB Flushing issue."); + goto cleanup; + } + } + else /* Paging/AHB region must use the AHB indirect interface */ + { + /* For AHB we're processing bytes and treating the readData array as a byte array + * */ + parsedDataStride = 1U; + + /* auto-increment can cause invalid memory regions to be accessed. + * Because of that, on the final word to read turn off auto increment. + * This logic also prevents auto-increment from being used when count == 1 + * */ + if (count == 1U) + { + /* Pack the ctrl and first addr then flush to write immediately */ + /* Using the configCache to keep things separate */ + recoveryAction = adrv903x_IndirectReadSetup(device, ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "DMA Ctrl Issue"); + goto cleanup; + } + } + else if (i == 0U) + { + /* Pack the ctrl and first addr then flush to write immediately */ + /* Using the configCache to keep things separate */ + recoveryAction = adrv903x_IndirectReadSetup(device, device->devStateInfo.spiOptions.allowAhbAutoIncrement); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "DMA Ctrl Issue"); + goto cleanup; + } + } + + /* No matter what we always need to set the address for the first read. */ + recoveryAction = adrv903x_DmaAddrSet(device, currentAddress); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "DMA Address Pack Issue"); + goto cleanup; + } + + for (i = 0U; i < count; ++i) + { + + if ((localCacheCount + (ADRV903X_DIRECT_SPI_BYTES)) > ADI_HAL_SPI_FIFO_SIZE) + { + recoveryAction = adrv903x_FlushParse(device, + localCache, + localCacheCount, + &readDataBytes[readDataIndex], + currentRdCount, + parsedDataStride); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AHB Flushing issue."); + goto cleanup; + } + localCacheCount = 0U; + readDataIndex += currentRdCount; + currentRdCount = 0U; + } + + recoveryAction = adrv903x_DirectSpiDataPack(device, localCache, &localCacheCount, ADRV903X_ADDR_SPIDMA0_DATA0, 0xFF, 0x00, ~ADRV903X_SPI_WRITE_POLARITY); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Direct SPI Data Packing Issue"); + goto cleanup; + } + + ADI_VARIABLE_LOG( &device->common, + ADI_HAL_LOG_SPI, + "Page Read (Address: 0x%08" PRIX32" Data: 0x%08" PRIX32" Mask: 0x%08" PRIX32")", + currentAddress, + readDataBytes[readDataIndex], + 0xFFU); + + /* Keeping track of how many registers in this localCache instance. + * This will get cleared on a all to adrv_FlushParse. + * */ + ++currentRdCount; + + /* Keeping track of which AHB address we're looking at. + * This will NOT get cleared on a all to adrv_FlushParse. + * */ + ++currentAddress; + + /* Cases where we need to flush prior to reading next word: + * - SPI streaming WITHOUT Spi FIFO mode enabled + * - because reading the same register over & over again will throw an error + * in SPI streaming + * - auto-increment is turned on and second to last byte has been cached + * - because the last byte needs to be read with autoincrement disabled to avoid + * writing illegal addresses into the AHB bus + * - auto-increment is turned off + * - because we need to set the address for the next byte + * */ + if (((device->devStateInfo.spiStreamingOn == 1U) && (device->devStateInfo.spiFifoModeOn == 0U)) || + ((device->devStateInfo.autoIncrModeOn == 1U) && i == (count - 2U)) || + (device->devStateInfo.autoIncrModeOn == 0U)) + { + recoveryAction = adrv903x_FlushParse(device, + localCache, + localCacheCount, + &readDataBytes[readDataIndex], + currentRdCount, + parsedDataStride); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AHB Flushing issue."); + goto cleanup; + } + + localCacheCount = 0U; + readDataIndex += currentRdCount; + currentRdCount = 0U; + } + + /* Set the address on the first byte or each time if auto-increment is off. + * This also ensures we will NOT set the address when SPI FIFO mode because we cannot + * be in SPI FIFO mode with auto increment off. + * Does not need to be done on the last iteration. + */ + if ((device->devStateInfo.autoIncrModeOn == 0U) && (i < (count - 1U))) + { + recoveryAction = adrv903x_DmaAddrSet(device, currentAddress); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "DMA Address Pack Issue"); + goto cleanup; + } + } + else if ((device->devStateInfo.autoIncrModeOn == 1U) && (i == (count - 2U))) + { + /* (count - 1) cached reads have been flushed and auto-increment should be disabled + * for the last byte read to avoid invalid memory regions to be accessed. + */ + recoveryAction = adrv903x_IndirectReadSetup(device, ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "DMA Ctrl Issue"); + goto cleanup; + } + } + } + + if (adrv903x_Is32BitAccess(addrActual, count) != ADI_TRUE) + { + /* Final flush before exit in case there's still cached up reads. */ + if (localCacheCount != 0U) + { + recoveryAction = adrv903x_FlushParse(device, + localCache, + localCacheCount, + &readDataBytes[readDataIndex], + currentRdCount, + parsedDataStride); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "AHB Flushing issue."); + goto cleanup; + } + } + } + } + + /* Clean up the data for the following cases: + * - If masking is required + */ + if (mask != NULL) + { + for (i = 0U; i < count; ++i) + { + readData[i] &= mask[i]; + } + } + +cleanup: + if (addrActual >= SPI_PAGING) + { + /* Reset any indirect configurations if used. */ + exitRecoveryAction = adrv903x_IndirectReadTeardown(device); + if (ADI_ADRV903X_ERR_ACT_NONE != exitRecoveryAction) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_INTERFACE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Exit Issue"); + } + } + + ADI_ADRV903X_API_EXIT_QUIET(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Registers32bOnlyRead(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr, + uint8_t readData[], + const uint32_t count) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, readData); + + ADI_ADRV903X_API_ENTRY_QUIET(&device->common); + + recoveryAction = adrv903x_Registers32bOnlyRead_vEndian(device, + spiCache, + addr, + readData, + count, + 0U); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adrv903x_Registers32bOnlyRead_vEndian failed"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT_QUIET(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_Registers32bOnlyWrite(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const uint32_t addr, + const uint8_t writeData[], + const uint32_t count) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t i = 0U; /* loop index */ + uint32_t j = 0U; /* loop index */ + uint32_t dataAligned32 = 0U; + uint8_t *dataAligned8 = (uint8_t*) &dataAligned32; /* Alias to dataAligned32 usable where uint8_t* arg is required */ + const uint32_t numBytesToWrite = count; + + /* read/wrb | sys_codeb | bus_waiting | bus_response | bus_size[1] | bus_size[0] | auto_incr | bus_sel */ + /* 0 0 0 0 1 0 0 0 */ + uint8_t spiDmaCtl[1U] = { 0x08U }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, writeData); + + ADI_ADRV903X_API_ENTRY_QUIET(&device->common); + + if (spiCache != NULL) + { + recoveryAction = adi_adrv903x_SpiFlush(device, spiCache->data, &spiCache->count); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush Issue After CPU Mailbox Buffer Write"); + goto cleanup; + } + } + + /* Range check: is the address one that requires a 32-bit transactions? + * does addr + count - 4 lie within valid range? + */ + recoveryAction = adrv903x_ThirtyTwoBitAhbAccessRangeCheck(device, addr, numBytesToWrite); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Range check failed. Address does not require a 32-bit SPI transaction."); + goto cleanup; + } + + /* Write the DMA control register */ + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_SPIDMA0_CTL, spiDmaCtl, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to the spi dma control register."); + goto cleanup; + } + + for (i = 0U; i < (numBytesToWrite / 4U); ++i) + { + /* Write the bus address */ + recoveryAction = adrv903x_DmaAddrSet(device, addr + (4U * i)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to the spi dma address registers."); + goto cleanup; + } + + /* Ensure data is word aligned before using endianess macro */ + for (j = 0U; j < 4U; ++j) + { + dataAligned8[j] = writeData[(i * 4U) + j]; + } + + /* Data to be written to the DMA register must be big-endian */ + dataAligned32 = ADRV903X_HTONL(dataAligned32); + + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_SPIDMA0_DATA3, dataAligned8, 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to the spi dma data registers."); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT_QUIET(&device->common, recoveryAction); + +} + +/* + * Return ADI_ADRV903X_ERR_ACT_NONE if the entire adrv903x memory area starting at addr and of length numBytes lies + * within a 32bOnly region and the start & end of the memory area is 4-byte aligned and the memory region is not + * zero length. + */ +static adi_adrv903x_ErrAction_e adrv903x_ThirtyTwoBitAhbAccessRangeCheck(adi_adrv903x_Device_t* const device, + const uint32_t addr, + const uint32_t numBytes) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + /* check that the count value is a multiple of 4 and not equal to 0U*/ + if (numBytes % 4U != 0U || + ((addr + numBytes - 4U) % 4U != 0U) || + numBytes == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numBytes, "The count parameter must greater than 0 and be a multiple of four."); + return recoveryAction; + } + + if (adrv903x_Is32BitAccess(addr, numBytes) != ADI_TRUE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numBytes, "The address range is not completely in a 32-bit AHB region."); + return recoveryAction; + } + + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, addr, "The specified memory location does not require the use of 32-bit SPI transactions."); + return recoveryAction; + } + + return recoveryAction; +} diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_radioctrl.c b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_radioctrl.c new file mode 100644 index 0000000000000..13af3d06d62a6 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_radioctrl.c @@ -0,0 +1,4438 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_radioctrl.c +* \brief Contains CPU features related function implementation defined in +* adi_adrv903x_radioctrl.h +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#include "adi_adrv903x_radioctrl.h" +#include "adi_adrv903x_cals.h" +#include "adi_adrv903x_cpu.h" +#include "adi_adrv903x_tx.h" +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_types.h" +#include "adi_adrv903x_version_types.h" + +#include "../../private/include/adrv903x_radioctrl.h" +#include "../../private/bf/adrv903x_bf_pll_mem_map.h" +#include "../../private/include/adrv903x_cpu_scratch_registers.h" +#include "../../private/include/adrv903x_cpu.h" +#include "../../private/include/adrv903x_rx.h" +#include "../../private/include/adrv903x_tx.h" +#include "../../private/include/adrv903x_gpio.h" +#include "../../private/include/adrv903x_radioctrl.h" +#include "../../private/bf/adrv903x_bf_tx_funcs.h" +#include "../../private/bf/adrv903x_bf_streamproc.h" +#include "../../private/include/adrv903x_init.h" +#include "../../private/include/adrv903x_stream_proc_types.h" + + +#define ADI_FILE ADI_ADRV903X_FILE_PUBLIC_RADIOCTRL + + +/**************************************************************************** + * Helper functions + **************************************************************************** + */ + +/** +* \brief Based off the structure of the stream_image.bin this function extracts +* the size and offset of a single slice processor. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param binary Pointer to the start of slice data in stream_image.bin +* \param binaryImageSize Pointer to a short where the slice size in bytes will be placed +* \param binaryImageOffset Pointer to a short that will store the slice image offset +* in the stream_image.bin file +*/ +static void adrv903x_BinaryImageInfoGet(const uint8_t binary[], + uint32_t* const binaryImageSize, + uint32_t* const binaryImageOffset) +{ + /* populating variables from binary array */ + *binaryImageSize = ((((uint32_t)binary[3U]) << 24U) | (((uint32_t)binary[2U]) << 16U) | (((uint32_t)binary[1U]) << 8U) | ((uint32_t)binary[0U])); + *binaryImageOffset = ((((uint32_t)binary[7U]) << 24U) | (((uint32_t)binary[6U]) << 16U) | (((uint32_t)binary[5U]) << 8U) | ((uint32_t)binary[4U])); +} + +/** +* \brief Based off the structure of the stream_image.bin this function extracts +* the base address of a single slice. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param binary Pointer to the start of slice image in stream_image.bin +* \param word Pointer to a word where the slice base address will be stored +*/ +static void adrv903x_BinaryParamsGetBaseAddr(const uint8_t binary[], uint32_t* const word) +{ + /* populating variables from binary array */ + *word = (((uint32_t)binary[3U]) << 24U) | (((uint32_t)binary[2U]) << 16U) | (((uint32_t)binary[1U]) << 8U) | (uint32_t)(binary[0U]); +} + +/** +* \brief Based off the structure of the stream_image.bin this function extracts +* the number of streams and slice image size. +* +* \dep_begin +* \dep{device->common.devHalInfo} +* \dep_end +* +* \param binary Pointer to the start of slice image in stream_image.bin +* \param numberStreams Pointer to a byte that will store the number of streams for this slice +* \param imageSize Pointer to a short that will store the slice size in bytes +*/ +static void adrv903x_BinaryParamsGetNumberStreamImageSize( const uint8_t binary[], + uint8_t* const numberStreams, + uint32_t* const imageSize) +{ + *numberStreams = binary[0U]; + *imageSize = (((uint32_t)binary[3U]) << 8) | (uint32_t)(binary[2U]); +} + +static adi_adrv903x_GpioPinSel_e adrv903x_StreamGleanGpioNumberGet(uint32_t gpioSelectionArr[], adrv903x_StreamGpioFeatureSelection_e featureSelect) +{ + uint32_t gpioIdx = 0U; + + if (gpioSelectionArr == NULL) + { + return ADI_ADRV903X_GPIO_INVALID; + } + + switch (featureSelect) + { + case ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT0: + case ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT1: + case ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT2: + case ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT3: + case ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT4: + case ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT5: + case ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT6: + case ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT7: + break; + + case ADRV903X_STREAM_GPIO_TX_ANTENNA_CAL: + case ADRV903X_STREAM_GPIO_RX_ANTENNA_CAL: + case ADRV903X_STREAM_GPIO_TX_PAP_FOR_EXT_LO0_UNLOCK: + case ADRV903X_STREAM_GPIO_TX_PAP_FOR_EXT_LO1_UNLOCK: + /* Fall Through */ + + default: + return ADI_ADRV903X_GPIO_INVALID; + break; + } + + for (gpioIdx = 0U; gpioIdx < ADI_ADRV903X_GPIO_COUNT; gpioIdx++) + { + if (gpioSelectionArr[gpioIdx] == (uint32_t)featureSelect) + { + return (adi_adrv903x_GpioPinSel_e)gpioIdx; + } + } + + return ADI_ADRV903X_GPIO_INVALID; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StreamImageWrite(adi_adrv903x_Device_t* const device, + uint32_t byteOffset, + const uint8_t binary[], + uint32_t byteCount) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t binaryImageSize = 0U; + uint32_t binaryImageOffset = 0U; + uint32_t i = 0U; + uint32_t addr = 0U; + uint32_t mask = 0U; + uint32_t word1 = 0U; + uint32_t binOffset = 0U; + uint32_t streamCtl = 0U; + uint8_t byte1 = 0U; + uint32_t imageSize = 0U; + uint32_t imageOffset = 0U; + uint32_t streamCtlAddr[] = { + ADRV903X_ADDR_MAIN_STREAM_CTL, + //todo- this value needs to be update when the kfa stream_reset bit is enabled + ADRV903X_ADDR_KFA_STREAM_CTL, + ADRV903X_ADDR_TX0_STREAM_CTL, + ADRV903X_ADDR_TX1_STREAM_CTL, + ADRV903X_ADDR_TX2_STREAM_CTL, + ADRV903X_ADDR_TX3_STREAM_CTL, + ADRV903X_ADDR_TX4_STREAM_CTL, + ADRV903X_ADDR_TX5_STREAM_CTL, + ADRV903X_ADDR_TX6_STREAM_CTL, + ADRV903X_ADDR_TX7_STREAM_CTL, + ADRV903X_ADDR_RX0_STREAM_CTL, + ADRV903X_ADDR_RX1_STREAM_CTL, + ADRV903X_ADDR_RX2_STREAM_CTL, + ADRV903X_ADDR_RX3_STREAM_CTL, + ADRV903X_ADDR_RX4_STREAM_CTL, + ADRV903X_ADDR_RX5_STREAM_CTL, + ADRV903X_ADDR_RX6_STREAM_CTL, + ADRV903X_ADDR_RX7_STREAM_CTL, + ADRV903X_ADDR_ORX0_STREAM_CTL, + ADRV903X_ADDR_ORX1_STREAM_CTL + }; + + /* Default value assigned by hardware */ + uint32_t coreSliceControlDefaultVal = 0x80U; + + /* Number of bytes in the stream_image.bin header that contains + * all the meta-data required to parse stream_image.bin + * This also indicates the byte address where the core processor + * starts. + */ + static const uint32_t STREAM_METADATA_HEADER_SIZE_START_BYTE = 24U; + static const uint32_t STREAM_METADATA_HEADER_SIZE_DATA_LENGTH = 4U; + static const uint32_t STREAM_IMAGE_SLICE_INFO_START_BYTE = 28U; + static const uint32_t STREAM_PROCESSOR_META_DATA_SIZE_BYTES = 8U; + static const uint32_t STREAM_IMAGE_GPIO00_START_BYTE = 190U; + static const uint32_t STREAM_IMAGE_TXORXMAPPINGMODE_START_BYTE = 287U; + static const uint32_t STREAM_IMAGE_TXORXOBSERVABILITY_START_BYTE = 289U; + static const uint32_t STREAM_IMAGE_TXTOORXMAPPINGPINTABLEORX0_00_START_BYTE = 291U; + static const uint32_t STREAM_IMAGE_TXTOORXMAPPINGPINTABLEORX1_00_START_BYTE = 355U; + static const uint32_t STREAM_IMAGE_TXTOORXMAPPINAUTOSWITCHORXATTENENABLE_START_BYTE = 419U; + static const uint32_t STREAM_IMAGE_TXTOORXMAPPINAUTOSWITCHORXNCOENABLE_START_BYTE = 420U; + + uint32_t FINAL_STREAM_IMAGE_HEADER_SIZE_BYTES = 0U; + + uint32_t gpioAssignments[ADI_ADRV903X_GPIO_COUNT] = { 0U }; + uint32_t gpioIdx = 0U; + uint32_t idx = 0U; + + + /* CPU stream download order: main, kfa, tx0/1/2/3/4/5/6/7, rx0/1/2/3/4/5/6/7, orx0/1 */ + static const uint32_t streamChannel[] = { + 0xFFFFFFFFU, + 0x0U, + ADI_ADRV903X_TX0 << ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET, + ADI_ADRV903X_TX1 << ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET, + ADI_ADRV903X_TX2 << ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET, + ADI_ADRV903X_TX3 << ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET, + ADI_ADRV903X_TX4 << ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET, + ADI_ADRV903X_TX5 << ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET, + ADI_ADRV903X_TX6 << ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET, + ADI_ADRV903X_TX7 << ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET, + ADI_ADRV903X_RX0, + ADI_ADRV903X_RX1, + ADI_ADRV903X_RX2, + ADI_ADRV903X_RX3, + ADI_ADRV903X_RX4, + ADI_ADRV903X_RX5, + ADI_ADRV903X_RX6, + ADI_ADRV903X_RX7, + ADI_ADRV903X_ORX0, + ADI_ADRV903X_ORX1 + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, binary, cleanup); + + if ((byteCount == 0U) || + ((byteCount % 4U) > 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + byteCount, + "Invalid byteCount. Must be multiple of 4."); + goto cleanup; + } + + if ((byteOffset % 4U) > 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + byteCount, + "Invalid byteOffset. Must be multiple of 4."); + goto cleanup; + } + + /* When byteOffset is zero that indicates the first time this function. + * has been called for a particular stream_image.bin so the header info + * must be extracted. We need all the information extracted in a single + * call which is why min chunk size is the same as FINAL_STREAM_IMAGE_HEADER_SIZE_BYTES. + * */ + if (byteOffset == 0U) + { + /* Check that enough data was passed in to read the stream header size from the stream */ + if (byteCount < STREAM_METADATA_HEADER_SIZE_START_BYTE + STREAM_METADATA_HEADER_SIZE_DATA_LENGTH) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + byteCount, + "Must pass in chunk size greater than current stream image header."); + goto cleanup; + } + + /* Glean stream header size from the binary itself */ + FINAL_STREAM_IMAGE_HEADER_SIZE_BYTES = adrv903x_CpuIntFromBytesGet(binary + STREAM_METADATA_HEADER_SIZE_START_BYTE, + STREAM_METADATA_HEADER_SIZE_DATA_LENGTH); + + /* Verify that enough data was passed in to read the entire stream header */ + if (byteCount < FINAL_STREAM_IMAGE_HEADER_SIZE_BYTES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + byteCount, + "Must pass in chunk size greater than current stream image header."); + goto cleanup; + } + +#if ADI_ADRV903X_API_VERSION_RANGE_CHECK > 0 + { + adi_adrv903x_Version_t version = { 0U, 0U, 0U, 0U }; + adi_adrv903x_Version_t minVersion = { 0U, 0U, 0U, 0U }; + static const uint32_t STREAM_IMAGE_VERSION_ID_START_BYTE = 8U; + + version.majorVer = adrv903x_CpuIntFromBytesGet(binary + STREAM_IMAGE_VERSION_ID_START_BYTE + 0U, 4U); + version.minorVer = adrv903x_CpuIntFromBytesGet(binary + STREAM_IMAGE_VERSION_ID_START_BYTE + 4U, 4U); + version.maintenanceVer = adrv903x_CpuIntFromBytesGet(binary + STREAM_IMAGE_VERSION_ID_START_BYTE + 8U, 4U); + version.buildVer = adrv903x_CpuIntFromBytesGet(binary + STREAM_IMAGE_VERSION_ID_START_BYTE + 12U, 4U); + + recoveryAction = adi_adrv903x_ApiVersionGet(device, &minVersion); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Stream Binary Version Get Issue"); + goto cleanup; + } + + recoveryAction = adrv903x_ApiVersionRangeCheck(device, &version, &minVersion, &minVersion); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Stream Binary Range Check Issue"); + goto cleanup; + } + } +#endif + + /* Glean the 24 GPIO selections made in the Stream Binary */ + for (gpioIdx = 0U; gpioIdx < ADI_ADRV903X_GPIO_COUNT; gpioIdx++) + { + gpioAssignments[gpioIdx] = adrv903x_CpuIntFromBytesGet(binary + STREAM_IMAGE_GPIO00_START_BYTE + (gpioIdx * 4U), 4U); + + /* If stream feature is a basic stream input that requires no special handling, add it to generic Stream triggers list */ + switch (gpioAssignments[gpioIdx]) + { + case (ADRV903X_STREAM_GPIO_TX_ANTENNA_CAL): /* Fallthrough */ + case (ADRV903X_STREAM_GPIO_RX_ANTENNA_CAL): /* Fallthrough */ + case (ADRV903X_STREAM_GPIO_TX_PAP_FOR_EXT_LO0_UNLOCK): /* Fallthrough */ + case (ADRV903X_STREAM_GPIO_TX_PAP_FOR_EXT_LO1_UNLOCK): /* Fallthrough */ + device->devStateInfo.streamGpioMapping.streamGpInput[gpioIdx] = (adi_adrv903x_GpioPinSel_e)gpioIdx; + break; + + // Default: Do Nothing + default: + device->devStateInfo.streamGpioMapping.streamGpInput[gpioIdx] = ADI_ADRV903X_GPIO_INVALID; + break; + } + + } + + /* Update device handle Tx Orx Mapping config */ + device->devStateInfo.txToOrxMappingConfig.gpioSelect[0U] = adrv903x_StreamGleanGpioNumberGet(gpioAssignments, ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT0); + device->devStateInfo.txToOrxMappingConfig.gpioSelect[1U] = adrv903x_StreamGleanGpioNumberGet(gpioAssignments, ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT1); + device->devStateInfo.txToOrxMappingConfig.gpioSelect[2U] = adrv903x_StreamGleanGpioNumberGet(gpioAssignments, ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT2); + device->devStateInfo.txToOrxMappingConfig.gpioSelect[3U] = adrv903x_StreamGleanGpioNumberGet(gpioAssignments, ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT3); + device->devStateInfo.txToOrxMappingConfig.gpioSelect[4U] = adrv903x_StreamGleanGpioNumberGet(gpioAssignments, ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT4); + device->devStateInfo.txToOrxMappingConfig.gpioSelect[5U] = adrv903x_StreamGleanGpioNumberGet(gpioAssignments, ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT5); + device->devStateInfo.txToOrxMappingConfig.gpioSelect[6U] = adrv903x_StreamGleanGpioNumberGet(gpioAssignments, ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT6); + device->devStateInfo.txToOrxMappingConfig.gpioSelect[7U] = adrv903x_StreamGleanGpioNumberGet(gpioAssignments, ADRV903X_STREAM_GPIO_TX_TO_ORX_MAPPING_BIT7); + + device->devStateInfo.txToOrxMappingConfig.txObservability = (uint16_t)adrv903x_CpuIntFromBytesGet(binary + STREAM_IMAGE_TXORXOBSERVABILITY_START_BYTE, 2U); + + device->devStateInfo.txToOrxMappingConfig.mode = (adi_adrv903x_TxToOrxMappingMode_e)adrv903x_CpuIntFromBytesGet(binary + STREAM_IMAGE_TXORXMAPPINGMODE_START_BYTE, 1U); + + for (idx = 0U; idx < ADI_ADRV903X_TX_TO_ORX_MAPPING_PIN_TABLE_SIZE; idx++) + { + device->devStateInfo.txToOrxMappingConfig.pinTableOrx0[idx] = (adi_adrv903x_TxToOrxMappingPinTable_e)adrv903x_CpuIntFromBytesGet(binary + STREAM_IMAGE_TXTOORXMAPPINGPINTABLEORX0_00_START_BYTE + (idx * 4U), 4U); + + device->devStateInfo.txToOrxMappingConfig.pinTableOrx1[idx] = (adi_adrv903x_TxToOrxMappingPinTable_e)adrv903x_CpuIntFromBytesGet(binary + STREAM_IMAGE_TXTOORXMAPPINGPINTABLEORX1_00_START_BYTE + (idx * 4U), 4U); + } + device->devStateInfo.txToOrxMappingConfig.autoSwitchOrxAttenEnable = (uint8_t)adrv903x_CpuIntFromBytesGet(binary + STREAM_IMAGE_TXTOORXMAPPINAUTOSWITCHORXATTENENABLE_START_BYTE, 1U); + + device->devStateInfo.txToOrxMappingConfig.autoSwitchOrxNcoEnable = (uint8_t)adrv903x_CpuIntFromBytesGet(binary + STREAM_IMAGE_TXTOORXMAPPINAUTOSWITCHORXNCOENABLE_START_BYTE, 1U); + + for (i = 0; i < ADI_ADRV903X_STREAM_MAX; ++i) + { + adrv903x_BinaryImageInfoGet(&binary[STREAM_IMAGE_SLICE_INFO_START_BYTE + i * STREAM_PROCESSOR_META_DATA_SIZE_BYTES], &binaryImageSize, &binaryImageOffset); + device->devStateInfo.chunkStreamImageSize[i] = binaryImageSize; + device->devStateInfo.chunkStreamImageOffset[i] = binaryImageOffset; + } + + /* Variables used to track the status of stream_image.bin parsing + * across multiple calls to this function. + * */ + device->devStateInfo.currentStreamImageIndex = 0U; + device->devStateInfo.currentStreamBinBaseAddr = 0U; + device->devStateInfo.currentStreamBaseAddr = 0U; + device->devStateInfo.currentStreamImageSize = 0U; + device->devStateInfo.currentStreamNumberStreams = 0U; + } + + for (i = device->devStateInfo.currentStreamImageIndex; i < ADI_ADRV903X_STREAM_MAX; ++i) + { + imageOffset = device->devStateInfo.chunkStreamImageOffset[i]; + + /* NOTE: the i == 0 if-statements are for the most part required because core + * slice control registers are in Direct SPI address range instead of AHB memory. + * */ + + /* The core processor binary header starts after the stream_image.bin header. + * But what gets written to the core AHB address includes the stream_image.bin + * header. */ + if (i == 0U) + { + imageOffset = FINAL_STREAM_IMAGE_HEADER_SIZE_BYTES; + } + + /* The if-statements below are to see if the current chunk of stream_image.bin + * includes certain necessary information for a particular slice, e.g. the binary + * base address which is the first word of a slice binary image. */ + if ((byteOffset <= imageOffset) && + ((byteOffset + byteCount) >= imageOffset + 4U)) + { + binOffset = imageOffset - byteOffset; + adrv903x_BinaryParamsGetBaseAddr(&binary[binOffset], &word1); + device->devStateInfo.currentStreamBinBaseAddr = word1; + device->devStateInfo.currentStreamImageSize = device->devStateInfo.chunkStreamImageSize[i]; + } + + if ((byteOffset <= imageOffset + 4U) && + ((byteOffset + byteCount) >= imageOffset + 8U)) + { + binOffset = imageOffset + 4U - byteOffset; + adrv903x_BinaryParamsGetBaseAddr(&binary[binOffset], &word1); + device->devStateInfo.currentStreamBaseAddr = word1; + } + + if ((byteOffset <= imageOffset + 8U) && + ((byteOffset + byteCount) >= imageOffset + 12U)) + { + binOffset = imageOffset + 8U - byteOffset; + adrv903x_BinaryParamsGetNumberStreamImageSize(&binary[binOffset], &byte1, &word1); + device->devStateInfo.currentStreamNumberStreams = byte1; + } + + /* If these tracking variables have been set for the current slice that means we are in a state + * where we can write the chunk to ARM memory. + * */ + if ((device->devStateInfo.currentStreamBinBaseAddr > 0U) && + (device->devStateInfo.currentStreamImageSize > 0U)) + { + addr = streamCtlAddr[i]; + + /* This if-statement will only be true the first time we have encounter a slice image because + * currentStreamImageSize gets decremented on each function call, so we can use this as a way + * to initialize slice startup items, e.g. putting the slice into reset while it's image is getting + * written. */ + if (device->devStateInfo.currentStreamImageSize == device->devStateInfo.chunkStreamImageSize[i]) + { + if ((device->devStateInfo.initializedChannels & streamChannel[i]) > 0U) + { + //todo: this assumes kfa stream_reset is in spi-only re.g.s + if ((i == 0U) || (i == 1U)) + { + streamCtl = coreSliceControlDefaultVal | (1U << ADRV903X_STREAM_RESET_BIT); + mask = 0xFFU; + } + else + { + /* Default for Rx stream_config_0 is zero*/ + streamCtl = (1U << ADRV903X_RX_STREAM_RESET_BIT); + mask = 0xFFFFFFFFU; + } + recoveryAction = adi_adrv903x_Register32Write(device, NULL, addr, streamCtl, mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set Stream Ctrl"); + goto cleanup; + } + } + } + + /* This if statement is in the case a byte chunk has a boundary between two slice images so we only write + * the remaining bytes of the current slice. + * */ + if (byteCount >= device->devStateInfo.currentStreamImageSize) + { + imageSize = device->devStateInfo.currentStreamImageSize; + } + else + { + imageSize = byteCount; + } + + /* Load the stream image to memory, starting at the memory address specified by Stream_binary_base + * if the corresponding channel has been initialized. + * */ + if ((device->devStateInfo.initializedChannels & streamChannel[i]) > 0) + { + recoveryAction = adi_adrv903x_RegistersByteWrite(device, + NULL, + device->devStateInfo.currentStreamBinBaseAddr, + binary, + imageSize); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write stream binary"); + goto cleanup; + } + } + else + { + //stream is disabled but no need to report an error + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + + byteCount -= imageSize; + byteOffset += imageSize; + binary += imageSize; + device->devStateInfo.currentStreamImageSize -= imageSize; + device->devStateInfo.currentStreamBinBaseAddr += imageSize; + + /* After an entire slice image has been written we need to set the corresponding stream control register. */ + if (device->devStateInfo.currentStreamImageSize == 0U) + { + + if ((device->devStateInfo.initializedChannels & streamChannel[i]) > 0U) + { + //todo: this assumes kfa stream_reset is in spi-only regs + if((i == 0U) || (i == 1U)) + { + streamCtl = coreSliceControlDefaultVal; + mask = 0xFFU; + + /* Populate registers(stream_base_byte0) and (stream_base_byte1)with the lower 16 bits of the Stream_base. */ + recoveryAction = adi_adrv903x_Register32Write(device, + NULL, + addr + ADRV903X_STREAM_BASE_BYTE0_REG_OFFSET, + (uint8_t)(device->devStateInfo.currentStreamBaseAddr), + mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set Stream Ctrl - Lower Byte"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, + NULL, + addr + ADRV903X_STREAM_BASE_BYTE1_REG_OFFSET, + (uint8_t)(device->devStateInfo.currentStreamBaseAddr >> 8U), + mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set Stream Ctrl - Upper Byte"); + goto cleanup; + } + + /* Populate register (last_stream_num)with the No_of_streams value. */ + recoveryAction = adi_adrv903x_Register32Write(device, + NULL, + addr + ADRV903X_LAST_STREAM_NUMBER_REG_OFFSET, + (uint8_t)(device->devStateInfo.currentStreamNumberStreams - 1U), + mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set Stream Ctrl - Number of Streams"); + goto cleanup; + } + + } + else + { + mask = 0xFFFFFFFFU; + streamCtl = 0U; + + /* Populate registers(stream_base_byte0) and (stream_base_byte1)with the lower 16 bits of the Stream_base. */ + streamCtl |= (device->devStateInfo.currentStreamBaseAddr & 0xFFU) << ADRV903X_RX_STREAM_BASE_BYTE0_BIT; + streamCtl |= ((device->devStateInfo.currentStreamBaseAddr >> 8U) & 0xFFU) << ADRV903X_RX_STREAM_BASE_BYTE1_BIT; + + /* Populate register (last_stream_num)with the No_of_streams value. */ + streamCtl |= ((device->devStateInfo.currentStreamNumberStreams - 1U) & 0xFFU) << ADRV903X_RX_LAST_STREAM_NUMBER_BIT; + + /* Stream config 1 holds the base address & last stream number */ + recoveryAction = adi_adrv903x_Register32Write(device, NULL, addr + 4U, streamCtl, mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set Stream Ctrl 1"); + goto cleanup; + } + + /* Just clear reset bit on other channel processors */ + streamCtl = 0U; + + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, addr, streamCtl, mask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set Stream Ctrl"); + goto cleanup; + } + } + + ++device->devStateInfo.currentStreamImageIndex; + device->devStateInfo.currentStreamBinBaseAddr = 0U; + device->devStateInfo.currentStreamBaseAddr = 0U; + device->devStateInfo.currentStreamImageSize = 0U; + device->devStateInfo.currentStreamNumberStreams = 0U; + } + else + { + //stream is disabled but no need to report an error + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + } + else + { + break; + } + + if (byteCount == 0U) + { + break; + } + } + + if (device->devStateInfo.currentStreamImageIndex == ADI_ADRV903X_STREAM_MAX) + { + device->devStateInfo.devState = (adi_adrv903x_ApiStates_e)(device->devStateInfo.devState | ADI_ADRV903X_STATE_STREAMLOADED); + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTxEnableSet(adi_adrv903x_Device_t* const device, + const uint32_t orxChannelMask, + const uint32_t orxChannelEnable, + const uint32_t rxChannelMask, + const uint32_t rxChannelEnable, + const uint32_t txChannelMask, + const uint32_t txChannelEnable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + +#if ADI_ADRV903X_RADIOCTRL_RANGE_CHECK > 0 + recoveryAction = adrv903x_RxTxEnableSetRangeCheck(device, orxChannelMask, orxChannelEnable, rxChannelMask, rxChannelEnable, txChannelMask, txChannelEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxTxEnableSetRangeCheck Issue"); + goto cleanup; + } +#endif + + /*Enable requested Rx Channel signal chains*/ + recoveryAction = adrv903x_RxEnableSet(device, rxChannelMask, rxChannelEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxEnableSet Issue"); + goto cleanup; + } + + /* Enable requested ORx Channel signal chains */ + recoveryAction = adrv903x_OrxEnableSet(device, orxChannelMask, orxChannelEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "OrxEnableSet Issue"); + goto cleanup; + } + + /* Enable requested Tx Channel signal chains */ + recoveryAction = adrv903x_TxEnableSet(device, txChannelMask, txChannelEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "TxEnableSet Issue"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTxEnableGet(adi_adrv903x_Device_t* const device, + uint32_t* const orxChannelMask, + uint32_t* const rxChannelMask, + uint32_t* const txChannelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t regVal = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, orxChannelMask, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxChannelMask, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txChannelMask, cleanup); + + /* Get RX Channel Enabling bit mask */ + recoveryAction = adrv903x_Core_RadioControlInterfaceRxSpiEn_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + ®Val); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RX Channel status get failed."); + goto cleanup; + } + *rxChannelMask = (uint32_t) regVal; + + /* Get ORX Channel Enabling bit mask */ + recoveryAction = adrv903x_Core_RadioControlInterfaceOrxSpiEn_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + ®Val); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "ORX Channel status get failed."); + goto cleanup; + } + *orxChannelMask = ((uint32_t) regVal) << ADI_ADRV903X_MAX_RX_ONLY; + + /* Get TX Channel Enabling bit mask */ + recoveryAction = adrv903x_Core_RadioControlInterfaceTxSpiEn_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e) ADRV903X_BF_CORE_ADDR, + ®Val); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "TX Channel status get failed."); + goto cleanup; + } + *txChannelMask = (uint32_t) regVal; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ChannelEnableGet(adi_adrv903x_Device_t* const device, + uint32_t* const orxChannelMask, + uint32_t* const rxChannelMask, + uint32_t* const txChannelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t tmpByte = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, orxChannelMask, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxChannelMask, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txChannelMask, cleanup); + + *orxChannelMask = 0U; + *rxChannelMask = 0U; + *txChannelMask = 0U; + + recoveryAction = adrv903x_Core_RadioControlInterfaceTxonReadback_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &tmpByte); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "TxonReadback issue"); + goto cleanup; + } + + *txChannelMask = tmpByte; + + recoveryAction = adrv903x_Core_RadioControlInterfaceRxonReadback_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &tmpByte); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxonReadback issue"); + goto cleanup; + } + + *rxChannelMask = tmpByte; + + recoveryAction = adrv903x_Core_RadioControlInterfaceOrxonReadback_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &tmpByte); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "OrxonReadback issue"); + goto cleanup; + } + + *orxChannelMask = tmpByte; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); + +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlCfgSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_RadioCtrlModeCfg_t* const radioCtrlCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, radioCtrlCfg, cleanup); + +#if ADI_ADRV903X_RADIOCTRL_RANGE_CHECK > 0 + recoveryAction = adrv903x_RadioCtrlCfgSetRangeCheck(device, radioCtrlCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RadioCtrlCfgSetRangeCheck Issue"); + goto cleanup; + } +#endif + + if (((device->devStateInfo.profilesValid & ADI_ADRV903X_RX_PROFILE_VALID) == ADI_ADRV903X_RX_PROFILE_VALID) && + (radioCtrlCfg->rxRadioCtrlModeCfg.rxEnableMode != ADI_ADRV903X_RX_EN_INVALID_MODE) && + (radioCtrlCfg->rxRadioCtrlModeCfg.rxChannelMask != ADI_ADRV903X_RXOFF)) + { + recoveryAction = adrv903x_RxRadioCtrlCfgSet(device, &radioCtrlCfg->rxRadioCtrlModeCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxRadioCtrlCfgSet Issue"); + goto cleanup; + } + } + + if (((device->devStateInfo.profilesValid & ADI_ADRV903X_TX_PROFILE_VALID) == ADI_ADRV903X_TX_PROFILE_VALID) && + (radioCtrlCfg->txRadioCtrlModeCfg.txEnableMode != ADI_ADRV903X_TX_EN_INVALID_MODE) && + (radioCtrlCfg->txRadioCtrlModeCfg.txChannelMask != ADI_ADRV903X_TXOFF)) + { + recoveryAction = adrv903x_TxRadioCtrlCfgSet(device, &radioCtrlCfg->txRadioCtrlModeCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "TxRadioCtrlCfgSet Issue"); + goto cleanup; + } + } + + if (((device->devStateInfo.profilesValid & ADI_ADRV903X_ORX_PROFILE_VALID) == ADI_ADRV903X_ORX_PROFILE_VALID) && + (radioCtrlCfg->orxRadioCtrlModeCfg.orxEnableMode != ADI_ADRV903X_ORX_EN_INVALID_MODE) && + (radioCtrlCfg->orxRadioCtrlModeCfg.orxChannelMask != ADI_ADRV903X_RXOFF)) + { + recoveryAction = adrv903x_OrxRadioCtrlCfgSet(device, &radioCtrlCfg->orxRadioCtrlModeCfg); + if(recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "OrxRadioCtrlCfgSet Issue"); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_RadioCtrlModeCfg_t* const radioCtrlCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, radioCtrlCfg, cleanup); + + if (rxChannel > ADI_ADRV903X_ORX1) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, rxChannel, "Invalid Rx/ORx Channel"); + goto cleanup; + } + + if (txChannel > ADI_ADRV903X_TX7) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx Channel"); + goto cleanup; + } + + if ((txChannel == ADI_ADRV903X_TXOFF) && + (rxChannel == ADI_ADRV903X_RXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "No valid Tx and Rx channels"); + goto cleanup; + } + + if ((rxChannel >= ADI_ADRV903X_RX0) && (rxChannel <= ADI_ADRV903X_RX7)) + { + recoveryAction = adrv903x_RxRadioCtrlCfgGet(device, rxChannel, &radioCtrlCfg->rxRadioCtrlModeCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxRadioCtrlCfgGet Issue"); + goto cleanup; + } + } + + if ((txChannel >= ADI_ADRV903X_TX0) && (txChannel <= ADI_ADRV903X_TX7)) + { + recoveryAction = adrv903x_TxRadioCtrlCfgGet(device, txChannel, &radioCtrlCfg->txRadioCtrlModeCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "TxRadioCtrlCfgGet Issue"); + goto cleanup; + } + } + + if ((rxChannel >= ADI_ADRV903X_ORX0) && (rxChannel <= ADI_ADRV903X_ORX1)) + { + recoveryAction = adrv903x_OrxRadioCtrlCfgGet(device, rxChannel, &radioCtrlCfg->orxRadioCtrlModeCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "OrxRadioCtrlCfgGet Issue"); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_LoFrequencySet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoConfig_t* const loConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + + adrv903x_CpuCmd_SetLoFreq_t loInfo; + adrv903x_CpuCmd_SetLoFreqResp_t cmdRsp; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + + uint8_t writeGpIntPin1Bool = 0U; + uint8_t writeGpIntPin0Bool = 0U; + uint8_t writePllUnlockMaskBool[ADI_ADRV903X_MAX_TXCHANNELS]; + + uint8_t tmpPllRampDownMask = 0U; + uint8_t origPllRampDownMask[ADI_ADRV903X_MAX_TXCHANNELS]; + uint8_t i = 0U; + uint8_t pllUnlockRampDownMask = 0U; + uint32_t tmpTxChannelMask = 0U; + + uint8_t gpIntMaskRegsOrig[4] = { 0U, 0U, 0U, 0U }; + uint8_t gpIntMaskRegsTmp[4] = { 0U, 0U, 0U, 0U }; + uint8_t* gpIntMaskPin1Byte9 = &gpIntMaskRegsOrig[0]; + uint8_t* gpIntMaskPin0Byte9 = &gpIntMaskRegsOrig[2]; + + static const uint8_t GPINT_RF1_PLL_OVERRANGE_BYTE9_MASK = (1U << 4U); + static const uint8_t GPINT_RF0_PLL_OVERRANGE_BYTE9_MASK = (1U << 5U); + static const uint8_t GPINT_RF1_PLL_UNLOCK_BYTE9_MASK = (1U << 7U); + static const uint8_t GPINT_RF0_PLL_UNLOCK_BYTE10_MASK = (1U << 0U); + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, loConfig, cleanup); + + ADI_LIBRARY_MEMSET(&loInfo, 0, sizeof(adrv903x_CpuCmd_SetLoFreq_t)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(adrv903x_CpuCmd_SetLoFreqResp_t)); + ADI_LIBRARY_MEMSET(&writePllUnlockMaskBool, 0, sizeof(writePllUnlockMaskBool)); + ADI_LIBRARY_MEMSET(&origPllRampDownMask, 0, sizeof(origPllRampDownMask)); + +#if ADI_ADRV903X_RADIOCTRL_RANGE_CHECK > 0 + recoveryAction = adrv903x_LoFrequencySetRangeCheck(device, loConfig); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "LoFrequencySetRangeCheck Issue"); + goto cleanup; + } +#endif + + /* Read GPINT registers */ + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, ADRV903X_ADDR_GPINT_MASK_PIN1_BYTE9, gpIntMaskPin1Byte9, NULL, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32Read GPINT_PIN1 issue"); + goto cleanup; + } + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, ADRV903X_ADDR_GPINT_MASK_PIN0_BYTE9, gpIntMaskPin0Byte9, NULL, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32Read GPINT_PIN0 issue"); + goto cleanup; + } + ADI_LIBRARY_MEMCPY(gpIntMaskRegsTmp, gpIntMaskRegsOrig, sizeof(gpIntMaskRegsOrig)); + gpIntMaskPin1Byte9 = &gpIntMaskRegsTmp[0]; + gpIntMaskPin0Byte9 = &gpIntMaskRegsTmp[2]; + + /* Based on loName determine the GPINT and PLL-unlock Tx rampdown to disable */ + switch (loConfig->loName) + { + case ADI_ADRV903X_LO0: + pllUnlockRampDownMask = (uint8_t)ADI_ADRV903X_RDT_RF0_PLL_UNLOCK; + gpIntMaskPin1Byte9[1] |= GPINT_RF0_PLL_UNLOCK_BYTE10_MASK; + gpIntMaskPin0Byte9[1] |= GPINT_RF0_PLL_UNLOCK_BYTE10_MASK; + break; + case ADI_ADRV903X_LO1: + pllUnlockRampDownMask = (uint8_t)ADI_ADRV903X_RDT_RF1_PLL_UNLOCK; + gpIntMaskPin1Byte9[0] |= GPINT_RF1_PLL_UNLOCK_BYTE9_MASK; + gpIntMaskPin0Byte9[0] |= GPINT_RF1_PLL_UNLOCK_BYTE9_MASK; + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, loConfig->loName, "Invalid LO selected for setting LO frequency"); + goto cleanup; + } + + pllUnlockRampDownMask >>= 3U; + + /* Disable various GP INTs while changing frequency */ + gpIntMaskPin1Byte9[0] |= (GPINT_RF0_PLL_OVERRANGE_BYTE9_MASK | GPINT_RF1_PLL_OVERRANGE_BYTE9_MASK); + gpIntMaskPin0Byte9[0] |= (GPINT_RF0_PLL_OVERRANGE_BYTE9_MASK | GPINT_RF1_PLL_OVERRANGE_BYTE9_MASK); + /* Write GPINT registers if Byte9 or Byte10 have been changed */ + writeGpIntPin1Bool = (gpIntMaskPin1Byte9[0] != gpIntMaskRegsOrig[0]) || (gpIntMaskPin1Byte9[1] != gpIntMaskRegsOrig[1]); + writeGpIntPin0Bool = (gpIntMaskPin0Byte9[0] != gpIntMaskRegsOrig[2]) || (gpIntMaskPin0Byte9[1] != gpIntMaskRegsOrig[3]); + if (writeGpIntPin1Bool) + { + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_GPINT_MASK_PIN1_BYTE9, gpIntMaskPin1Byte9, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32Write GPINT_PIN1 issue"); + goto cleanup; + } + } + if (writeGpIntPin0Bool) + { + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_GPINT_MASK_PIN0_BYTE9, gpIntMaskPin0Byte9, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32Write GPINT_PIN0 issue"); + goto cleanup; + } + } + + /* Store current PLL Unlock mask for ramp down configuration for each channel and update them temporarily */ + for (i = 0U; i < ADI_ADRV903X_MAX_TXCHANNELS; ++i) + { + tmpTxChannelMask = (uint32_t)((uint32_t)1U << i); + + if (((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & tmpTxChannelMask) == 0U) + { + /* skip for uninitialized channels */ + continue; + } + + /* Retrieve the base address for selected tx channel */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)tmpTxChannelMask, &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, tmpTxChannelMask, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + /* Store pll unlock mask */ + recoveryAction = adrv903x_TxFuncs_PllUnlockMask_BfGet(device, NULL, txBaseAddr, &origPllRampDownMask[i]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading Tx Pll Unlock Mask for ramp-down config"); + goto cleanup; + } + + tmpPllRampDownMask = origPllRampDownMask[i] | pllUnlockRampDownMask; /* 1 means disabled */ + /* store boolean on whether temporary values to be written are different from the original */ + writePllUnlockMaskBool[i] = (tmpPllRampDownMask != origPllRampDownMask[i]); + + /* update pll unlock mask if tmp value is different */ + if (writePllUnlockMaskBool[i]) + { + recoveryAction = adrv903x_TxFuncs_PllUnlockMask_BfSet(device, NULL, txBaseAddr, tmpPllRampDownMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing temporary Tx Pll Unlock Mask for ramp-down config"); + goto cleanup; + } + } + } + + /* Prepare the command payload */ + loInfo.loName = (adi_adrv903x_LoName_t) loConfig->loName; + loInfo.loConfigSel = (adi_adrv903x_LoOption_t) ADRV903X_HTOCL(loConfig->loConfigSel) ; + loInfo.loFrequency_Hz = (uint64_t) ADRV903X_HTOCLL(loConfig->loFrequency_Hz); + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_LO_FREQUENCY, + (void*)&loInfo, + sizeof(loInfo), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + /* Write back original GPINT settings */ + gpIntMaskPin1Byte9 = &gpIntMaskRegsOrig[0]; + gpIntMaskPin0Byte9 = &gpIntMaskRegsOrig[2]; + if (writeGpIntPin1Bool) + { + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_GPINT_MASK_PIN1_BYTE9, gpIntMaskPin1Byte9, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32Write GPINT_PIN1 issue"); + goto cleanup; + } + } + if (writeGpIntPin0Bool) + { + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_GPINT_MASK_PIN0_BYTE9, gpIntMaskPin0Byte9, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32Write GPINT_PIN0 issue"); + goto cleanup; + } + } + + /* Restore Pll unlock masks for ramp-down configuration */ + for (i = 0; i < ADI_ADRV903X_MAX_TXCHANNELS; ++i) + { + tmpTxChannelMask = (uint32_t)((uint32_t)1U << i); + + if ((((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & tmpTxChannelMask) == 0U) || + (writePllUnlockMaskBool[i] == 0U)) + { + /* skip for uninitialized channels or unchanged Pll unlock masks*/ + continue; + } + + /* Retrieve the base address for selected tx channel */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)tmpTxChannelMask, &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, tmpTxChannelMask, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PllUnlockMask_BfSet(device, NULL, txBaseAddr, origPllRampDownMask[i]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing temporary Tx Pll Unlock Mask for ramp-down config"); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_LoFrequencyGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_LoConfigReadback_t* const loConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_GetLoFreqResp_t cmdRsp; + adrv903x_CpuCmd_GetLoFreq_t loCmd; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, loConfig, cleanup); + + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(adrv903x_CpuCmd_GetLoFreqResp_t)); + ADI_LIBRARY_MEMSET(&loCmd, 0, sizeof(adrv903x_CpuCmd_GetLoFreq_t)); + + /* Executing the GET LO Freq command */ + loCmd.loName = (adi_adrv903x_LoName_t) loConfig->loName; + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_LO_FREQUENCY, + (void*)&loCmd, + sizeof(loCmd), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + loConfig->loFrequency_Hz = (uint64_t) ADRV903X_CTOHLL(cmdRsp.loFrequency_Hz); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CfgPllToChanCtrl(adi_adrv903x_Device_t* const device, + uint8_t rf0MuxTx0_3, + uint8_t rf0MuxTx4_7, + uint8_t rf0MuxRx0_3, + uint8_t rf0MuxRx4_7) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_ChanCtrlToPlls_t ChanCtrlToPllsPayload; + adrv903x_CpuCmd_ChanCtrlToPllsResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + + /* check Device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_LIBRARY_MEMSET(&ChanCtrlToPllsPayload, 0, sizeof(adrv903x_CpuCmd_ChanCtrlToPlls_t)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(adrv903x_CpuCmd_ChanCtrlToPllsResp_t)); + + /* Prepare the command Payload */ + ChanCtrlToPllsPayload.rf0MuxTx0_3 = (uint8_t) rf0MuxTx0_3; + ChanCtrlToPllsPayload.rf0MuxTx4_7 = (uint8_t) rf0MuxTx4_7; + ChanCtrlToPllsPayload.rf0MuxRx0_3 = (uint8_t) rf0MuxRx0_3; + ChanCtrlToPllsPayload.rf0MuxRx4_7 = (uint8_t) rf0MuxRx4_7; + + /* Send Command and Receive Response */ + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_CHAN_TO_PLLS, + (void*)&ChanCtrlToPllsPayload, + sizeof(ChanCtrlToPllsPayload), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_LoLoopFilterSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoName_e loName, + const adi_adrv903x_LoLoopFilterCfg_t* const loLoopFilterConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_SetLoopfilter_t loopFilterPayload; + adrv903x_CpuCmd_SetLoopfilterResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, loLoopFilterConfig, cleanup); + + ADI_LIBRARY_MEMSET(&loopFilterPayload, 0, sizeof(adrv903x_CpuCmd_SetLoopfilter_t)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(adrv903x_CpuCmd_SetLoopfilterResp_t)); + +#if ADI_ADRV903X_RADIOCTRL_RANGE_CHECK > 0 + recoveryAction = adrv903x_LoLoopFilterSetRangeCheck(device, loName, loLoopFilterConfig); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "LoLoopFilterRangeCheck Issue"); + goto cleanup; + } +#endif + + loopFilterPayload.loName = (adi_adrv903x_LoName_t)(loName); + loopFilterPayload.loopBandwidth = ADRV903X_HTOCL((uint32_t)(loLoopFilterConfig->loopBandwidth_kHz * 1000U)); + loopFilterPayload.phaseMargin = ADRV903X_HTOCL((uint32_t)loLoopFilterConfig->phaseMargin_degrees); + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_LOOPFILTER, + (void*)&loopFilterPayload, + sizeof(loopFilterPayload), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_LoLoopFilterGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_LoName_e loName, + adi_adrv903x_LoLoopFilterCfg_t* const loLoopFilterConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_GetLoopfilter_t loopFilterPayload; + adrv903x_CpuCmd_GetLoopfilterResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, loLoopFilterConfig, cleanup); + + ADI_LIBRARY_MEMSET(&loopFilterPayload, 0, sizeof(adrv903x_CpuCmd_GetLoopfilter_t)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(adrv903x_CpuCmd_GetLoopfilterResp_t)); + + if ((loName != ADI_ADRV903X_LO0) && (loName != ADI_ADRV903X_LO1)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, loName, "Invalid LO Name"); + goto cleanup; + } + loopFilterPayload.loName = (adi_adrv903x_LoName_t)(loName); + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_LOOPFILTER, + (void*)&loopFilterPayload, + sizeof(loopFilterPayload), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + loLoopFilterConfig->loopBandwidth_kHz = (uint16_t) (ADRV903X_CTOHL(cmdRsp.loopBandwidth) / 1000); + loLoopFilterConfig->phaseMargin_degrees = (uint8_t) ADRV903X_CTOHL(cmdRsp.phaseMargin); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_PllStatusGet(adi_adrv903x_Device_t* const device, + uint32_t* const pllLockStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + static const uint8_t CLK_PLL_LOCK_STATUS_SHIFT = 0U; + static const uint8_t LO0_LOCK_STATUS_SHIFT = 1U; + static const uint8_t LO1_LOCK_STATUS_SHIFT = 2U; + static const uint8_t SERDES_PLL_LOCK_STATUS_SHIFT = 3U; + static const uint32_t LOCK_BIT_MASK = 0x00000001U; + + uint8_t pllLockStatusRead = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, pllLockStatus, cleanup); + + /* Clear status of all PLLs */ + *pllLockStatus = 0U; + + /* Read CLK Pll status */ + recoveryAction = adrv903x_PllMemMap_SynLock_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_CLKPLL, + &pllLockStatusRead); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Get CLK PLL Lock Status Failed."); + goto cleanup; + } + + /* Update pllLockStatus bit 0 with Clk Pll Status */ + *pllLockStatus |= ((uint32_t)pllLockStatusRead & LOCK_BIT_MASK) << CLK_PLL_LOCK_STATUS_SHIFT; + + /* Read LO0 Pll status */ + recoveryAction = adrv903x_PllMemMap_SynLock_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_EAST_RFPLL, + &pllLockStatusRead); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Get LO0 Lock Status Failed."); + goto cleanup; + } + + /* Update pllLockStatus bit 1 with LO0 Pll Status */ + *pllLockStatus |= ((uint32_t)pllLockStatusRead & LOCK_BIT_MASK) << LO0_LOCK_STATUS_SHIFT; + + /* Read LO1 Pll status */ + recoveryAction = adrv903x_PllMemMap_SynLock_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_WEST_RFPLL, + &pllLockStatusRead); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Get LO1 Lock Status Failed."); + goto cleanup; + } + + /* Update pllLockStatus bit 2 with LO1 Pll Status */ + *pllLockStatus |= ((uint32_t)pllLockStatusRead & LOCK_BIT_MASK) << LO1_LOCK_STATUS_SHIFT; + + /* Read SERDES Pll status */ + recoveryAction = adrv903x_PllMemMap_SynLock_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_SERDES_PLL, + &pllLockStatusRead); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API Get SERDES PLL Lock Status Failed."); + goto cleanup; + } + + /* Update pllLockStatus bit 3 with Serdes Pll Status */ + *pllLockStatus |= ((uint32_t)pllLockStatusRead & LOCK_BIT_MASK) << SERDES_PLL_LOCK_STATUS_SHIFT; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTxLoFreqGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_RxTxLoFreqReadback_t* const rxTxLoFreq) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_GetRxTxLoFreqResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint8_t i = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxTxLoFreq, cleanup); + + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(adrv903x_CpuCmd_GetRxTxLoFreqResp_t)); + ADI_LIBRARY_MEMSET(rxTxLoFreq, 0, sizeof(adi_adrv903x_RxTxLoFreqReadback_t)); + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_RXTXLOFREQ, + (void*) NULL, /* No CMD load needed for this cmd */ + 0U, + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + /* Copying CPU responses back to user structure */ + for(i = 0 ; i < ADI_ADRV903X_MAX_RX_ONLY ; i++) + { + rxTxLoFreq->rxLoName[i] = (adi_adrv903x_LoName_e)ADRV903X_CTOHL((uint32_t)cmdRsp.rxLoName[i]); + rxTxLoFreq->rxFreq_Khz[i] = ADRV903X_CTOHL(cmdRsp.rxFreq[i]); + } + + for (i = 0U; i < ADI_ADRV903X_MAX_TXCHANNELS; i++) + { + rxTxLoFreq->txLoName[i] = (adi_adrv903x_LoName_e)ADRV903X_CTOHL((uint32_t)cmdRsp.txLoName[i]); + rxTxLoFreq->txFreq_Khz[i] = ADRV903X_CTOHL(cmdRsp.txFreq[i]); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlTxRxEnCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RadioCtrlTxRxEnCfg_t* const txRxEnCfg, + uint8_t pinIndex, + uint8_t configSel) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t i = 0U; + + adrv903xCoreBfSet8FnPtr_t adrvCoreRadioControlInterfaceTRxEnPinXBfSet[4][ADI_ADRV903X_TRX_CTRL_PIN_COUNT] = + { + { + adrv903x_Core_RadioControlInterfaceTxEnPin0_BfSet, + adrv903x_Core_RadioControlInterfaceTxEnPin1_BfSet, + adrv903x_Core_RadioControlInterfaceTxEnPin2_BfSet, + adrv903x_Core_RadioControlInterfaceTxEnPin3_BfSet, + adrv903x_Core_RadioControlInterfaceTxEnPin4_BfSet, + adrv903x_Core_RadioControlInterfaceTxEnPin5_BfSet, + adrv903x_Core_RadioControlInterfaceTxEnPin6_BfSet, + adrv903x_Core_RadioControlInterfaceTxEnPin7_BfSet + }, + { + adrv903x_Core_RadioControlInterfaceTxAntEnPin0_BfSet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin1_BfSet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin2_BfSet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin3_BfSet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin4_BfSet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin5_BfSet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin6_BfSet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin7_BfSet + }, + { + adrv903x_Core_RadioControlInterfaceRxEnPin0_BfSet, + adrv903x_Core_RadioControlInterfaceRxEnPin1_BfSet, + adrv903x_Core_RadioControlInterfaceRxEnPin2_BfSet, + adrv903x_Core_RadioControlInterfaceRxEnPin3_BfSet, + adrv903x_Core_RadioControlInterfaceRxEnPin4_BfSet, + adrv903x_Core_RadioControlInterfaceRxEnPin5_BfSet, + adrv903x_Core_RadioControlInterfaceRxEnPin6_BfSet, + adrv903x_Core_RadioControlInterfaceRxEnPin7_BfSet + }, + { + adrv903x_Core_RadioControlInterfaceRxAntEnPin0_BfSet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin1_BfSet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin2_BfSet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin3_BfSet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin4_BfSet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin5_BfSet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin6_BfSet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin7_BfSet + } + }; + + adi_adrv903x_TxRxEnPin_e arrayTxRxPin[ADI_ADRV903X_TRX_CTRL_PIN_COUNT] = + { + ADI_ADRV903X_TXRXEN_PIN0, + ADI_ADRV903X_TXRXEN_PIN1, + ADI_ADRV903X_TXRXEN_PIN2, + ADI_ADRV903X_TXRXEN_PIN3, + ADI_ADRV903X_TXRXEN_PIN4, + ADI_ADRV903X_TXRXEN_PIN5, + ADI_ADRV903X_TXRXEN_PIN6, + ADI_ADRV903X_TXRXEN_PIN7 + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txRxEnCfg, cleanup); + + if (pinIndex < ADI_ADRV903X_TXRXEN_PIN0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, pinIndex, "Invalid pinIndex"); + goto cleanup; + } + + if ((configSel < ADI_ADRV903X_TXRXEN_TX_ENABLE_MAP) || + (configSel > ADI_ADRV903X_TXRXEN_ALL)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, configSel, "Invalid configSel"); + goto cleanup; + } + + for (i = 0; i < ADI_ADRV903X_TRX_CTRL_PIN_COUNT; i++) + { + if (ADRV903X_BF_EQUAL(pinIndex, arrayTxRxPin[i])) + { + if (ADRV903X_BF_EQUAL(configSel, ADI_ADRV903X_TXRXEN_TX_ENABLE_MAP)) + { + recoveryAction = adrvCoreRadioControlInterfaceTRxEnPinXBfSet[0][i](device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + txRxEnCfg->txEnMapping[i]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API TX Radio Control En Pin Failed."); + goto cleanup; + } + } + + if (ADRV903X_BF_EQUAL(configSel, (uint8_t)ADI_ADRV903X_TXRXEN_TX_ALTENABLE_MAP)) + { + recoveryAction = adrvCoreRadioControlInterfaceTRxEnPinXBfSet[1][i](device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + txRxEnCfg->txAltMapping[i]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API TX Radio Control Alternate En Pin Failed."); + goto cleanup; + } + } + + if (ADRV903X_BF_EQUAL(configSel, ADI_ADRV903X_TXRXEN_RX_ENABLE_MAP)) + { + recoveryAction = adrvCoreRadioControlInterfaceTRxEnPinXBfSet[2][i](device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + txRxEnCfg->rxEnMapping[i]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API RX Radio Control En Pin Failed."); + goto cleanup; + } + } + + if (ADRV903X_BF_EQUAL(configSel, ADI_ADRV903X_TXRXEN_RX_ALTENABLE_MAP)) + { + recoveryAction = adrvCoreRadioControlInterfaceTRxEnPinXBfSet[3][i](device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + txRxEnCfg->rxAltMapping[i]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API RX Radio Control Alternate En Pin Failed."); + goto cleanup; + } + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlTxRxEnCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_RadioCtrlTxRxEnCfg_t* const txRxEnCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t i = 0U; + + adrv903xCoreBfGet8FnPtr_t adrvCoreRadioControlInterfaceTRxEnPinXBfGet[4][ADI_ADRV903X_TRX_CTRL_PIN_COUNT] = + { + { + adrv903x_Core_RadioControlInterfaceTxEnPin0_BfGet, + adrv903x_Core_RadioControlInterfaceTxEnPin1_BfGet, + adrv903x_Core_RadioControlInterfaceTxEnPin2_BfGet, + adrv903x_Core_RadioControlInterfaceTxEnPin3_BfGet, + adrv903x_Core_RadioControlInterfaceTxEnPin4_BfGet, + adrv903x_Core_RadioControlInterfaceTxEnPin5_BfGet, + adrv903x_Core_RadioControlInterfaceTxEnPin6_BfGet, + adrv903x_Core_RadioControlInterfaceTxEnPin7_BfGet + }, + { + adrv903x_Core_RadioControlInterfaceTxAntEnPin0_BfGet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin1_BfGet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin2_BfGet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin3_BfGet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin4_BfGet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin5_BfGet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin6_BfGet, + adrv903x_Core_RadioControlInterfaceTxAntEnPin7_BfGet + }, + { + adrv903x_Core_RadioControlInterfaceRxEnPin0_BfGet, + adrv903x_Core_RadioControlInterfaceRxEnPin1_BfGet, + adrv903x_Core_RadioControlInterfaceRxEnPin2_BfGet, + adrv903x_Core_RadioControlInterfaceRxEnPin3_BfGet, + adrv903x_Core_RadioControlInterfaceRxEnPin4_BfGet, + adrv903x_Core_RadioControlInterfaceRxEnPin5_BfGet, + adrv903x_Core_RadioControlInterfaceRxEnPin6_BfGet, + adrv903x_Core_RadioControlInterfaceRxEnPin7_BfGet + }, + { + adrv903x_Core_RadioControlInterfaceRxAntEnPin0_BfGet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin1_BfGet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin2_BfGet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin3_BfGet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin4_BfGet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin5_BfGet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin6_BfGet, + adrv903x_Core_RadioControlInterfaceRxAntEnPin7_BfGet + } + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txRxEnCfg, cleanup); + + for (i = 0; i < ADI_ADRV903X_TRX_CTRL_PIN_COUNT; i++) + { + recoveryAction = adrvCoreRadioControlInterfaceTRxEnPinXBfGet[0][i](device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &txRxEnCfg->txEnMapping[i]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API TX Radio Control En Pin Failed."); + goto cleanup; + } + + recoveryAction = adrvCoreRadioControlInterfaceTRxEnPinXBfGet[1][i](device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &txRxEnCfg->txAltMapping[i]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API TX Radio Control Alternate En Pin Failed."); + goto cleanup; + } + + recoveryAction = adrvCoreRadioControlInterfaceTRxEnPinXBfGet[2][i](device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &txRxEnCfg->rxEnMapping[i]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API RX Radio Control En Pin Failed."); + goto cleanup; + } + + recoveryAction = adrvCoreRadioControlInterfaceTRxEnPinXBfGet[3][i](device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &txRxEnCfg->rxAltMapping[i]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "API RX Radio Control Alternate En Pin Failed."); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TemperatureGet(adi_adrv903x_Device_t* const device, + const uint16_t avgMask, + adi_adrv903x_DevTempData_t* const deviceTemperature) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_GetDevTemp_t devTempCmd; + adrv903x_CpuCmd_GetDevTempResp_t devTempCmdResp; + adrv903x_CpuCmd_GetDevTempResp_t devTempCmdResp0; + adrv903x_CpuCmd_GetDevTempResp_t devTempCmdResp1; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + const int16_t ADRV903X_TEMP_UNUSED = -274; + uint32_t cpuTypeIdx = 0U; + uint32_t curTempSensor = 0U; + uint16_t avgDiv = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, deviceTemperature, cleanup); + + ADI_LIBRARY_MEMSET(&devTempCmd, 0, sizeof(adrv903x_CpuCmd_GetDevTemp_t)); + ADI_LIBRARY_MEMSET(&devTempCmdResp, 0, sizeof(adrv903x_CpuCmd_GetDevTempResp_t)); + ADI_LIBRARY_MEMSET(&devTempCmdResp0, 0, sizeof(adrv903x_CpuCmd_GetDevTempResp_t)); + ADI_LIBRARY_MEMSET(&devTempCmdResp1, 0, sizeof(adrv903x_CpuCmd_GetDevTempResp_t)); + + /* Set ADRV903X_CPU_CMD_ID_GET_DEVICE_TEMPERATURE command parameters */ + devTempCmd.avgMask = ADRV903X_HTOCS(avgMask); + + for (cpuTypeIdx = (uint32_t) ADI_ADRV903X_CPU_TYPE_0; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_DEVICE_TEMPERATURE, + (void*)&devTempCmd, + sizeof(devTempCmd), + (void*)&devTempCmdResp, + sizeof(devTempCmdResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(devTempCmdResp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + else + { + if (cpuTypeIdx == (uint32_t) ADI_ADRV903X_CPU_TYPE_0) + { + devTempCmdResp0 = devTempCmdResp; + } + if (cpuTypeIdx == (uint32_t) ADI_ADRV903X_CPU_TYPE_1) + { + devTempCmdResp1 = devTempCmdResp; + } + } + } + + /* Copy/translate the temperature data to the caller's buffer */ + deviceTemperature->avgMask = ADRV903X_CTOHS((uint16_t)(devTempCmdResp0.tempData.avgMask | devTempCmdResp1.tempData.avgMask)); + deviceTemperature->tempDegreesCelsiusAvg = 0; + for( curTempSensor = 0U; curTempSensor < ADI_ADRV903X_DEVTEMP_MAX_SENSORS; curTempSensor++) + { + if ((int16_t)ADRV903X_CTOHS(devTempCmdResp0.tempData.tempDegreesCelsius[curTempSensor]) == ADRV903X_TEMP_UNUSED ) + { + deviceTemperature->tempDegreesCelsius[curTempSensor] = ADRV903X_CTOHS(devTempCmdResp1.tempData.tempDegreesCelsius[curTempSensor]); + } + else + { + deviceTemperature->tempDegreesCelsius[curTempSensor] = ADRV903X_CTOHS(devTempCmdResp0.tempData.tempDegreesCelsius[curTempSensor]); + } + + if ((deviceTemperature->tempDegreesCelsius[curTempSensor] != ADRV903X_TEMP_UNUSED) && + (deviceTemperature->avgMask & (0x0001 << curTempSensor))) + { + deviceTemperature->tempDegreesCelsiusAvg += deviceTemperature->tempDegreesCelsius[curTempSensor]; + ++avgDiv; + } + } + + if ((avgDiv > 0) && (deviceTemperature->avgMask > 0)) + { + deviceTemperature->tempDegreesCelsiusAvg /= avgDiv; + } + else + { + deviceTemperature->tempDegreesCelsiusAvg = ADRV903X_TEMP_UNUSED; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TemperatureEnableGet(adi_adrv903x_Device_t* const device, + uint16_t* const tempEnData) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_GetDevTempSnsEnResp_t devTempEnCmdResp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t cpuTypeIdx = 0U; + + /* Check for pointer not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(tempEnData); + + ADI_LIBRARY_MEMSET(&devTempEnCmdResp, 0, sizeof(adrv903x_CpuCmd_GetDevTempSnsEnResp_t)); + *tempEnData = 0; + + for (cpuTypeIdx = (uint32_t) ADI_ADRV903X_CPU_TYPE_0; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response*/ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_ENABLED_TEMPSENSORS, + (void*) NULL, /* No CMD load needed for this cmd */ + 0U, + (void*)&devTempEnCmdResp, + sizeof(devTempEnCmdResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(devTempEnCmdResp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + else + { + /* Copy/translate the temperature data to the caller's buffer */ + *tempEnData |= (ADRV903X_CTOHS(devTempEnCmdResp.tempEnData)); + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TemperatureEnableSet(adi_adrv903x_Device_t* const device, + uint16_t* const tempEnData) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_SetDevTempSnsEn_t devTempCmd; + adrv903x_CpuCmd_SetDevTempSnsEnResp_t devTempEnCmdResp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t cpuTypeIdx = 0U; + + /* Check for pointer not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(tempEnData); + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_LIBRARY_MEMSET(&devTempEnCmdResp, 0, sizeof(adrv903x_CpuCmd_SetDevTempSnsEnResp_t)); + /* Set ADRV903X_CPU_CMD_ID_GET_DEVICE_TEMPERATURE command parameters */ + devTempCmd.tempEnData = ADRV903X_HTOCS(*tempEnData); + *tempEnData = 0; + + for (cpuTypeIdx = (uint32_t) ADI_ADRV903X_CPU_TYPE_0; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response; cpu0*/ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_ENABLED_TEMPSENSORS, + (void*)&devTempCmd, + sizeof(devTempCmd), + (void*)&devTempEnCmdResp, + sizeof(devTempEnCmdResp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(devTempEnCmdResp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + else + { + *tempEnData |= ADRV903X_CTOHS(devTempEnCmdResp.tempEnData); + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StreamGpioConfigSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_StreamGpioPinCfg_t* const streamGpioPinCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + int idx = 0; + + adi_adrv903x_GpioSignal_e signals[ADI_ADRV903X_MAX_STREAMGPIO] = { + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_0, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_1, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_2, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_3, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_4, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_5, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_6, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_7, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_8, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_9, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_10, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_11, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_12, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_13, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_14, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_15, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_16, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_17, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_18, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_19, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_20, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_21, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_22, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_23 + }; + + adi_adrv903x_GpioPinSel_e pinSelect = ADI_ADRV903X_GPIO_INVALID; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, streamGpioPinCfg, cleanup); + +#if ADI_ADRV903X_RADIOCTRL_RANGE_CHECK > 0 + recoveryAction = adrv903x_StreamGpioConfigSetRangeCheck(device, + streamGpioPinCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "StreamGpioSignalSetRangeCheck issue"); + goto cleanup; + } +#endif + + /* Release all Stream GPIO if valid */ + for (idx = 0U; idx < ADI_ADRV903X_MAX_STREAMGPIO; idx++) + { + /* Find the signal for this gpio index */ + recoveryAction = adrv903x_GpioSignalFind(device, &pinSelect, signals[idx], ADI_ADRV903X_CHOFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + idx, + "GpioSignalFind issue"); + goto cleanup; + } + + /* Release if pinSelect is valid */ + if (pinSelect != ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = adrv903x_GpioSignalRelease(device, pinSelect, signals[idx], ADI_ADRV903X_CHOFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + idx, + "GpioSignalRelease issue"); + goto cleanup; + } + } + } + + /* Config Stream GPIO if valid */ + for (idx = 0U; idx < ADI_ADRV903X_MAX_STREAMGPIO; idx++) + { + /* Set if pinSelect is valid */ + if (streamGpioPinCfg->streamGpInput[idx] != ADI_ADRV903X_GPIO_INVALID) + { + pinSelect = (adi_adrv903x_GpioPinSel_e)(idx); + + /* Set the signal for this gpio */ + recoveryAction = adrv903x_GpioSignalSet(device, pinSelect, signals[idx], ADI_ADRV903X_CHOFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + idx, + "GpioSignalSet issue"); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StreamGpioConfigGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_StreamGpioPinCfg_t* const streamGpioPinCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + int idx = 0; + adi_adrv903x_GpioSignal_e signals[ADI_ADRV903X_MAX_STREAMGPIO] = { + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_0, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_1, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_2, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_3, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_4, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_5, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_6, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_7, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_8, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_9, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_10, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_11, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_12, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_13, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_14, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_15, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_16, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_17, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_18, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_19, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_20, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_21, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_22, + ADI_ADRV903X_GPIO_SIGNAL_GPIO_STREAM_PROC_PIN_23 + }; + + adi_adrv903x_GpioPinSel_e pinSelect = ADI_ADRV903X_GPIO_INVALID; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, streamGpioPinCfg, cleanup); + + for (idx = 0U; idx < ADI_ADRV903X_MAX_STREAMGPIO; idx++) + { + /* Find the signal for this gpio index */ + recoveryAction = adrv903x_GpioSignalFind(device, &pinSelect, signals[idx], ADI_ADRV903X_CHOFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "GpioSignalGet issue"); + goto cleanup; + } + + streamGpioPinCfg->streamGpInput[idx] = pinSelect; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_OrxNcoFreqCalculate(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e orxChannel, + const uint32_t txSynthesisBwLower_kHz, + const uint32_t txSynthesisBwUpper_kHz, + int32_t* const ncoShiftFreqAdc_kHz, + int32_t* const ncoShiftFreqDatapath_kHz) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint32_t orxChannelIdx = 0U; + uint32_t centreTxSynthesisBw_kHz = (txSynthesisBwLower_kHz + txSynthesisBwUpper_kHz)/2U; + uint32_t boundaryDistanceLower = 0U; + uint32_t boundaryDistanceUpper = 0U; + uint32_t nyquistZone1SynthesisBwUpper = 0U; + uint32_t nyquistZone1SynthesisBwLower = 0U; + uint32_t orxAdcSampleRate_kHz = 0U; + int32_t passbandEdgeShift = 0; + int32_t localNcoShiftFreqAdc_kHz = 0; + uint8_t validRangeSynthesisBw = 0U; + + const uint32_t ORX_ADC_RATE_GUARD_REGION_KHZ = 100000U; /* Distance between the RF synthesis BW edges and multiples of FS/2 */ + const int32_t HB_FILTER_PASSBAND_EDGE_BY_100 = 44; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, ncoShiftFreqAdc_kHz, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, ncoShiftFreqDatapath_kHz, cleanup); + + /* Range check orxChannel enum */ + if ((orxChannel != ADI_ADRV903X_ORX0) && + (orxChannel != ADI_ADRV903X_ORX1)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, orxChannel, "ORx Channel selected is invalid. Must select ORx0-1."); + goto cleanup; + } + + orxChannelIdx = (orxChannel == ADI_ADRV903X_ORX0) ? 0U : 1U; + orxAdcSampleRate_kHz = device->initExtract.orx.orxChannelCfg[orxChannelIdx].orxAdcSampleRate_kHz; + /* Pick only the data that lies in the 0 to Fs region and shift that to DC */ + localNcoShiftFreqAdc_kHz = -(int32_t)(centreTxSynthesisBw_kHz % orxAdcSampleRate_kHz); + /* Recalculate the upper and lower synthesis Bw edges such that it lies in the 0 to Fs region*/ + nyquistZone1SynthesisBwUpper = txSynthesisBwUpper_kHz % orxAdcSampleRate_kHz; + nyquistZone1SynthesisBwLower = txSynthesisBwLower_kHz % orxAdcSampleRate_kHz; + + /* if the RF synthesis BW lies across an Fs boundary, the values of the upper synthesis BW + * would end up lower than the lower synthesis BW edge */ + if (nyquistZone1SynthesisBwUpper < nyquistZone1SynthesisBwLower) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txSynthesisBwUpper_kHz, + "Invalid relation between Tx synthesis bandwidth upper and lower frequencies in the first Nyquist Zone"); + goto cleanup; + } + + /* Make sure the Synthesis Bandwidth is at least 100 MHz away from DC and Fs/2 or Fs/2 and Fs */ + /* If the signal lies in a odd nyquist zones (0 to 0.5*Fs) we need a -ve frequency shift at the NCO */ + if ((nyquistZone1SynthesisBwLower >= (ORX_ADC_RATE_GUARD_REGION_KHZ)) && + (nyquistZone1SynthesisBwUpper <= ((orxAdcSampleRate_kHz / 2U) - ORX_ADC_RATE_GUARD_REGION_KHZ))) + { + validRangeSynthesisBw = ADI_TRUE; + boundaryDistanceUpper = (orxAdcSampleRate_kHz / 2U) - nyquistZone1SynthesisBwUpper; + boundaryDistanceLower = nyquistZone1SynthesisBwLower; + } + + /* If the signal lies in a odd nyquist zones (0.5*Fs to Fs, 1.5*Fs to 2*Fs, 2.5Fs to 3*Fs) + * we need a +ve frequency shift at the NCO */ + if ((nyquistZone1SynthesisBwLower >= ((orxAdcSampleRate_kHz / 2U) + ORX_ADC_RATE_GUARD_REGION_KHZ)) && + (nyquistZone1SynthesisBwUpper <= (orxAdcSampleRate_kHz - ORX_ADC_RATE_GUARD_REGION_KHZ))) + { + validRangeSynthesisBw = ADI_TRUE; + boundaryDistanceUpper = orxAdcSampleRate_kHz - nyquistZone1SynthesisBwUpper; + boundaryDistanceLower = nyquistZone1SynthesisBwLower - (orxAdcSampleRate_kHz / 2U); + } + + /* Case when the Synthesis Bandwidth is very close to the Fs or Fs/2 boundary*/ + if (validRangeSynthesisBw == ADI_FALSE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txSynthesisBwUpper_kHz, + "Invalid range for Tx synthesis bandwidth upper and lower frequencies"); + goto cleanup; + } + + passbandEdgeShift = (int32_t)((HB_FILTER_PASSBAND_EDGE_BY_100 * + device->initExtract.orx.orxChannelCfg[orxChannelIdx].orxOutputRate_kHz) - + ((txSynthesisBwUpper_kHz - centreTxSynthesisBw_kHz) * 100)) / 100; + /* If passbandEdgeShift is less than 0, the synthesis BW is greater than the 88% bandwidth supported by the ORx*/ + if (passbandEdgeShift < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txSynthesisBwUpper_kHz, + "Tx synthesis bandwidth is greater than the maximum supported by the ORX channel"); + goto cleanup; + } + + if (boundaryDistanceLower < boundaryDistanceUpper) + { + /* If the closest image is on the lower side of the SBW, we shift the + * observed synthesis BW to the lower edge the passband (- 0.44 * Fs)*/ + *ncoShiftFreqAdc_kHz = localNcoShiftFreqAdc_kHz - passbandEdgeShift; + *ncoShiftFreqDatapath_kHz = passbandEdgeShift; + } + else + { + /* If the closest image is on the upper side of the SBW, we shift the + * observed synthesis BW to the upper edge the passband (+ 0.44 * Fs)*/ + *ncoShiftFreqAdc_kHz = localNcoShiftFreqAdc_kHz + passbandEdgeShift; + *ncoShiftFreqDatapath_kHz = -passbandEdgeShift; + } + + /* Success */ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingInit(adi_adrv903x_Device_t* const device) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + + /* Initializes the Tx To Orx Mapping Config, including its GPIOs */ + recoveryAction = adrv903x_TxToOrxMappingInit(device, &device->devStateInfo.txToOrxMappingConfig); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Tx To Orx Mapping Init Failed"); + goto cleanup; + } + cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingConfigGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TxToOrxMappingConfig_t* const mappingConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common) ; + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, mappingConfig, cleanup); + + /* Grab configuration stored in the device handle*/ + ADI_LIBRARY_MEMCPY(mappingConfig, &device->devStateInfo.txToOrxMappingConfig, sizeof(adi_adrv903x_TxToOrxMappingConfig_t)); + + /*Success*/ + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingSet(adi_adrv903x_Device_t* const device, + const uint8_t mapping) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t modeMask = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Get modeMask from the mode*/ + switch (device->devStateInfo.txToOrxMappingConfig.mode) + { + case ADI_ADRV903X_TX_ORX_MAPPING_MODE_2BIT: + modeMask = 0x03U; + break; + case ADI_ADRV903X_TX_ORX_MAPPING_MODE_3BIT: + modeMask = 0x07U; + break; + case ADI_ADRV903X_TX_ORX_MAPPING_MODE_4BIT: + modeMask = 0x0FU; + break; + case ADI_ADRV903X_TX_ORX_MAPPING_MODE_6BIT: + modeMask = 0x3FU; + break; + case ADI_ADRV903X_TX_ORX_MAPPING_MODE_8BIT: /* Fallthrough */ + default: + modeMask = 0xFFU; + break; + } + + /* Range check mapping byte against Mapping Mode */ + if ((mapping & modeMask) != mapping) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + mapping, + "Tx to Orx Mapping byte requested is not valid for use with the device's Mapping Mode configuration"); + goto cleanup; + } + + /* Write mapping byte to scratch reg for the stream to readback */ + recoveryAction = adrv903x_Core_ScratchReg_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + ADRV903X_CPU_TX_ORX_MAPPING_SET_SCRATCH_REG_ID, + mapping); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Error while setting Tx to ORx mapping selection."); + goto cleanup; + } + + /* Trigger stream */ + recoveryAction = adrv903x_StreamTrigger(device, ADRV903X_STREAM_MAIN_TX_TO_ORX_MAP); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while triggering Core Stream to apply Tx to Orx mapping"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e orxChannel, + adi_adrv903x_TxChannels_e* const txChannel) +{ + static const uint8_t NIBBLE_TX_MASK = 0x07U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t readNibble = 0U; + uint8_t txIdx = 0U; + uint8_t noMapState = 0U; + uint32_t txChanSel = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common) ; + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txChannel, cleanup); + + /* Range check orxChannel enum */ + if ((orxChannel != ADI_ADRV903X_ORX0) && + (orxChannel != ADI_ADRV903X_ORX1)) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + orxChannel, + "ORx Channel selected is invalid. Must select ORx0-1.") ; + goto cleanup; + } + + /* Readback current mapping */ + if (orxChannel == ADI_ADRV903X_ORX0) + { + recoveryAction = adrv903x_Core_RadioControlInterfaceOrx0Map_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &readNibble); + } + else + { + recoveryAction = adrv903x_Core_RadioControlInterfaceOrx1Map_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + &readNibble); + } + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, + recoveryAction, + "Error while retrieving current Tx to ORx map for selected ORx channel."); + goto cleanup; + } + + + /* Use mapping mode and tx observability to translate value to tx channel*/ + static const uint8_t NIBBLE_MSB = 0x08U; + noMapState = (NIBBLE_MSB & readNibble) ? ADI_TRUE : ADI_FALSE; + + if (noMapState ) + { + *txChannel = ADI_ADRV903X_TXOFF; + } + else + { + txIdx = NIBBLE_TX_MASK & readNibble; + txChanSel = 1U << (uint32_t)txIdx; + *txChannel = (adi_adrv903x_TxChannels_e)(txChanSel); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingPresetAttenSet( adi_adrv903x_Device_t* const device, + const uint32_t mapping, + const uint8_t presetAtten_dB, + const uint8_t immediateUpdate) +{ + static const uint8_t MAX_ORX_ATTEN_DB = 16U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t txIdx = 0U; + uint32_t txChannelMask = (mapping & (~TX_TO_ORX_EXTENDED_MAPPING_FLAG)); + uint32_t extendedMappingFlag = (mapping & TX_TO_ORX_EXTENDED_MAPPING_FLAG); + uint8_t tmpMask = 0U; + adi_adrv903x_Channels_e tmpChannel = ADI_ADRV903X_CHOFF; + uint8_t sendToCpu[ADI_ADRV903X_CPU_TYPE_MAX_RADIO] = { ADI_FALSE, ADI_FALSE }; + uint8_t txChanMaskForCpu[ADI_ADRV903X_CPU_TYPE_MAX_RADIO] = { 0U }; + uint32_t cpuIdx = 0U; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + + adrv903x_CpuCmd_SetTxToOrxPresetAtten_t cmd; + adrv903x_CpuCmd_SetTxToOrxPresetAttenResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_MAILBOX_ERROR; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_LIBRARY_MEMSET(&cmd, 0, sizeof(adrv903x_CpuCmd_SetTxToOrxPresetAtten_t)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(adrv903x_CpuCmd_SetTxToOrxPresetAttenResp_t)); + + /* Check that requested mapping are valid */ + if ((txChannelMask != (txChannelMask & 0x00FFU)) || /* Value Not in Range 0x00 to 0xFF */ + (mapping == TX_TO_ORX_EXTENDED_MAPPING_FLAG) || /* Extended Flag & 0x00 Bitmask */ + (txChannelMask == 0U)) /* 0x00 Bitmask */ + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txChannelMask, + "Requested Mapping is Invalid"); + goto cleanup; + } + + /* Check preset value is valid */ + if (presetAtten_dB > MAX_ORX_ATTEN_DB) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + presetAtten_dB, + "presetAtten_dB outside maximum range"); + goto cleanup; + } + + /* Check that immediateUpdate is valid */ + if ((immediateUpdate != ADI_TRUE) && + (immediateUpdate != ADI_FALSE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + immediateUpdate, + "immediateUpdate is invalid. Must be 0 or 1."); + goto cleanup; + } + + /* Check that immediateUpdate is valid for State Mappings */ + if ((immediateUpdate == ADI_TRUE) && + (extendedMappingFlag == TX_TO_ORX_EXTENDED_MAPPING_FLAG)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + immediateUpdate, + "Immediate Update Cannot Be Performed with a State Mapping"); + goto cleanup; + } + + if (extendedMappingFlag == TX_TO_ORX_EXTENDED_MAPPING_FLAG) + { + /* State Mapping Specific Command */ + cmd.extendedMappingFlag = ADI_TRUE; + sendToCpu[0U] = ADI_TRUE; + cmd.chanSelect = txChannelMask; + } + else + { + for (txIdx = 0U; txIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++txIdx) + { + /* Get channel number enum for this txIdx */ + tmpMask = (1U << txIdx); + tmpMask = (tmpMask & ((uint8_t) txChannelMask)); + tmpChannel = (adi_adrv903x_Channels_e)(tmpMask); + + /* If channel enum is TXOFF, skip this channel */ + if (tmpChannel == ADI_ADRV903X_CHOFF) + { + continue; + } + + /* Get the CPU assigned to this channel*/ + recoveryAction = adrv903x_CpuChannelMappingGet( device, tmpChannel, ADRV903X_CPU_OBJID_SYSTEM_END, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get CPU channel mapping"); + goto cleanup; + } + + /* Set bit for target CPU */ + cpuIdx = (uint8_t)(cpuType); + sendToCpu[cpuIdx] = ADI_TRUE; + txChanMaskForCpu[cpuIdx] |= tmpMask; + } + } + + /* Loop through CPUs and send CPU cmd to only those required */ + for (cpuIdx = 0U; cpuIdx < (uint32_t)ADI_ADRV903X_CPU_TYPE_MAX_RADIO; cpuIdx++) + { + if (sendToCpu[cpuIdx] == ADI_TRUE) + { + /* Set cpuType */ + cpuType = (adi_adrv903x_CpuType_e)cpuIdx; + + /* Setup cmd-specific payload */ + if (extendedMappingFlag != TX_TO_ORX_EXTENDED_MAPPING_FLAG) + { + cmd.chanSelect = txChanMaskForCpu[cpuIdx]; + } + cmd.presetAtten_dB = (uint8_t) presetAtten_dB; + cmd.immediateUpdate = (uint8_t) immediateUpdate; + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_TX_TO_ORX_PRESET_ATTEN, + (void*)&cmd, + sizeof(cmd), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingPresetAttenGet_v2( adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxToOrxMappingPinTable_e mapping, + uint8_t* const presetAtten_dB) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t scratchRegId = 0U; + uint8_t scratchAttenVal = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, presetAtten_dB, cleanup); + + *presetAtten_dB = 0U; + + /* Check that requested Mapping is valid and determine scratchpadRegId for selected Mapping */ + switch (mapping) + { + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX0: + scratchRegId = ADRV903X_CPU_TX_0_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX1: + scratchRegId = ADRV903X_CPU_TX_1_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX2: + scratchRegId = ADRV903X_CPU_TX_2_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX3: + scratchRegId = ADRV903X_CPU_TX_3_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX4: + scratchRegId = ADRV903X_CPU_TX_4_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX5: + scratchRegId = ADRV903X_CPU_TX_5_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX6: + scratchRegId = ADRV903X_CPU_TX_6_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX7: + scratchRegId = ADRV903X_CPU_TX_7_ORX_ATTEN; + break; + + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_0: + scratchRegId = ADRV903X_CPU_MAPVAL_9_ATTEN; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_1: + scratchRegId = ADRV903X_CPU_MAPVAL_A_ATTEN; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_2: + scratchRegId = ADRV903X_CPU_MAPVAL_B_ATTEN; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_3: + scratchRegId = ADRV903X_CPU_MAPVAL_C_ATTEN; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_4: + scratchRegId = ADRV903X_CPU_MAPVAL_D_ATTEN; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_5: + scratchRegId = ADRV903X_CPU_MAPVAL_E_ATTEN; + break; + + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + mapping, + "Requested Mapping is Invalid - Check adi_adrv903x_TxToOrxMapping_e for Valid Values"); + goto cleanup; + break; + } + + /* Readback Scratchpad value */ + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + scratchRegId, + &scratchAttenVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read Tx to Orx Preset value for Orx Atten"); + goto cleanup; + } + + /* Convert to dB, same as in OrxAttenGet*/ + recoveryAction = adrv903x_ORxTrmAttenToDb(device, scratchAttenVal, presetAtten_dB); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to resolve Orx Atten value in dB for Tx to Orx Preset"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingPresetAttenGet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + uint8_t* const presetAtten_dB) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t scratchRegId = 0U; + uint8_t scratchAttenVal = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, presetAtten_dB, cleanup); + + /* Check that requested Tx channel is valid and determine scratchpadRegId for selected channel */ + switch (txChannel) + { + case ADI_ADRV903X_TX0: + scratchRegId = ADRV903X_CPU_TX_0_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX1: + scratchRegId = ADRV903X_CPU_TX_1_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX2: + scratchRegId = ADRV903X_CPU_TX_2_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX3: + scratchRegId = ADRV903X_CPU_TX_3_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX4: + scratchRegId = ADRV903X_CPU_TX_4_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX5: + scratchRegId = ADRV903X_CPU_TX_5_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX6: + scratchRegId = ADRV903X_CPU_TX_6_ORX_ATTEN; + break; + + case ADI_ADRV903X_TX7: + scratchRegId = ADRV903X_CPU_TX_7_ORX_ATTEN; + break; + + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txChannel, + "Requested Tx channel is invalid. Must be Tx Channel 0-7."); + goto cleanup; + break; + } + + /* Readback Scratchpad value */ + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + scratchRegId, + &scratchAttenVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read Tx to Orx Preset value for Orx Atten"); + goto cleanup; + } + + /* Convert to dB, same as in OrxAttenGet*/ + recoveryAction = adrv903x_ORxTrmAttenToDb(device, scratchAttenVal, presetAtten_dB); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to resolve Orx Atten value in dB for Tx to Orx Preset"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingPresetNcoSet( adi_adrv903x_Device_t* const device, + const uint32_t mapping, + const adi_adrv903x_TxToOrxMappingPresetNco_t* const presetNco, + const uint8_t immediateUpdate) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t txIdx = 0U; + uint32_t txChannelMask = (mapping & (~TX_TO_ORX_EXTENDED_MAPPING_FLAG)); + uint32_t extendedMappingFlag = (mapping & TX_TO_ORX_EXTENDED_MAPPING_FLAG); + uint8_t tmpMask = 0U; + adi_adrv903x_Channels_e tmpChannel = ADI_ADRV903X_CHOFF; + uint8_t sendToCpu[ADI_ADRV903X_CPU_TYPE_MAX_RADIO] = { ADI_FALSE, ADI_FALSE }; + uint8_t txChanMaskForCpu[ADI_ADRV903X_CPU_TYPE_MAX_RADIO] = { 0U }; + uint32_t cpuIdx = 0U; + adi_adrv903x_CpuType_e cpuType = ADI_ADRV903X_CPU_TYPE_UNKNOWN; + + adrv903x_CpuCmd_SetTxToOrxPresetNco_t cmd; + adrv903x_CpuCmd_SetTxToOrxPresetNcoResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_MAILBOX_ERROR; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common) ; + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, presetNco, cleanup); + + ADI_LIBRARY_MEMSET(&cmd, 0, sizeof(adrv903x_CpuCmd_SetTxToOrxPresetNco_t)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(adrv903x_CpuCmd_SetTxToOrxPresetNcoResp_t)); + + /* Check that requested mapping are valid */ + if ((txChannelMask != (txChannelMask & 0x00FFU)) || /* Value Not in Range 0x00 to 0xFF */ + (mapping == TX_TO_ORX_EXTENDED_MAPPING_FLAG) || /* Extended Flag & 0x00 Bitmask */ + (txChannelMask == 0U)) /* 0x00 Bitmask */ + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txChannelMask, + "Requested Mapping is Invalid"); + goto cleanup; + } + + /* Check preset adc nco freq value is valid */ + if ((presetNco->ncoFreqAdc_Khz > 8388607) || + (presetNco->ncoFreqAdc_Khz < -8388608)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + presetNco->ncoFreqAdc_Khz, + "presetNco->ncoFreqAdc_Khz outside maximum range. Must be in range -8388608 to 8388607"); + goto cleanup; + } + + /* Check preset datapath nco freq value is valid */ + if ((presetNco->ncoFreqDatapath_Khz > 8388607) || + (presetNco->ncoFreqDatapath_Khz < -8388608)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + presetNco->ncoFreqDatapath_Khz, + "presetNco->ncoFreqDatapath_Khz outside maximum range. Must be in range -8388608 to 8388607"); + goto cleanup; + } + + /* Check that immediateUpdate is valid */ + if ((immediateUpdate != ADI_TRUE) && + (immediateUpdate != ADI_FALSE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + immediateUpdate, + "immediateUpdate is invalid. Must be 0 or 1."); + goto cleanup; + } + + /* Check that immediateUpdate is valid for State Mappings */ + if ((immediateUpdate == ADI_TRUE) && + (extendedMappingFlag == TX_TO_ORX_EXTENDED_MAPPING_FLAG)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + immediateUpdate, + "Immediate Update Cannot Be Performed with a State Mapping"); + goto cleanup; + } + + if (extendedMappingFlag == TX_TO_ORX_EXTENDED_MAPPING_FLAG) + { + /* State Mapping Specific Command */ + cmd.extendedMappingFlag = ADI_TRUE; + sendToCpu[0U] = ADI_TRUE; + cmd.chanSelect = txChannelMask; + } + else + { + for (txIdx = 0U; txIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++txIdx) + { + /* Get channel number enum for this txIdx */ + tmpMask = (1U << txIdx); + tmpMask &= txChannelMask; + tmpChannel = (adi_adrv903x_Channels_e)(tmpMask); + + /* If channel enum is TXOFF, skip this channel */ + if (tmpChannel == ADI_ADRV903X_CHOFF) + { + continue; + } + + /* Get the CPU assigned to this channel */ + recoveryAction = adrv903x_CpuChannelMappingGet(device, tmpChannel, ADRV903X_CPU_OBJID_SYSTEM_END, &cpuType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get CPU channel mapping"); + goto cleanup; + } + + /* Set bit for target CPU */ + cpuIdx = (uint8_t)(cpuType); + sendToCpu[cpuIdx] = ADI_TRUE; + txChanMaskForCpu[cpuIdx] |= tmpMask; + } + } + + /* Loop through CPUs and send ARM cmd to only those required */ + for (cpuIdx = 0U; cpuIdx < (uint32_t)ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuIdx) + { + if (sendToCpu[cpuIdx] == ADI_TRUE) + { + /* Set cpuType */ + cpuType = (adi_adrv903x_CpuType_e)cpuIdx; + + /* Setup cmd-specific payload */ + if (extendedMappingFlag != TX_TO_ORX_EXTENDED_MAPPING_FLAG) + { + cmd.chanSelect = txChanMaskForCpu[cpuIdx]; + } + cmd.ncoFreqAdc_Khz = ADRV903X_HTOCL(presetNco->ncoFreqAdc_Khz); + cmd.ncoFreqDatapath_Khz = ADRV903X_HTOCL(presetNco->ncoFreqDatapath_Khz); + cmd.immediateUpdate = immediateUpdate; + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_TX_TO_ORX_PRESET_NCO, + (void*)&cmd, + sizeof(cmd), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingPresetNcoGet_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxToOrxMappingPinTable_e mapping, + adi_adrv903x_TxToOrxMappingPresetNco_t* const presetNco) +{ + const uint8_t NCO_NUM_BYTES = 3U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t scratchRegIdStart_adc = 0U; + uint8_t scratchRegIdStart_dp = 0U; + uint8_t tmpByte = 0U; + uint32_t tmpAdc = 0U; + uint32_t tmpDp = 0U; + uint8_t idx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, presetNco, cleanup); + + ADI_LIBRARY_MEMSET(presetNco, 0, sizeof(adi_adrv903x_TxToOrxMappingPresetNco_t)); + + /* Check that requested Tx channel is valid and determine scratchpadRegIdStart for selected channel */ + switch (mapping) + { + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX0: + scratchRegIdStart_adc = ADRV903X_CPU_TX_0_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_0_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX1: + scratchRegIdStart_adc = ADRV903X_CPU_TX_1_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_1_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX2: + scratchRegIdStart_adc = ADRV903X_CPU_TX_2_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_2_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX3: + scratchRegIdStart_adc = ADRV903X_CPU_TX_3_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_3_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX4: + scratchRegIdStart_adc = ADRV903X_CPU_TX_4_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_4_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX5: + scratchRegIdStart_adc = ADRV903X_CPU_TX_5_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_5_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX6: + scratchRegIdStart_adc = ADRV903X_CPU_TX_6_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_6_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_TX7: + scratchRegIdStart_adc = ADRV903X_CPU_TX_7_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_7_ORX_NCO_DP_FREQ_MSB; + break; + + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_0: + scratchRegIdStart_adc = ADRV903X_CPU_MAPVAL_9_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_MAPVAL_9_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_1: + scratchRegIdStart_adc = ADRV903X_CPU_MAPVAL_A_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_MAPVAL_A_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_2: + scratchRegIdStart_adc = ADRV903X_CPU_MAPVAL_B_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_MAPVAL_B_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_3: + scratchRegIdStart_adc = ADRV903X_CPU_MAPVAL_C_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_MAPVAL_C_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_4: + scratchRegIdStart_adc = ADRV903X_CPU_MAPVAL_D_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_MAPVAL_D_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX_ORX_MAPPING_PIN_TABLE_STATE_5: + scratchRegIdStart_adc = ADRV903X_CPU_MAPVAL_E_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_MAPVAL_E_NCO_DP_FREQ_MSB; + break; + + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + mapping, + "Requested Mapping is Invalid - Check adi_adrv903x_TxToOrxMappingPinTable_e for Valid Values"); + goto cleanup; + break; + } + + /* Readback Scratchpad values */ + for (idx = 0U; idx < NCO_NUM_BYTES; ++idx) + { + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + (scratchRegIdStart_adc - idx), + &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read Tx to Orx Preset value for Orx ADC NCO"); + goto cleanup; + } + tmpAdc <<= 8U; + tmpAdc |= ((uint32_t)tmpByte); + + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + (scratchRegIdStart_dp - idx), + &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read Tx to Orx Preset value for Orx Datapath NCO"); + goto cleanup; + } + tmpDp <<= 8U; + tmpDp |= ((uint32_t)tmpByte); + } + + /* Readback values are 24bits. Returned results are int32_t, so sign extend data as needed */ + if ((tmpAdc & 0x00800000U) != 0U) + { + tmpAdc |= 0xFF000000U; + } + + if ((tmpDp & 0x00800000U) != 0U) + { + tmpDp |= 0xFF000000U; + } + + /* Store results */ + presetNco->ncoFreqAdc_Khz = (int32_t)tmpAdc; + presetNco->ncoFreqDatapath_Khz = (int32_t)tmpDp; + + cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxToOrxMappingPresetNcoGet( adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxToOrxMappingPresetNco_t* const presetNco) +{ + const uint8_t NCO_NUM_BYTES = 3U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t scratchRegIdStart_adc = 0U; + uint8_t scratchRegIdStart_dp = 0U; + uint8_t tmpByte = 0U; + uint32_t tmpAdc = 0U; + uint32_t tmpDp = 0U; + uint8_t idx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, presetNco, cleanup); + + ADI_LIBRARY_MEMSET(presetNco, 0, sizeof(adi_adrv903x_TxToOrxMappingPresetNco_t)); + + /* Check that requested Tx channel is valid and determine scratchpadRegIdStart for selected channel */ + switch (txChannel) + { + case ADI_ADRV903X_TX0: + scratchRegIdStart_adc = ADRV903X_CPU_TX_0_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_0_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX1: + scratchRegIdStart_adc = ADRV903X_CPU_TX_1_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_1_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX2: + scratchRegIdStart_adc = ADRV903X_CPU_TX_2_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_2_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX3: + scratchRegIdStart_adc = ADRV903X_CPU_TX_3_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_3_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX4: + scratchRegIdStart_adc = ADRV903X_CPU_TX_4_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_4_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX5: + scratchRegIdStart_adc = ADRV903X_CPU_TX_5_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_5_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX6: + scratchRegIdStart_adc = ADRV903X_CPU_TX_6_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_6_ORX_NCO_DP_FREQ_MSB; + break; + + case ADI_ADRV903X_TX7: + scratchRegIdStart_adc = ADRV903X_CPU_TX_7_ORX_NCO_ADC_FREQ_MSB; + scratchRegIdStart_dp = ADRV903X_CPU_TX_7_ORX_NCO_DP_FREQ_MSB; + break; + + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txChannel, + "Requested Tx channel is invalid. Must be Tx Channel 0-7."); + goto cleanup; + break; + } + + /* Readback Scratchpad values */ + for (idx = 0U; idx < NCO_NUM_BYTES; idx++) + { + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + (scratchRegIdStart_adc - idx), + &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read Tx to Orx Preset value for Orx ADC NCO"); + goto cleanup; + } + tmpAdc <<= 8U; + tmpAdc |= ((uint32_t) tmpByte); + + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + (scratchRegIdStart_dp - idx), + &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read Tx to Orx Preset value for Orx Datapath NCO"); + goto cleanup; + } + tmpDp <<= 8U; + tmpDp |= ((uint32_t) tmpByte); + } + + /* Readback values are 24bits. Returned results are int32_t, so sign extend data as needed */ + if ((tmpAdc & 0x00800000U) != 0U) + { + tmpAdc |= 0xFF000000U; + } + + if ((tmpDp & 0x00800000U) != 0U) + { + tmpDp |= 0xFF000000U; + } + + /* Store results */ + presetNco->ncoFreqAdc_Khz = (int32_t)tmpAdc; + presetNco->ncoFreqDatapath_Khz = (int32_t)tmpDp; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StreamVersionGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_Version_t* const streamVersion) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t ver[4U] = { 0U }; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, streamVersion, cleanup); + + if ((device->devStateInfo.devState & ADI_ADRV903X_STATE_STREAMLOADED) != ADI_ADRV903X_STATE_STREAMLOADED) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Stream binary must be loaded before getting stream version"); + goto cleanup; + } + + /* Read the StreamVersion */ + recoveryAction = adi_adrv903x_Registers32Read(device, NULL, ADI_ADRV903X_STREAM_VERSION_ADDR, ver, NULL, 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue during Reading Stream Version registers"); + goto cleanup; + } + /* Store the StreamVersion */ + streamVersion->majorVer = ver[0U]; + streamVersion->minorVer = ver[1U]; + streamVersion->maintenanceVer = ver[2U]; + streamVersion->buildVer = ver[3U]; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalConfigSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_RxRadioCtrlAntennaCalConfig_t * const configRx, + adi_adrv903x_TxRadioCtrlAntennaCalConfig_t * const configTx) +{ + + static const uint32_t txScratchPad2[] = { (uint32_t)ADRV903X_ADDR_TX0_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX1_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX2_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX3_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX4_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX5_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX6_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX7_STREAM_SCRATCH2 }; + + static const uint32_t rxScratchPad2[] = { (uint32_t)ADRV903X_ADDR_RX0_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX1_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX2_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX3_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX4_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX5_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX6_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX7_STREAM_SCRATCH2 }; + + static const uint32_t TX_SCRATCH2_WRITE_MASK = 0x00FFFFFFU; + static const uint32_t RX_SCRATCH_WRITE_MASK = 0xFFFFFFFFU; + static const uint32_t RX_SCRATCH_WRITE_SHIFT = 24U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t txScratch2WriteValue = 0U; + uint32_t rxScratchWriteValue = 0U; + adi_adrv903x_RxGain_t rxGain; + uint16_t attenRegVal = 0U; + uint32_t chanId = 0U; + uint32_t chanSel = 0U; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, configRx, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, configTx, cleanup); + + ADI_LIBRARY_MEMSET(&rxGain, 0, sizeof(rxGain)); + + /*Check that if requested Rx Channel valid*/ + if ((configRx->rxChannelMask & (~(uint32_t)ADI_ADRV903X_RX_MASK_ALL)) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + configRx->rxChannelMask, + "Invalid channel is selected for Rx config. Valid values are 0 or any combinations of Rx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + if ((configTx->txChannelMask & (~(uint32_t)ADI_ADRV903X_TXALL)) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + configTx->txChannelMask, + "Invalid channel is selected for Tx config. Valid values are 0 or any combinations of Tx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + txScratch2WriteValue = (uint32_t)(configTx->txNcoFreqKhz) & TX_SCRATCH2_WRITE_MASK; + /* Change the sign of the frequency because there is an I/Q swap in the HW */ + rxScratchWriteValue = (((uint32_t)configRx->rxGainIndex & 0x000000FF) << RX_SCRATCH_WRITE_SHIFT) | + ((uint32_t)(-configRx->rxNcoFreqKhz) & 0x00FFFFFF); + + /* for each Tx channel in txChannelMask */ + for (chanId = 0U; chanId < ADI_ADRV903X_MAX_TXCHANNELS; chanId++) + { + if ((configTx->txChannelMask & (1U << chanId)) == 0U) + { + /* Skip channel. It's not in chanMask. */ + continue; + } + + if (configTx->txAttenuation_mdB > ADRV903X_TX_ATTEN_VALUE_MILLI_DB_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + configTx->txAttenuation_mdB, + "Invalid txAttenuation_mdB value"); + goto cleanup; + } + + /* ChanId is selected in chanMask */ + chanSel = (1U << chanId); + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanId, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + /* Conversion from the requested atten level (milli-dB) to equivalent + * TxAttenTable index is always done based on a step size of 0.05. + * Other step sizes are not supported. */ + attenRegVal = (configTx->txAttenuation_mdB / ADRV903X_TX_ATTEN_STEP_SIZE_DIV_0P05); + + recoveryAction = adrv903x_TxFuncs_TxAttenuation_BfSet(device, + NULL, + txBaseAddr, + attenRegVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Input Select"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, txScratchPad2[chanId], txScratch2WriteValue, TX_SCRATCH2_WRITE_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot write Tx scratch pad register 2"); + goto cleanup; + } + } + + /* for each Rx channel in rxChannelMask */ + for (chanId = 0U; chanId < ADI_ADRV903X_MAX_RX_ONLY; chanId++) + { + if ((configRx->rxChannelMask & (1U << chanId)) == 0) + { + /* Skip channel. It's not in chanMask. */ + continue; + } + + rxGain.gainIndex = configRx->rxGainIndex; + rxGain.rxChannelMask = configRx->rxChannelMask; + + recoveryAction = adrv903x_RxGainSetRangeCheck(device, &rxGain, 1); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Rx gain is out of range"); + goto cleanup; + } + + /* ChanId is selected in chanMask */ + recoveryAction = adi_adrv903x_Register32Write(device, NULL, rxScratchPad2[chanId], rxScratchWriteValue, RX_SCRATCH_WRITE_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot write Rx scratch pad register 2"); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalConfigGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_RxRadioCtrlAntennaCalConfig_t * const configRx, + adi_adrv903x_TxRadioCtrlAntennaCalConfig_t * const configTx) +{ + + static const uint32_t txScratchPad2[] = { + (uint32_t)ADRV903X_ADDR_TX0_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX1_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX2_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX3_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX4_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX5_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX6_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX7_STREAM_SCRATCH2 + }; + + static const uint32_t rxScratchPad2[] = { + (uint32_t)ADRV903X_ADDR_RX0_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX1_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX2_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX3_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX4_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX5_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX6_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX7_STREAM_SCRATCH2 + }; + + static const uint32_t TX_SCRATCH2_READ_MASK = 0x00FFFFFFU; + static const uint32_t RX_SCRATCH2_READ_MASK = 0xFFFFFFFFU; + static const uint32_t RX_SCRATCH2_READ_SHIFT = 24U; + static const uint32_t NCO_SIGN_MASK = 0x00800000U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t txScratch2ReadValue = 0U; + uint32_t rxScratch2ReadValue = 0U; + uint16_t attenRegVal = 0U; + uint32_t txChanId = 0U; + uint32_t rxChanId = 0U; + uint32_t chanSel = 0U; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, configRx, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, configTx, cleanup); + + if ((configRx->rxChannelMask != (uint32_t)ADI_ADRV903X_RXOFF) && + (configRx->rxChannelMask != (uint32_t)ADI_ADRV903X_RX0) && + (configRx->rxChannelMask != (uint32_t)ADI_ADRV903X_RX1) && + (configRx->rxChannelMask != (uint32_t)ADI_ADRV903X_RX2) && + (configRx->rxChannelMask != (uint32_t)ADI_ADRV903X_RX3) && + (configRx->rxChannelMask != (uint32_t)ADI_ADRV903X_RX4) && + (configRx->rxChannelMask != (uint32_t)ADI_ADRV903X_RX5) && + (configRx->rxChannelMask != (uint32_t)ADI_ADRV903X_RX6) && + (configRx->rxChannelMask != (uint32_t)ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + configRx->rxChannelMask, + "Invalid Rx channel is selected. User should select one channel or CHOFF only"); + goto cleanup; + } + + if ((configTx->txChannelMask != (uint32_t)ADI_ADRV903X_TXOFF) && + (configTx->txChannelMask != (uint32_t)ADI_ADRV903X_TX0) && + (configTx->txChannelMask != (uint32_t)ADI_ADRV903X_TX1) && + (configTx->txChannelMask != (uint32_t)ADI_ADRV903X_TX2) && + (configTx->txChannelMask != (uint32_t)ADI_ADRV903X_TX3) && + (configTx->txChannelMask != (uint32_t)ADI_ADRV903X_TX4) && + (configTx->txChannelMask != (uint32_t)ADI_ADRV903X_TX5) && + (configTx->txChannelMask != (uint32_t)ADI_ADRV903X_TX6) && + (configTx->txChannelMask != (uint32_t)ADI_ADRV903X_TX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + configTx->txChannelMask, + "Invalid Tx channel is selected. User should select one channel or CHOFF only"); + goto cleanup; + } + + if (configTx->txChannelMask == (uint32_t)ADI_ADRV903X_TXOFF) + { + configTx->txAttenuation_mdB = 0U; + configTx->txNcoFreqKhz = 0; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + else + { + chanSel = configTx->txChannelMask; + txChanId = adrv903x_TxChannelsToId((adi_adrv903x_TxChannels_e)chanSel); + + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanSel, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_TxAttenuation_BfGet(device, + NULL, + txBaseAddr, + &attenRegVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx slice attenuation"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Read(device, NULL, txScratchPad2[txChanId], &txScratch2ReadValue, TX_SCRATCH2_READ_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot read Tx scratch pad register 2"); + goto cleanup; + } + + if ((txScratch2ReadValue & NCO_SIGN_MASK) > 0) + { + /* handle the negative case */ + configTx->txNcoFreqKhz = (int32_t)((~txScratch2ReadValue & 0x00FFFFFF) + 1) * (-1); + } + else + { + /* handle the positive case */ + configTx->txNcoFreqKhz = (int32_t)(txScratch2ReadValue & 0x00FFFFFF); + } + + /* Conversion from the atten level (milli-dB) to equivalent + * TxAttenTable index is always done based on a step size of 0.05. + * Other step sizes are not supported. */ + configTx->txAttenuation_mdB = (attenRegVal * ADRV903X_TX_ATTEN_STEP_SIZE_DIV_0P05); + } + + if (configRx->rxChannelMask == (uint32_t)ADI_ADRV903X_RXOFF) + { + configRx->rxGainIndex = 0U; + configRx->rxNcoFreqKhz = 0; + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + else + { + chanSel = configRx->rxChannelMask; + rxChanId = adrv903x_RxChannelsToId((adi_adrv903x_RxChannels_e)chanSel); + + recoveryAction = adi_adrv903x_Register32Read(device, NULL, rxScratchPad2[rxChanId], &rxScratch2ReadValue, RX_SCRATCH2_READ_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot read Rx scratch pad register 2"); + goto cleanup; + } + + if ((rxScratch2ReadValue & NCO_SIGN_MASK) > 0) + { + /* handle the negative case */ + configRx->rxNcoFreqKhz = (int32_t)((~rxScratch2ReadValue & 0x00FFFFFF) + 1) * (-1); + } + else + { + /* handle the positive case */ + configRx->rxNcoFreqKhz = (int32_t)(rxScratch2ReadValue & 0x00FFFFFF); + } + configRx->rxNcoFreqKhz *= (-1); /* Change the sign of the frequency because there is an I/Q swap in the HW */ + + configRx->rxGainIndex = (rxScratch2ReadValue >> RX_SCRATCH2_READ_SHIFT); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalErrorGet(adi_adrv903x_Device_t* const device, + const uint32_t channelSel, + uint8_t * const errStatus) +{ + static const uint32_t txScratchPad1[] = { + (uint32_t)ADRV903X_ADDR_TX0_STREAM_SCRATCH1, + (uint32_t)ADRV903X_ADDR_TX1_STREAM_SCRATCH1, + (uint32_t)ADRV903X_ADDR_TX2_STREAM_SCRATCH1, + (uint32_t)ADRV903X_ADDR_TX3_STREAM_SCRATCH1, + (uint32_t)ADRV903X_ADDR_TX4_STREAM_SCRATCH1, + (uint32_t)ADRV903X_ADDR_TX5_STREAM_SCRATCH1, + (uint32_t)ADRV903X_ADDR_TX6_STREAM_SCRATCH1, + (uint32_t)ADRV903X_ADDR_TX7_STREAM_SCRATCH1 + }; + + static const uint32_t rxScratchPad0[] = { + (uint32_t)ADRV903X_ADDR_RX0_STREAM_SCRATCH0, + (uint32_t)ADRV903X_ADDR_RX1_STREAM_SCRATCH0, + (uint32_t)ADRV903X_ADDR_RX2_STREAM_SCRATCH0, + (uint32_t)ADRV903X_ADDR_RX3_STREAM_SCRATCH0, + (uint32_t)ADRV903X_ADDR_RX4_STREAM_SCRATCH0, + (uint32_t)ADRV903X_ADDR_RX5_STREAM_SCRATCH0, + (uint32_t)ADRV903X_ADDR_RX6_STREAM_SCRATCH0, + (uint32_t)ADRV903X_ADDR_RX7_STREAM_SCRATCH0 + }; + + static const uint32_t TX_ANT_CAL_ERROR_READ_MASK = 0x000000D8U; + static const uint32_t RX_ANT_CAL_ERROR_READ_MASK = 0x00000CC0U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t txScratch1ReadValue = 0U; + uint32_t rxScratch0ReadValue = 0U; + uint32_t chanId = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, errStatus, cleanup); + + if ((channelSel != (uint32_t)ADI_ADRV903X_CH0) && + (channelSel != (uint32_t)ADI_ADRV903X_CH1) && + (channelSel != (uint32_t)ADI_ADRV903X_CH2) && + (channelSel != (uint32_t)ADI_ADRV903X_CH3) && + (channelSel != (uint32_t)ADI_ADRV903X_CH4) && + (channelSel != (uint32_t)ADI_ADRV903X_CH5) && + (channelSel != (uint32_t)ADI_ADRV903X_CH6) && + (channelSel != (uint32_t)ADI_ADRV903X_CH7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + channelSel, + "Invalid channel is selected. User should select one channel only"); + goto cleanup; + + } + + chanId = adrv903x_TxChannelsToId((adi_adrv903x_TxChannels_e)channelSel); + + recoveryAction = adi_adrv903x_Register32Read(device, NULL, txScratchPad1[chanId], &txScratch1ReadValue, TX_ANT_CAL_ERROR_READ_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot read Tx scratch pad register 1"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Read(device, NULL, rxScratchPad0[chanId], &rxScratch0ReadValue, RX_ANT_CAL_ERROR_READ_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot read Rx scratch pad register 0"); + goto cleanup; + } + + /* In scratch register, Bit 3-4 has Tx Low High stream errors - Bit 6-7 has Tx Ant Cal Low High stream errors */ + txScratch1ReadValue = ((txScratch1ReadValue & 0xC0U) >> 6U) | ((txScratch1ReadValue & 0x18U) >> 1U); + + /* In scratch register, Bit 10-11 has Rx Low High stream errors - Bit 6-7 has Tx Ant Cal Low High stream errors */ + rxScratch0ReadValue = ((rxScratch0ReadValue & 0xC0U) >> 6U) | ((rxScratch0ReadValue & 0xC00U) >> 8U); + + /* Store Tx error bits in LSB and Rx error bits in MSB */ + *errStatus = (txScratch1ReadValue) | (rxScratch0ReadValue << 4U); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalErrorClear(adi_adrv903x_Device_t* const device, + const uint32_t channelMask, + const uint8_t errClearMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + int implemented = 0; + (void)channelMask; + (void)errClearMask; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + if (implemented == 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_API_NOT_IMPLEMENTED_REPORT_GOTO(&device->common, cleanup); + } +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StreamProcErrorGet( adi_adrv903x_Device_t* const device, + adi_adrv903x_StreamErrArray_t* const streamErr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t isErrInStream = 0U; + uint16_t streamErrorCode = 0U; + uint8_t i = 0U; + + /*struct to aid separate processor type and id for each stream processor*/ + typedef struct adrv903x_streamProcAttribs + { + adrv903x_BfStreamprocChanAddr_e chanAddr; + adi_adrv903x_StreamProcType_e procType; + uint8_t procId; + } adrv903x_streamProcAttribs_t; + + /*Creates the NUM_STREAM_PROCS size array for the stream processors. + *Each element is a struct that has the address, the type and the id of the stream processor*/ + static const adrv903x_streamProcAttribs_t streamProcAttribs[ADI_ADRV903X_STREAM_MAX] = { + {ADRV903X_BF_DIGITAL_CORE_MAIN_STREAM_PROC, ADI_ADRV903X_STREAM_MAIN, 0}, + {ADRV903X_BF_DIGITAL_CORE_KFA_STREAM_PROC_REGS, ADI_ADRV903X_STREAM_KFA, 0}, + {ADRV903X_BF_SLICE_RX_0__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_RX, 0}, + {ADRV903X_BF_SLICE_RX_1__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_RX, 1}, + {ADRV903X_BF_SLICE_RX_2__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_RX, 2}, + {ADRV903X_BF_SLICE_RX_3__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_RX, 3}, + {ADRV903X_BF_SLICE_RX_4__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_RX, 4}, + {ADRV903X_BF_SLICE_RX_5__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_RX, 5}, + {ADRV903X_BF_SLICE_RX_6__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_RX, 6}, + {ADRV903X_BF_SLICE_RX_7__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_RX, 7}, + {ADRV903X_BF_SLICE_TX_0__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_TX, 0}, + {ADRV903X_BF_SLICE_TX_1__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_TX, 1}, + {ADRV903X_BF_SLICE_TX_2__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_TX, 2}, + {ADRV903X_BF_SLICE_TX_3__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_TX, 3}, + {ADRV903X_BF_SLICE_TX_4__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_TX, 4}, + {ADRV903X_BF_SLICE_TX_5__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_TX, 5}, + {ADRV903X_BF_SLICE_TX_6__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_TX, 6}, + {ADRV903X_BF_SLICE_TX_7__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_TX, 7}, + {ADRV903X_BF_SLICE_ORX_0__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_ORX, 0}, + {ADRV903X_BF_SLICE_ORX_1__SLICE_AHB_STREAM_PROC, ADI_ADRV903X_STREAM_ORX, 1} + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, streamErr, cleanup); + + ADI_LIBRARY_MEMSET(streamErr, 0, sizeof(adi_adrv903x_StreamErrArray_t)); + + for (i = 0U; i < ADI_ADRV903X_STREAM_MAX; i++) + { + /*Initializes the streamErr with the streamProcType and streamProcId for each stream processor*/ + streamErr->streamProcArray[i].streamProcType = streamProcAttribs[i].procType; + streamErr->streamProcArray[i].streamProcId = streamProcAttribs[i].procId; + + recoveryAction = adrv903x_Streamproc_DbgRdbkMode_BfSet(device, NULL, streamProcAttribs[i].chanAddr, 1); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue setting Stream Error to volatile status"); + goto cleanup; + } + + recoveryAction = adrv903x_Streamproc_StreamError_BfGet(device, NULL, streamProcAttribs[i].chanAddr, &isErrInStream); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue reading status error bit"); + goto cleanup; + } + if (isErrInStream == ADI_TRUE) + { + /* Since an error was detected, the stream number that triggered the error and the error + * code are saved in the stream processor struct. After storing these informations, the error + * status is reset*/ + recoveryAction = adrv903x_Streamproc_ErroredStreamNumber_BfGet( device, + NULL, + streamProcAttribs[i].chanAddr, + &streamErr->streamProcArray[i].erroredStreamNumber); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue reading the stream number that triggered the error"); + goto cleanup; + } + recoveryAction = adrv903x_Streamproc_RdbkErrorVal_BfGet(device, + NULL, + streamProcAttribs[i].chanAddr, + &streamErrorCode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue reading the error code for the stream error"); + goto cleanup; + } + streamErr->streamProcArray[i].streamErrEnum = (adi_adrv903x_StreamError_e)streamErrorCode; + + /*Clear the error in streams:*/ + recoveryAction = adrv903x_Streamproc_ErroredStreamNumber_BfSet( device, + NULL, + streamProcAttribs[i].chanAddr, + 0xFU); /*is cleared when writing a dummy value*/ + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue resetting the stream error number"); + goto cleanup; + } + recoveryAction = adrv903x_Streamproc_StreamError_BfSet( device, + NULL, + streamProcAttribs[i].chanAddr, + 1U); /*Writing 1 clears error bit*/ + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue resetting the status error bit"); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalGpioChannelSet(adi_adrv903x_Device_t* const device, + const uint32_t txChannelMask, + const uint32_t rxChannelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + if ((txChannelMask & (~(uint32_t)ADI_ADRV903X_TXALL)) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txChannelMask, + "Invalid Tx channel is selected. Valid values are 0 or any combinations of Tx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + if ((rxChannelMask & (~(uint32_t)ADI_ADRV903X_RX_MASK_ALL)) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannelMask, + "Invalid Rx channel is selected. Valid values are 0 or any combinations of Rx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + /* Write Tx Scratchpad value */ + recoveryAction = adrv903x_Core_ScratchReg_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + ADRV903X_GPIO_ANTCAL_TX_MASK, + (uint8_t)txChannelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write GPIO antenna cal Tx selection to scratchpad register"); + goto cleanup; + } + + /* Write Rx Scratchpad value */ + recoveryAction = adrv903x_Core_ScratchReg_BfSet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + ADRV903X_GPIO_ANTCAL_RX_MASK, + (uint8_t)rxChannelMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write GPIO antenna cal Rx selection to scratchpad register"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalGpioChannelGet(adi_adrv903x_Device_t* const device, + uint32_t * const txChannelMask, + uint32_t * const rxChannelMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t scratchPadValue = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txChannelMask, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxChannelMask, cleanup); + + /* Read Tx Scratchpad value */ + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + ADRV903X_GPIO_ANTCAL_TX_MASK, + &scratchPadValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read GPIO antenna cal Tx selection to scratchpad register"); + goto cleanup; + } + *txChannelMask = (uint32_t)scratchPadValue; + + /* Read Rx Scratchpad value */ + recoveryAction = adrv903x_Core_ScratchReg_BfGet(device, + NULL, + (adrv903x_BfCoreChanAddr_e)ADRV903X_BF_CORE_ADDR, + ADRV903X_GPIO_ANTCAL_RX_MASK, + &scratchPadValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read GPIO antenna cal Rx selection to scratchpad register"); + goto cleanup; + } + *rxChannelMask = (uint32_t)scratchPadValue; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); + +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RadioCtrlAntCalConfigSet_v2(adi_adrv903x_Device_t* const device, + adi_adrv903x_RxRadioCtrlAntennaCalConfig_t * const configRx, + adi_adrv903x_TxRadioCtrlAntennaCalConfig_t * const configTx, + const uint8_t rxGainValue, + const uint8_t enableFreeze) +{ + + static const uint32_t txScratchPad2[] = { (uint32_t)ADRV903X_ADDR_TX0_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX1_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX2_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX3_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX4_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX5_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX6_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_TX7_STREAM_SCRATCH2 }; + + static const uint32_t rxScratchPad2[] = { (uint32_t)ADRV903X_ADDR_RX0_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX1_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX2_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX3_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX4_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX5_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX6_STREAM_SCRATCH2, + (uint32_t)ADRV903X_ADDR_RX7_STREAM_SCRATCH2 }; + + static const uint32_t rxScratchPad5[] = { (uint32_t)ADRV903X_ADDR_RX0_STREAM_SCRATCH5, + (uint32_t)ADRV903X_ADDR_RX1_STREAM_SCRATCH5, + (uint32_t)ADRV903X_ADDR_RX2_STREAM_SCRATCH5, + (uint32_t)ADRV903X_ADDR_RX3_STREAM_SCRATCH5, + (uint32_t)ADRV903X_ADDR_RX4_STREAM_SCRATCH5, + (uint32_t)ADRV903X_ADDR_RX5_STREAM_SCRATCH5, + (uint32_t)ADRV903X_ADDR_RX6_STREAM_SCRATCH5, + (uint32_t)ADRV903X_ADDR_RX7_STREAM_SCRATCH5 }; + + static const uint32_t TX_SCRATCH2_WRITE_MASK = 0x00FFFFFFU; + static const uint32_t RX_SCRATCH_WRITE_MASK = 0xFFFFFFFFU; + static const uint32_t RX_SCRATCH_WRITE_SHIFT = 24U; + static const uint32_t RX_SCRATCH5_GAIN_SHIFT = 8U; + static const uint32_t RX_SCRATCH5_WRITE_MASk = 0xFF01U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t txScratch2WriteValue = 0U; + uint32_t rxScratchWriteValue = 0U; + uint32_t rxScratch5WriteValue = 0U; + adi_adrv903x_RxGain_t rxGain; + uint16_t attenRegVal = 0U; + uint32_t chanId = 0U; + uint32_t chanSel = 0U; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, configRx, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, configTx, cleanup); + + ADI_LIBRARY_MEMSET(&rxGain, 0, sizeof(rxGain)); + + /* Check enable parameter is valid */ + if ((enableFreeze != ADI_ENABLE) && (enableFreeze != ADI_DISABLE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + enableFreeze, + "enableFreeze parameter must be either 0 for disabled or 1 for enabled"); + goto cleanup; + } + + /*Check that if requested Rx Channel valid*/ + if ((configRx->rxChannelMask & (~(uint32_t)ADI_ADRV903X_RX_MASK_ALL)) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + configRx->rxChannelMask, + "Invalid channel is selected for Rx config. Valid values are 0 or any combinations of Rx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + if ((configTx->txChannelMask & (~(uint32_t)ADI_ADRV903X_TXALL)) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + configTx->txChannelMask, + "Invalid channel is selected for Tx config. Valid values are 0 or any combinations of Tx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + txScratch2WriteValue = (uint32_t)(configTx->txNcoFreqKhz) & TX_SCRATCH2_WRITE_MASK; + /* Change the sign of the frequency because there is an I/Q swap in the HW */ + rxScratchWriteValue = (((uint32_t)configRx->rxGainIndex & 0x000000FF) << RX_SCRATCH_WRITE_SHIFT) | + ((uint32_t)(-configRx->rxNcoFreqKhz) & 0x00FFFFFF); + + /* for each Tx channel in txChannelMask */ + for (chanId = 0U; chanId < ADI_ADRV903X_MAX_TXCHANNELS; chanId++) + { + if ((configTx->txChannelMask & (1U << chanId)) == 0U) + { + /* Skip channel. It's not in chanMask. */ + continue; + } + + if (configTx->txAttenuation_mdB > ADRV903X_TX_ATTEN_VALUE_MILLI_DB_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + configTx->txAttenuation_mdB, + "Invalid txAttenuation_mdB value"); + goto cleanup; + } + + /* ChanId is selected in chanMask */ + chanSel = (1U << chanId); + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanId, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + /* Conversion from the atten level (milli-dB) to equivalent + * TxAttenTable index is always done based on a step size of 0.05. + * Other step sizes are not supported. */ + attenRegVal = (configTx->txAttenuation_mdB / ADRV903X_TX_ATTEN_STEP_SIZE_DIV_0P05); + + recoveryAction = adrv903x_TxFuncs_TxAttenuation_BfSet(device, + NULL, + txBaseAddr, + attenRegVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Input Select"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, txScratchPad2[chanId], txScratch2WriteValue, TX_SCRATCH2_WRITE_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot write Tx scratch pad register 2"); + goto cleanup; + } + } + + /* for each Rx channel in rxChannelMask */ + for (chanId = 0U; chanId < ADI_ADRV903X_MAX_RX_ONLY; chanId++) + { + /* Write freeze and gainvalue to each scratchpad register */ + rxScratch5WriteValue = (((uint32_t)enableFreeze) | ((uint32_t)rxGainValue) << RX_SCRATCH5_GAIN_SHIFT); + recoveryAction = adi_adrv903x_Register32Write(device, NULL, rxScratchPad5[chanId], rxScratch5WriteValue, RX_SCRATCH5_WRITE_MASk); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot write Rx scratch pad register 5"); + goto cleanup; + } + + if ((configRx->rxChannelMask & (1U << chanId)) == 0) + { + /* Skip channel. It's not in chanMask. */ + continue; + } + + rxGain.gainIndex = configRx->rxGainIndex; + rxGain.rxChannelMask = configRx->rxChannelMask; + + recoveryAction = adrv903x_RxGainSetRangeCheck(device, &rxGain, 1); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Rx gain is out of range"); + goto cleanup; + } + + /* ChanId is selected in chanMask */ + recoveryAction = adi_adrv903x_Register32Write(device, NULL, rxScratchPad2[chanId], rxScratchWriteValue, RX_SCRATCH_WRITE_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot write Rx scratch pad register 2"); + goto cleanup; + } + + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioCtrlRxTxMapSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxRxCtrlGpioMap_t txRxCtrlGpioMap[], + const uint32_t numGpios) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + adi_adrv903x_StreamGpioPinCfg_t streamGpioCfg; + adi_adrv903x_GpioSignal_e signalArray[ADI_ADRV903X_GPIO_INVALID]; + uint32_t gpioMaskArray[ADI_ADRV903X_GPIO_INVALID]; + adi_adrv903x_TxRxCtrlGpioMap_t txRxCtrlByGpio; + + uint32_t scratchRegisterAddress = 0U; + uint8_t channelMaskArray[1] = { 0U }; + uint8_t rxOrTxMaskArray[1] = { 0U }; + uint8_t prevReg216Value[1] = { 0U }; + uint8_t prevReg216Mask[1] = { 0xFFU }; + + uint8_t i = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txRxCtrlGpioMap, cleanup); + + ADI_LIBRARY_MEMSET(&streamGpioCfg, 0U, sizeof(streamGpioCfg)); + ADI_LIBRARY_MEMSET(&signalArray, 0U, sizeof(signalArray)); + ADI_LIBRARY_MEMSET(&gpioMaskArray, 0U, sizeof(gpioMaskArray)); + ADI_LIBRARY_MEMSET(&txRxCtrlByGpio, 0U, sizeof(txRxCtrlByGpio)); + + if (numGpios > ADI_ADRV903X_GPIO_AS_TRXCONTROL_MAX_NUMBER_PINS) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numGpios, "Invalid array size. numGpios must be equal or smaller than 4"); + goto cleanup; + } + + for (i = 0U; i < numGpios; i++) + { + txRxCtrlByGpio = txRxCtrlGpioMap[i]; + if ((txRxCtrlByGpio.logicalPin != ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_0) && + (txRxCtrlByGpio.logicalPin != ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_1) && + (txRxCtrlByGpio.logicalPin != ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_2) && + (txRxCtrlByGpio.logicalPin != ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_3)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txRxCtrlByGpio.logicalPin, "Invalid logicalPin parameter value inside structure. Must be from 0 to 3"); + goto cleanup; + } + + if (txRxCtrlByGpio.gpioPin >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txRxCtrlByGpio.logicalPin, "Invalid gpioPin parameter value inside structure. Must be between 0 and 23"); + goto cleanup; + } + + if (txRxCtrlByGpio.rxTxMask == ADRV903X_STREAM_TRIGGER_GPIO_TXRXMASK_TX) + { + if ((txRxCtrlByGpio.channelMask < (uint32_t)ADI_ADRV903X_TX0) || (txRxCtrlByGpio.channelMask > (uint32_t)ADI_ADRV903X_TX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txRxCtrlByGpio.channelMask, "Invalid Tx channelMask parameter passed - must be from Tx0 up to Tx7"); + goto cleanup; + } + } + else if (txRxCtrlByGpio.rxTxMask == ADRV903X_STREAM_TRIGGER_GPIO_TXRXMASK_RX) + { + if (txRxCtrlByGpio.channelMask < (uint8_t)ADI_ADRV903X_RX0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txRxCtrlByGpio.channelMask, "Invalid Rx channelMask parameter passed - must be from Rx0 up to Rx7"); + goto cleanup; + } + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txRxCtrlByGpio.rxTxMask, "Invalid rxTxMask enum passed. Value must be 1 for Rx or 2 for Tx"); + goto cleanup; + } + + scratchRegisterAddress = (uint32_t)ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS + ADRV903X_ADDR_CORE_STREAM_SCRATCH212 + (uint32_t)txRxCtrlByGpio.logicalPin; + + /* Check if target pin is not being used by other signals */ + recoveryAction = adi_adrv903x_GpioConfigAllGet(device, signalArray, gpioMaskArray, (uint8_t)ADI_ADRV903X_GPIO_INVALID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while retreiving current GPIO configurations"); + goto cleanup; + } + + if (signalArray[(uint8_t)txRxCtrlByGpio.gpioPin] != ADI_ADRV903X_GPIO_SIGNAL_UNUSED) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txRxCtrlByGpio.gpioPin, "Pin already routed to another signal. Please select another pin"); + goto cleanup; + } + + channelMaskArray[0] = (uint8_t)txRxCtrlByGpio.channelMask; + + /* + * ScratchRegisterAddress is which logical gpio is tied to the physical pin. + * channelMask tells which channels are linked to the logical gpio. + */ + recoveryAction = adi_adrv903x_RegistersByteWrite(device, + NULL, + scratchRegisterAddress, + channelMaskArray, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while writing on stream scratch register"); + goto cleanup; + } + + if (txRxCtrlByGpio.logicalPin == ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_0) + { + rxOrTxMaskArray[0] = txRxCtrlByGpio.rxTxMask; + } + else if (txRxCtrlByGpio.logicalPin == ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_1) + { + rxOrTxMaskArray[0] = txRxCtrlByGpio.rxTxMask << 2U; + } + else if (txRxCtrlByGpio.logicalPin == ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_2) + { + rxOrTxMaskArray[0] = txRxCtrlByGpio.rxTxMask << 4U; + } + else + { + rxOrTxMaskArray[0] = txRxCtrlByGpio.rxTxMask << 6U; + } + + /* + * Scratch Register 216 holds if each gpio is tied to rx or tx for all gpios, so we need to + * read first and use it as a mask before updating it. + */ + recoveryAction = adi_adrv903x_RegistersByteRead(device, + NULL, + (uint32_t)ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS + ADRV903X_ADDR_CORE_STREAM_SCRATCH216, + prevReg216Value, + prevReg216Mask, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while reading stream scratch register"); + goto cleanup; + } + + rxOrTxMaskArray[0] |= prevReg216Value[0]; + + recoveryAction = adi_adrv903x_RegistersByteWrite(device, + NULL, + (uint32_t)ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS + ADRV903X_ADDR_CORE_STREAM_SCRATCH216, + rxOrTxMaskArray, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while writing on stream scratch register"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_StreamGpioConfigGet(device, &streamGpioCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Stream Gpio Config Get Failed"); + goto cleanup; + } + + if (streamGpioCfg.streamGpInput[(uint8_t)txRxCtrlByGpio.gpioPin] != ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txRxCtrlByGpio.gpioPin, "Pin already configured to a stream. Please review gpio and stream assignment"); + goto cleanup; + } + + streamGpioCfg.streamGpInput[(uint8_t)txRxCtrlByGpio.gpioPin] = txRxCtrlByGpio.gpioPin; + + recoveryAction = adi_adrv903x_StreamGpioConfigSet(device, &streamGpioCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Stream Gpio Config Set Failed"); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioCtrlRxTxMapGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_GpioPinSel_e gpioPin, + const adi_adrv903x_TxRxCtrlGpioLogicalPin_e gpioLogicalPin, + adi_adrv903x_TxRxCtrlGpioMap_t* const txRxCtrlGpio) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_StreamGpioPinCfg_t streamGpioCfg; + + uint32_t scratchRegisterAddress = 0U; + uint8_t channelMaskArray[1] = { 0U }; + uint8_t regRxOrTxValue[1] = { 0U }; + uint8_t registerReadMask[1] = { 0xFFU }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txRxCtrlGpio, cleanup); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_LIBRARY_MEMSET(&streamGpioCfg, 0U, sizeof(streamGpioCfg)); + + if ((gpioLogicalPin != ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_0) && + (gpioLogicalPin != ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_1) && + (gpioLogicalPin != ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_2) && + (gpioLogicalPin != ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_3)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gpioLogicalPin, "Invalid gpioLogicalPin parameter value. Must be from 0 to 3"); + goto cleanup; + } + + if (gpioPin >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gpioPin, "Invalid gpioPin parameter value. Must be between 0 and 23"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_StreamGpioConfigGet(device, &streamGpioCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Stream Gpio Config Get Failed"); + goto cleanup; + } + + if (streamGpioCfg.streamGpInput[(uint8_t)gpioPin] == gpioPin) + { + txRxCtrlGpio->gpioPin = gpioPin; + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gpioPin, "GPIO Pin not assigned to a signal. Please confirm this is the correct pin and it was configured correctly"); + goto cleanup; + } + + txRxCtrlGpio->logicalPin = gpioLogicalPin; + + scratchRegisterAddress = (uint32_t)ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS + ADRV903X_ADDR_CORE_STREAM_SCRATCH212 + (uint32_t)gpioLogicalPin; + + /* + * ScratchRegisterAddress is which logical gpio is tied to the physical pin. + * channelMask tells which channels are linked to the logical gpio. + */ + recoveryAction = adi_adrv903x_RegistersByteRead(device, + NULL, + scratchRegisterAddress, + channelMaskArray, + registerReadMask, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while writing on stream scratch register"); + goto cleanup; + } + + txRxCtrlGpio->channelMask = channelMaskArray[0]; + + recoveryAction = adi_adrv903x_RegistersByteRead(device, + NULL, + (uint32_t)ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS + ADRV903X_ADDR_CORE_STREAM_SCRATCH216, + regRxOrTxValue, + registerReadMask, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while reading stream scratch register"); + goto cleanup; + } + + if (gpioLogicalPin == ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_1) + { + regRxOrTxValue[0] = regRxOrTxValue[0] >> 2U; + } + else if (gpioLogicalPin == ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_2) + { + regRxOrTxValue[0] = regRxOrTxValue[0] >> 4U; + } + else if (gpioLogicalPin == ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_3) + { + regRxOrTxValue[0] = regRxOrTxValue[0] >> 6U; + } + + regRxOrTxValue[0] &= 0x3; + + txRxCtrlGpio->rxTxMask = (adi_adrv903x_TxRxCtrlGpioRxOrTx_e)regRxOrTxValue[0]; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_GpioCtrlRxTxMapClear(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxRxCtrlGpioMap_t txRxCtrlGpioMap[], + const uint32_t numGpios) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + adi_adrv903x_StreamGpioPinCfg_t streamGpioCfg; + adi_adrv903x_GpioSignal_e signalArray[ADI_ADRV903X_GPIO_INVALID]; + adi_adrv903x_TxRxCtrlGpioMap_t gpioLogPhyMapping; + uint32_t scratchRegisterAddress = 0U; + uint8_t clearChannelMaskArray[1] = { 0U }; + uint8_t clearRxOrTxMaskArray[1] = { 0U }; + uint8_t i = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txRxCtrlGpioMap, cleanup); + + ADI_LIBRARY_MEMSET(&streamGpioCfg, 0U, sizeof(streamGpioCfg)); + ADI_LIBRARY_MEMSET(&signalArray, 0U, sizeof(signalArray)); + ADI_LIBRARY_MEMSET(&gpioLogPhyMapping, 0U, sizeof(gpioLogPhyMapping)); + + if (numGpios > ADI_ADRV903X_GPIO_AS_TRXCONTROL_MAX_NUMBER_PINS) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numGpios, "Invalid array size. numGpios must be equal or smaller than 4"); + goto cleanup; + } + + for (i = 0U; i < numGpios; i++) + { + gpioLogPhyMapping = txRxCtrlGpioMap[i]; + if ((gpioLogPhyMapping.logicalPin != ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_0) && + (gpioLogPhyMapping.logicalPin != ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_1) && + (gpioLogPhyMapping.logicalPin != ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_2) && + (gpioLogPhyMapping.logicalPin != ADRV903X_STREAM_TRIGGER_GPIO_LOGICAL_3)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gpioLogPhyMapping.logicalPin, "Invalid logicalPin parameter value inside structure. Must be from 0 to 3"); + goto cleanup; + } + + if (gpioLogPhyMapping.gpioPin >= ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gpioLogPhyMapping.logicalPin, "Invalid gpioPin parameter value inside structure. Must be between 0 and 23"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_StreamGpioConfigGet(device, &streamGpioCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Stream Gpio Config Get Failed"); + goto cleanup; + } + + streamGpioCfg.streamGpInput[(uint8_t)gpioLogPhyMapping.gpioPin] = ADI_ADRV903X_GPIO_INVALID; + + recoveryAction = adi_adrv903x_StreamGpioConfigSet(device, &streamGpioCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Stream Gpio Config Reset Failed"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_RegistersByteWrite(device, + NULL, + (uint32_t)ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS + ADRV903X_ADDR_CORE_STREAM_SCRATCH216, + clearRxOrTxMaskArray, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while writing on stream scratch register."); + goto cleanup; + } + + scratchRegisterAddress = (uint32_t)ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS + ADRV903X_ADDR_CORE_STREAM_SCRATCH212 + (uint32_t)gpioLogPhyMapping.logicalPin; + + recoveryAction = adi_adrv903x_RegistersByteWrite(device, + NULL, + scratchRegisterAddress, + clearChannelMaskArray, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while writing on stream scratch register."); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); + +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_rx.c b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_rx.c new file mode 100644 index 0000000000000..024648f017c2f --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_rx.c @@ -0,0 +1,2835 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_rx.c +* \brief Contains Rx features related function implementation defined in +* adi_adrv903x_rx.h +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#include "adi_adrv903x_rx.h" +#include "adi_adrv903x_cpu.h" +#include "adi_adrv903x_hal.h" +#include "adi_adrv903x_radioctrl.h" + +#include "../../private/include/adrv903x_rx.h" +#include "../../private/include/adrv903x_tx.h" +#include "../../private/include/adrv903x_gpio.h" +#include "../../private/bf/adrv903x_bf_rx_funcs.h" +#include "../../private/bf/adrv903x_bf_rx_ddc.h" +#include "../../private/bf/adrv903x_bf_rx_dig.h" +#include "../../private/bf/adrv903x_bf_orx_dig.h" +#include "../../private/include/adrv903x_cpu.h" +#include "../../private/include/adrv903x_reg_addr_macros.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PUBLIC_RX + +#define ADI_ADRV903X_NUM_GPIOS_IN_RX_GAIN_CTRL_PIN_FEATURE 2U +#define ADI_ADRV903X_NUM_GPIOS_IN_RX_EXT_CTRL_WORD_OUTPUT_FEATURE 8U +#define ADI_ADRV903X_NUM_GPIOS_IN_RX_DUALBAND_CTRL_WORD_OUTPUT_FEATURE 8U +#define ADI_ADRV903X_NUM_BYTES_PER_RX_GAIN_INDEX 8U +#define MAX_ORX_CHANNEL_ID 1U +#define ADC_TEST_GEN_SEL_BYBASS 0x0U +#define ADC_TEST_GEN_SEL_SINE 0x3U +#define ADC_TEST_GEN_EN_SEL_SPI 0x1U +#define ADC_TEST_GEN_CLK_ADC 0x0U + + +static const uint8_t MAX_ORX_CHANNEL_MASK = (1U << (MAX_ORX_CHANNEL_ID + 1U)) - 1U; + +/* Simple mapping from ORx channel id to corresponding OrxWest regmap addr */ +static const adrv903x_BfActrlOrxWestRegmapChanAddr_e chanIdToOrxWestRegmapChanAddr[] = +{ + ADRV903X_BF_SLICE_ORX_0__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP, + ADRV903X_BF_SLICE_ORX_1__ORX_ANALOG_ADC_8B_VENUS_ACTRL_WEST_REGMAP +}; + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainTableWrite(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint8_t gainIndexOffset, + const adi_adrv903x_RxGainTableRow_t gainTableRow[], + const uint32_t arraySize) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t baseIndex = 0U; + uint32_t baseAddress[1] = { 0U }; + uint16_t numGainIndicesToWrite = arraySize; + /*Maximum Array Size = Max Gain Table Size x Bytes Per Gain Table Entry*/ + ADI_PLATFORM_LARGE_ARRAY_ALLOC(uint8_t, cpuDmaData, ((ADI_ADRV903X_MAX_GAIN_TABLE_INDEX - ADI_ADRV903X_MIN_GAIN_TABLE_INDEX) + 1U) * ADI_ADRV903X_NUM_BYTES_PER_RX_GAIN_INDEX); + adrv903x_BfRxDdcChanAddr_e ddcBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + uint32_t chanId = 0U; + adi_adrv903x_SpiCache_t spiCache = { { 0U }, 0U, 0U, 0U }; + + const uint32_t rxGainTableBaseAddr[] = + { + ADI_ADRV903X_RX0_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX1_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX2_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX3_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX4_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX5_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX6_GAIN_TABLE_BASEADDR, + ADI_ADRV903X_RX7_GAIN_TABLE_BASEADDR + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuDmaData, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gainTableRow, cleanup); + +#if ADI_ADRV903X_RX_RANGE_CHECK > 0 + recoveryAction = adrv903x_RxGainTableWriteRangeCheck(device, rxChannelMask, gainIndexOffset, gainTableRow, numGainIndicesToWrite); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxGainTableWriteRangeCheck Issue"); + goto cleanup; + } +#endif + + /*Calculate base index for the config*/ + baseIndex = (gainIndexOffset - (numGainIndicesToWrite - 1U)); + + /*Format Gain Table Entries*/ + recoveryAction = adrv903x_RxGainTableFormat(device, gainTableRow, &cpuDmaData[0U], numGainIndicesToWrite); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxGainTableFormat Issue"); + goto cleanup; + } + + /*Resolve the RX Channel SRAM to program*/ + /*If Rx Channel Mask Set by user for this config, load Rx gain table*/ + for (chanId = 0U; chanId < ADI_ADRV903X_MAX_RX_ONLY; ++chanId) + { + adi_adrv903x_RxChannels_e rxChannel = (adi_adrv903x_RxChannels_e) (rxChannelMask & (1U << chanId)); + if (rxChannel > 0U) + { + /*Resolve Rx1 Gain Table SRAM load start address*/ + baseAddress[0U] = rxGainTableBaseAddr[chanId] + (baseIndex * ADI_ADRV903X_NUM_BYTES_PER_RX_GAIN_INDEX); + + /*Write to the SRAM via ARM DMA*/ + recoveryAction = adi_adrv903x_Registers32bOnlyWrite(device, + &spiCache, + baseAddress[0U], + &cpuDmaData[0U], + (numGainIndicesToWrite * ADI_ADRV903X_NUM_BYTES_PER_RX_GAIN_INDEX)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while writing gain table."); + goto cleanup; + } + recoveryAction = adrv903x_RxDdcBitfieldAddressGet(device, rxChannel, ADI_ADRV903X_RX_DDC_BAND0, &ddcBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read DDC address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_DigitalGainEnable_BfSet(device, &spiCache, ddcBaseAddr, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while writing Gain Comp Config0 DDC0"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdcBitfieldAddressGet(device, rxChannel, ADI_ADRV903X_RX_DDC_BAND1, &ddcBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read DDC address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_DigitalGainEnable_BfSet(device, &spiCache, ddcBaseAddr, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue while writing Gain Comp Config0 DDC1"); + goto cleanup; + } + } + } + + recoveryAction = adi_adrv903x_SpiFlush(device, spiCache.data, &spiCache.count); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Flush Issue After CPU Mailbox Buffer Write"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainTableRead(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + const uint8_t gainIndexOffset, + adi_adrv903x_RxGainTableRow_t gainTableRow[], + const uint32_t arraySize, + uint16_t* const numGainIndicesRead) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint32_t baseAddress = 0U; + uint32_t maxReadGainIndices = arraySize; + uint16_t numGainIndicesReadVal = 0U; + /*Maximum Array Size = Max Gain Table Size x Bytes Per Gain Table Entry*/ + ADI_PLATFORM_LARGE_ARRAY_ALLOC(uint8_t, cpuAhbData, ((ADI_ADRV903X_MAX_GAIN_TABLE_INDEX - ADI_ADRV903X_MIN_GAIN_TABLE_INDEX) + 1U) * ADI_ADRV903X_NUM_BYTES_PER_RX_GAIN_INDEX); + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuAhbData, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gainTableRow, cleanup); + +#if ADI_ADRV903X_RX_RANGE_CHECK > 0 + recoveryAction = adrv903x_RxGainTableReadRangeCheck(device, + rxChannel, + gainIndexOffset, + gainTableRow, + maxReadGainIndices); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxGainTableReadRangeCheck Issue"); + goto cleanup; + } +#endif + + /*Calculate no. of indices to read and the base address for the config*/ + recoveryAction = adrv903x_RxGainTableReadParamsCompute( device, + rxChannel, + maxReadGainIndices, + gainIndexOffset, + &numGainIndicesReadVal, + &baseAddress); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxGainTableReadParamsCompute Issue"); + goto cleanup; + } + + /*Read Gain Table Data for the requested channel via ARM DMA*/ + recoveryAction = adi_adrv903x_Registers32bOnlyRead(device, + NULL, + baseAddress, + &cpuAhbData[0U], + (numGainIndicesReadVal * ADI_ADRV903X_NUM_BYTES_PER_RX_GAIN_INDEX)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error Reading Gain Table ARM DMA"); + goto cleanup; + } + + /*Parse gain table data obtained in ARM DMA data format to an rx gain table row entry data structure memory*/ + recoveryAction = adrv903x_RxGainTableParse(device, &gainTableRow[0U], &cpuAhbData[0], numGainIndicesReadVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxGainTableParse Issue"); + goto cleanup; + } + + /*Update no. of gain indices read*/ + if (numGainIndicesRead != NULL) + { + *numGainIndicesRead = numGainIndicesReadVal; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainTableExtCtrlPinsSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint32_t channelEnable) +{ + #define NUM_GPIO_PER_CHANNEL 2U + + static const adi_adrv903x_GpioAnaPinSel_e gpioLut[ADI_ADRV903X_MAX_RX_ONLY][NUM_GPIO_PER_CHANNEL] = { + { ADI_ADRV903X_GPIO_ANA_00, ADI_ADRV903X_GPIO_ANA_01 }, + { ADI_ADRV903X_GPIO_ANA_02, ADI_ADRV903X_GPIO_ANA_03 }, + { ADI_ADRV903X_GPIO_ANA_04, ADI_ADRV903X_GPIO_ANA_05 }, + { ADI_ADRV903X_GPIO_ANA_06, ADI_ADRV903X_GPIO_ANA_07 }, + { ADI_ADRV903X_GPIO_ANA_08, ADI_ADRV903X_GPIO_ANA_09 }, + { ADI_ADRV903X_GPIO_ANA_10, ADI_ADRV903X_GPIO_ANA_11 }, + { ADI_ADRV903X_GPIO_ANA_12, ADI_ADRV903X_GPIO_ANA_13 }, + { ADI_ADRV903X_GPIO_ANA_14, ADI_ADRV903X_GPIO_ANA_15 } + }; + + static const adi_adrv903x_GpioSignal_e sigLut[ADI_ADRV903X_MAX_RX_ONLY][NUM_GPIO_PER_CHANNEL] = { + { ADI_ADRV903X_GPIO_SIGNAL_RX0_EXT_CONTROL_0, ADI_ADRV903X_GPIO_SIGNAL_RX0_EXT_CONTROL_1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX1_EXT_CONTROL_0, ADI_ADRV903X_GPIO_SIGNAL_RX1_EXT_CONTROL_1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX2_EXT_CONTROL_0, ADI_ADRV903X_GPIO_SIGNAL_RX2_EXT_CONTROL_1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX3_EXT_CONTROL_0, ADI_ADRV903X_GPIO_SIGNAL_RX3_EXT_CONTROL_1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX4_EXT_CONTROL_0, ADI_ADRV903X_GPIO_SIGNAL_RX4_EXT_CONTROL_1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX5_EXT_CONTROL_0, ADI_ADRV903X_GPIO_SIGNAL_RX5_EXT_CONTROL_1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX6_EXT_CONTROL_0, ADI_ADRV903X_GPIO_SIGNAL_RX6_EXT_CONTROL_1 }, + { ADI_ADRV903X_GPIO_SIGNAL_RX7_EXT_CONTROL_0, ADI_ADRV903X_GPIO_SIGNAL_RX7_EXT_CONTROL_1 } + }; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t currentChannelMask = 0U; + uint8_t chIdx = 0U; + uint8_t gpioIdx = 0U; + adi_adrv903x_GpioSignal_e getSig = ADI_ADRV903X_GPIO_SIGNAL_UNUSED; + uint32_t getChanMask = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + /*Check that rxChannelMask is valid*/ + if (rxChannelMask > (uint32_t)( ADI_ADRV903X_RX0 | ADI_ADRV903X_RX1 | ADI_ADRV903X_RX2 | ADI_ADRV903X_RX3 | + ADI_ADRV903X_RX4 | ADI_ADRV903X_RX5 | ADI_ADRV903X_RX6 | ADI_ADRV903X_RX7 )) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannelMask, + "Invalid Rx Channel mask parameter. Valid Rx channel masks include 0x0-0xff"); + goto cleanup; + } + + /*Check that channelEnable is Valid*/ + if (channelEnable > (uint32_t)( ADI_ADRV903X_RX0 | ADI_ADRV903X_RX1 | ADI_ADRV903X_RX2 | ADI_ADRV903X_RX3 | + ADI_ADRV903X_RX4 | ADI_ADRV903X_RX5 | ADI_ADRV903X_RX6 | ADI_ADRV903X_RX7 )) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + channelEnable, + "Invalid channelEnable mask parameter. Valid Enable Channel bitmasks 0x0-0xff"); + goto cleanup; + } + + /* If no channels were selected, this is an allowed noop */ + if (rxChannelMask == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + else + { + + /*Iterate through rxChannelMask, enabling/disabling selected channels*/ + for (chIdx = 0U; chIdx < ADI_ADRV903X_MAX_RX_ONLY; chIdx++) + { + /* Update currentChannelMask enum var for this chIdx */ + currentChannelMask = (adi_adrv903x_RxChannels_e)(1U << chIdx); + + /*Check if this channel should be affected*/ + if ((currentChannelMask & rxChannelMask) != 0U) + { + + /* Enable Analog GPIOs for this channel */ + if ((currentChannelMask & channelEnable) != 0U) + { + for (gpioIdx = 0U; gpioIdx < NUM_GPIO_PER_CHANNEL; gpioIdx++) + { + /*Route signals for this channel to Analog GPIOs*/ + recoveryAction = adrv903x_GpioAnalogSignalSet( device, + gpioLut[chIdx][gpioIdx], + sigLut[chIdx][gpioIdx], + 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioAnalogSignalSet Issue"); + goto cleanup; + } + } /* end of gpioIdx for loop */ + + } /* end Enable block */ + /* Disable Analog GPIOs for this channel */ + else + { + + for (gpioIdx = 0U; gpioIdx < NUM_GPIO_PER_CHANNEL; gpioIdx++) + { + /* Check if the GPIO has the associated Signal routed. */ + recoveryAction = adrv903x_GpioAnalogSignalGet( device, + gpioLut[chIdx][gpioIdx], + &getSig, + &getChanMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioAnalogSignalGet Issue"); + goto cleanup; + } + + /* If the expected signal is currently routed, release/disconnect the pin */ + if (getSig == sigLut[chIdx][gpioIdx]) + { + recoveryAction = adrv903x_GpioAnalogSignalRelease( device, + gpioLut[chIdx][gpioIdx], + sigLut[chIdx][gpioIdx], + 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "GpioAnalogSignalRelease Issue"); + goto cleanup; + } + } + + } /* end of gpioIdx for loop */ + + } /* end Disable block */ + + } /* End if channel-affected block */ + + } /* end rxChannel for loop */ + + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxMinMaxGainIndexSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const uint8_t minGainIndex, + const uint8_t maxGainIndex) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + +#if ADI_ADRV903X_RX_RANGE_CHECK > 0 + recoveryAction = adrv903x_RxMinMaxGainIndexSetRangeCheck(device, rxChannelMask, minGainIndex, maxGainIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxMinMaxGainIndexSetRangeCheck Issue"); + goto cleanup; + } +#endif + + /*Update device gain table min and max gain indices*/ + if ((rxChannelMask & (uint32_t)ADI_ADRV903X_RX0) == (uint32_t)ADI_ADRV903X_RX0) + { + device->devStateInfo.gainIndexes.rx0MaxGainIndex = maxGainIndex; + device->devStateInfo.gainIndexes.rx0MinGainIndex = minGainIndex; + } + + if ((rxChannelMask & (uint32_t)ADI_ADRV903X_RX1) == (uint32_t)ADI_ADRV903X_RX1) + { + device->devStateInfo.gainIndexes.rx1MaxGainIndex = maxGainIndex; + device->devStateInfo.gainIndexes.rx1MinGainIndex = minGainIndex; + } + + if ((rxChannelMask & (uint32_t)ADI_ADRV903X_RX2) == (uint32_t)ADI_ADRV903X_RX2) + { + device->devStateInfo.gainIndexes.rx2MaxGainIndex = maxGainIndex; + device->devStateInfo.gainIndexes.rx2MinGainIndex = minGainIndex; + } + + if ((rxChannelMask & (uint32_t)ADI_ADRV903X_RX3) == (uint32_t)ADI_ADRV903X_RX3) + { + device->devStateInfo.gainIndexes.rx3MaxGainIndex = maxGainIndex; + device->devStateInfo.gainIndexes.rx3MinGainIndex = minGainIndex; + } + + if ((rxChannelMask & (uint32_t)ADI_ADRV903X_RX4) == (uint32_t)ADI_ADRV903X_RX4) + { + device->devStateInfo.gainIndexes.rx4MaxGainIndex = maxGainIndex; + device->devStateInfo.gainIndexes.rx4MinGainIndex = minGainIndex; + } + + if ((rxChannelMask & (uint32_t)ADI_ADRV903X_RX5) == (uint32_t)ADI_ADRV903X_RX5) + { + device->devStateInfo.gainIndexes.rx5MaxGainIndex = maxGainIndex; + device->devStateInfo.gainIndexes.rx5MinGainIndex = minGainIndex; + } + + if ((rxChannelMask & (uint32_t)ADI_ADRV903X_RX6) == (uint32_t)ADI_ADRV903X_RX6) + { + device->devStateInfo.gainIndexes.rx6MaxGainIndex = maxGainIndex; + device->devStateInfo.gainIndexes.rx6MinGainIndex = minGainIndex; + } + + if ((rxChannelMask & (uint32_t)ADI_ADRV903X_RX7) == (uint32_t)ADI_ADRV903X_RX7) + { + device->devStateInfo.gainIndexes.rx7MaxGainIndex = maxGainIndex; + device->devStateInfo.gainIndexes.rx7MinGainIndex = minGainIndex; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + goto cleanup; /* Added to deal with Compiler Warning when ADI_ADRV903X_RX_RANGE_CHECK = 0 */ + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxGain_t rxGain[], + const uint32_t arraySize) +{ + static const uint32_t RX0_FUNC_ADDR_BASE = 0x60030050U; + static const uint8_t DATA_TRANSACTION_1_SIZE = 18U; + static const uint8_t DATA_TRANSACTION_2_SIZE = 6U; + + uint32_t configIndex = 0U; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + + /* Used to track whether its our first write or not, used to limit number of spi bytes being transmitted */ + uint8_t firstWrite = 0U; + + uint8_t rxFuncFirstByte = (uint8_t)(RX0_FUNC_ADDR_BASE >> 24U); + uint8_t rxFuncSecondByte = 0x00U; + uint8_t rxFuncThirdByte = 0x00U; + uint8_t rxFuncLastByte = (uint8_t)(RX0_FUNC_ADDR_BASE & 0xFFU); + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_hal_Err_e halError = ADI_HAL_ERR_PARAM; + + /* Hardcoded 18 byte data array for first spi transaction with placeholders for addresses and data + dataPageSetup[0] : 0x01U msb of paging register (ADRV903X_ADDR_SPI0_PAGE_31TO24) address + dataPageSetup[1] : 0x26U lsb of paging register (ADRV903X_ADDR_SPI0_PAGE_31TO24) address + dataPageSetup[2] : 0x60U first byte of slice register address + dataPageSetup[3] : 0x01U msb of paging register (ADRV903X_ADDR_SPI0_PAGE_23TO16) address + dataPageSetup[4] : 0x27U lsb of paging register (ADRV903X_ADDR_SPI0_PAGE_23TO16) address + dataPageSetup[5] : 0x00U PLACEHOLDER - Next byte of slice register address + dataPageSetup[6] : 0x01U msb of paging register (ADRV903X_ADDR_SPI0_PAGE_15TO8) address + dataPageSetup[7] : 0x28U lsb of paging register (ADRV903X_ADDR_SPI0_PAGE_15TO8) address + dataPageSetup[8] : 0x00U Next byte of slice register address + dataPageSetup[9] : 0x01U msb of paging register (ADRV903X_ADDR_SPI0_PAGE_7TO0) address + dataPageSetup[10] : 0x29U lsb of paging register (ADRV903X_ADDR_SPI0_PAGE_7TO0) address + dataPageSetup[11] : 0x50U Next byte of slice register address + dataPageSetup[12] : 0x01U msb of paging register (ADRV903X_ADDR_SPI0_PAGING_CONTROL) address + dataPageSetup[13] : 0x2AU lsb of paging register (ADRV903X_ADDR_SPI0_PAGING_CONTROL) address + dataPageSetup[14] : 0x00U Data to write to paging congtrol register + dataPageSetup[15] : 0x40U msb of calculated address depending on paging config and spi write polarity + dataPageSetup[16] : 0x01U lsb of calculated address depending on paging config and spi write polarity + dataPageSetup[17] : 0x00U PLACEHOLDER - will be replaced with gain index value for that given slice + */ + uint8_t dataPageSetup[] = { 0x01U, 0x26U, rxFuncFirstByte, 0x01U, 0x27U, rxFuncSecondByte, 0x01U, 0x28U, rxFuncThirdByte, 0x01U, 0x29U, rxFuncLastByte, 0x01U, 0x2aU, 0x00U, 0x40U, 0x01U, 0x00U}; + + /* Hardcoded 6 byte data array for every subsequent spi transaction + data[0] : 0x01U msb of paging register (ADRV903X_ADDR_SPI0_PAGE_31TO24) address + data[1] : 0x27U lsb of paging register (ADRV903X_ADDR_SPI0_PAGE_31TO24) address + data[2] : 0x00U PLACEHOLDER - Byte of slice register address which can be calculated based on which channel you are dealing with + data[3] : 0x40U msb of calculated address depending on paging config and spi write polarity + data[4] : 0x01U lsb of calculated address depending on paging config and spi write polarity + data[5] : 0x00U PLACEHOLDER - will be replaced with gain index value for that given slice + */ + uint8_t data[] = { 0x01U, 0x27U, 0x00U, 0x40U, 0x01U, 0x00U }; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + +#if ADI_ADRV903X_RX_RANGE_CHECK > 0U + recoveryAction = adrv903x_RxGainSetRangeCheck(device, rxGain, arraySize); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxGainSetRangeCheck Issue"); + goto cleanup; + } +#endif + + /*Update manual gain index setting for the requested channel */ + for (configIndex = 0U; configIndex < arraySize; ++configIndex) + { + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_RX_ONLY; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(rxGain[configIndex].rxChannelMask, chanSel)) + { + /* calculate part of address related to given channel id */ + rxFuncSecondByte = (uint8_t)(3U + (chanIdx << 4U)); + device->devStateInfo.currentPageStartingAddress = (uint32_t)((rxFuncFirstByte << 24) + (rxFuncSecondByte << 16) + (rxFuncThirdByte << 8) + rxFuncLastByte); + /* check if its the first time we've called this function so we can setup the paging registers */ + if (firstWrite == 0U) + { + dataPageSetup[5U] = rxFuncSecondByte; + dataPageSetup[17U] = rxGain[configIndex].gainIndex; + halError = adrv903x_SpiWrite(device->common.devHalInfo, dataPageSetup, DATA_TRANSACTION_1_SIZE); + if (halError != ADI_HAL_ERR_OK) + { + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ErrCodeConvert(halError); + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + dataPageSetup, + "Error writing rx gain value"); + goto cleanup; + } + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + /* update first write to signify we have wrote the data at least once and paging registers are configured correctly */ + firstWrite = 1U; + } + else + { + /* update data array to point to correct slice and with correct gain index for given configIndex */ + data[2U] = rxFuncSecondByte; + data[5U] = rxGain[configIndex].gainIndex; + halError = adrv903x_SpiWrite(device->common.devHalInfo, data, DATA_TRANSACTION_2_SIZE); + if (halError != ADI_HAL_ERR_OK) + { + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ErrCodeConvert(halError); + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + data, + "Error writing rx gain value"); + goto cleanup; + } + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxMgcGainGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxGain_t * const rxGain) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + +#if ADI_ADRV903X_RX_RANGE_CHECK > 0 + recoveryAction = adrv903x_RxGainGetRangeCheck(device, rxChannel, rxGain); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxGainGetRangeCheck Issue"); + goto cleanup; + } +#endif + + /*Check for null rxGain pointer*/ + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxGain, cleanup); + + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, rxChannel, &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx Channel used to determine rx func address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcManualGainIndex_BfGet(device, + NULL, + rxFuncsBaseAddr, + &rxGain->gainIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get Rx manual gain index for channel"); + goto cleanup; + } + + /* Set rxChannelMask to a valid Rx Channel */ + rxGain->rxChannelMask = (uint32_t)rxChannel; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxGain_t * const rxGain) +{ + static const uint8_t LATCH_READBACK_DUMMY_DATA = 0xFFU; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + uint8_t latchReadback = 0; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + +#if ADI_ADRV903X_RX_RANGE_CHECK > 0 + recoveryAction = adrv903x_RxGainGetRangeCheck(device, rxChannel, rxGain); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxGainGetRangeCheck Issue"); + goto cleanup; + } +#endif + + /*Check for null rxGain pointer*/ + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxGain, cleanup); + + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, + rxChannel, + &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Rx funcs address get issue"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_AgcEnableGainIndexUpdate_BfGet(device, NULL, rxFuncsBaseAddr, &latchReadback); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading enable gain index update bit"); + goto cleanup; + } + + if (latchReadback == ADI_TRUE) + { + recoveryAction = adrv903x_RxFuncs_AgcGainIndex_BfSet(device, + NULL, + rxFuncsBaseAddr, + LATCH_READBACK_DUMMY_DATA); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while writing dummy data to latch gain index readback"); + goto cleanup; + } + } + + recoveryAction = adrv903x_RxFuncs_AgcGainIndex_BfGet(device, + NULL, + rxFuncsBaseAddr, + &rxGain->gainIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading AGC gain index"); + goto cleanup; + } + + /* Set rxChannelMask to a valid Rx Channel */ + rxGain->rxChannelMask = (uint32_t)rxChannel; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxDataFormatGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxDataFormatRt_t * const rxDataFormat) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, rxDataFormat); + + /* Check if the requested rxChannel is valid Rx or ORx channel. */ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7) && + (rxChannel != ADI_ADRV903X_ORX0) && + (rxChannel != ADI_ADRV903X_ORX1) ) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for RxDataFormatGet"); + goto cleanup; + } + + /* Retrieve the format selection with adrv903x_RxDataFormatSelectGet */ + recoveryAction = adrv903x_RxDataFormatSelectGet(device, + rxChannel, + &rxDataFormat->rxDataFormat.formatSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error getting RxDataFormat formatSelect"); + goto cleanup; + } + + /* Retrieve the floating point format configuration with adrv903x_RxDataFormatFloatingPointGet */ + recoveryAction = adrv903x_RxDataFormatFloatingPointGet( device, + rxChannel, + &rxDataFormat->rxDataFormat.floatingPointConfig); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error getting RxDataFormat floatingPointConfig"); + goto cleanup; + } + + + /* Retrieve the integer format configuration with adrv903x_RxDataFormatIntegerGet */ + recoveryAction = adrv903x_RxDataFormatIntegerGet( device, + rxChannel, + &rxDataFormat->rxDataFormat.integerConfigSettings, + &rxDataFormat->rxDataFormat.slicerConfigSettings); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error getting RxDataFormat integerConfigSettings and slicerConfigSettings"); + goto cleanup; + } + + /* Retrieve the embedded overload indicator format configuration with adrv903x_RxDataFormatEmbOvldMonitorGet */ + recoveryAction = adrv903x_RxDataFormatEmbOvldMonitorGet( device, + rxChannel, + &rxDataFormat->rxDataFormat.embOvldMonitorSettings); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error getting RxDataFormat embOvldMonitorSettings"); + goto cleanup; + } + + /* Retrieve the external LNA gain compensation and gain temperature compensation with adrv903x_RxGainCompExtLnaGet and adrv903x_RxGainCompTempEnableGet */ + recoveryAction = adrv903x_RxGainCompExtLnaGet( device, + rxChannel, + &rxDataFormat->rxDataFormat.externalLnaGain); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error getting RxDataFormat externalLnaGain"); + goto cleanup; + } + + recoveryAction = adrv903x_RxGainCompTempEnableGet( device, + rxChannel, + &rxDataFormat->rxDataFormat.tempCompensationEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error getting RxDataFormat tempCompensationEnable"); + goto cleanup; + } + + /* Populate the rxChannelMask field of the output structure with the specified channel. */ + rxDataFormat->rxChannelMask = rxChannel; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxSlicerPositionGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint8_t* const slicerPosition) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxFuncsChanAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + + /* Null pointer checks */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, slicerPosition, cleanup); + + /* Check that the requested rxChannel is valid. ORx not allowed */ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, recoveryAction, rxChannel, "Invalid Rx Channel Requested for reading slicer position"); + goto cleanup; + } + + /* Get Rx Funcs Bitfield Address */ + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet( device, + rxChannel, + &rxFuncsChanAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to retrieve Rx Funcs base address"); + goto cleanup; + } + + /* Get Slicer Position from Bitfield */ + recoveryAction = adrv903x_RxFuncs_RxdpSlicerPosition_BfGet(device, + NULL, + rxFuncsChanAddr, + slicerPosition); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT( &device->common, recoveryAction, "RxdpSlicerPosition readback issue"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxLoSourceGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_LoSel_e * const rxLoSource) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Check Rx data format config pointer is not NULL*/ + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxLoSource, cleanup); + + /* Check that the requested rxChannel is valid */ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "Invalid Rx channel selected for LO source mapping read back. Valid Rx channels are Rx0-Rx7."); + goto cleanup; + } + + /* Check that rx profile is valid in current config */ + if (((device->devStateInfo.profilesValid & ADI_ADRV903X_RX_PROFILE_VALID) != ADI_ADRV903X_RX_PROFILE_VALID) + || (device->devStateInfo.initializedChannels & (uint32_t)rxChannel) == 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + rxChannel, + "LO source read back requested for an Rx channel but Rx profile is invalid or channel not initialized in the device structure"); + goto cleanup; + } + + /* Readback Rx LO source selection */ + recoveryAction = adrv903x_RxLoSourceGet(device, rxChannel, rxLoSource); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error retrieving Lo Source for Rx channel."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxNcoShifterSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxNcoConfig_t* const rxNcoConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_RxNcoConfig_t rxNcoInfo; + adrv903x_RxNcoConfigResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t cpuTypeIdx = 0U; + uint8_t channelMaskRet = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxNcoConfig, cleanup); + ADI_LIBRARY_MEMSET(&rxNcoInfo, 0, sizeof(rxNcoInfo)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(cmdRsp)); + + if (rxNcoConfig->bandSelect >= ADRV903X_DDC_NUM_BAND) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxNcoConfig->bandSelect, "Invalid bandSelect provided."); + goto cleanup; + } + + /* Prepare the command payload */ + rxNcoInfo.chanSelect = (uint8_t) rxNcoConfig->chanSelect; + rxNcoInfo.bandSelect = (adi_adrv903x_DdcNumber_t) rxNcoConfig->bandSelect; + rxNcoInfo.enable = (uint8_t) rxNcoConfig->enable; + rxNcoInfo.phase = (uint32_t) ADRV903X_HTOCL(rxNcoConfig->phase); + rxNcoInfo.frequencyKhz = (int32_t) ADRV903X_HTOCL(rxNcoConfig->frequencyKhz); + + /* For each CPU, send the command, wait for a response, and process any errors. + * Only the CPU that owns this channel will set chanSelect in its response. + */ + for (cpuTypeIdx = 0U; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_RX_NCO, + (void*)&rxNcoInfo, + sizeof(rxNcoInfo), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + channelMaskRet |= cmdRsp.chanSelect; + if (channelMaskRet == rxNcoInfo.chanSelect) + { + goto cleanup; + } + } + /* if didn't go to cleanup, then some error occurred.*/ + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMaskRet, "Firmware did not execute cmd on all channels requested"); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxNcoShifterGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_RxNcoConfigReadbackResp_t* const rxRbConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_RxNcoConfigReadback_t rxNcoCfgRbCmd; + adi_adrv903x_RxNcoConfigReadbackResp_t rxNcoCfgGetCmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_NO_ERROR; + uint32_t cpuType = 0U; + uint32_t chIdx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxRbConfig, cleanup); + + ADI_LIBRARY_MEMSET(&rxNcoCfgRbCmd, 0, sizeof(rxNcoCfgRbCmd)); + ADI_LIBRARY_MEMSET(&rxNcoCfgGetCmdRsp, 0, sizeof(rxNcoCfgGetCmdRsp)); + + /* Testing if channel mask has more than two channels activated */ + if (rxRbConfig->chanSelect == (uint8_t) ADI_ADRV903X_RXOFF || + rxRbConfig->chanSelect > (uint8_t) ADI_ADRV903X_RX7 || + (((rxRbConfig->chanSelect - 1) & rxRbConfig->chanSelect) != 0U)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxRbConfig->chanSelect, "Invalid chanSelect provided."); + goto cleanup; + } + + if (rxRbConfig->bandSelect >= ADRV903X_DDC_NUM_BAND) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxRbConfig->bandSelect, "Invalid bandSelect provided."); + goto cleanup; + } + + /* Get CPU assigned to this channel */ + for (chIdx = 0U; chIdx < ADI_ADRV903X_MAX_CHANNELS; chIdx++) + { + if (rxRbConfig->chanSelect == ((uint8_t)1U << chIdx)) + { + cpuType = device->initExtract.rxTxCpuConfig[chIdx]; + break; + } + } + + /* Prepare the command payload */ + rxNcoCfgRbCmd.chanSelect = (uint8_t) rxRbConfig->chanSelect; + rxNcoCfgRbCmd.bandSelect = (adi_adrv903x_DdcNumber_t) rxRbConfig->bandSelect; + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + (adi_adrv903x_CpuType_e)cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_RX_NCO, + (void*)&rxNcoCfgRbCmd, + sizeof(rxNcoCfgRbCmd), + (void*)&rxNcoCfgGetCmdRsp, + sizeof(rxNcoCfgGetCmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO((adrv903x_CpuErrorCode_e)rxNcoCfgGetCmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup) ; + } + + if (rxNcoCfgGetCmdRsp.chanSelect == rxNcoCfgRbCmd.chanSelect) + { + /* Extract the command-specific response from the response payload */ + rxRbConfig->enabled = (uint8_t) rxNcoCfgGetCmdRsp.enabled; + rxRbConfig->phase = (uint32_t) ADRV903X_CTOHL(rxNcoCfgGetCmdRsp.phase); + rxRbConfig->frequencyKhz = (int32_t) ADRV903X_CTOHL(rxNcoCfgGetCmdRsp.frequencyKhz); + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxRbConfig->chanSelect, "Channel is not handled by the CPU"); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_OrxNcoSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_ORxNcoConfig_t * const orxNcoConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_ORxNcoConfig_t orxNcoInfo; + adrv903x_ORxNcoConfigResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_CpuErrorCode_t cpuErrorCode = 0U; + uint32_t cpuTypeIdx = 0U; + uint8_t channelMaskRet = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, orxNcoConfig, cleanup); + + ADI_LIBRARY_MEMSET(&orxNcoInfo, 0, sizeof(orxNcoInfo)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(cmdRsp)); + + /* Prepare the command payload */ + orxNcoInfo.chanSelect = (uint8_t) orxNcoConfig->chanSelect; + orxNcoInfo.ncoSelect = (uint8_t) orxNcoConfig->ncoSelect; + orxNcoInfo.enable = (uint8_t) orxNcoConfig->enable; + orxNcoInfo.phase = (uint32_t) ADRV903X_HTOCL(orxNcoConfig->phase); + orxNcoInfo.frequencyKhz = (int32_t) ADRV903X_HTOCL(orxNcoConfig->frequencyKhz); + + /* For each CPU, send the command, wait for a response, and process any errors. + * Only the CPU that owns this channel will set chanSelect in its response. + */ + for (cpuTypeIdx = 0U; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_ORX_NCO, + (void*)&orxNcoInfo, + sizeof(orxNcoInfo), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + channelMaskRet |= cmdRsp.chanSelect; + if (channelMaskRet == orxNcoInfo.chanSelect) + { + goto cleanup; + } + } + /* if didn't go to cleanup, then some error occurred.*/ + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMaskRet, "Firmware did not execute cmd on all channels requested"); + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_OrxNcoSet_v2(adi_adrv903x_Device_t* const device, + const adi_adrv903x_ORxNcoConfig_t * const orxNcoConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_ORxNcoConfig_t orxNcoInfo; + adrv903x_ORxNcoConfigResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adi_adrv903x_CpuErrorCode_t cpuErrorCode = 0U; + uint32_t cpuTypeIdx = 0U; + uint8_t channelMaskRet = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, orxNcoConfig, cleanup); + + ADI_LIBRARY_MEMSET(&orxNcoInfo, 0, sizeof(orxNcoInfo)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(cmdRsp)); + + /* Prepare the command payload */ + orxNcoInfo.chanSelect = (uint8_t) orxNcoConfig->chanSelect; + orxNcoInfo.ncoSelect = (uint8_t) orxNcoConfig->ncoSelect; + orxNcoInfo.enable = (uint8_t) orxNcoConfig->enable; + orxNcoInfo.phase = (uint32_t) ADRV903X_HTOCL(orxNcoConfig->phase); + orxNcoInfo.frequencyKhz = (int32_t) ADRV903X_HTOCL(orxNcoConfig->frequencyKhz); + + /* For each CPU, send the command, wait for a response, and process any errors. + * Only the CPU that owns this channel will set chanSelect in its response. + */ + for (cpuTypeIdx = 0U; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_ORX_NCO_V2, + (void*)&orxNcoInfo, + sizeof(orxNcoInfo), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + channelMaskRet |= cmdRsp.chanSelect; + if (channelMaskRet == orxNcoInfo.chanSelect) + { + goto cleanup; + } + } + /* if didn't go to cleanup, then some error occurred.*/ + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMaskRet, "Firmware did not execute cmd on all channels requested"); + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_OrxNcoGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_ORxNcoConfigReadbackResp_t* const orxRbConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_ORxNcoConfigReadback_t orxNcoCfgRbCmd; + adi_adrv903x_ORxNcoConfigReadbackResp_t orxNcoCfgGetCmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t cpuTypeIdx = 0U; + uint8_t channelMaskRet = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, orxRbConfig, cleanup); + ADI_LIBRARY_MEMSET(&orxNcoCfgRbCmd, 0, sizeof(orxNcoCfgRbCmd)); + ADI_LIBRARY_MEMSET(&orxNcoCfgGetCmdRsp, 0, sizeof(orxNcoCfgGetCmdRsp)); + + /* Testing if channel mask has more than two channels activated*/ + if (orxRbConfig->chanSelect == (uint8_t) ADI_ADRV903X_RXOFF || + orxRbConfig->chanSelect > (uint8_t) ADI_ADRV903X_RX7 || + (((orxRbConfig->chanSelect - 1) & orxRbConfig->chanSelect) != 0U)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, orxRbConfig->chanSelect, "Invalid chanSelect provided."); + goto cleanup; + } + + /* Prepare the command payload */ + orxNcoCfgRbCmd.chanSelect = (uint8_t) orxRbConfig->chanSelect; + orxNcoCfgRbCmd.ncoSelect = (uint8_t) orxRbConfig->ncoSelect; + + /* For each CPU, send the command, wait for a response, and process any errors. + * Only the CPU that owns this channel will set chanSelect in its response. + */ + for (cpuTypeIdx = 0U; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_ORX_NCO, + (void*)&orxNcoCfgRbCmd, + sizeof(orxNcoCfgRbCmd), + (void*)&orxNcoCfgGetCmdRsp, + sizeof(orxNcoCfgGetCmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO((adrv903x_CpuErrorCode_e)orxNcoCfgGetCmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup) ; + } + + channelMaskRet = orxNcoCfgGetCmdRsp.chanSelect; + if (channelMaskRet == orxNcoCfgRbCmd.chanSelect) + { + /* Extract the command-specific response from the response payload */ + orxRbConfig->enabled = (uint8_t) orxNcoCfgGetCmdRsp.enabled; + orxRbConfig->phase = (uint32_t) ADRV903X_CTOHL(orxNcoCfgGetCmdRsp.phase); + orxRbConfig->frequencyKhz = (int32_t) ADRV903X_CTOHL(orxNcoCfgGetCmdRsp.frequencyKhz); + orxRbConfig->status = (uint32_t) ADRV903X_CTOHL(orxNcoCfgGetCmdRsp.status); + goto cleanup; + } + } + /* if didn't go to cleanup, then some error occurred.*/ + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMaskRet, "Firmware did not execute cmd on all channels requested"); + + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxDecimatedPowerCfgSet(adi_adrv903x_Device_t * const device, + adi_adrv903x_RxDecimatedPowerCfg_t rxDecPowerCfg[], + const uint32_t numOfDecPowerCfgs) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + static const uint8_t TDD_MODE_ENABLE_DEFAULT_VAL = 1U; + static const uint16_t TDD_MODE_DELAY_DEFAULT_VAL = 0U; + static const uint8_t NUMBER_OF_RX_DDC = 2U; + uint32_t cfgIdx = 0U; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + uint8_t decPowerEnable = 0U; + uint8_t decPowerAgcSelect = 0U; + uint8_t decPowerClockEnable = 0U; + uint8_t hb2OutClkDivRatio = 0U; + uint8_t ddcSelection = 0U; + uint32_t ddcMask = 0U; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + adrv903x_BfRxChanAddr_e rxDigBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_DIG; + adrv903x_BfRxDdcChanAddr_e ddcAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxDecPowerCfg, cleanup); + + if (numOfDecPowerCfgs == 0U) + { + /* no valid configs */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numOfDecPowerCfgs, "Invalid Number of Dec Power Configurations"); + goto cleanup; + } + + /* Loop through the number of configurations and perform range checks */ + for (cfgIdx = 0U; cfgIdx < numOfDecPowerCfgs; ++cfgIdx) + { + recoveryAction = adrv903x_DecPowerCfgRangeCheck(device, &rxDecPowerCfg[cfgIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Dec power range Check Error Reported"); + goto cleanup; + } + } + + /* Write out the configurations */ + for (cfgIdx = 0U; cfgIdx < numOfDecPowerCfgs; ++cfgIdx) + { + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_RX_ONLY; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(rxDecPowerCfg[cfgIdx].rxChannelMask, chanSel)) + { + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, (adi_adrv903x_RxChannels_e)(chanSel), &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Invalid Rx Channel used to determine rx func address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxBitfieldAddressGet(device, (adi_adrv903x_RxChannels_e)(chanSel), &rxDigBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Invalid Rx Channel used to determine rx dig address"); + goto cleanup; + } + + if (rxDecPowerCfg[cfgIdx].decPowerControl == ADI_ADRV903X_DEC_POWER_MEAS_OFF) + { + /* Manual(SPI) control, user disables the dec power measurement */ + decPowerEnable = 0U; + decPowerAgcSelect = 0U; + decPowerClockEnable = 0U; + } + else if (rxDecPowerCfg[cfgIdx].decPowerControl == ADI_ADRV903X_DEC_POWER_MEAS_ON) + { + /* Manual(SPI) control, user enables the dec power measurement */ + decPowerEnable = 1U; + decPowerAgcSelect = 0U; + decPowerClockEnable = 1U; + } + else + { + /* AGC controls the decimated power, decPowerEnable is a don't care for this case */ + decPowerEnable = 0U; + decPowerAgcSelect = 1U; + decPowerClockEnable = 1U; + } + + /* 1 - Clock configuration for decimated power block */ + recoveryAction = adrv903x_RxDig_Hb2OutClkDivideRatio_BfGet(device, NULL, rxDigBaseAddr, &hb2OutClkDivRatio); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read hb2 out clk divide ratio"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDig_DecpwrClkDivideRatio_BfSet(device, NULL, rxDigBaseAddr, hb2OutClkDivRatio); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write dec power clk divide ratio"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDig_DecpwrClkEnable_BfSet(device, NULL, rxDigBaseAddr, decPowerClockEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to set dec power clk enable bit"); + goto cleanup; + } + + /* 2 - Main path Dec power configuration */ + if (ADRV903X_BF_EQUAL(rxDecPowerCfg[cfgIdx].measBlockSelectMask, (uint32_t)ADI_ADRV903X_DEC_POWER_MAIN_PATH_MEAS_BLOCK)) + { + /* Disable Dec Power While Changing Configs */ + recoveryAction = adrv903x_RxFuncs_DecPowerEnable_BfSet(device, NULL, rxFuncsBaseAddr, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write dec power enable bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_DecPowerDataSel_BfSet(device, NULL, rxFuncsBaseAddr, rxDecPowerCfg[cfgIdx].powerInputSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write signal source for decimated power measurement"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_DecPowerMeasurementDuration_BfSet(device, NULL, rxFuncsBaseAddr, rxDecPowerCfg[cfgIdx].powerMeasurementDuration); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write decimated power measurement duration"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_DecPowerEnSpiOrAgcSelect_BfSet(device, NULL, rxFuncsBaseAddr, decPowerAgcSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write dec power AGC select bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_DecPowerTddModeEnable_BfSet(device, NULL, rxFuncsBaseAddr, TDD_MODE_ENABLE_DEFAULT_VAL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to enable Tdd mode for decimated power measurement"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_DecPowerStartDelayCounter_BfSet(device, NULL, rxFuncsBaseAddr, TDD_MODE_DELAY_DEFAULT_VAL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to enable Tdd mode for decimated power measurement"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_DecPowerEnable_BfSet(device, NULL, rxFuncsBaseAddr, decPowerEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write dec power enable bit"); + goto cleanup; + } + } + + /* 3 - Configure Band Decimated power blocks */ + ddcMask = 0U; + if (ADRV903X_BF_EQUAL(rxDecPowerCfg[cfgIdx].measBlockSelectMask, (uint32_t)ADI_ADRV903X_DEC_POWER_BAND_A_MEAS_BLOCK)) + { + ddcMask |= (1U << (uint32_t)ADI_ADRV903X_RX_DDC_BAND0); + } + + if (ADRV903X_BF_EQUAL(rxDecPowerCfg[cfgIdx].measBlockSelectMask, (uint32_t)ADI_ADRV903X_DEC_POWER_BAND_B_MEAS_BLOCK)) + { + ddcMask |= (1U << (uint32_t)ADI_ADRV903X_RX_DDC_BAND1); + } + + for (ddcSelection = 0U; ddcSelection < NUMBER_OF_RX_DDC; ddcSelection++) + { + if (ADRV903X_BF_EQUAL(ddcMask, (uint32_t)(1U << ddcSelection))) + { + /* Get Rx DDC Bitfield Address */ + recoveryAction = adrv903x_RxDdcBitfieldAddressGet(device, + (adi_adrv903x_RxChannels_e)(chanSel), + (adi_adrv903x_RxDdcs_e)ddcSelection, + &ddcAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Rx ddc bit field address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_DecPowerMeasurementDuration_BfSet(device, NULL, ddcAddr, rxDecPowerCfg[cfgIdx].powerMeasurementDuration); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write decimated power measurement duration"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_DecPowerEnable_BfSet(device, NULL, ddcAddr, decPowerEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write dec power enable bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_DecPowerEnSpiOrAgcSelect_BfSet(device, NULL, ddcAddr, decPowerAgcSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write dec power AGC select bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_DecPowerTddModeEnable_BfSet(device, NULL, ddcAddr, TDD_MODE_ENABLE_DEFAULT_VAL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to enable Tdd mode for decimated power measurement"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_DecPowerStartDelayCounter_BfSet(device, NULL, ddcAddr, TDD_MODE_DELAY_DEFAULT_VAL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to enable Tdd mode for decimated power measurement"); + goto cleanup; + } + } + } + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxDecimatedPowerCfgGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + const adi_adrv903x_DecPowerMeasurementBlock_e decPowerBlockSelection, + adi_adrv903x_RxDecimatedPowerCfg_t * const rxDecPowerCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + adrv903x_BfRxDdcChanAddr_e ddcAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + uint8_t decPowerEnable = 0U; + uint8_t decPowerAgcSelect = 0U; + adi_adrv903x_RxDdcs_e ddcSelection = ADI_ADRV903X_RX_DDC_BAND0; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxDecPowerCfg, cleanup); + + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + /* Invalid Rx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx channel selection"); + goto cleanup; + } + + if ((decPowerBlockSelection != ADI_ADRV903X_DEC_POWER_MAIN_PATH_MEAS_BLOCK) && + (decPowerBlockSelection != ADI_ADRV903X_DEC_POWER_BAND_A_MEAS_BLOCK) && + (decPowerBlockSelection != ADI_ADRV903X_DEC_POWER_BAND_B_MEAS_BLOCK)) + { + /* Invalid decimated power block selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, decPowerBlockSelection, "Invalid decimated power block selection"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, rxChannel, &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx Channel used to determine rx func address"); + goto cleanup; + } + + rxDecPowerCfg->rxChannelMask = (uint32_t)rxChannel; + + if (decPowerBlockSelection == ADI_ADRV903X_DEC_POWER_MAIN_PATH_MEAS_BLOCK) + { + recoveryAction = adrv903x_RxFuncs_DecPowerDataSel_BfGet(device, NULL, rxFuncsBaseAddr, &rxDecPowerCfg->powerInputSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read signal source for decimated power measurement"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_DecPowerMeasurementDuration_BfGet(device, NULL, rxFuncsBaseAddr, &rxDecPowerCfg->powerMeasurementDuration); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read decimated power measurement duration"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_DecPowerEnable_BfGet(device, NULL, rxFuncsBaseAddr, &decPowerEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write dec power enable bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_DecPowerEnSpiOrAgcSelect_BfGet(device, NULL, rxFuncsBaseAddr, &decPowerAgcSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write dec power AGC select bit"); + goto cleanup; + } + + rxDecPowerCfg->measBlockSelectMask = (uint8_t)ADI_ADRV903X_DEC_POWER_MAIN_PATH_MEAS_BLOCK; + } + else + { + if (decPowerBlockSelection == ADI_ADRV903X_DEC_POWER_BAND_A_MEAS_BLOCK) + { + ddcSelection = ADI_ADRV903X_RX_DDC_BAND0; + rxDecPowerCfg->measBlockSelectMask = (uint8_t)ADI_ADRV903X_DEC_POWER_BAND_A_MEAS_BLOCK; + } + else + { + ddcSelection = ADI_ADRV903X_RX_DDC_BAND1; + rxDecPowerCfg->measBlockSelectMask = (uint8_t)ADI_ADRV903X_DEC_POWER_BAND_B_MEAS_BLOCK; + } + + recoveryAction = adrv903x_RxDdcBitfieldAddressGet(device, rxChannel, ddcSelection, &ddcAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read DDC address"); + goto cleanup; + } + + rxDecPowerCfg->powerInputSelect = 0U; /* Input selection is not supported for DDC */ + + recoveryAction = adrv903x_RxDdc_DecPowerMeasurementDuration_BfGet(device, NULL, ddcAddr, &rxDecPowerCfg->powerMeasurementDuration); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read decimated power measurement duration"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_DecPowerEnable_BfGet(device, NULL, ddcAddr, &decPowerEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write dec power enable bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_DecPowerEnSpiOrAgcSelect_BfGet(device, NULL, ddcAddr, &decPowerAgcSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write dec power AGC select bit"); + goto cleanup; + } + } + + if ((decPowerEnable == 0U) && (decPowerAgcSelect == 0U)) + { + rxDecPowerCfg->decPowerControl = ADI_ADRV903X_DEC_POWER_MEAS_OFF; + } + else if ((decPowerEnable == 1U) && (decPowerAgcSelect == 0U)) + { + rxDecPowerCfg->decPowerControl = ADI_ADRV903X_DEC_POWER_MEAS_ON; + } + else if (decPowerAgcSelect == 1U) + { + rxDecPowerCfg->decPowerControl = ADI_ADRV903X_DEC_POWER_AGC_MEAS; + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid dec power measurement configuration is detected"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ORxDecimatedPowerCfgSet(adi_adrv903x_Device_t * const device, + adi_adrv903x_ORxDecimatedPowerCfg_t orxDecPowerCfg[], + const uint32_t numOfDecPowerCfgs) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + static const adi_adrv903x_RxChannels_e ORX_CHANNEL_ARR[] = { ADI_ADRV903X_ORX0, ADI_ADRV903X_ORX1 }; + static const uint32_t ORX_CHANNEL_ARR_SIZE = sizeof(ORX_CHANNEL_ARR) / sizeof(ORX_CHANNEL_ARR[0U]); + static const uint8_t HB2_INPUT_SELECT = 0U; + static const uint8_t HB2_OUTPUT_SELECT = 1U; + + uint32_t cfgIdx = 0U; + uint32_t chanIdx = 0U; + uint8_t clkDivRatio = 0U; + + adrv903x_BfOrxDigChanAddr_e orxDigBaseAddr = ADRV903X_BF_SLICE_ORX_0__ORX_DIG; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, orxDecPowerCfg, cleanup); + + if (numOfDecPowerCfgs == 0U) + { + /* no valid configs */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numOfDecPowerCfgs, "Invalid Number of Dec Power Configurations"); + goto cleanup; + } + + /* Loop through the number of configurations and perform range checks */ + for (cfgIdx = 0U; cfgIdx < numOfDecPowerCfgs; ++cfgIdx) + { + recoveryAction = adrv903x_OrxDecPowerCfgRangeCheck(device, &orxDecPowerCfg[cfgIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Orx Dec power range check Error Reported"); + goto cleanup; + } + } + + /* Write out the configurations */ + for (cfgIdx = 0U; cfgIdx < numOfDecPowerCfgs; ++cfgIdx) + { + for (chanIdx = 0U; chanIdx < ORX_CHANNEL_ARR_SIZE; chanIdx++) + { + if ((orxDecPowerCfg[cfgIdx].orxChannelMask & (uint32_t)ORX_CHANNEL_ARR[chanIdx]) == (uint32_t)ORX_CHANNEL_ARR[chanIdx]) + { + recoveryAction = adrv903x_OrxBitfieldAddressGet(device, ORX_CHANNEL_ARR[chanIdx], &orxDigBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid ORx Channel used to determine orx dig address"); + goto cleanup; + } + + /* Read clock divider value to be configured for measurement block based upon input source selection */ + if (orxDecPowerCfg[cfgIdx].powerInputSelect == HB2_INPUT_SELECT) + { + recoveryAction = adrv903x_OrxDig_Hb2InClkDivideRatio_BfGet(device, + NULL, + orxDigBaseAddr, + &clkDivRatio); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading hb2 input clk divide ratio"); + goto cleanup; + } + } + else if (orxDecPowerCfg[cfgIdx].powerInputSelect == HB2_OUTPUT_SELECT) + { + recoveryAction = adrv903x_OrxDig_Hb2OutClkDivideRatio_BfGet(device, + NULL, + orxDigBaseAddr, + &clkDivRatio); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading hb2 output clk divide ratio"); + goto cleanup; + } + } + else + { + recoveryAction = adrv903x_OrxDig_Hb1OutClkDivideRatio_BfGet(device, + NULL, + orxDigBaseAddr, + &clkDivRatio); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading hb1 output clk divide ratio"); + goto cleanup; + } + } + + /* Set clk divide ratio for power measurement block */ + recoveryAction = adrv903x_OrxDig_PnpClkDivideRatio_BfSet(device, + NULL, + orxDigBaseAddr, + clkDivRatio); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting Pnp clock divide ratio"); + goto cleanup; + } + + recoveryAction = adrv903x_OrxDig_PwrMeasInputSel_BfSet(device, + NULL, + orxDigBaseAddr, + orxDecPowerCfg[cfgIdx].powerInputSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting power measurement input selection"); + goto cleanup; + } + + recoveryAction = adrv903x_OrxDig_DecpwrCount_BfSet(device, + NULL, + orxDigBaseAddr, + orxDecPowerCfg[cfgIdx].powerMeasurementDuration); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting power measurement duration"); + goto cleanup; + } + + recoveryAction = adrv903x_OrxDig_StreamprocPnpClkEnable_BfSet(device, + NULL, + orxDigBaseAddr, + orxDecPowerCfg[cfgIdx].measurementEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting power measurement clk enable bit"); + goto cleanup; + } + + recoveryAction = adrv903x_OrxDig_PwrMeasEnable_BfSet(device, + NULL, + orxDigBaseAddr, + orxDecPowerCfg[cfgIdx].measurementEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting power measurement enable bit"); + goto cleanup; + } + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_ORxDecimatedPowerCfgGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e orxChannel, + adi_adrv903x_ORxDecimatedPowerCfg_t * const orxDecPowerCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfOrxDigChanAddr_e orxDigBaseAddr = ADRV903X_BF_SLICE_ORX_0__ORX_DIG; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, orxDecPowerCfg, cleanup); + + + if ((orxChannel != ADI_ADRV903X_ORX0) && + (orxChannel != ADI_ADRV903X_ORX1)) + { + /* Invalid Orx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, orxChannel, "Invalid Orx channel selection"); + goto cleanup; + } + + /* Read back the configuration of selected channel */ + recoveryAction = adrv903x_OrxBitfieldAddressGet(device, orxChannel, &orxDigBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid ORx Channel used to determine orx dig address"); + goto cleanup; + } + + recoveryAction = adrv903x_OrxDig_PwrMeasInputSel_BfGet(device, + NULL, + orxDigBaseAddr, + &orxDecPowerCfg->powerInputSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading power measurement input selection"); + goto cleanup; + } + + recoveryAction = adrv903x_OrxDig_DecpwrCount_BfGet(device, + NULL, + orxDigBaseAddr, + &orxDecPowerCfg->powerMeasurementDuration); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading power measurement duration"); + goto cleanup; + } + + recoveryAction = adrv903x_OrxDig_PwrMeasEnable_BfGet(device, + NULL, + orxDigBaseAddr, + &orxDecPowerCfg->measurementEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading power measurement enable bit"); + goto cleanup; + } + + orxDecPowerCfg->orxChannelMask = (uint32_t)orxChannel; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxDecimatedPowerGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_RxChannels_e rxChannel, + const adi_adrv903x_DecPowerMeasurementBlock_e decPowerBlockSelection, + uint8_t * const powerReadBack) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxFuncsBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_FUNCS; + adrv903x_BfRxDdcChanAddr_e ddcAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + adi_adrv903x_RxDdcs_e ddcSelection = ADI_ADRV903X_RX_DDC_BAND0; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, powerReadBack, cleanup); + + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7) + && + (rxChannel != ADI_ADRV903X_ORX0) && /* ORx only supported on ADRV903X */ + (rxChannel != ADI_ADRV903X_ORX1) + ) + { + /* Invalid channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid channel selection"); + goto cleanup; + } + + if ((rxChannel == ADI_ADRV903X_ORX0) || + (rxChannel == ADI_ADRV903X_ORX1)) + { + adrv903x_BfOrxDigChanAddr_e orxDigBaseAddr = ADRV903X_BF_SLICE_ORX_0__ORX_DIG; + + /* ORx channel is selected */ + recoveryAction = adrv903x_OrxBitfieldAddressGet(device, rxChannel, &orxDigBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid ORx Channel used to determine orx dig address"); + goto cleanup; + } + + recoveryAction = adrv903x_OrxDig_DecpwrValueReadback_BfSet(device, + NULL, + orxDigBaseAddr, + 1U); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting decimated power readback latch bit"); + goto cleanup; + } + + recoveryAction = adrv903x_OrxDig_Decpwr_BfGet(device, + NULL, + orxDigBaseAddr, + powerReadBack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading decimated power for selected Orx channel"); + goto cleanup; + } + } + else if (decPowerBlockSelection == ADI_ADRV903X_DEC_POWER_MAIN_PATH_MEAS_BLOCK) + { + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, + rxChannel, + &rxFuncsBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid Rx Channel used to determine rx func address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxFuncs_DecPowerReadback_BfSet(device, + NULL, + rxFuncsBaseAddr, + 1U); + if(recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting decimated power readback latch bit"); + goto cleanup ; + } + + recoveryAction = adrv903x_RxFuncs_DecPowerValue_BfGet(device, + NULL, + rxFuncsBaseAddr, + powerReadBack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading main path decimated power for selected Rx channel"); + goto cleanup; + } + } + else + { + if (decPowerBlockSelection == ADI_ADRV903X_DEC_POWER_BAND_A_MEAS_BLOCK) + { + ddcSelection = ADI_ADRV903X_RX_DDC_BAND0; + + } + else if (decPowerBlockSelection == ADI_ADRV903X_DEC_POWER_BAND_B_MEAS_BLOCK) + { + ddcSelection = ADI_ADRV903X_RX_DDC_BAND1; + } + else + { + /* Invalid decPowerBlockSelection selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid decPowerBlockSelection selection"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdcBitfieldAddressGet(device, + rxChannel, + ddcSelection, + &ddcAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read DDC address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_DecPowerValueReadback_BfSet(device, + NULL, + ddcAddr, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting decimated power readback latch bit"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDdc_DecPowerValue_BfGet(device, + NULL, + ddcAddr, + powerReadBack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading band decimated power for selected Rx channel"); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_OrxAttenSet(adi_adrv903x_Device_t* const device, + const uint32_t channelMask, + const uint8_t attenDb) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t chanId = 0U; + uint8_t trmAtten = 0U; + uint8_t trmAttenBwCapEn = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + if (channelMask > MAX_ORX_CHANNEL_MASK) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + channelMask, + "Invalid channelMask"); + goto cleanup; + } + + if (attenDb > ADI_ADRV903X_MAX_ORX_ATTEN_DB) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + attenDb, + "attenDb outside maximum range"); + goto cleanup; + } + + recoveryAction = adrv903x_ORxAttenDbToRegValues(device, attenDb, &trmAtten, &trmAttenBwCapEn); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adrv903x_ORxAttenDbToRegValues failed"); + goto cleanup; + } + + /* for each channel in channelMask */ + for (chanId = 0U; chanId <= MAX_ORX_CHANNEL_ID; chanId++) + { + if ((channelMask & (1 << chanId)) == 0) + { + /* Skip this channel */ + continue; + } + + /* ensure channel's trm_atten_pd is always set 0 */ + recoveryAction = adrv903x_ActrlOrxWestRegmap_TrmAttenPd_BfSet(device, NULL, chanIdToOrxWestRegmapChanAddr[chanId], 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting TrmAttenPd bitfield"); + goto cleanup; + } + + /* ensure channel's trm_cm_cap_en is always set 1 */ + recoveryAction = adrv903x_ActrlOrxWestRegmap_TrmAttenCmCapEn_BfSet(device, NULL, chanIdToOrxWestRegmapChanAddr[chanId], 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting TrmAttenCmCapEn bitfield"); + goto cleanup; + } + + /* Set this ORx channel's trm_atten bitfield */ + recoveryAction = adrv903x_ActrlOrxWestRegmap_TrmAtten_BfSet(device, + NULL, + chanIdToOrxWestRegmapChanAddr[chanId], + (adrv903x_Bf_ActrlOrxWestRegmap_TrmAtten_e)trmAtten); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "ORX attenuator trimmer set issue"); + goto cleanup; + } + + /* Set this ORx channel's trm_atten_bw_cap - NOTE: the register is called trm_atten_spare2 */ + recoveryAction = adrv903x_ActrlOrxWestRegmap_TrmAttenSpare2_BfSet(device, + NULL, + chanIdToOrxWestRegmapChanAddr[chanId], + trmAttenBwCapEn); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error setting TrmAttenSpare2 bitfield"); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_OrxAttenGet(adi_adrv903x_Device_t* const device, + const uint8_t channelId, + uint8_t* const attenDb) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + adrv903x_Bf_ActrlOrxWestRegmap_TrmAtten_e trmAtten = ADRV903X_BF_ACTRL_ORX_WEST_REGMAP_TRM_ATTEN_ATTEN_0DB; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + if (channelId > MAX_ORX_CHANNEL_ID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + channelId, + "Invalid channelId"); + goto cleanup; + } + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, attenDb, cleanup); + + /* Get the channel's attenuation */ + recoveryAction = adrv903x_ActrlOrxWestRegmap_TrmAtten_BfGet(device, + NULL, + chanIdToOrxWestRegmapChanAddr[channelId], + &trmAtten); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + ADI_NO_VARIABLE, + "ORX attenuator trimmer get issue"); + goto cleanup; + } + + recoveryAction = adrv903x_ORxTrmAttenToDb(device, trmAtten, attenDb); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + ADI_NO_VARIABLE, + "adrv903x_ORxTrmAttenToDb failed"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainCtrlModeSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxGainCtrlModeCfg_t gainCtrlModeCfg[], + const uint32_t arraySize) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxChannelBitfieldAddr; + uint32_t gainCtrlModeIndex = 0U; + uint32_t rxChannelIndex = 0U; + uint32_t rxChannel = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gainCtrlModeCfg, cleanup); + + if (arraySize == 0U) + { + /* no valid configs */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, arraySize, "Invalid number of gain control mode array"); + goto cleanup; + } + + /* check each item in the input array, make sure the parameters are valid */ + for (gainCtrlModeIndex = 0; gainCtrlModeIndex < arraySize; gainCtrlModeIndex++) + { + /* rxChannelMask should larger than 0 and less than 0x100 */ + if ((gainCtrlModeCfg[gainCtrlModeIndex].rxChannelMask == 0U) || + ((gainCtrlModeCfg[gainCtrlModeIndex].rxChannelMask & (~(uint32_t)ADI_ADRV903X_RX_MASK_ALL)) != 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gainCtrlModeCfg[gainCtrlModeIndex].rxChannelMask, "Invalid Rx channel mask"); + goto cleanup; + } + + /* gainCtrlMode just support MGC and AGC type */ + if ((gainCtrlModeCfg[gainCtrlModeIndex].gainCtrlMode != ADI_ADRV903X_MGC) && + (gainCtrlModeCfg[gainCtrlModeIndex].gainCtrlMode != ADI_ADRV903X_AGC)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gainCtrlModeCfg[gainCtrlModeIndex].gainCtrlMode, "Invalid Rx channel gain control mode"); + goto cleanup; + } + } + + for (gainCtrlModeIndex = 0U; gainCtrlModeIndex < arraySize; gainCtrlModeIndex++) + { + for (rxChannelIndex = 0U; rxChannelIndex < ADI_ADRV903X_MAX_RX_ONLY; rxChannelIndex++) + { + rxChannel = 1U << rxChannelIndex; + if ((gainCtrlModeCfg[gainCtrlModeIndex].rxChannelMask & rxChannel) == rxChannel) + { + /* get the Rx channel function address */ + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, + (adi_adrv903x_RxChannels_e)rxChannel, + &rxChannelBitfieldAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx channel function address"); + goto cleanup; + } + + /* set gain control mode */ + recoveryAction = adrv903x_RxFuncs_AgcSetup_BfSet(device, + NULL, + rxChannelBitfieldAddr, + (uint8_t)gainCtrlModeCfg[gainCtrlModeIndex].gainCtrlMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Rx channel gain control mode set failure"); + goto cleanup; + } + } + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainCtrlModeGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxGainCtrlMode_e* gainCtrlMode) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxFuncsChanAddr_e rxChannelBitfieldAddr; + uint8_t value = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gainCtrlMode, cleanup); + + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + /* Invalid Rx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx channel selection"); + goto cleanup; + } + + /* get the Rx channel function address */ + recoveryAction = adrv903x_RxFuncsBitfieldAddressGet(device, + rxChannel, + &rxChannelBitfieldAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx channel function address"); + goto cleanup; + } + + /* set gain control mode */ + recoveryAction = adrv903x_RxFuncs_AgcSetup_BfGet(device, + NULL, + rxChannelBitfieldAddr, + &value); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Rx channel gain control mode get failure"); + goto cleanup; + } + + /* update gain control mode information */ + *gainCtrlMode = (adi_adrv903x_RxGainCtrlMode_e)value; + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTempGainCompSet(adi_adrv903x_Device_t* const device, + const uint32_t rxChannelMask, + const int8_t gainValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDdcChanAddr_e rxChannelBitfieldAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + uint32_t rxChannelIndex = 0U; + uint32_t rxChannel = 0U; + uint32_t ddcBand = 0U; + uint8_t value = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* rxChannelMask should larger than 0 and less than 0x100 */ + if ((rxChannelMask == 0U) || + ((rxChannelMask & (~(uint32_t)ADI_ADRV903X_RX_MASK_ALL)) != 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannelMask, "Invalid Rx channel mask"); + goto cleanup; + } + + /* check that gainValue is within allowable range */ + if ((gainValue < -63) || + (gainValue > 63)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gainValue, "Invalid Rx channel temperature gain value"); + goto cleanup; + } + else + { + /* register expects sign-magnitude value hence if value is negative, need to convert out of two's compliment and set the sign bit (bit 7) to 1 */ + if (gainValue < 0) + { + value = (uint8_t)((gainValue * (-1)) | 0x40); + } + else + { + value = (uint8_t)gainValue; + } + } + + for (rxChannelIndex = 0U; rxChannelIndex < ADI_ADRV903X_MAX_RX_ONLY; rxChannelIndex++) + { + rxChannel = 1U << rxChannelIndex; + if ((rxChannelMask & rxChannel) == rxChannel) + { + /* if an Rx channel mask is set, resolve the corresponding Rx DDC Bitfield Addresses (2 DDCs per channel)*/ + for (ddcBand = 0U; ddcBand < ADI_ADRV903X_MAX_RX_DDC_BANDS; ddcBand++) + { + recoveryAction = adrv903x_RxDdcBitfieldAddressGet(device, + (adi_adrv903x_RxChannels_e)rxChannel, + (adi_adrv903x_RxDdcs_e)ddcBand, + &rxChannelBitfieldAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, ddcBand, "get Rx channel DDC base address failure"); + goto cleanup; + } + + /* set temperature gain value */ + recoveryAction = adrv903x_RxDdc_RxTempGainComp_BfSet(device, + NULL, + rxChannelBitfieldAddr, + value); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "set Rx channel temperature gain value failure"); + goto cleanup; + } + } + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTempGainCompGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + int8_t* const gainValue) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDdcChanAddr_e rxChannelBitfieldAddr = ADRV903X_BF_SLICE_RX_0__RX_DDC_0_; + uint8_t value = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, gainValue, cleanup); + + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + /* Invalid Rx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx channel selection"); + goto cleanup; + } + + /* get the Rx channel DDC0 address */ + recoveryAction = adrv903x_RxDdcBitfieldAddressGet(device, + rxChannel, + ADI_ADRV903X_RX_DDC_BAND0, + &rxChannelBitfieldAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "get Rx channel DDC0 address failure"); + goto cleanup; + } + + /* get temperature gain value */ + recoveryAction = adrv903x_RxDdc_RxTempGainComp_BfGet(device, + NULL, + rxChannelBitfieldAddr, + &value); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "get Rx channel temperature gain value failure"); + goto cleanup; + } + + /* convert from 7-bit sign magnitude format to 8-bit two's complement + * sign magnitude format: sign bit + data bit (amplitude value), not use complement code + */ + if ((value & 0x40U) > 0) + { + /* handle the negative case */ + *gainValue = (int8_t)(value & 0x3FU) * (-1); + } + else + { + /* handle the positive case */ + *gainValue = (int8_t)value; + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTestDataSet(adi_adrv903x_Device_t* device, + const uint32_t rxChannelMask, + const adi_adrv903x_RxTestDataCfg_t* const rxTestDataCfg) +{ + /* The full range of generator selection options are not made available via the API we just use these + * two internally */ + uint8_t rxChannelIndex = 0U; + uint32_t chanSel = 0U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDigChanAddr_e rxDigBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_DIG; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxTestDataCfg, cleanup); + + if ((rxChannelMask == 0U) || + ((rxChannelMask > (uint32_t) ADI_ADRV903X_RX_MASK_ALL))) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannelMask, "Invalid Rx channel mask"); + goto cleanup; + } + + for (rxChannelIndex = 0U; rxChannelIndex < ADI_ADRV903X_MAX_RX_ONLY; rxChannelIndex++) + { + chanSel = 1U << rxChannelIndex; + adi_adrv903x_RxChannels_e rxChannel = (adi_adrv903x_RxChannels_e)(chanSel); + if ((rxChannelMask & (uint32_t) rxChannel) == 0) + { + /* This channel is not set in the rxChannelMask arg - skip it */ + continue; + } + + recoveryAction = adrv903x_RxBitfieldAddressGet(device, rxChannel, &rxDigBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx Channel used to determine rx dig address"); + goto cleanup; + } + + if (rxTestDataCfg->enable == 0U) + { + /* Disable the test signal */ + + /* Set register-control to disable test signal*/ + recoveryAction = adrv903x_RxDig_AdcTestGenEnSpi_BfSet(device, NULL, rxDigBaseAddr, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set ADC test generator enable SPI."); + goto cleanup; + } + + /* Set test signal enablement to be controlled by register (not GPIO) */ + recoveryAction = adrv903x_RxDig_AdcTestGenEnSel_BfSet(device, NULL, rxDigBaseAddr, ADC_TEST_GEN_EN_SEL_SPI); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to disable Rx ADC test signal. Could not set ADC test generator enable select."); + goto cleanup; + } + } + else + { + /* Enable the test signal */ + + /* First range check the freq */ + if (rxTestDataCfg->sineFreq > ADI_ADRV903X_FS_DIV_5 || rxTestDataCfg->sineFreq < ADI_ADRV903X_FS_DIV_40) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxTestDataCfg->sineFreq, "Invalid frequency"); + goto cleanup; + } + + /* Always use full-scale sine - other signal types are not exposed via the API */ + recoveryAction = adrv903x_RxDig_AdcTestGenSel_BfSet(device, NULL, rxDigBaseAddr, ADC_TEST_GEN_SEL_SINE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set ADC test generator select."); + goto cleanup; + } + + /* Always set the test signal frequency relative to ADC clock */ + recoveryAction = adrv903x_RxDig_AdcTestClkSel_BfSet(device, NULL, rxDigBaseAddr, ADC_TEST_GEN_CLK_ADC); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to enable ADC test generator clock select."); + goto cleanup; + } + + /* Set the test signal frequency */ + recoveryAction = adrv903x_RxDig_AdcTestGenSineFreq_BfSet(device, NULL, rxDigBaseAddr, (uint8_t) rxTestDataCfg->sineFreq); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set ADC test generator sine freq."); + goto cleanup; + } + + /* Set register-control to enable test signal*/ + recoveryAction = adrv903x_RxDig_AdcTestGenEnSpi_BfSet(device, NULL, rxDigBaseAddr, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set ADC test generator enable SPI."); + goto cleanup; + } + + /* Set test signal enablement to be controlled by register (not GPIO) */ + recoveryAction = adrv903x_RxDig_AdcTestGenEnSel_BfSet(device, NULL, rxDigBaseAddr, ADC_TEST_GEN_EN_SEL_SPI); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set test generator enable select."); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxTestDataGet(adi_adrv903x_Device_t* device, + const adi_adrv903x_RxChannels_e rxChannel, + adi_adrv903x_RxTestDataCfg_t* const rxTestDataCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfRxDigChanAddr_e rxDigBaseAddr = ADRV903X_BF_SLICE_RX_0__RX_DIG; + + /* Hold bitfield values read back */ + uint8_t genEnSel = 0U; /* Set adc_test_gen_en source to SPI */ + uint8_t genSel = 0U; /* Test signal type: Full scale, bypass etc */ + uint8_t clkSel = 0U; /* Send test data into ADC iface FIFO */ + uint8_t genEnSpi = 0U; /* Start sending test data */ + uint8_t tmpByte = 0U; /* Temp storage */ + adi_adrv903x_AdcTestSineFreq_e genSineFreq = ADI_ADRV903X_FS_DIV_40; /* Test signal frequency */ + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxTestDataCfg, cleanup); + + recoveryAction = adrv903x_RxBitfieldAddressGet(device, rxChannel, &rxDigBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannel, "Invalid Rx channel used to determine rx dig address"); + goto cleanup; + } + + recoveryAction = adrv903x_RxDig_AdcTestGenSel_BfGet(device, NULL, rxDigBaseAddr, &genSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read ADC test generator select."); + goto cleanup; + } + + recoveryAction = adrv903x_RxDig_AdcTestClkSel_BfGet(device, NULL, rxDigBaseAddr, &clkSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read ADC test generator clock select."); + goto cleanup; + } + + recoveryAction = adrv903x_RxDig_AdcTestGenEnSel_BfGet(device, NULL, rxDigBaseAddr, &genEnSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read ADC test generator enable select."); + goto cleanup; + } + + recoveryAction = adrv903x_RxDig_AdcTestGenSineFreq_BfGet(device, NULL, rxDigBaseAddr, &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read ADC test generator sine freq."); + goto cleanup; + } + + genSineFreq = (adi_adrv903x_AdcTestSineFreq_e)tmpByte; + + recoveryAction = adrv903x_RxDig_AdcTestGenEnSpi_BfGet(device, NULL, rxDigBaseAddr, &genEnSpi); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read ADC test generator enable SPI."); + goto cleanup; + } + + /* Return 'enabled' only if the settings are exactly as the setter function would enable */ + if ((genSel == ADC_TEST_GEN_SEL_SINE) && + (clkSel != 0U) && + (genEnSel == ADC_TEST_GEN_EN_SEL_SPI) && + (genEnSpi == 1U)) + { + rxTestDataCfg->enable = 1U; + rxTestDataCfg->sineFreq = genSineFreq; + } + else + { + rxTestDataCfg->enable = 0U; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxLoPowerDownSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannelMask, + const uint8_t enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t rxScratch7Addr = 0U; + uint8_t i = 0U; + + static const uint32_t rxChanToScratch7Addr[ADI_ADRV903X_MAX_RX_ONLY] = { + ADRV903X_ADDR_RX0_STREAM_SCRATCH7, + ADRV903X_ADDR_RX1_STREAM_SCRATCH7, + ADRV903X_ADDR_RX2_STREAM_SCRATCH7, + ADRV903X_ADDR_RX3_STREAM_SCRATCH7, + ADRV903X_ADDR_RX4_STREAM_SCRATCH7, + ADRV903X_ADDR_RX5_STREAM_SCRATCH7, + ADRV903X_ADDR_RX6_STREAM_SCRATCH7, + ADRV903X_ADDR_RX7_STREAM_SCRATCH7, + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + if ((rxChannelMask < ADI_ADRV903X_RX0) || (rxChannelMask >= ADI_ADRV903X_ORX0)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannelMask, "Invalid Rx channel passed - must be from Rx0 up to Rx7."); + goto cleanup; + } + + if ((enable != ADI_DISABLE) && (enable != ADI_ENABLE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, enable, "Invalid enable value passed - must be ADI_ENABLE or ADI_DISABLE"); + goto cleanup; + } + + for (i = 0U; i < ADI_ADRV903X_MAX_RX_ONLY; i++) + { + if (((uint32_t)rxChannelMask & (1U << i)) == (1U << i)) + { + rxScratch7Addr = rxChanToScratch7Addr[i]; + + /* Stream scratch pad bit is set to *skip* power down so is logical inversion of *enable* power down */ + recoveryAction = adi_adrv903x_Register32Write( device, + NULL, + rxScratch7Addr, + (uint32_t)(!enable), + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "SPI Issue while writing on stream scratch register."); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxSpurBaseBandFreqSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannelMask, + const int32_t bbFreqKhz, + const uint8_t enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_RxSpurFreqSet_t rxSpurConfig; + adi_adrv903x_RxSpurFreqConfigResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_NO_ERROR; + uint32_t cpuTypeIdx = 0U; + + /* Check Device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + if ((enable != ADI_DISABLE) && (enable != ADI_ENABLE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, enable, "Invalid enable value passed - must be ADI_ENABLE or ADI_DISABLE"); + goto cleanup; + } + + ADI_LIBRARY_MEMSET(&rxSpurConfig, 0, sizeof(rxSpurConfig)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(cmdRsp)); + + /* Prepare the command Payload */ + rxSpurConfig.rxChannelMask = ADRV903X_HTOCL(rxChannelMask); + rxSpurConfig.baseBandFreqKHz = ADRV903X_HTOCL(bbFreqKhz); + rxSpurConfig.enable = enable; + + /* For each CPU, send the command, wait for a response, and process any errors. */ + for (cpuTypeIdx = 0U; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and Receive Response */ + recoveryAction = adrv903x_CpuCmdSend(device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_RX_SPUR_BASE_BAND_FREQ_SET, + (void*)&rxSpurConfig, + sizeof(rxSpurConfig), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO((adrv903x_CpuErrorCode_e)ADRV903X_CTOHL(cmdRsp.status), cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxSpurBaseBandFreqGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannelMask, + adi_adrv903x_RxSpurFreqConfigResp_t* const rxSpurRbConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_RxSpurFreqConfigResp_t cmdRsp; + adi_adrv903x_RxSpurFreqGet_t rxSpurGetCmd; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_NO_ERROR; + uint32_t cpuTypeIdx = 0U; + uint8_t channelMaskRet = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxSpurRbConfig, cleanup); + + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(cmdRsp)); + ADI_LIBRARY_MEMSET(&rxSpurGetCmd, 0, sizeof(rxSpurGetCmd)); + + /* rxChannelMask must contain a single channel */ + if (rxChannelMask == ADI_ADRV903X_RX0 || + rxChannelMask == ADI_ADRV903X_RX1 || + rxChannelMask == ADI_ADRV903X_RX2 || + rxChannelMask == ADI_ADRV903X_RX3 || + rxChannelMask == ADI_ADRV903X_RX4 || + rxChannelMask == ADI_ADRV903X_RX5 || + rxChannelMask == ADI_ADRV903X_RX6 || + rxChannelMask == ADI_ADRV903X_RX7) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxChannelMask, "rxChannelMask parameter is invalid."); + goto cleanup; + } + + /* Prepare Command Payload */ + rxSpurGetCmd.rxChannelMask = ADRV903X_HTOCL(rxChannelMask); + + /* For each CPU, send the command, and verify the response. */ + for (cpuTypeIdx = 0U; cpuTypeIdx < (uint32_t)ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_RX_SPUR_BASE_BAND_FREQ_GET, + (void*)&rxSpurGetCmd, + sizeof(rxSpurGetCmd), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO((adrv903x_CpuErrorCode_e)ADRV903X_CTOHL(cmdRsp.status), cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + channelMaskRet = ADRV903X_CTOHL(cmdRsp.rxChannelMask); + if (channelMaskRet == rxChannelMask) + { + rxSpurRbConfig->baseBandFreqKHz = ADRV903X_CTOHL(cmdRsp.baseBandFreqKHz); + rxSpurRbConfig->status = ADRV903X_CTOHL(cmdRsp.status); + rxSpurRbConfig->enabled = cmdRsp.enabled; + break; + } + } + + /* The above loop should always break before cpuTypeIdx reaches ADI_ADRV903X_CPU_TYPE_MAX_RADIO */ + if (cpuTypeIdx >= ADI_ADRV903X_CPU_TYPE_MAX_RADIO) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMaskRet, "FW did not execute cmd on all channels requested"); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_tx.c b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_tx.c new file mode 100644 index 0000000000000..3ffccd65c1117 --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_tx.c @@ -0,0 +1,4024 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_tx.c +* \brief Contains ADRV903X features related function implementation defined in +* adi_adrv903x_tx.h +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#include "adi_adrv903x_tx.h" + +#include "../../private/include/adrv903x_tx.h" +#include "../../private/include/adrv903x_cpu.h" +#include "../../private/include/adrv903x_reg_addr_macros.h" +#include "../../private/include/adrv903x_gpio.h" +#include "../../private/include/adrv903x_radioctrl.h" +#include "../../private/include/adrv903x_stream_proc_types.h" +#include "../../private/bf/adrv903x_bf_tx_funcs.h" +#include "../../private/bf/adrv903x_bf_tx_dig.h" + + +#define ADI_FILE ADI_ADRV903X_FILE_PUBLIC_TX + +#define TX_ATTEN_EDGE_TRIGGER 0U +#define TX_ATTEN_LEVEL_TRIGGER 1U +#define TX_ATTEN_TABLE_INDEX_RANGE_CHECK 33U + +/* Some tyepdefs and static fn ptrs to make the S0S1 Bf access manageable */ +typedef adi_adrv903x_ErrAction_e(*txAttenSetFnPtr_t)(adi_adrv903x_Device_t *device, + adi_adrv903x_SpiCache_t *spiCache, + adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t bfValue); + +typedef adi_adrv903x_ErrAction_e(*txAttenGetFnPtr_t)(adi_adrv903x_Device_t *device, + adi_adrv903x_SpiCache_t *spiCache, + adrv903x_BfCoreChanAddr_e baseAddr, + uint16_t *bfValue); + +typedef adi_adrv903x_ErrAction_e(*txAttenUpdateFnPtr_t)(adi_adrv903x_Device_t* const device, + adi_adrv903x_SpiCache_t* const spiCache, + const adrv903x_BfCoreChanAddr_e baseAddr, + const uint8_t bfValue); + +static const txAttenSetFnPtr_t txAttenChanS0S1SetFnPtrs[ADI_ADRV903X_MAX_TXCHANNELS][2] = +{ + { adrv903x_Core_Tx0AttenS0_BfSet, adrv903x_Core_Tx0AttenS1_BfSet }, + { adrv903x_Core_Tx1AttenS0_BfSet, adrv903x_Core_Tx1AttenS1_BfSet }, + { adrv903x_Core_Tx2AttenS0_BfSet, adrv903x_Core_Tx2AttenS1_BfSet }, + { adrv903x_Core_Tx3AttenS0_BfSet, adrv903x_Core_Tx3AttenS1_BfSet }, + { adrv903x_Core_Tx4AttenS0_BfSet, adrv903x_Core_Tx4AttenS1_BfSet }, + { adrv903x_Core_Tx5AttenS0_BfSet, adrv903x_Core_Tx5AttenS1_BfSet }, + { adrv903x_Core_Tx6AttenS0_BfSet, adrv903x_Core_Tx6AttenS1_BfSet }, + { adrv903x_Core_Tx7AttenS0_BfSet, adrv903x_Core_Tx7AttenS1_BfSet }, +}; + +static const txAttenGetFnPtr_t txAttenChanS0S1GetFnPtrs[ADI_ADRV903X_MAX_TXCHANNELS][2] = +{ + { adrv903x_Core_Tx0AttenS0_BfGet, adrv903x_Core_Tx0AttenS1_BfGet }, + { adrv903x_Core_Tx1AttenS0_BfGet, adrv903x_Core_Tx1AttenS1_BfGet }, + { adrv903x_Core_Tx2AttenS0_BfGet, adrv903x_Core_Tx2AttenS1_BfGet }, + { adrv903x_Core_Tx3AttenS0_BfGet, adrv903x_Core_Tx3AttenS1_BfGet }, + { adrv903x_Core_Tx4AttenS0_BfGet, adrv903x_Core_Tx4AttenS1_BfGet }, + { adrv903x_Core_Tx5AttenS0_BfGet, adrv903x_Core_Tx5AttenS1_BfGet }, + { adrv903x_Core_Tx6AttenS0_BfGet, adrv903x_Core_Tx6AttenS1_BfGet }, + { adrv903x_Core_Tx7AttenS0_BfGet, adrv903x_Core_Tx7AttenS1_BfGet }, +}; + +static const txAttenUpdateFnPtr_t txAttenChanS0S1UpdateFnPtrs[ADI_ADRV903X_MAX_TXCHANNELS][2] = +{ + { adrv903x_Core_Tx0AttenUpdateS0_BfSet, adrv903x_Core_Tx0AttenUpdateS1_BfSet }, + { adrv903x_Core_Tx1AttenUpdateS0_BfSet, adrv903x_Core_Tx1AttenUpdateS1_BfSet }, + { adrv903x_Core_Tx2AttenUpdateS0_BfSet, adrv903x_Core_Tx2AttenUpdateS1_BfSet }, + { adrv903x_Core_Tx3AttenUpdateS0_BfSet, adrv903x_Core_Tx3AttenUpdateS1_BfSet }, + { adrv903x_Core_Tx4AttenUpdateS0_BfSet, adrv903x_Core_Tx4AttenUpdateS1_BfSet }, + { adrv903x_Core_Tx5AttenUpdateS0_BfSet, adrv903x_Core_Tx5AttenUpdateS1_BfSet }, + { adrv903x_Core_Tx6AttenUpdateS0_BfSet, adrv903x_Core_Tx6AttenUpdateS1_BfSet }, + { adrv903x_Core_Tx7AttenUpdateS0_BfSet, adrv903x_Core_Tx7AttenUpdateS1_BfSet }, +}; +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenTableRead(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + const uint32_t txAttenIndexOffset, + adi_adrv903x_TxAttenTableRow_t txAttenTableRows[], + const uint32_t numTxAttenEntries) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t i = 0U; + uint32_t tableAddr = 0U; + /* Ensure alignment of cfgData */ + uint32_t cfgData32[ADI_ADRV903X_TX_ATTEN_TABLE_CACHE_MAX / 4U] = { 0U }; + uint8_t* cfgData = (uint8_t*) cfgData32; + uint32_t start = 0U; + uint32_t stop = 0U; + uint32_t data = 0U; + uint32_t offset; + uint32_t numBytesToRead = 0U; + static const uint8_t TX_ENTRY_SIZE = 4U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + tableAddr = adrv903x_txAttenAddrLookup(txChannel); + if (tableAddr == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid TxChannel"); + goto cleanup; + } + + if (((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & txChannel) != txChannel) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "TxChannel not initialized"); + goto cleanup; + } + + if (numTxAttenEntries == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numTxAttenEntries, "Number of TxAttenuation Entries cannot be 0"); + goto cleanup; + } + + if ((txAttenIndexOffset + numTxAttenEntries - 1U) > ADRV903X_TX_ATTEN_TABLE_MAX_IDX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numTxAttenEntries, "Request exceeds Attenuation Table Bounds"); + goto cleanup; + } + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txAttenTableRows, cleanup); + + start = 0U; + stop = 0U; + offset = (txAttenIndexOffset * TX_ENTRY_SIZE) + tableAddr; + + numBytesToRead = numTxAttenEntries * TX_ENTRY_SIZE; + if (numBytesToRead > ADI_ADRV903X_TX_ATTEN_TABLE_CACHE_MAX) + { + numBytesToRead = ADI_ADRV903X_TX_ATTEN_TABLE_CACHE_MAX; + } + + recoveryAction = adi_adrv903x_Registers32bOnlyRead(device, NULL, (offset + stop), cfgData, numBytesToRead); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32Read Issue"); + goto cleanup; + } + + for (i = 0; i < numTxAttenEntries; i++) + { + data = *((uint32_t*)(cfgData + start)); + txAttenTableRows[i].txAttenHp = ADRV903X_BF_DECODE(data, ADRV903X_TX_ATTEN_TABLE_HP_MASK, ADRV903X_TX_ATTEN_TABLE_HP_SHIFT); + txAttenTableRows[i].txAttenMult = ADRV903X_BF_DECODE(data, ADRV903X_TX_ATTEN_TABLE_MULT_MASK, ADRV903X_TX_ATTEN_TABLE_MULT_SHIFT); + + start += TX_ENTRY_SIZE; + + if ((start >= ADI_ADRV903X_TX_ATTEN_TABLE_CACHE_MAX) && + ((i + 1U) < numTxAttenEntries)) + { + numBytesToRead = (numTxAttenEntries - (i + 1U)) * TX_ENTRY_SIZE; + if (numBytesToRead > ADI_ADRV903X_TX_ATTEN_TABLE_CACHE_MAX) + { + numBytesToRead = ADI_ADRV903X_TX_ATTEN_TABLE_CACHE_MAX; + } + + stop += start; + recoveryAction = adi_adrv903x_Registers32bOnlyRead(device, NULL, (offset + stop), cfgData, numBytesToRead); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Registers32Read Issue"); + goto cleanup; + } + start = 0U; + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxAtten_t txAttenuation[], + const uint32_t numTxAttenConfigs) +{ + static const uint8_t DATA_TRANSACTION_1_SIZE = 9u; + static const uint8_t DATA_TRANSACTION_2_SIZE = 6U; + static const uint8_t DATA_TRANSATCTION_FF_SIZE = 3U; + static const uint8_t CH0_START_ADDRESS = 0xB3U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_hal_Err_e halError = ADI_HAL_ERR_PARAM; + + uint32_t attenRegVal = 0U; + uint32_t i = 0U; + + /* Variables for minimum Tx attenuation range check - only for A0 and A1 silicon */ + uint16_t minAttenIndexSet = UINT16_MAX; + uint16_t attenIndex = 0U; + + uint8_t chanId = 0U; + uint8_t addrLsb = 0U; + uint8_t latchMask = 0U; + uint8_t attenLsb = 0U; + /* Hardcoded 9 byte data array for first spi transaction with placeholders for addresses and data + data1[0] : 0x01U msb of masking register address + data1[1] : 0x32U lsb of masking register address + data1[2] : 0x03U mask indicating which bits to set in target register + data1[3] : 0x01U msb of address to write + data1[4] : 0x00U PLACEHOLDER - will be replaced with msb (i.e. lsb +1 address ) corresponding to address of relevant tx channel + data1[5] : 0x00U PLACEHOLDER - will be replaced with the lsb for given tx attenuation value + data1[6] : 0x01U msb of address to write + data1[7] : 0x00U PLACEHOLDER - will be replaced with lsb corresponding to address of relevant tx channel + data1[8] : 0x00U PLACEHOLDER - will be replaced with the msb for given tx attenuation value + */ + uint8_t data1[] = { 0x01U, 0x32U, 0x03U, 0x01U, 0x00U, 0x00U, 0x01U, 0x00U, 0x00U }; + + /* Spi Transaction array data for general case of latching mask != 0xFF which does require masking register usage + data1[0] : 0x01U msb of masking register address + data1[1] : 0x32U lsb of masking register address + data1[2] : 0x00U Placeholder - to be replaced by latching mask calculated during function + data1[3] : 0x01U msb of latch register address + data1[4] : 0xD3U lsb of latch register address + data1[5] : 0x00U Placeholder - will be replaced with latch mask value calculated in function + */ + uint8_t data2[] = { 0x01U, 0x32U, 0x00U, 0x01U, 0xD3U, 0x00U }; + /* Spi Transaction array data for special case of latching mask == 0xFF (all channels) which does not require masking register + dataFF[0] : 0x01U msb of latch register address + dataFF[1] : 0xD3U lsb of latch register address + dataFF[2] : 0x00U Placeholder - will be replaced with latch mask value calculated in function + */ + uint8_t dataFF[] = { 0x01U, 0xD3U, 0x00U }; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txAttenuation, cleanup); + + if (numTxAttenConfigs == 0U) + { + /* no valid configs */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numTxAttenConfigs, "Invalid Number of TxAttentuation Configurations"); + goto cleanup; + } + + /* Loop through the number of configurations and check attenuation mode */ + for (i = 0U; i < numTxAttenConfigs; ++i) + { + if (txAttenuation[i].txAttenuation_mdB > ADRV903X_TX_ATTEN_VALUE_MILLI_DB_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txAttenuation[i].txAttenuation_mdB, + "Invalid txAttenuation_mdB value"); + goto cleanup; + } + + /*Check that if requested Tx Channel valid*/ + if (((txAttenuation[i].txChannelMask & (~(uint32_t)ADI_ADRV903X_TXALL)) != 0U) || + (txAttenuation[i].txChannelMask == (uint32_t)ADI_ADRV903X_TXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txAttenuation[i].txChannelMask, + "Invalid Tx channel is selected. Valid values are any combinations of Tx0/1/2/3/4/5/6/7"); + goto cleanup; + } + } + + /* Loop through the number of configurations passed */ + for (i = 0U; i < numTxAttenConfigs; ++i) + { + /* for each Tx channel in chanMask */ + for (chanId = 0U; chanId <= ADI_ADRV903X_TX_CHAN_ID_MAX; ++chanId) + { + if ((txAttenuation[i].txChannelMask & (1U << chanId)) == 0U) + { + /* Skip channel. It's not in chanMask. */ + continue; + } + + /* Conversion from the requested atten level (milli-dB) to equivalent + * TxAttenTable index is always done based on a step size of 0.05. + * This also means the register value to be programmed equals the + * atten table index. Other step sizes are not supported. */ + attenIndex = (txAttenuation[i].txAttenuation_mdB / ADRV903X_TX_ATTEN_STEP_SIZE_DIV_0P05); + attenRegVal = attenIndex; + if (attenIndex < minAttenIndexSet) + { + minAttenIndexSet = attenIndex; + } + + /* Calculate address based on channel id */ + addrLsb = CH0_START_ADDRESS + (chanId << 2U); + /* Isolate Lsb for data to write */ + attenLsb = (uint8_t)(attenRegVal - ((attenRegVal >> 8U) << 8U)); + /* pack placeholders in spi data1 array */ + data1[4U] = (uint8_t)(addrLsb + 1U); + data1[5U] = (uint8_t)(attenRegVal >> 8U); + data1[7U] = addrLsb; + data1[8U] = attenLsb; + halError = adrv903x_SpiWrite(device->common.devHalInfo, data1, DATA_TRANSACTION_1_SIZE); + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ErrCodeConvert(halError); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + data1, + "Error writing tx atten values"); + goto cleanup; + } + + /* build mask for latching only selected channel latches */ + latchMask |= 1U << chanId; + } + } + /* Special Case where mask of 0xFF does not require a masking register to be wrote first */ + if (latchMask == 0xFFU) + { + dataFF[2U] = latchMask; + halError = adrv903x_SpiWrite(device->common.devHalInfo, dataFF, DATA_TRANSATCTION_FF_SIZE); + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ErrCodeConvert(halError); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + dataFF, + "Error writing Attenuation Latch Value"); + goto cleanup; + } + } + else + { + data2[2U] = latchMask; + data2[5U] = latchMask; + halError = adrv903x_SpiWrite(device->common.devHalInfo, data2, DATA_TRANSACTION_2_SIZE); + recoveryAction = (adi_adrv903x_ErrAction_e) adi_common_hal_ErrCodeConvert(halError); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + data2, + "Error writing Attenuation Latch Value"); + goto cleanup; + } + } + + cleanup: + /* Minimum atten range check is only applied for A0 and A1 silicon */ + if ((device->devStateInfo.deviceSiRev == 0xA0U) || (device->devStateInfo.deviceSiRev == 0xA1)) + { + if (minAttenIndexSet <= TX_ATTEN_TABLE_INDEX_RANGE_CHECK) + { + /* The attenuation was set successfully but we need to log a warning due to one or more of the table indices used. */ + ADI_VARIABLE_LOG(&device->common, ADI_HAL_LOG_WARN, "WARNING: Tx Attenuation Table Index 0-33 are under implementation.", NULL, NULL); + } + } + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); + +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxAtten_t * const txAttenuation) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint16_t txAttenReadBack = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txAttenuation, cleanup); + + switch (txChannel) + { + case ADI_ADRV903X_TX0: + recoveryAction = adrv903x_Core_Tx0AttenS0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &txAttenReadBack); + break; + + case ADI_ADRV903X_TX1: + recoveryAction = adrv903x_Core_Tx1AttenS0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &txAttenReadBack); + break; + + case ADI_ADRV903X_TX2: + recoveryAction = adrv903x_Core_Tx2AttenS0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &txAttenReadBack); + break; + + case ADI_ADRV903X_TX3: + recoveryAction = adrv903x_Core_Tx3AttenS0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &txAttenReadBack); + break; + + case ADI_ADRV903X_TX4: + recoveryAction = adrv903x_Core_Tx4AttenS0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &txAttenReadBack); + break; + + case ADI_ADRV903X_TX5: + recoveryAction = adrv903x_Core_Tx5AttenS0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &txAttenReadBack); + break; + + case ADI_ADRV903X_TX6: + recoveryAction = adrv903x_Core_Tx6AttenS0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &txAttenReadBack); + break; + + case ADI_ADRV903X_TX7: + recoveryAction = adrv903x_Core_Tx7AttenS0_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &txAttenReadBack); + break; + + case ADI_ADRV903X_TXOFF: /* Fall Through */ + case ADI_ADRV903X_TXALL: + + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txChannel, + "Invalid TxChannel"); + goto cleanup; + break; + + } + + /* API Call Check for all Switch Statement */ + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + txChannel, + "Failure to Read Tx Attenuation for Given Channel"); + goto cleanup; + } + + + /* Convert from atten table index to milli dB */ + txAttenuation->txAttenuation_mdB = (txAttenReadBack * ADRV903X_TX_ATTEN_STEP_SIZE_DIV_0P05); + txAttenuation->txChannelMask = txChannel; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxNcoShifterSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxNcoMixConfig_t * const txNcoConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_TxNcoMixConfig_t txNcoInfo; + adrv903x_TxNcoMixConfigResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t cpuTypeIdx = 0U; + uint8_t channelMaskRet = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txNcoConfig, cleanup); + + ADI_LIBRARY_MEMSET(&txNcoInfo, 0, sizeof(txNcoInfo)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(cmdRsp)); + + if (txNcoConfig->chanSelect == 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txNcoConfig->chanSelect, "Invalid chanSelect provided."); + goto cleanup; + } + + if (txNcoConfig->enable > 1U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txNcoConfig->enable, "Invalid enable provided."); + goto cleanup; + } + + /* Prepare the command payload */ + txNcoInfo.chanSelect = (uint8_t) txNcoConfig->chanSelect; + txNcoInfo.enable = (uint8_t) txNcoConfig->enable; + txNcoInfo.phase = (uint32_t) ADRV903X_HTOCL(txNcoConfig->phase); + txNcoInfo.frequencyKhz = (int32_t) ADRV903X_HTOCL(txNcoConfig->frequencyKhz); + + /* For each CPU, send the command, wait for a response, and process any errors. + * Only the CPU that owns this channel will set chanSelect in its response. + */ + for (cpuTypeIdx = 0U; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_TX_MIX_NCO, + (void*)&txNcoInfo, + sizeof(txNcoInfo), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + channelMaskRet |= cmdRsp.chanSelect; + if (channelMaskRet == txNcoInfo.chanSelect) + { + break; /* Commands are done */ + } + } + + /* The above loop should always break before cpuTypeIdx reaches ADI_ADRV903X_CPU_TYPE_MAX_RADIO */ + if (cpuTypeIdx >= ADI_ADRV903X_CPU_TYPE_MAX_RADIO) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMaskRet, "FW did not execute cmd on all channels requested"); + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxNcoShifterGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TxNcoMixConfigReadbackResp_t* const txRbConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_TxNcoMixConfigReadback_t txNcoCfgRbCmd; + adi_adrv903x_TxNcoMixConfigReadbackResp_t txNcoCfgGetCmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_NO_ERROR; + uint32_t cpuType = 0U; + uint32_t chIdx = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txRbConfig, cleanup); + + ADI_LIBRARY_MEMSET(&txNcoCfgRbCmd, 0, sizeof(txNcoCfgRbCmd)); + ADI_LIBRARY_MEMSET(&txNcoCfgGetCmdRsp, 0, sizeof(txNcoCfgGetCmdRsp)); + + /* Testing if channel mask has more than two channels activated*/ + if (txRbConfig->chanSelect == (uint8_t) ADI_ADRV903X_TXOFF || + txRbConfig->chanSelect > (uint8_t) ADI_ADRV903X_TX7 || + (((txRbConfig->chanSelect - 1) & txRbConfig->chanSelect) != 0U)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txRbConfig->chanSelect, "Invalid chanSelect provided."); + goto cleanup; + } + + /* Get CPU assigned to this channel */ + for (chIdx = 0U; chIdx < ADI_ADRV903X_MAX_CHANNELS; chIdx++) + { + if (txRbConfig->chanSelect == ((uint8_t)1U << chIdx)) + { + cpuType = device->initExtract.rxTxCpuConfig[chIdx]; + break; + } + } + + /* Prepare the command payload */ + txNcoCfgRbCmd.chanSelect = (uint8_t) txRbConfig->chanSelect; + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + (adi_adrv903x_CpuType_e)cpuType, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_TX_MIX_NCO, + (void*)&txNcoCfgRbCmd, + sizeof(txNcoCfgRbCmd), + (void*)&txNcoCfgGetCmdRsp, + sizeof(txNcoCfgGetCmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO((adrv903x_CpuErrorCode_e)txNcoCfgGetCmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup) ; + } + + if (txNcoCfgGetCmdRsp.chanSelect == txNcoCfgRbCmd.chanSelect) + { + /* Extract the command-specific response from the response payload */ + txRbConfig->enable = (uint8_t) txNcoCfgGetCmdRsp.enable; + txRbConfig->phase = (uint32_t) ADRV903X_CTOHL(txNcoCfgGetCmdRsp.phase); + txRbConfig->frequencyKhz = (int32_t) ADRV903X_CTOHL(txNcoCfgGetCmdRsp.frequencyKhz); + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txRbConfig->chanSelect, "Channel is not handled by the CPU"); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxTestToneSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxTestNcoConfig_t * const txNcoConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_TxTestNcoConfig_t txNcoInfo; + adrv903x_TxTestNcoConfigResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t cpuTypeIdx = 0U; + uint8_t channelMaskRet = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txNcoConfig, cleanup); + ADI_LIBRARY_MEMSET(&txNcoInfo, 0, sizeof(txNcoInfo)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(cmdRsp)); + + if (txNcoConfig->chanSelect == 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txNcoConfig->chanSelect, "Invalid chanSelect provided."); + goto cleanup; + } + + if (txNcoConfig->ncoSelect >= ADI_ADRV903X_TX_TEST_NCO_MAX_NUM) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txNcoConfig->ncoSelect, "Invalid ncoSelect provided."); + goto cleanup; + } + + if (txNcoConfig->enable > 1U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txNcoConfig->enable, "Invalid enable provided."); + goto cleanup; + } + + if (txNcoConfig->attenCtrl >= ADI_ADRV903X_TX_TEST_NCO_ATTEN_MAX_NUM) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txNcoConfig->attenCtrl, "Invalid attenCtrl provided."); + goto cleanup; + } + + /* Prepare the command payload */ + txNcoInfo.chanSelect = (uint8_t) txNcoConfig->chanSelect; + txNcoInfo.ncoSelect = (adi_adrv903x_TxTestNcoSelect_t) txNcoConfig->ncoSelect; + txNcoInfo.enable = (uint8_t) txNcoConfig->enable; + txNcoInfo.phase = (uint32_t) ADRV903X_HTOCL(txNcoConfig->phase); + txNcoInfo.frequencyKhz = (int32_t) ADRV903X_HTOCL(txNcoConfig->frequencyKhz); + txNcoInfo.attenCtrl = (adi_adrv903x_TxTestNcoAtten_t) txNcoConfig->attenCtrl; + + /* For each CPU, send the command, wait for a response, and process any errors. + * Only the CPU that owns this channel will set chanSelect in its response. + */ + for (cpuTypeIdx = 0U; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_TX_TEST_NCO, + (void*)&txNcoInfo, + sizeof(txNcoInfo), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + channelMaskRet |= cmdRsp.chanSelect; + if (channelMaskRet == txNcoInfo.chanSelect) + { + break; /* Commands are done */ + } + } + + /* The above loop should always break before cpuTypeIdx reaches ADI_ADRV903X_CPU_TYPE_MAX_RADIO */ + if (cpuTypeIdx >= ADI_ADRV903X_CPU_TYPE_MAX_RADIO) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMaskRet, "FW did not execute cmd on all channels requested"); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxTestToneGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TxTestNcoConfigReadbackResp_t* const txRbConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_TxTestNcoConfigReadback_t txNcoCfgRbCmd; + adi_adrv903x_TxTestNcoConfigReadbackResp_t txNcoCfgGetCmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t cpuTypeIdx = 0U; + uint8_t channelMaskRet = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txRbConfig, cleanup); + + ADI_LIBRARY_MEMSET(&txNcoCfgRbCmd, 0, sizeof(txNcoCfgRbCmd)); + ADI_LIBRARY_MEMSET(&txNcoCfgGetCmdRsp, 0, sizeof(txNcoCfgGetCmdRsp)); + + /* Testing if channel mask has more than two channels activated*/ + if (txRbConfig->chanSelect == (uint8_t) ADI_ADRV903X_TXOFF || + txRbConfig->chanSelect > (uint8_t) ADI_ADRV903X_TX7 || + (((txRbConfig->chanSelect - 1) & txRbConfig->chanSelect) != 0U)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txRbConfig->chanSelect, "Invalid chanSelect provided."); + goto cleanup; + } + + + if (txRbConfig->ncoSelect >= ADI_ADRV903X_TX_TEST_NCO_MAX_NUM) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txRbConfig->ncoSelect, "Invalid ncoSelect provided."); + goto cleanup; + } + + /* Prepare the command payload */ + txNcoCfgRbCmd.chanSelect = (uint8_t) txRbConfig->chanSelect; + txNcoCfgRbCmd.ncoSelect = (adi_adrv903x_TxTestNcoSelect_t) txRbConfig->ncoSelect; + + /* For each CPU, send the command, wait for a response, and process any errors. + * Only the CPU that owns this channel will set chanSelect in its response. + */ + for (cpuTypeIdx = 0U; cpuTypeIdx < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; ++cpuTypeIdx) + { + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend(device, + (adi_adrv903x_CpuType_e)cpuTypeIdx, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_TX_TEST_NCO, + (void*)&txNcoCfgRbCmd, + sizeof(txNcoCfgRbCmd), + (void*)&txNcoCfgGetCmdRsp, + sizeof(txNcoCfgGetCmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO((adrv903x_CpuErrorCode_e)txNcoCfgGetCmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + channelMaskRet = txNcoCfgGetCmdRsp.chanSelect; + if (channelMaskRet == txNcoCfgRbCmd.chanSelect) + { + /* Extract the command-specific response from the response payload */ + txRbConfig->chanSelect = (uint8_t)txNcoCfgGetCmdRsp.chanSelect; + txRbConfig->ncoSelect = (uint8_t) txNcoCfgGetCmdRsp.ncoSelect; + txRbConfig->enabled = (uint8_t) txNcoCfgGetCmdRsp.enabled; + txRbConfig->attenCtrl = txNcoCfgGetCmdRsp.attenCtrl; + txRbConfig->phase = (uint32_t) ADRV903X_CTOHL(txNcoCfgGetCmdRsp.phase); + txRbConfig->frequencyKhz = (int32_t) ADRV903X_CTOHL(txNcoCfgGetCmdRsp.frequencyKhz); + break; /* Commands are done */ + } + } + + /* The above loop should always break before cpuTypeIdx reaches ADI_ADRV903X_CPU_TYPE_MAX_RADIO */ + if (cpuTypeIdx >= ADI_ADRV903X_CPU_TYPE_MAX_RADIO) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, channelMaskRet, "FW did not execute cmd on all channels requested"); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenS0S1Set(adi_adrv903x_Device_t* const device, + const uint32_t chanMask, + const uint32_t levelMilliDB, + const uint8_t isS0) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t chanId = 0U; + uint8_t isS1 = !isS0; + uint32_t attenRegVal = 0U; + + /* Variables for minimum Tx attenuation range check - only for A0 and A1 silicon */ + uint16_t minAttenIndexSet = UINT16_MAX; + uint16_t attenIndex = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + if ((chanMask > ADI_ADRV903X_TX_CHAN_MASK_MAX) || + (chanMask == 0U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + chanMask, + "Invalid channel mask"); + goto cleanup; + } + + if (levelMilliDB > ADRV903X_TX_ATTEN_VALUE_MILLI_DB_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + levelMilliDB, + "Value exceeds max attenuation value"); + goto cleanup; + } + + /* for each Tx channel in chanMask */ + for (chanId = 0U; chanId <= ADI_ADRV903X_TX_CHAN_ID_MAX; ++chanId) + { + if ((chanMask & (1U << chanId)) == 0U) + { + /* Skip channel. It's not in chanMask. */ + continue; + } + + /* ChanId is selected in chanMask */ + + /* Conversion from the requested atten level (milli-dB) to equivalent + * TxAttenTable index is always done based on a step size of 0.05. + * This also means the register value to be programmed equals the + * atten table index. Other step sizes are not supported. */ + attenIndex = (levelMilliDB / ADRV903X_TX_ATTEN_STEP_SIZE_DIV_0P05); + attenRegVal = attenIndex; + + if (attenIndex < minAttenIndexSet) + { + minAttenIndexSet = attenIndex; + } + + /* Write to the S0/S1 register */ + recoveryAction = txAttenChanS0S1SetFnPtrs[chanId][isS1](device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + attenRegVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + chanId, + "Failure to write S0/S1 TxAttenuation"); + goto cleanup; + } + + /* Latch in the S0/S1 register */ + recoveryAction = txAttenChanS0S1UpdateFnPtrs[chanId][isS1]( device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT( &device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + chanId, + "Failure to update S0/S1 TxAttenuation"); + goto cleanup; + } + } /* for each Tx channel */ +cleanup: + /* Minimum atten range check is only applied for A0 and A1 silicon */ + if ((device->devStateInfo.deviceSiRev == 0xA0) || (device->devStateInfo.deviceSiRev == 0xA1)) + { + if ((recoveryAction == ADI_ADRV903X_ERR_ACT_NONE) && + (minAttenIndexSet <= TX_ATTEN_TABLE_INDEX_RANGE_CHECK)) + { + /* The attenuation was set successfully but we need to give an error due to one or more of the table indices used. */ + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + minAttenIndexSet, + "WARNING: Tx Attenuation Table Index 0-33 are under implementation."); + } + } + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenS0S1Get(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + uint32_t* const levelMilliDB, + const uint8_t isS0) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t isS1 = !isS0; + uint16_t attenRegVal = 0U; + uint8_t chanId = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, levelMilliDB, cleanup); + + ADI_ADRV903X_API_ENTRY(&device->common); + + chanId = adrv903x_TxChannelsToId(txChannel); + if (chanId > ADI_ADRV903X_TX_CHAN_ID_MAX) + { + ADI_PARAM_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + chanId, + "Invalid channel id"); + goto cleanup; + } + + /* Read back the S0/S1 register */ + recoveryAction = (adi_adrv903x_ErrAction_e)txAttenChanS0S1GetFnPtrs[chanId][isS1](device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &attenRegVal); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + chanId, + "Failure to write S0/S1 TxAttenuation"); + goto cleanup; + } + + /* Conversion from the attenTableIndex read back to the equivalent + * atten level (milli-Db) is always done based on a step size of + * 0.05. Other step sizes are not supported. + */ + *levelMilliDB = attenRegVal * ADRV903X_TX_ATTEN_STEP_SIZE_DIV_0P05; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenUpdateCfgSet(adi_adrv903x_Device_t* const device, + const uint32_t chanMask, + const adi_adrv903x_TxAttenUpdateCfg_t* const cfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t chanId = 0; + uint32_t chanSel = 0U; + adrv903x_BfTxDigChanAddr_e txDigChanBaseAddr = (adrv903x_BfTxDigChanAddr_e)0U; + adrv903x_BfTxFuncsChanAddr_e txFuncsChanBaseAddr = (adrv903x_BfTxFuncsChanAddr_e)0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cfg, cleanup); + + if ((chanMask > ADI_ADRV903X_TX_CHAN_MASK_MAX) || + (chanMask == 0U)) + { + ADI_PARAM_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + chanMask, + "Invalid channel mask"); + goto cleanup; + } + + if (cfg->trgCfg.updateTrg != ADI_ADRV903X_TXATTEN_UPD_TRG_NONE && + cfg->trgCfg.updateTrg != ADI_ADRV903X_TXATTEN_UPD_TRG_SPI && + cfg->trgCfg.updateTrg != ADI_ADRV903X_TXATTEN_UPD_TRG_GPIO) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + cfg->trgCfg.updateTrg, + "Invalid ADI_ADRV903X_TXATTEN_UPD_TRG value"); + goto cleanup; + } + + if (cfg->srcCfg.updateSrc != ADI_ADRV903X_TXATTEN_UPD_SRC_S0 && + cfg->srcCfg.updateSrc != ADI_ADRV903X_TXATTEN_UPD_SRC_S0_OR_S1) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + cfg->srcCfg.updateSrc, + "Invalid ADI_ADRV903X_TXATTEN_UPD_SRC value"); + goto cleanup; + } + + /* If update is via gpio verify the trigger gpio is valid. + * Note: Due to h/w pinmux limitations pin0 cannot be routed for use as the trigger. */ + if (cfg->trgCfg.updateTrg == ADI_ADRV903X_TXATTEN_UPD_TRG_GPIO && + (cfg->trgCfg.triggerGpio >= ADI_ADRV903X_GPIO_INVALID || + cfg->trgCfg.triggerGpio == 0U)) + { + ADI_PARAM_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + cfg->trgCfg.triggerGpio, + "Invalid triggerGpio"); + goto cleanup; + } + + /* If use of S0/S1 is determined via gpio ensure gpio is valid. + * Note: Due to h/w pinmux limitations pin0 cannot be routed for use as the S0_S1 src */ + if (cfg->srcCfg.updateSrc == ADI_ADRV903X_TXATTEN_UPD_SRC_S0_OR_S1 && + (cfg->srcCfg.s0OrS1Gpio >= ADI_ADRV903X_GPIO_INVALID || + cfg->srcCfg.s0OrS1Gpio == 0U)) + { + ADI_PARAM_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + cfg->srcCfg.s0OrS1Gpio, + "Invalid s0OrS1Gpio"); + goto cleanup; + } + + /* If update is via gpio and S1/S0 is determined by gpio verify + * the gpios are different */ + if (cfg->trgCfg.updateTrg == ADI_ADRV903X_TXATTEN_UPD_TRG_GPIO && + cfg->srcCfg.updateSrc == ADI_ADRV903X_TXATTEN_UPD_SRC_S0_OR_S1 && + cfg->trgCfg.triggerGpio == cfg->srcCfg .s0OrS1Gpio ) + { + ADI_PARAM_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + ADI_NO_VARIABLE, + "Cannot use same GPIO for trigger gpio and S0/S1 selection"); + goto cleanup; + } + + /* The global CoreSpiEnable bit is set for SPI trigger; Unset for any other trigger. */ + recoveryAction = adrv903x_Core_TxAttenUpdCoreSpiEn_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + (cfg->trgCfg.updateTrg == ADI_ADRV903X_TXATTEN_UPD_TRG_SPI)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_Core_TxAttenUpdCoreSpiEn_BfSet failed."); + goto cleanup; + } + + /* Routing of GPIO signals to TxChans for update triggering + * must be done for all channels in a single call not channel by channel */ + if (cfg->trgCfg.updateTrg == ADI_ADRV903X_TXATTEN_UPD_TRG_GPIO) + { + /* Route selected trigger GPIO to TxChans*/ + recoveryAction = adrv903x_GpioSignalSet(device, + cfg->trgCfg.triggerGpio, + ADI_ADRV903X_GPIO_SIGNAL_TX_ATTEN_UPD_GPIO, + chanMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_GpioSignalSet failed for trigger GPIO"); + goto cleanup; + } + } + + /* Routing of GPIO signals to TxChans for S0/S1 selection + * must be done for all channels in a single call not channel by channel */ + if (cfg->srcCfg.updateSrc == ADI_ADRV903X_TXATTEN_UPD_SRC_S0_OR_S1) + { + /* Configuring which GPIO selects S0/S1. */ + recoveryAction = adrv903x_GpioSignalSet(device, + cfg->srcCfg.s0OrS1Gpio, + ADI_ADRV903X_GPIO_SIGNAL_SELECT_S1, + chanMask); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_GpioSignalSet failed for S0/S1 gpio."); + goto cleanup; + } + } + + /* for each Tx channel in chanMask */ + for (chanId = 0U; chanId <= ADI_ADRV903X_TX_CHAN_ID_MAX; chanId++) + { + chanSel = 1U << chanId; + + if ((chanMask & (1 << chanId)) == 0) + { + /* Skip channel. It's not in chanMask. */ + continue; + } + + /* Convert the chanId to the base address value required by the bitfield functions */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &txFuncsChanBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanId, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxDigBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &txDigChanBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanId, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + switch (cfg->trgCfg.updateTrg) + { + case ADI_ADRV903X_TXATTEN_UPD_TRG_NONE: + /* Do not trigger update from GPIO */ + recoveryAction = adrv903x_TxFuncs_TxAttenUpdGpioEn_BfSet(device, + NULL, + txFuncsChanBaseAddr, + 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_TxFuncs_TxAttenUpdGpioEn_BfSet failed."); + goto cleanup; + } + break; + case ADI_ADRV903X_TXATTEN_UPD_TRG_SPI: + /* Hardware supports level trigger for SPI but we don't expose that. Is always edge triggered. */ + recoveryAction = adrv903x_TxFuncs_TxAttenUpdTrgSel_BfSet(device, + NULL, + txFuncsChanBaseAddr, + TX_ATTEN_EDGE_TRIGGER); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_TxFuncs_TxAttenUpdTrgSel_BfSet failed."); + goto cleanup; + } + break; + case ADI_ADRV903X_TXATTEN_UPD_TRG_GPIO: + /* Do trigger update from GPIO */ + recoveryAction = adrv903x_TxFuncs_TxAttenUpdGpioEn_BfSet(device, + NULL, + txFuncsChanBaseAddr, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_TxFuncs_TxAttenUpdGpioEn_BfSet failed."); + goto cleanup; + } + + /* Always set edge triggered. Hardware supports level trigger for GPIO but we don't expose that. */ + recoveryAction = adrv903x_TxFuncs_TxAttenUpdTrgSel_BfSet(device, + NULL, + txFuncsChanBaseAddr, + TX_ATTEN_EDGE_TRIGGER); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_TxFuncs_TxAttenUpdTrgSel_BfSet failed."); + goto cleanup; + } + + /* Setting the GPIO that triggers the update is done by adrv903x_GpioSignalSet above. */ + + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + cfg->trgCfg.updateTrg, + "Invalid ADI_ADRV903X_TXATTEN_UPD_TRG value"); + goto cleanup; + break; + } + + switch (cfg->srcCfg.updateSrc) + { + case ADI_ADRV903X_TXATTEN_UPD_SRC_S0: + /* Turn off use of per-slice tx_attenuation register as that would override S0 */ + recoveryAction = adrv903x_TxFuncs_UseSliceAttenValue_BfSet(device, + NULL, + txFuncsChanBaseAddr, + 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_TxFuncs_UseSliceAttenValue_BfSet failed."); + goto cleanup; + } + + /* Turn off use of GPIO to select between S0/S1 */ + recoveryAction = adrv903x_TxFuncs_UseAttenWordS1ViaGpioPin_BfSet(device, + NULL, + txFuncsChanBaseAddr, + 0U); + break; + case ADI_ADRV903X_TXATTEN_UPD_SRC_S0_OR_S1: + /* Turn off use of per-slice tx_attenuation register that would override S0 */ + recoveryAction = adrv903x_TxFuncs_UseSliceAttenValue_BfSet(device, + NULL, + txFuncsChanBaseAddr, + 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_TxFuncs_UseSliceAttenValue_BfSet failed."); + goto cleanup; + } + + /* Turn on use of GPIO to select between S0/S1 */ + recoveryAction = adrv903x_TxFuncs_UseAttenWordS1ViaGpioPin_BfSet(device, + NULL, + txFuncsChanBaseAddr, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_TxFuncs_UseAttenWordS1ViaGpioPin_BfSet failed."); + goto cleanup; + } + + /* Configuring which GPIO selects S0/S1 is done by adrv903x_GpioSignalSet above. */ + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + cfg->srcCfg.updateSrc, + "Invalid ADI_ADRV903X_TXATTEN_UPD_SRC value"); + goto cleanup; + break; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenUpdateCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxAttenUpdateCfg_t* const cfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxDigChanAddr_e txDigChanBaseAddr = (adrv903x_BfTxDigChanAddr_e)0U; + adrv903x_BfTxFuncsChanAddr_e txFuncsChanBaseAddr = (adrv903x_BfTxFuncsChanAddr_e)0U; + uint8_t chanId = 0U; + + uint8_t updCoreSpiEn = 0U; /* global config that overrides the per-channel updGpioEn */ + uint8_t updGpioEn = 0U; /* enables gpio update trigger */ + uint8_t trgCfgTriggerGpio = 0U; /* identifies gpio update trigger */ + uint8_t useS1ViaGpioPin = 0U; /* enables S0/S1 selection via GPIO */ + uint8_t srcCfgS0OrS1Gpio = 0U; /* identifies S0/S1 selection GPIO */ + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cfg, cleanup); + + chanId = adrv903x_TxChannelsToId(txChannel); + if (chanId > ADI_ADRV903X_TX_CHAN_ID_MAX) + { + ADI_PARAM_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + chanId, + "Invalid channel id"); + goto cleanup; + } + + /* Convert the chanId to the base address value required by the bitfield functions */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, txChannel, &txFuncsChanBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanId, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxDigBitfieldAddressGet(device, txChannel, &txDigChanBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanId, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_TxAttenUpdCoreSpiEn_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + &updCoreSpiEn); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_Core_TxAttenUpdCoreSpiEn_BfGet failed."); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_TxAttenUpdGpioEn_BfGet(device, + NULL, + txFuncsChanBaseAddr, + &updGpioEn); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_TxFuncs_TxAttenUpdGpioEn_BfGet failed."); + goto cleanup; + } + + recoveryAction = adrv903x_TxDig_TxAttenUpdGpioSelect_BfGet(device, + NULL, + txDigChanBaseAddr, + &trgCfgTriggerGpio); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_TxDig_TxAttenUpdGpioSelect_BfGet failed."); + goto cleanup; + } + + /* Turn off use of GPIO to select between S0/S1 */ + recoveryAction = adrv903x_TxFuncs_UseAttenWordS1ViaGpioPin_BfGet(device, + NULL, + txFuncsChanBaseAddr, + &useS1ViaGpioPin); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_TxFuncs_UseAttenWordS1ViaGpioPin_BfGet failed."); + goto cleanup; + } + + recoveryAction = adrv903x_TxDig_Spi2TxAttenGpioSelect_BfGet(device, + NULL, + txDigChanBaseAddr, + &srcCfgS0OrS1Gpio); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Call to adrv903x_TxDig_Spi2TxAttenGpioSelect_BfGet failed."); + goto cleanup; + } + + /* Analyze the device settings and populate the cfg structure accordingly */ + if (useS1ViaGpioPin == 0) + { + cfg->srcCfg.updateSrc = ADI_ADRV903X_TXATTEN_UPD_SRC_S0; + } + else + { + cfg->srcCfg.updateSrc = ADI_ADRV903X_TXATTEN_UPD_SRC_S0_OR_S1; + cfg->srcCfg.s0OrS1Gpio = (adi_adrv903x_GpioPinSel_e)srcCfgS0OrS1Gpio; + } + + if (updCoreSpiEn > 0) + { + cfg->trgCfg.updateTrg = ADI_ADRV903X_TXATTEN_UPD_TRG_SPI; + } + else if (updGpioEn > 0) + { + cfg->trgCfg.updateTrg = ADI_ADRV903X_TXATTEN_UPD_TRG_GPIO; + cfg->trgCfg.triggerGpio = (adi_adrv903x_GpioPinSel_e)trgCfgTriggerGpio ; + } + else + { + cfg->trgCfg.updateTrg = ADI_ADRV903X_TXATTEN_UPD_TRG_NONE; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenUpdate(adi_adrv903x_Device_t *const device, + const uint32_t chanMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + if ((chanMask > ADI_ADRV903X_TX_CHAN_MASK_MAX) || + (chanMask == 0U)) + { + ADI_PARAM_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERR_ACT_CHECK_PARAM, + chanMask, + "Invalid channel mask"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_TxAttenUpdCoreSpi_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + chanMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to update TxAtten"); + goto cleanup; + } + + recoveryAction = adrv903x_Core_TxAttenUpdCoreSpi_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, + 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to reset update TxAtten bits"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxLoSourceGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_LoSel_e * const txLoSource) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Check Tx data format config pointer is not NULL*/ + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txLoSource, cleanup); + + /* Check that the requested txChannel is valid */ + if ((txChannel != ADI_ADRV903X_TX0) && + (txChannel != ADI_ADRV903X_TX1) && + (txChannel != ADI_ADRV903X_TX2) && + (txChannel != ADI_ADRV903X_TX3) && + (txChannel != ADI_ADRV903X_TX4) && + (txChannel != ADI_ADRV903X_TX5) && + (txChannel != ADI_ADRV903X_TX6) && + (txChannel != ADI_ADRV903X_TX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txChannel, + "Invalid Tx channel selected for LO source mapping read back. Valid Tx channels are Tx0-Tx7."); + goto cleanup; + } + + /* Check that Tx profile is valid in current config */ + if (((device->devStateInfo.profilesValid & ADI_ADRV903X_TX_PROFILE_VALID) != ADI_ADRV903X_TX_PROFILE_VALID) + || ((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & (uint32_t)txChannel) == 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT( &device->common, + recoveryAction, + txChannel, + "LO source read back requested for an Tx channel but Tx profile is invalid or channel not initialized in the device structure"); + goto cleanup; + } + + /* Readback Tx LO source selection */ + recoveryAction = adrv903x_TxLoSourceGet(device, txChannel, txLoSource); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error retrieving Lo Source for Tx channel."); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxPowerMonitorCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_PowerMonitorCfgRt_t txPowerMonitorCfg[], + const uint32_t numPowerProtectCfgs) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cfgIdx = 0U; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + static const uint16_t MAX_PEAK_PRE_THRESHOLD = 511U; + uint16_t peakPreThreShold = 0U; + uint16_t peakThreshold = 0U; + uint16_t avgThreshold = 0U; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txPowerMonitorCfg, cleanup); + + if (numPowerProtectCfgs == 0U) + { + /* no valid configs */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numPowerProtectCfgs, "Invalid Number of Tx Power Monitor Configurations"); + goto cleanup; + } + + /* Loop through the number of configurations and perform range checks */ + for (cfgIdx = 0U; cfgIdx < numPowerProtectCfgs; ++cfgIdx) + { + recoveryAction = adrv903x_TxPowerMonitorCfgRangeCheck(device, &txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Tx Power Monitor Range Check Error Reported"); + goto cleanup; + } + + /*Check that if requested Tx Channel valid*/ + if (((txPowerMonitorCfg[cfgIdx].txChannelMask & (~(uint32_t)ADI_ADRV903X_TXALL)) != 0U) || (txPowerMonitorCfg[cfgIdx].txChannelMask == (uint32_t)ADI_ADRV903X_TXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txPowerMonitorCfg[cfgIdx].txChannelMask, + "Invalid Tx channel is selected. Valid values are any combinations of Tx0/1/2/3/4/5/6/7"); + goto cleanup; + } + } + + /* Write out the configurations to appropriate bitfields */ + for (cfgIdx = 0U; cfgIdx < numPowerProtectCfgs; ++cfgIdx) + { + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(txPowerMonitorCfg[cfgIdx].txChannelMask, chanSel)) + { + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + peakThreshold = txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg.peakThreshold; + avgThreshold = txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg.avgThreshold; + /* Peak Pre Threshold must be set to (peakThreshold/2) / 2^(16-9) to adjust bus width */ + peakPreThreShold = peakThreshold >> 8; + if (peakPreThreShold > MAX_PEAK_PRE_THRESHOLD) + { + /* Saturate pre threshold */ + peakPreThreShold = MAX_PEAK_PRE_THRESHOLD; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionOverloadThPre_BfSet(device, + NULL, + txBaseAddr, + peakPreThreShold); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Peak Pre-Threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionInputSel_BfSet(device, + NULL, + txBaseAddr, + (uint8_t)txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg.inputSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Input Select"); + goto cleanup; + } + + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakThreshold_BfSet(device, + NULL, + txBaseAddr, + peakThreshold); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Peak Threshold"); + goto cleanup; + } + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakDur_BfSet(device, + NULL, + txBaseAddr, + txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg.measDuration); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Peak Duration"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakCount_BfSet(device, + NULL, + txBaseAddr, + txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg.peakCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Peak Count"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakpowerErrorClearRequired_BfSet(device, + NULL, + txBaseAddr, + txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg.peakErrorClearRequired); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Peak Error Clear Required"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakpowerEn_BfSet(device, + NULL, + txBaseAddr, + txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg.peakPowerEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Peak Power Enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakpowerIrqEn_BfSet(device, + NULL, + txBaseAddr, + txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg.peakPowerIrqEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Peak Power IRQ enable"); + goto cleanup; + } + + + recoveryAction = adrv903x_TxFuncs_PaProtectionAverageThreshold_BfSet(device, + NULL, + txBaseAddr, + avgThreshold); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Average Threshold"); + goto cleanup; + } + recoveryAction = adrv903x_TxFuncs_PaProtectionAverageDur_BfSet(device, + NULL, + txBaseAddr, + txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg.measDuration); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Average Duration"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionAvgpowerErrorClearRequired_BfSet(device, + NULL, + txBaseAddr, + txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg.avgErrorClearRequired); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Average Error Clear Required"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionAvgpowerEn_BfSet(device, + NULL, + txBaseAddr, + txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg.avgPowerEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Average Enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionAvgpowerIrqEn_BfSet(device, + NULL, + txBaseAddr, + txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg.avgPowerIrqEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PA Protect Average IRQ Enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionAprEn_BfSet(device, + NULL, + txBaseAddr, + txPowerMonitorCfg[cfgIdx].txPowerMonitorCfg.avgPeakRatioEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx Average to Peak Ratio Enable"); + goto cleanup; + } + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxPowerMonitorCfgGet(adi_adrv903x_Device_t * const device, + adi_adrv903x_PowerMonitorCfgRt_t* const txPowerMonitorCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + uint8_t tempByte = 0U; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txPowerMonitorCfg, cleanup); + + /* Retrieve the base address of selected channel. This function call will also range check the txChannelMask */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)txPowerMonitorCfg->txChannelMask, &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txPowerMonitorCfg->txChannelMask, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionInputSel_BfGet(device, + NULL, + txBaseAddr, + &tempByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Input Select"); + goto cleanup; + } + txPowerMonitorCfg->txPowerMonitorCfg.inputSel = (adi_adrv903x_PaProtectionInputSel_e)tempByte; + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakThreshold_BfGet(device, + NULL, + txBaseAddr, + &txPowerMonitorCfg->txPowerMonitorCfg.peakThreshold); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Peak Threshold"); + goto cleanup; + } + + /* Peak and Average measurement durations are programmed same to HW */ + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakDur_BfGet(device, + NULL, + txBaseAddr, + &txPowerMonitorCfg->txPowerMonitorCfg.measDuration); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Peak Duration"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakCount_BfGet(device, + NULL, + txBaseAddr, + &txPowerMonitorCfg->txPowerMonitorCfg.peakCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Peak Count"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakpowerErrorClearRequired_BfGet(device, + NULL, + txBaseAddr, + &txPowerMonitorCfg->txPowerMonitorCfg.peakErrorClearRequired); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Peak Error Clear Required"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakpowerEn_BfGet(device, + NULL, + txBaseAddr, + &txPowerMonitorCfg->txPowerMonitorCfg.peakPowerEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Peak Power Enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakpowerIrqEn_BfGet(device, + NULL, + txBaseAddr, + &txPowerMonitorCfg->txPowerMonitorCfg.peakPowerIrqEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Peak Power IRQ enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionAverageThreshold_BfGet(device, + NULL, + txBaseAddr, + &txPowerMonitorCfg->txPowerMonitorCfg.avgThreshold); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Average Threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionAvgpowerErrorClearRequired_BfGet(device, + NULL, + txBaseAddr, + &txPowerMonitorCfg->txPowerMonitorCfg.avgErrorClearRequired); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Average Error Clear Required"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionAvgpowerEn_BfGet(device, + NULL, + txBaseAddr, + &txPowerMonitorCfg->txPowerMonitorCfg.avgPowerEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Average Enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionAvgpowerIrqEn_BfGet(device, + NULL, + txBaseAddr, + &txPowerMonitorCfg->txPowerMonitorCfg.avgPowerIrqEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Average IRQ Enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionAprEn_BfGet(device, + NULL, + txBaseAddr, + &txPowerMonitorCfg->txPowerMonitorCfg.avgPeakRatioEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Average to Peak Ratio Enable"); + goto cleanup; + } +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxProtectionErrorGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + uint32_t* const eventBits) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + uint8_t bfValue = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, eventBits, cleanup); + + /* Clear the memory before setting individual bits for different events */ + *eventBits = 0U; + + /* Retrieve the base address of selected channel. This function call will also range check the txChannelMask */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)txChannel, &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionAvgpowerError_BfGet(device, + NULL, + txBaseAddr, + &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx Average Power Error Bit"); + goto cleanup; + } + + *eventBits |= (uint32_t) (bfValue & 0x01U); + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakpowerError_BfGet(device, + NULL, + txBaseAddr, + &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx Peak Power Error Bit"); + goto cleanup; + } + + *eventBits |= (((uint32_t) (bfValue & 0x01U)) << 1U); + + recoveryAction = adrv903x_TxFuncs_SrdError_BfGet(device, + NULL, + txBaseAddr, + &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx SRD Error Bit"); + goto cleanup; + } + + *eventBits |= (((uint32_t) (bfValue & 0x01U)) << 2U); + + recoveryAction = adrv903x_TxFuncs_PllJesdProtEvent_BfGet(device, + NULL, + txBaseAddr, + &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx Pll Unlock/Dfrm Irq Error"); + goto cleanup; + } + + *eventBits |= (((uint32_t) (bfValue & 0x01U)) << 3U); + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxProtectionErrorClear(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + const uint32_t eventBits) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Retrieve the base address of selected channel. This function call will also range check the txChannelMask */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)txChannel, &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + if (ADRV903X_BF_EQUAL(eventBits, 0x01U)) + { + recoveryAction = adrv903x_TxFuncs_PaProtectionAvgpowerErrorClear_BfSet(device, + NULL, + txBaseAddr, + ADI_TRUE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to set Tx Average Power Error Clear Bit"); + goto cleanup; + } + } + + if (ADRV903X_BF_EQUAL(eventBits, 0x02U)) + { + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakpowerErrorClear_BfSet(device, + NULL, + txBaseAddr, + ADI_TRUE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to set Tx Peak Power Error Clear Bit"); + goto cleanup; + } + } + + if (ADRV903X_BF_EQUAL(eventBits, 0x04U)) + { + recoveryAction = adrv903x_TxFuncs_SrdErrorClear_BfSet(device, + NULL, + txBaseAddr, + ADI_TRUE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to set SRD Error Clear Bit"); + goto cleanup; + } + } + + if (ADRV903X_BF_EQUAL(eventBits, 0x08U)) + { + recoveryAction = adrv903x_TxFuncs_PllJesdProtClr_BfSet(device, + NULL, + txBaseAddr, + ADI_TRUE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to set Pll Unlock/Dfrm Irq Error Clear Bit"); + goto cleanup; + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxSlewRateDetectorCfgSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_SlewRateDetectorCfgRt_t txSlewRateDetectorCfg[], + const uint32_t numSlewRateDetCfgs) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cfgIdx = 0U; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txSlewRateDetectorCfg, cleanup); + + if (numSlewRateDetCfgs == 0U) + { + /* no valid configs */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numSlewRateDetCfgs, "Invalid Number of Tx SRD Configurations"); + goto cleanup; + } + + /* Loop through the number of configurations and perform range checks */ + for (cfgIdx = 0U; cfgIdx < numSlewRateDetCfgs; ++cfgIdx) + { + recoveryAction = adrv903x_TxSlewRateDetectorCfgRangeCheck(device, &txSlewRateDetectorCfg[cfgIdx].srlCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Tx SRD Range Check Error Reported"); + goto cleanup; + } + + /*Check that if requested Tx Channel valid*/ + if (((txSlewRateDetectorCfg[cfgIdx].txChannelMask & (~(uint32_t)ADI_ADRV903X_TXALL)) != 0U) || (txSlewRateDetectorCfg[cfgIdx].txChannelMask == (uint32_t)ADI_ADRV903X_TXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txSlewRateDetectorCfg[cfgIdx].txChannelMask, + "Invalid Tx channel is selected. Valid values are any combinations of Tx0/1/2/3/4/5/6/7"); + goto cleanup; + } + } + + /* Write out the configurations to appropriate bitfields */ + for (cfgIdx = 0U; cfgIdx < numSlewRateDetCfgs; ++cfgIdx) + { + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(txSlewRateDetectorCfg[cfgIdx].txChannelMask, chanSel)) + { + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdDinSel_BfSet(device, + NULL, + txBaseAddr, + (uint8_t)txSlewRateDetectorCfg[cfgIdx].srlCfg.inputSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx SRD input selection"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdSlewOffset_BfSet(device, + NULL, + txBaseAddr, + txSlewRateDetectorCfg[cfgIdx].srlCfg.srdOffset); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx SRD threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdEn_BfSet(device, + NULL, + txBaseAddr, + txSlewRateDetectorCfg[cfgIdx].srlCfg.srdEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx SRD enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdIrqEn_BfSet(device, + NULL, + txBaseAddr, + txSlewRateDetectorCfg[cfgIdx].srlCfg.srdIrqEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx SRD Irq enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdArvWait_BfSet(device, + NULL, + txBaseAddr, + txSlewRateDetectorCfg[cfgIdx].srlCfg.autoRecoveryWaitTime); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write auto recovery wait time"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdArvEn_BfSet(device, + NULL, + txBaseAddr, + txSlewRateDetectorCfg[cfgIdx].srlCfg.autoRecoveryEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write auto recovery enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdArvTxonQual_BfSet(device, + NULL, + txBaseAddr, + txSlewRateDetectorCfg[cfgIdx].srlCfg.autoRecoveryDisableTimerWhenTxOff); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write auto recovery disable timer when Tx off"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdStatEn_BfSet(device, + NULL, + txBaseAddr, + txSlewRateDetectorCfg[cfgIdx].srlCfg.srdStatisticsEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write statistics enable"); + goto cleanup; + } + + /* Clear statistics before setting statistics mode */ + recoveryAction = adrv903x_TxFuncs_SrdStatMode_BfSet(device, + NULL, + txBaseAddr, + (2U | txSlewRateDetectorCfg[cfgIdx].srlCfg.srdStatisticsMode)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to clear statistics"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdStatMode_BfSet(device, + NULL, + txBaseAddr, + txSlewRateDetectorCfg[cfgIdx].srlCfg.srdStatisticsMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write statistics mode"); + goto cleanup; + } + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxSlewRateDetectorCfgGet(adi_adrv903x_Device_t * const device, + adi_adrv903x_SlewRateDetectorCfgRt_t * const txSlewRateDetectorCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + uint8_t tempByte = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txSlewRateDetectorCfg, cleanup); + + /* Retrieve the base address of selected channel. This function call will also range check the txChannelMask */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)txSlewRateDetectorCfg->txChannelMask, &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txSlewRateDetectorCfg->txChannelMask, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdDinSel_BfGet(device, + NULL, + txBaseAddr, + &tempByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx SRD input selection"); + goto cleanup; + } + txSlewRateDetectorCfg->srlCfg.inputSel = (adi_adrv903x_PaProtectionInputSel_e)tempByte; + + recoveryAction = adrv903x_TxFuncs_SrdSlewOffset_BfGet(device, + NULL, + txBaseAddr, + &txSlewRateDetectorCfg->srlCfg.srdOffset); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx SRD threshold"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdEn_BfGet(device, + NULL, + txBaseAddr, + &txSlewRateDetectorCfg->srlCfg.srdEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx SRD enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdIrqEn_BfGet(device, + NULL, + txBaseAddr, + &txSlewRateDetectorCfg->srlCfg.srdIrqEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx SRD Irq enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdArvWait_BfGet(device, + NULL, + txBaseAddr, + &txSlewRateDetectorCfg->srlCfg.autoRecoveryWaitTime); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read auto recovery wait time"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdArvEn_BfGet(device, + NULL, + txBaseAddr, + &txSlewRateDetectorCfg->srlCfg.autoRecoveryEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read auto recovery enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdArvTxonQual_BfGet(device, + NULL, + txBaseAddr, + &txSlewRateDetectorCfg->srlCfg.autoRecoveryDisableTimerWhenTxOff); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read auto recovery disable timer when Tx off"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdStatEn_BfGet(device, + NULL, + txBaseAddr, + &txSlewRateDetectorCfg->srlCfg.srdStatisticsEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read statistics enable"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdStatMode_BfGet(device, + NULL, + txBaseAddr, + &txSlewRateDetectorCfg->srlCfg.srdStatisticsMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read statistics mode"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxSlewRateStatisticsRead(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + const uint8_t clearStats, + uint16_t * const statisticsReadback) +{ + static const uint8_t SINGLE_BIT_MAX = 1U; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + uint8_t tempByte = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, statisticsReadback, cleanup); + + if (clearStats > SINGLE_BIT_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + clearStats, + "clearStats value is invalid. Valid values 0-1"); + goto cleanup; + } + + /* Clear the memory to make sure statistics readback will be correct */ + *statisticsReadback = 0; + + /* Retrieve the base address of selected channel. This function call will also range check the txChannelMask */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, txChannel, &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdStat_BfGet(device, + NULL, + txBaseAddr, + statisticsReadback); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read statistics"); + goto cleanup; + } + + if (clearStats == 1U) + { + recoveryAction = adrv903x_TxFuncs_SrdStatMode_BfGet(device, + NULL, + txBaseAddr, + &tempByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read statistics mode"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdStatMode_BfSet(device, + NULL, + txBaseAddr, + (tempByte | 2U)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to clear statistics"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_SrdStatMode_BfSet(device, + NULL, + txBaseAddr, + tempByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to restore statistics mode"); + goto cleanup; + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxProtectionRampSampleHoldEnableSet(adi_adrv903x_Device_t* const device, + const uint32_t txChannelMask, + const uint8_t enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + /*Check that if requested Tx Channel valid*/ + if (((txChannelMask & (~(uint32_t)ADI_ADRV903X_TXALL)) != 0U) || (txChannelMask == (uint32_t)ADI_ADRV903X_TXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txChannelMask, + "Invalid Tx channel is selected. Valid values are any combinations of Tx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + if (enable > ADI_TRUE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + enable, + "enable value is invalid. Valid values 0-1"); + goto cleanup; + } + + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + if (ADRV903X_BF_EQUAL(txChannelMask, (uint32_t)(1U << chanIdx))) + { + chanSel = 1U << chanIdx; + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + + recoveryAction = adrv903x_TxFuncs_AnaRampHoldSampleEn_BfSet(device, + NULL, + txBaseAddr, + enable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx Analog sample hold and ramp down bit"); + goto cleanup; + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxProtectionRampSampleHoldEnableGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + uint8_t* const enable) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, enable, cleanup); + + /* Retrieve the base address for selected tx channel. This will also range check the txChannelMask parameter */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, txChannel, &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_AnaRampHoldSampleEn_BfGet(device, + NULL, + txBaseAddr, + enable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx Analog sample hold and ramp down bit"); + goto cleanup; + } + + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxProtectionRampCfgSet(adi_adrv903x_Device_t* const device, + adi_adrv903x_ProtectionRampCfgRt_t txProtectionRampCfg[], + const uint32_t numProtectionRampCfgs) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cfgIdx = 0U; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + uint8_t jesdDfrmMask = 0U; + uint8_t pllUnlockMask = 0U; + uint8_t srdRdnEn = 0U; + uint8_t avgPowerRdnEn = 0U; + uint8_t peakPowerRdnEn = 0U; + + uint32_t allRampDownMasks = (uint32_t)ADI_ADRV903X_RDT_PEAK_PA | + (uint32_t)ADI_ADRV903X_RDT_AVG_PA | + (uint32_t)ADI_ADRV903X_RDT_SRD | + (uint32_t)ADI_ADRV903X_RDT_CLK_PLL_UNLOCK | + (uint32_t)ADI_ADRV903X_RDT_RF0_PLL_UNLOCK | + (uint32_t)ADI_ADRV903X_RDT_RF1_PLL_UNLOCK | + (uint32_t)ADI_ADRV903X_RDT_SERDES_PLL_UNLOCK | + (uint32_t)ADI_ADRV903X_RDT_DFRM0_EVENT | + (uint32_t)ADI_ADRV903X_RDT_DFRM1_EVENT; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txProtectionRampCfg, cleanup); + + if (numProtectionRampCfgs == 0U) + { + /* no valid configs */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numProtectionRampCfgs, "Invalid Number of Tx Protection Ramp Configurations"); + goto cleanup; + } + + /* Loop through the number of configurations and perform range checks */ + for (cfgIdx = 0U; cfgIdx < numProtectionRampCfgs; ++cfgIdx) + { + if ((txProtectionRampCfg[cfgIdx].protectionRampCfg.rampDownMask & (~allRampDownMasks)) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txProtectionRampCfg[cfgIdx].protectionRampCfg.rampDownMask, + "Ramp down mask selection is invalid. Valid values are any combinations of bitmasks given in adi_adrv903x_RampDownTrigger_e"); + goto cleanup; + } + + if (txProtectionRampCfg[cfgIdx].protectionRampCfg.altEventClearReqd > 1U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txProtectionRampCfg[cfgIdx].protectionRampCfg.altEventClearReqd, + "Invalid altEventClearReqd selection. Valid values are 0-1"); + goto cleanup; + } + + /*Check that if requested Tx Channel valid*/ + if(((txProtectionRampCfg[cfgIdx].txChannelMask & (~(uint32_t)ADI_ADRV903X_TXALL)) != 0U) || (txProtectionRampCfg[cfgIdx].txChannelMask == (uint32_t)ADI_ADRV903X_TXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txProtectionRampCfg[cfgIdx].txChannelMask, + "Invalid Tx channel is selected. Valid values are any combinations of Tx0/1/2/3/4/5/6/7"); + goto cleanup; + } + } + + /* Write out the configurations to appropriate bitfields */ + for (cfgIdx = 0U; cfgIdx < numProtectionRampCfgs; ++cfgIdx) + { + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(txProtectionRampCfg[cfgIdx].txChannelMask, (uint32_t)(chanSel))) + { + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + jesdDfrmMask = ((txProtectionRampCfg[cfgIdx].protectionRampCfg.rampDownMask >> 0x7U) & 0x3U); + /* Setting these bits will disable the rampdown for dfrm events, so toggle user selection */ + jesdDfrmMask = ~jesdDfrmMask; + jesdDfrmMask &= 0x3U; + recoveryAction = adrv903x_TxFuncs_JesdDfrmMask_BfSet(device, + NULL, + txBaseAddr, + jesdDfrmMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx Jesd Dfrm Mask"); + goto cleanup; + } + + pllUnlockMask = ((txProtectionRampCfg[cfgIdx].protectionRampCfg.rampDownMask >> 0x3U) & 0xFU); + /* Setting these bits will disable the rampdown for pll unlock events, so toggle user selection */ + pllUnlockMask = ~pllUnlockMask; + pllUnlockMask &= 0xFU; + recoveryAction = adrv903x_TxFuncs_PllUnlockMask_BfSet(device, + NULL, + txBaseAddr, + pllUnlockMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx PLL Unlock Mask"); + goto cleanup; + } + + srdRdnEn = ((txProtectionRampCfg[cfgIdx].protectionRampCfg.rampDownMask >> 0x2U) & 0x1U); + recoveryAction = adrv903x_TxFuncs_SrdRdnEn_BfSet(device, + NULL, + txBaseAddr, + srdRdnEn); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx SRD Ramp Down Mask"); + goto cleanup; + } + + avgPowerRdnEn = ((txProtectionRampCfg[cfgIdx].protectionRampCfg.rampDownMask >> 0x1U) & 0x1U); + recoveryAction = adrv903x_TxFuncs_PaProtectionAvgpowerRdnEn_BfSet(device, + NULL, + txBaseAddr, + avgPowerRdnEn); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx Average Power Ramp Down Mask"); + goto cleanup; + } + + peakPowerRdnEn = (txProtectionRampCfg[cfgIdx].protectionRampCfg.rampDownMask & 0x1U); + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakpowerRdnEn_BfSet(device, + NULL, + txBaseAddr, + peakPowerRdnEn); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx Peak Power Ramp Down Mask"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PllJesdProtClrReqd_BfSet(device, + NULL, + txBaseAddr, + txProtectionRampCfg[cfgIdx].protectionRampCfg.altEventClearReqd); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx Power Protect Event Clear Required"); + goto cleanup; + } + } + } + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxProtectionRampCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_ProtectionRampCfgRt_t* const txProtectionRampCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + uint8_t tempByte = 0U; + uint32_t tmpRampDownMask = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txProtectionRampCfg, cleanup); + + /* Retrieve the base address for selected tx channel. This will also range check the txChannelMask parameter */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(txProtectionRampCfg->txChannelMask), &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txProtectionRampCfg->txChannelMask, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_JesdDfrmMask_BfGet(device, + NULL, + txBaseAddr, + &tempByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx Jesd Dfrm Mask"); + goto cleanup; + } + /* bit = 1 means ramp down is disabled. So toggle the bits before returning it to user */ + tempByte = ~tempByte; + tempByte &= 0x3U; + tmpRampDownMask |= (uint32_t)tempByte << 0x0007U; + + recoveryAction = adrv903x_TxFuncs_PllUnlockMask_BfGet(device, + NULL, + txBaseAddr, + &tempByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PLL Unlock Mask"); + goto cleanup; + } + /* bit = 1 means ramp down is disabled. So toggle the bits before returning it to user */ + tempByte = ~tempByte; + tempByte &= 0xFU; + tmpRampDownMask |= (uint32_t)tempByte << 0x0003U; + + recoveryAction = adrv903x_TxFuncs_SrdRdnEn_BfGet(device, + NULL, + txBaseAddr, + &tempByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx SRD Ramp Down Mask"); + goto cleanup; + } + tmpRampDownMask |= (uint32_t)tempByte << 0x0002U; + + recoveryAction = adrv903x_TxFuncs_PaProtectionAvgpowerRdnEn_BfGet(device, + NULL, + txBaseAddr, + &tempByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx Average Power Ramp Down Mask"); + goto cleanup; + } + tmpRampDownMask |= (uint32_t)tempByte << 0x0001U; + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakpowerRdnEn_BfGet(device, + NULL, + txBaseAddr, + &tempByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx Peak Power Ramp Down Mask"); + goto cleanup; + } + tmpRampDownMask |= (uint32_t)tempByte << 0x0000U; + + recoveryAction = adrv903x_TxFuncs_PllJesdProtClrReqd_BfGet(device, + NULL, + txBaseAddr, + &txProtectionRampCfg->protectionRampCfg.altEventClearReqd); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx Power Protect Event Clear Required"); + goto cleanup; + } + + txProtectionRampCfg->protectionRampCfg.rampDownMask = tmpRampDownMask; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxPowerMonitorStatusGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxPowerMonitorStatus_t * const powerMonitorStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxFuncsChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + uint8_t tempByte = 0U; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, powerMonitorStatus, cleanup); + + /* Retrieve the base address for selected tx channel. This will also range check the txChannel parameter */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, txChannel, &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionReadbackUpdate_BfSet(device, + NULL, + txBaseAddr, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to set readback update bitfield"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakpowerEn_BfGet(device, + NULL, + txBaseAddr, + &tempByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Peak Power Enable"); + goto cleanup; + } + + if (tempByte == 1U) + { + /* Read power levels only if peak power measurement block is enabled */ + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakPower_BfGet(device, + NULL, + txBaseAddr, + &powerMonitorStatus->peakPower); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read average power"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionPeakErrorPower_BfGet(device, + NULL, + txBaseAddr, + &powerMonitorStatus->peakErrorPower); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read peak error power"); + goto cleanup; + } + } + else + { + powerMonitorStatus->peakPower = 0U; + powerMonitorStatus->peakErrorPower = 0U; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionAvgpowerEn_BfGet(device, + NULL, + txBaseAddr, + &tempByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Avg Power Enable"); + goto cleanup; + } + + if (tempByte == 1U) + { + recoveryAction = adrv903x_TxFuncs_PaProtectionAveragePower_BfGet(device, + NULL, + txBaseAddr, + &powerMonitorStatus->avgPower); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read average power"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionAverageErrorPower_BfGet(device, + NULL, + txBaseAddr, + &powerMonitorStatus->avgErrorPower); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read average error power"); + goto cleanup; + } + } + else + { + powerMonitorStatus->avgPower = 0U; + powerMonitorStatus->avgErrorPower = 0U; + } + + recoveryAction = adrv903x_TxFuncs_PaProtectionAprEn_BfGet(device, + NULL, + txBaseAddr, + &tempByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx PA Protect Average to Peak Ratio Enable"); + goto cleanup; + } + + if (tempByte == 1U) + { + recoveryAction = adrv903x_TxFuncs_PaProtectionAveragePeakRatio_BfGet(device, + NULL, + txBaseAddr, + &powerMonitorStatus->avgPeakRatio); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read average to peak ratio"); + goto cleanup; + } + } + else + { + powerMonitorStatus->avgPeakRatio = 0U; + } + + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenCfgSet(adi_adrv903x_Device_t* const device, + const uint32_t chanMask, + adi_adrv903x_TxAttenCfg_t* const txAttenCfg) +{ + const uint8_t TX_ATTEN_MODE_SPI = 1U; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t chanId = 0U; + uint32_t chanSel = 0U; + adrv903x_BfTxFuncsChanAddr_e txFuncsChanAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txAttenCfg, cleanup); + + if (chanMask > ADI_ADRV903X_TX_CHAN_MASK_MAX || + chanMask == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanMask, "Invalid channel mask."); + goto cleanup; + } + + if (txAttenCfg->txAttenStepSize >= ADI_ADRV903X_TXATTEN_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txAttenCfg->txAttenStepSize, "Tx atten step size is invalid."); + goto cleanup; + } + + /* adi_adrv903x_TxAttenUpdateCfgSet already validates everything within txAttenCfg->updateCfg */ + recoveryAction = adi_adrv903x_TxAttenUpdateCfgSet(device, chanMask, &txAttenCfg->updateCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Tx atten config failed to set update config"); + goto cleanup; + } + + for (chanId = 0U; chanId < ADI_ADRV903X_MAX_TXCHANNELS; chanId++) + { + chanSel = 1U << chanId; + if ((chanMask & chanSel) == 0) + { + /* chanId not set in chanMask - skip this channel */ + continue; + } + + /* Convert the chanId to the base address value required by the bitfield functions */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &txFuncsChanAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanId, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + /* Ensure mode is SPI mode */ + recoveryAction = adrv903x_TxFuncs_TxAttenMode_BfSet(device, NULL, txFuncsChanAddr, TX_ATTEN_MODE_SPI); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx Atten Mode"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_TxAttenConfig_BfSet(device, NULL, txFuncsChanAddr, txAttenCfg->txAttenStepSize); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to write Tx Use Atten Step Size"); + goto cleanup; + } + device->devStateInfo.txAttenStepSize[chanId] = txAttenCfg->txAttenStepSize; + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxAttenCfg_t* const txAttenCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxFuncsChanAddr_e txFuncsChanAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + uint8_t chanId = 0U; + uint8_t tmpByte = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txAttenCfg, cleanup); + + + chanId = adrv903x_TxChannelsToId(txChannel); + if (chanId > ADI_ADRV903X_TX_CHAN_ID_MAX) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanId, "Invalid channel id."); + goto cleanup; + } + + recoveryAction = adi_adrv903x_TxAttenUpdateCfgGet(device, txChannel, &txAttenCfg->updateCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get tx atten update config"); + goto cleanup; + } + + /* Convert the chanId to the base address value required by the bitfield functions */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, txChannel, &txFuncsChanAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanId, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + /* Fetch the const step mode config items */ + recoveryAction = adrv903x_TxFuncs_TxAttenConfig_BfGet(device, NULL, txFuncsChanAddr, &tmpByte); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read Tx Atten Step Size"); + goto cleanup; + } + + txAttenCfg->txAttenStepSize = (adi_adrv903x_TxAttenStepSize_e)tmpByte; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxDecimatedPowerCfgSet(adi_adrv903x_Device_t * const device, + adi_adrv903x_TxDecimatedPowerCfg_t txDecPowerCfg[], + const uint32_t numOfDecPowerCfgs) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cfgIdx = 0U; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + + adrv903x_BfTxFuncsChanAddr_e txFuncsChanBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + adrv903x_BfTxDigChanAddr_e txDigChanBaseAddr = (adrv903x_BfTxDigChanAddr_e)0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txDecPowerCfg, cleanup); + + if (numOfDecPowerCfgs == 0U) + { + /* no valid configs */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numOfDecPowerCfgs, "Invalid Number of Dec Power Configurations"); + goto cleanup; + } + + /* Loop through the number of configurations and perform range checks */ + for (cfgIdx = 0U; cfgIdx < numOfDecPowerCfgs; ++cfgIdx) + { + recoveryAction = adrv903x_TxDecPowerCfgRangeCheck(device, &txDecPowerCfg[cfgIdx]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Tx Dec power range check Error Reported"); + goto cleanup; + } + } + + /* Write out the configurations */ + for (cfgIdx = 0U; cfgIdx < numOfDecPowerCfgs; ++cfgIdx) + { + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; chanIdx++) + { + chanSel = 1U << chanIdx; + if ((txDecPowerCfg[cfgIdx].txChannelMask & chanSel) > 0) + { + /* Convert the chanId to the base address value required by the bitfield functions */ + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &txFuncsChanBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_TxPowerInputSelect_BfSet(device, + NULL, + txFuncsChanBaseAddr, + txDecPowerCfg[cfgIdx].powerInputSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting power measurement input selection"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_TxPowerMeasurementDuration_BfSet(device, + NULL, + txFuncsChanBaseAddr, + txDecPowerCfg[cfgIdx].powerMeasurementDuration); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting power measurement duration"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_TxPeakToPowerMode_BfSet(device, + NULL, + txFuncsChanBaseAddr, + txDecPowerCfg[cfgIdx].peakToPowerMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting peak to power mode"); + goto cleanup; + } + + recoveryAction = adrv903x_TxDigBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &txDigChanBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + if (txDecPowerCfg[cfgIdx].measurementEnable == 1U) + { + + recoveryAction = adrv903x_TxDig_StreamprocDuc0Hb3OutClkEnable_BfSet(device, + NULL, + txDigChanBaseAddr, + txDecPowerCfg[cfgIdx].measurementEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting tx stream proc duc0 hb3 out clk enable bit"); + goto cleanup; + } + recoveryAction = adrv903x_TxDig_StreamprocPfirClkEnable_BfSet(device, + NULL, + txDigChanBaseAddr, + txDecPowerCfg[cfgIdx].measurementEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting tx stream proc pfir clk enable bit"); + goto cleanup; + } + } + + recoveryAction = adrv903x_TxFuncs_TxPowerMeasurementEnable_BfSet(device, + NULL, + txFuncsChanBaseAddr, + txDecPowerCfg[cfgIdx].measurementEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting power measurement enable bit"); + goto cleanup; + } + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxDecimatedPowerCfgGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxDecimatedPowerCfg_t * const txDecPowerCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxFuncsChanAddr_e txFuncsChanBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txDecPowerCfg, cleanup); + + if ((txChannel != ADI_ADRV903X_TX0) && + (txChannel != ADI_ADRV903X_TX1) && + (txChannel != ADI_ADRV903X_TX2) && + (txChannel != ADI_ADRV903X_TX3) && + (txChannel != ADI_ADRV903X_TX4) && + (txChannel != ADI_ADRV903X_TX5) && + (txChannel != ADI_ADRV903X_TX6) && + (txChannel != ADI_ADRV903X_TX7)) + { + /* Invalid tx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx channel selection"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, txChannel, &txFuncsChanBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_TxPowerInputSelect_BfGet(device, + NULL, + txFuncsChanBaseAddr, + &txDecPowerCfg->powerInputSelect); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading power measurement input selection"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_TxPowerMeasurementDuration_BfGet(device, + NULL, + txFuncsChanBaseAddr, + &txDecPowerCfg->powerMeasurementDuration); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading power measurement duration"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_TxPeakToPowerMode_BfGet(device, + NULL, + txFuncsChanBaseAddr, + &txDecPowerCfg->peakToPowerMode); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading peak to power mode bit"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_TxPowerMeasurementEnable_BfGet(device, + NULL, + txFuncsChanBaseAddr, + &txDecPowerCfg->measurementEnable); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading power measurement enable bit"); + goto cleanup; + } + + txDecPowerCfg->txChannelMask = (uint32_t)txChannel; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxDecimatedPowerGet(adi_adrv903x_Device_t * const device, + const adi_adrv903x_TxChannels_e txChannel, + uint8_t * const powerReadBack, + uint8_t * const powerPeakReadBack) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxFuncsChanAddr_e txFuncsChanBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_FUNCS; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, powerReadBack, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, powerPeakReadBack, cleanup); + + if ((txChannel != ADI_ADRV903X_TX0) && + (txChannel != ADI_ADRV903X_TX1) && + (txChannel != ADI_ADRV903X_TX2) && + (txChannel != ADI_ADRV903X_TX3) && + (txChannel != ADI_ADRV903X_TX4) && + (txChannel != ADI_ADRV903X_TX5) && + (txChannel != ADI_ADRV903X_TX6) && + (txChannel != ADI_ADRV903X_TX7)) + { + /* Invalid Tx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid channel selection"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncsBitfieldAddressGet(device, txChannel, &txFuncsChanBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_TxPowerMeasurementReadback_BfSet(device, + NULL, + txFuncsChanBaseAddr, + 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while setting decimated power readback latch bit"); + goto cleanup; + } + + recoveryAction = adrv903x_TxFuncs_TxPower_BfGet(device, + NULL, + txFuncsChanBaseAddr, + powerReadBack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading decimated power for selected Tx channel"); + goto cleanup; + } + + + recoveryAction = adrv903x_TxFuncs_TxPowerLargestPeak_BfGet(device, + NULL, + txFuncsChanBaseAddr, + powerPeakReadBack); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while reading decimated peak power for selected Tx channel"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenPhaseSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxAttenPhaseCfg_t * const txAttenPhaseCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_SetTxAttenPhase_t txAttenPhaseInfo; + adrv903x_CpuCmd_SetTxAttenPhaseResp_t cmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t i = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txAttenPhaseCfg, cleanup); + ADI_LIBRARY_MEMSET(&txAttenPhaseInfo, 0, sizeof(txAttenPhaseInfo)); + ADI_LIBRARY_MEMSET(&cmdRsp, 0, sizeof(cmdRsp)); + + if (txAttenPhaseCfg->chanSelect == 0U) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txAttenPhaseCfg->chanSelect, "Invalid chanSelect provided."); + goto cleanup; + } + + /* Prepare the command payload */ + txAttenPhaseInfo.chanSelect = (uint8_t) txAttenPhaseCfg->chanSelect; + for (i = 0U; i < ADI_ADRV903X_TX_ATTEN_PHASE_SIZE; i++) + { + txAttenPhaseInfo.txAttenPhase[i] = ADRV903X_HTOCS(txAttenPhaseCfg->txAttenPhase[i]); + } + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_SET_TX_ATTEN_PHASE, + (void*)&txAttenPhaseInfo, + sizeof(txAttenPhaseInfo), + (void*)&cmdRsp, + sizeof(cmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(cmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxAttenPhaseGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_TxAttenPhaseCfg_t* const txRbConfig) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_CpuCmd_GetTxAttenPhase_t txAttenPhaseCfgRbCmd; + adrv903x_CpuCmd_GetTxAttenPhaseResp_t txAttenPhaseCfgGetcmdRsp; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + adrv903x_CpuErrorCode_e cpuErrorCode = ADRV903X_CPU_SYSTEM_SIMULATED_ERROR; + uint32_t i = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, txRbConfig, cleanup); + ADI_LIBRARY_MEMSET(&txAttenPhaseCfgRbCmd, 0, sizeof(txAttenPhaseCfgRbCmd)); + ADI_LIBRARY_MEMSET(&txAttenPhaseCfgGetcmdRsp, 0, sizeof(txAttenPhaseCfgGetcmdRsp)); + + /* Test if channel mask is 0 or has more than one channel set */ + if (txRbConfig->chanSelect == (uint8_t) ADI_ADRV903X_TXOFF || + txRbConfig->chanSelect > (uint8_t) ADI_ADRV903X_TX7 || + (((txRbConfig->chanSelect - 1) & txRbConfig->chanSelect) != 0U)) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txRbConfig->chanSelect, "Invalid chanSelect provided."); + goto cleanup; + } + + /* Prepare the command payload */ + txAttenPhaseCfgRbCmd.chanSelect = (uint8_t) txRbConfig->chanSelect; + + /* Send command and receive response */ + recoveryAction = adrv903x_CpuCmdSend( device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_GET_TX_ATTEN_PHASE, + (void*)&txAttenPhaseCfgRbCmd, + sizeof(txAttenPhaseCfgRbCmd), + (void*)&txAttenPhaseCfgGetcmdRsp, + sizeof(txAttenPhaseCfgGetcmdRsp), + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ADRV903X_CPU_CMD_RESP_CHECK_GOTO(txAttenPhaseCfgGetcmdRsp.status, cmdStatus, cpuErrorCode, recoveryAction, cleanup); + } + + /* Extract the command-specific response from the response payload */ + for (i = 0U; i < ADI_ADRV903X_TX_ATTEN_PHASE_SIZE; i++) + { + txRbConfig->txAttenPhase[i] = ADRV903X_CTOHS(txAttenPhaseCfgGetcmdRsp.txAttenPhase[i]); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DtxCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DtxCfg_t dtxCfg[], + const uint32_t numDtxCfgs) +{ + static const uint32_t txScratchPad6[] = { (uint32_t)ADRV903X_ADDR_TX0_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX1_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX2_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX3_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX4_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX5_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX6_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX7_STREAM_SCRATCH6 + }; + static const uint32_t TX_SCRATCH_MASK = 0xFFFF0103U; + static const uint32_t DTX_MODE_MASK = 0x00000003U; + static const uint32_t DTX_MODE_SHIFT = 0U; + static const uint32_t DTX_ZERO_COUNT_MASK = 0xFFFF0000U; + static const uint32_t DTX_ZERO_COUNT_SHIFT = 16U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t cfgIdx = 0U; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + uint32_t txScratch6Value = 0U; + adi_adrv903x_DtxMode_e prvDtxMode[] = { ADI_ADRV903X_DTXMODE_DISABLE, + ADI_ADRV903X_DTXMODE_DISABLE, + ADI_ADRV903X_DTXMODE_DISABLE, + ADI_ADRV903X_DTXMODE_DISABLE, + ADI_ADRV903X_DTXMODE_DISABLE, + ADI_ADRV903X_DTXMODE_DISABLE, + ADI_ADRV903X_DTXMODE_DISABLE, + ADI_ADRV903X_DTXMODE_DISABLE + }; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dtxCfg, cleanup); + + if (numDtxCfgs == 0U) + { + /* no valid configs */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numDtxCfgs, "Invalid Number of Tx DTX Configurations"); + goto cleanup; + } + + /* Loop through the number of configurations and perform range checks */ + for (cfgIdx = 0U; cfgIdx < numDtxCfgs; ++cfgIdx) + { + /*Check that if requested Tx Channel valid*/ + if (((dtxCfg[cfgIdx].txChannelMask & (~(uint32_t)ADI_ADRV903X_TXALL)) != 0U) || (dtxCfg[cfgIdx].txChannelMask == (uint32_t)ADI_ADRV903X_TXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + dtxCfg[cfgIdx].txChannelMask, + "Invalid Tx channel is selected. Valid values are any combinations of Tx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + /*Check that if requested DTX Mode is valid*/ + if (dtxCfg[cfgIdx].dtxMode > ADI_ADRV903X_DTXMODE_PIN) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + dtxCfg[cfgIdx].dtxMode, + "Invalid DTX mode selection. Valid values are 0/1/2/3"); + goto cleanup; + } + } + + /* Write out the configurations to appropriate bitfields */ + for (cfgIdx = 0U; cfgIdx < numDtxCfgs; ++cfgIdx) + { + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(dtxCfg[cfgIdx].txChannelMask, chanSel)) + { + /* Update TX scratch register with DTX config for specific channel */ + recoveryAction = adi_adrv903x_Register32Read(device, NULL, txScratchPad6[chanIdx], &txScratch6Value, TX_SCRATCH_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot read Tx scratch pad register 6"); + goto cleanup; + } + + prvDtxMode[chanIdx] = (adi_adrv903x_DtxMode_e)((txScratch6Value & DTX_MODE_MASK) >> DTX_MODE_SHIFT); + + txScratch6Value &= (~DTX_MODE_MASK); + txScratch6Value |= ((uint32_t)(dtxCfg[cfgIdx].dtxMode) << DTX_MODE_SHIFT); + txScratch6Value &= (~DTX_ZERO_COUNT_MASK); + txScratch6Value |= ((uint32_t)(dtxCfg[cfgIdx].dtxZeroCounter) << DTX_ZERO_COUNT_SHIFT); + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, txScratchPad6[chanIdx], txScratch6Value, TX_SCRATCH_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot write Tx scratch pad register 6"); + goto cleanup; + } + } + } + + /* For each cfgIdx, trigger stream to update DTX mode config registers while writing to DTX ClearStatus bits */ + recoveryAction = adrv903x_TxStreamTrigger(device, (uint8_t)dtxCfg[cfgIdx].txChannelMask, (uint8_t)ADRV903X_STREAM_TX_WRITE_DTX_MODE_CONFIG_CLRSTATUS); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + dtxCfg[cfgIdx].txChannelMask, + "Error while triggering TX DTX CFG stream"); + goto cleanup; + } + + /* Check if DTX is requested to be disabled but this request was issued when DTX was activated */ + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(dtxCfg[cfgIdx].txChannelMask, chanSel)) + { + if ((dtxCfg[cfgIdx].dtxMode == ADI_ADRV903X_DTXMODE_DISABLE) && + (prvDtxMode[chanIdx] == ADI_ADRV903X_DTXMODE_AUTO)) + { + recoveryAction = adrv903x_TxStreamTrigger(device, (uint8_t)chanSel, (uint8_t)ADRV903X_STREAM_TX_DTX_POWER_UP); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + chanSel, + "Error while triggering TX DTX POWER UP stream"); + goto cleanup; + } + } + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DtxCfgGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_DtxCfg_t* const dtxCfg) +{ + static const uint32_t txScratchPad6[] = { (uint32_t)ADRV903X_ADDR_TX0_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX1_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX2_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX3_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX4_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX5_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX6_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX7_STREAM_SCRATCH6 + }; + static const uint32_t DTX_MODE_MASK = 0x00000003U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxDigChanAddr_e txDigChanBaseAddr = (adrv903x_BfTxDigChanAddr_e)0U; + uint32_t txScratch6Value = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dtxCfg, cleanup); + + if ((txChannel != ADI_ADRV903X_TX0) && + (txChannel != ADI_ADRV903X_TX1) && + (txChannel != ADI_ADRV903X_TX2) && + (txChannel != ADI_ADRV903X_TX3) && + (txChannel != ADI_ADRV903X_TX4) && + (txChannel != ADI_ADRV903X_TX5) && + (txChannel != ADI_ADRV903X_TX6) && + (txChannel != ADI_ADRV903X_TX7)) + { + /* Invalid tx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx channel selection"); + goto cleanup; + } + + for (uint32_t chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + if ((1U << chanIdx) == txChannel) + { + /* Read DTX configuration stored in scratch register to retrieve DTX Mode */ + recoveryAction = adi_adrv903x_Register32Read(device, NULL, txScratchPad6[chanIdx], &txScratch6Value, DTX_MODE_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot read Tx scratch pad register 6"); + goto cleanup; + } + + dtxCfg->dtxMode = (adi_adrv903x_DtxMode_e)(txScratch6Value); + } + } + + /* Retrieve Zero count via BfGet */ + recoveryAction = adrv903x_TxDigBitfieldAddressGet(device, txChannel, &txDigChanBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxDig_DtxZeroCounter_BfGet(device, + NULL, + txDigChanBaseAddr, + &dtxCfg->dtxZeroCounter); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting dtx zero counter "); + goto cleanup; + } + + dtxCfg->txChannelMask = (uint32_t)txChannel; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DtxGpioCfgSet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_DtxGpioCfg_t* dtxGpioCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + adi_adrv903x_GpioPinSel_e gpioReadback = ADI_ADRV903X_GPIO_INVALID; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dtxGpioCfg, cleanup); + + /* Check all Dtx GPIO if valid */ + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + /* Check if pin is valid */ + if (dtxGpioCfg->dtxGpioTxSel[chanIdx] > ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Invalid DTX GPIO pin selected. To disable, please select ADI_ADRV903X_GPIO_INVALID"); + goto cleanup; + } + + /* Skip ADI_ADRV903X_GPIO_INVALID */ + if (dtxGpioCfg->dtxGpioTxSel[chanIdx] == ADI_ADRV903X_GPIO_INVALID) + { + continue; + } + + } + + /* First release all GPIOs used for tx internal signals */ + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + chanSel = 1U << chanIdx; + recoveryAction = adrv903x_GpioSignalFind(device, + &gpioReadback, + ADI_ADRV903X_GPIO_SIGNAL_DTX_FORCE_PIN, + (adi_adrv903x_Channels_e)(chanSel)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read gpio for selected signal"); + goto cleanup; + } + + if (gpioReadback != ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = adrv903x_GpioSignalRelease(device, + gpioReadback, + ADI_ADRV903X_GPIO_SIGNAL_DTX_FORCE_PIN, + (adi_adrv903x_Channels_e)(1U <common, recoveryAction, "Failure to release gpio"); + goto cleanup; + } + } + } + + /* Then assign new GPIOs for Tx internal signals */ + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + if (dtxGpioCfg->dtxGpioTxSel[chanIdx] != ADI_ADRV903X_GPIO_INVALID) + { + recoveryAction = adrv903x_GpioSignalSet(device, + dtxGpioCfg->dtxGpioTxSel[chanIdx], + ADI_ADRV903X_GPIO_SIGNAL_DTX_FORCE_PIN, + (adi_adrv903x_Channels_e)(1U << chanIdx)); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, chanIdx, "Failure to assign selected signal to GPIO for chanIdx"); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DtxGpioCfgGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_DtxGpioCfg_t* const dtxGpioCfg) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + adi_adrv903x_GpioPinSel_e gpioReadback = ADI_ADRV903X_GPIO_INVALID; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dtxGpioCfg, cleanup); + + /* Then assign new GPIOs for Tx internal signals */ + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + chanSel = 1U << chanIdx; + recoveryAction = adrv903x_GpioSignalFind(device, + &gpioReadback, + ADI_ADRV903X_GPIO_SIGNAL_DTX_FORCE_PIN, + (adi_adrv903x_Channels_e)chanSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read gpio for selected signal"); + goto cleanup; + } + + dtxGpioCfg->dtxGpioTxSel[chanIdx] = gpioReadback; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DtxForceSet(adi_adrv903x_Device_t* const device, + const uint32_t txChannelMask, + const uint8_t dtxForce) +{ + static const uint32_t txScratchPad6[] = { (uint32_t)ADRV903X_ADDR_TX0_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX1_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX2_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX3_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX4_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX5_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX6_STREAM_SCRATCH6, + (uint32_t)ADRV903X_ADDR_TX7_STREAM_SCRATCH6 + }; + static const uint32_t TX_SCRATCH_MASK = 0xFFFF0103U; + static const uint32_t DTX_FORCE_MASK = 0x00000100U; + static const uint32_t DTX_FORCE_SHIFT = 8U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + uint32_t txScratch6Value = 0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + /*Check that if requested Tx Channel valid*/ + if (((txChannelMask & (~(uint32_t)ADI_ADRV903X_TXALL)) != 0U) || (txChannelMask == (uint32_t)ADI_ADRV903X_TXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txChannelMask, + "Invalid Tx channel is selected. Valid values are any combinations of Tx0/1/2/3/4/5/6/7"); + goto cleanup; + } + + /*Check that if requested DTX Force is valid*/ + if (dtxForce > ADI_ENABLE) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + dtxForce, + "Invalid DTX Force bit. Valid values are 0/1"); + goto cleanup; + } + + + /* Write out the configurations to appropriate bitfields */ + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + chanSel = 1U << chanIdx; + if (ADRV903X_BF_EQUAL(txChannelMask, chanSel)) + { + /* Update TX scratch register with DTX config for specific channel */ + recoveryAction = adi_adrv903x_Register32Read(device, NULL, txScratchPad6[chanIdx], &txScratch6Value, TX_SCRATCH_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot read Tx scratch pad register 6"); + goto cleanup; + } + + txScratch6Value = (txScratch6Value & (~DTX_FORCE_MASK)) | ((uint32_t)(dtxForce) << DTX_FORCE_SHIFT); + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, txScratchPad6[chanIdx], txScratch6Value, TX_SCRATCH_MASK); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot write Tx scratch pad register 6"); + goto cleanup; + } + } + } + + recoveryAction = adrv903x_TxStreamTrigger(device, (uint8_t)txChannelMask, (uint8_t)ADRV903X_STREAM_TX_WRITE_DTX_MODE_CONFIG); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, + recoveryAction, + "Error while triggering TX stream"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DtxStatusGet(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + uint8_t * const dtxStatus) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adrv903x_BfTxDigChanAddr_e txDigChanBaseAddr = (adrv903x_BfTxDigChanAddr_e)0U; + + /* Check device pointer is not null */ + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dtxStatus, cleanup); + + if ((txChannel != ADI_ADRV903X_TX0) && + (txChannel != ADI_ADRV903X_TX1) && + (txChannel != ADI_ADRV903X_TX2) && + (txChannel != ADI_ADRV903X_TX3) && + (txChannel != ADI_ADRV903X_TX4) && + (txChannel != ADI_ADRV903X_TX5) && + (txChannel != ADI_ADRV903X_TX6) && + (txChannel != ADI_ADRV903X_TX7)) + { + /* Invalid tx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx channel selection"); + goto cleanup; + } + + recoveryAction = adrv903x_TxDigBitfieldAddressGet(device, txChannel, &txDigChanBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx Channel used to determine SPI address"); + goto cleanup; + } + + recoveryAction = adrv903x_TxDig_DtxStatus_BfGet(device, + NULL, + txDigChanBaseAddr, + dtxStatus); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting dtx mode "); + goto cleanup; + + } + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxPfirCoeffsWrite(adi_adrv903x_Device_t* const device, + const uint32_t txChannelMask, + adi_adrv903x_TxPfirCoeff_t* const pfirCoeffs) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t i; + uint32_t chanIdx = 0U; + uint32_t chanSel = 0U; + adrv903x_BfTxDatapathChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_DATAPATH; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(pfirCoeffs); + ADI_ADRV903X_API_ENTRY(&device->common); + + /* Check that requested Tx Channel mask is valid */ + if (((txChannelMask & (~(uint32_t)ADI_ADRV903X_TXALL)) != 0U) || (txChannelMask == (uint32_t)ADI_ADRV903X_TXOFF)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + txChannelMask, + "Invalid Tx channel mask"); + goto cleanup; + } + + /* Loop through each selected TX channel and set PFIR coeffs. */ + for (chanIdx = 0U; chanIdx < ADI_ADRV903X_MAX_TXCHANNELS; ++chanIdx) + { + chanSel = 1U << chanIdx; + if ((txChannelMask & chanSel) == 0) + { + /* TX channel is not selected - skip this channel */ + continue; + } + + recoveryAction = adrv903x_TxDatapathBitfieldAddressGet(device, (adi_adrv903x_TxChannels_e)(chanSel), &txBaseAddr); + + /* Two 16 bit PFIR coefficients are written each loop */ + for (i = 0U; i < ADRV903X_NUM_PFIR_COEF/2; i++) + { + recoveryAction = adrv903x_TxDatapath_PfirCoeffDataI_BfSet(device, + NULL, + txBaseAddr, + i, + (pfirCoeffs->pfirCoefI[2 * i] & 0xFFFFu) + (pfirCoeffs->pfirCoefI[2 * i + 1] << 16)); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Tx PFIR i coefficients"); + goto cleanup; + } + + recoveryAction = adrv903x_TxDatapath_PfirCoeffDataQ_BfSet(device, + NULL, + txBaseAddr, + i, + (pfirCoeffs->pfirCoefQ[2 * i] & 0xFFFFu) + (pfirCoeffs->pfirCoefQ[2 * i + 1] << 16)); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing to Tx PFIR q coefficients"); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_TxPfirCoeffsRead(adi_adrv903x_Device_t* const device, + const adi_adrv903x_TxChannels_e txChannel, + adi_adrv903x_TxPfirCoeff_t* const pfirCoeffs) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t i; + adrv903x_BfTxDatapathChanAddr_e txBaseAddr = ADRV903X_BF_SLICE_TX_0__TX_DATAPATH; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(pfirCoeffs); + ADI_ADRV903X_API_ENTRY(&device->common); + + if ((txChannel != ADI_ADRV903X_TX0) && + (txChannel != ADI_ADRV903X_TX1) && + (txChannel != ADI_ADRV903X_TX2) && + (txChannel != ADI_ADRV903X_TX3) && + (txChannel != ADI_ADRV903X_TX4) && + (txChannel != ADI_ADRV903X_TX5) && + (txChannel != ADI_ADRV903X_TX6) && + (txChannel != ADI_ADRV903X_TX7)) + { + /* Invalid tx channel selection */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Invalid Tx channel selection"); + goto cleanup; + } + + recoveryAction = adrv903x_TxDatapathBitfieldAddressGet(device, txChannel, &txBaseAddr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, txChannel, "Error reading base address for txChannel."); + goto cleanup; + } + + /* Two 16 bit PFIR coefficients are read each loop */ + for (i = 0U; i < ADRV903X_NUM_PFIR_COEF / 2; i++) + { + uint32_t readVal; + + /* Read two 16bit coefficients in one 32bit value */ + recoveryAction = adrv903x_TxDatapath_PfirCoeffDataI_BfGet(device, + NULL, + txBaseAddr, + i, + &readVal); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading Tx PFIR i coefficients"); + goto cleanup; + } + + pfirCoeffs->pfirCoefI[2 * i] = (int16_t)(readVal & 0xFFFFu) ; + pfirCoeffs->pfirCoefI[2 * i + 1] = (int16_t)((readVal >> 16) & 0xFFFFu); + + /* Read two 16bit coefficients in one 32bit value */ + recoveryAction = adrv903x_TxDatapath_PfirCoeffDataQ_BfGet(device, + NULL, + txBaseAddr, + i, + &readVal); + + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error reading Tx PFIR q coefficients"); + goto cleanup; + } + + pfirCoeffs->pfirCoefQ[2 * i] = (int16_t)(readVal & 0xFFFFu); + pfirCoeffs->pfirCoefQ[2 * i + 1] = (int16_t)((readVal >> 16) & 0xFFFFu); + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + diff --git a/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_utilities.c b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_utilities.c new file mode 100644 index 0000000000000..6b4a84527152f --- /dev/null +++ b/drivers/iio/adc/adrv903x/devices/adrv903x/public/src/adi_adrv903x_utilities.c @@ -0,0 +1,7070 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_adrv903x_utilities.c +* \brief Contains ADI Transceiver CPU functions +* Analog Devices maintains and provides updates to this code layer. +* The end user should not modify this file or any code in this directory. +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#include "adi_adrv903x_utilities.h" +#include "adi_adrv903x_cpu.h" +#include "adi_adrv903x_datainterface.h" +#include "adi_adrv903x_radioctrl.h" +#include "adi_adrv903x_cals.h" +#include "adi_adrv903x_tx.h" +#include "adi_library.h" + +#include "../../private/include/adrv903x_init.h" +#include "../../private/include/adrv903x_cpu_archive_types.h" +#include "../../private/include/adrv903x_rx.h" +#include "../../private/include/adrv903x_cpu.h" +#include "../../private/include/adrv903x_gpio.h" +#include "../../private/include/adrv903x_datainterface.h" +#include "../../private/include/adrv903x_cpu_cmd_fast_attack.h" +#include "../../private/include/adrv903x_binloader.h" +#include "../../private/bf/adrv903x_bf_tx_dig.h" +#include "../../public/include/adi_adrv903x_version.h" +#include "../../public/include/adi_adrv903x_core.h" +#include "../../private/bf/adrv903x_bf_core.h" + + + +#include "../../private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.h" +#include "../../private/bf/adrv903x_bf_jesd_common.h" +#include "../../private/bf/adrv903x_bf_jrx_link.h" + + +#include "../../private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2.h" +#include "../../private/bf/adrv903x_bf_tx_funcs_types.h" +#include "../../private/bf/adrv903x_bf_orx_dig.h" +#include "../../private/bf/adrv903x_bf_pll_mem_map.h" +#include "../../private/bf/adrv903x_bf_jtx_link.h" + +#define ADI_FILE ADI_ADRV903X_FILE_PUBLIC_UTILITIES + +/*****************************************************************************/ +/***** Helper functions' prototypes ******************************************/ +/*****************************************************************************/ +static adi_adrv903x_ErrAction_e adrv903x_CpuLoadUtil(adi_adrv903x_Device_t* const device, + const adi_adrv903x_cpuBinaryInfo_t* const cpuBinaryInfo, + FILE* cpuImageFilePtr, + const adi_adrv903x_CpuType_e cpuType); +static uint32_t adrv903x_insert64Bits( uint8_t* array, + uint64_t storeVariable); +static uint32_t adrv903x_insert32Bits( uint8_t* array, + uint32_t storeVariable); +static uint32_t adrv903x_insert16Bits( uint8_t* array, + uint16_t storeVariable); +static uint32_t adrv903x_insert8Bits( uint8_t* array, + uint8_t storeVariable); + +static adi_adrv903x_ErrAction_e adrv903x_dumpMemoryRegion( adi_adrv903x_Device_t* const device, + FILE **ofp, + uint32_t startAddr, + uint32_t endAddr, + uint32_t* const dumpSize, + uint32_t *recordCrc); +static adi_adrv903x_ErrAction_e adrv903x_JrxRepairHistoryRangeCheck(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepairHistory_t* const RepairHistory); + +static void adrv903x_EndiannessCheckAndConvert(void* const buffer, const size_t elementSize, const size_t elementCount); + +#define VARIABLE_ASSIGNMENT(target, source) \ + (target) = (source); \ + if(ADRV903X_LITTLE_ENDIAN == 0) \ + { \ + adrv903x_EndiannessCheckAndConvert(&(target), sizeof((target)), 1);\ + }\ + +static size_t adrv903x_VariableFromFileExtract(adi_adrv903x_Device_t* const device, + void* const buffer, + const size_t elementSize, + const size_t elementCount, + FILE* file); + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuImageLoad(adi_adrv903x_Device_t* const device, + const adi_adrv903x_cpuBinaryInfo_t* const cpuBinaryInfo) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + FILE* cpuImageFilePtr = NULL; + uint32_t fileSize = 0U; + uint32_t byteCount = 0U; + uint32_t expFileSize = 0U; + adrv903x_CpuArchiveHeader_t archiveHdr; + uint32_t i = 0u; + uint32_t expectedXSum = 0U; + uint8_t* archivePtr = NULL; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuBinaryInfo, cleanup); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuBinaryInfo->filePath, cleanup); + + ADI_LIBRARY_MEMSET(&archiveHdr, 0, sizeof(adrv903x_CpuArchiveHeader_t)); + + if (ADI_LIBRARY_STRNLEN((const char*)cpuBinaryInfo->filePath, ADI_ADRV903X_MAX_FILE_LENGTH) == ADI_ADRV903X_MAX_FILE_LENGTH) + { + /* Path is not terminated */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Unterminated path string"); + goto cleanup; + } + + /* Open CPU archive file */ +#ifdef __GNUC__ + cpuImageFilePtr = ADI_LIBRARY_FOPEN((const char *)cpuBinaryInfo->filePath, "rb"); +#else + if (ADI_LIBRARY_FOPEN_S(&cpuImageFilePtr, (const char *)cpuBinaryInfo->filePath, "rb") != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Invalid Binary File or Path Detected"); + goto cleanup; + } +#endif + if (NULL == cpuImageFilePtr) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Invalid Binary File or Path Detected"); + goto cleanup; + } + + /* Determine file size */ + if (ADI_LIBRARY_FSEEK(cpuImageFilePtr, 0, SEEK_END) != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Seek to EOF Failed"); + goto cleanup; + } + + /* ADI_LIBRARY_FTELL returns long type */ + fileSize = (uint32_t) ADI_LIBRARY_FTELL(cpuImageFilePtr); + + /* Check if CPU Image File is Empty */ + if (fileSize == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Zero Length CPU Image Detected"); + goto cleanup; + } + + /* Check that size of the file is a multiple of 4 */ + if ((fileSize & 0x3U) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Incorrect CPU Binary File Block Size"); + goto cleanup; + } + + /* Verify file contains at least the archive header */ + if (fileSize < sizeof(adrv903x_CpuArchiveHeader_t)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Invalid CPU image file detected (very small)"); + goto cleanup; + } + + /* Rewind the file pointer to beginning of the file */ + if (ADI_LIBRARY_FSEEK(cpuImageFilePtr, 0U, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + /* Read out the archive header */ + byteCount = ADI_LIBRARY_FREAD(&archiveHdr, 1, sizeof(archiveHdr), cpuImageFilePtr); + if (byteCount != sizeof(archiveHdr)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Error reading header from CPU image file"); + goto cleanup; + } + + /* Extract archive header contents (stored in CPU byte order) */ + archiveHdr.magicNum = ADRV903X_CTOHL(archiveHdr.magicNum); + archiveHdr.formatRev = ADRV903X_CTOHL(archiveHdr.formatRev); + archiveHdr.xsum = ADRV903X_CTOHL(archiveHdr.xsum); + + /* Calculate the expected archive header checksum + * (inverted byte sum of magicNum and formatRev) + */ + expectedXSum = 0U; + archivePtr = (uint8_t*)&archiveHdr; + for (i = 0U; i < sizeof(archiveHdr) - sizeof(archiveHdr.xsum); i++) + { + expectedXSum += archivePtr[i]; + } + expectedXSum = ~expectedXSum; + + /* Verify header checksum is correct */ + if (expectedXSum != archiveHdr.xsum) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Corrupted CPU image file detected"); + goto cleanup; + } + + /* Verify header magic number is correct */ + if (archiveHdr.magicNum != ADRV903X_CPU_ARCHIVE_MAGIC_NUM) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Unsupported CPU image file detected"); + goto cleanup; + } + + /* Verify archive format revision is correct */ + if (archiveHdr.formatRev != ADRV903X_CPU_ARCHIVE_REV_1) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Unsupported CPU image file detected"); + goto cleanup; + } + + /* Verify file size is correct (header + two CPU images) */ + expFileSize = sizeof(adrv903x_CpuArchiveHeader_t) + ADI_ADRV903X_CPU_0_BINARY_IMAGE_FILE_SIZE_BYTES + ADI_ADRV903X_CPU_1_BINARY_IMAGE_FILE_SIZE_BYTES; + if (fileSize != expFileSize) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Invalid CPU image file detected"); + goto cleanup; + } + + /* Put the part into streaming mode to help facilitate the large, contiguous SPI writes in CpuImageWrite */ + recoveryAction = adrv903x_SpiStreamingEntry(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue with entering Spi Streaming mode"); + goto cleanup; + } + + /* Load CPU0 image */ + recoveryAction = adrv903x_CpuLoadUtil(device, cpuBinaryInfo, cpuImageFilePtr, ADI_ADRV903X_CPU_TYPE_0); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error loading CPU0 image"); + goto cleanup; + } + + /* Load CPU1 image */ + recoveryAction = adrv903x_CpuLoadUtil(device, cpuBinaryInfo, cpuImageFilePtr, ADI_ADRV903X_CPU_TYPE_1); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error loading CPU1 image"); + goto cleanup; + } + + /* Load successful. Update device state. */ + device->devStateInfo.devState = (adi_adrv903x_ApiStates_e)(device->devStateInfo.devState | ADI_ADRV903X_STATE_CPU0LOADED | ADI_ADRV903X_STATE_CPU1LOADED); + + /* Close CPU Image File */ + if (0 == ADI_LIBRARY_FCLOSE(cpuImageFilePtr)) + { + cpuImageFilePtr = NULL; + } + else + { + cpuImageFilePtr = NULL; + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Cannot Close CPU Image File"); + goto cleanup; + } + +cleanup : + if (cpuImageFilePtr != NULL) + { + /* Close CPU Image File */ + if (0 != ADI_LIBRARY_FCLOSE(cpuImageFilePtr)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot Close CPU Image File"); + } + } + + if (device->devStateInfo.spiStreamingOn == ADI_TRUE) + { + if( ADI_ADRV903X_ERR_ACT_NONE != adrv903x_SpiStreamingExit(device)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_INTERFACE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Spi Streaming Exit Issue"); + } + } + + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StreamImageLoad(adi_adrv903x_Device_t* const device, + const adi_adrv903x_streamBinaryInfo_t* const streamBinaryInfoPtr) +{ + const size_t BIN_ELEMENT_SIZE = 1U; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + FILE* streamBinaryFilePtr = NULL; + uint32_t fileSize = 0U; + uint32_t numFileChunks = 0U; + uint32_t chunkIndex = 0U; + uint8_t streamBinaryImageBuffer[ADI_ADRV903X_STREAM_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES]; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, streamBinaryInfoPtr, cleanup); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, streamBinaryInfoPtr->filePath, cleanup); + + if (ADI_LIBRARY_STRNLEN((const char*)streamBinaryInfoPtr->filePath, ADI_ADRV903X_MAX_FILE_LENGTH) == ADI_ADRV903X_MAX_FILE_LENGTH) + { + /* Path is not terminated */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, streamBinaryInfoPtr->filePath, "Unterminated path string"); + goto cleanup; + } + + /* Open Stream Binary File */ +#ifdef __GNUC__ + streamBinaryFilePtr = ADI_LIBRARY_FOPEN((const char *)streamBinaryInfoPtr->filePath, "rb"); +#else + if (ADI_LIBRARY_FOPEN_S(&streamBinaryFilePtr, (const char *)streamBinaryInfoPtr->filePath, "rb") != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, streamBinaryInfoPtr->filePath, "Invalid Binary File or Path Detected"); + goto cleanup; + } +#endif + + if (NULL == streamBinaryFilePtr) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, streamBinaryInfoPtr->filePath, "Invalid Binary File or Path Detected"); + goto cleanup; + } + + /*Determine file size*/ + if (ADI_LIBRARY_FSEEK(streamBinaryFilePtr, 0U, SEEK_END) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, streamBinaryFilePtr, "Seek to EOF Failed"); + goto cleanup; + } + + /* ADI_LIBRARY_FTELL returns long type */ + fileSize = (uint32_t) ADI_LIBRARY_FTELL(streamBinaryFilePtr); + numFileChunks = (uint32_t)(fileSize / ADI_ADRV903X_STREAM_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES); + + /* Check that Stream binary file is not empty */ + if (fileSize == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, streamBinaryFilePtr, "Zero Length Stream Image Detected"); + goto cleanup; + } + + /* Check that Stream binary file size does not exceed maximum size */ + if (fileSize > ADI_ADRV903X_STREAM_BINARY_IMAGE_FILE_SIZE_BYTES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, fileSize, "Stream Binary Size exceeds Maximum Limit"); + goto cleanup; + } + + /* Check that size of the file is a multiple of 4 */ + if ((fileSize & 0x3U) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, streamBinaryInfoPtr->filePath, "Incorrect Stream Binary File Block Size"); + goto cleanup; + } + + /* Rewind the file pointer to beginning of the file */ + if (ADI_LIBRARY_FSEEK(streamBinaryFilePtr, 0U, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, streamBinaryFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + /* Put the part into streaming mode to help facilitate the large, contiguous SPI writes in CpuImageWrite */ + recoveryAction = adrv903x_SpiStreamingEntry(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue with entering Spi Streaming mode"); + goto cleanup; + } + + /* Read Stream binary file */ + for (chunkIndex = 0U; chunkIndex < numFileChunks; ++chunkIndex) + { + if (ADI_LIBRARY_FREAD(&streamBinaryImageBuffer[0U], BIN_ELEMENT_SIZE, ADI_ADRV903X_STREAM_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES, streamBinaryFilePtr) < ADI_ADRV903X_STREAM_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numFileChunks, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + /* Write Stream binary */ + recoveryAction = adi_adrv903x_StreamImageWrite( device, + (chunkIndex * ADI_ADRV903X_STREAM_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES), + &streamBinaryImageBuffer[0U], + ADI_ADRV903X_STREAM_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue During Binary Loading (e.g. SPI Issue)"); + goto cleanup; + } + } + + +cleanup : + if (streamBinaryFilePtr != NULL) + { + /* Close Stream binary file */ + if (0 != ADI_LIBRARY_FCLOSE(streamBinaryFilePtr)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot Close Stream Image File"); + } + } + + if (device->devStateInfo.spiStreamingOn == ADI_TRUE) + { + if (ADI_ADRV903X_ERR_ACT_NONE != adrv903x_SpiStreamingExit(device)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_INTERFACE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Spi Streaming Exit Issue"); + } + } + + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainTableLoad(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxGainTableInfo_t rxGainTableInfo[], + const uint32_t rxGainTableArrSize) +{ + const uint8_t LINE_BUFFER_SIZE = 128U; + const uint8_t HEADER_BUFFER_SIZE = 16U; + const uint8_t NUM_COLUMNS = 5U; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t arrayIndex = 0U; + uint8_t minGainIndex = 0U; + uint8_t maxGainIndex = 0U; + uint8_t prevGainIndex = 0U; + uint8_t gainIndex = 0U; + uint16_t lineCount = 0U; + FILE* rxGainTableFilePtr = NULL; + char rxGainTableLineBuffer[LINE_BUFFER_SIZE]; + char headerStr1[HEADER_BUFFER_SIZE]; + char headerStr2[HEADER_BUFFER_SIZE]; + char headerStr3[HEADER_BUFFER_SIZE]; + char headerStr4[HEADER_BUFFER_SIZE]; + char headerStr5[HEADER_BUFFER_SIZE]; + adi_adrv903x_RxGainTableRow_t rxGainTableRowBuffer[ADI_ADRV903X_RX_GAIN_TABLE_SIZE_ROWS]; + adi_adrv903x_Version_t tableVersion = { 0, 0, 0, 0 }; + uint32_t checksum[4U] = { 0, 0, 0, 0 }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + if (0U == rxGainTableArrSize) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableArrSize, "Invalid Array Size"); + goto cleanup; + } + + for (arrayIndex = 0U; arrayIndex < rxGainTableArrSize; ++arrayIndex) + { + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxGainTableInfo[arrayIndex].filePath, cleanup); + + if (0U == rxGainTableInfo[arrayIndex].channelMask) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableInfo[arrayIndex].channelMask, "Invalid Rx Gain Table Channel Mask Detected"); + goto cleanup; + } + + if (ADI_LIBRARY_STRNLEN((const char*)rxGainTableInfo[arrayIndex].filePath, ADI_ADRV903X_MAX_FILE_LENGTH) == ADI_ADRV903X_MAX_FILE_LENGTH) + { + /* Path is not terminated */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableInfo[arrayIndex].filePath, "Unterminated path string"); + goto cleanup; + } + + /* Open Rx Gain Table CSV file */ +#ifdef __GNUC__ + rxGainTableFilePtr = ADI_LIBRARY_FOPEN((const char *)rxGainTableInfo[arrayIndex].filePath, "r"); +#else + if (ADI_LIBRARY_FOPEN_S(&rxGainTableFilePtr, (const char *)rxGainTableInfo[arrayIndex].filePath, "r") != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableInfo[arrayIndex].filePath, "File is already Open or Invalid CSV File/Path Detected"); + goto cleanup; + } +#endif + if (rxGainTableFilePtr == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableInfo[arrayIndex].filePath, "File is already Open or Invalid CSV File/Path Detected"); + goto cleanup; + } + + + + /* Check for empty Rx Gain Table */ + if (ADI_LIBRARY_FGETS(rxGainTableLineBuffer, sizeof(rxGainTableLineBuffer), rxGainTableFilePtr) != NULL) + { + + /* Parse the first line of the Rx Gain Table file which contains the version info */ +#ifdef __GNUC__ +#ifdef __KERNEL__ + /* Copy the substring before the comma, should be Version */ + strncpy(headerStr1, rxGainTableLineBuffer, 7); + if (sscanf(rxGainTableLineBuffer, + "Version,%u,%u,%u,%u", + (uint32_t*)&tableVersion.majorVer, + (uint32_t*)&tableVersion.minorVer, + (uint32_t*)&tableVersion.maintenanceVer, + (uint32_t*)&tableVersion.buildVer) != (NUM_COLUMNS - 1)) +#else + if (sscanf(rxGainTableLineBuffer, + "%[^,],%u,%u,%u,%u", + headerStr1, + (uint32_t*)&tableVersion.majorVer, + (uint32_t*)&tableVersion.minorVer, + (uint32_t*)&tableVersion.maintenanceVer, + (uint32_t*)&tableVersion.buildVer) != NUM_COLUMNS) +#endif +#else + if (sscanf_s(rxGainTableLineBuffer, + "%[^,],%d,%d,%d,%d", + headerStr1, + (uint32_t)sizeof(headerStr1), + &version.majorVer, + &version.minorVer, + &version.maintenanceVer, + &version.buildVer) != NUM_COLUMNS) +#endif + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableInfo[arrayIndex].filePath, "Invalid Rx Gain Table Format Detected"); + goto cleanup; + } + + /* Verify that Gain Table Version Format is correct */ + if (ADI_LIBRARY_STRSTR(headerStr1, "Version") == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, headerStr1, "Version Column Expected First"); + goto cleanup; + } + + +#if ADI_ADRV903X_API_VERSION_RANGE_CHECK > 0 + { + adi_adrv903x_Version_t currentVersion = { 0U, 0U, 0U, 0U }; + + recoveryAction = adi_adrv903x_ApiVersionGet(device, ¤tVersion); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxGainTable Version Get Issue"); + goto cleanup; + } + + recoveryAction = adrv903x_ApiVersionRangeCheck(device, &tableVersion, ¤tVersion, ¤tVersion); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RxGainTable Version Check Issue"); + goto cleanup; + } + } +#endif + + if (ADI_LIBRARY_FGETS(rxGainTableLineBuffer, sizeof(rxGainTableLineBuffer), rxGainTableFilePtr) == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableFilePtr, "Empty Rx Gain Table Detected"); + goto cleanup; + } + + /* Parse the second line of the Rx Gain Table file which contains the checksum info */ +#ifdef __GNUC__ +#ifdef __KERNEL__ + /* Copy the substring before the comma, should be Version */ + strncpy(headerStr1, rxGainTableLineBuffer, 8); + if (sscanf(rxGainTableLineBuffer, + "Checksum,%u,%u,%u,%u", + (uint32_t*)&checksum[0], + (uint32_t*)&checksum[1], + (uint32_t*)&checksum[2], + (uint32_t*)&checksum[3]) != NUM_COLUMNS -1) +#else + if (sscanf(rxGainTableLineBuffer, + "%[^,],%u,%u,%u,%u", + headerStr1, + (uint32_t*)&checksum[0], + (uint32_t*)&checksum[1], + (uint32_t*)&checksum[2], + (uint32_t*)&checksum[3]) != NUM_COLUMNS) +#endif +#else + if (sscanf_s(rxGainTableLineBuffer, + "%[^,],%d,%d,%d,%d", + headerStr1, + (uint32_t)sizeof(headerStr1), + &checksum[0], + &checksum[1], + &checksum[2], + &checksum[3]) != NUM_COLUMNS) +#endif + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableInfo[arrayIndex].filePath, "Invalid Rx Gain Table Format Detected"); + goto cleanup; + } + + /* Verify that Gain Table Version Format is correct */ + if (ADI_LIBRARY_STRSTR(headerStr1, "Checksum") == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, headerStr1, "Checksum Column Expected First"); + goto cleanup; + } + + if (ADI_LIBRARY_FGETS(rxGainTableLineBuffer, sizeof(rxGainTableLineBuffer), rxGainTableFilePtr) == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableFilePtr, "Empty Rx Gain Table Detected"); + goto cleanup; + } + + /* Parse the third line of the Rx Gain Table file which contains header strings for each column in the table */ +#ifdef __GNUC__ + if (sscanf( rxGainTableLineBuffer, + "%[^,],%[^,],%[^,],%[^,],%[^\n]", + headerStr1, + headerStr2, + headerStr3, + headerStr4, + headerStr5) != NUM_COLUMNS) +#else + if (sscanf_s( rxGainTableLineBuffer, + "%[^,],%[^,],%[^,],%[^,],%[^\n]", + headerStr1, + (uint32_t)sizeof(headerStr1), + headerStr2, + (uint32_t)sizeof(headerStr2), + headerStr3, + (uint32_t)sizeof(headerStr3), + headerStr4, + (uint32_t)sizeof(headerStr4), + headerStr5, + (uint32_t)sizeof(headerStr5)) != NUM_COLUMNS) +#endif +#ifdef __KERNEL__ + for(unsigned int z = 0; z < HEADER_BUFFER_SIZE; z++) { + headerStr1[z] = '\0'; + headerStr2[z] = '\0'; + headerStr3[z] = '\0'; + headerStr4[z] = '\0'; + headerStr5[z] = '\0'; + } + + strncpy(headerStr1, rxGainTableLineBuffer, 10); + strncpy(headerStr2, &rxGainTableLineBuffer[11], 15); + strncpy(headerStr3, &rxGainTableLineBuffer[27], 11); + strncpy(headerStr4, &rxGainTableLineBuffer[39], 12); + strncpy(headerStr5, &rxGainTableLineBuffer[52], 12); +#else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableInfo[arrayIndex].filePath, "Invalid Rx Gain Table Format Detected"); + goto cleanup; + } +#endif + + /* Verify that Gain Table Format is correct */ + if (ADI_LIBRARY_STRSTR(headerStr1, "Gain Index") == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, headerStr1, "Gain Index Column Expected First"); + goto cleanup; + } + + if (ADI_LIBRARY_STRSTR(headerStr2, "FE Control Word") == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, headerStr2, "FE Control Column Expected Second"); + goto cleanup; + } + + if (ADI_LIBRARY_STRSTR(headerStr3, "Ext Control") == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, headerStr3, "Ext Control Column Expected Third"); + goto cleanup; + } + + if (ADI_LIBRARY_STRSTR(headerStr4, "Phase Offset") == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, headerStr4, "Phase Offset Column Expected Fourth"); + goto cleanup; + } + + if (ADI_LIBRARY_STRSTR(headerStr5, "Digital Gain") == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, headerStr5, "Digital Gain Column Expected Fifth"); + goto cleanup; + } + + /* Put the part into streaming mode to help facilitate the large, contiguous SPI writes in CpuImageWrite */ + recoveryAction = adrv903x_SpiStreamingEntry(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue with entering Spi Streaming mode"); + goto cleanup; + } + + /* Clear line counter */ + lineCount = 0U; + + /* Loop until the gain table end is reached or no. of lines scanned exceeds maximum */ + while ((ADI_LIBRARY_FGETS(rxGainTableLineBuffer, sizeof(rxGainTableLineBuffer), rxGainTableFilePtr) != NULL) && + (lineCount < ADI_ADRV903X_RX_GAIN_TABLE_SIZE_ROWS)) + { +#ifdef __GNUC__ + if (sscanf(rxGainTableLineBuffer, + "%hhu,%hhu,%hhu,%hu,%hd", + &gainIndex, + &rxGainTableRowBuffer[lineCount].rxFeGain, + &rxGainTableRowBuffer[lineCount].extControl, + &rxGainTableRowBuffer[lineCount].phaseOffset, + &rxGainTableRowBuffer[lineCount].digGain) != NUM_COLUMNS) +#else + if (sscanf_s(rxGainTableLineBuffer, + "%hhu,%hhu,%hhu,%hu,%hd", + &gainIndex, + &rxGainTableRowBuffer[lineCount].rxFeGain, + &rxGainTableRowBuffer[lineCount].extControl, + &rxGainTableRowBuffer[lineCount].phaseOffset, + &rxGainTableRowBuffer[lineCount].digGain) != NUM_COLUMNS) +#endif + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gainIndex, "Insufficient entries in Rx gain table row entry"); + goto cleanup; + } + + if (lineCount == 0U) + { + minGainIndex = gainIndex; + } + else + { + /* Check that gain indices are arranged in ascending order */ + if (prevGainIndex != (gainIndex - 1U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, gainIndex, "Gain Indices not in Ascending Order"); + goto cleanup; + } + } + + prevGainIndex = gainIndex; + lineCount++; + } + + maxGainIndex = gainIndex; + + recoveryAction = adi_adrv903x_RxGainTableWrite( device, + (rxGainTableInfo[arrayIndex].channelMask & device->devStateInfo.initializedChannels), + maxGainIndex, + &rxGainTableRowBuffer[0U], + lineCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue with RX Gain Table Writing"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_RxMinMaxGainIndexSet( device, + (rxGainTableInfo[arrayIndex].channelMask & device->devStateInfo.initializedChannels), + minGainIndex, + maxGainIndex); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue with Setting Min/Max Gain Index"); + goto cleanup; + } + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableFilePtr, "Empty Rx Gain Table Detected"); + goto cleanup; + } + + /* Close Rx Gain Table csv file, (part of for loop) */ + if (0 == ADI_LIBRARY_FCLOSE(rxGainTableFilePtr)) + { + rxGainTableFilePtr = NULL; + } + else + { + rxGainTableFilePtr = NULL; + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot Close CSV File"); + goto cleanup; + } + } + +cleanup : + if (rxGainTableFilePtr != NULL) + { + /* Close Rx Gain Table csv file */ + if (0 != ADI_LIBRARY_FCLOSE(rxGainTableFilePtr)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot Close CSV File"); + } + } + + if (device->devStateInfo.spiStreamingOn == ADI_TRUE) + { + if (ADI_ADRV903X_ERR_ACT_NONE != adrv903x_SpiStreamingExit(device)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_INTERFACE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Spi Streaming Exit Issue"); + } + } + + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuProfileImageLoad(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuProfileBinaryInfo_t* const cpuProfileBinaryInfoPtr) +{ + const size_t BIN_ELEMENT_SIZE = 1U; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + FILE* cpuProfileFilePtr = NULL; + uint32_t totalFileSize = 0U; + uint32_t numFileChunks = 0U; + uint32_t chunkIndex = 0U; + uint32_t byteCount = 0U; + uint8_t cpuProfileBinaryImageBuffer[ADI_ADRV903X_CPU_PROFILE_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES]; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuProfileBinaryInfoPtr, cleanup); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuProfileBinaryInfoPtr->filePath, cleanup); + + if (ADI_LIBRARY_STRNLEN((const char*)cpuProfileBinaryInfoPtr->filePath, ADI_ADRV903X_MAX_FILE_LENGTH) == ADI_ADRV903X_MAX_FILE_LENGTH) + { + /* Path is not terminated */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileBinaryInfoPtr->filePath, "Unterminated path string"); + goto cleanup; + } + + /* Open ARM binary file */ +#ifdef __GNUC__ + cpuProfileFilePtr = ADI_LIBRARY_FOPEN((const char *)cpuProfileBinaryInfoPtr->filePath, "rb"); +#else + if (ADI_LIBRARY_FOPEN_S(&cpuProfileFilePtr, (const char *)cpuProfileBinaryInfoPtr->filePath, "rb") != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileBinaryInfoPtr->filePath, "Unable to open CPU Profile Binary. Please check filepath is correct"); + goto cleanup; + } +#endif + + if (NULL == cpuProfileFilePtr) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to open CPU Profile Binary. Please check filepath is correct") + goto cleanup; + } + + /* Determine file size */ + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, 0U, SEEK_END) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Seek to EOF Failed"); + goto cleanup; + } + + /* ADI_LIBRARY_FTELL returns long type */ + totalFileSize = (uint32_t) ADI_LIBRARY_FTELL(cpuProfileFilePtr); + + /* Check that FW binary file is not empty */ + if (0U == totalFileSize) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, totalFileSize, "Zero Length CPU Profile Binary Detected"); + goto cleanup; + } + + /* Check that FW Profile binary file size is not smaller than server size */ + if (totalFileSize < ADRV903X_DEVICE_PROFILE_SIZE_BYTES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, totalFileSize, "CPU Profile Binary Size smaller than Server ADRV903X_DEVICE_PROFILE_SIZE_BYTES"); + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, ADRV903X_DEVICE_PROFILE_SIZE_BYTES, "ADRV903X_DEVICE_PROFILE_SIZE_BYTES bigger than CPU Profile Binary Size"); + goto cleanup; + } + + /*check if the CPU Profile Binary Image Size is perfectly divisible by the chunk size*/ + if ((ADRV903X_DEVICE_PROFILE_SIZE_BYTES & 0x3U) != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Incorrect CPU Profile Binary Structure Size"); + goto cleanup; + } + + /* Calculate the number of chunks to be written for radio profile */ + numFileChunks = (uint32_t)(ADRV903X_DEVICE_PROFILE_SIZE_BYTES / ADI_ADRV903X_CPU_PROFILE_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES) + 1; + + /* Rewind the file pointer to beginning of the file */ + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, 0U, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + /* Put the part into streaming mode to help facilitate the large, contiguous SPI writes in CpuImageWrite */ + recoveryAction = adrv903x_SpiStreamingEntry(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue with entering Spi Streaming mode"); + goto cleanup; + } + + /* Read ARM binary file */ + for (chunkIndex = 0U; chunkIndex < numFileChunks; ++chunkIndex) + { + if ((byteCount = ADI_LIBRARY_FREAD(&cpuProfileBinaryImageBuffer[0U], BIN_ELEMENT_SIZE, ADI_ADRV903X_CPU_PROFILE_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES, cpuProfileFilePtr)) > 0) + { + /* In case the bin file has also the Init_t and PostMcsInit_t, keep the last chunkSize only the part belonging to profile */ + if (chunkIndex == (numFileChunks - 1U)) + { + byteCount = ADRV903X_DEVICE_PROFILE_SIZE_BYTES - (chunkIndex) * ADI_ADRV903X_CPU_PROFILE_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES; + } + + /* Write the CPU Profile binary chunk */ + recoveryAction = adi_adrv903x_CpuProfileWrite( device, + (chunkIndex * ADI_ADRV903X_CPU_PROFILE_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES), + &cpuProfileBinaryImageBuffer[0U], + byteCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue during CPU Profile Write"); + goto cleanup; + } + } + else if (ADI_LIBRARY_FERROR(cpuProfileFilePtr)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, numFileChunks, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + } + +cleanup: + if (cpuProfileFilePtr != NULL) + { + /* Close CPU Profile binary file */ + if (0 != ADI_LIBRARY_FCLOSE(cpuProfileFilePtr)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot Close CPU Profile Binary File"); + } + } + + if (device->devStateInfo.spiStreamingOn == ADI_TRUE) + { + if (ADI_ADRV903X_ERR_ACT_NONE != adrv903x_SpiStreamingExit(device)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_INTERFACE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Spi Streaming Exit Issue"); + } + } + + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeviceInfoExtract(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuProfileBinaryInfo_t* const cpuProfileBinaryInfoPtr) +{ + typedef struct { + adrv903x_TxConfig_t txConfig; + adrv903x_RxConfig_t rxConfig; + adrv903x_OrxConfig_t orxConfig; + adrv903x_JesdSettings_t jesdProfile; + } configs_t; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + FILE* cpuProfileFilePtr = NULL; + uint32_t fileSize = 0U; + adrv903x_DeviceProfile_t* const deviceProfile = NULL; + uint32_t offset = 0U; + uint32_t readSize = 0U; + uint32_t idx = 0U; + uint32_t bandIdx = 0U; + uint32_t targetIdx = 0U; + uint32_t digMask = 0U; + + ADI_PLATFORM_LARGE_VAR_ALLOC(configs_t, config); + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuProfileBinaryInfoPtr, cleanup); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuProfileBinaryInfoPtr->filePath, cleanup); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, config, cleanup); + + if (ADI_LIBRARY_STRNLEN((const char*)cpuProfileBinaryInfoPtr->filePath, ADI_ADRV903X_MAX_FILE_LENGTH) == ADI_ADRV903X_MAX_FILE_LENGTH) + { + /* Path is not terminated */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileBinaryInfoPtr->filePath, "Unterminated path string"); + goto cleanup; + } + + /* Open ARM binary file */ +#ifdef __GNUC__ + cpuProfileFilePtr = ADI_LIBRARY_FOPEN((const char *)cpuProfileBinaryInfoPtr->filePath, "rb"); +#else + if (ADI_LIBRARY_FOPEN_S(&cpuProfileFilePtr, (const char *)cpuProfileBinaryInfoPtr->filePath, "rb") != 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileBinaryInfoPtr->filePath, "Unable to open CPU Profile Binary. Please check filepath is correct"); + goto cleanup; + } +#endif + + if (NULL == cpuProfileFilePtr) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to open CPU Profile Binary. Please check filepath is correct") + goto cleanup; + } + + /* Determine file size */ + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, 0U, SEEK_END) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Seek to EOF Failed"); + goto cleanup; + } + + /* ADI_LIBRARY_FTELL returns long type */ + fileSize = (uint32_t) ADI_LIBRARY_FTELL(cpuProfileFilePtr); + + /* Check that FW binary file is not empty */ + if (0U == fileSize) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, fileSize, "Zero Length CPU Profile Binary Detected"); + goto cleanup; + } + + /* Check that FW Profile binary file size is not smaller than server size */ + if (fileSize < ADRV903X_DEVICE_PROFILE_SIZE_BYTES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, fileSize, "CPU Profile Binary Size smaller than Server ADRV903X_DEVICE_PROFILE_SIZE_BYTES"); + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, ADRV903X_DEVICE_PROFILE_SIZE_BYTES, "ADRV903X_DEVICE_PROFILE_SIZE_BYTES bigger than CPU Profile Binary Size"); + goto cleanup; + } + + /* Clear all variables */ + ADI_LIBRARY_MEMSET(&device->initExtract, 0, sizeof(device->initExtract)); + + /* Read scaled device clock frequency */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, deviceClkScaledFreq_kHz); + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((adrv903x_VariableFromFileExtract(device, &device->initExtract.clocks.deviceClockScaled_kHz, sizeof(deviceProfile->radioProfile.deviceClkScaledFreq_kHz), 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + /* Read Pad Divider */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, padDiv); + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((adrv903x_VariableFromFileExtract(device, &device->initExtract.clocks.padDivideRatio, sizeof(deviceProfile->radioProfile.padDiv), 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + /* Read armClkDiv */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, armClkDiv); + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((adrv903x_VariableFromFileExtract(device, &device->initExtract.clocks.armClkDivideRatio, sizeof(deviceProfile->radioProfile.armClkDiv), 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + /* Read DevClk armClkDiv */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, armClkDivDevClk); + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((adrv903x_VariableFromFileExtract(device, &device->initExtract.clocks.armClkDevClkDivRatio, sizeof(deviceProfile->radioProfile.armClkDivDevClk), 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + /* Read chanConfig */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, chanConfig); + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((adrv903x_VariableFromFileExtract(device, &device->initExtract.rx.rxInitChannelMask, sizeof(deviceProfile->radioProfile.chanConfig), 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + device->initExtract.tx.txInitChannelMask = device->initExtract.rx.rxInitChannelMask & ADI_ADRV903X_TXALL; + device->initExtract.rx.rxInitChannelMask = (device->initExtract.rx.rxInitChannelMask >> 8) & (ADI_ADRV903X_RX_MASK_ALL | ADI_ADRV903X_ORX_MASK_ALL); + + /* Read rxTxCpuConfig */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, rxTxCpuConfig); + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((adrv903x_VariableFromFileExtract(device, &device->initExtract.rxTxCpuConfig[0], sizeof(deviceProfile->radioProfile.rxTxCpuConfig), 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + /* Read orxCpuConfig */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, orxCpuConfig); + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((adrv903x_VariableFromFileExtract(device, &device->initExtract.orxCpuConfig[0], sizeof(deviceProfile->radioProfile.orxCpuConfig), 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + /* Read chanAssign */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, chanAssign); + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((adrv903x_VariableFromFileExtract(device, &device->initExtract.chanAssign[0], sizeof(deviceProfile->radioProfile.chanAssign), 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + /* Read hsDigClk_kHz */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, hsDigFreq_kHz); + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((ADI_LIBRARY_FREAD(&device->initExtract.clocks.hsDigClk_kHz, sizeof(deviceProfile->radioProfile.hsDigFreq_kHz), 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + /* Read feature mask */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, featureMask); + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((ADI_LIBRARY_FREAD(&device->initExtract.featureMask[0], sizeof(deviceProfile->radioProfile.featureMask), 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + /* Read JESD Profile */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, jesdProfile); + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((ADI_LIBRARY_FREAD(&config->jesdProfile, sizeof(deviceProfile->radioProfile.jesdProfile), 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.rxdesQhfrate, config->jesdProfile.rxdesQhfrate); + + for (idx = 0U; idx < ADI_ADRV903X_MAX_FRAMERS; idx++) + { + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.framerSetting[idx].iqRate_kHz, config->jesdProfile.framer[idx].iqRate_kHz) ; + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.framerSetting[idx].laneRate_kHz, config->jesdProfile.framer[idx].laneRate_kHz) ; + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.framerSetting[idx].jesdM, config->jesdProfile.framer[idx].M) ; + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.framerSetting[idx].jesdNp, config->jesdProfile.framer[idx].Np) ; + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.framerSetting[idx].serialLaneEnabled, config->jesdProfile.framer[idx].serializerLanesEnabled) ; + } + + for (idx = 0U; idx < ADI_ADRV903X_MAX_DEFRAMERS; idx++) + { + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.deframerSetting[idx].iqRate_kHz, config->jesdProfile.deframer[idx].iqRate_kHz) ; + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.deframerSetting[idx].laneRate_kHz, config->jesdProfile.deframer[idx].laneRate_kHz) ; + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.deframerSetting[idx].deserialLaneEnabled, config->jesdProfile.deframer[idx].deserializerLanesEnabled) ; + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.deframerSetting[idx].jesdM, config->jesdProfile.deframer[idx].M); + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.deframerSetting[idx].jesdNp, config->jesdProfile.deframer[idx].Np); + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.deframerSetting[idx].interleavingEnabled, config->jesdProfile.deframer[idx].interleavingEnabled); + } + + for (idx = 0U; idx < ADI_ADRV903X_MAX_FRAMERS_LS; idx++) + { + if (config->jesdProfile.linkSharingCfg[idx].linkSharingEnabled == ADI_ENABLE) + { + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.framerLsSetting[idx].jesdM, config->jesdProfile.linkSharingCfg[idx].M) ; + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.framerLsSetting[idx].jesdNp, config->jesdProfile.linkSharingCfg[idx].Np) ; + } + else + { + device->initExtract.jesdSetting.framerLsSetting[idx].jesdM = 0; + device->initExtract.jesdSetting.framerLsSetting[idx].jesdNp = 0; + } + } + + for (idx = 0U; idx < ADRV903X_JESD_MAX_LKSH_SAMPLE_XBAR_IDX; idx++) + { + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.framerLsSetting[0].linkLsSampleXBar[idx], config->jesdProfile.linkSharingCfg[0].sampleXBar[idx]) ; + VARIABLE_ASSIGNMENT(device->initExtract.jesdSetting.framerLsSetting[1].linkLsSampleXBar[idx], config->jesdProfile.linkSharingCfg[1].sampleXBar[idx]) ; + } + + /* Read CPU ID that maps a deserializer lane to CPU0/1 for SERDES cals */ + for (idx = 0U; idx < ADI_ADRV903X_MAX_SERDES_LANES; idx++) + { + VARIABLE_ASSIGNMENT(device->initExtract.jesd204DesLaneCpuConfig[idx], config->jesdProfile.deserializerLane[idx].cpuId) ; + } + + for (idx = 0U; idx < ADRV903X_NUM_TXRX_CHAN; idx++) + { + + readSize = sizeof(config->rxConfig); + switch (device->initExtract.chanAssign[idx]) + { + case 0U: + /* Read rxConfig[0]*/ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, rxConfig[0U]); + break; + + case 1U: + /* Read rxConfig[1]*/ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, rxConfig[1U]); + break; + case 2U: + /* Read rxConfig[2]*/ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, rxConfig[2U]); + break; + case 3U: + /* Read rxConfig[3]*/ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, rxConfig[3U]); + break; + case 255U: + /* Channel disabled */ + offset = 0; + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + break; + } + + + if (offset == 0U) + { /* channel disabled */ + device->initExtract.rx.rxChannelCfg[idx].rfBandwidth_kHz = 0U; + device->initExtract.rx.rxChannelCfg[idx].rxDdc0OutputRate_kHz = 0U; + device->initExtract.rx.rxChannelCfg[idx].rxDdc1OutputRate_kHz = 0U; + device->initExtract.rx.rxChannelCfg[idx].digChanMask = 0U; + device->initExtract.rx.rxChannelCfg[idx].rxAdcSampleRate_kHz = 0U; + } + else + { + uint32_t totalDecimationDDC1 = 0U; + uint32_t totalDecimationDDC0 = 0U; + uint32_t rxOutputRate_kHz = 0U; + uint8_t rxBandEnbDDC0 = 0U; + uint8_t rxBandEnbDDC1 = 0U; + + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((ADI_LIBRARY_FREAD(&config->rxConfig, readSize, 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + VARIABLE_ASSIGNMENT(totalDecimationDDC1, config->rxConfig.rxddc[1].totalDecimation); + VARIABLE_ASSIGNMENT(totalDecimationDDC0, config->rxConfig.rxddc[0].totalDecimation); + VARIABLE_ASSIGNMENT(rxOutputRate_kHz, config->rxConfig.rxOutputRate_kHz); + VARIABLE_ASSIGNMENT(rxBandEnbDDC0, config->rxConfig.rxddc[0].rxBandEnb); + VARIABLE_ASSIGNMENT(rxBandEnbDDC1, config->rxConfig.rxddc[1].rxBandEnb); + + if (config->rxConfig.rxddc[1].rxBandEnb == 0U) + { + VARIABLE_ASSIGNMENT(device->initExtract.rx.rxChannelCfg[idx].rxDdc0OutputRate_kHz, config->rxConfig.rxOutputRate_kHz) ; + device->initExtract.rx.rxChannelCfg[idx].rxDdc1OutputRate_kHz = 0U; + + } + else if (totalDecimationDDC1 > totalDecimationDDC0) + { + //Band 0 has lower totalDecimation + device->initExtract.rx.rxChannelCfg[idx].rxDdc0OutputRate_kHz = rxOutputRate_kHz; + device->initExtract.rx.rxChannelCfg[idx].rxDdc1OutputRate_kHz = (rxOutputRate_kHz * totalDecimationDDC0) / totalDecimationDDC1 ; + } + else + { + //Band 1 has lower totalDecimation + device->initExtract.rx.rxChannelCfg[idx].rxDdc0OutputRate_kHz = (rxOutputRate_kHz * totalDecimationDDC1) / totalDecimationDDC0; + device->initExtract.rx.rxChannelCfg[idx].rxDdc1OutputRate_kHz = rxOutputRate_kHz; + } + + for (bandIdx = 0U; bandIdx < ADI_ADRV903X_DDC_NUM_BAND; bandIdx++) + { + if (config->rxConfig.rxddc[bandIdx].rxBandEnb == 1U) + { + uint32_t ncoFreqin_kHz = 0U; + uint32_t ibwCenterFreq_kHz = 0U; + uint32_t rfCenterFreq_kHz = 0U; + VARIABLE_ASSIGNMENT(ncoFreqin_kHz, config->rxConfig.rxddc[bandIdx].ncoFreqin_kHz); + VARIABLE_ASSIGNMENT(ibwCenterFreq_kHz, config->rxConfig.ibwCenterFreq_kHz); + VARIABLE_ASSIGNMENT(rfCenterFreq_kHz, config->rxConfig.rxddc[bandIdx].rfCenterFreq_kHz); + + device->initExtract.rx.rxChannelCfg[idx].bandSettings[bandIdx].enabled = ADI_TRUE; + VARIABLE_ASSIGNMENT(device->initExtract.rx.rxChannelCfg[idx].bandSettings[bandIdx].instBw_kHz, config->rxConfig.rxddc[bandIdx].instBw_kHz); + VARIABLE_ASSIGNMENT(device->initExtract.rx.rxChannelCfg[idx].bandSettings[bandIdx].rfCenterFreq_kHz, config->rxConfig.rxddc[bandIdx].rfCenterFreq_kHz); + device->initExtract.rx.rxChannelCfg[idx].bandSettings[bandIdx].sampleRate_kHz = device->initExtract.clocks.hsDigClk_kHz / (1U << config->rxConfig.rxddc[bandIdx].hb1OutputClkDiv); + device->initExtract.rx.rxChannelCfg[idx].bandSettings[bandIdx].bandOffset_kHz = ncoFreqin_kHz - (ibwCenterFreq_kHz - rfCenterFreq_kHz); + } + else + { + device->initExtract.rx.rxChannelCfg[idx].bandSettings[bandIdx].enabled = ADI_FALSE; + device->initExtract.rx.rxChannelCfg[idx].bandSettings[bandIdx].instBw_kHz = 0U; + device->initExtract.rx.rxChannelCfg[idx].bandSettings[bandIdx].rfCenterFreq_kHz = 0U; + device->initExtract.rx.rxChannelCfg[idx].bandSettings[bandIdx].sampleRate_kHz = 0U; + device->initExtract.rx.rxChannelCfg[idx].bandSettings[bandIdx].bandOffset_kHz = 0U; + } + } + + VARIABLE_ASSIGNMENT(device->initExtract.rx.rxChannelCfg[idx].rfBandwidth_kHz, config->rxConfig.ibw_kHz) ; + VARIABLE_ASSIGNMENT(device->initExtract.rx.rxChannelCfg[idx].rxAdcSampleRate_kHz, config->rxConfig.adcClockRate_kHz) ; + digMask = rxBandEnbDDC1; + digMask <<= 1; + digMask |= rxBandEnbDDC0; + device->initExtract.rx.rxChannelCfg[idx].digChanMask = digMask; + } + } + + for (idx = 0U; idx < ADI_ADRV903X_MAX_ORX; idx++) + { + readSize = sizeof(config->orxConfig); + switch (idx) + { + case 0U: + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, orxConfig[0U]); + break; + case 1U: + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, orxConfig[1U]); + break; +#if ADI_ADRV903X_MAX_ORX > 2 + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; +#endif + } + + targetIdx = idx; + + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((ADI_LIBRARY_FREAD(&config->orxConfig, readSize, 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + VARIABLE_ASSIGNMENT(device->initExtract.orx.orxChannelCfg[targetIdx].rfBandwidth_kHz, config->orxConfig.sbw_kHz) ; + VARIABLE_ASSIGNMENT(device->initExtract.orx.orxChannelCfg[targetIdx].orxOutputRate_kHz, config->orxConfig.orxOutputRate_kHz) ; + VARIABLE_ASSIGNMENT(device->initExtract.orx.orxChannelCfg[targetIdx].orxAdcSampleRate_kHz, config->orxConfig.adcClockRate_kHz) ; + } + + for (idx = 0U; idx < ADRV903X_NUM_TXRX_CHAN; idx++) + { + + readSize = sizeof(config->txConfig); + switch (device->initExtract.chanAssign[idx]) + { + case 0U: + /* Read txConfig[0] */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, txConfig[0U]); + break; + + case 1U: + /* Read txConfig[1] */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, txConfig[1U]); + break; + case 2U: + /* Read txConfig[2] */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, txConfig[2U]); + break; + case 3U: + /* Read txConfig[3] */ + offset = ADI_LIBRARY_OFFSETOF(adrv903x_RadioProfile_t, txConfig[3U]); + break; + case 255U: + /* Channel disabled */ + offset = 0U; + break; + default: + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + break; + } + + if (offset == 0U) + { /* channel disabled */ + device->initExtract.tx.txChannelCfg[idx].rfBandwidth_kHz = 0U; + device->initExtract.tx.txChannelCfg[idx].totalDecimation = 0U; + device->initExtract.tx.txChannelCfg[idx].digChanMask = 0U; + device->initExtract.tx.txChannelCfg[idx].txLbAdcSampleRate_kHz = 0U; + device->initExtract.tx.txChannelCfg[idx].txLbAdcClkDiv = 0U; + } + else + { + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, offset, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to Rewind File Pointer for CPU Binary"); + goto cleanup; + } + + if ((ADI_LIBRARY_FREAD(&config->txConfig, readSize, 1, cpuProfileFilePtr)) <= 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + + VARIABLE_ASSIGNMENT(device->initExtract.tx.txChannelCfg[idx].rfBandwidth_kHz, config->txConfig.ibw_kHz) ; + VARIABLE_ASSIGNMENT(device->initExtract.tx.txChannelCfg[idx].totalDecimation, config->txConfig.txduc[0].totalDecimation); + VARIABLE_ASSIGNMENT(device->initExtract.tx.txChannelCfg[idx].digChanMask, config->txConfig.txduc[0].rxBandEnb); + VARIABLE_ASSIGNMENT(device->initExtract.tx.txChannelCfg[idx].txLbAdcSampleRate_kHz, config->txConfig.lpbkAdcClkRate_kHz); + /* clkDiv from profile.bin holds a bitfield value. txLbAdcClkDiv is the logical divider value. Adding 1 converts + * from bitfield value to logical value. */ + VARIABLE_ASSIGNMENT(device->initExtract.tx.txChannelCfg[idx].txLbAdcClkDiv, config->txConfig.lpbkClkGenConfig.clkDiv + 1); + + for (bandIdx = 0U; bandIdx < ADI_ADRV903X_DUC_NUM_BAND; bandIdx++) + { + if (config->txConfig.txduc[bandIdx].rxBandEnb == 1U) + { + uint8_t tinClkDiv = 0U; + uint32_t ncoFreqin_kHz = 0U; + uint32_t ibwCenterFreq_kHz = 0U; + uint32_t rfCenterFreq_kHz = 0U; + VARIABLE_ASSIGNMENT(tinClkDiv, config->txConfig.txduc[bandIdx].tinClkDiv); + VARIABLE_ASSIGNMENT(ncoFreqin_kHz, config->txConfig.txduc[bandIdx].ncoFreqin_kHz); + VARIABLE_ASSIGNMENT(ibwCenterFreq_kHz, config->txConfig.ibwCenterFreq_kHz); + VARIABLE_ASSIGNMENT(rfCenterFreq_kHz, config->txConfig.txduc[bandIdx].rfCenterFreq_kHz); + + device->initExtract.tx.txChannelCfg[idx].bandSettings[bandIdx].enabled = ADI_TRUE; + VARIABLE_ASSIGNMENT(device->initExtract.tx.txChannelCfg[idx].bandSettings[bandIdx].instBw_kHz, config->txConfig.txduc[bandIdx].instBw_kHz); + VARIABLE_ASSIGNMENT(device->initExtract.tx.txChannelCfg[idx].bandSettings[bandIdx].rfCenterFreq_kHz, config->txConfig.txduc[bandIdx].rfCenterFreq_kHz); + device->initExtract.tx.txChannelCfg[idx].bandSettings[bandIdx].sampleRate_kHz = device->initExtract.clocks.hsDigClk_kHz / (1U << tinClkDiv); + device->initExtract.tx.txChannelCfg[idx].bandSettings[bandIdx].bandOffset_kHz = ncoFreqin_kHz - (ibwCenterFreq_kHz - rfCenterFreq_kHz); + } + else + { + device->initExtract.tx.txChannelCfg[idx].bandSettings[bandIdx].enabled = ADI_FALSE; + device->initExtract.tx.txChannelCfg[idx].bandSettings[bandIdx].instBw_kHz = 0U; + device->initExtract.tx.txChannelCfg[idx].bandSettings[bandIdx].rfCenterFreq_kHz = 0U; + device->initExtract.tx.txChannelCfg[idx].bandSettings[bandIdx].sampleRate_kHz = 0U; + device->initExtract.tx.txChannelCfg[idx].bandSettings[bandIdx].bandOffset_kHz = 0U; + } + } + + VARIABLE_ASSIGNMENT(device->initExtract.tx.txChannelCfg[idx].pfirRate_kHz, config->txConfig.txPfirClk_kHz) ; + + + if (device->initExtract.tx.txChannelCfg[idx].totalDecimation > 8U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Error Reading Block of Data from CPU Binary File"); + goto cleanup; + } + } + } + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup: + if (cpuProfileFilePtr != NULL) + { + /* Close CPU Profile binary file */ + if (0 != ADI_LIBRARY_FCLOSE(cpuProfileFilePtr)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot Close CPU Profile Binary File"); + } + } + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_DeviceCopy(adi_adrv903x_Device_t* const deviceSrc, + adi_adrv903x_Device_t* const deviceDest) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(deviceSrc); + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(deviceDest); + + /* Ignore Common Device & SPI Settings */ + (void) ADI_LIBRARY_MEMCPY(&deviceDest->devStateInfo, &deviceSrc->devStateInfo, sizeof(adi_adrv903x_Info_t)); + (void) ADI_LIBRARY_MEMCPY(&deviceDest->initExtract, &deviceSrc->initExtract, sizeof(adi_adrv903x_InitExtract_t)); + + return recoveryAction; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_PreMcsInit(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Init_t* const init, + const adi_adrv903x_TrxFileInfo_t* const trxBinaryInfoPtr) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, init, cleanup); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, trxBinaryInfoPtr, cleanup); + + /* Prevent any Read Operation from device during Broadcast */ + ADI_ADRV903X_WRONLY_SET(device->common, ADI_TRUE); + + /* Extract Info from CPU Profile Binary */ + recoveryAction = adi_adrv903x_DeviceInfoExtract(device, &trxBinaryInfoPtr->cpuProfile); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue during CPU Profile Binary Image Extract"); + goto cleanup; + } + + /* Initialize TRX Device */ + recoveryAction = adi_adrv903x_Initialize(device, init); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "TRX Device Initialization Failed"); + goto cleanup; + } + + /* Load Stream Binary Image */ + recoveryAction = adi_adrv903x_StreamImageLoad(device, &trxBinaryInfoPtr->stream); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue during Stream Binary Image Loading"); + goto cleanup; + } + + /* Load CPU Binary File(s) */ + recoveryAction = adi_adrv903x_CpuImageLoad(device, &trxBinaryInfoPtr->cpu); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue during CPU Binary Image Loading"); + goto cleanup; + } + + /* Load CPU Profile Binary */ + recoveryAction = adi_adrv903x_CpuProfileImageLoad(device, &trxBinaryInfoPtr->cpuProfile); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue during CPU Profile Binary Image Loading"); + goto cleanup; + } + + /* Load Rx Gain Table(s) */ + recoveryAction = adi_adrv903x_RxGainTableLoad(device, &trxBinaryInfoPtr->rxGainTable[0U], ADI_ADRV903X_LOAD_ALL_RXGAIN_TABLES); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue during RX Gain Table Loading"); + goto cleanup; + } + + /* CPU Bootup */ + recoveryAction = adi_adrv903x_CpuStart(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Issue during TRX CPU Start"); + goto cleanup; + } + +cleanup : + ADI_ADRV903X_WRONLY_SET(device->common, ADI_FALSE); + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_PreMcsInit_NonBroadcast(adi_adrv903x_Device_t* const device, + const adi_adrv903x_Init_t* const init) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_RxDataFormatRt_t rxDataFormatRt; + adi_adrv903x_RxGain_t rxGain; + uint32_t i = 0u; + uint32_t rxChannels[] = { + (uint32_t)ADI_ADRV903X_RX0, + (uint32_t)ADI_ADRV903X_RX1, + (uint32_t)ADI_ADRV903X_RX2, + (uint32_t)ADI_ADRV903X_RX3, + (uint32_t)ADI_ADRV903X_RX4, + (uint32_t)ADI_ADRV903X_RX5, + (uint32_t)ADI_ADRV903X_RX6, + (uint32_t)ADI_ADRV903X_RX7, + (uint32_t)ADI_ADRV903X_ORX0, + (uint32_t)ADI_ADRV903X_ORX1 + }; + + adi_adrv903x_TxAtten_t txAtten; + adi_adrv903x_TxAttenCfg_t txAttenCfg; + adi_adrv903x_PowerMonitorCfgRt_t txPowerMonitorCfg; + adi_adrv903x_SlewRateDetectorCfgRt_t txSrlCfg; + adi_adrv903x_ProtectionRampCfgRt_t txProtectionRampCfg; + uint8_t txInputInterpolation = 0U; + uint32_t chanMask = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, init, cleanup); + + ADI_LIBRARY_MEMSET(&txAtten, 0, sizeof(txAtten)); + ADI_LIBRARY_MEMSET(&txAttenCfg, 0, sizeof(txAttenCfg)); + ADI_LIBRARY_MEMSET(&txPowerMonitorCfg, 0, sizeof(txPowerMonitorCfg)); + ADI_LIBRARY_MEMSET(&txSrlCfg, 0, sizeof(txSrlCfg)); + ADI_LIBRARY_MEMSET(&txProtectionRampCfg, 0, sizeof(txProtectionRampCfg)); + ADI_LIBRARY_MEMSET(&rxDataFormatRt, 0, sizeof(rxDataFormatRt)); + ADI_LIBRARY_MEMSET(&rxGain, 0, sizeof(rxGain)); + + recoveryAction = adi_adrv903x_CpuStartStatusCheck(device, ADI_ADRV903X_GETCPUBOOTUP_TIMEOUT_US); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CPU Boot Issue"); + goto cleanup; + } + +#if ADI_ADRV903X_SPI_VERIFY + recoveryAction = adi_adrv903x_SpiVerify(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } +#endif + + recoveryAction = adi_adrv903x_DeviceRevGet(device, &(device->devStateInfo.deviceSiRev)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failure to read device silicon revision"); + goto cleanup; + } + + if (device->devStateInfo.profilesValid & ADI_ADRV903X_TX_PROFILE_VALID) + { + /* For each tx channel */ + for (i = 0U; i < ADI_ADRV903X_MAX_TXCHANNELS; ++i) + { + chanMask = 1U << i; + if (ADRV903X_BF_EQUAL(device->initExtract.tx.txInitChannelMask, chanMask) == 0) + { + /* Channel disabled - skip */ + continue; + } + + /* Tx channel is enabled */ + txAttenCfg = init->tx.txChannelCfg[i].txAttenCfg; + + recoveryAction = adi_adrv903x_TxAttenCfgSet(device, chanMask, &txAttenCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Tx Atten Configuration Failed"); + goto cleanup; + } + + txAtten.txChannelMask = chanMask; + txAtten.txAttenuation_mdB = init->tx.txChannelCfg[i].txAttenInit_mdB; + + recoveryAction = adi_adrv903x_TxAttenSet(device, &txAtten, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + if (recoveryAction != ADI_ADRV903X_ERR_ACT_RESET_FEATURE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Tx Initial Attenuation Set Failed"); + goto cleanup; + } + } + + txInputInterpolation = (uint8_t)device->initExtract.tx.txChannelCfg[i].totalDecimation; + + recoveryAction = adrv903x_TxPowerMonitorInitialize(device, chanMask, txInputInterpolation); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Tx Power Monitor Initialize Failed"); + goto cleanup; + } + + txPowerMonitorCfg.txChannelMask = chanMask; + txPowerMonitorCfg.txPowerMonitorCfg = init->tx.txChannelCfg[i].txpowerMonitorCfg; + + recoveryAction = adi_adrv903x_TxPowerMonitorCfgSet(device, &txPowerMonitorCfg, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Tx Power Protection Configuration Failed"); + goto cleanup; + } + + txSrlCfg.txChannelMask = chanMask; + txSrlCfg.srlCfg = init->tx.txChannelCfg[i].srlCfg; + + recoveryAction = adi_adrv903x_TxSlewRateDetectorCfgSet(device, &txSrlCfg, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Tx Slew Rate Detector Configuration Failed"); + goto cleanup; + } + + txProtectionRampCfg.txChannelMask = chanMask; + + txProtectionRampCfg.protectionRampCfg = init->tx.txChannelCfg[i].protectionRampCfg; + recoveryAction = adi_adrv903x_TxProtectionRampCfgSet(device, &txProtectionRampCfg, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Tx Protection Ramp Configuration Failed"); + goto cleanup; + } + } + } + + /* Initializing RX configuration */ + if (device->devStateInfo.profilesValid & ADI_ADRV903X_RX_PROFILE_VALID) + { + for (i = 0U; i < (sizeof(rxChannels) / sizeof(rxChannels[0U])); ++i) + { + if ((device->initExtract.rx.rxInitChannelMask & rxChannels[i]) > 0U) + { + /* Correct the Rx Channel Mask from the profile */ + rxDataFormatRt.rxChannelMask = rxChannels[i]; + rxDataFormatRt.rxDataFormat = init->rx.rxChannelCfg[i].rxDataFormat; + + /* Setup the Rx data formatter */ + recoveryAction = adrv903x_RxDataFormatSet(device, &rxDataFormatRt, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RX Data Format set Failed"); + goto cleanup; + } + + /* Setup Rx AGC overload protection registers */ + recoveryAction = adrv903x_RxOverloadProtectionSet(device, (adi_adrv903x_RxChannels_e)rxChannels[i]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RX Overload Protection set Failed"); + goto cleanup; + } + + if (i < ADI_ADRV903X_MAX_RX_ONLY) + { + /* Correct the Rx Channel Mask from the profile */ + rxGain.rxChannelMask = rxChannels[i]; + rxGain.gainIndex = init->rx.rxChannelCfg[i].rxGainIndexInit; + + /* Setup the Rx Gain */ + recoveryAction = adi_adrv903x_RxGainSet(device, &rxGain, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "RX Gain set Failed"); + goto cleanup; + } + } + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_PostMcsInit(adi_adrv903x_Device_t* const device, + const adi_adrv903x_PostMcsInit_t* const utilityInit) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + const uint32_t INIT_CALS_TIMEOUT_MS = 60000U; /* 60 Seconds Timeout */ + ADI_PLATFORM_LARGE_VAR_ALLOC(adi_adrv903x_InitCalErrData_t, initCalErrDataPtr); + uint8_t idx = 0U; + adi_adrv903x_RadioCtrlTxRxEnCfg_t allDisabledTxRxEnCfg; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, initCalErrDataPtr, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, utilityInit, cleanup); + + ADI_LIBRARY_MEMSET(&allDisabledTxRxEnCfg, 0, sizeof(allDisabledTxRxEnCfg)); + + /*Initialize radio control. This is required to run before running init cals*/ + /* Sets up Radio Ctrl mode for Rx/ORx/Tx signal chains (SPI vs Pin mode) */ + if ((utilityInit->radioCtrlCfg.txRadioCtrlModeCfg.txChannelMask != 0U) || + (utilityInit->radioCtrlCfg.rxRadioCtrlModeCfg.rxChannelMask != 0U) || + (utilityInit->radioCtrlCfg.orxRadioCtrlModeCfg.orxChannelMask != 0U)) + { + recoveryAction = adi_adrv903x_RadioCtrlCfgSet(device, (adi_adrv903x_RadioCtrlModeCfg_t*) &utilityInit->radioCtrlCfg); + if (ADI_ADRV903X_ERR_ACT_NONE != recoveryAction) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Radio Control Config Set Failed"); + goto cleanup; + } + } + + /* Sets up Radio Ctrl TxRx Enable Config for Pin mode (Config will be ignore in SPI mode) */ + if ((utilityInit->radioCtrlTxRxEnCfgSel != 0U) || (utilityInit->radioCtrlTxRxEnPinSel != 0U)) + { + recoveryAction = adi_adrv903x_RadioCtrlTxRxEnCfgSet(device, + &allDisabledTxRxEnCfg, + ADI_ADRV903X_TXRXEN_PINALL, + ADI_ADRV903X_TXRXEN_TX_ENABLE_MAP | ADI_ADRV903X_TXRXEN_RX_ENABLE_MAP); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Radio Control TxRxEnCfg set to default failed"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_RadioCtrlTxRxEnCfgSet(device, + &utilityInit->radioCtrlGpioCfg, + utilityInit->radioCtrlTxRxEnPinSel, + utilityInit->radioCtrlTxRxEnCfgSel); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Radio Control TxRxEnCfg Set Failed"); + goto cleanup; + } + } + + /* Sets up the GPIO pin mapping used by stream processor */ + recoveryAction = adi_adrv903x_StreamGpioConfigSet(device, &device->devStateInfo.streamGpioMapping); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Stream Gpio Config Set Failed"); + goto cleanup; + } + + /* Sets up the Tx to Orx pin mapping */ + recoveryAction = adi_adrv903x_TxToOrxMappingInit(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Tx To Orx Mapping Init Failed"); + goto cleanup; + } + + /* Initialize GP Interrupt settings for use during device initialization*/ + /* Set GP Int Pin Masks to selected states */ + recoveryAction = adi_adrv903x_GpIntPinMaskCfgSet(device, ADI_ADRV903X_GPINTALL, &utilityInit->gpIntPostInit); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing GP Interrupt Mask Array."); + goto cleanup; + } + + /* Clear all status bits */ + recoveryAction = adi_adrv903x_GpIntStatusClear(device, NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error clearing GP Interrupt Status bits."); + goto cleanup; + } + + /*Initialize cals*/ + if ((utilityInit->initCals.rxChannelMask != 0U) || + (utilityInit->initCals.txChannelMask != 0U) || + (utilityInit->initCals.orxChannelMask != 0U) || + (utilityInit->initCals.calMask != 0U)) + { + recoveryAction = adi_adrv903x_InitCalsRun(device, &utilityInit->initCals); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "InitCalsRun Failed"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_InitCalsWait_v2(device, INIT_CALS_TIMEOUT_MS, initCalErrDataPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Initial Calibration Wait Issue"); + goto cleanup; + } + + for (idx = 0; idx < ADI_ADRV903X_NUM_INIT_CAL_CHANNELS; ++idx) + { + if (initCalErrDataPtr->channel[idx].errCode != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "InitCals Error - Get More Information via Detailed Status Get"); + goto cleanup; + } + } + } + + recoveryAction = adi_adrv903x_JrxRepairInitialization(device, utilityInit->initCals.warmBoot); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Jrx repair at initialization failed"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StandbyEnter(adi_adrv903x_Device_t* const device, + adi_adrv903x_StandbyRecover_t* const standbyRecover) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint32_t txInitChMask = ((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & ADI_ADRV903X_TXALL); + uint32_t rxInitChMask = (device->devStateInfo.initializedChannels & ADI_ADRV903X_RX_MASK_ALL); + uint32_t orxInitChMask = (device->devStateInfo.initializedChannels & ADI_ADRV903X_ORX_MASK_ALL); + uint32_t trackingCal = 0U; + uint32_t trackingCalMask = 0U; + uint32_t channelMask = 0U; + uint32_t timeElapsedUs = 0U; + uint32_t index = 0U; + uint32_t cmdExecRespLength = 0U; + uint32_t regAddr = 0U; + uint16_t deserializerPdCfg = 0xFFFFU; + uint8_t regData[4] = { 0U, 0U, 0U, 0U }; + uint8_t trackingCalActive = 0U; + uint8_t lanesEnabled = 0U; + adrv903x_CpuCmd_JtxLanePower_t jtxPwrCmd; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + + adi_adrv903x_ChannelTrackingCals_t channelMaskv2; + adi_adrv903x_TrackingCalState_t trackingCalState; + + adi_adrv903x_RadioCtrlModeCfg_t radioCtrlSpiModeCfg = { + { ADI_ADRV903X_TX_EN_SPI_MODE, txInitChMask }, + { ADI_ADRV903X_RX_EN_SPI_MODE, rxInitChMask }, + { ADI_ADRV903X_ORX_EN_SPI_MODE, orxInitChMask } + }; + + adrv903x_CpuCmd_EnFastAttack_t enFastAttackCmd; + adrv903x_CpuCmd_EnFastAttackResp_t enFastAttackCmdRsp; + + const adi_adrv903x_GpIntPinMaskCfg_t pinMaskCfgAll = { + { 0xFFFFFFFFFFFFU, 0xFFFFFFFFFFFFU }, + { 0xFFFFFFFFFFFFU, 0xFFFFFFFFFFFFU } + }; + + const uint32_t TX_DAC_PWD_DOWN_I_ADDRS[ADI_ADRV903X_MAX_TXCHANNELS] = { + ADRV903X_ADDR_TX0_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX1_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX2_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX3_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX4_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX5_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX6_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX7_DAC_PWD_DOWN_I + }; + const uint32_t RX_ADC_REGMAP0_CTRL_FD_PD_ADDRS[ADI_ADRV903X_MAX_RX_ONLY] = { + ADRV903X_ADDR_RX0_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX1_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX2_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX3_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX4_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX5_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX6_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX7_ADC_REGMAP0_CTRL_FD_PD + }; + const uint32_t RX_ADC_REGMAP0_CTRL_FL_PD_ADDRS[ADI_ADRV903X_MAX_RX_ONLY] = { + ADRV903X_ADDR_RX0_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX1_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX2_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX3_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX4_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX5_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX6_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX7_ADC_REGMAP0_CTRL_FL_PD + }; + const uint32_t TX_LB_ADC_WEST_TRM_PDN_CTRL_ADDRS[ADI_ADRV903X_MAX_TXCHANNELS] = { + ADRV903X_ADDR_TX0_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX1_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX2_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX3_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX4_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX5_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX6_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX7_LB_ADC_WEST_TRM_PDN_CTRL + }; + const uint32_t TX_LB_ADC_EAST_TRM_PDN_CTRL_ADDRS[ADI_ADRV903X_MAX_TXCHANNELS] = { + ADRV903X_ADDR_TX0_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX1_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX2_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX3_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX4_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX5_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX6_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX7_LB_ADC_EAST_TRM_PDN_CTRL + }; + + const uint8_t PLL_MISC_PD_DISABLE = 0xBCU; + const uint8_t PLL_MISC_PD_KILLS_DISABLE = 0x8FU; + const uint8_t PLL_LO_GEN_SYNC_PD_DISABLE = 0xF3U; + const uint8_t TX_DAC_PD_DISABLE = 0x1CU; + const uint8_t RX_ADC_CTRL_FD_PD_DISABLE = 0x1FU; + const uint8_t RX_ADC_CTRL_FL_PD_DISABLE = 0xBFU; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, standbyRecover, cleanup); + ADI_LIBRARY_MEMSET(&jtxPwrCmd, 0U, sizeof(jtxPwrCmd)); + + if ((device->devStateInfo.devState & ADI_ADRV903X_STATE_STANDBY) == ADI_ADRV903X_STATE_STANDBY) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Device is already in Standby Mode"); + goto cleanup; + } + + /* 1. Disable GPINT IRQs */ + recoveryAction = adi_adrv903x_GpIntPinMaskCfgSet(device, ADI_ADRV903X_GPINTALL, &pinMaskCfgAll); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing GP Interrupt Mask."); + goto cleanup; + } + + /* 2. Set radio control to SPI mode */ + recoveryAction = adi_adrv903x_RadioCtrlCfgSet(device, &radioCtrlSpiModeCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error writing GP Interrupt Mask Array."); + goto cleanup; + } + + /* 3. Turn off All Channels */ + recoveryAction = adi_adrv903x_RxTxEnableGet(device, &(standbyRecover->orxEnabledMask), &(standbyRecover->rxEnabledMask), &(standbyRecover->txEnabledMask)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting enabled channels."); + goto cleanup; + } + + recoveryAction = adi_adrv903x_RxTxEnableSet(device, orxInitChMask, 0U, rxInitChMask, 0U, txInitChMask, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while disabling channels."); + goto cleanup; + } + + /* 4. Disable Tracking cals*/ + recoveryAction = adi_adrv903x_TrackingCalsEnableGet(device, &(standbyRecover->tcEnableMasks)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while storing enabled tracking cals."); + goto cleanup; + } + + for (trackingCal = (uint32_t)ADI_ADRV903X_TC_RX_QEC_MASK; trackingCal <= (uint32_t)ADI_ADRV903X_TC_ORX_ADC_MASK; trackingCal <<= 1U) + { + channelMask = 0U; + + for (index = 0U; index < ADI_ADRV903X_NUM_TRACKING_CAL_CHANNELS; index++) + { + if (standbyRecover->tcEnableMasks.enableMask[index] & trackingCal) + { + channelMask |= (1U << index); + } + } + + if (channelMask) + { + trackingCalMask |= trackingCal; + channelMaskv2.rxChannel = channelMask & 0xFFU; + channelMaskv2.txChannel = channelMask & 0xFFU; + channelMaskv2.orxChannel = channelMask & 0x03U; + channelMaskv2.laneSerdes = channelMask & 0xFFU; + recoveryAction = adi_adrv903x_TrackingCalsEnableSet_v2(device, (adi_adrv903x_TrackingCalibrationMask_e)trackingCal, &channelMaskv2, ADI_ADRV903X_TRACKING_CAL_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, trackingCal, "Error while disabling Tracking cal"); + goto cleanup; + } + } + } + + /* Poll tracking cals state to be inactive */ + for (timeElapsedUs = 0U; timeElapsedUs < ADI_ADRV903X_TRACKCALDISABLE_TIMEOUT_US; timeElapsedUs += ADI_ADRV903X_TRACKCALDISABLE_INTERVAL_US) + { + trackingCalActive = 0U; + /* Retrieve Tracking Cal state */ + recoveryAction = adi_adrv903x_TrackingCalAllStateGet(device, &trackingCalState); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting Tracking Cal State"); + goto cleanup; + } + + /* check if every tracking cal is inactive */ + for (trackingCal = (uint32_t)ADI_ADRV903X_TC_RX_QEC; trackingCal < (uint32_t)ADI_ADRV903X_TC_NUM_CALS; trackingCal++) + { + for (index = 0U; index < ADI_ADRV903X_NUM_TRACKING_CAL_CHANNELS; index++) + { + if (((standbyRecover->tcEnableMasks.enableMask[index] & (1U << trackingCal)) != 0U) && /* previously enabled */ + ((trackingCalState.calState[index][trackingCal] & ADI_ADRV903X_TC_STATE_INACTIVE) != ADI_ADRV903X_TC_STATE_INACTIVE)) + { + trackingCalActive = 1U; + break; + } + } + if (trackingCalActive == 1U) + { + break; + } + } + + /* Break out here if all tracking cals are Inactive */ + if (trackingCalActive == 0U) + { + break; + } + + /* Some tracking cals are still running. Wait the specified wait interval, then check again for inactivity. */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, ADI_ADRV903X_TRACKCALDISABLE_INTERVAL_US); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Issue"); + goto cleanup; + } + } + + /* Check for Tracking Cal Inactive timeout */ + if (timeElapsedUs >= ADI_ADRV903X_TRACKCALDISABLE_TIMEOUT_US) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_TIMEOUT, recoveryAction, trackingCal, "Tracking Cal Inactive Timeout"); + goto cleanup; + } + + /* 5. Enable Fast Attack mode for tracking cals and serdes initcal */ + enFastAttackCmd.calMask = ADRV903X_HTOCL(trackingCalMask & + (~(uint32_t)(ADI_ADRV903X_TC_RX_ADC_MASK | ADI_ADRV903X_TC_ORX_ADC_MASK))); /* skip RX ADC and ORX ADC from Fast attack */ + + for (index = 0U; index < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; index++) + { + recoveryAction = adrv903x_CpuCmdSend(device, + (adi_adrv903x_CpuType_e)index, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_ENABLE_FAST_ATTACK, + (void*)&enFastAttackCmd, + sizeof(adrv903x_CpuCmd_EnFastAttack_t), + (void*)&enFastAttackCmdRsp, + sizeof(adrv903x_CpuCmd_EnFastAttackResp_t), + NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Failed to set Cals in Fast attack mode"); + goto cleanup; + } + } + + /* Still need to send control commands for RXQEC, TXQEC and TXLOL Cals */ + for (index = 0U; index < ADI_ADRV903X_MAX_RX_ONLY; index++) + { + if ((standbyRecover->tcEnableMasks.enableMask[index] & ADI_ADRV903X_TC_RX_QEC_MASK) != 0U) + { + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + ADRV903X_CPU_OBJID_TC_RXQEC, + 0x2U, + (adi_adrv903x_Channels_e)(1U << index), + regData, + 0U, + &cmdExecRespLength, + regData, + 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Failed to set RX QEC cal in Fast Attack"); + goto cleanup; + } + } + } + + for (index = 0U; index < ADI_ADRV903X_MAX_TXCHANNELS; index++) + { + if (standbyRecover->tcEnableMasks.enableMask[index] & ADI_ADRV903X_TC_TX_LOL_MASK) + { + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + ADRV903X_CPU_OBJID_TC_TX_LOL, + 0x2U, + (adi_adrv903x_Channels_e)(1U << index), + regData, + 0U, + &cmdExecRespLength, + regData, + 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Failed to set TX LOL cal in Fast Attack"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + ADRV903X_CPU_OBJID_TC_TX_LOL, + 0x0U, + (adi_adrv903x_Channels_e)(1U << index), + regData, + 0U, + &cmdExecRespLength, + regData, + 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Failed to soft reset TX LOL"); + goto cleanup; + } + } + + if (standbyRecover->tcEnableMasks.enableMask[index] & ADI_ADRV903X_TC_TX_QEC_MASK) + { + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + ADRV903X_CPU_OBJID_TC_TXQEC, + 0x0U, + (adi_adrv903x_Channels_e)(1U << index), + regData, + 0U, + &cmdExecRespLength, + regData, + 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Failed to set TX QEC cal in Fast Attack"); + goto cleanup; + } + } + } + + /* 6. Disable serializer lanes */ + lanesEnabled = 0U; + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_FRAMERS; index++) + { + lanesEnabled |= device->initExtract.jesdSetting.framerSetting[index].serialLaneEnabled; + } + + /* Prepare the command payload to power-down all enabled jtx lanes. uint8_t fields don't require HTOC conversion. */ + jtxPwrCmd.jtxLaneMask = lanesEnabled; + jtxPwrCmd.jtxLanePower = 0x00; + + /* Send command. There is no cmd-specific response expected. + * This command is always sent to CPU0 regardless of lane-CPU assignment. */ + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_JESD_TX_LANE_POWER, + (void*)&jtxPwrCmd, + sizeof(jtxPwrCmd), + NULL, + 0U, + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + goto cleanup; + } + + if (cmdStatus != ADRV903X_CPU_CMD_STATUS_NO_ERROR) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_ERROR_REPORT(&device->common, + ADI_COMMON_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + cmdStatus, + "CPU cmd ADRV903X_CPU_CMD_ID_JESD_TX_LANE_POWER failed"); + goto cleanup; + } + /* 7. Disable All deserializer lanes */ + lanesEnabled = 0U; + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + lanesEnabled |= device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled; + } + + regAddr = ADRV903X_ADDR_SERDES_RXDIG_PHY_PD_0; + for (index = 0U; index < (uint32_t)ADRV903X_JESD_MAX_DESERIALIZER_LANES; index++) + { + if ((lanesEnabled & (1U << index)) != 0U) + { + if (deserializerPdCfg == 0xFFFFU) + { + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, regAddr, regData, NULL, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Reading Deserrializer Power Down Register"); + goto cleanup; + } + deserializerPdCfg = (((uint16_t)regData[0]) | (((uint16_t)regData[1]) << 8U)); + } + + regData[0] = 0x3FU; + regData[1] = 0x07U; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, regData, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Reading Deserrializer Power Down Register"); + goto cleanup; + } + } + regAddr += 0x800U; + } + standbyRecover->deserializerPowerDownReg = deserializerPdCfg; + + /* 8. Disable Framers */ + recoveryAction = adi_adrv903x_FramerLinkStateSet(device, (uint8_t)ADI_ADRV903X_ALL_FRAMERS, ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Disabling Framers"); + goto cleanup; + } + + /* 9. Disable Deframers */ + recoveryAction = adi_adrv903x_DeframerLinkStateSet(device, (uint8_t)ADI_ADRV903X_ALL_DEFRAMER, ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Disabling Deframers"); + goto cleanup; + } + + /* 10. Disable SERDES PLL */ + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, ADRV903X_ADDR_SERDES_PLL_MISC_PD, regData, NULL, 3U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Reading SERDES PLL Power Down Register"); + goto cleanup; + } + standbyRecover->serdesPllPowerDownCfg = (((uint32_t)regData[0]) | + (((uint32_t)regData[1]) << 8U) | + (((uint32_t)regData[2]) << 16U)); + + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, ADRV903X_ADDR_SERDES_PLL_OUTPUT_DIVIDER_CTL, regData, NULL, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Reading SERDES PLL Output Control Register"); + goto cleanup; + } + standbyRecover->serdesPllPowerDownCfg |= (((uint32_t)regData[0]) << 24U); + + regData[0] = PLL_MISC_PD_DISABLE; + regData[1] = PLL_MISC_PD_KILLS_DISABLE; + regData[2] = PLL_LO_GEN_SYNC_PD_DISABLE; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_SERDES_PLL_MISC_PD, regData, 3U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Writing SERDES PLL Power Down Register"); + goto cleanup; + } + + regData[0] = 0xFFU; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_SERDES_PLL_OUTPUT_DIVIDER_CTL, regData, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Writing SERDES PLL Output Control Register"); + goto cleanup; + } + + /* 11. Disable RF LO1 PLL */ + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, ADRV903X_ADDR_RFLO1_PLL_MISC_PD, regData, NULL, 3U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Reading RF LO1 PLL Power Down Register"); + goto cleanup; + } + standbyRecover->lo1PllPowerDownCfg = (((uint32_t)regData[0]) | + (((uint32_t)regData[1]) << 8U) | + (((uint32_t)regData[2]) << 16U)); + + regData[0] = PLL_MISC_PD_DISABLE; + regData[1] = PLL_MISC_PD_KILLS_DISABLE; + regData[2] = PLL_LO_GEN_SYNC_PD_DISABLE; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_RFLO1_PLL_MISC_PD, regData, 3U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Writing RF LO1 PLL Power Down Register"); + goto cleanup; + } + + /* 12. Disable RF LO0 PLL */ + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, ADRV903X_ADDR_RFLO0_PLL_MISC_PD, regData, NULL, 3U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Reading RF LO0 PLL Power Down Register"); + goto cleanup; + } + standbyRecover->lo0PllPowerDownCfg = (((uint32_t)regData[0]) | + (((uint32_t)regData[1]) << 8U) | + (((uint32_t)regData[2]) << 16U)); + + regData[0] = PLL_MISC_PD_DISABLE; + regData[1] = PLL_MISC_PD_KILLS_DISABLE; + regData[2] = PLL_LO_GEN_SYNC_PD_DISABLE; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_RFLO0_PLL_MISC_PD, regData, 3U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Writing RF LO0 PLL Power Down Register"); + goto cleanup; + } + + /* 13. Disable TX DAC */ + regData[0] = TX_DAC_PD_DISABLE; + regData[1] = TX_DAC_PD_DISABLE; + for (index = 0U; index < ADI_ADRV903X_MAX_TXCHANNELS; index++) + { + if (txInitChMask & (1U << index)) + { + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, TX_DAC_PWD_DOWN_I_ADDRS[index], regData, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Error while disabling TX channel DAC"); + goto cleanup; + } + } + } + + /* 14. Disable RX ADC */ + for (index = 0U; index < ADI_ADRV903X_MAX_RX_ONLY; index++) + { + if (rxInitChMask & (1U << index)) + { + regAddr = RX_ADC_REGMAP0_CTRL_FD_PD_ADDRS[index]; + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, regAddr, regData, NULL, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Error while Reading Rx ADC Power Down Registers"); + goto cleanup; + } + standbyRecover->rxAdcPowerDownCtrl = ((uint32_t)regData[0]); + + regAddr = RX_ADC_REGMAP0_CTRL_FL_PD_ADDRS[index]; + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, regAddr, regData, NULL, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Error while Reading Rx ADC Power Down Registers"); + goto cleanup; + } + standbyRecover->rxAdcPowerDownCtrl |= (((uint32_t)regData[0]) << 8U); + + regAddr = RX_ADC_REGMAP0_CTRL_FD_PD_ADDRS[index] + 0x80U; + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, regAddr, regData, NULL, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Error while Reading Rx ADC Power Down Registers"); + goto cleanup; + } + standbyRecover->rxAdcPowerDownCtrl |= (((uint32_t)regData[0]) << 16U); + + regAddr = RX_ADC_REGMAP0_CTRL_FL_PD_ADDRS[index] + 0x80U; + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, regAddr, regData, NULL, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Error while Reading Rx ADC Power Down Registers"); + goto cleanup; + } + standbyRecover->rxAdcPowerDownCtrl |= (((uint32_t)regData[0]) << 24U); + break; + } + } + + for (index = 0U; index < ADI_ADRV903X_MAX_RX_ONLY; index++) + { + if (rxInitChMask & (1U << index)) + { + regAddr = RX_ADC_REGMAP0_CTRL_FD_PD_ADDRS[index]; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, &RX_ADC_CTRL_FD_PD_DISABLE, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Error while disabling RX channel ADC"); + goto cleanup; + } + + regAddr = RX_ADC_REGMAP0_CTRL_FL_PD_ADDRS[index]; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, &RX_ADC_CTRL_FL_PD_DISABLE, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Error while disabling RX channel ADC"); + goto cleanup; + } + + regAddr = RX_ADC_REGMAP0_CTRL_FD_PD_ADDRS[index] + 0x80U; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, &RX_ADC_CTRL_FD_PD_DISABLE, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Error while disabling RX channel ADC"); + goto cleanup; + } + + regAddr = RX_ADC_REGMAP0_CTRL_FL_PD_ADDRS[index] + 0x80U; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, &RX_ADC_CTRL_FL_PD_DISABLE, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Error while disabling RX channel ADC"); + goto cleanup; + } + } + } + + /* 15. Disable ORX ADC */ + for (index = 0U; index < ADI_ADRV903X_MAX_ORX; index++) + { + if ((orxInitChMask >> ADI_ADRV903X_MAX_RX_ONLY) & (1U << index)) + { + regAddr = (index == 0U) ? ADRV903X_BF_SLICE_ORX_0__ORX_DIG : ADRV903X_BF_SLICE_ORX_1__ORX_DIG; + recoveryAction = adrv903x_OrxDig_AdcPdN_BfSet(device, NULL, (adrv903x_BfOrxDigChanAddr_e)regAddr, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Error while disabling ORX channel ADC"); + goto cleanup; + } + } + } + + /* 16. Disable TX LB ADC */ + for (index = 0U; index < ADI_ADRV903X_MAX_TXCHANNELS; index++) + { + if (txInitChMask & (1U << index)) + { + regAddr = TX_LB_ADC_WEST_TRM_PDN_CTRL_ADDRS[index]; + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, regAddr, regData, NULL, 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Error while Reading West Tx LB ADC Power Down Registers"); + goto cleanup; + } + standbyRecover->txLbAdcTrmPowerDownCtrl = (((uint32_t)regData[0] & 0x3FU) | + (((uint32_t)regData[1] & 0x3FU) << 6U) | + (((uint32_t)regData[2] & 0x03U) << 12U) | + (((uint32_t)regData[3] & 0x03U) << 14U)); + + regAddr = TX_LB_ADC_EAST_TRM_PDN_CTRL_ADDRS[index]; + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, regAddr, regData, NULL, 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Error while Reading East Tx LB ADC Power Down Registers"); + goto cleanup; + } + standbyRecover->txLbAdcTrmPowerDownCtrl |= ((((uint32_t)regData[0] & 0xCFU) << 16U) | + (((uint32_t)regData[1] & 0x03U) << 24U) | + (((uint32_t)regData[2] & 0x03U) << 26U) | + (((uint32_t)regData[3] & 0x03U) << 28U)); + break; + } + } + + for (index = 0U; index < ADI_ADRV903X_MAX_TXCHANNELS; index++) + { + if (txInitChMask & (1U << index)) + { + regAddr = TX_LB_ADC_WEST_TRM_PDN_CTRL_ADDRS[index]; + regData[0] = 0x3FU; + regData[1] = 0x3FU; + regData[2] = 0x03U; + regData[3] = 0x03U; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, regData, 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Error while Writing West Tx LB ADC Power Down Registers"); + goto cleanup; + } + + regAddr = TX_LB_ADC_EAST_TRM_PDN_CTRL_ADDRS[index]; + regData[0] = 0xCFU; + regData[1] = 0x03U; + regData[2] = 0x03U; + regData[3] = 0x03U; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, regData, 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Error while Writing East Tx LB ADC Power Down Registers"); + goto cleanup; + } + } + } + + /* 17. Change hsDigClk source to DevClk */ + recoveryAction = adrv903x_Core_UseDeviceClkAsHsdigclk_BfSet(device, NULL, ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Changing hsDigClk source to DevClk"); + goto cleanup; + } + + /* 18. Disable CLK PLL */ + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, ADRV903X_ADDR_CLK_PLL_MISC_PD, regData, NULL, 3U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Reading CLK PLL Power Down Register"); + goto cleanup; + } + standbyRecover->clkPllPowerDownCfg = (((uint32_t)regData[0]) | + (((uint32_t)regData[1]) << 8U) | + (((uint32_t)regData[2]) << 16U)); + + regData[0] = PLL_MISC_PD_DISABLE; + regData[1] = PLL_MISC_PD_KILLS_DISABLE; + regData[2] = PLL_LO_GEN_SYNC_PD_DISABLE; + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_CLK_PLL_MISC_PD, regData, 3U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Writing RF LO1 PLL Power Down Register"); + goto cleanup; + } + + /* Set device state to STANDBY */ + device->devStateInfo.devState = (adi_adrv903x_ApiStates_e)(device->devStateInfo.devState | ADI_ADRV903X_STATE_STANDBY); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StandbyRecover(adi_adrv903x_Device_t* const device, + adi_adrv903x_StandbyRecover_t* const standbyRecover) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint8_t rf0PllRxMux = 0U; + uint8_t rf1PllRxMux = 0U; + uint8_t rf0PllTxMux = 0U; + uint8_t rf1PllTxMux = 0U; + + uint8_t lanesEnabled = 0U; + + uint32_t txInitChMask = ((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & ADI_ADRV903X_TXALL); + uint32_t rxInitChMask = (device->devStateInfo.initializedChannels & ADI_ADRV903X_RX_MASK_ALL); + uint32_t orxInitChMask = (device->devStateInfo.initializedChannels & ADI_ADRV903X_ORX_MASK_ALL); + uint32_t index = 0U; + uint32_t regAddr = 0U; + uint8_t regData[4] = { 0U, 0U, 0U, 0U }; + + adrv903x_CpuCmd_ReprogramPll_t reprogramPllCmd; + adrv903x_CpuCmd_ReprogramPllResp_t reprogramPllCmdRsp; + adrv903x_CpuCmd_JtxLanePower_t jtxPwrCmd; + adrv903x_CpuCmdStatus_e cmdStatus = ADRV903X_CPU_CMD_STATUS_GENERIC; + + const uint32_t TX_DAC_PWD_DOWN_I_ADDRS[ADI_ADRV903X_MAX_TXCHANNELS] = { + ADRV903X_ADDR_TX0_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX1_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX2_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX3_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX4_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX5_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX6_DAC_PWD_DOWN_I, + ADRV903X_ADDR_TX7_DAC_PWD_DOWN_I + }; + const uint32_t RX_ADC_REGMAP0_CTRL_FD_PD_ADDRS[ADI_ADRV903X_MAX_RX_ONLY] = { + ADRV903X_ADDR_RX0_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX1_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX2_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX3_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX4_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX5_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX6_ADC_REGMAP0_CTRL_FD_PD, + ADRV903X_ADDR_RX7_ADC_REGMAP0_CTRL_FD_PD + }; + const uint32_t RX_ADC_REGMAP0_CTRL_FL_PD_ADDRS[ADI_ADRV903X_MAX_RX_ONLY] = { + ADRV903X_ADDR_RX0_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX1_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX2_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX3_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX4_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX5_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX6_ADC_REGMAP0_CTRL_FL_PD, + ADRV903X_ADDR_RX7_ADC_REGMAP0_CTRL_FL_PD + }; + const uint32_t TX_LB_ADC_WEST_TRM_PDN_CTRL_ADDRS[ADI_ADRV903X_MAX_TXCHANNELS] = { + ADRV903X_ADDR_TX0_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX1_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX2_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX3_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX4_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX5_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX6_LB_ADC_WEST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX7_LB_ADC_WEST_TRM_PDN_CTRL + }; + const uint32_t TX_LB_ADC_EAST_TRM_PDN_CTRL_ADDRS[ADI_ADRV903X_MAX_TXCHANNELS] = { + ADRV903X_ADDR_TX0_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX1_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX2_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX3_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX4_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX5_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX6_LB_ADC_EAST_TRM_PDN_CTRL, + ADRV903X_ADDR_TX7_LB_ADC_EAST_TRM_PDN_CTRL + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, standbyRecover, cleanup); + + if ((device->devStateInfo.devState & ADI_ADRV903X_STATE_STANDBY) != ADI_ADRV903X_STATE_STANDBY) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Device is not in Standby Mode"); + goto cleanup; + } + + /* 1.a Power up CLK PLL */ + regData[0] = (standbyRecover->clkPllPowerDownCfg & 0xFFU); + regData[1] = ((standbyRecover->clkPllPowerDownCfg >> 8U) & 0xFFU); + regData[2] = ((standbyRecover->clkPllPowerDownCfg >> 16U) & 0xFFU); + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_CLK_PLL_MISC_PD, regData, 3U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while enabling CLK PLL"); + goto cleanup; + } + + /* 1.b Reprogram CLK PLL */ + reprogramPllCmd.pllSel = ADI_ADRV903X_CLK_PLL; + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_REPROGRAM_PLL, + (void*)&reprogramPllCmd, + sizeof(adrv903x_CpuCmd_ReprogramPll_t), + (void*)&reprogramPllCmdRsp, + sizeof(adrv903x_CpuCmd_ReprogramPllResp_t), + NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Reprogram CLK PLL"); + goto cleanup; + } + + /* 1.c Change hsDigClk back to CLK PLL */ + recoveryAction = adrv903x_Core_UseDeviceClkAsHsdigclk_BfSet(device, NULL, ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Changing hsDigClk source to CLK PLL"); + goto cleanup; + } + + /* 1.d Power up TX DAC */ + regData[0] = 0x00U; + regData[1] = 0x00U; + for (index = 0U; index < ADI_ADRV903X_MAX_TXCHANNELS; index++) + { + if (txInitChMask & (1U << index)) + { + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, TX_DAC_PWD_DOWN_I_ADDRS[index], regData, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Error while Enabling TX channel DAC"); + goto cleanup; + } + } + } + + /* 1.e Power up RX ADC */ + for (index = 0U; index < ADI_ADRV903X_MAX_RX_ONLY; index++) + { + if (rxInitChMask & (1U << index)) + { + regAddr = RX_ADC_REGMAP0_CTRL_FD_PD_ADDRS[index]; + regData[0] = (standbyRecover->rxAdcPowerDownCtrl & 0x2F); /* Ensure PD_DAC_CK is 0 */ + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, regData, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Failed to Power up RX channel ADC"); + goto cleanup; + } + + regAddr = RX_ADC_REGMAP0_CTRL_FL_PD_ADDRS[index]; + regData[0] = ((standbyRecover->rxAdcPowerDownCtrl >> 8U) & 0xFF); + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, regData, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Failed to Power up RX channel ADC"); + goto cleanup; + } + + regAddr = RX_ADC_REGMAP0_CTRL_FD_PD_ADDRS[index] + 0x80U; + regData[0] = ((standbyRecover->rxAdcPowerDownCtrl >> 16U) & 0x2F); /* Ensure PD_DAC_CK is 0 */ + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, regData, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Failed to Power up RX channel ADC"); + goto cleanup; + } + + regAddr = RX_ADC_REGMAP0_CTRL_FL_PD_ADDRS[index] + 0x80U; + regData[0] = ((standbyRecover->rxAdcPowerDownCtrl >> 24U) & 0xFF); + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, regData, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, regAddr, "Failed to Power up RX channel ADC"); + goto cleanup; + } + } + } + + /* 1.f Power up ORX ADC */ + for (index = 0U; index < ADI_ADRV903X_MAX_ORX; index++) + { + if ((orxInitChMask >> ADI_ADRV903X_MAX_RX_ONLY) & (1U << index)) + { + regAddr = (index == 0U) ? ADRV903X_BF_SLICE_ORX_0__ORX_DIG : ADRV903X_BF_SLICE_ORX_1__ORX_DIG; + recoveryAction = adrv903x_OrxDig_AdcPdN_BfSet(device, NULL, (adrv903x_BfOrxDigChanAddr_e)regAddr, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Error while enabling ORX channel ADC"); + goto cleanup; + } + } + } + + /* 1.g Power up LB ADC */ + for (index = 0U; index < ADI_ADRV903X_MAX_TXCHANNELS; index++) + { + if (txInitChMask & (1U << index)) + { + regAddr = TX_LB_ADC_WEST_TRM_PDN_CTRL_ADDRS[index]; + regData[0] = (standbyRecover->txLbAdcTrmPowerDownCtrl & 0x3FU); + regData[1] = ((standbyRecover->txLbAdcTrmPowerDownCtrl >> 6U) & 0x3FU); + regData[2] = ((standbyRecover->txLbAdcTrmPowerDownCtrl >> 12U) & 0x03U); + regData[3] = ((standbyRecover->txLbAdcTrmPowerDownCtrl >> 14U) & 0x03U); + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, regData, 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Error while Enabling West Tx channel LB ADC"); + goto cleanup; + } + + regAddr = TX_LB_ADC_EAST_TRM_PDN_CTRL_ADDRS[index]; + regData[0] = ((standbyRecover->txLbAdcTrmPowerDownCtrl >> 16U) & 0xCFU); + regData[1] = ((standbyRecover->txLbAdcTrmPowerDownCtrl >> 24U) & 0x03U); + regData[2] = ((standbyRecover->txLbAdcTrmPowerDownCtrl >> 26U) & 0x03U); + regData[3] = ((standbyRecover->txLbAdcTrmPowerDownCtrl >> 28U) & 0x03U); + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, regData, 4U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Error while Enabling East Tx channel LB ADC"); + goto cleanup; + } + } + } + + /* Read Channel RF PLL Selectors */ + recoveryAction = adrv903x_PllMemMap_SelRxLo_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_EAST_RFPLL, &rf0PllRxMux); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read RX Channel RF0 PLL Selector"); + goto cleanup; + } + recoveryAction = adrv903x_PllMemMap_SelRxLo_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_WEST_RFPLL, &rf1PllRxMux); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read RX Channel RF1 PLL Selector"); + goto cleanup; + } + recoveryAction = adrv903x_PllMemMap_SelTxLo_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_EAST_RFPLL, &rf0PllTxMux); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read TX Channel RF0 PLL Selector"); + goto cleanup; + } + recoveryAction = adrv903x_PllMemMap_SelTxLo_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_WEST_RFPLL, &rf1PllTxMux); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to read TX Channel RF1 PLL Selector"); + goto cleanup; + } + + /* 1.h Power up RF0 PLL (if it is being used)*/ + if (((rf0PllTxMux == 1U) && ((txInitChMask & 0x0FU) != 0U)) | /* tx channel 0-3 connected to PLL0 */ + ((rf1PllTxMux == 0U) && ((txInitChMask & 0xF0U) != 0U)) | /* tx channel 4-7 connected to PLL0 */ + ((rf0PllRxMux == 1U) && ((rxInitChMask & 0x0FU) != 0U)) | /* rx channel 0-3 connected to PLL0 */ + ((rf1PllRxMux == 0U) && ((rxInitChMask & 0xF0U) != 0U))) /* rx channel 4-7 connected to PLL0 */ + { + regData[0] = (standbyRecover->lo0PllPowerDownCfg & 0xFFU); + regData[1] = ((standbyRecover->lo0PllPowerDownCfg >> 8U) & 0xFFU); + regData[2] = ((standbyRecover->lo0PllPowerDownCfg >> 16U) & 0xFFU); + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_RFLO0_PLL_MISC_PD, regData, 3U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Power up RF0 PLL"); + goto cleanup; + } + + /* 1.i Reprogram RF0 PLL */ + reprogramPllCmd.pllSel = ADI_ADRV903X_RF0_PLL; + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_REPROGRAM_PLL, + (void*)&reprogramPllCmd, + sizeof(adrv903x_CpuCmd_ReprogramPll_t), + (void*)&reprogramPllCmdRsp, + sizeof(adrv903x_CpuCmd_ReprogramPllResp_t), + NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Reprogram RF0 PLL"); + goto cleanup; + } + } + + /* 1.j Power up RF1 PLL (if it is being used)*/ + if (((rf0PllTxMux == 0U) && ((txInitChMask & 0x0FU) != 0U)) | /* tx channel 0-3 connected to PLL1 */ + ((rf1PllTxMux == 1U) && ((txInitChMask & 0xF0U) != 0U)) | /* tx channel 4-7 connected to PLL1 */ + ((rf0PllRxMux == 0U) && ((rxInitChMask & 0x0FU) != 0U)) | /* rx channel 0-3 connected to PLL1 */ + ((rf1PllRxMux == 1U) && ((rxInitChMask & 0xF0U) != 0U))) /* rx channel 4-7 connected to PLL1 */ + { + regData[0] = (standbyRecover->lo1PllPowerDownCfg & 0xFFU); + regData[1] = ((standbyRecover->lo1PllPowerDownCfg >> 8U) & 0xFFU); + regData[2] = ((standbyRecover->lo1PllPowerDownCfg >> 16U) & 0xFFU); + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_RFLO1_PLL_MISC_PD, regData, 3U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Power up RF1 PLL"); + goto cleanup; + } + + /* 1.k Reprogram RF1 PLL */ + reprogramPllCmd.pllSel = ADI_ADRV903X_RF1_PLL; + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_REPROGRAM_PLL, + (void*)&reprogramPllCmd, + sizeof(adrv903x_CpuCmd_ReprogramPll_t), + (void*)&reprogramPllCmdRsp, + sizeof(adrv903x_CpuCmd_ReprogramPllResp_t), + NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Reprogram RF1 PLL"); + goto cleanup; + } + } + + /* 1.l Power up Serdes PLL */ + regData[0] = (standbyRecover->serdesPllPowerDownCfg & 0xFFU); + regData[1] = ((standbyRecover->serdesPllPowerDownCfg >> 8U) & 0xFFU); + regData[2] = ((standbyRecover->serdesPllPowerDownCfg >> 16U) & 0xFFU); + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_SERDES_PLL_MISC_PD, regData, 3U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Power up Serdes PLL"); + goto cleanup; + } + + regData[0] = ((standbyRecover->serdesPllPowerDownCfg >> 24U) & 0xFFU); + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, ADRV903X_ADDR_SERDES_PLL_OUTPUT_DIVIDER_CTL, regData, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set Serdes PLL output divider control"); + goto cleanup; + } + + /* 1.m Reprogram Serdes PLL */ + reprogramPllCmd.pllSel = ADI_ADRV903X_SERDES_PLL; + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_REPROGRAM_PLL, + (void*)&reprogramPllCmd, + sizeof(adrv903x_CpuCmd_ReprogramPll_t), + (void*)&reprogramPllCmdRsp, + sizeof(adrv903x_CpuCmd_ReprogramPllResp_t), + NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Reprogram SERDES PLL"); + goto cleanup; + } + + /* 1.n Power up Serializer lanes and Framer */ + lanesEnabled = 0U; + for(index = 0U ; index < (uint32_t)ADI_ADRV903X_MAX_FRAMERS ; index++) + { + lanesEnabled |= device->initExtract.jesdSetting.framerSetting[index].serialLaneEnabled; + } + + /* Prepare the command payload to power-down all enabled jtx lanes */ + jtxPwrCmd.jtxLaneMask = lanesEnabled; + jtxPwrCmd.jtxLanePower = 0xFF; + + /* Send command. There is no cmd-specific response expected. + * This command is always sent to CPU0 regardless of lane-CPU assignment. */ + recoveryAction = adrv903x_CpuCmdSend(device, + ADI_ADRV903X_CPU_TYPE_0, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_JESD_TX_LANE_POWER, + (void*)&jtxPwrCmd, + sizeof(jtxPwrCmd), + NULL, + 0U, + &cmdStatus); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to call CPU cmd ADRV903X_CPU_CMD_ID_JESD_TX_LANE_POWER"); + goto cleanup; + } + + if (cmdStatus != ADRV903X_CPU_CMD_STATUS_NO_ERROR) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_ERROR_REPORT(&device->common, + ADI_COMMON_ERRSRC_API, + ADI_COMMON_ERRCODE_API, + recoveryAction, + cmdStatus, + "CPU cmd ADRV903X_CPU_CMD_ID_JESD_TX_LANE_POWER failed"); + goto cleanup; + } + + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_FRAMERS; index++) + { + if (device->initExtract.jesdSetting.framerSetting[index].serialLaneEnabled != 0U) + { + recoveryAction = adi_adrv903x_FramerLinkStateSet(device, (1U << index), ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Failed to Enable Framer"); + goto cleanup; + } + } + } + + /* 1.o Power up Deserializer and Deframer */ + lanesEnabled = 0U; + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + lanesEnabled |= device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled; + } + + regData[0] = standbyRecover->deserializerPowerDownReg & 0xFFU; + regData[1] = (standbyRecover->deserializerPowerDownReg >> 8U) & 0xFFU; + regAddr = ADRV903X_ADDR_SERDES_RXDIG_PHY_PD_0; + for (index = 0U; index < (uint32_t)ADRV903X_JESD_MAX_DESERIALIZER_LANES; index++) + { + if ((lanesEnabled & (1U << index)) != 0U) + { + recoveryAction = adi_adrv903x_RegistersByteWrite(device, NULL, regAddr, regData, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Writing Deserializer Power Down Register"); + goto cleanup; + } + } + regAddr += 0x800U; + } + + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + if (device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled != 0U) + { + recoveryAction = adi_adrv903x_DeframerLinkStateSet(device, (1U << index), ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Failed to Enable Deframer"); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StandbyExit(adi_adrv903x_Device_t* const device, + adi_adrv903x_StandbyRecover_t* const standbyRecover) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint32_t txInitChMask = ((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & ADI_ADRV903X_TXALL); + uint32_t rxInitChMask = (device->devStateInfo.initializedChannels & ADI_ADRV903X_RX_MASK_ALL); + uint32_t orxInitChMask = (device->devStateInfo.initializedChannels & ADI_ADRV903X_ORX_MASK_ALL); + + uint32_t trackingCal = 0U; + uint32_t index = 0U; + uint32_t channelMask = 0U; + uint32_t baseAddr = 0U; + + adi_adrv903x_ChannelTrackingCals_t channelMaskv2; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, standbyRecover, cleanup); + + if ((device->devStateInfo.devState & ADI_ADRV903X_STATE_STANDBY) != ADI_ADRV903X_STATE_STANDBY) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Device is not in Standby Mode"); + goto cleanup; + } + + /* Clear possible Framer errors */ + baseAddr = (uint32_t) ADRV903X_BF_DIGITAL_CORE_JESD_JTX_LINK_0_; + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_FRAMERS; ++index) + { + if (device->initExtract.jesdSetting.framerSetting[index].serialLaneEnabled != 0U) + { + /* clear PCLK error */ + recoveryAction = adrv903x_JtxLink_JtxPclkErrorClear_BfSet(device, NULL, (adrv903x_BfJtxLinkChanAddr_e)baseAddr, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Failed to Clear Framer PCLK Errors"); + goto cleanup; + } + recoveryAction = adrv903x_JtxLink_JtxPclkErrorClear_BfSet(device, NULL, (adrv903x_BfJtxLinkChanAddr_e)baseAddr, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Error after clearing Framer PCLK Errors"); + goto cleanup; + } + /* clear SYSREF error */ + recoveryAction = adrv903x_JtxLink_JtxTplSysrefClrPhaseErr_BfSet(device, NULL, (adrv903x_BfJtxLinkChanAddr_e)baseAddr, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Failed to Clear Framer SYSREF Errors"); + goto cleanup; + } + recoveryAction = adrv903x_JtxLink_JtxTplSysrefClrPhaseErr_BfSet(device, NULL, (adrv903x_BfJtxLinkChanAddr_e)baseAddr, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Error after clearing Framer SYSREF Errors"); + goto cleanup; + } + } + baseAddr += 0x10000U; + } + + /* Re-enable channels when we're done (restore the SPI mode registers) */ + recoveryAction = adi_adrv903x_RxTxEnableSet(device, + orxInitChMask, standbyRecover->orxEnabledMask, + rxInitChMask, standbyRecover->rxEnabledMask, + txInitChMask, standbyRecover->txEnabledMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Re-enabling channels."); + goto cleanup; + } + + /* Re-enable Tracking Cals (starting from the ADC cals) */ + for (trackingCal = (uint32_t)ADI_ADRV903X_TC_ORX_ADC_MASK; trackingCal >= (uint32_t)ADI_ADRV903X_TC_RX_QEC_MASK; trackingCal >>= 1U) + { + channelMask = 0U; + + for (index = 0U; index < ADI_ADRV903X_NUM_TRACKING_CAL_CHANNELS; index++) + { + if (standbyRecover->tcEnableMasks.enableMask[index] & trackingCal) + { + channelMask |= (1U << index); + } + } + + if (channelMask) + { + channelMaskv2.rxChannel = channelMask & 0xFFU; + channelMaskv2.txChannel = channelMask & 0xFFU; + channelMaskv2.orxChannel = channelMask & 0x03U; + channelMaskv2.laneSerdes = channelMask & 0xFFU; + recoveryAction = adi_adrv903x_TrackingCalsEnableSet_v2(device, (adi_adrv903x_TrackingCalibrationMask_e)trackingCal, &channelMaskv2, ADI_ADRV903X_TRACKING_CAL_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, trackingCal, "Error while enabling Tracking cal"); + goto cleanup; + } + } + } + + /* Clear STANDBY state */ + device->devStateInfo.devState = (adi_adrv903x_ApiStates_e)(device->devStateInfo.devState & ~ADI_ADRV903X_STATE_STANDBY); + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_StandbyExitStatusGet(adi_adrv903x_Device_t* const device, + adi_adrv903x_StandbyRecover_t* const standbyRecover, + uint8_t * const done) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint32_t txInitChMask = ((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & ADI_ADRV903X_TXALL); + + uint32_t chanSel = 0U; + uint32_t index = 0U; + + uint32_t adcCalStatus[ADRV903X_TXLB_ADC_FAST_ATTACK_STATUS_IDX + 1U] = { 0 }; + + uint8_t localDone = ADI_TRUE; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, standbyRecover, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, done, cleanup); + + for (index = 0U; index < ADI_ADRV903X_MAX_TXCHANNELS; index++) + { + chanSel = (1U << index); + if (txInitChMask & chanSel) + { + /* Get TXLB ADC Calibration Status */ + recoveryAction = adi_adrv903x_CalSpecificStatusGet( device, + (adi_adrv903x_Channels_e)(chanSel), + ADRV903X_CPU_OBJID_TC_TXLB_ADC, + (uint8_t *)adcCalStatus, + (ADRV903X_TXLB_ADC_FAST_ATTACK_STATUS_IDX + 1U) * sizeof(uint32_t)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, chanSel, "Get TXLB ADC calibration status failed"); + goto cleanup; + } + + if (ADRV903X_HTOCL(adcCalStatus[ADRV903X_TXLB_ADC_FAST_ATTACK_STATUS_IDX]) != 0U) + { + localDone = ADI_FALSE; + goto cleanup; + } + } + } + +cleanup: + if (recoveryAction == ADI_ADRV903X_ERR_ACT_NONE) + { + *done = localDone; + } + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +static adi_adrv903x_ErrAction_e adrv903x_CpuMemDumpBinWrite(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuMemDumpBinaryInfo_t* const cpuMemDumpBinaryInfoPtr, + const uint8_t forceException, + uint32_t* const dumpSize, + const uint8_t ramOnlyFlag) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + FILE* ofp = NULL; + uint32_t byteCount = 0U; + uint32_t cpuIdx = 0U; + uint32_t exceptionValue = 0U; + uint8_t binaryRead[ADI_ADRV903X_MEM_DUMP_CHUNK_SIZE + 10] = { 0U }; + uint32_t tableIdx = 0U; + uint32_t i = 0U; + uint32_t startAddr = 0U; + uint32_t endAddr = 0U; + uint32_t timeout_us = 0U; + uint32_t waitInterval_us = 0U; + uint32_t eventCheck = 0U; + uint32_t numEventChecks = 0U; + uint32_t cpuTableSize = 0U; + uint8_t txChanId = 0U; + uint8_t sliceClkEn = 0x01U; + const uint32_t STREAM_CPU_RAM_ADDR = 0x46A00000U; + adrv903x_BfTxDigChanAddr_e txDigBaseAddr[ADI_ADRV903X_MAX_TXCHANNELS] = { ADRV903X_BF_SLICE_TX_0__TX_DIG, ADRV903X_BF_SLICE_TX_1__TX_DIG, ADRV903X_BF_SLICE_TX_2__TX_DIG, ADRV903X_BF_SLICE_TX_3__TX_DIG, ADRV903X_BF_SLICE_TX_4__TX_DIG, ADRV903X_BF_SLICE_TX_5__TX_DIG, ADRV903X_BF_SLICE_TX_6__TX_DIG, ADRV903X_BF_SLICE_TX_7__TX_DIG }; + + + + const uint32_t cpuExceptionAddr[ADI_ADRV903X_CPU_TYPE_MAX_RADIO] = { ADRV903X_CPU_0_PM_EXCEPTION_FLAG, ADRV903X_CPU_1_PM_EXCEPTION_FLAG }; /* Exception Flag Memory */ + + uint32_t recordCrc = 0U; + uint8_t recordPadding = 0U; + + /* File header variables */ + uint16_t fileFormatVersion = 0U; + uint16_t productId = 0U; + uint16_t productRevision = 0U; + time_t rawtime; + struct tm *tmPtr; + + /* Generic record header varibales */ + uint32_t recordType; + uint32_t recordLength; + uint8_t endianness = 0U; + + /* Device Driver record variables */ + uint16_t driverId; + uint16_t instanceId; + uint32_t driverStateLength; + uint16_t driverVersionMajor; + uint16_t driverVersionMinor; + uint16_t driverVersionPatch; + uint8_t driverVersionPrerel[ADI_ADRV903X_VERSION_PREREL_SIZE] = {0U}; + uint32_t driverVersionBuild; + uint16_t tmYear = 0U; + uint8_t tmMonth = 0U; + uint8_t tmDay = 0U; + uint8_t tmHour = 0U; + uint8_t tmMin = 0U; + uint8_t tmSec = 0U; + uint8_t* driverPtr; + + /* CPU RAM Record Variables */ + uint64_t startAddress; + uint32_t memLength; + uint16_t ramId; + uint16_t cpuType; + + /* Telemetry Buffer Record Variables */ + uint32_t bufferLength; + uint16_t bufferId; + uint16_t formatVersion = 0x1U; + + /* Register Record Variables */ + uint32_t length; + uint8_t registerWidth; + + /* Firmware Version Records */ + uint16_t firmwareSemverMajor; + uint16_t firmwareSemverMinor; + uint16_t firmwareSemverPatch; + uint8_t firmwareVersionPrerel[ADI_ADRV903X_VERSION_PREREL_SIZE] = {0U}; + uint32_t firmwareSemverBuild; + uint32_t firmwareId; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuMemDumpBinaryInfoPtr, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuMemDumpBinaryInfoPtr->filePath, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dumpSize, cleanup); + + if ((forceException != 0U) && + (forceException != 1U)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, forceException, "forceException param must be 0 or 1"); + goto cleanup; + } + +#ifdef __GNUC__ + ofp = ADI_LIBRARY_FOPEN((const char*)cpuMemDumpBinaryInfoPtr->filePath, "wb"); +#else + ADI_LIBRARY_FOPEN_S(&ofp, (const char*)cpuMemDumpBinaryInfoPtr->filePath, "wb"); +#endif + + if (ofp == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, ofp, "Unable to open binary image file. Please check if the path is correct"); + goto cleanup; + } + + if (forceException == ADI_TRUE) + { + + + /* For each main CPU force an exception unless it is already in exception state */ + for (cpuIdx = ADI_ADRV903X_CPU_TYPE_0; cpuIdx < ADI_ADRV903X_CPU_TYPE_MAX_RADIO; cpuIdx++) + { + recoveryAction = adi_adrv903x_Register32Read(device, NULL, cpuExceptionAddr[cpuIdx], &exceptionValue, 0xFFFFFFFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Unable to Read Cpu memory"); + goto cleanup; + } + + if (exceptionValue == (uint32_t)ADRV903X_CPU_NO_EXCEPTION) + { + /* CPU is not in exception state; Force it into exception state */ + recoveryAction = adrv903x_CpuForceException(device, (adi_adrv903x_CpuType_e)cpuIdx); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "CpuForceException issue"); + goto cleanup; + } + + /* Poll until CPU is in exception state or timeout */ + timeout_us = ADI_ADRV903X_WRITECPUEXCEPTION_TIMEOUT_US; + waitInterval_us = ADI_ADRV903X_WRITECPUEXCEPTION_INTERVAL_US; +#if ADI_ADRV903X_WRITECPUEXCEPTION_INTERVAL_US > ADI_ADRV903X_WRITECPUEXCEPTION_TIMEOUT_US + waitInterval_us = timeout_us; +#elif ADI_ADRV903X_WRITECPUEXCEPTION_INTERVAL_US == 0 + waitInterval_us = timeout_us; +#endif + numEventChecks = timeout_us / waitInterval_us; + + /* timeout event check loop */ + for (eventCheck = 0U; eventCheck <= numEventChecks; ++eventCheck) + { + recoveryAction = adi_adrv903x_Register32Read(device, NULL, cpuExceptionAddr[cpuIdx], &exceptionValue, 0xFFFFFFFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Unable to Read Cpu memory"); + goto cleanup; + } + + if (exceptionValue == (uint32_t)ADRV903X_CPU_NO_EXCEPTION) + { + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, waitInterval_us); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Request Issue"); + goto cleanup; + } + } + else + { + /* CPU is now in exception state */ + break; + } + } + + if (exceptionValue == (uint32_t)ADRV903X_CPU_NO_EXCEPTION) + { + /* Timeout polling for CPU to be in exception state */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, exceptionValue, "Unable to force CPU to throw exception"); + goto cleanup; + } + + /* CPU is now in exception state */ + } + } + + } + + /* Enable the Tx slice clock of the uninitialized TX channels to avoid the invalid memdump */ + sliceClkEn = 0x01U; + for (txChanId = 0U; txChanId <= ADI_ADRV903X_TX_CHAN_ID_MAX; txChanId++) + { + if (((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & (0x01 << (uint32_t)txChanId)) == 0U) + { + adrv903x_TxDig_TxAttenClkEnable_BfSet(device, NULL, txDigBaseAddr[txChanId], sliceClkEn); + } + } + + *dumpSize = 0U; + + /* Generate Header for dump file*/ + fileFormatVersion = 0x1U; + productRevision = device->devStateInfo.deviceSiRev; + /* Determine product ID */ + adrv903x_Core_EfuseProductId_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_SPI_ONLY_REGS, (uint8_t*) &productId); + productId = ADI_ADRV903X_PRODUCT_ID_MASK | productId; + /* Find dump time */ + ADI_LIBRARY_TIME(&rawtime); + tmPtr = ADI_LIBRARY_GMTIME(&rawtime); + + /* Generate header record*/ + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + byteCount = 0U; + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], fileFormatVersion); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], productId); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], productRevision); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], tmPtr->tm_year); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], tmPtr->tm_mon); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], tmPtr->tm_mday); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], tmPtr->tm_hour); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], tmPtr->tm_min); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], tmPtr->tm_sec); + byteCount += 3U; /* Padding to align to 64-bit boundary */ + /* calculate CRC*/ + recordCrc = adrv903x_Crc32ForChunk(binaryRead, byteCount, recordCrc, ADI_TRUE); + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], recordCrc); + byteCount += 4U; /* Padding to align to 64-bit boundary */ + + /* Insert file header */ + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + + /* Generate Device Driver Record */ + recordCrc = 0U; + byteCount = 0U; + recordType = ADI_ADRV903X_MEMDUMP_DEV_DRVR_STATE_RECORD; + recordLength = ADI_ADRV903X_MEMDUMP_DEVICE_DRIVER_HEADER_SIZE + sizeof(*device); + /* Generate basic header */ + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], recordType); + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], recordLength); + /* Insert record header */ + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + byteCount = 0U; + + /* Get driver record values */ + driverId = 0U; /* TBD */ + instanceId = device->common.id; + driverStateLength = sizeof(*device); + driverVersionMajor = ADI_ADRV903X_CURRENT_MAJOR_VERSION; + driverVersionMinor = ADI_ADRV903X_CURRENT_MINOR_VERSION; + driverVersionPatch = ADI_ADRV903X_CURRENT_MAINTENANCE_VERSION; + driverVersionBuild = ADI_ADRV903X_CURRENT_BUILD_VERSION; + /* Compile driver record header */ + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], driverId); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], instanceId); + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], driverStateLength); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], driverVersionMajor); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], driverVersionMinor); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], driverVersionPatch); + for(i = 0U; i < ADI_ADRV903X_VERSION_PREREL_SIZE; i++) + { + byteCount += adrv903x_insert8Bits(&binaryRead[byteCount], driverVersionPrerel[i]); + } + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], driverVersionBuild); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], endianness); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], tmYear); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], tmMonth); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], tmDay); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], tmHour); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], tmMin); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], tmSec); + + /* Publish driver header to file */ + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + recordCrc = adrv903x_Crc32ForChunk(binaryRead, byteCount, recordCrc, ADI_FALSE); + + /* Begin publishing Device Handle */ + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + byteCount = 0U; + driverPtr = (uint8_t*) device; + for(i = 0U; i < driverStateLength; i++) + { + if(byteCount >= ADI_ADRV903X_MEM_DUMP_CHUNK_SIZE) + { + /* If at maximum length for buffer, flush */ + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + recordCrc = adrv903x_Crc32ForChunk(binaryRead, byteCount, recordCrc, ADI_FALSE); + byteCount = 0U; + } + /* Set buffer to data and increment ptr */ + byteCount += adrv903x_insert8Bits(&binaryRead[byteCount], *(driverPtr++)); + } + /* Flush remaining data, even if smaller than chunk size */ + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + /* Calculate final crc */ + recordCrc = adrv903x_Crc32ForChunk(binaryRead, byteCount, recordCrc, ADI_TRUE); + + /* Append CRC32 and padding*/ + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + recordPadding = (recordLength % 8U) ? 8U - (recordLength % 8U) : 0U; + adrv903x_insert32Bits(&binaryRead[recordPadding], recordCrc); + byteCount = 8U + recordPadding; + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + + /* Begin Radio FW Record */ + recordCrc = 0U; + byteCount = 0U; + recordType = ADI_ADRV903X_MEMDUMP_FIRMWARE_VER_RECORD; + recordLength = ADI_ADRV903X_MEMDUMP_FIRMWARE_VERSION_HEADER_SIZE; + + /* Generate basic header */ + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], recordType); + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], recordLength); + /* Insert record header */ + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + byteCount = 0U; + + /* Get driver record values */ + firmwareSemverMajor = ADI_ADRV903X_CURRENT_MAJOR_VERSION; + firmwareSemverMinor = ADI_ADRV903X_CURRENT_MINOR_VERSION; + firmwareSemverPatch = ADI_ADRV903X_CURRENT_MAINTENANCE_VERSION; + firmwareSemverBuild = ADI_ADRV903X_CURRENT_BUILD_VERSION; + firmwareId = ADI_ADRV903X_MEMDUMP_RADIO_FW << ADI_ADRV903X_FIRMWARE_TYPE_ID_SHIFT; + + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], firmwareSemverMajor); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], firmwareSemverMinor); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], firmwareSemverPatch); + for(i = 0U; i < ADI_ADRV903X_VERSION_PREREL_SIZE; i++) + { + byteCount += adrv903x_insert8Bits(&binaryRead[byteCount], firmwareVersionPrerel[i]); + } + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], firmwareSemverBuild); + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], firmwareId); + + /* Publish firmware record to file */ + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + recordCrc = adrv903x_Crc32ForChunk(binaryRead, byteCount, recordCrc, ADI_TRUE); + + /* Append CRC32 and padding*/ + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + recordPadding = (recordLength % 8U) ? 8U - (recordLength % 8U) : 0U; + adrv903x_insert32Bits(&binaryRead[recordPadding], recordCrc); + byteCount = 8U + recordPadding; + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + + /* Begin Stream FW Record */ + recordCrc = 0U; + byteCount = 0U; + recordType = ADI_ADRV903X_MEMDUMP_FIRMWARE_VER_RECORD; + recordLength = ADI_ADRV903X_MEMDUMP_FIRMWARE_VERSION_HEADER_SIZE; + + /* Generate basic header */ + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], recordType); + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], recordLength); + /* Insert record header */ + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + byteCount = 0U; + + /* Get driver record values */ + firmwareSemverMajor = device->devStateInfo.cpu.devProfileVersion.majorVer; + firmwareSemverMinor = device->devStateInfo.cpu.devProfileVersion.minorVer; + firmwareSemverPatch = device->devStateInfo.cpu.devProfileVersion.maintenanceVer; + firmwareSemverBuild = device->devStateInfo.cpu.devProfileVersion.buildVer; + firmwareId = ADI_ADRV903X_MEMDUMP_STREAM_FW << ADI_ADRV903X_FIRMWARE_TYPE_ID_SHIFT; + + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], firmwareSemverMajor); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], firmwareSemverMinor); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], firmwareSemverPatch); + for(i = 0U; i < ADI_ADRV903X_VERSION_PREREL_SIZE; i++) + { + byteCount += adrv903x_insert8Bits(&binaryRead[byteCount], firmwareVersionPrerel[i]); + } + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], firmwareSemverBuild); + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], firmwareId); + + /* Publish firmware record to file */ + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + recordCrc = adrv903x_Crc32ForChunk(binaryRead, byteCount, recordCrc, ADI_TRUE); + + /* Append CRC32 and padding*/ + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + recordPadding = (recordLength % 8U) ? 8U - (recordLength % 8U) : 0U; + adrv903x_insert32Bits(&binaryRead[recordPadding], recordCrc); + byteCount = 8U + recordPadding; + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + + /* Loop through the radio CPU RAM dump table a write memory to file */ + cpuTableSize = sizeof(adrv903x_CpuRamMemDumpTable) / sizeof(adrv903x_CpuRamMemDump_t); + if(ramOnlyFlag == 1U && cpuTableSize > ADI_ADRV903X_VRAM_ONLY_SIZE) + { + cpuTableSize = ADI_ADRV903X_VRAM_ONLY_SIZE; + } + + for (tableIdx = 0U; tableIdx < cpuTableSize; tableIdx++) + { + + startAddr = adrv903x_CpuRamMemDumpTable[tableIdx].cpuMemAddr; + endAddr = adrv903x_CpuRamMemDumpTable[tableIdx].cpuMemAddr + adrv903x_CpuRamMemDumpTable[tableIdx].cpuMemSize - 1; + + /* Generate CPU RAM Record */ + recordCrc = 0U; + byteCount = 0U; + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + + /* Insert basic record header */ + recordType = ADI_ADRV903X_MEMDUMP_CPU_RAM_RECORD; + recordLength = ADI_ADRV903X_MEMDUMP_CPU_RAM_HEADER_SIZE + adrv903x_CpuRamMemDumpTable[tableIdx].cpuMemSize; + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], recordType); + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], recordLength); + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + + /* Reset values for CPU record header */ + byteCount = 0U; + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + + /* Construct CPU RAM record header */ + startAddress = startAddr; + memLength = adrv903x_CpuRamMemDumpTable[tableIdx].cpuMemSize; + ramId = adrv903x_CpuRamMemDumpTable[tableIdx].ramId; + endianness = adrv903x_CpuRamMemDumpTable[tableIdx].cpuMemEndianness; + if(startAddr >= STREAM_CPU_RAM_ADDR) + { + cpuType = ADI_ADRV903X_MEMDUMP_STREAM_CPU; + } + else + { + cpuType = ADI_ADRV903X_MEMDUMP_ARM_V7; + } + byteCount += adrv903x_insert64Bits(&binaryRead[byteCount], startAddress); + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], memLength); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], ramId); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], cpuType); + byteCount += adrv903x_insert8Bits (&binaryRead[byteCount], endianness); + byteCount += 7U; /* Padding */ + + /* Insert CPU RAM record header */ + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + recordCrc = adrv903x_Crc32ForChunk(binaryRead, byteCount, recordCrc, ADI_FALSE); + byteCount = 0U; + + recoveryAction = adrv903x_dumpMemoryRegion( device, + &ofp, + startAddr, + endAddr, + dumpSize, + &recordCrc); + + if(recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write CRC to a binary file."); + goto cleanup; + } + + /* Append CRC32 and padding*/ + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + recordPadding = (recordLength % 8U) ? 8U - (recordLength % 8U) : 0U; + adrv903x_insert32Bits(&binaryRead[recordPadding], recordCrc); + byteCount = 8U + recordPadding; + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + + } + byteCount = 0U; + recordCrc = 0U; + + /* Loop through the radio cpu telemetry dump table a write memory to file */ + cpuTableSize = sizeof(adrv903x_TelemetryMemDumpTable) / sizeof(adrv903x_CpuMemDump_t); + if(ramOnlyFlag == 0U) + { + for (tableIdx = 0U; tableIdx < cpuTableSize; tableIdx++) + { + + startAddr = adrv903x_TelemetryMemDumpTable[tableIdx].cpuMemAddr; + endAddr = adrv903x_TelemetryMemDumpTable[tableIdx].cpuMemAddr + adrv903x_TelemetryMemDumpTable[tableIdx].cpuMemSize - 1; + + /* Generate Telemetry Buffer Record */ + recordCrc = 0U; + byteCount = 0U; + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + + /* Insert basic record header */ + recordType = ADI_ADRV903X_MEMDUMP_TELEM_RECORD; + recordLength = ADI_ADRV903X_MEMDUMP_TELEM_BUFFER_HEADER_SIZE + adrv903x_TelemetryMemDumpTable[tableIdx].cpuMemSize; + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], recordType); + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], recordLength); + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + + /* Reset values for telemetry buffer record header */ + byteCount = 0U; + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + + /* Construct Telemetry record header*/ + bufferLength = adrv903x_TelemetryMemDumpTable[tableIdx].cpuMemSize; + bufferId = ADI_ADRV903X_PRODUCT_ID_MASK; + endianness = adrv903x_TelemetryMemDumpTable[tableIdx].cpuMemEndianness; + + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], bufferLength); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], bufferId); + byteCount += adrv903x_insert16Bits(&binaryRead[byteCount], formatVersion); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], endianness); + byteCount += 7U; /* Padding */ + + /* Insert telemetry buffer record header */ + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + recordCrc = adrv903x_Crc32ForChunk(binaryRead, byteCount, recordCrc, ADI_FALSE); + byteCount = 0U; + + recoveryAction = adrv903x_dumpMemoryRegion( device, + &ofp, + startAddr, + endAddr, + dumpSize, + &recordCrc); + + if(recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write CRC to a binary file."); + goto cleanup; + } + /* Append CRC32 and padding*/ + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + recordPadding = (recordLength % 8U) ? 8U - (recordLength % 8U) : 0U; + adrv903x_insert32Bits(&binaryRead[recordPadding], recordCrc); + byteCount = 8U + recordPadding; + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + } + } + byteCount = 0U; + recordCrc = 0U; + + /* Loop through the radio cpu memory dump table a write memory to file */ + cpuTableSize = sizeof(adrv903x_CpuMemDumpTable) / sizeof(adrv903x_CpuMemDump_t); + if(ramOnlyFlag == 0U) + { + for (tableIdx = 0U; tableIdx < cpuTableSize; tableIdx++) + { + + startAddr = adrv903x_CpuMemDumpTable[tableIdx].cpuMemAddr; + endAddr = adrv903x_CpuMemDumpTable[tableIdx].cpuMemAddr + adrv903x_CpuMemDumpTable[tableIdx].cpuMemSize - 1; + + /* Generate Register Record */ + recordCrc = 0U; + byteCount = 0U; + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + + /* Insert basic record header */ + recordType = ADI_ADRV903X_MEMDUMP_REG_RECORD; + recordLength = ADI_ADRV903X_MEMDUMP_REGISTER_HEADER_SIZE + adrv903x_CpuMemDumpTable[tableIdx].cpuMemSize; + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], recordType); + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], recordLength); + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + + /* Reset values for register record header */ + byteCount = 0U; + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + + + /* Construct Register record header*/ + startAddress = adrv903x_CpuMemDumpTable[tableIdx].cpuMemAddr; + length = adrv903x_CpuMemDumpTable[tableIdx].cpuMemSize; + registerWidth = adrv903x_CpuMemDumpTable[tableIdx].cpuMemWidth; + endianness = adrv903x_CpuMemDumpTable[tableIdx].cpuMemEndianness; + + byteCount += adrv903x_insert64Bits(&binaryRead[byteCount], startAddress); + byteCount += adrv903x_insert32Bits(&binaryRead[byteCount], length); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], registerWidth); + byteCount += adrv903x_insert8Bits( &binaryRead[byteCount], endianness); + byteCount += 2U; /* Padding */ + + /* Insert register buffer record header */ + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + recordCrc = adrv903x_Crc32ForChunk(binaryRead, byteCount, recordCrc, ADI_FALSE); + byteCount = 0U; + + recoveryAction = adrv903x_dumpMemoryRegion( device, + &ofp, + startAddr, + endAddr, + dumpSize, + &recordCrc); + + if(recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write CRC to a binary file."); + goto cleanup; + } + + /* Append CRC32 and padding*/ + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); /* Set binary to 0's */ + recordPadding = (recordLength % 8U) ? 8U - (recordLength % 8U) : 0U; + adrv903x_insert32Bits(&binaryRead[recordPadding], recordCrc); + byteCount = 8U + recordPadding; + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + goto cleanup; + } + } + } + byteCount = 0U; + +cleanup: + /*Close ARM binary file*/ + if (ofp != NULL) + { + if (ADI_LIBRARY_FCLOSE(ofp) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to close a binary file. Possible memory shortage while flushing / other I/O errors."); + } + } + + /* Disable the Tx slice clock of the uninitialized TX channels to retrieve the normal status before memory dump */ + sliceClkEn = 0x00U; + for (txChanId = 0U; txChanId <= ADI_ADRV903X_TX_CHAN_ID_MAX; txChanId++) + { + if (((device->devStateInfo.initializedChannels >> ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET) & (0x01 << (uint32_t)txChanId)) == 0U) + { + adrv903x_TxDig_TxAttenClkEnable_BfSet(device, NULL, txDigBaseAddr[txChanId], sliceClkEn); + } + } + + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} +static uint32_t adrv903x_insert64Bits( uint8_t* array, + uint64_t storeVariable) +{ + if(array == NULL) + { + return 0U; /* Return number of Bytes stored */ + } + *(array++) = storeVariable & 0xFFU; + *(array++) = (storeVariable >> 8) & 0xFFU; + *(array++) = (storeVariable >> 16) & 0xFFU; + *(array++) = (storeVariable >> 24) & 0xFFU; + *(array++) = (storeVariable >> 32) & 0xFFU; + *(array++) = (storeVariable >> 40) & 0xFFU; + *(array++) = (storeVariable >> 48) & 0xFFU; + *(array) = (storeVariable >> 56) & 0xFFU; + return 8U; /* Return number of Bytes stored */ +} +static uint32_t adrv903x_insert32Bits( uint8_t* array, + uint32_t storeVariable) +{ + if(array == NULL) + { + return 0U; /* Return number of Bytes stored */ + } + *(array++) = storeVariable & 0xFFU; + *(array++) = (storeVariable >> 8) & 0xFFU; + *(array++) = (storeVariable >> 16) & 0xFFU; + *(array) = (storeVariable >> 24) & 0xFFU; + return 4U; +} +static uint32_t adrv903x_insert16Bits( uint8_t* array, + uint16_t storeVariable) +{ + if(array == NULL) + { + return 0U; /* Return number of Bytes stored */ + } + *(array++) = storeVariable & 0xFFU; + *(array) = (storeVariable >> 8) & 0xFFU; + return 2U; /* Return number of Bytes stored */ +} +static uint32_t adrv903x_insert8Bits( uint8_t* array, + uint8_t storeVariable) +{ + if(array == NULL) + { + return 0U; /* Return number of Bytes stored */ + } + *(array) = storeVariable & 0xFFU; + return 1U; /* Return number of Bytes stored */ +} + +static adi_adrv903x_ErrAction_e adrv903x_dumpMemoryRegion( adi_adrv903x_Device_t* const device, + FILE **ofp, + uint32_t startAddr, + uint32_t endAddr, + uint32_t* const dumpSize, + uint32_t *recordCrc) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint32_t sizeFlag = 0U; + uint32_t offset = 0U; + uint32_t byteCount = 0U; + uint32_t read32 = 0U; + uint32_t i = 0U; + uint8_t skipRead = ADI_FALSE; + uint8_t binaryRead[ADI_ADRV903X_MEM_DUMP_CHUNK_SIZE + 10] = { 0U }; + const uint32_t cpuCrashAddr[] = { 0U }; /* Skip these addresses that causes CPU crash */ + const uint32_t SPI_ONLY_REGS_ADDR = 0x47000000U; + const uint32_t DIRECT_SPI_REGION_LEN = 0x4000U; + const uint32_t HARDWARE_SEMAPHORE_ADDR = 0x46500000U; + const uint32_t HARDWARE_SEMAPHORE_LEN = 0x200000U; + + if (startAddr == 0) + { + return ADI_ADRV903X_ERR_ACT_NONE; /* last entry */ + } + + /* if the cpuMemSize = 1, set the sizeFlag as 1 to ensure enter the below loop */ + if (startAddr == endAddr) + { + sizeFlag = 1U; + } + + for (offset = startAddr; ((offset < endAddr) || (1 == sizeFlag)); offset += ADI_ADRV903X_MEM_DUMP_CHUNK_SIZE) + { + /* Clean the flag for waiting for next cpuMemSize = 1 */ + sizeFlag = 0U; + if (offset < (endAddr - ADI_ADRV903X_MEM_DUMP_CHUNK_SIZE)) + { + byteCount = ADI_ADRV903X_MEM_DUMP_CHUNK_SIZE; + } + else + { + byteCount = endAddr + 1 - offset; + } + + *dumpSize += byteCount; + + + skipRead = ADI_FALSE; + ADI_LIBRARY_MEMSET(binaryRead, 0, sizeof(binaryRead)); + + for (i = 0U; i < sizeof(cpuCrashAddr) / sizeof(uint32_t); i++) + { + if (offset == cpuCrashAddr[i]) + { + skipRead = ADI_TRUE; + break; + } + } + + if (skipRead == ADI_FALSE) + { + + /* DIRECT READ Byte */ + if ((offset >= SPI_ONLY_REGS_ADDR) && + (offset < (SPI_ONLY_REGS_ADDR + DIRECT_SPI_REGION_LEN))) + { + for (i = 0; i < byteCount; i++) + { + recoveryAction = adi_adrv903x_Register32Read(device, NULL, offset + i, &read32, 0xFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset + i, "Unable to Read Cpu memory"); + return recoveryAction; + } + binaryRead[i] = (uint8_t)read32; + } + } + else + { + recoveryAction = adi_adrv903x_Registers32Read(device, NULL, offset, (uint32_t *)binaryRead, NULL, (byteCount + 3) / 4); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Unable to Read Cpu memory"); + return recoveryAction; + } + /* + * Hardware semaphore register check and reset operation: + * Hardware semaphore register will be set to 0x00 on read, + * The value will be set to all 1s on read if current value is all 0s, + * So need to retrieve the value after reading it in the CpuMemDump + */ + if (((offset + byteCount) < (HARDWARE_SEMAPHORE_ADDR + HARDWARE_SEMAPHORE_LEN)) && + (offset >= HARDWARE_SEMAPHORE_ADDR)) + { + recoveryAction = adi_adrv903x_Registers32Write(device, NULL, &offset, (uint32_t *)binaryRead, NULL, (byteCount + 3) / 4); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, offset, "Unable to re-write the hardware semaphore"); + return recoveryAction; + } + } + } + } + + if (ADI_LIBRARY_FWRITE(binaryRead, + 1, + byteCount, + *ofp) != byteCount) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Fatal error while trying to write a binary file."); + return recoveryAction; + } + /* Add the CRC value at the end of Radio side memory dump */ + if (offset >= endAddr - ADI_ADRV903X_MEM_DUMP_CHUNK_SIZE) + { + *recordCrc = adrv903x_Crc32ForChunk(binaryRead, byteCount, *recordCrc, ADI_TRUE); + } + else + { + *recordCrc = adrv903x_Crc32ForChunk(binaryRead, byteCount, *recordCrc, ADI_FALSE); + } + } + return ADI_ADRV903X_ERR_ACT_NONE; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuMemDump(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuMemDumpBinaryInfo_t* const cpuMemDumpBinaryInfoPtr, + const uint8_t forceException, + uint32_t* const dumpSize) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuMemDumpBinaryInfoPtr, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dumpSize, cleanup); + + + recoveryAction = adrv903x_CpuMemDumpBinWrite(device, cpuMemDumpBinaryInfoPtr, forceException, dumpSize, 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_CpuMemDump_vRamOnly(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuMemDumpBinaryInfo_t* const cpuMemDumpBinaryInfoPtr, + const uint8_t forceException, + uint32_t* const dumpSize) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuMemDumpBinaryInfoPtr, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, dumpSize, cleanup); + + + recoveryAction = adrv903x_CpuMemDumpBinWrite(device, cpuMemDumpBinaryInfoPtr, forceException, dumpSize, 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, ADI_NO_ERROR_MESSAGE); + goto cleanup; + } + + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairFileSave(adi_adrv903x_Device_t* const device, + const adi_adrv903x_JrxRepairBinaryInfo_t * const fileInfo, + adi_adrv903x_JrxRepairHistory_t* const repairHistory) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + FILE* repairHistoryFile = NULL; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, repairHistory, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, fileInfo, cleanup); + + if (ADI_LIBRARY_STRNLEN((const char*)fileInfo->filePath, ADI_ADRV903X_MAX_FILE_LENGTH) == ADI_ADRV903X_MAX_FILE_LENGTH) + { + /* File path is not terminated */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, fileInfo->filePath, "Unterminated path string"); + goto cleanup; + } + + /* Open JrxRepair History file */ +#ifdef __GNUC__ + repairHistoryFile = ADI_LIBRARY_FOPEN((const char *)fileInfo->filePath, "w"); +#else + if (ADI_LIBRARY_FOPEN_S(&repairHistoryFile, (const char *)fileInfo->filePath, "w") != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, fileInfo->filePath, "Invalid File or Path Detected"); + goto cleanup; + } +#endif + if (NULL == repairHistoryFile) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, fileInfo->filePath, "Invalid Binary File or Path Detected"); + goto cleanup; + } + + /* Write to File */ + if (-1 < ADI_LIBRARY_FPRINTF(repairHistoryFile, "%016hi%08hhu%08hhu%08hhu\n", repairHistory->lastTemp, repairHistory->badLaneMask, repairHistory->weakLaneMask, repairHistory->goodLaneMask)) + { + if (0 != ADI_LIBRARY_FFLUSH(repairHistoryFile)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, fileInfo->filePath, "Error writing to repair history file"); + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + +cleanup: + /* Close JrxRepair History File */ + if (0 == ADI_LIBRARY_FCLOSE(repairHistoryFile)) + { + repairHistoryFile = NULL; + } + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairFileLoad(adi_adrv903x_Device_t* const device, + const adi_adrv903x_JrxRepairBinaryInfo_t* const fileInfo, + adi_adrv903x_JrxRepairHistory_t* const repairHistory) +{ + const uint32_t expectedFileSize = 41U; + + adi_adrv903x_JrxRepairHistory_t repairHistoryRd; + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + FILE* repairHistoryFile = NULL; + uint32_t fileSize = 0U; + int16_t lastTempConvert = 0; /* Variable used to prevent truncation of 16 bit signed when parsing */ + char fileBuf[expectedFileSize]; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, repairHistory, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, fileInfo, cleanup); + + if (ADI_LIBRARY_STRNLEN((const char*)fileInfo->filePath, ADI_ADRV903X_MAX_FILE_LENGTH) == ADI_ADRV903X_MAX_FILE_LENGTH) + { + /* Path is not terminated */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, fileInfo->filePath, "Unterminated path string"); + goto cleanup; + } + + /* Open JrxRepair History file */ +#ifdef __GNUC__ + repairHistoryFile = ADI_LIBRARY_FOPEN((const char *)fileInfo->filePath, "rb"); +#else + if (ADI_LIBRARY_FOPEN_S(&repairHistoryFile, (const char *)fileInfo->filePath, "rb") != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, filePath, "Invalid File or Path Detected"); + goto cleanup; + } +#endif + if (NULL == repairHistoryFile) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, fileInfo->filePath, "Invalid Binary File or Path Detected"); + goto cleanup; + } + + /* Determine file size */ + if (ADI_LIBRARY_FSEEK(repairHistoryFile, 0, SEEK_END) != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_INTERFACE; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, fileInfo->filePath, "Seek to EOF Failed"); + goto cleanup; + } + + /* ADI_LIBRARY_FTELL returns long type */ + fileSize = (uint32_t) ADI_LIBRARY_FTELL(repairHistoryFile); + + /* Check if File is Empty */ + if (fileSize == 0U) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, repairHistoryFile, "Zero Length File Detected"); + goto cleanup; + } + + /* Verify file contains at least the archive header */ + if (fileSize < sizeof(adi_adrv903x_JrxRepairHistory_t)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, fileInfo->filePath, "Invalid file detected (very small)"); + goto cleanup; + } + + /* Rewind the file pointer to beginning of the file */ + if (ADI_LIBRARY_FSEEK(repairHistoryFile, 0, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, fileInfo->filePath, "Unable to Rewind File Pointer"); + goto cleanup; + } + + ADI_LIBRARY_FREAD(&fileBuf, 1U, expectedFileSize, repairHistoryFile); + fileBuf[expectedFileSize - 1U] = '\0'; + + if (4U != sscanf(fileBuf, "%16d%8hhu%8hhu%8hhu", (int*)&lastTempConvert, (uint8_t*)&repairHistoryRd.badLaneMask, (uint8_t*)&repairHistoryRd.weakLaneMask, (uint8_t*)&repairHistoryRd.goodLaneMask)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_FEATURE; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, fileInfo->filePath, "Error reading repairHistory from file"); + goto cleanup; + } + + repairHistoryRd.lastTemp = lastTempConvert; + + if (NULL != ADI_LIBRARY_MEMCPY(repairHistory, &repairHistoryRd, sizeof(adi_adrv903x_JrxRepairHistory_t))) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + } + +cleanup: + if (repairHistoryFile != NULL) + { + /* Close repairHistory File */ + if (0 == ADI_LIBRARY_FCLOSE(repairHistoryFile)) + { + repairHistoryFile = NULL; + } + } + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairHistoryCheck(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepair_t* const jrxRepair, + int16_t* const checkTemp) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_DevTempData_t deviceTemperature; + + uint8_t screenID = 0U; + uint8_t usedDeserLanes = 0U; + + uint32_t index = 0U; + uint32_t localCheckResult = 0x00U; + + int16_t localCheckTemperature = 0; + + static const uint8_t SERDES_TEMP_INDEX = 11U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, jrxRepair, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, checkTemp, cleanup); + + /* check CM screen ID */ + recoveryAction = adrv903x_JrxRepairScreenTestChecker(device, &screenID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to find screenID for part."); + goto cleanup; + } + /* check temperature to see if the problem is caused by the VCM */ + recoveryAction = adi_adrv903x_TemperatureGet(device, 0U, &deviceTemperature); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get the temperature of the part."); + goto cleanup; + } + + localCheckTemperature = deviceTemperature.tempDegreesCelsius[SERDES_TEMP_INDEX]; + if (screenID == 0U) + { + /* check if we already applied a self repair */ + if ((device->devStateInfo.devState & ADI_ADRV903X_STATE_JRXREPAIRED) == ADI_ADRV903X_STATE_JRXREPAIRED) + { + /* If the conditions have changed then we need to rerun the repair for bad lanes */ + localCheckResult = (uint32_t)(ADI_ADRV903X_JRX_REPAIR_SWC_ALREADY_ENABLED | ADI_ADRV903X_JRX_REPAIR_UNKNOWN_ERROR); + } + else + { + /* first time checking the for History */ + if ((device->devStateInfo.devState & ADI_ADRV903X_STATE_INITCALS_RUN) != ADI_ADRV903X_STATE_INITCALS_RUN) + { + /* if Post MCS Init is not complete, just load the history */ + localCheckResult = (uint32_t)(ADI_ADRV903X_JRX_REPAIR_LOAD_HISTORY); + } + else + { + /* Not at start-up, assume history.lastTemp is initialized */ + if (localCheckTemperature < (jrxRepair->history.lastTemp + ADI_ADRV903X_FACTORY_TEMPERATURE_MARGIN)) + { + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + usedDeserLanes |= device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled; + } + + localCheckResult = (uint32_t)(ADI_ADRV903X_JRX_REPAIR_FAULTY_VCM_AMP); + jrxRepair->history.badLaneMask = 0x00U; + jrxRepair->history.goodLaneMask = usedDeserLanes; /* default all good */ + jrxRepair->history.weakLaneMask = 0x00U; + } + else + { + /* temperature not matching the failure mechanism, the errors are not due to VCM */ + localCheckResult = (uint32_t)(ADI_ADRV903X_JRX_REPAIR_TEMP_GT_LAST | ADI_ADRV903X_JRX_REPAIR_UNKNOWN_ERROR); + } + } + } + } + else + { + /* Part is screened, no need to check for VCM issue */ + localCheckResult = (uint32_t)(ADI_ADRV903X_JRX_REPAIR_SCREENED | ADI_ADRV903X_JRX_REPAIR_UNKNOWN_ERROR); + } + +cleanup: + if (recoveryAction == ADI_ADRV903X_ERR_ACT_NONE) + { + *checkTemp = localCheckTemperature; + jrxRepair->historyCheck = (localCheckResult | (uint32_t)(ADI_ADRV903X_JRX_REPAIR_CHECKED)); + } + + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairEnter(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepair_t* const jrxRepair) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t localTcEnabledLanes = 0U; + uint8_t trackingCalActive = 0U; + uint32_t index = 0U; + uint32_t timeElapsedUs = 0U; + + adi_adrv903x_ChannelTrackingCals_t chanMaskv2; + adi_adrv903x_TrackingCalState_t trackingCalState; + adi_adrv903x_TrackingCalEnableMasks_t tcEnableMask; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, jrxRepair, cleanup); + + /* Store Enabled Lanes for tracking calibration */ + recoveryAction = adi_adrv903x_TrackingCalsEnableGet(device, &tcEnableMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while storing enabled tracking cals."); + goto cleanup; + } + + for (index = 0U; index < ADI_ADRV903X_NUM_TRACKING_CAL_CHANNELS; index++) + { + if ((tcEnableMask.enableMask[index] & ADI_ADRV903X_TC_TX_SERDES_MASK) != 0x0U) + { + localTcEnabledLanes |= (1U << index); + } + } + + if (localTcEnabledLanes != 0U) + { + /* Disable Serdes Tracking Cal */ + chanMaskv2.rxChannel = 0x00U; + chanMaskv2.txChannel = 0x00U; + chanMaskv2.orxChannel = 0x00U; + chanMaskv2.laneSerdes = localTcEnabledLanes; + recoveryAction = adi_adrv903x_TrackingCalsEnableSet_v2(device, ADI_ADRV903X_TC_TX_SERDES_MASK, &chanMaskv2, ADI_ADRV903X_TRACKING_CAL_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Disable Serdes Tracking Calibration"); + goto cleanup; + } + + /* Poll tracking cals state to be inactive */ + for (timeElapsedUs = 0U; timeElapsedUs < ADI_ADRV903X_TRACKCALDISABLE_TIMEOUT_US; timeElapsedUs += ADI_ADRV903X_TRACKCALDISABLE_INTERVAL_US) + { + trackingCalActive = ADI_DISABLE; + /* Retrieve Tracking Cals state */ + recoveryAction = adi_adrv903x_TrackingCalAllStateGet(device, &trackingCalState); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while getting Tracking Cals State"); + goto cleanup; + } + + /* check if serdes tracking cal is inactive */ + for (index = 0U; index < ADI_ADRV903X_NUM_TRACKING_CAL_CHANNELS; index++) + { + if (((localTcEnabledLanes & (1U << index)) != 0U) && + ((trackingCalState.calState[index][ADI_ADRV903X_TC_TX_SERDES] & ADI_ADRV903X_TC_STATE_INACTIVE) != ADI_ADRV903X_TC_STATE_INACTIVE)) + { + trackingCalActive = ADI_ENABLE; + break; + } + } + + /* Break out here if serdes tracking cals is Inactive */ + if (trackingCalActive == ADI_DISABLE) + { + break; + } + + /* Serdes tracking cals is still running. Wait the specified wait interval, then check again for inactivity. */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, ADI_ADRV903X_TRACKCALDISABLE_INTERVAL_US); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Issue"); + goto cleanup; + } + } + + /* Check for Tracking Cal Inactive timeout */ + if (timeElapsedUs >= ADI_ADRV903X_TRACKCALDISABLE_TIMEOUT_US) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_TIMEOUT, recoveryAction, timeElapsedUs, "Serdes Tracking Cal Inactive Timeout"); + goto cleanup; + } + } + + /* enable PRBS if required */ + if (jrxRepair->dfrmPrbsCfg.polyOrder != ADI_ADRV903X_PRBS_DISABLE) + { + recoveryAction = adi_adrv903x_DfrmPrbsCheckerStateSet(device, &jrxRepair->dfrmPrbsCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set the PRBS mode"); + goto cleanup; + } + } + + jrxRepair->tcEnabledLaneMask = localTcEnabledLanes; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairExit(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepair_t* const jrxRepair) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + adi_adrv903x_DfrmPrbsCfg_t dfrmPrbsCfg; + adi_adrv903x_ChannelTrackingCals_t chanMaskv2; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + /* disable PRBS if enabled */ + recoveryAction = adi_adrv903x_DfrmPrbsCheckerStateGet(device, &dfrmPrbsCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get the PRBS mode"); + goto cleanup; + } + + if (dfrmPrbsCfg.polyOrder != ADI_ADRV903X_PRBS_DISABLE) + { + dfrmPrbsCfg.polyOrder = ADI_ADRV903X_PRBS_DISABLE; + recoveryAction = adi_adrv903x_DfrmPrbsCheckerStateSet(device, &dfrmPrbsCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set the PRBS mode"); + goto cleanup; + } + } + else + { + /* Re-enable tracking cals if it was enabled previously */ + if (jrxRepair->tcEnabledLaneMask != 0U) + { + chanMaskv2.rxChannel = 0x00U; + chanMaskv2.txChannel = 0x00U; + chanMaskv2.orxChannel = 0x00U; + chanMaskv2.laneSerdes = jrxRepair->tcEnabledLaneMask; + recoveryAction = adi_adrv903x_TrackingCalsEnableSet_v2(device, ADI_ADRV903X_TC_TX_SERDES_MASK, &chanMaskv2, ADI_ADRV903X_TRACKING_CAL_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Enable Serdes Tracking Calibration"); + goto cleanup; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairBiasSurvey(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepairHistory_t* const repairHistory, + adi_adrv903x_JrxRepairBiasSurvey_t* const biasSurvey) +{ + static const uint8_t MAX_SCORE = (1U << ADI_ADRV903X_JRX_REPAIR_BIAS_NUM) - 1U; + + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t ibiasFix = 0U; + uint8_t ibiasFixDefault = 0U; + uint8_t usedDeserLanes = 0U; + uint8_t calSincePowerUp = 0U; + uint8_t laneSel = 0U; + uint8_t goodLanes = 0U; + uint8_t badLanes = 0U; + uint8_t weakLanes = 0U; + uint8_t badScore = 0U; + uint32_t index = 0U; + uint32_t laneIdx = 0U; + + uint8_t laneScore[ADI_ADRV903X_MAX_DESERIALIZER_LANES]; + ADI_PLATFORM_LARGE_VAR_ALLOC(adi_adrv903x_InitCalErrData_t, initCalErrDataPtr); + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, initCalErrDataPtr, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, repairHistory, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, biasSurvey, cleanup); + + + recoveryAction = adrv903x_JrxRepairHistoryRangeCheck(device, repairHistory); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid Jrx Repair History."); + goto cleanup; + } + + ADI_LIBRARY_MEMSET(biasSurvey, 0, sizeof(adi_adrv903x_JrxRepairBiasSurvey_t)); + + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + usedDeserLanes |= device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled; + } + + recoveryAction = adrv903x_SerdesRxdig8packRegmapCore1p2_CtrlIbiasFix_BfGet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK, + &ibiasFixDefault); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Get Default bias setting"); + goto cleanup; + } + + if (ibiasFixDefault == ADI_ADRV903X_JRX_REPAIR_MAX_BIAS) + { + recoveryAction = adi_adrv903x_InitCalsDetailedStatusGet_v2(device, initCalErrDataPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Get Initcal Status"); + goto cleanup; + } + for (laneIdx = 0U; laneIdx < ADI_ADRV903X_MAX_DESERIALIZER_LANES; laneIdx++) + { + if (((usedDeserLanes & (1 << laneIdx)) != 0U) && + ((initCalErrDataPtr->channel[laneIdx].calsSincePowerUp & ADI_ADRV903X_IC_SERDES) == ADI_ADRV903X_IC_SERDES)) + { + calSincePowerUp |= (1 << laneIdx); + } + } + } + + badScore = (1U << (ibiasFixDefault - ADI_ADRV903X_JRX_REPAIR_MIN_BIAS)) - 1U; + + for (ibiasFix = (uint8_t)ADI_ADRV903X_JRX_REPAIR_MAX_BIAS, index = (ADI_ADRV903X_JRX_REPAIR_BIAS_NUM - 1U); + ibiasFix >= (uint8_t)ADI_ADRV903X_JRX_REPAIR_MIN_BIAS; + ibiasFix--, index--) + { + /* skip fast attack for the first run if nominal bias is maximum bias */ + if ((ibiasFix != ibiasFixDefault) || (ibiasFix != ADI_ADRV903X_JRX_REPAIR_MAX_BIAS) || (calSincePowerUp != usedDeserLanes)) + { + recoveryAction = adrv903x_SerdesRxdig8packRegmapCore1p2_CtrlIbiasFix_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK, + ibiasFix); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to set new bias setting"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_JrxRepairFastAttackRun(device, initCalErrDataPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Run Serdes Fast Attack Initcal"); + goto cleanup; + } + } + + /* Get Errors with JrxRepairTest */ + recoveryAction = adi_adrv903x_JrxRepairTest(device, &(biasSurvey->biasTests[index])); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, ibiasFix, "Failed to test new Bias settings"); + goto cleanup; + } + + } + + recoveryAction = adrv903x_SerdesRxdig8packRegmapCore1p2_CtrlIbiasFix_BfSet(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK, + ibiasFixDefault); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Set Default bias setting"); + goto cleanup; + } + + /* evaluate bias survey */ + for (laneIdx = 0U; laneIdx < ADI_ADRV903X_MAX_DESERIALIZER_LANES; laneIdx++) + { + laneScore[laneIdx] = MAX_SCORE; + for (index = 0U; index < ADI_ADRV903X_JRX_REPAIR_BIAS_NUM; index++) + { + if (biasSurvey->biasTests[index].laneErrors[laneIdx] != 0U) + { + laneScore[laneIdx] &= ~(1U << index); + } + } + } + + /* update history */ + for (laneIdx = 0U; laneIdx < ADI_ADRV903X_MAX_DESERIALIZER_LANES; laneIdx++) + { + laneSel = (1U << laneIdx); + if ((usedDeserLanes & laneSel) == 0U) + { + continue; + } + + if (laneScore[laneIdx] == MAX_SCORE) + { + goodLanes |= laneSel; + } + else if (laneScore[laneIdx] <= badScore) + { + badLanes |= laneSel; + } + else + { + weakLanes |= laneSel; + } + } + + /* update history */ + repairHistory->goodLaneMask &= goodLanes; + repairHistory->badLaneMask |= badLanes; + repairHistory->weakLaneMask = weakLanes; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairFastAttackRun(adi_adrv903x_Device_t* const device, + adi_adrv903x_InitCalErrData_t* const initCalErrData) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint8_t usedDeserLanes = 0U; + uint32_t index = 0U; + + adrv903x_CpuCmd_EnFastAttack_t enFastAttackCmd; + adrv903x_CpuCmd_EnFastAttackResp_t enFastAttackCmdRsp; + adi_adrv903x_InitCals_t initCalCfg; + + static const uint32_t INIT_CALS_TIMEOUT_MS = 10000U; /* 10 Seconds Timeout */ + uint32_t init_cals_timeout_ms = INIT_CALS_TIMEOUT_MS; + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, initCalErrData, cleanup); + + /* Enable Fast Attack mode for Serdes initcal */ + enFastAttackCmd.calMask = ADRV903X_HTOCL(ADI_ADRV903X_TC_TX_SERDES_MASK); + + for (index = 0U; index < (uint32_t) ADI_ADRV903X_CPU_TYPE_MAX_RADIO; index++) + { + recoveryAction = adrv903x_CpuCmdSend(device, + (adi_adrv903x_CpuType_e)index, + ADRV903X_LINK_ID_0, + ADRV903X_CPU_CMD_ID_ENABLE_FAST_ATTACK, + (void*)&enFastAttackCmd, + sizeof(adrv903x_CpuCmd_EnFastAttack_t), + (void*)&enFastAttackCmdRsp, + sizeof(adrv903x_CpuCmd_EnFastAttackResp_t), + NULL); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Failed to set Serdes InitCal in Fast attack mode"); + goto cleanup; + } + } + + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + usedDeserLanes |= device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled; + } + + /* Run Serdes Initcal */ + initCalCfg.calMask = ADI_ADRV903X_IC_SERDES; + initCalCfg.txChannelMask = 0x00U; + initCalCfg.orxChannelMask = 0x00U; + initCalCfg.rxChannelMask = usedDeserLanes; + initCalCfg.warmBoot = 0U; + + recoveryAction = adi_adrv903x_InitCalsRun(device, &initCalCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "InitCalsRun Failed"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_InitCalsWait_v2(device, init_cals_timeout_ms, initCalErrData); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Initial Calibration Wait Issue"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairTest(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepairTest_t* const testResult) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + + typedef struct + { + uint8_t dfrmIdx; + uint8_t logicLaneId; + } JrxLinkLogicLaneInfo_t; + + JrxLinkLogicLaneInfo_t logicLaneInfo[ADI_ADRV903X_MAX_DESERIALIZER_LANES]; + + uint8_t pclkErrClear[ADI_ADRV903X_MAX_DEFRAMERS] = { 0U }; + + uint8_t pclkSlowErr = 0U; + uint8_t pclkFastErr = 0U; + + + uint8_t linkType = 0U; + uint8_t laneId = 0U; + uint8_t bfValue = 0U; + uint8_t usedDeserLanes = 0U; + + uint32_t usedDfrmBaseAddr = ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_; + uint32_t index = 0U; + + adi_adrv903x_DeframerSel_e usedDfrm = ADI_ADRV903X_DEFRAMER_0; + adi_adrv903x_DfrmPrbsCfg_t dfrmPrbsCfg; + + adi_adrv903x_Dfrm204cErrCounterStatus_t dfrm204cErrCnt; + adi_adrv903x_DfrmErrCounterStatus_t dfrm204bErrCnt; + adi_adrv903x_DfrmPrbsErrCounters_t dfrmPrbsErrCnt; + + static const uint8_t JRX204C_STATE_FEC_READY = 6U; + static const uint32_t JRX_LINK_BASE_ADDR[ADI_ADRV903X_MAX_DEFRAMERS] = + { + ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_, + ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_ + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, testResult, cleanup); + + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + if (device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled != 0) + { + usedDfrm = (adi_adrv903x_DeframerSel_e)(1U << index); + usedDfrmBaseAddr = JRX_LINK_BASE_ADDR[index]; + } + usedDeserLanes |= device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled; + } + + /* Mode: PRBS, 204C or 204B */ + recoveryAction = adi_adrv903x_DfrmPrbsCheckerStateGet(device, &dfrmPrbsCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get the PRBS mode"); + goto cleanup; + } + + /* Get the Deframer link type */ + recoveryAction = adrv903x_JrxLink_JrxLinkType_BfGet(device, + NULL, + (adrv903x_BfJrxLinkChanAddr_e)usedDfrmBaseAddr, + &linkType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link type for Deframer"); + goto cleanup; + } + + /* Init/Reset Error Counters and Link Layer Error Status */ + if (dfrmPrbsCfg.polyOrder == ADI_ADRV903X_PRBS_DISABLE) + { + + /* Init Logic Lane Info */ + for (laneId = 0U; laneId < (uint8_t)ADI_ADRV903X_MAX_DESERIALIZER_LANES; laneId++) + { + logicLaneInfo[laneId].dfrmIdx = 0U; + logicLaneInfo[laneId].logicLaneId = (uint8_t)ADI_ADRV903X_MAX_DESERIALIZER_LANES; + } + + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + if (device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled == 0U) + { + continue; + } + + recoveryAction = adrv903x_JrxLink_JrxCorePclkErrorClear_BfGet(device, NULL, (adrv903x_BfJrxLinkChanAddr_e)JRX_LINK_BASE_ADDR[index], &pclkErrClear[index]); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Failed to Read Deframer PCLK Error Clear status"); + goto cleanup; + } + + for (laneId = 0U; laneId < (uint8_t)ADI_ADRV903X_MAX_DESERIALIZER_LANES; laneId++) + { + recoveryAction = adrv903x_JrxLink_JrxCoreLaneSel_BfGet(device, NULL, (adrv903x_BfJrxLinkChanAddr_e)JRX_LINK_BASE_ADDR[index], laneId, &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, laneId, "Error while reading Jrx Link Xbar"); + goto cleanup; + } + if (bfValue < ADI_ADRV903X_MAX_DESERIALIZER_LANES) + { + logicLaneInfo[bfValue].logicLaneId = laneId; + logicLaneInfo[bfValue].dfrmIdx = index; + } + } + } + + + if (linkType != 0U) + { + /* 204C link type case */ + for (index = 0; index < ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + if(device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled != 0U){ + recoveryAction = adi_adrv903x_Dfrm204cErrCounterReset(device, (adi_adrv903x_DeframerSel_e)(1U << index)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Reseting 204C Deframer Error Counters"); + goto cleanup; + } + } + } + + recoveryAction = adrv903x_JesdCommon_JrxDl204cHoldErrCnt_BfSet(device, NULL, ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, ADI_ENABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Holding 204C Deframer Error Counters"); + goto cleanup; + } + } + else + { + /* 204B link type case*/ + for (laneId = 0; laneId < (uint8_t)ADI_ADRV903X_MAX_DESERIALIZER_LANES; laneId++) + { + if ((usedDeserLanes & (1U << laneId)) != 0U) + { + recoveryAction = adrv903x_JesdCommon_JrxDl204bEcntTch_BfSet(device, NULL, ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, laneId, 0x7U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Holding 204B Error Counters"); + goto cleanup; + } + recoveryAction = adrv903x_JesdCommon_JrxDl204bEcntEna_BfSet(device, NULL, ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, laneId, 0x7U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Enabling 204B Error Counters"); + goto cleanup; + } + /* Deframer Selection doesn't really matter */ + recoveryAction = adi_adrv903x_DfrmErrCounterReset(device, usedDfrm, laneId, 0x7U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Reseting 204B Deframer Error Counters"); + goto cleanup; + } + } + } + + /* Clear 204B IRQ */ + recoveryAction = adi_adrv903x_DfrmIrqSourceReset(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to clear 204B IRQs"); + goto cleanup; + } + + + /* Enable PCLK Errors (if it is not enabled) in 204B case */ + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + if ((device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled == 0U) || (pclkErrClear[index] == 0U)) + { + continue; + } + + recoveryAction = adrv903x_JrxLink_JrxCorePclkErrorClear_BfSet(device, NULL, (adrv903x_BfJrxLinkChanAddr_e)JRX_LINK_BASE_ADDR[index], 0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Failed to Enable Deframer PCLK Error"); + goto cleanup; + } + } + + } + + /* clear possible PCLK errors */ + recoveryAction = adi_adrv903x_DeframerErrorCtrl(device, ADI_ADRV903X_ALL_DEFRAMER, ADI_ADRV903X_SERDES_PCLK_ERR_CLEAR); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to clear PCLK Errors"); + goto cleanup; + } + } + else + { + /* PRBS Checker is enabled */ + recoveryAction = adi_adrv903x_DfrmPrbsCountReset(device); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to clear PRBS counters"); + goto cleanup; + } + } + + /* Wait a bit */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, ADI_ADRV903X_JRXREPAIR_TEST_WAIT_US); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Issue"); + goto cleanup; + } + + /* Read Counter */ + if (dfrmPrbsCfg.polyOrder == ADI_ADRV903X_PRBS_DISABLE) + { + for (laneId = 0U; laneId < ADI_ADRV903X_MAX_DESERIALIZER_LANES; laneId++) + { + if ((usedDeserLanes & (1U << laneId)) == 0U) + { + testResult->laneErrors[laneId] = 0U; + continue; + } + + if (linkType != 0U) + { + /* 204C link type case */ + recoveryAction = adrv903x_JesdCommon_JrxDl204cState_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, laneId, &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get 204C Lane State"); + goto cleanup; + } + if (bfValue != JRX204C_STATE_FEC_READY) + { + /* Lane is not in a good state */ + testResult->laneErrors[laneId] = 0xFFFFFFFFU; + continue; + } + + recoveryAction = adi_adrv903x_Dfrm204cErrCounterStatusGet(device, usedDfrm, laneId, &dfrm204cErrCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get 204C Error Counters"); + goto cleanup; + } + testResult->laneErrors[laneId] = (((uint32_t)dfrm204cErrCnt.shCntValue << 24U) | + ((uint32_t)dfrm204cErrCnt.embCntValue << 16U) | + ((uint32_t)dfrm204cErrCnt.mbCntValue << 8U) | + (uint32_t)dfrm204cErrCnt.crcCntValue); + } + else + { + /* 204B link type case */ + recoveryAction = adrv903x_JesdCommon_JrxDl204bSyncN_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, laneId, &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get 204B Lane Sync N"); + goto cleanup; + } + if (bfValue == ADI_DISABLE) + { + /* Lane is not in a good state */ + testResult->laneErrors[laneId] = 0xFFFFFFFFU; + continue; + } + recoveryAction = adrv903x_JesdCommon_JrxDl204bCgs_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, laneId, &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get 204B Lane CGS sync"); + goto cleanup; + } + if (bfValue == ADI_DISABLE) + { + /* Lane is not in a good state */ + testResult->laneErrors[laneId] = 0xFFFFFFFFU; + continue; + } + + + if (logicLaneInfo[laneId].logicLaneId < ADI_ADRV903X_MAX_DESERIALIZER_LANES) + { + /* Verify Logic Lane PCLK fast/slow errors */ + recoveryAction = adrv903x_JrxLink_JrxCorePclkFastError_BfGet(device, NULL, + (adrv903x_BfJrxLinkChanAddr_e)JRX_LINK_BASE_ADDR[logicLaneInfo[laneId].dfrmIdx], + logicLaneInfo[laneId].logicLaneId, &pclkFastErr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Read Logic Lane PCLK Fast Error"); + goto cleanup; + } + recoveryAction = adrv903x_JrxLink_JrxCorePclkSlowError_BfGet(device, NULL, + (adrv903x_BfJrxLinkChanAddr_e)JRX_LINK_BASE_ADDR[logicLaneInfo[laneId].dfrmIdx], + logicLaneInfo[laneId].logicLaneId, &pclkSlowErr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Read Logic Lane PCLK Slow Error"); + goto cleanup; + } + if ((pclkFastErr == ADI_ENABLE) && (pclkSlowErr == ADI_ENABLE)) + { + /* Lane is not in a good state */ + testResult->laneErrors[laneId] = 0xFFFFFFFFU; + continue; + } + } + + + recoveryAction = adi_adrv903x_DfrmErrCounterStatusGet(device, usedDfrm, laneId, &dfrm204bErrCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get 204B Error Counters"); + goto cleanup; + } + testResult->laneErrors[laneId] = (((uint32_t)dfrm204bErrCnt.bdCntValue << 16U) | + ((uint32_t)dfrm204bErrCnt.nitCntValue << 8U) | + (uint32_t)dfrm204bErrCnt.uekCntValue); + } + } + + /* some clean up */ + if (linkType != 0U) + { + recoveryAction = adrv903x_JesdCommon_JrxDl204cHoldErrCnt_BfSet(device, NULL, ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, ADI_DISABLE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Releasing 204C Deframer Error Counters"); + goto cleanup; + } + } + else + { + /* 204B link type case*/ + for (laneId = 0; laneId < (uint8_t)ADI_ADRV903X_MAX_DESERIALIZER_LANES; laneId++) + { + if ((usedDeserLanes & (1U << laneId)) != 0U) + { + recoveryAction = adrv903x_JesdCommon_JrxDl204bEcntTch_BfSet(device, NULL, ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, laneId, 0x0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while Releasing 204B Error Counters"); + goto cleanup; + } + } + } + + + /* Restore PCLK Errors status in 204B case */ + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + if ((device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled == 0U) || (pclkErrClear[index] == 0U)) + { + continue; + } + + recoveryAction = adrv903x_JrxLink_JrxCorePclkErrorClear_BfSet(device, NULL, (adrv903x_BfJrxLinkChanAddr_e)JRX_LINK_BASE_ADDR[index], 1U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_ERROR_REPORT(&device->common, ADI_ADRV903X_ERRSRC_API, ADI_COMMON_ERRCODE_API, recoveryAction, index, "Failed to Disable Deframer PCLK Error"); + goto cleanup; + } + } + + } + } + else + { + /* PRBS Mode */ + dfrmPrbsErrCnt.sampleSource = ADI_ADRV903X_PRBSCHECK_LANEDATA; + recoveryAction = adi_adrv903x_DfrmPrbsErrCountGet(device, &dfrmPrbsErrCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get PRBS Error Counters"); + goto cleanup; + } + for (laneId = 0U; laneId < (uint8_t)ADI_ADRV903X_MAX_DESERIALIZER_LANES; laneId++) + { + if ((usedDeserLanes & (1U << laneId)) == 0U) + { + testResult->laneErrors[laneId] = 0U; + } + else + { + testResult->laneErrors[laneId] = dfrmPrbsErrCnt.laneErrors[laneId]; + } + } + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairApply(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepairHistory_t* const repairHistory) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint8_t usedDeserLanes = 0U; + uint8_t useLanesFix = 0U; + uint32_t index = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, repairHistory, cleanup); + + recoveryAction = adrv903x_JrxRepairHistoryRangeCheck(device, repairHistory); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Invalid Jrx Repair History."); + goto cleanup; + } + + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + usedDeserLanes |= device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled; + } + + if ((repairHistory->badLaneMask != 0U) || (repairHistory->weakLaneMask != 0U)) + { + useLanesFix = ADI_TRUE; + } + else + { + useLanesFix = ADI_FALSE; + } + + /* Enable SwC */ + recoveryAction = adi_adrv903x_JrxRepairVcmLanesFix(device, usedDeserLanes, useLanesFix); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Set SwC Enabled"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairSwCEnableGet(adi_adrv903x_Device_t* const device, + uint8_t* const swcEnMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint8_t ctrlDataSet[9U]; + uint8_t ctrlDataGet[9U]; + uint8_t usedDeserLanes = 0U; + uint8_t localSwcEnMask = 0U; + uint8_t laneSel = 0U; + + uint32_t lengthResp = 0U; + uint32_t timeElapsedUs = 0U; + uint32_t index = 0U; + uint32_t laneCnt = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, swcEnMask, cleanup); + + /* Prepare the command payload */ + ctrlDataSet[0] = 0x00U; + ctrlDataSet[1] = (uint8_t)ADRV903X_SERDES_TEST_CMD; + ctrlDataSet[2] = (uint8_t)ADRV903X_SERDES_TEST_SET_VCM_SWC; + ctrlDataSet[3] = 0x01U; + ctrlDataSet[4] = 0x00U; + ctrlDataSet[5] = 0x00U; + ctrlDataSet[6] = 0x00U; + ctrlDataSet[7] = 0x00U; + ctrlDataSet[8] = 0x00U; + + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + usedDeserLanes |= device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled; + } + + /* Run the command for two used lanes */ + for (index = 0U; (index < (uint32_t)ADI_ADRV903X_MAX_DESERIALIZER_LANES) && (laneCnt < 2U); index++) + { + laneSel = (1U << index); + + if ((usedDeserLanes & laneSel) == 0U) + { + continue; + } + + laneCnt++; + ctrlDataSet[0] = (uint8_t)index; + + /* Exec command */ + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + ADRV903X_CPU_OBJID_IC_SERDES, + ADRV903X_SERDES_CTRL_SET_FSM_CMD, + (adi_adrv903x_Channels_e)laneSel, + ctrlDataSet, + sizeof(ctrlDataSet), + &lengthResp, + ctrlDataGet, + sizeof(ctrlDataGet)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to run Jrx VCM Switch C Set command"); + goto cleanup; + } + + /* Poll Serdes Calibration Status for completion of the SwC set Command */ + for (timeElapsedUs = 0U; timeElapsedUs < ADI_ADRV903X_TRACKCALDISABLE_TIMEOUT_US; timeElapsedUs += ADI_ADRV903X_TRACKCALDISABLE_INTERVAL_US) + { + /* Get Serdes Calibration Status */ + recoveryAction = adi_adrv903x_CalSpecificStatusGet( device, + (adi_adrv903x_Channels_e)laneSel, + ADRV903X_CPU_OBJID_TC_SERDES, + ctrlDataGet, + sizeof(ctrlDataGet)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get SwC set Command status failed"); + goto cleanup; + } + + /* Break out here if SwC set Command have been completed */ + if (ctrlDataGet[1] == (uint8_t)ADRV903X_SERDES_TEST_CMD_DONE) + { + break; + } + + /* SwC set Command is still in progress. Wait the specified wait interval, then check again for status. */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, ADI_ADRV903X_TRACKCALDISABLE_INTERVAL_US); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Issue"); + goto cleanup; + } + } + + /* Check for timeout */ + if (timeElapsedUs >= ADI_ADRV903X_TRACKCALDISABLE_TIMEOUT_US) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_TIMEOUT, + recoveryAction, + timeElapsedUs, + "SwC set Command Timeout"); + goto cleanup; + } + + localSwcEnMask |= ctrlDataGet[ADRV903X_SERDES_CTRL_FSM_CMD_RSP_HDR_SIZE_BYTES]; + } + + *swcEnMask = localSwcEnMask; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairSwCEnableSet(adi_adrv903x_Device_t* const device, + const uint8_t swcEnMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint8_t ctrlDataSet[9U]; + uint8_t ctrlDataGet[9U]; + uint8_t usedDeserLanes = 0U; + uint8_t laneSel = 0U; + + uint32_t lengthResp = 0U; + uint32_t timeElapsedUs = 0U; + uint32_t index = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_LIBRARY_MEMSET(ctrlDataSet, 0U, sizeof(ctrlDataSet)); + ADI_LIBRARY_MEMSET(ctrlDataGet, 0U, sizeof(ctrlDataGet)); + + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + usedDeserLanes |= device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled; + } + + /* get first used lane */ + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DESERIALIZER_LANES; index++) + { + laneSel = (1U << index); + if ((usedDeserLanes & laneSel) != 0U) + { + break; + } + } + + /* Prepare the command payload */ + ctrlDataSet[0] = (uint8_t)index; + ctrlDataSet[1] = (uint8_t)ADRV903X_SERDES_TEST_CMD; + ctrlDataSet[2] = (uint8_t)ADRV903X_SERDES_TEST_SET_VCM_SWC; + ctrlDataSet[3] = 0x01U; + ctrlDataSet[4] = usedDeserLanes; + ctrlDataSet[5] = swcEnMask; + ctrlDataSet[6] = usedDeserLanes; + ctrlDataSet[7] = swcEnMask; + ctrlDataSet[8] = (swcEnMask == 0x00U) ? 0x00U : 0x01U; + + /* Exec command */ + recoveryAction = adi_adrv903x_CpuControlCmdExec(device, + ADRV903X_CPU_OBJID_IC_SERDES, + ADRV903X_SERDES_CTRL_SET_FSM_CMD, + (adi_adrv903x_Channels_e)laneSel, + ctrlDataSet, + sizeof(ctrlDataSet), + &lengthResp, + ctrlDataGet, + sizeof(ctrlDataGet)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to run Jrx VCM Switch C Set command"); + goto cleanup; + } + + /* Poll Serdes Calibration Status for completion of the SwC set Command */ + for (timeElapsedUs = 0U; timeElapsedUs < ADI_ADRV903X_TRACKCALDISABLE_TIMEOUT_US; timeElapsedUs += ADI_ADRV903X_TRACKCALDISABLE_INTERVAL_US) + { + /* Get Serdes Calibration Status */ + recoveryAction = adi_adrv903x_CalSpecificStatusGet( device, + (adi_adrv903x_Channels_e)laneSel, + ADRV903X_CPU_OBJID_TC_SERDES, + ctrlDataGet, + sizeof(ctrlDataGet)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Get SwC set Command status failed"); + goto cleanup; + } + + /* Break out here if SwC set Command have been completed */ + if (ctrlDataGet[1] == (uint8_t)ADRV903X_SERDES_TEST_CMD_DONE) + { + break; + } + + /* SwC set Command is still in progress. Wait the specified wait interval, then check again for status. */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, ADI_ADRV903X_TRACKCALDISABLE_INTERVAL_US); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Issue"); + goto cleanup; + } + } + + /* Check for timeout */ + if (timeElapsedUs >= ADI_ADRV903X_TRACKCALDISABLE_TIMEOUT_US) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_RESET_FEATURE; + ADI_ERROR_REPORT(&device->common, + ADI_ADRV903X_ERRSRC_API, + ADI_COMMON_ERRCODE_TIMEOUT, + recoveryAction, + timeElapsedUs, + "SwC set Command Timeout"); + goto cleanup; + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairExecute(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepair_t* const jrxRepair) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + + uint8_t failingLanes = 0x00U; + uint8_t swcEnabled = 0x00U; + + uint32_t index = 0U; + int16_t checkTemp = 0; + + adi_adrv903x_DevTempData_t deviceTemperature; + adi_adrv903x_JrxRepairTest_t execTest; + adi_adrv903x_JrxRepairHistory_t updatedHistory; + ADI_PLATFORM_LARGE_VAR_ALLOC(adi_adrv903x_InitCalErrData_t, initCalErrDataPtr); + + static const uint8_t SERDES_TEMP_INDEX = 11U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, initCalErrDataPtr, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, jrxRepair, cleanup); + + if ((jrxRepair->runMode != ADI_ADRV903X_JRX_REPAIR_NORMAL_MODE) && + (jrxRepair->runMode != ADI_ADRV903X_JRX_REPAIR_FAST_MODE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, jrxRepair->runMode, "Invalid Run Mode"); + goto cleanup; + } + + if ((jrxRepair->historyCheck & ADI_ADRV903X_JRX_REPAIR_CHECKED) == 0x0U) + { + /* If history unchecked verify conditions to run Jrx Repair */ + recoveryAction = adi_adrv903x_JrxRepairHistoryCheck(device, jrxRepair, &checkTemp); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "JrxRepairHistoryCheck failed"); + goto cleanup; + } + } + else + { + /* readback temperature */ + recoveryAction = adi_adrv903x_TemperatureGet(device, 0U, &deviceTemperature); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get the temperature of the part."); + goto cleanup; + } + + checkTemp = deviceTemperature.tempDegreesCelsius[SERDES_TEMP_INDEX]; + } + + /* if any error condition is being set by adi_adrv903x_JrxRepairHistoryCheck function we can exit gracefully */ + if ((jrxRepair->historyCheck & ADI_ADRV903X_JRX_REPAIR_UNKNOWN_ERROR) == ADI_ADRV903X_JRX_REPAIR_UNKNOWN_ERROR) + { + /* uncheck */ + jrxRepair->historyCheck &= ~ADI_ADRV903X_JRX_REPAIR_CHECKED; + goto cleanup; /* exit gracefully before JrxRepairEnter */ + } + + /* Disable Serdes tracking calibration and configure PRBS */ + recoveryAction = adi_adrv903x_JrxRepairEnter(device, jrxRepair); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Enter JrxRepair routine"); + goto cleanup; + } + + /* Check SWC*/ + recoveryAction = adi_adrv903x_JrxRepairSwCEnableGet(device, &swcEnabled); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Get SwC enabled mask"); + goto cleanup; + } + if (swcEnabled != 0U) + { + /* SwC Already Enabled */ + jrxRepair->historyCheck |= (ADI_ADRV903X_JRX_REPAIR_SWC_ALREADY_ENABLED | ADI_ADRV903X_JRX_REPAIR_UNKNOWN_ERROR); + goto exit; /* exit gracefully (Need to go to JrxRepairExit)*/ + } + + /* copy previous history to the next to be updated */ + (void) ADI_LIBRARY_MEMCPY(&updatedHistory, &jrxRepair->history, sizeof(adi_adrv903x_JrxRepairHistory_t)); + + if (((jrxRepair->historyCheck & ADI_ADRV903X_JRX_REPAIR_ASSESS_LANES) == ADI_ADRV903X_JRX_REPAIR_ASSESS_LANES) && + (jrxRepair->runMode == ADI_ADRV903X_JRX_REPAIR_NORMAL_MODE)) + { + /* Run Bias Survey */ + recoveryAction = adi_adrv903x_JrxRepairBiasSurvey(device, &updatedHistory, &jrxRepair->biasSurvey); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adi_adrv903x_JrxRepairBiasSurvey failed"); + goto cleanup; + } + + if (((updatedHistory.badLaneMask | jrxRepair->history.badLaneMask) == jrxRepair->history.badLaneMask) && + ((updatedHistory.weakLaneMask | jrxRepair->history.weakLaneMask) == jrxRepair->history.weakLaneMask)) + { + /* No new bad/weak lanes */ + jrxRepair->historyCheck |= (ADI_ADRV903X_JRX_REPAIR_NO_LANE_ERRORS | ADI_ADRV903X_JRX_REPAIR_UNKNOWN_ERROR); + jrxRepair->history.lastTemp = checkTemp; /* No VCM Issue: Update Temp */ + goto exit; /* exit gracefully (Need to go to JrxRepairExit)*/ + } + } + + if (jrxRepair->runMode == ADI_ADRV903X_JRX_REPAIR_FAST_MODE) + { + /* If fast mode is required we apply the SwC and test if there is any error in the links */ + updatedHistory.badLaneMask |= (updatedHistory.goodLaneMask | updatedHistory.weakLaneMask); + updatedHistory.goodLaneMask = 0x00U; + updatedHistory.weakLaneMask = 0x00U; + } + + if ((jrxRepair->historyCheck & ADI_ADRV903X_JRX_REPAIR_LOAD_HISTORY) == ADI_ADRV903X_JRX_REPAIR_LOAD_HISTORY) + { + /* Apply History config */ + recoveryAction = adi_adrv903x_JrxRepairApply(device, &updatedHistory); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adi_adrv903x_JrxRepairApply failed"); + goto cleanup; + } + + /* Wait a bit */ + recoveryAction = (adi_adrv903x_ErrAction_e) adi_adrv903x_hal_Wait_us(&device->common, ADI_ADRV903X_JRXREPAIR_APPLY_WAIT_US); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "HAL Wait Issue"); + goto cleanup; + } + } + + if ((jrxRepair->historyCheck & ADI_ADRV903X_JRX_REPAIR_FAULTY_VCM_AMP) == ADI_ADRV903X_JRX_REPAIR_FAULTY_VCM_AMP) + { + /* Last temperature update */ + updatedHistory.lastTemp = checkTemp; + + /* Run Fast attack Initcal */ + recoveryAction = adi_adrv903x_JrxRepairFastAttackRun(device, initCalErrDataPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Run Serdes Fast Attack Initcal"); + goto cleanup; + } + + /* Reset Errors and Test new configuration */ + recoveryAction = adi_adrv903x_JrxRepairTest(device, &execTest); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adi_adrv903x_JrxRepairTest failed"); + goto cleanup; + } + + /* Update failingLanes with JrxRepairTest output */ + for (index = 0; index < ADI_ADRV903X_MAX_DESERIALIZER_LANES; index++) + { + if (execTest.laneErrors[index] != 0U) + { + failingLanes |= (1U << index); + } + } + + /* check if the updated settings have worked ok */ + if (failingLanes != 0U) + { + /* Restore previous history */ + recoveryAction = adi_adrv903x_JrxRepairApply(device, &jrxRepair->history); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Restore previous JrxRepair history"); + goto cleanup; + } + jrxRepair->historyCheck |= ADI_ADRV903X_JRX_REPAIR_UNKNOWN_ERROR; + jrxRepair->history.lastTemp = checkTemp; /* No VCM Issue: Update Temp */ + } + else + { + /* Fix succeeded. Update current history */ + (void) ADI_LIBRARY_MEMCPY(&jrxRepair->history, &updatedHistory, sizeof(adi_adrv903x_JrxRepairHistory_t)); + jrxRepair->historyCheck |= ADI_ADRV903X_JRX_REPAIR_APPLY_SUCCESS; + } + } + +exit: + /* Re-enable Serdes tracking calibration or Disable PRBS Checker */ + recoveryAction = adi_adrv903x_JrxRepairExit(device, jrxRepair); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Exit JrxRepair routine"); + goto cleanup; + } + jrxRepair->historyCheck &= ~ADI_ADRV903X_JRX_REPAIR_CHECKED; /* uncheck history */ + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairLaneAssess(adi_adrv903x_Device_t* const device, + uint8_t *const badLaneMask) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + adi_adrv903x_DeframerSel_e usedDfrm = ADI_ADRV903X_DEFRAMER_0; + + uint32_t usedDfrmBaseAddr = 0U; + uint32_t index = 0U; + uint32_t laneId = 0U; + uint8_t linkType = 0U; + uint8_t bfValue = 0U; + uint8_t laneSel = 0U; + uint8_t localBadLaneMask = 0U; + uint8_t gpintStatus[2] = { 0U }; + + adi_adrv903x_Dfrm204cErrCounterStatus_t dfrm204cErrCnt; + adi_adrv903x_DfrmErrCounterStatus_t dfrm204bErrCnt; + + static const uint32_t GPINT_STATUS_BYTE1_ADDR = 0x16BU; + static const uint32_t JRX_LINK_BASE_ADDR[2] = + { + ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_0_, + ADRV903X_BF_DIGITAL_CORE_JESD_JRX_LINK_1_ + }; + + static const uint8_t GPINT_STATUS_DFRM_ALL_MASK[2] = { 0xFCU, 0x3FU }; + static const uint8_t JRX204C_STATE_FEC_READY = 6U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, badLaneMask); + + /* Read GPINT STATUS registers */ + recoveryAction = adi_adrv903x_RegistersByteRead(device, NULL, GPINT_STATUS_BYTE1_ADDR, gpintStatus, NULL, 2U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "adi_adrv903x_RegistersByteRead GPINT_STATUS issue"); + goto cleanup; + } + + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + if ((device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled == 0U) || + ((gpintStatus[index] & GPINT_STATUS_DFRM_ALL_MASK[index]) == 0U)) + { + /* skip if deframer is unused or if there is no lane related issue on that deframer*/ + continue; + } + + usedDfrm = (adi_adrv903x_DeframerSel_e)(1U << index); + usedDfrmBaseAddr = JRX_LINK_BASE_ADDR[index]; + + /* Get the Deframer link type */ + recoveryAction = adrv903x_JrxLink_JrxLinkType_BfGet(device, + NULL, + (adrv903x_BfJrxLinkChanAddr_e)usedDfrmBaseAddr, + &linkType); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error while attempting to get link type for Deframer"); + goto cleanup; + } + + for (laneId = 0U; laneId < ADI_ADRV903X_MAX_DESERIALIZER_LANES; laneId++) + { + laneSel = (1U << laneId); + if ((device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled & laneSel) == 0U) + { + continue; + } + + /* Verify Sync/State Status */ + if (linkType != 0U) + { + /* 204C link type case - Read Lane State */ + recoveryAction = adrv903x_JesdCommon_JrxDl204cState_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, laneId, &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get 204C Lane State"); + goto cleanup; + } + if (bfValue != JRX204C_STATE_FEC_READY) + { + localBadLaneMask |= laneSel; + continue; + } + } + else + { + /* 204B link type case - Read Sync_N and CGS sync*/ + recoveryAction = adrv903x_JesdCommon_JrxDl204bSyncN_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, laneId, &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get 204B Lane Sync N"); + goto cleanup; + } + if (bfValue == ADI_DISABLE) + { + localBadLaneMask |= laneSel; + continue; + } + recoveryAction = adrv903x_JesdCommon_JrxDl204bCgs_BfGet(device, NULL, ADRV903X_BF_DIGITAL_CORE_JESD_JESD_COMMON, laneId, &bfValue); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get 204B Lane CGS sync"); + goto cleanup; + } + if (bfValue == ADI_DISABLE) + { + localBadLaneMask |= laneSel; + continue; + } + } + + /* Verify Link Layer Error Counters */ + if (linkType != 0U) + { + /* 204C link type case */ + recoveryAction = adi_adrv903x_Dfrm204cErrCounterStatusGet(device, usedDfrm, index, &dfrm204cErrCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get 204C Error Counters"); + goto cleanup; + } + if ((dfrm204cErrCnt.crcCntValue != 0U) || (dfrm204cErrCnt.embCntValue != 0U) || + (dfrm204cErrCnt.mbCntValue != 0U) || (dfrm204cErrCnt.shCntValue != 0U)) + { + localBadLaneMask |= laneSel; + continue; + } + } + else + { + /* 204B link type case */ + recoveryAction = adi_adrv903x_DfrmErrCounterStatusGet(device, usedDfrm, index, &dfrm204bErrCnt); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to get 204B Error Counters"); + goto cleanup; + } + if ((dfrm204bErrCnt.bdCntValue != 0U) || (dfrm204bErrCnt.nitCntValue != 0U) || + (dfrm204bErrCnt.uekCntValue != 0U)) + { + localBadLaneMask |= laneSel; + continue; + } + } + } /* for each phy lane */ + } /* for each deframer */ + + *badLaneMask = localBadLaneMask; + +cleanup : + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairVcmLanesFix(adi_adrv903x_Device_t* const device, + uint8_t laneMask, + uint8_t enableFix) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t index = 0U; + uint8_t numDeserLanesUsed = 0U; + uint8_t actionLaneSelector = 0U; + + const uint8_t swcVcmDisabled = 0U; + const uint8_t swcVcmEnabledLaneUsed = 1U; + const uint8_t swcVcmEnabledLaneUnused = 2U; + + static const uint32_t DESER_PD_REG_0_ADDRESS[] = { + ADRV903X_ADDR_DESER_PHY0_PD_REG_0, + ADRV903X_ADDR_DESER_PHY1_PD_REG_0, + ADRV903X_ADDR_DESER_PHY2_PD_REG_0, + ADRV903X_ADDR_DESER_PHY3_PD_REG_0, + ADRV903X_ADDR_DESER_PHY4_PD_REG_0, + ADRV903X_ADDR_DESER_PHY5_PD_REG_0, + ADRV903X_ADDR_DESER_PHY6_PD_REG_0, + ADRV903X_ADDR_DESER_PHY7_PD_REG_0 + }; + /* reg add; disable swc/subs; enable used swc/subs; enabled unused swc/subs */ + static const uint32_t DESER_PD_REG_0_VALUE[] = { + 0x01U, /* Reset value of register */ + 0xFFU, /* No power-downs on the enabled lanes */ + 0x35U /* Several power-downs on the disabled lanes to save power */ + }; + + static const uint32_t DESER_PD_REG_1_ADDRESS[] = { + ADRV903X_ADDR_DESER_PHY0_PD_REG_1, + ADRV903X_ADDR_DESER_PHY1_PD_REG_1, + ADRV903X_ADDR_DESER_PHY2_PD_REG_1, + ADRV903X_ADDR_DESER_PHY3_PD_REG_1, + ADRV903X_ADDR_DESER_PHY4_PD_REG_1, + ADRV903X_ADDR_DESER_PHY5_PD_REG_1, + ADRV903X_ADDR_DESER_PHY6_PD_REG_1, + ADRV903X_ADDR_DESER_PHY7_PD_REG_1, + }; + /* reg add; disable swc/subs; enable used swc/subs; enabled unused swc/subs */ + static const uint32_t DESER_PD_REG_1_VALUE[] = { + 0x00U, /* Reset value of register */ + 0x02U, /* Powers down the CM amp on the enabled lanes. */ + 0x07U /* More power-down facilities on the disabled lanes to save power */ + }; + + static const uint32_t DESER_CORE1P2_TEST_ADDRESS[] = { + ADRV903X_ADDR_DESER_PHY0_CORE1P2_TEST, + ADRV903X_ADDR_DESER_PHY1_CORE1P2_TEST, + ADRV903X_ADDR_DESER_PHY2_CORE1P2_TEST, + ADRV903X_ADDR_DESER_PHY3_CORE1P2_TEST, + ADRV903X_ADDR_DESER_PHY4_CORE1P2_TEST, + ADRV903X_ADDR_DESER_PHY5_CORE1P2_TEST, + ADRV903X_ADDR_DESER_PHY6_CORE1P2_TEST, + ADRV903X_ADDR_DESER_PHY7_CORE1P2_TEST + }; + /* reg add; disable swc/subs; enable used swc/subs; enabled unused swc/subs */ + static const uint32_t DESER_CORE1P2_TEST_VALUE[] = { + 0x00U, /* Reset value of register */ + 30U, /*This connects the CM node of the used lanes to the AMUX*/ + 29U, /*This connects the CM bias node of the unused lanes to the AMUX*/ + }; + + static const uint32_t DESER_CORE1P2_DECFE_CTL0_ADDRESS[] = { + ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL0, + ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL0, + ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL0, + ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL0, + ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL0, + ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL0, + ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL0, + ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL0 + }; + /* reg add; disable swc/subs; enable used swc/subs; enabled unused swc/subs */ + static const uint32_t DESER_CORE1P2_DECFE_CTL0_VALUE[] = { + 0x00U, /* Reset value of register */ + 0xFFU, /* No power-downs on the enabled lanes */ + 0x0FU /* More power-down facilities on the disabled lanes */ + }; + + static const uint32_t DESER_CORE1P2_DECFE_CTL18_ADDRESS[] = { + ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL18, + ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL18, + ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL18, + ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL18, + ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL18, + ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL18, + ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL18, + ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL18 + }; + /* reg add; disable swc/subs; enable used swc/subs; enabled unused swc/subs */ + static const uint32_t DESER_CORE1P2_DECFE_CTL18_VALUE[] = { + 0x00U, /* Reset value of register */ + 0xFFU, /* No power-downs on the enabled lanes */ + 0x01U /* More power-down facilities on the disabled lanes */ + }; + static const uint32_t DESER_CORE1P2_DECFE_CTL28_ADDRESS[] = { + ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL28, + ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL28, + ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL28, + ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL28, + ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL28, + ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL28, + ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL28, + ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL28 + }; + /* reg add; disable swc/subs; enable used swc/subs; enabled unused swc/subs */ + static const uint32_t DESER_CORE1P2_DECFE_CTL28_VALUE[] = { + 0x00U, /* Reset value of register */ + 0xFFU, /* Not used on used lanes */ + 0xFFU /* More power-down facilities on the disabled lanes */ + }; + static const uint32_t DESER_CORE1P2_DECFE_CTL31_ADDRESS[] = { + ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL31, + ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL31, + ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL31, + ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL31, + ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL31, + ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL31, + ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL31, + ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL31 + }; + /* reg add; disable swc/subs; enable used swc/subs; enabled unused swc/subs */ + static const uint32_t DESER_CORE1P2_DECFE_CTL31_VALUE[] = { + 0x00U, /* Reset value of register */ + 0xFFU, /* Not used on used lanes */ + 0x01U /* More power-down facilities on the disabled lanes */ + }; + + static const uint32_t DESER_CORE1P2_DECFE_CTL41_ADDRESS[] = { + ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL41, + ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL41, + ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL41, + ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL41, + ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL41, + ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL41, + ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL41, + ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL41 + }; + /* reg add; disable swc/subs; enable used swc/subs; enabled unused swc/subs */ + static const uint32_t DESER_CORE1P2_DECFE_CTL41_VALUE[] = { + 0x00U, /* Reset value of register */ + 0x00U, /* Not used on used lanes */ + 0xFFU /* More power-down facilities on the disabled lanes */ + }; + static const uint32_t DESER_CORE1P2_DECFE_CTL43_ADDRESS[] = { + ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL43, + ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL43, + ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL43, + ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL43, + ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL43, + ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL43, + ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL43, + ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL43 + }; + /* reg add; disable swc/subs; enable used swc/subs; enabled unused swc/subs */ + static const uint32_t DESER_CORE1P2_DECFE_CTL43_VALUE[] = { + 0x00U, /* Reset value of register */ + 0xFFU, /* Not used on used lanes */ + 0x80U /* More power-down facilities on the disabled lanes */ + }; + static const uint32_t DESER_CORE1P2_DECFE_CTL45_ADDRESS[] = { + ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL45, + ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL45, + ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL45, + ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL45, + ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL45, + ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL45, + ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL45, + ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL45 + }; + /* reg add; disable swc/subs; enable used swc/subs; enabled unused swc/subs */ + static const uint32_t DESER_CORE1P2_DECFE_CTL45_VALUE[] = { + 0x00U, /* Reset value of register */ + 0xFFU, /* Not used on used lanes */ + 0x80U /* More power-down facilities on the disabled lanes */ + }; + + static const uint32_t DESER_CORE1P2_DECFE_CTL49_ADDRESS[] = { + ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL49, + ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL49, + ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL49, + ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL49, + ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL49, + ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL49, + ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL49, + ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL49 + }; + /* reg add; disable swc/subs; enable used swc/subs; enabled unused swc/subs */ + static const uint32_t DESER_CORE1P2_DECFE_CTL49_VALUE[] = { + 0x20U, /* Reset value of register */ + 0xFFU, /* Not used on used lanes */ + 0x06U /* Powers down the CM amp on the disabled lanes */ + }; + + static const uint32_t DESER_CORE1P2_DECFE_CTL54_ADDRESS[] = { + ADRV903X_ADDR_DESER_PHY0_CORE1P2_DECFE_CTL54, + ADRV903X_ADDR_DESER_PHY1_CORE1P2_DECFE_CTL54, + ADRV903X_ADDR_DESER_PHY2_CORE1P2_DECFE_CTL54, + ADRV903X_ADDR_DESER_PHY3_CORE1P2_DECFE_CTL54, + ADRV903X_ADDR_DESER_PHY4_CORE1P2_DECFE_CTL54, + ADRV903X_ADDR_DESER_PHY5_CORE1P2_DECFE_CTL54, + ADRV903X_ADDR_DESER_PHY6_CORE1P2_DECFE_CTL54, + ADRV903X_ADDR_DESER_PHY7_CORE1P2_DECFE_CTL54 + }; + /* reg add; disable swc/subs; enable used swc/subs; enabled unused swc/subs */ + static const uint32_t DESER_CORE1P2_DECFE_CTL54_VALUE[] = { + 0x00U, /* Reset value of register */ + 0xFFU, /* Not used on used lanes */ + 0x05U /* More power-down facilities on the disabled lanes */ + }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + if ((enableFix != ADI_TRUE) && (enableFix != ADI_FALSE)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, enableFix, "input parameter \"enableFix\" should be either True or False."); + goto cleanup; + } + + numDeserLanesUsed = ((laneMask >> 7U) & 1U) + \ + ((laneMask >> 6U) & 1U) + \ + ((laneMask >> 5U) & 1U) + \ + ((laneMask >> 4U) & 1U) + \ + ((laneMask >> 3U) & 1U) + \ + ((laneMask >> 2U) & 1U) + \ + ((laneMask >> 1U) & 1U) + \ + (laneMask & 1U); + + if (enableFix == ADI_TRUE) + { + recoveryAction = adi_adrv903x_Register32Write(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK, + 0x00, + 0xFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK"); + goto cleanup; + } + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DESERIALIZER_LANES; index++) + { + /* Lane NOT being used */ + actionLaneSelector = swcVcmEnabledLaneUnused; + + if ((laneMask & (1U << index)) == 0U) + { + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_CORE1P2_DECFE_CTL49_ADDRESS[index], DESER_CORE1P2_DECFE_CTL49_VALUE[actionLaneSelector], 0x07U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_ADDR_DESER_PHY_CORE1P2_DECFE_CTL49 of one of the lanes"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_PD_REG_0_ADDRESS[index], DESER_PD_REG_0_VALUE[actionLaneSelector], 0x3FU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_ADDR_DESER_PHY_PD_REG_0 of one of the lanes"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_PD_REG_1_ADDRESS[index], DESER_PD_REG_1_VALUE[actionLaneSelector], 0x07U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_ADDR_DESER_PHY_PD_REG_1 of one of the lanes"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_CORE1P2_DECFE_CTL18_ADDRESS[index], DESER_CORE1P2_DECFE_CTL18_VALUE[actionLaneSelector], 0x01U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_ADDR_DESER_PHY_CORE1P2_DECFE_CTL18 of one of the lanes"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_CORE1P2_DECFE_CTL31_ADDRESS[index], DESER_CORE1P2_DECFE_CTL31_VALUE[actionLaneSelector], 0x01U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_ADDR_DESER_PHY_CORE1P2_DECFE_CTL31 of one of the lanes"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_CORE1P2_DECFE_CTL54_ADDRESS[index], DESER_CORE1P2_DECFE_CTL54_VALUE[actionLaneSelector], 0x0FU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_ADDR_DESER_PHY_CORE1P2_DECFE_CTL54 of one of the lanes"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_CORE1P2_DECFE_CTL0_ADDRESS[index], DESER_CORE1P2_DECFE_CTL0_VALUE[actionLaneSelector], 0x0FU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_ADDR_DESER_PHY_CORE1P2_DECFE_CTL0 of one of the lanes"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_CORE1P2_DECFE_CTL28_ADDRESS[index], DESER_CORE1P2_DECFE_CTL28_VALUE[actionLaneSelector], 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_ADDR_DESER_PHY_CORE1P2_DECFE_CTL28 of one of the lanes"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_CORE1P2_DECFE_CTL41_ADDRESS[index], DESER_CORE1P2_DECFE_CTL41_VALUE[actionLaneSelector], 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_ADDR_DESER_PHY_CORE1P2_DECFE_CTL41 of one of the lanes"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_CORE1P2_DECFE_CTL43_ADDRESS[index], DESER_CORE1P2_DECFE_CTL43_VALUE[actionLaneSelector], 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_ADDR_DESER_PHY_CORE1P2_DECFE_CTL43 of one of the lanes"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_CORE1P2_DECFE_CTL45_ADDRESS[index], DESER_CORE1P2_DECFE_CTL45_VALUE[actionLaneSelector], 0xFFU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_ADDR_DESER_PHY_CORE1P2_DECFE_CTL45 of one of the lanes"); + goto cleanup; + } + } + } + if (numDeserLanesUsed > 0x4U) + { + recoveryAction = adi_adrv903x_JrxRepairSwCEnableSet(device, laneMask); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Set SwC Enabled"); + goto cleanup; + } + + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DESERIALIZER_LANES; index++) + { + if ((laneMask & (1U << index)) == 0U) + { + /* Lane NOT being used */ + actionLaneSelector = swcVcmEnabledLaneUnused; + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_CORE1P2_TEST_ADDRESS[index], DESER_CORE1P2_TEST_VALUE[actionLaneSelector], 0x1FU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to DESERDES CORE1P2_TEST"); + goto cleanup; + } + } + } + } + else + { + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DESERIALIZER_LANES; index++) + { + actionLaneSelector = ((laneMask & (1U << index)) == 0U) ? swcVcmEnabledLaneUnused : swcVcmEnabledLaneUsed; + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_PD_REG_1_ADDRESS[index], DESER_PD_REG_1_VALUE[actionLaneSelector], 0x07U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to DESERDES PD_REG_1"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_CORE1P2_TEST_ADDRESS[index], DESER_CORE1P2_TEST_VALUE[actionLaneSelector], 0x1FU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to DESERDES CORE1P2_TEST"); + goto cleanup; + } + } + } + + /* Indicate that JRxRepair has been applied */ + device->devStateInfo.devState = (adi_adrv903x_ApiStates_e)(device->devStateInfo.devState | ADI_ADRV903X_STATE_JRXREPAIRED); + + } + else + { + if (numDeserLanesUsed <= 0x4U) + { + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DESERIALIZER_LANES; index++) + { + actionLaneSelector = swcVcmDisabled; + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_PD_REG_1_ADDRESS[index], DESER_PD_REG_1_VALUE[actionLaneSelector], 0x07U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_ADDR_DESER_PHY_PD_REG_1 of one of the lanes"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_Register32Write(device, NULL, DESER_CORE1P2_TEST_ADDRESS[index], DESER_CORE1P2_TEST_VALUE[actionLaneSelector], 0x1FU); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to DESERDES CORE1P2_TEST"); + goto cleanup; + } + } + } + else + { + recoveryAction = adi_adrv903x_JrxRepairSwCEnableSet(device, 0x0U); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to Set SwC Disabled"); + goto cleanup; + } + } + + recoveryAction = adi_adrv903x_Register32Write(device, + NULL, + ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK, + ~laneMask, + 0xFF); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to write to ADRV903X_BF_DIGITAL_CORE_JESD_DESERIALIZER_DESER_PHY_TOP_8PACK"); + goto cleanup; + } + + /* Indicate that JRxRepair is disabled */ + device->devStateInfo.devState = (adi_adrv903x_ApiStates_e)(device->devStateInfo.devState & ~ADI_ADRV903X_STATE_JRXREPAIRED); + + } + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_JrxRepairInitialization(adi_adrv903x_Device_t* const device, + uint8_t enableRepair) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + uint8_t idx = 0U; + uint8_t screenID = 0U; + uint8_t usedDeserLanes = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + + recoveryAction = adrv903x_JrxRepairScreenTestChecker(device, &screenID); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Screen check has failed."); + goto cleanup; + } + + if (((enableRepair & ADI_ADRV903X_JRXREPAIR_INIT_ALL) == ADI_ADRV903X_JRXREPAIR_INIT_ALL) || + (((enableRepair & ADI_ADRV903X_JRXREPAIR_INIT_NONSCREENED) == ADI_ADRV903X_JRXREPAIR_INIT_NONSCREENED) && (screenID == ADI_FALSE))) + { + for (idx = 0U; idx < (uint8_t)ADI_ADRV903X_MAX_DEFRAMERS; idx++) + { + usedDeserLanes |= device->initExtract.jesdSetting.deframerSetting[idx].deserialLaneEnabled; + } + + recoveryAction = adi_adrv903x_JrxRepairVcmLanesFix(device, usedDeserLanes, ADI_TRUE); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Failed to fix enable VCM fix"); + goto cleanup; + } + } + + cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + +/* Helper function to load CPU image from file. SHOULD ONLY BE CALLED FROM adi_adrv903x_CpuImageLoad() */ +static adi_adrv903x_ErrAction_e adrv903x_CpuLoadUtil(adi_adrv903x_Device_t* const device, + const adi_adrv903x_cpuBinaryInfo_t* const cpuBinaryInfo, + FILE* cpuImageFilePtr, + const adi_adrv903x_CpuType_e cpuType) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + uint32_t numFileChunks = 0U; + uint32_t chunkIndex = 0U; + uint8_t cpuImageChunk[ADI_ADRV903X_CPU_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES]; + uint32_t byteCount = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cpuBinaryInfo); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, cpuImageFilePtr); + + /* Calculate number of image chunks to write */ + if (cpuType == ADI_ADRV903X_CPU_TYPE_0) + { + numFileChunks = (uint32_t)(ADI_ADRV903X_CPU_0_BINARY_IMAGE_FILE_SIZE_BYTES / ADI_ADRV903X_CPU_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES); + } + else if (cpuType == ADI_ADRV903X_CPU_TYPE_1) + { + numFileChunks = (uint32_t)(ADI_ADRV903X_CPU_1_BINARY_IMAGE_FILE_SIZE_BYTES / ADI_ADRV903X_CPU_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES); + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuType, "Invalid CPU type"); + return recoveryAction; + } + + for (chunkIndex = 0U; chunkIndex < numFileChunks; ++chunkIndex) + { + /* Read Segment of CPU Image */ + byteCount = ADI_LIBRARY_FREAD(&cpuImageChunk[0U], 1, ADI_ADRV903X_CPU_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES, cpuImageFilePtr); + if (byteCount == ADI_ADRV903X_CPU_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES) + { + /* Write CPU Image Segment */ + recoveryAction = adi_adrv903x_CpuImageWrite(device, + cpuType, + (chunkIndex * ADI_ADRV903X_CPU_BINARY_IMAGE_LOAD_CHUNK_SIZE_BYTES), + &cpuImageChunk[0U], + byteCount); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Error During Binary Loading (e.g. SPI Issue)"); + return recoveryAction; + } + } + else + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Error Reading Block of Data from CPU Binary File"); + return recoveryAction; + } + } + + return recoveryAction; +} + + +static adi_adrv903x_ErrAction_e adrv903x_JrxRepairHistoryRangeCheck(adi_adrv903x_Device_t* const device, + adi_adrv903x_JrxRepairHistory_t* const repairHistory) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + const int16_t minTemp = -274; + const int16_t maxTemp = (ADI_ADRV903X_FACTORY_TEMPERATURE_TEST + ADI_ADRV903X_FACTORY_TEMPERATURE_MARGIN); + uint8_t usedDeserLanes = 0U; + uint32_t index = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, repairHistory); + + if ((repairHistory->lastTemp < minTemp) || (repairHistory->lastTemp > maxTemp)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, repairHistory->lastTemp, "Temperature outside of range"); + return recoveryAction; + } + + for (index = 0U; index < (uint32_t)ADI_ADRV903X_MAX_DEFRAMERS; index++) + { + usedDeserLanes |= device->initExtract.jesdSetting.deframerSetting[index].deserialLaneEnabled; + } + + if ((repairHistory->goodLaneMask | repairHistory->weakLaneMask | repairHistory->badLaneMask) != usedDeserLanes) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, repairHistory->goodLaneMask, "good+bad+weak not compatible with lanes enabled"); + return recoveryAction; + } + + return recoveryAction; +} + +static void adrv903x_EndiannessCheckAndConvert(void* const buffer, const size_t elementSize, const size_t elementCount) +{ + /* new function entry reporting */ + uint8_t i = 0U; + uint16_t* tmp16; + uint32_t* tmp32; + uint64_t* tmp64; + + if (elementSize == 2U) + { + //biteswap small + tmp16 = (uint16_t* const)buffer; + for (i = 0; i < elementCount; i++) { + tmp16[i] = ADRV903X_HTOCS(tmp16[i]); + } + } + else if (elementSize == 4U) + { + //biteswap large + tmp32 = (uint32_t* const)buffer; + for (i = 0; i < elementCount; i++) { + tmp32[i] = ADRV903X_HTOCL(tmp32[i]); + } + } + else if (elementSize == 8U) + { + //biteswap large large + tmp64 = (uint64_t* const)buffer; + for (i = 0; i < elementCount; i++) { + tmp64[i] = ADRV903X_HTOCLL(tmp64[i]); + } + } +} +static size_t adrv903x_VariableFromFileExtract(adi_adrv903x_Device_t* const device, + void* const buffer, + const size_t elementSize, + const size_t elementCount, + FILE* file) +{ + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API_PRIV); + ADI_ADRV903X_NULL_PTR_REPORT_RETURN(&device->common, file); + + uint8_t returnValue = ADI_LIBRARY_FREAD(buffer, 1, elementSize * elementCount, file); + if (returnValue > 0) + { + adrv903x_EndiannessCheckAndConvert(buffer, elementSize, elementCount); + } + return returnValue; +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainTableChecksumRead(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxGainTableInfo_t* const rxGainTableInfoPtr, + uint32_t* const rxGainTableChecksum) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + const uint8_t LINE_BUFFER_SIZE = 128U; + const uint8_t HEADER_BUFFER_SIZE = 16U; + const uint8_t NUM_COLUMNS = 5U; + FILE* rxGainTableFilePtr = NULL; + char rxGainTableLineBuffer[LINE_BUFFER_SIZE]; + char headerStr1[HEADER_BUFFER_SIZE]; + adi_adrv903x_Version_t tableVersion = { 0U, 0U, 0U, 0U }; + uint32_t checksum[4U] = { 0U, 0U, 0U, 0U }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxGainTableChecksum, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxGainTableInfoPtr, cleanup); + + if (ADI_LIBRARY_STRNLEN((const char*)rxGainTableInfoPtr->filePath, ADI_ADRV903X_MAX_FILE_LENGTH) == ADI_ADRV903X_MAX_FILE_LENGTH) + { + /* Path is not terminated */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableInfoPtr->filePath, "Unterminated path string"); + goto cleanup; + } + + /* Open Rx Gain Table CSV file */ +#ifdef __GNUC__ + rxGainTableFilePtr = ADI_LIBRARY_FOPEN((const char *)rxGainTableInfoPtr->filePath, "r"); +#else + if (ADI_LIBRARY_FOPEN_S(&rxGainTableFilePtr, (const char *)rxGainTableInfoPtr->filePath, "r") != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxGainTableInfoPtr->filePath, + "Unable to open Rx Gain Table csv file. Please check if the path is correct or the file is open in another program"); + + goto cleanup; + } +#endif + + if (rxGainTableFilePtr == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxGainTableInfoPtr->filePath, + "Invalid Rx Gain Table csv file path while attempting to load Rx Gain Table"); + goto cleanup; + } + + if (ADI_LIBRARY_FGETS(rxGainTableLineBuffer, sizeof(rxGainTableLineBuffer), rxGainTableFilePtr) == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableFilePtr, "Empty Rx Gain Table Detected"); + goto cleanup; + } + + + /* Parse the first line of the Rx Gain Table file which contains the version info */ +#ifdef __GNUC__ + if (sscanf(rxGainTableLineBuffer, + "%[^,],%u,%u,%u,%u", + headerStr1, + (uint32_t*)&tableVersion.majorVer, + (uint32_t*)&tableVersion.minorVer, + (uint32_t*)&tableVersion.maintenanceVer, + (uint32_t*)&tableVersion.buildVer) != NUM_COLUMNS) +#else + if (sscanf_s(rxGainTableLineBuffer, + "%[^,],%d,%d,%d,%d", + headerStr1, + (uint32_t)sizeof(headerStr1), + &version.majorVer, + &version.minorVer, + &version.maintenanceVer, + &version.buildVer) != NUM_COLUMNS) +#endif + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableInfoPtr->filePath, "Invalid Rx Gain Table Format Detected"); + goto cleanup; + } + + /* Verify that Gain Table Version Format is correct */ + if (ADI_LIBRARY_STRSTR(headerStr1, "Version") == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, headerStr1, "Version Column Expected First"); + goto cleanup; + } + + + if (ADI_LIBRARY_FGETS(rxGainTableLineBuffer, sizeof(rxGainTableLineBuffer), rxGainTableFilePtr) == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableFilePtr, "Empty Rx Gain Table Detected"); + goto cleanup; + } + + /* Parse the second line of the Rx Gain Table file which contains the checksum info */ +#ifdef __GNUC__ + if (sscanf(rxGainTableLineBuffer, + "%[^,],%u,%u,%u,%u", + headerStr1, + (uint32_t*)&checksum[0], + (uint32_t*)&checksum[1], + (uint32_t*)&checksum[2], + (uint32_t*)&checksum[3]) != NUM_COLUMNS) +#else + if (sscanf_s(rxGainTableLineBuffer, + "%[^,],%d,%d,%d,%d", + headerStr1, + (uint32_t)sizeof(headerStr1), + &checksum[0], + &checksum[1], + &checksum[2], + &checksum[3]) != NUM_COLUMNS) +#endif + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, rxGainTableInfoPtr->filePath, "Invalid Rx Gain Table Format Detected"); + goto cleanup; + } + + /* Verify that Gain Table Checksum Format is correct */ + if (ADI_LIBRARY_STRSTR(headerStr1, "Checksum") == NULL) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, headerStr1, "Checksum Column Expected First"); + goto cleanup; + } + + *rxGainTableChecksum = checksum[0]; + + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + +cleanup: + + if (rxGainTableFilePtr != NULL) + { + /* Close Rx Gain Table csv file */ + if (ADI_LIBRARY_FCLOSE(rxGainTableFilePtr) != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxGainTableInfoPtr->filePath, + "Fatal error while trying to close Rx Gain Table csv file. Possible memory shortage while flushing / other I/O errors."); + } + } + + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_RxGainTableChecksumCalculate(adi_adrv903x_Device_t* const device, + const adi_adrv903x_RxChannels_e rxChannel, + uint32_t* const rxGainTableChecksum) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + +#define MAX_RX_GAIN_TABLE_LINES 256U +#define GAIN_TABLE_SIZE 7U + static const uint8_t INDEX_MASK = 0xFFU; + static const uint8_t PHASE_OFFSET_MASK = 0xFFU; + static const uint8_t PHASE_OFFSET_SHIFT = 8U; + static const uint8_t DIG_GAIN_MASK = 0xFFU; + static const uint8_t DIG_GAIN_SHIFT = 8U; + + uint16_t numGainIndicesRead = 0U; + uint32_t i = 0U; + uint32_t checksum = 0U; + uint8_t finalCrc = ADI_FALSE; + + adi_adrv903x_RxGainTableRow_t gainTableRow[MAX_RX_GAIN_TABLE_LINES]; + uint8_t gainTableData[GAIN_TABLE_SIZE] = { 0U }; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + ADI_ADRV903X_API_ENTRY(&device->common); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, rxGainTableChecksum, cleanup); + ADI_LIBRARY_MEMSET(&gainTableRow, 0, sizeof(gainTableRow)); + + /* Check that the channel requested is valid */ + if ((rxChannel != ADI_ADRV903X_RX0) && + (rxChannel != ADI_ADRV903X_RX1) && + (rxChannel != ADI_ADRV903X_RX2) && + (rxChannel != ADI_ADRV903X_RX3) && + (rxChannel != ADI_ADRV903X_RX4) && + (rxChannel != ADI_ADRV903X_RX5) && + (rxChannel != ADI_ADRV903X_RX6) && + (rxChannel != ADI_ADRV903X_RX7)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannel, + "Invalid Rx Channel Requested for gain table read. Valid Rx channels include Rx0-Rx7"); + goto cleanup; + } + + recoveryAction = adi_adrv903x_RxGainTableRead(device, + rxChannel, + ADI_ADRV903X_MAX_GAIN_TABLE_INDEX, + gainTableRow, + MAX_RX_GAIN_TABLE_LINES, + &numGainIndicesRead); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + rxChannel, + "Rx Gain Table read failure"); + goto cleanup; + } + + if (numGainIndicesRead != MAX_RX_GAIN_TABLE_LINES) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, + recoveryAction, + numGainIndicesRead, + "Rx Gain Table read number of lines wrong"); + goto cleanup; + } + + for (i = 0; i < MAX_RX_GAIN_TABLE_LINES; i++) + { + gainTableData[0] = (uint8_t)(i & INDEX_MASK); + gainTableData[1] = (uint8_t)(gainTableRow[i].rxFeGain); + gainTableData[2] = (uint8_t)(gainTableRow[i].extControl); + gainTableData[3] = (uint8_t)(gainTableRow[i].phaseOffset & PHASE_OFFSET_MASK); + gainTableData[4] = (uint8_t)((gainTableRow[i].phaseOffset >> PHASE_OFFSET_SHIFT) & PHASE_OFFSET_MASK); + gainTableData[5] = (uint8_t)(gainTableRow[i].digGain & DIG_GAIN_MASK); + gainTableData[6] = (uint8_t)((gainTableRow[i].digGain >> DIG_GAIN_SHIFT) & DIG_GAIN_MASK); + + if (i == (MAX_RX_GAIN_TABLE_LINES - 1)) + { + finalCrc = ADI_TRUE; + } + + checksum = adrv903x_Crc32ForChunk(gainTableData, + GAIN_TABLE_SIZE, + checksum, + finalCrc); + } + + *rxGainTableChecksum = checksum; + +cleanup: + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + +ADI_API adi_adrv903x_ErrAction_e adi_adrv903x_InitDataExtract(adi_adrv903x_Device_t* const device, + const adi_adrv903x_CpuProfileBinaryInfo_t* const cpuBinaryInfo, + adi_adrv903x_Version_t* const apiVer, + adi_adrv903x_CpuFwVersion_t* const fwVer, + adi_adrv903x_Version_t* const streamVer, + adi_adrv903x_Init_t* const init, + adi_adrv903x_PostMcsInit_t* const postMcsInit, + adi_adrv903x_ExtractInitDataOutput_e* const checkOutput) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + FILE* cpuProfileFilePtr = NULL; + uint32_t totalFileSize = 0U; + + ADI_ADRV903X_NULL_DEVICE_PTR_RETURN(device); + + ADI_ADRV903X_API_ENTRY(&device->common); + + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, apiVer, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, fwVer, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, streamVer, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, init, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, postMcsInit, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, checkOutput, cleanup); + ADI_ADRV903X_NULL_PTR_REPORT_GOTO(&device->common, cpuBinaryInfo, cleanup); + + if (ADI_LIBRARY_STRNLEN((const char*)cpuBinaryInfo->filePath, ADI_ADRV903X_MAX_FILE_LENGTH) == ADI_ADRV903X_MAX_FILE_LENGTH) + { + /* Path is not terminated */ + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo, "Unterminated path string"); + goto cleanup; + } + + /* Open cpu profile binary file */ +#ifdef __GNUC__ + cpuProfileFilePtr = ADI_LIBRARY_FOPEN((const char*)cpuBinaryInfo->filePath, "rb"); +#else + if (ADI_LIBRARY_FOPEN_S(&cpuProfileFilePtr, (const char*)cpuBinaryInfo->filePath, "rb") != 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileBinaryInfoPtr->filePath, "Unable to open CPU Profile Binary. Please check filepath is correct"); + goto cleanup; + } +#endif + + if (NULL == cpuProfileFilePtr) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Unable to open CPU Profile Binary. Please check filepath is correct") + goto cleanup; + } + + /* Determine file size */ + if (ADI_LIBRARY_FSEEK(cpuProfileFilePtr, 0U, SEEK_END) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Seek to EOF Failed"); + goto cleanup; + } + + /* ADI_LIBRARY_FTELL returns long type */ + totalFileSize = (uint32_t) ADI_LIBRARY_FTELL(cpuProfileFilePtr); + + /* Check that cpu profile binary file is not empty */ + if (0U == totalFileSize) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, totalFileSize, "Zero Length CPU Profile Binary Detected"); + goto cleanup; + } + + if ((uint32_t)sizeof(adrv903x_DeviceProfile_t) == totalFileSize) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + *checkOutput = ADI_ADRV903X_EXTRACT_INIT_DATA_LEGACY_PROFILE_BIN; + goto cleanup; + } + + if(ADI_LIBRARY_FSEEK(cpuProfileFilePtr, 0, SEEK_SET) < 0) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuProfileFilePtr, "Could not rewind to start"); + goto cleanup; + } + + recoveryAction = adrv903x_LoadBinFile(device, cpuProfileFilePtr, apiVer, fwVer, streamVer, init, postMcsInit, (uint32_t)sizeof(adrv903x_DeviceProfile_t)); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) + { + ADI_PARAM_ERROR_REPORT(&device->common, recoveryAction, cpuBinaryInfo->filePath, "Issue with file path for cpu profile"); + goto cleanup; + } + + *checkOutput = ADI_ADRV903X_EXTRACT_INIT_DATA_POPULATED; + +cleanup: + if (cpuProfileFilePtr != NULL) + { + /* Close CPU Profile binary file */ + if (0 != ADI_LIBRARY_FCLOSE(cpuProfileFilePtr)) + { + recoveryAction = ADI_ADRV903X_ERR_ACT_CHECK_PARAM; + ADI_API_ERROR_REPORT(&device->common, recoveryAction, "Cannot Close CPU Profile Binary File"); + } + } + + ADI_ADRV903X_API_EXIT(&device->common, recoveryAction); +} + + diff --git a/drivers/iio/adc/adrv903x/initdata.c b/drivers/iio/adc/adrv903x/initdata.c new file mode 100644 index 0000000000000..4491d749e53b1 --- /dev/null +++ b/drivers/iio/adc/adrv903x/initdata.c @@ -0,0 +1,940 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +#include "initdata.h" + +adi_adrv903x_Version_t initStructApiVersion = {2, 12, 1, 4}; + +adi_adrv903x_CpuFwVersion_t initStructArmVersion = { {2, 12, 1, 4} , ADI_ADRV903X_CPU_FW_BUILD_RELEASE}; + +adi_adrv903x_Version_t initStructStreamVersion = {2, 12, 1, 4}; + +adi_adrv903x_Init_t deviceInitStruct = +{ + { // spiOptionsInit + 1, // allowSpiStreaming + 1, // allowAhbAutoIncrement + 1, // allowAhbSpiFifoMode + }, + { // clocks + 0, // DevClkOnChipTermResEn + }, + { // cpuMemDump + { // filePath (array) + 68, 101, 118, 105, 99, 101, 67, 112, 117, 77, 101, 109, 68, 117, 109, 112, + 46, 98, 105, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }, // filePath (end of array) + }, + { // rx + { // rxChannelCfg (array) + { // rxChannelCfg[0] + { // rxDataFormat + ADI_ADRV903X_GAIN_COMPENSATION_DISABLED, // formatSelect + { // floatingPointConfig + ADI_ADRV903X_FP_FORMAT_SIGN_EXP_SIGNIFICAND, // fpDataFormat + ADI_ADRV903X_ROUND_TO_EVEN, // fpRoundMode + ADI_ADRV903X_2_EXPONENTBITS, // fpNumExpBits + ADI_ADRV903X_FPATTEN_0DB, // fpAttenSteps + ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_DISABLE, // fpHideLeadingOne + ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_DISABLE, // fpEncodeNan + }, + { // integerConfigSettings + ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS, // intEmbeddedBits + ADI_ADRV903X_INTEGER_16BIT_2SCOMP, // intSampleResolution + ADI_ADRV903X_NO_PARITY, // intParity + ADI_ADRV903X_LOWER_NIBBLE_ON_I, // intEmbeddedPos + }, + { // slicerConfigSettings + ADI_ADRV903X_EXTSLICER_STEPSIZE_1DB, // extSlicerStepSize + ADI_ADRV903X_INTSLICER_STEPSIZE_1DB, // intSlicerStepSize + ADI_ADRV903X_EXTSLICER_RX_GPIO_DISABLE, // extSlicerGpioSelect + { // intSlicerGpioSelect (array) + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[0] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[1] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[2] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[3] + }, // intSlicerGpioSelect (end of array) + }, + { // embOvldMonitorSettings + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbQ + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneQ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW, // embeddedMonitorHb2LowSrcSel + ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH, // embeddedMonitorHb2HighSrcSel + ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdLowSrcSel + ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdHighSrcSel + 0, // invertHb2Flag + 0, // invertApdFlag + }, + 0, // externalLnaGain + 0, // tempCompensationEnable + }, + 255, // rxGainIndexInit + }, // rxChannelCfg[0] + { // rxChannelCfg[1] + { // rxDataFormat + ADI_ADRV903X_GAIN_COMPENSATION_DISABLED, // formatSelect + { // floatingPointConfig + ADI_ADRV903X_FP_FORMAT_SIGN_EXP_SIGNIFICAND, // fpDataFormat + ADI_ADRV903X_ROUND_TO_EVEN, // fpRoundMode + ADI_ADRV903X_2_EXPONENTBITS, // fpNumExpBits + ADI_ADRV903X_FPATTEN_0DB, // fpAttenSteps + ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_DISABLE, // fpHideLeadingOne + ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_DISABLE, // fpEncodeNan + }, + { // integerConfigSettings + ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS, // intEmbeddedBits + ADI_ADRV903X_INTEGER_16BIT_2SCOMP, // intSampleResolution + ADI_ADRV903X_NO_PARITY, // intParity + ADI_ADRV903X_LOWER_NIBBLE_ON_I, // intEmbeddedPos + }, + { // slicerConfigSettings + ADI_ADRV903X_EXTSLICER_STEPSIZE_1DB, // extSlicerStepSize + ADI_ADRV903X_INTSLICER_STEPSIZE_1DB, // intSlicerStepSize + ADI_ADRV903X_EXTSLICER_RX_GPIO_DISABLE, // extSlicerGpioSelect + { // intSlicerGpioSelect (array) + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[0] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[1] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[2] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[3] + }, // intSlicerGpioSelect (end of array) + }, + { // embOvldMonitorSettings + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbQ + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneQ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW, // embeddedMonitorHb2LowSrcSel + ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH, // embeddedMonitorHb2HighSrcSel + ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdLowSrcSel + ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdHighSrcSel + 0, // invertHb2Flag + 0, // invertApdFlag + }, + 0, // externalLnaGain + 0, // tempCompensationEnable + }, + 255, // rxGainIndexInit + }, // rxChannelCfg[1] + { // rxChannelCfg[2] + { // rxDataFormat + ADI_ADRV903X_GAIN_COMPENSATION_DISABLED, // formatSelect + { // floatingPointConfig + ADI_ADRV903X_FP_FORMAT_SIGN_EXP_SIGNIFICAND, // fpDataFormat + ADI_ADRV903X_ROUND_TO_EVEN, // fpRoundMode + ADI_ADRV903X_2_EXPONENTBITS, // fpNumExpBits + ADI_ADRV903X_FPATTEN_0DB, // fpAttenSteps + ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_DISABLE, // fpHideLeadingOne + ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_DISABLE, // fpEncodeNan + }, + { // integerConfigSettings + ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS, // intEmbeddedBits + ADI_ADRV903X_INTEGER_16BIT_2SCOMP, // intSampleResolution + ADI_ADRV903X_NO_PARITY, // intParity + ADI_ADRV903X_LOWER_NIBBLE_ON_I, // intEmbeddedPos + }, + { // slicerConfigSettings + ADI_ADRV903X_EXTSLICER_STEPSIZE_1DB, // extSlicerStepSize + ADI_ADRV903X_INTSLICER_STEPSIZE_1DB, // intSlicerStepSize + ADI_ADRV903X_EXTSLICER_RX_GPIO_DISABLE, // extSlicerGpioSelect + { // intSlicerGpioSelect (array) + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[0] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[1] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[2] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[3] + }, // intSlicerGpioSelect (end of array) + }, + { // embOvldMonitorSettings + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbQ + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneQ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW, // embeddedMonitorHb2LowSrcSel + ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH, // embeddedMonitorHb2HighSrcSel + ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdLowSrcSel + ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdHighSrcSel + 0, // invertHb2Flag + 0, // invertApdFlag + }, + 0, // externalLnaGain + 0, // tempCompensationEnable + }, + 255, // rxGainIndexInit + }, // rxChannelCfg[2] + { // rxChannelCfg[3] + { // rxDataFormat + ADI_ADRV903X_GAIN_COMPENSATION_DISABLED, // formatSelect + { // floatingPointConfig + ADI_ADRV903X_FP_FORMAT_SIGN_EXP_SIGNIFICAND, // fpDataFormat + ADI_ADRV903X_ROUND_TO_EVEN, // fpRoundMode + ADI_ADRV903X_2_EXPONENTBITS, // fpNumExpBits + ADI_ADRV903X_FPATTEN_0DB, // fpAttenSteps + ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_DISABLE, // fpHideLeadingOne + ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_DISABLE, // fpEncodeNan + }, + { // integerConfigSettings + ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS, // intEmbeddedBits + ADI_ADRV903X_INTEGER_16BIT_2SCOMP, // intSampleResolution + ADI_ADRV903X_NO_PARITY, // intParity + ADI_ADRV903X_LOWER_NIBBLE_ON_I, // intEmbeddedPos + }, + { // slicerConfigSettings + ADI_ADRV903X_EXTSLICER_STEPSIZE_1DB, // extSlicerStepSize + ADI_ADRV903X_INTSLICER_STEPSIZE_1DB, // intSlicerStepSize + ADI_ADRV903X_EXTSLICER_RX_GPIO_DISABLE, // extSlicerGpioSelect + { // intSlicerGpioSelect (array) + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[0] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[1] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[2] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[3] + }, // intSlicerGpioSelect (end of array) + }, + { // embOvldMonitorSettings + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbQ + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneQ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW, // embeddedMonitorHb2LowSrcSel + ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH, // embeddedMonitorHb2HighSrcSel + ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdLowSrcSel + ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdHighSrcSel + 0, // invertHb2Flag + 0, // invertApdFlag + }, + 0, // externalLnaGain + 0, // tempCompensationEnable + }, + 255, // rxGainIndexInit + }, // rxChannelCfg[3] + { // rxChannelCfg[4] + { // rxDataFormat + ADI_ADRV903X_GAIN_COMPENSATION_DISABLED, // formatSelect + { // floatingPointConfig + ADI_ADRV903X_FP_FORMAT_SIGN_EXP_SIGNIFICAND, // fpDataFormat + ADI_ADRV903X_ROUND_TO_EVEN, // fpRoundMode + ADI_ADRV903X_2_EXPONENTBITS, // fpNumExpBits + ADI_ADRV903X_FPATTEN_0DB, // fpAttenSteps + ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_DISABLE, // fpHideLeadingOne + ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_DISABLE, // fpEncodeNan + }, + { // integerConfigSettings + ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS, // intEmbeddedBits + ADI_ADRV903X_INTEGER_16BIT_2SCOMP, // intSampleResolution + ADI_ADRV903X_NO_PARITY, // intParity + ADI_ADRV903X_LOWER_NIBBLE_ON_I, // intEmbeddedPos + }, + { // slicerConfigSettings + ADI_ADRV903X_EXTSLICER_STEPSIZE_1DB, // extSlicerStepSize + ADI_ADRV903X_INTSLICER_STEPSIZE_1DB, // intSlicerStepSize + ADI_ADRV903X_EXTSLICER_RX_GPIO_DISABLE, // extSlicerGpioSelect + { // intSlicerGpioSelect (array) + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[0] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[1] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[2] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[3] + }, // intSlicerGpioSelect (end of array) + }, + { // embOvldMonitorSettings + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbQ + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneQ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW, // embeddedMonitorHb2LowSrcSel + ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH, // embeddedMonitorHb2HighSrcSel + ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdLowSrcSel + ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdHighSrcSel + 0, // invertHb2Flag + 0, // invertApdFlag + }, + 0, // externalLnaGain + 0, // tempCompensationEnable + }, + 255, // rxGainIndexInit + }, // rxChannelCfg[4] + { // rxChannelCfg[5] + { // rxDataFormat + ADI_ADRV903X_GAIN_COMPENSATION_DISABLED, // formatSelect + { // floatingPointConfig + ADI_ADRV903X_FP_FORMAT_SIGN_EXP_SIGNIFICAND, // fpDataFormat + ADI_ADRV903X_ROUND_TO_EVEN, // fpRoundMode + ADI_ADRV903X_2_EXPONENTBITS, // fpNumExpBits + ADI_ADRV903X_FPATTEN_0DB, // fpAttenSteps + ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_DISABLE, // fpHideLeadingOne + ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_DISABLE, // fpEncodeNan + }, + { // integerConfigSettings + ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS, // intEmbeddedBits + ADI_ADRV903X_INTEGER_16BIT_2SCOMP, // intSampleResolution + ADI_ADRV903X_NO_PARITY, // intParity + ADI_ADRV903X_LOWER_NIBBLE_ON_I, // intEmbeddedPos + }, + { // slicerConfigSettings + ADI_ADRV903X_EXTSLICER_STEPSIZE_1DB, // extSlicerStepSize + ADI_ADRV903X_INTSLICER_STEPSIZE_1DB, // intSlicerStepSize + ADI_ADRV903X_EXTSLICER_RX_GPIO_DISABLE, // extSlicerGpioSelect + { // intSlicerGpioSelect (array) + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[0] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[1] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[2] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[3] + }, // intSlicerGpioSelect (end of array) + }, + { // embOvldMonitorSettings + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbQ + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneQ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW, // embeddedMonitorHb2LowSrcSel + ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH, // embeddedMonitorHb2HighSrcSel + ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdLowSrcSel + ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdHighSrcSel + 0, // invertHb2Flag + 0, // invertApdFlag + }, + 0, // externalLnaGain + 0, // tempCompensationEnable + }, + 255, // rxGainIndexInit + }, // rxChannelCfg[5] + { // rxChannelCfg[6] + { // rxDataFormat + ADI_ADRV903X_GAIN_COMPENSATION_DISABLED, // formatSelect + { // floatingPointConfig + ADI_ADRV903X_FP_FORMAT_SIGN_EXP_SIGNIFICAND, // fpDataFormat + ADI_ADRV903X_ROUND_TO_EVEN, // fpRoundMode + ADI_ADRV903X_2_EXPONENTBITS, // fpNumExpBits + ADI_ADRV903X_FPATTEN_0DB, // fpAttenSteps + ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_DISABLE, // fpHideLeadingOne + ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_DISABLE, // fpEncodeNan + }, + { // integerConfigSettings + ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS, // intEmbeddedBits + ADI_ADRV903X_INTEGER_16BIT_2SCOMP, // intSampleResolution + ADI_ADRV903X_NO_PARITY, // intParity + ADI_ADRV903X_LOWER_NIBBLE_ON_I, // intEmbeddedPos + }, + { // slicerConfigSettings + ADI_ADRV903X_EXTSLICER_STEPSIZE_1DB, // extSlicerStepSize + ADI_ADRV903X_INTSLICER_STEPSIZE_1DB, // intSlicerStepSize + ADI_ADRV903X_EXTSLICER_RX_GPIO_DISABLE, // extSlicerGpioSelect + { // intSlicerGpioSelect (array) + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[0] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[1] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[2] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[3] + }, // intSlicerGpioSelect (end of array) + }, + { // embOvldMonitorSettings + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbQ + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneQ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW, // embeddedMonitorHb2LowSrcSel + ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH, // embeddedMonitorHb2HighSrcSel + ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdLowSrcSel + ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdHighSrcSel + 0, // invertHb2Flag + 0, // invertApdFlag + }, + 0, // externalLnaGain + 0, // tempCompensationEnable + }, + 255, // rxGainIndexInit + }, // rxChannelCfg[6] + { // rxChannelCfg[7] + { // rxDataFormat + ADI_ADRV903X_GAIN_COMPENSATION_DISABLED, // formatSelect + { // floatingPointConfig + ADI_ADRV903X_FP_FORMAT_SIGN_EXP_SIGNIFICAND, // fpDataFormat + ADI_ADRV903X_ROUND_TO_EVEN, // fpRoundMode + ADI_ADRV903X_2_EXPONENTBITS, // fpNumExpBits + ADI_ADRV903X_FPATTEN_0DB, // fpAttenSteps + ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_DISABLE, // fpHideLeadingOne + ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_DISABLE, // fpEncodeNan + }, + { // integerConfigSettings + ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS, // intEmbeddedBits + ADI_ADRV903X_INTEGER_16BIT_2SCOMP, // intSampleResolution + ADI_ADRV903X_NO_PARITY, // intParity + ADI_ADRV903X_LOWER_NIBBLE_ON_I, // intEmbeddedPos + }, + { // slicerConfigSettings + ADI_ADRV903X_EXTSLICER_STEPSIZE_1DB, // extSlicerStepSize + ADI_ADRV903X_INTSLICER_STEPSIZE_1DB, // intSlicerStepSize + ADI_ADRV903X_EXTSLICER_RX_GPIO_DISABLE, // extSlicerGpioSelect + { // intSlicerGpioSelect (array) + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[0] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[1] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[2] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[3] + }, // intSlicerGpioSelect (end of array) + }, + { // embOvldMonitorSettings + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbQ + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneQ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW, // embeddedMonitorHb2LowSrcSel + ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH, // embeddedMonitorHb2HighSrcSel + ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdLowSrcSel + ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdHighSrcSel + 0, // invertHb2Flag + 0, // invertApdFlag + }, + 0, // externalLnaGain + 0, // tempCompensationEnable + }, + 255, // rxGainIndexInit + }, // rxChannelCfg[7] + { // rxChannelCfg[8] + { // rxDataFormat + ADI_ADRV903X_GAIN_COMPENSATION_DISABLED, // formatSelect + { // floatingPointConfig + ADI_ADRV903X_FP_FORMAT_SIGN_EXP_SIGNIFICAND, // fpDataFormat + ADI_ADRV903X_ROUND_TO_EVEN, // fpRoundMode + ADI_ADRV903X_2_EXPONENTBITS, // fpNumExpBits + ADI_ADRV903X_FPATTEN_0DB, // fpAttenSteps + ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_DISABLE, // fpHideLeadingOne + ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_DISABLE, // fpEncodeNan + }, + { // integerConfigSettings + ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS, // intEmbeddedBits + ADI_ADRV903X_INTEGER_16BIT_2SCOMP, // intSampleResolution + ADI_ADRV903X_NO_PARITY, // intParity + ADI_ADRV903X_LOWER_NIBBLE_ON_I, // intEmbeddedPos + }, + { // slicerConfigSettings + ADI_ADRV903X_EXTSLICER_STEPSIZE_1DB, // extSlicerStepSize + ADI_ADRV903X_INTSLICER_STEPSIZE_1DB, // intSlicerStepSize + ADI_ADRV903X_EXTSLICER_RX_GPIO_DISABLE, // extSlicerGpioSelect + { // intSlicerGpioSelect (array) + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[0] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[1] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[2] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[3] + }, // intSlicerGpioSelect (end of array) + }, + { // embOvldMonitorSettings + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbQ + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneQ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW, // embeddedMonitorHb2LowSrcSel + ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH, // embeddedMonitorHb2HighSrcSel + ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdLowSrcSel + ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdHighSrcSel + 0, // invertHb2Flag + 0, // invertApdFlag + }, + 0, // externalLnaGain + 0, // tempCompensationEnable + }, + 255, // rxGainIndexInit + }, // rxChannelCfg[8] + { // rxChannelCfg[9] + { // rxDataFormat + ADI_ADRV903X_GAIN_COMPENSATION_DISABLED, // formatSelect + { // floatingPointConfig + ADI_ADRV903X_FP_FORMAT_SIGN_EXP_SIGNIFICAND, // fpDataFormat + ADI_ADRV903X_ROUND_TO_EVEN, // fpRoundMode + ADI_ADRV903X_2_EXPONENTBITS, // fpNumExpBits + ADI_ADRV903X_FPATTEN_0DB, // fpAttenSteps + ADI_ADRV903X_FP_FORMAT_HIDE_LEADING_ONE_DISABLE, // fpHideLeadingOne + ADI_ADRV903X_FP_FORMAT_NAN_ENCODE_DISABLE, // fpEncodeNan + }, + { // integerConfigSettings + ADI_ADRV903X_NO_EMBEDDED_SLICER_BITS, // intEmbeddedBits + ADI_ADRV903X_INTEGER_16BIT_2SCOMP, // intSampleResolution + ADI_ADRV903X_NO_PARITY, // intParity + ADI_ADRV903X_LOWER_NIBBLE_ON_I, // intEmbeddedPos + }, + { // slicerConfigSettings + ADI_ADRV903X_EXTSLICER_STEPSIZE_1DB, // extSlicerStepSize + ADI_ADRV903X_INTSLICER_STEPSIZE_1DB, // intSlicerStepSize + ADI_ADRV903X_EXTSLICER_RX_GPIO_DISABLE, // extSlicerGpioSelect + { // intSlicerGpioSelect (array) + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[0] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[1] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[2] + ADI_ADRV903X_GPIO_INVALID, // intSlicerGpioSelect[3] + }, // intSlicerGpioSelect (end of array) + }, + { // embOvldMonitorSettings + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbQ + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneI + ADI_ADRV903X_RX_EMB_MON_SRC_NO_MON_DATA_EMBEDDED, // embeddedMonitorSrcLsbPlusOneQ + ADI_ADRV903X_HB2_LOW_SRC_OVRG_LOW, // embeddedMonitorHb2LowSrcSel + ADI_ADRV903X_HB2_HIGH_SRC_OVRG_HIGH, // embeddedMonitorHb2HighSrcSel + ADI_ADRV903X_APD_LOW_SRC_LOWER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdLowSrcSel + ADI_ADRV903X_APD_HIGH_SRC_UPPER_LEVEL_BLOCKER_EXCEEDED, // embeddedMonitorApdHighSrcSel + 0, // invertHb2Flag + 0, // invertApdFlag + }, + 0, // externalLnaGain + 0, // tempCompensationEnable + }, + 255, // rxGainIndexInit + }, // rxChannelCfg[9] + }, // rxChannelCfg (end of array) + }, + { // tx + { // txChannelCfg (array) + { // txChannelCfg[0] + { // txAttenCfg + { // updateCfg + { // srcCfg + ADI_ADRV903X_TXATTEN_UPD_SRC_S0, // updateSrc + ADI_ADRV903X_GPIO_INVALID, // s0OrS1Gpio + }, + { // trgCfg + ADI_ADRV903X_TXATTEN_UPD_TRG_NONE, // updateTrg + ADI_ADRV903X_GPIO_INVALID, // triggerGpio + }, + }, + ADI_ADRV903X_TXATTEN_0P05_DB, // txAttenStepSize + }, + 0, // txAttenInit_mdB + { // txpowerMonitorCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // peakThreshold + 0, // measDuration + 0, // peakCount + 0, // peakErrorClearRequired + 0, // peakPowerEnable + 0, // peakPowerIrqEnable + 0, // avgThreshold + 0, // avgErrorClearRequired + 0, // avgPowerEnable + 0, // avgPowerIrqEnable + 0, // avgPeakRatioEnable + }, + { // srlCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // srdOffset + 0, // srdEnable + 0, // srdIrqEnable + 0, // autoRecoveryWaitTime + 0, // autoRecoveryEnable + 0, // autoRecoveryDisableTimerWhenTxOff + 0, // srdStatisticsEnable + 0, // srdStatisticsMode + }, + { // protectionRampCfg + 0x00, // rampDownMask + 0, // altEventClearReqd + }, + }, // txChannelCfg[0] + { // txChannelCfg[1] + { // txAttenCfg + { // updateCfg + { // srcCfg + ADI_ADRV903X_TXATTEN_UPD_SRC_S0, // updateSrc + ADI_ADRV903X_GPIO_INVALID, // s0OrS1Gpio + }, + { // trgCfg + ADI_ADRV903X_TXATTEN_UPD_TRG_NONE, // updateTrg + ADI_ADRV903X_GPIO_INVALID, // triggerGpio + }, + }, + ADI_ADRV903X_TXATTEN_0P05_DB, // txAttenStepSize + }, + 0, // txAttenInit_mdB + { // txpowerMonitorCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // peakThreshold + 0, // measDuration + 0, // peakCount + 0, // peakErrorClearRequired + 0, // peakPowerEnable + 0, // peakPowerIrqEnable + 0, // avgThreshold + 0, // avgErrorClearRequired + 0, // avgPowerEnable + 0, // avgPowerIrqEnable + 0, // avgPeakRatioEnable + }, + { // srlCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // srdOffset + 0, // srdEnable + 0, // srdIrqEnable + 0, // autoRecoveryWaitTime + 0, // autoRecoveryEnable + 0, // autoRecoveryDisableTimerWhenTxOff + 0, // srdStatisticsEnable + 0, // srdStatisticsMode + }, + { // protectionRampCfg + 0x00, // rampDownMask + 0, // altEventClearReqd + }, + }, // txChannelCfg[1] + { // txChannelCfg[2] + { // txAttenCfg + { // updateCfg + { // srcCfg + ADI_ADRV903X_TXATTEN_UPD_SRC_S0, // updateSrc + ADI_ADRV903X_GPIO_INVALID, // s0OrS1Gpio + }, + { // trgCfg + ADI_ADRV903X_TXATTEN_UPD_TRG_NONE, // updateTrg + ADI_ADRV903X_GPIO_INVALID, // triggerGpio + }, + }, + ADI_ADRV903X_TXATTEN_0P05_DB, // txAttenStepSize + }, + 0, // txAttenInit_mdB + { // txpowerMonitorCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // peakThreshold + 0, // measDuration + 0, // peakCount + 0, // peakErrorClearRequired + 0, // peakPowerEnable + 0, // peakPowerIrqEnable + 0, // avgThreshold + 0, // avgErrorClearRequired + 0, // avgPowerEnable + 0, // avgPowerIrqEnable + 0, // avgPeakRatioEnable + }, + { // srlCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // srdOffset + 0, // srdEnable + 0, // srdIrqEnable + 0, // autoRecoveryWaitTime + 0, // autoRecoveryEnable + 0, // autoRecoveryDisableTimerWhenTxOff + 0, // srdStatisticsEnable + 0, // srdStatisticsMode + }, + { // protectionRampCfg + 0x00, // rampDownMask + 0, // altEventClearReqd + }, + }, // txChannelCfg[2] + { // txChannelCfg[3] + { // txAttenCfg + { // updateCfg + { // srcCfg + ADI_ADRV903X_TXATTEN_UPD_SRC_S0, // updateSrc + ADI_ADRV903X_GPIO_INVALID, // s0OrS1Gpio + }, + { // trgCfg + ADI_ADRV903X_TXATTEN_UPD_TRG_NONE, // updateTrg + ADI_ADRV903X_GPIO_INVALID, // triggerGpio + }, + }, + ADI_ADRV903X_TXATTEN_0P05_DB, // txAttenStepSize + }, + 0, // txAttenInit_mdB + { // txpowerMonitorCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // peakThreshold + 0, // measDuration + 0, // peakCount + 0, // peakErrorClearRequired + 0, // peakPowerEnable + 0, // peakPowerIrqEnable + 0, // avgThreshold + 0, // avgErrorClearRequired + 0, // avgPowerEnable + 0, // avgPowerIrqEnable + 0, // avgPeakRatioEnable + }, + { // srlCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // srdOffset + 0, // srdEnable + 0, // srdIrqEnable + 0, // autoRecoveryWaitTime + 0, // autoRecoveryEnable + 0, // autoRecoveryDisableTimerWhenTxOff + 0, // srdStatisticsEnable + 0, // srdStatisticsMode + }, + { // protectionRampCfg + 0x00, // rampDownMask + 0, // altEventClearReqd + }, + }, // txChannelCfg[3] + { // txChannelCfg[4] + { // txAttenCfg + { // updateCfg + { // srcCfg + ADI_ADRV903X_TXATTEN_UPD_SRC_S0, // updateSrc + ADI_ADRV903X_GPIO_INVALID, // s0OrS1Gpio + }, + { // trgCfg + ADI_ADRV903X_TXATTEN_UPD_TRG_NONE, // updateTrg + ADI_ADRV903X_GPIO_INVALID, // triggerGpio + }, + }, + ADI_ADRV903X_TXATTEN_0P05_DB, // txAttenStepSize + }, + 0, // txAttenInit_mdB + { // txpowerMonitorCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // peakThreshold + 0, // measDuration + 0, // peakCount + 0, // peakErrorClearRequired + 0, // peakPowerEnable + 0, // peakPowerIrqEnable + 0, // avgThreshold + 0, // avgErrorClearRequired + 0, // avgPowerEnable + 0, // avgPowerIrqEnable + 0, // avgPeakRatioEnable + }, + { // srlCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // srdOffset + 0, // srdEnable + 0, // srdIrqEnable + 0, // autoRecoveryWaitTime + 0, // autoRecoveryEnable + 0, // autoRecoveryDisableTimerWhenTxOff + 0, // srdStatisticsEnable + 0, // srdStatisticsMode + }, + { // protectionRampCfg + 0x00, // rampDownMask + 0, // altEventClearReqd + }, + }, // txChannelCfg[4] + { // txChannelCfg[5] + { // txAttenCfg + { // updateCfg + { // srcCfg + ADI_ADRV903X_TXATTEN_UPD_SRC_S0, // updateSrc + ADI_ADRV903X_GPIO_INVALID, // s0OrS1Gpio + }, + { // trgCfg + ADI_ADRV903X_TXATTEN_UPD_TRG_NONE, // updateTrg + ADI_ADRV903X_GPIO_INVALID, // triggerGpio + }, + }, + ADI_ADRV903X_TXATTEN_0P05_DB, // txAttenStepSize + }, + 0, // txAttenInit_mdB + { // txpowerMonitorCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // peakThreshold + 0, // measDuration + 0, // peakCount + 0, // peakErrorClearRequired + 0, // peakPowerEnable + 0, // peakPowerIrqEnable + 0, // avgThreshold + 0, // avgErrorClearRequired + 0, // avgPowerEnable + 0, // avgPowerIrqEnable + 0, // avgPeakRatioEnable + }, + { // srlCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // srdOffset + 0, // srdEnable + 0, // srdIrqEnable + 0, // autoRecoveryWaitTime + 0, // autoRecoveryEnable + 0, // autoRecoveryDisableTimerWhenTxOff + 0, // srdStatisticsEnable + 0, // srdStatisticsMode + }, + { // protectionRampCfg + 0x00, // rampDownMask + 0, // altEventClearReqd + }, + }, // txChannelCfg[5] + { // txChannelCfg[6] + { // txAttenCfg + { // updateCfg + { // srcCfg + ADI_ADRV903X_TXATTEN_UPD_SRC_S0, // updateSrc + ADI_ADRV903X_GPIO_INVALID, // s0OrS1Gpio + }, + { // trgCfg + ADI_ADRV903X_TXATTEN_UPD_TRG_NONE, // updateTrg + ADI_ADRV903X_GPIO_INVALID, // triggerGpio + }, + }, + ADI_ADRV903X_TXATTEN_0P05_DB, // txAttenStepSize + }, + 0, // txAttenInit_mdB + { // txpowerMonitorCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // peakThreshold + 0, // measDuration + 0, // peakCount + 0, // peakErrorClearRequired + 0, // peakPowerEnable + 0, // peakPowerIrqEnable + 0, // avgThreshold + 0, // avgErrorClearRequired + 0, // avgPowerEnable + 0, // avgPowerIrqEnable + 0, // avgPeakRatioEnable + }, + { // srlCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // srdOffset + 0, // srdEnable + 0, // srdIrqEnable + 0, // autoRecoveryWaitTime + 0, // autoRecoveryEnable + 0, // autoRecoveryDisableTimerWhenTxOff + 0, // srdStatisticsEnable + 0, // srdStatisticsMode + }, + { // protectionRampCfg + 0x00, // rampDownMask + 0, // altEventClearReqd + }, + }, // txChannelCfg[6] + { // txChannelCfg[7] + { // txAttenCfg + { // updateCfg + { // srcCfg + ADI_ADRV903X_TXATTEN_UPD_SRC_S0, // updateSrc + ADI_ADRV903X_GPIO_INVALID, // s0OrS1Gpio + }, + { // trgCfg + ADI_ADRV903X_TXATTEN_UPD_TRG_NONE, // updateTrg + ADI_ADRV903X_GPIO_INVALID, // triggerGpio + }, + }, + ADI_ADRV903X_TXATTEN_0P05_DB, // txAttenStepSize + }, + 0, // txAttenInit_mdB + { // txpowerMonitorCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // peakThreshold + 0, // measDuration + 0, // peakCount + 0, // peakErrorClearRequired + 0, // peakPowerEnable + 0, // peakPowerIrqEnable + 0, // avgThreshold + 0, // avgErrorClearRequired + 0, // avgPowerEnable + 0, // avgPowerIrqEnable + 0, // avgPeakRatioEnable + }, + { // srlCfg + ADI_ADRV903X_HB1_OUTPUT, // inputSel + 0, // srdOffset + 0, // srdEnable + 0, // srdIrqEnable + 0, // autoRecoveryWaitTime + 0, // autoRecoveryEnable + 0, // autoRecoveryDisableTimerWhenTxOff + 0, // srdStatisticsEnable + 0, // srdStatisticsMode + }, + { // protectionRampCfg + 0x00, // rampDownMask + 0, // altEventClearReqd + }, + }, // txChannelCfg[7] + }, // txChannelCfg (end of array) + }, + { // uart (array) + { // uart[0] + 0, // enable + ADI_ADRV903X_GPIO_09, // pinSelect + }, // uart[0] + { // uart[1] + 0, // enable + ADI_ADRV903X_GPIO_10, // pinSelect + }, // uart[1] + { // uart[2] + 0, // enable + ADI_ADRV903X_GPIO_11, // pinSelect + }, // uart[2] + { // uart[3] + 0, // enable + ADI_ADRV903X_GPIO_12, // pinSelect + }, // uart[3] + }, // uart (end of array) + { // gpIntPreInit + { // gpInt0Mask + 0xFFFFFFFFFFFF, // lowerMask + 0xFFFFFFFFFFFF, // upperMask + }, + { // gpInt1Mask + 0xFFFFFFFFFFFF, // lowerMask + 0xFFFFFFFFFFFF, // upperMask + }, + }, +}; +adi_adrv903x_PostMcsInit_t utilityInit = +{ + { // radioCtrlCfg + { // txRadioCtrlModeCfg + ADI_ADRV903X_TX_EN_SPI_MODE, // txEnableMode + 0xFF, // txChannelMask + }, + { // rxRadioCtrlModeCfg + ADI_ADRV903X_RX_EN_SPI_MODE, // rxEnableMode + 0xFF, // rxChannelMask + }, + { // orxRadioCtrlModeCfg + ADI_ADRV903X_ORX_EN_SPI_MODE, // orxEnableMode + 0x300, // orxChannelMask + }, + }, + { // radioCtrlGpioCfg + { // txEnMapping (array) + 0, 0, 0, 0, 0, 0, 0, 0, + }, // txEnMapping (end of array) + { // txAltMapping (array) + 0, 0, 0, 0, 0, 0, 0, 0, + }, // txAltMapping (end of array) + { // rxEnMapping (array) + 0, 0, 0, 0, 0, 0, 0, 0, + }, // rxEnMapping (end of array) + { // rxAltMapping (array) + 0, 0, 0, 0, 0, 0, 0, 0, + }, // rxAltMapping (end of array) + }, + 0, // radioCtrlTxRxEnPinSel + 0, // radioCtrlTxRxEnCfgSel + { // gpIntPostInit + { // gpInt0Mask + 0xFFFFFFFFFFFF, // lowerMask + 0xFFFFFFFFFFFF, // upperMask + }, + { // gpInt1Mask + 0xFFFFFFFFFFFF, // lowerMask + 0xFFFFFFFFFFFF, // upperMask + }, + }, + { // initCals + 0x7E, // calMask + 0xFF, // rxChannelMask + 0xFF, // txChannelMask + 0x03, // orxChannelMask + 0, // warmBoot + }, +}; diff --git a/drivers/iio/adc/adrv903x/initdata.h b/drivers/iio/adc/adrv903x/initdata.h new file mode 100644 index 0000000000000..be5f98ad23a6e --- /dev/null +++ b/drivers/iio/adc/adrv903x/initdata.h @@ -0,0 +1,26 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * \file initdata.h + * \brief Contains extern declarations for ADRV903X data structures + * initializations + * + * ADRV903X API Version: 2.12.1.4 + */ + +#ifndef INITDATA_H_ +#define INITDATA_H_ + +#include "adi_adrv903x_api.h" + +ADI_API_EX adi_adrv903x_Version_t initStructApiVersion; +ADI_API_EX adi_adrv903x_CpuFwVersion_t initStructArmVersion; +ADI_API_EX adi_adrv903x_Version_t initStructStreamVersion; +ADI_API_EX adi_adrv903x_Init_t deviceInitStruct; +ADI_API_EX adi_adrv903x_PostMcsInit_t utilityInit; + +#endif /* INITDATA_H_ */ + diff --git a/drivers/iio/adc/adrv903x/platforms/adi_library.c b/drivers/iio/adc/adrv903x/platforms/adi_library.c new file mode 100644 index 0000000000000..563d84f7e7a6c --- /dev/null +++ b/drivers/iio/adc/adrv903x/platforms/adi_library.c @@ -0,0 +1,285 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_library.c +* \brief Contains implementations of standard library functions +* +* ADRV903X API Version: 2.12.1.4 +*/ +#include "adi_library.h" + +ADI_API void* adi_library_memset(void* dst, int c, size_t len) +{ + uint8_t* target = NULL; + + target = (uint8_t*) dst; + + if ((dst == NULL) || (len <= 0)) + { + return (NULL); + } + + for (; len; len--) + { + *target++ = (uint8_t) c; + } + + return target; +} + +ADI_API void* adi_library_memcpy(void* dst, const void* src, size_t len) +{ + uint8_t* target = NULL; + const uint8_t* source = NULL; + + target = (uint8_t*) dst; + source = (const uint8_t*) src; + + if ((dst == NULL) || (src == NULL) || (len <= 0U)) + return (NULL); + + for (; len; len--) + { + *target++ = *source++; + } + + return dst; +} + +ADI_API size_t adi_library_strlen(const char* src) +{ + uint8_t* target = NULL; + const uint8_t* source = NULL; + + target = (uint8_t*) src; + source = (const uint8_t*) src; + + if (src == NULL) + { + return (0U); + } + + /* Find NULL character in the src string */ + for (; *target != '\0'; target++) + { + /* Do nothing */ + } + + /* The delta is the length */ + return (target - source); +} + +ADI_API size_t adi_library_strnlen(const char* src, size_t maxlen) +{ + uint8_t* target = NULL; + const uint8_t* source = NULL; + + target = (uint8_t*) src; + source = (const uint8_t*) src; + + if ((src == NULL) || (maxlen <= 0U)) + { + return (0U); + } + + for (; *target != '\0'; target++) + { + if ((size_t) (target - source) > maxlen) + { + return (maxlen); + } + } + + return (target - source); +} + +ADI_API char* adi_library_strchr(const char* src, int c) +{ + char* target = NULL; + + target = (char*) src; + + if (target == NULL) + { + return (NULL); + } + + for (; *target != '\0'; target++) + { + if (*target == (char) c) + { + return (target); + } + } + + return (NULL); +} + +ADI_API char* adi_library_strcat(char* dst, const char* src) +{ + char* target = dst; + char* source = NULL; + source = (char*) src; + + if ((dst == NULL) || (src == NULL)) + { + return (NULL); + } + + /* Move target pointer to the end of target string. */ + for (; *target != '\0'; target++) + { + /* Do Nothing */ + } + + /* Copy every byte from source string to target */ + for (; *source != '\0'; source++, target++) + { + *target = *source; + } + + /* set last byte as NULL */ + *target = '\0'; + + return (dst); +} + +ADI_API char* adi_library_strncat(char* dst, const char* src, size_t n) +{ + char* target = dst; + char* source = NULL; + + source = (char*) src; + + if ((dst == NULL) || (src == NULL) || (n <= 0U)) + { + return (NULL); + } + + /* Move target pointer to the end of target string. */ + for (; *target != '\0'; target++) + { + /* Do Nothing */ + } + + /* Copy every byte from source string to target */ + for (; *source != '\0'; source++, target++) + { + if (n != 0U) + { + *target = *source; + n--; + } + else + { + break; + } + } + + /* set last byte as NULL */ + *target = '\0'; + + return (dst); +} + +ADI_API char* adi_library_strdup(const char* stringPtr) +{ + size_t stringLength = adi_library_strlen(stringPtr) + 1; + + if (stringPtr == NULL) + { + return NULL; + } + + void* duplicateString = malloc(stringLength); + + if (duplicateString == NULL) + { + return NULL; + } + + return (char*) ADI_LIBRARY_MEMCPY(duplicateString, stringPtr, stringLength); +} + +#ifndef ADI_LIBRARY_RM_FLOATS + +ADI_API int32_t adi_library_q36ToDB(uint32_t val, int32_t scale) +{ + return (int32_t)(10 * log10(val / pow(2,36)) * scale); +} + +ADI_API int32_t adi_library_linearToMillidBVolt(uint32_t val, uint32_t scale) +{ + return (int32_t)(1000 * 20 * log10((double)val / scale)); +} + +ADI_API int32_t adi_library_millidBVoltToLinear(int32_t millidB, uint32_t scale) +{ + return (uint32_t)(pow(10, (double)millidB / 1000 / 20) * scale); +} +#elif defined (__KERNEL__) + +ADI_API int32_t adi_library_q36ToDB(uint32_t val, int32_t scale) +{ + /* 181816029 = (1 << 24) * log10(1 << 36) */ + return (10 * (int64_t)(intlog10(val) - 181816029ULL) * scale) >> 24; +} + +ADI_API int32_t adi_library_linearToMillidBVolt(uint32_t val, uint32_t scale) +{ + return (1000 * 20 * ((uint64_t)intlog10(val) - intlog10(scale))) >> 24U; +} + +#define COMPUTE(n, d) if (neg) {a *= d; a = div_u64(a, n);} else {a *= n; a = div_u64(a, d);}; +ADI_API int32_t adi_library_millidBVoltToLinear(int32_t millidB, uint32_t scale) +{ + unsigned neg = 0; + uint64_t a = scale; + + if (millidB < 0) { + neg = 1; + millidB *= -1; + } + + while (millidB > 0) { + if (millidB >= 20000) { + millidB -= 20000; + COMPUTE(10, 1); /* 10^(20/20) */ + continue; + } + if (millidB >= 6000) { + millidB -= 6000; + COMPUTE(199526, 100000); /* 10^(6/20) */ + continue; + } + if (millidB >= 1000) { + millidB -= 1000; + COMPUTE(112202, 100000); /* 10^(1/20) */ + continue; + } + if (millidB >= 100) { + millidB -= 100; + COMPUTE(101158, 100000); /* 10^(0.1/20) */ + continue; + } + if (millidB >= 10) { + millidB -= 10; + COMPUTE(100115, 100000); /* 10^(0.01/20) */ + continue; + } + if (millidB >= 1) { + millidB -= 1; + COMPUTE(100012, 100000); /* 10^(0.001/20) */ + continue; + } + } + + return a; +} + +#else +#error "log(), pow() replacement functions using integers must be implemented" +#endif \ No newline at end of file diff --git a/drivers/iio/adc/adrv903x/platforms/adi_library.h b/drivers/iio/adc/adrv903x/platforms/adi_library.h new file mode 100644 index 0000000000000..f2b266d67f9c4 --- /dev/null +++ b/drivers/iio/adc/adrv903x/platforms/adi_library.h @@ -0,0 +1,129 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ +/** +* \file adi_library.h +* +* ADRV903X API Version: 2.12.1.4 +*/ +#ifndef _ADI_LIBRARY_H_ +#define _ADI_LIBRARY_H_ + +#include "adi_library_types.h" +#include "adi_platform.h" + +/** +* \brief A function to set a n byte of memory to a specific character. +* +* \param dst is a pointer to the chunk of memory +* \param c value to be set is passed as an int but function fills memory using unsigned char conversion +* \param len is the size of the chunk of memory. +* +* \retval Returns pointer to the dst when successful, NULL when error occurred. +*/ +ADI_API void* adi_library_memset(void* dst, int c, size_t len); + +/** +* \brief A function to copy len bytes from memory area src to memory area dst. +* +* \param dst destination memory (copy to). +* \param src source memory (copy from). +* \param len is the size of the chunk of dst when successful, NULL when error occurred. +* +* \retval Returns pointer to the dst. +*/ +ADI_API void* adi_library_memcpy(void* dst, const void* src, size_t len); + +/** +* \brief A function to determine the length of a string. +* +* \param src points to a string. +* +* \retval Returns the length of the string, 0 when error occurred. +*/ +ADI_API size_t adi_library_strlen(const char* src); + +/** +* \brief A function to determine the length of a fixed-size string. +* +* \param src points to a string. +* \param maxlen is at most of the string length. +* +* \retval Returns the length of the string or maxlen if '\0' is not found in the string, or 0 when error occurred. +*/ +ADI_API size_t adi_library_strnlen(const char* src, size_t maxlen); + +/** +* \brief A function to return a pointer to the first occurrence of the character c in the string src. +* +* \param src points to a string. +* \param c is a character to look for in the src string. +* +* \retval Return a pointer to the matched character or NULL if the character is not found or error occurred. +*/ +ADI_API char* adi_library_strchr(const char* src, int c); + +/** +* \brief A function appends the src string to the dst string. dst string must have enough room for both strings. +* +* \param dst points to a string +* \param src points to a string +* +* \retval Return a pointer to the resulting string dst, NULL when error occurred. +*/ +ADI_API char* adi_library_strcat(char* dst, const char* src); + +/** +* \brief A function appends n bytes the src string to the dst string. dst string must have enough room for dst string and n bytes. +* +* \param dst points to a string. +* \param src points to a string. +* \param n number of bytes to use from src string. +* +* \retval Return a pointer to the resulting string dst, NULL when error occurred. +*/ +ADI_API char* adi_library_strncat(char* dst, const char* src, size_t n); + +/** +* \brief A function to duplicate a string +* +* NOTE: Caller is responsible for managing/freeing duplicate string (i.e. Duplication done using malloc()) +* +* \param[in] stringPtr points to a string to be duplicated +* +* \retval Pointer to duplicated string or NULL for error +*/ +ADI_API char* adi_library_strdup(const char* stringPtr); + +/** +* \brief Convert a fixed point Q0.36 value to a dB value +* +* \param[in] val Q0.36 value +* \param[in] scale Scale factor (e.g. 1000 to get milli-dB returned) +* +* \retval Scaled dB value +*/ +ADI_API int32_t adi_library_q36ToDB(uint32_t val, int32_t scale); + +/** +* \brief Convert a linear value to a milli-dB value +* +* \param[in] val linear value +* \param[in] scale Scale factor +* +* \retval milli-dB value +*/ +ADI_API int32_t adi_library_linearToMillidBVolt(uint32_t val, uint32_t scale); + +/** +* \brief Convert a milli-dB value to a linear field value +* +* \param[in] millidB milli-dB value +* \param[in] scale Scale factor +* +* \retval linear value +*/ +ADI_API int32_t adi_library_millidBVoltToLinear(int32_t millidB, uint32_t scale); + +#endif /*_ADI_LIBRARY_H_ */ diff --git a/drivers/iio/adc/adrv903x/platforms/adi_library_types.h b/drivers/iio/adc/adrv903x/platforms/adi_library_types.h new file mode 100644 index 0000000000000..7188992b38c1d --- /dev/null +++ b/drivers/iio/adc/adrv903x/platforms/adi_library_types.h @@ -0,0 +1,168 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_library_types.h +* +* ADRV903X API Version: 2.12.1.4 +*/ +#ifndef _ADI_LIBRARY_TYPES_H_ +#define _ADI_LIBRARY_TYPES_H_ + +#ifdef __KERNEL__ +#include +#include +#include +#include +#include +#include +#include +#include +typedef time64_t time_t; +#define INT16_MAX S16_MAX +#define INT16_MIN S16_MIN +#define UINT16_MAX U16_MAX +#define UINT32_MAX U32_MAX +#define PRIX32 "lX" +#define PRIu32 "u" +#define PRId64 "d" +#define PRIX64 "llX" +#define time_t time64_t +/** Define to disable any code that uses floating point types */ +#define ADI_LIBRARY_RM_FLOATS 1 +#define ADI_PLATFORM_LARGE_VARS_ON_HEAP /* Use heap instead of stack for large variables */ +#else + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif + +/* stddef.h */ +#define ADI_LIBRARY_OFFSETOF offsetof + +/* stdio.h */ +#define ADI_LIBRARY_PRINTF printf +#define ADI_LIBRARY_FPRINTF fprintf +#define ADI_LIBRARY_SPRINTF sprintf +#define ADI_LIBRARY_SNPRINTF snprintf +#define ADI_LIBRARY_VPRINTF vprintf +#define ADI_LIBRARY_VSNPRINTF vsnprintf +#define ADI_LIBRARY_FFLUSH fflush +#define ADI_LIBRARY_FSEEK fseek +#define ADI_LIBRARY_FREAD fread +#define ADI_LIBRARY_FWRITE fwrite +#define ADI_LIBRARY_FOPEN fopen +#define ADI_LIBRARY_FOPEN_S fopen_s +#define ADI_LIBRARY_FCLOSE fclose +#define ADI_LIBRARY_FTELL ftell +#define ADI_LIBRARY_FERROR ferror +#define ADI_LIBRARY_SETVBUF setvbuf +#define ADI_LIBRARY_FGETS fgets + +/* stdlib.h */ +#define ADI_LIBRARY_CALLOC calloc +#define ADI_LIBRARY_FREE free +#define ADI_LIBRARY_RAND rand +#define ADI_LIBRARY_EXIT exit +#define ADI_LIBRARY_ABS abs + +/* stdarg.h */ +#define ADI_LIBRARY_VA_START va_start +#define ADI_LIBRARY_VA_END va_end + +/* math.h*/ +#define ADI_LIBRARY_CEIL ceil + +/* string.h */ +#define ADI_LIBRARY_MEMSET memset +#define ADI_LIBRARY_MEMCPY memcpy +#define ADI_LIBRARY_STRLEN strlen +#define ADI_LIBRARY_MEMCMP memcmp +#define ADI_LIBRARY_STRCMP strcmp +#define ADI_LIBRARY_STRTOK strtok +#define ADI_LIBRARY_STRTOK_R strtok_r + +#if __STDC_VERSION__ >= 199901L /* C99 */ + #define ADI_LIBRARY_STRNLEN adi_library_strnlen /* ADI Implementation Required for C99 Make File Test */ +#else + #define ADI_LIBRARY_STRNLEN strnlen +#endif + +#define ADI_LIBRARY_STRCHR strchr +#define ADI_LIBRARY_STRCAT strcat +#define ADI_LIBRARY_STRNCAT strncat +#define ADI_LIBRARY_STRNCPY strncpy + +#if __STDC_VERSION__ >= 199901L /* C99 */ + #define ADI_LIBRARY_STRDUP adi_library_strdup /* ADI Implementation Required for C99 Make File Test */ +#else + #define ADI_LIBRARY_STRDUP strdup +#endif + +#define ADI_LIBRARY_STRSTR strstr + +/* time.h */ + +#define ADI_LIBRARY_TIME time +#define ADI_LIBRARY_LOCALTIME_R localtime_r +#define ADI_LIBRARY_MKTIME mktime +#define ADI_LIBRARY_CTIME ctime +#define ADI_LIBRARY_NANOSLEEP nanosleep +#define ADI_LIBRARY_CLOCK clock +#define ADI_LIBRARY_CLOCKS_PER_SEC CLOCKS_PER_SEC +#define ADI_LIBRARY_GMTIME gmtime + +/* ctype.h */ +#define ADI_LIBRARY_TOUPPER toupper +#define ADI_LIBRARY_TOLOWER tolower + + +/* When ADI_PLATFORM_LARGE_VARS_ON_HEAP is defined, the memory per function frame is limited to 2k, + * and the heap is used instead. + * + * This works by using the ADI_PLATFORM_LARGE_VAR_ALLOC(), and ADI_PLATFORM_LARGE_ARRAY_ALLOC() + * macros within the code for large variables/arrays. Memory allocated using these macros is + * automatically freed when the variable goes out of scope, and is zeroed out. When used for arrays + * it gives a pointer to an array and not an actual array so be careful using sizeof() with it, or + * taking its address! + */ +/*#define ADI_PLATFORM_LARGE_VARS_ON_HEAP*/ + +#ifdef ADI_PLATFORM_LARGE_VARS_ON_HEAP + +#ifndef __GNUC__ +#error "Compiler does not support ADI_PLATFORM_LARGE_VARS_ON_HEAP" +#endif + +static inline void adi_platform_free_ptr(void *ptrPtr) { + ADI_LIBRARY_FREE(*(void**)(ptrPtr)); +} + +#define ADI_PLATFORM_LARGE_ARRAY_ALLOC(type, name, count) \ + type *name __attribute__((__cleanup__(adi_platform_free_ptr))) = (type*)ADI_LIBRARY_CALLOC(count, sizeof(type)) + +#else /* ADI_PLATFORM_LARGE_VARS_ON_HEAP */ + +#define ADI_PLATFORM_LARGE_ARRAY_ALLOC(type, name, count) \ + type name##_[count]; \ + type *name = name##_; \ + ADI_LIBRARY_MEMSET(name, 0, sizeof(name##_)); + +#endif + +#define ADI_PLATFORM_LARGE_VAR_ALLOC(type, name) ADI_PLATFORM_LARGE_ARRAY_ALLOC(type, name, 1) + +#endif /* _ADI_LIBRARY_TYPES_H_ */ diff --git a/drivers/iio/adc/adrv903x/platforms/adi_platform.c b/drivers/iio/adc/adrv903x/platforms/adi_platform.c new file mode 100644 index 0000000000000..d4b0b34631148 --- /dev/null +++ b/drivers/iio/adc/adrv903x/platforms/adi_platform.c @@ -0,0 +1,215 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_platform.c +* +* \brief Definitions for ADI Specific Platforms +* +* ADRV903X API Version: 2.12.1.4 +*/ + +#include "adi_platform.h" + +#ifdef _ADI_ADS10_PLATFORM +#include "ads10/ads10_init.h" +#include "ads10/ads10_i2c.h" +#include "ads10/ads10_spi.h" +#include "ads10/ads10_timer.h" +#include "ads10/ads10_bbic_control.h" +#include "posix/posix_mutex.h" +#endif + +#include "../platforms/common/tls.h" +#include "../platforms/common/adi_logging.h" + +/* + * Function pointer assignment for default configuration + */ + +/* Initialization interface to open, init, close drivers and pointers to resources */ +adi_hal_Err_e (*adrv903x_HwOpen)(void* const devHalCfg) = NULL; + +adi_hal_Err_e (*adrv903x_HwClose)(void* const devHalCfg) = NULL; + +adi_hal_Err_e (*adrv903x_HwReset)(void* const devHalCfg, const uint8_t pinLevel) = NULL; + +void* (*adrv903x_DevHalCfgCreate)( const uint32_t interfaceMask, + const uint8_t spiChipSelect, + const char* const logFilename) = NULL; + +adi_hal_Err_e (*adrv903x_DevHalCfgFree)(void* devHalCfg) = NULL; + +/* SPI Interface */ +adi_hal_Err_e (*adrv903x_SpiWrite)( void* const devHalCfg, + const uint8_t txData[], + const uint32_t numTxBytes) = NULL; + +adi_hal_Err_e (*adrv903x_SpiRead)( void* const devHalCfg, + const uint8_t txData[], + uint8_t rxData[], + const uint32_t numRxBytes) = NULL; + +/* I2C Interface */ +adi_hal_Err_e(*adi_hal_I2cWrite)( void* const devHalCfg, + const uint8_t txData[], + const uint32_t numTxBytes) = NULL; + +adi_hal_Err_e(*adi_hal_I2cRead)( void* const devHalCfg, + const uint8_t txData[], + const uint32_t numTxBytes, + uint8_t rxData[], + const uint32_t numRxBytes) = NULL; + +/* Logging interface */ +adi_hal_Err_e (*adrv903x_LogFileOpen)( void* const devHalCfg, + const char* const filename) = NULL; + +adi_hal_Err_e (*adrv903x_LogLevelSet)( void* const devHalCfg, + const uint32_t logLevelMask) = NULL; + +adi_hal_Err_e (*adrv903x_LogLevelGet)( void* const devHalCfg, + uint32_t* const logLevelMask) = NULL; + +adi_hal_Err_e (*adi_hal_LogStatusGet)( void* const devHalCfg, + adi_hal_LogStatusGet_t* const logStatus) = NULL; + +adi_hal_Err_e (*adi_hal_LogConsoleSet)( void* const devHalCfg, + const adi_hal_LogConsole_e logConsoleFlag) = NULL; + +adi_hal_Err_e (*adrv903x_LogWrite)( void* const devHalCfg, + const adi_hal_LogLevel_e logLevel, + const uint8_t indent, + const char* const comment, + va_list argp) = NULL; + +adi_hal_Err_e (*adrv903x_LogFileClose)(void* const devHalCfg) = NULL; + +/* Timer interface */ +adi_hal_Err_e (*adrv903x_Wait_ms)(void* const devHalCfg, const uint32_t time_ms) = NULL; +adi_hal_Err_e (*adrv903x_Wait_us)(void* const devHalCfg, const uint32_t time_us) = NULL; + +/* BBIC control interface */ +adi_hal_Err_e (*adi_hal_BbicRegisterRead)( void* const devHalCfg, + const uint32_t addr, + uint32_t* const data) = NULL; + +adi_hal_Err_e (*adi_hal_BbicRegisterWrite)( void* const devHalCfg, + const uint32_t addr, + const uint32_t data) = NULL; + +adi_hal_Err_e (*adi_hal_BbicRegistersRead)( void* const devHalCfg, + const uint32_t addr, + uint32_t data[], + const uint32_t numDataWords) = NULL; + +adi_hal_Err_e (*adi_hal_BbicRegistersWrite)(void* const devHalCfg, + const uint32_t addr, + const uint32_t data[], + const uint32_t numDataWords) = NULL; + +/* Thread Interface */ +adi_hal_thread_t (*adi_hal_ThreadSelf)(void) = NULL; + +adi_hal_Err_e (*adrv903x_TlsSet)(const adi_hal_TlsType_e tlsType, void* const value) = NULL; + +void* (*adrv903x_TlsGet)(const adi_hal_TlsType_e tlsType) = NULL; + +/* Mutex Interface */ +adi_hal_Err_e(*adrv903x_MutexInit)(adi_hal_mutex_t* const mutex) = NULL; +adi_hal_Err_e(*adrv903x_MutexLock)(adi_hal_mutex_t* const mutex) = NULL; +adi_hal_Err_e(*adrv903x_MutexUnlock)(adi_hal_mutex_t* const mutex) = NULL; +adi_hal_Err_e(*adrv903x_MutexDestroy)(adi_hal_mutex_t* const mutex) = NULL; + +adi_hal_Err_e(*adi_hal_BoardIdentify)(char** boardNames, int32_t* numBoards) = NULL; + +ADI_API adi_hal_Err_e adi_adrv903x_hal_PlatformSetup(const adi_hal_Platforms_e platform) +{ + adi_hal_Err_e error = ADI_HAL_ERR_PARAM; + + switch (platform) + { + case ADI_ADS10_PLATFORM: +#ifdef _ADI_ADS10_PLATFORM + adrv903x_HwOpen = ads10_HwOpen; + adrv903x_HwClose = ads10_HwClose; + adrv903x_HwReset = ads10_HwReset; + adrv903x_DevHalCfgCreate = ads10_DevHalCfgCreate; + adrv903x_DevHalCfgFree = ads10_DevHalCfgFree; + +#ifdef ADI_ADRV903X_SPI_DEV_DRIVER_EN + adrv903x_SpiWrite = ads10_SpiWrite; + adrv903x_SpiRead = ads10_SpiRead; +#else + adrv903x_SpiWrite = ads10_SpiWrite_v2; + adrv903x_SpiRead = ads10_SpiRead_v2; +#endif + adi_hal_I2cWrite = NULL; /* ADS10 does not require I2C interface to any devices used in device API layer */ + adi_hal_I2cRead = NULL; /* ADS10 does not require I2C interface to any devices used in device API layer */ + + adrv903x_LogFileOpen = adi_LogFileOpen; + adrv903x_LogLevelSet = adi_LogLevelSet; + adrv903x_LogLevelGet = adi_LogLevelGet; + adi_hal_LogStatusGet = adi_LogStatusGet; + adi_hal_LogConsoleSet = adi_LogConsoleSet; + adrv903x_LogWrite = adi_LogWrite; + adrv903x_LogFileClose = adi_LogFileClose; + + adrv903x_Wait_us = ads10_TimerWait_us; + adrv903x_Wait_ms = ads10_TimerWait_ms; + + /* only required to support the ADI FPGA*/ + adi_hal_BbicRegisterRead = ads10_BbicRegisterRead; + adi_hal_BbicRegisterWrite = ads10_BbicRegisterWrite; + adi_hal_BbicRegistersRead = ads10_BbicRegistersRead; + adi_hal_BbicRegistersWrite = ads10_BbicRegistersWrite; + + adi_hal_ThreadSelf = posix_ThreadSelf; + adrv903x_TlsGet = common_TlsGet; + adrv903x_TlsSet = common_TlsSet; + adrv903x_MutexInit = posix_MutexInit; + adrv903x_MutexLock = posix_MutexLock; + adrv903x_MutexUnlock = posix_MutexUnlock; + adrv903x_MutexDestroy = posix_MutexDestroy; + adi_hal_BoardIdentify = ads10_BoardIdentify; + error = common_TlsInit(); +#else + error = ADI_HAL_ERR_NOT_IMPLEMENTED; +#endif + break; + case ADI_LINUX: + adrv903x_HwOpen = linux_adrv903x_HwOpen; + adrv903x_HwClose = linux_adrv903x_HwClose; + adrv903x_HwReset = linux_adrv903x_HwReset; + + adrv903x_SpiWrite = linux_adrv903x_SpiWrite; + adrv903x_SpiRead = linux_adrv903x_SpiRead; + + adrv903x_LogFileOpen = linux_adrv903x_LogFileOpen; + adrv903x_LogLevelSet = linux_adrv903x_LogLevelSet; + adrv903x_LogLevelGet = linux_adrv903x_LogLevelGet; + adrv903x_LogWrite = linux_adrv903x_LogWrite; + adrv903x_LogFileClose = linux_adrv903x_LogFileClose; + + adrv903x_Wait_us = linux_adrv903x_TimerWait_us; + adrv903x_Wait_ms = linux_adrv903x_TimerWait_ms; + + adrv903x_TlsGet = linux_adrv903x_TlsGet; + adrv903x_TlsSet = linux_adrv903x_TlsSet; + + adrv903x_MutexInit = linux_adrv903x_MutexInit; + adrv903x_MutexLock = linux_adrv903x_MutexLock; + adrv903x_MutexUnlock = linux_adrv903x_MutexUnlock; + adrv903x_MutexDestroy = linux_adrv903x_MutexDestroy; + + error = ADI_HAL_ERR_OK; + break; + default: + error = ADI_HAL_ERR_PARAM; + break; + } + + return error; +} diff --git a/drivers/iio/adc/adrv903x/platforms/adi_platform.h b/drivers/iio/adc/adrv903x/platforms/adi_platform.h new file mode 100644 index 0000000000000..de252a6c7cfe4 --- /dev/null +++ b/drivers/iio/adc/adrv903x/platforms/adi_platform.h @@ -0,0 +1,534 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/** +* \file adi_platform.h +* +* \brief Declarations for Generic ADI Platform +* +* ADRV903X API Version: 2.12.1.4 +* +* \note Implementation required to guarantee ADI Device functionality +* +* WARNING: Declarations in this file MUST NOT be modified +* +* Set of Global Function Pointers Requiring Definition & Initialization for use with ADI Devices +* +* HAL Configurations are Opaque to ADI Devices (i.e. using void* for devHalCfg) +* adi_hal_Interfaces_e - Bit Mask Abstraction for defining interfaces for a HAL Configuration +* +* One HAL Configuration Required per Device (i.e. ADI Device Structure includes HAL Device Pointer) +* +* Basic Sequence: +* +* 1) adrv903x_DevHalCfgCreate() -> Interfaces Defined are Hardware/Feature Specific +* 2) adrv903x_HwOpen() -> Enable all Selected HAL Interfaces & Features +* 3) Use Device -> Hardware Ready for Use +* 4) adrv903x_HwClose() -> Release all Resources, i.e. Clean-up Task +* 5) adrv903x_DevHalCfgFree() -> Free Memory, i.e. Clean-up Task +* +* Logging Feature is per HAL Configuration (i.e. Each ADI Device has its own log file) +* +* HAL API's include multi-threaded applications support +* Single Threaded Applications must stub these API's (i.e. return success) +*/ + +#ifndef __ADI_PLATFORM_H__ +#define __ADI_PLATFORM_H__ + +#ifdef __GNUC__ /* __unix__ verify if our linux image declare this */ + #define OS_Windows 0 +#else /* windows */ + +#if _WIN64 == 0 /* _Win32 */ + #define OS_Windows 32 +#elif _WIN64 == 1 /* _Win64 */ + #define OS_Windows 64 +#endif +#endif + +#ifndef ADI_API + #ifdef __cplusplus + #define ADI_API extern "C" + #else + #define ADI_API + #endif +#endif +#ifndef ADI_API_EX + #ifdef __cplusplus + #define ADI_API_EX ADI_API + #else + #define ADI_API_EX ADI_API extern + #endif +#endif + +/* ADI_HAL_MAX_THREADS defines the maximum number of threads that can simultaneously use the API. Effectively + * it is the maximum number of threads that can have an adi_common_ErrData_t registered (using adrv903x_TlsSet) + * at one time. */ +#ifndef ADI_HAL_MAX_THREADS +#define ADI_HAL_MAX_THREADS 1U +#endif + +#if ADI_HAL_MAX_THREADS <= 0 +#error "ADI_HAL_MAX_THREADS defined as <=0. It must be defined to be >= 1 or omitted in which case it defaults to 1." +#endif + +#include "adi_platform_types.h" +#include "adi_platform_impl.h" + +/** + * BBIC Init, Open, Close functions + */ + +/** + * \brief Returns a handle to a HAL configuration with the specified interfaces enabled and based + * on the supplied parameters. Several HAL configurations may be created independently. A HAL + * configuration must be obtained via this function and must be supplied as the \p devHalCfg + * parameter to all other HAL API functions. + * + * \post After creation the returned devHalCfg needs to be opened with adrv903x_HwOpen before being + * used. + * + * \post To prevent resource leakage all HAL configurations must eventually be freed using + * adrv903x_DevHalCfgFree. + * + * \retval void* - Pointer to Object Containing HAL Configuration + */ +ADI_API_EX void* (*adrv903x_DevHalCfgCreate)(const uint32_t interfaceMask, const uint8_t spiChipSelect, const char* const logFilename); + +/** + * \brief Prepares the HAL interfaces associated with the devHalCfg handle for use. + * + * This function must be called before any of the other HAL functions are called for the + * same \param devHalCfg. This function must be called only once for each value of \param devHalCfg. + * + * Applications do not need to call this function directly. Opening is done by assigning + * the devHalCfg to an ADI device and opening that device with a device-specific HwOpen + * call (e.g. adi_adrv903x_HwOpen). + * + * \pre The value of \param devHalCfg has been previously returned from a call to + * adrv903x_DevHalCfgCreate. + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + */ +ADI_API_EX adi_hal_Err_e (*adrv903x_HwOpen)(void* const devHalCfg); + +/** + * \brief Notifies the HAL that the configuration is no longer required and that any resources + * acquired for that configuration may be released. Must be called before adrv903x_DevHalCfgFree. + * + * Applications do not need to call this function directly. Closing is done by closing the ADI + * device to which the devHalCfg was assigned. i.e by calling a device-specific HwClose function + * (e.g. adi_adrv903x_HwClose). + * + * \pre The value of \param devHalCfg has been previously returned from a call to + * adrv903x_DevHalCfgCreate. + * + * \pre The value of \param devHalCfg has been opened with adrv903x_HwOpen. + * + * \post After this call the configuration must be freed using adrv903x_DevHalCfgFree. + * \post After this call no function except adrv903x_DevHalCfgFree may be called in relation to this + * devHalCfg. The devHalCfg may not be re-opened. + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + */ +ADI_API_EX adi_hal_Err_e (*adrv903x_HwClose)(void* const devHalCfg); + +/** + * \brief Performs a reset (which may be a physical power-on reset or power-cycle) of the device + * addressed by the HAL configuration's SPI interface. + * + * \pre The value of \param devHalCfg has been previously returned from a call to + * adrv903x_DevHalCfgCreate. + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + */ +ADI_API_EX adi_hal_Err_e (*adrv903x_HwReset)(void* const devHalCfg, const uint8_t pinLevel); + +/** + * \brief Indicate that the client is finished with a HAL configuration itself. The configuration + * can only be freed after first being closed with adrv903x_HwClose. After this function the + * supplied HAL configuration handle may no longer be used with any HAL API function. + * + * \pre The value of \param devHalCfg has been previously returned from a call to + * adrv903x_DevHalCfgCreate. + * + * \pre The \param devHalCfg has been closed with adrv903x_HwClose. + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + */ +ADI_API_EX adi_hal_Err_e (*adrv903x_DevHalCfgFree)(void* devHalCfg); + +/** + * \brief Function to write the the specified data to the device I2C port + * + * If numTxBytes is 0, no transaction is to take place and function is to + * return ADI_HAL_ERR_OK. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param txData Byte array of data to write to the I2C device. First byte +* should be the I2C register address followed by one or more data bytes. + * \param numTxBytes Number of bytes in the txData array + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + */ +ADI_API_EX adi_hal_Err_e(*adi_hal_I2cWrite)(void* const devHalCfg, const uint8_t txData[], const uint32_t numTxBytes); + +/** + * \brief Function to read data from the device via I2C port + * + * If numRxBytes is 0, no transaction is to take place and function is to + * return ADI_HAL_ERR_OK. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param txData Byte array of data to write to the I2C device. Depending on the +* I2C device, this might just be 1 byte containing the register +* address to read + * \param numTxBytes Number of bytes in the txData array + * \param rxData Byte array to return the read back data + * \param numRxBytes Number of bytes to read back, and size of rxData array + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + */ +ADI_API_EX adi_hal_Err_e(*adi_hal_I2cRead)(void* const devHalCfg, const uint8_t txData[], const uint32_t numTxBytes, + uint8_t rxData[], const uint32_t numRxBytes); + +/** + * \brief Function to write the the specified data to the device SPI port + * + * If numTxBytes is 0, no transaction is to take place and function is to + * return ADI_HAL_ERR_OK. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param txData Array of data to be written to the device + * \param numTxBytes Size of txData + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + */ +ADI_API_EX adi_hal_Err_e (*adrv903x_SpiWrite)(void* const devHalCfg, const uint8_t txData[], const uint32_t numTxBytes); + +/** + * \brief Function to read data from the device via SPI port + * + * Input arrays will be the same size to support full duplex SPI drivers. + * + * If numRxBytes is 0, no transaction is to take place and function is to + * return ADI_HAL_ERR_OK. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param txData Array of bytes to write to the device + * \param rxData Array of bytes read from the device + * \param numRxBytes Size of txData and rxData arrays. Arrays must be of + * the same size. + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + */ +ADI_API_EX adi_hal_Err_e (*adrv903x_SpiRead)(void* const devHalCfg, + const uint8_t txData[], + uint8_t rxData[], + const uint32_t numRxBytes); + +/** +* \brief Service to get Logging Status +* +* \param devHalCfg Pointer to device instance specific platform settings +* \param logStatus Pointer to Structure that will be populated with Log Status +* +* \note Error Count & Flags are reset after each Status Call +* +* \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful +*/ +ADI_API_EX adi_hal_Err_e (*adi_hal_LogStatusGet)(void* const devHalCfg, adi_hal_LogStatusGet_t* const logStatus); + +/** +* \brief Opens a logFile. If the file is already open it will be closed and reopened. +* +* This function opens the file for writing and saves the resulting file +* descriptor to the devHalCfg structure. +* +* \param devHalCfg Pointer to device instance specific platform settings +* \param filename The user provided name of the file to open. +* +* \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful +* +*/ +ADI_API_EX adi_hal_Err_e (*adrv903x_LogFileOpen)(void* const devHalCfg, const char* const filename); + +/** +* \brief Service to Close a Log File +* +* \param devHalCfg Pointer to device instance specific platform settings +* +* \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful +* +*/ +ADI_API_EX adi_hal_Err_e (*adrv903x_LogFileClose)(void* const devHalCfg); + +/** +* \brief Sets the log level, allowing the end user to select the granularity of +* what events get logged. +* +* \param devHalCfg Pointer to device instance specific platform settings +* \param logMask Bitwise Mask of adi_hal_LogLevel_e values to capture messages of a specific type +* +* \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful +* +*/ +ADI_API_EX adi_hal_Err_e (*adrv903x_LogLevelSet)(void* const devHalCfg, const uint32_t logMask); + +/** + * \brief Gets the currently set log level: the mask of different types of log + * events that are currently enabled to be logged. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param logMask Bitwise Mask of adi_hal_LogLevel_e values to capture messages of a specific type + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + * + */ +ADI_API_EX adi_hal_Err_e (*adrv903x_LogLevelGet)(void* const devHalCfg, uint32_t* const logMask); + +/** + * \brief Service to Set to Logging to Console Flag + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param logConsoleFlag Log to Console Flag Setting + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + * + */ +ADI_API_EX adi_hal_Err_e (*adi_hal_LogConsoleSet)(void* const devHalCfg, const adi_hal_LogConsole_e logConsoleFlag); + + +/** +* \brief Writes a message to the currently open logFile specified in the +* adi_hal_LogCfg_t of the devHalCfg structure passed +* +* Uses the vfprintf functionality to allow the user to supply the format and +* the number of arguments that will be logged. +* +* \param devHalCfg Pointer to device instance specific platform settings +* \param logLevel Specified Logging Level +* \param comment the string to include in the line added to the log. +* \param argp variable argument list to be printed +* +* \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful +* +*/ +ADI_API_EX adi_hal_Err_e (*adrv903x_LogWrite)( void* const devHalCfg, + const adi_hal_LogLevel_e logLevel, + const uint8_t indent, + const char* const comment, + va_list argp); + +/** +* \brief Provides a blocking delay of the current thread +* +* \param devHalCfg Pointer to device instance specific platform settings +* \param time_us the time to delay in micro seconds +* +* \retval ADI_HAL_ERR_OK Function completed successfully +*/ +ADI_API_EX adi_hal_Err_e (*adrv903x_Wait_us)(void* const devHalCfg, const uint32_t time_us); + +/** +* \brief Provides a blocking delay of the current thread +* +* \param devHalCfg Pointer to device instance specific platform settings +* \param time_ms the Time to delay in milli seconds +* +* \retval ADI_HAL_ERR_OK Function completed successfully +* +*/ +ADI_API_EX adi_hal_Err_e (*adrv903x_Wait_ms)(void* const devHalCfg, const uint32_t time_ms); + +/** + * \brief Function to read a single BBIC control register + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param addr 32bit address of BBIC register to read + * \param data 32bit Pointer to store return value representing the data of the register at the specified address + * + * \retval ADI_HAL_ERR_OK Function completed successfully + */ +ADI_API_EX adi_hal_Err_e (*adi_hal_BbicRegisterRead)(void* const devHalCfg, const uint32_t addr, uint32_t* const data); + +/** + * \brief Function to write a single BBIC control register + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param addr 32bit address of BBIC register to write + * \param data 32bit data to write to the register at the specified address + * + * \retval ADI_HAL_ERR_OK Function completed successfully + */ +ADI_API_EX adi_hal_Err_e (*adi_hal_BbicRegisterWrite)(void* const devHalCfg, const uint32_t addr, const uint32_t data); + +/** + * \brief Function to read multiple consecutive BBIC control registers starting at a specified register address. + * + * If numDataWords is 0, no transaction is to take place and function is to + * return ADI_HAL_ERR_OK. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param addr 32bit address of BBIC register to start reading from + * \param data 32bit Pointer to store return array representing the data starting at the specified register address + and ending at (addr + numDataWords -1) + * \param numDataWords Number of elements in the data array + * + * \retval ADI_HAL_ERR_OK Function completed successfully + */ +ADI_API_EX adi_hal_Err_e (*adi_hal_BbicRegistersRead)( void* const devHalCfg, + const uint32_t addr, + uint32_t data[], + const uint32_t numDataWords); + +/** + * \brief Function to write multiple consecutive BBIC control registers starting at a specified register address. + * + * If numDataWords is 0, no transaction is to take place and function is to + * return ADI_HAL_ERR_OK. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param addr 32bit address of BBIC register to start writing to + * \param data 32bit Pointer to array representing the data to write starting at the specified register address + * and ending at (addr + numDataWords -1) + * \param numDataWords Number of elements in the data array + * + * \retval ADI_HAL_ERR_OK Function completed successfully + */ +ADI_API_EX adi_hal_Err_e (*adi_hal_BbicRegistersWrite)( void* const devHalCfg, + const uint32_t addr, + const uint32_t data[], + const uint32_t numDataWords); + +#ifndef __KERNEL__ +/** + * \brief Returns the ID of the calling thread. + * + * Non-multithreaded HALs must implement this function but may return the same value regardless + * of the calling thread. + */ +ADI_API_EX adi_hal_thread_t (*adi_hal_ThreadSelf)(void); +#endif + +/** + * \brief Before being used a mutex must be initialized with this function. The mutex is + * initialized into the unlocked state. + * + * The HAL mutex API intends to be a subset of the Linux implementation of the POSIX API. + * Some differences: + * - There is no HAL_MUTEX_INITIALIZER - adi_hal_mutex_init must be used. + * - There is no adi_hal_mutexattr_settype - all mutex's are recursive. + * - adi_hal_mutex_lock blocks indefinitely - there is no adi_hal_trylock nor + * pthread_mutex_timedlock. + * - Any failure of any functions of the API is indicated by returning a non-zero value. + * - There is no requirement to allow mutex's to be re-initialized after being destroyed. + * - TODO BOM - refine error handling. + * - TODO BOM - refine blocking semantics. Do we need to specify 'blocks indefinitely' we could + * allow a HAL specific timeout returning something like EAGAIN but need a way to + * route this platform specific code back to the API client. + * + * If the HAL provided to the API does not support multi-threading the HAL must still + * define hal_mutex_t and supply implementations of adi_hal_MutexXxx functions returning + * ADI_HAL_ERR_OK. + */ +ADI_API_EX adi_hal_Err_e (*adrv903x_MutexInit)(adi_hal_mutex_t* const mutex); + +/** + * \brief Acquire the mutex. + * + * Will block indefinitely to acquire the mutex. All mutex's are recursive so the same thread can + * lock the same mutex multiple times but must take care to unlock it the same number of times + * before another thread can acquire it. + * + * Non-multithreaded HALs must implement this function but it can just simply return 0 + */ +ADI_API_EX adi_hal_Err_e (*adrv903x_MutexLock)(adi_hal_mutex_t* const mutex); + +/** + * \brief Unlocks the mutex. + */ +ADI_API_EX adi_hal_Err_e (*adrv903x_MutexUnlock)(adi_hal_mutex_t* const mutex); + +/** + * \brief Signal to the HAL that the mutex is no longer required and any associated resources can + * be released. The mutex must itself must already be released (i.e. has been unlocked as many + * times as it has been locked). After being destroyed a mutex must not be used or initialized + * again. + * + * Non-multithreaded HALs must implement this function but it can just simply return 0 + */ +ADI_API_EX adi_hal_Err_e (*adrv903x_MutexDestroy)(adi_hal_mutex_t* const mutex); + +/** + * \brief Store \param value on behalf of the calling thread and associate it with \param tlsType. + * To retrieve the value later the same thread calls adrv903x_TlsGet using the same value of + * \param tlsType. + * + * If adrv903x_TlsSet was previously called with a different value the new value overwrites the existing + * value stored. Until a thread calls adrv903x_TlsSet the value associated with that thread is NULL for + * all values of \param tlsType. + * + * The HAL thread-local storage API intends to be similar to the POSIX pthread_set/get specific API. + * But only allows a small number of key values which removes the need for a function similar to + * pthread_key_create() and replaces pthread_key_t with adi_hal_TlsType_e. + * + * Implementations must support tlsTypes of HAL_TLS_ERR and may support other values. + * + * A call supplying a \param value of NULL marks the TLS slot for the calling thread as empty and + * the slot may be assigned subsequently to another thread. A call supplying a \param value of NULL + * cannot fail. + * + * A HAL implementation may have a fixed, low limit on TLS slots. All client threads that call an + * ADI API function MUST after it's final API call and before termination call + * adi_hal_set_tls(HAL_TLS_END, NULL) to ensure its TLS slots are made available for subsequent + * threads using the API. + * + * Non-multithreaded HALs must implement this function and still keep an association between \param + * tlsType and \param value but can use the same association for each thread - i.e. simply ignore + * the identity of the calling thread so that a value set by one thread overwrites the value + * set by any previous thread. + */ +ADI_API_EX adi_hal_Err_e (*adrv903x_TlsSet)(const adi_hal_TlsType_e tlsType, void* const value); + +/** + * \brief Return the value associated with the calling thread for \param tlsType. + * + * Non-multithreaded HALs must implement this function and still keep an association between \param + * tlsType and \param value but can use the same association for each thread - i.e. simply ignore + * the identity of the calling thread so the value returned for all threads is the same. + * + * Further details of the HAL thread-local storage API are detailed by adrv903x_TlsSet. + */ +ADI_API_EX void* (*adrv903x_TlsGet)(const adi_hal_TlsType_e tlsType); + +/** + * \brief HAL Platform Setup + * + * This function assigns each function pointer declared in adi_platform.h to the correct + * implementation defined in the platform files associated with the adi_hal_Platforms_e + * platform input parameter. + * + * \param devHalInfo Pointer to be assumed as an ADI HAL Configuration + * \param platform ADI Platform Type to be Configured + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + */ +ADI_API_EX adi_hal_Err_e adi_adrv903x_hal_PlatformSetup(const adi_hal_Platforms_e platform); + + +/** + * \brief HAL Board Identify + * + * \param boardName Pointer to Board Name String + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + */ +ADI_API_EX adi_hal_Err_e(*adi_hal_BoardIdentify)(char** boardNames, int32_t* numBoards); + +#endif /* __ADI_PLATFORM_H__ */ + + diff --git a/drivers/iio/adc/adrv903x/platforms/adi_platform_impl.h b/drivers/iio/adc/adrv903x/platforms/adi_platform_impl.h new file mode 100644 index 0000000000000..40eef950fa95a --- /dev/null +++ b/drivers/iio/adc/adrv903x/platforms/adi_platform_impl.h @@ -0,0 +1,20 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/* + * HAL implementors/porters may modify this file to suit the underlying OS + * and hardware. For instance to map abstract HAL types to concrete + * platform/OS-dependent types. + */ + +#ifndef __ADI_PLATFORM_IMPL_H__ +#define __ADI_PLATFORM_IMPL_H__ + +#include "adi_platform_impl_types.h" + +/* Add custom platform functions here */ + +#endif + diff --git a/drivers/iio/adc/adrv903x/platforms/adi_platform_impl_types.h b/drivers/iio/adc/adrv903x/platforms/adi_platform_impl_types.h new file mode 100644 index 0000000000000..35edf04588a70 --- /dev/null +++ b/drivers/iio/adc/adrv903x/platforms/adi_platform_impl_types.h @@ -0,0 +1,76 @@ +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* SPDX-License-Identifier: Apache-2.0 +*/ + +/* + * HAL implementors/porters may modify this file to suit the underlying OS + * and hardware. For instance to map abstract HAL types to concrete + * platform/OS-dependent types. + */ + +#ifndef __ADI_PLATFORM_IMPL_TYPES_H__ +#define __ADI_PLATFORM_IMPL_TYPES_H__ + +#ifndef __KERNEL__ +#include +typedef pthread_mutex_t adi_hal_mutex_t; +typedef pthread_t adi_hal_thread_t; +#else +typedef struct mutex adi_hal_mutex_t; +#endif +/** + * \brief Default filepath for logfiles if none provided + * + * This should be used in platform implementation of adrv903x_LogFileOpen + * to define the default logfile path. + */ +#define ADI_PLATFORM_LOG_PATH_DEFAULT "adi_default_log.txt" + + +/** + * \brief Max number of characters for log file + * + * This should be used in platform implementation of adrv903x_LogFileOpen + * to define the max filepath length. + */ +#define ADI_HAL_STRING_LENGTH 256U + +/** + * \brief Max number of characters per log message + * + * This should be used in platform implementation of adrv903x_LogWrite + * to define the number of characters allowed per log message. + */ +#define ADI_HAL_MAX_LOG_LINE 1000U + +/** + * \brief Max number of lines in log file + * + * This should be used in platform implementation of adrv903x_LogWrite. + * This will ensure log files do not become excessively large during + * operation. + */ +#define ADI_HAL_LOG_MAX_NUM_LINES 2000000U + +/** + * \brief Size, in bytes, of the FIFO used in the SPI driver. + * + * This is critical to get correct based on hardware SPI driver + * if the DUT is placed in streaming mode, since the API SPI + * functions use this value to determine when a new address phase + * should be inserted into the SPI data stream. + */ +#define ADI_HAL_SPI_FIFO_SIZE 255U + + +/** + * \brief Default mode for log console output + * + * Can be used in platform implementation of adrv903x_DevHalCfgCreate to + * give a default value for log console mode when configuring logging. + */ +#define ADI_LOG_CONSOLE_DEFAULT_MODE ADI_LOG_CONSOLE_OFF + +#endif + diff --git a/drivers/iio/adc/adrv903x/platforms/adi_platform_types.h b/drivers/iio/adc/adrv903x/platforms/adi_platform_types.h new file mode 100644 index 0000000000000..71c29c4c49d3e --- /dev/null +++ b/drivers/iio/adc/adrv903x/platforms/adi_platform_types.h @@ -0,0 +1,311 @@ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ADI_PLATFORM_TYPES_H__ +#define __ADI_PLATFORM_TYPES_H__ + +#include "adi_library_types.h" +#include "adi_platform_impl_types.h" + +#define PLATFORM_ENV_VARIABLE "ADI_PLATFORM_NAME" + +#define MEM_SIZE_4KB (uint32_t) 0x00001000U +#define MEM_SIZE_16PLUSMB (uint32_t) 0x010B0000U +#define MEM_SIZE_16MB (uint32_t) 0x01000000U +#define MEM_SIZE_256MB (uint32_t) 0x10000000U +#define MEM_SIZE_512MB (uint32_t) 0x20000000U +#define MEM_SIZE_1GB (uint32_t) 0x40000000U + +#define SYM2STR(x) #x + +#define LOG_ERR_COUNT_LIMIT (uint8_t) 0xFFU + +#define ADI_DEVICE_HAL_OPEN 1U +#define ADI_DEVICE_HAL_CLOSED 0U + +/** + * \brief HAL Error Codes + * + * Hal Error Codes is flexible to Extended onto Operating System Codes + * + * Linux System Errors Ranger 1 - 124 + * + * Offset HAL Errors to 256 + * + * Current ADI Platform will not extend error codes, instead store the OS Error Code into the Device HAL Structure + */ +typedef enum adi_hal_Err +{ + ADI_HAL_ERR_OK = 0x00L, /*!< No Error */ + ADI_HAL_ERR_NULL_PTR = 0xFFL, /*!< Null Pointer */ + ADI_HAL_ERR_PARAM, /*!< Invalid Parameter Error */ + ADI_HAL_ERR_I2C, /*!< I2C Error */ + ADI_HAL_ERR_I2C_WRITE, /*!< I2C Write Error */ + ADI_HAL_ERR_I2C_READ, /*!< I2C Read Error */ + ADI_HAL_ERR_SPI, /*!< SPI Error */ + ADI_HAL_ERR_SPI_WRITE, /*!< SPI Write Error */ + ADI_HAL_ERR_SPI_READ, /*!< SPI Read Error */ + ADI_HAL_ERR_SPI_CS, /*!< SPI Chip Select Error */ + ADI_HAL_ERR_GPIO, /*!< GPIO Error */ + ADI_HAL_ERR_TIMER, /*!< Timer Error */ + ADI_HAL_ERR_BBICCTRL, /*!< BBIC Control Error */ + ADI_HAL_ERR_BBICCTRL_CORE, /*!< BBIC Core Error */ + ADI_HAL_ERR_BBICCTRL_WORD_BOUNDARY, /*!< BBIC Address must be word aligned */ + ADI_HAL_ERR_BBICCTRL_RAM, /*!< BBIC RAM Error */ + ADI_HAL_ERR_BBICCTRL_SPI, /*!< BBIC SPI Error */ + ADI_HAL_ERR_MEMORY, /*!< Memory Error (e.g. Allocation) */ + ADI_HAL_ERR_LOG, /*!< Logging Error */ + ADI_HAL_ERR_LIBRARY, /*!< Library Module Error Code */ + ADI_HAL_ERR_EEPROM_DATA, /*!< EEPROM Data Error Code (e.g. Failed CRC, Invalid Structure Parameter(s) */ + ADI_HAL_ERR_NOT_IMPLEMENTED /*!< HAL Feature Not Implemented */ +} adi_hal_Err_e; + +/** + * \brief Logging Error Codes + */ +typedef enum adi_hal_LogErr +{ + ADI_LOG_ERR_OK = 0x00UL, /*!< No Error */ + ADI_LOG_ERR_OPENING_FILE = 0x01UL, /*!< Opening Log File Error Flag */ + ADI_LOG_ERR_CLOSING_FILE = 0x02UL, /*!< Closing Log File Error Flag */ + ADI_LOG_ERR_FFLUSH = 0x04UL, /*!< Stream Buffer Flushing Error */ + ADI_LOG_ERR_LEVEL = 0x08UL, /*!< Log Level Error Flag */ + ADI_LOG_ERR_WRITE = 0x10UL, /*!< Writing to File Error Flag */ + ADI_LOG_ERR_REWIND = 0x20UL /*!< File Position Reset */ +} adi_hal_LogErr_e; + +/** + * \brief Log Level Message Categories + */ +typedef enum adi_hal_LogLevel +{ + ADI_HAL_LOG_NONE = 0x0UL, /*!< No Logging Flag */ + ADI_HAL_LOG_MSG = 0x1UL, /*!< Message Logging Flag */ + ADI_HAL_LOG_WARN = 0x2UL, /*!< Warning Message Logging Flag */ + ADI_HAL_LOG_ERR = 0x4UL, /*!< Error Message Logging Flag */ + ADI_HAL_LOG_API = 0x8UL, /*!< API Entry Logging Flag */ + ADI_HAL_LOG_API_PRIV = 0x10UL, /*!< Private API Entry Flag */ + ADI_HAL_LOG_BF = 0x20UL, /*!< Bitfield API Entry Flag */ + ADI_HAL_LOG_HAL = 0x40UL, /*!< HAL API Entry Flag */ + ADI_HAL_LOG_SPI = 0x80UL, /*!< SPI Transaction Flag */ + ADI_HAL_LOG_ALL = 0xFFUL /*!< All Logging Enabled */ +} adi_hal_LogLevel_e; + +/** + * \brief Enum type for Console Logging + */ +typedef enum adi_hal_LogConsole +{ + ADI_LOG_CONSOLE_OFF = 0UL, /*!< Logging to Console Disabled */ + ADI_LOG_CONSOLE_ON /*!< Logging to Console Enabled */ +} adi_hal_LogConsole_e; + +/** + * \brief Enum type for HAL platforms + */ +typedef enum adi_hal_Platforms +{ + ADI_ADS10_PLATFORM = 0U, /*!< ADS10 Platform */ + ADI_LINUX, /*!< Linux Platform */ + ADI_UNKNOWN_PLATFORM +} adi_hal_Platforms_e; + +/** +* \brief Enum type for HAL Board (daughter card) Identity +*/ +typedef enum adi_hal_Boards +{ + ADI_BOARD_UNKNOWN = 0U, /*!< Unknown Board Type */ + ADI_BOARD_BLANK_EEPROM /*!< Selects for no daughter board present */ +} adi_hal_Boards_e; + +/** + * \brief Enum type for the hardware interfaces supported by the platform. + * Each device specifies which interfaces it needs from the BBIC in its + * devHalCfg structure. + */ +typedef enum adi_hal_Interfaces +{ + ADI_HAL_INTERFACE_SPI = 0x01U, /* Device requires SPI interface from BBIC */ + ADI_HAL_INTERFACE_LOG = 0x02U, /* Device requires Logging interface from BBIC */ + ADI_HAL_INTERFACE_BBICCTRL = 0x04U, /* Device requires BBIC Register/Control interface from BBIC. Mutually exclusive with HWRESET */ + ADI_HAL_INTERFACE_HWRESET = 0x08U, /* Device requires GPIO (reset pins) interface from BBIC. Mutually exclusive with BBICCTRL */ + ADI_HAL_INTERFACE_TIMER = 0x10U, /* Device requires Timer interface from BBIC */ + ADI_HAL_INTERFACE_I2C = 0x20U, /* Device requires I2C interface from BBIC */ + ADI_HAL_INTERFACE_EEPROM = 0x40U /* Device requires EEPROM interface from BBIC */ +} adi_hal_Interfaces_e; + +/** + * \brief BBIC interfaces + */ +typedef enum adi_hal_BbicInterfaces +{ + ADI_HAL_BBIC_CORE = 0x01U, /* Core FPGA registers, including HwReset pins */ + ADI_HAL_BBIC_RAM = 0x02U, /* Ram registers */ + ADI_HAL_BBIC_SPI = 0x04U /* Advanced SPI configuration registers */ +} adi_hal_BbicInterfaces_e; + +/** + * \brief The set of key values HAL supports for associating a value with a thread. + */ +typedef enum +{ + HAL_TLS_ERR = 0U, /*!< Key for associating an adi_common_ErrData_t with a thread. */ + HAL_TLS_USR, /*!< Key for associating an arbitrary void* with a thread. */ + HAL_TLS_END /*!< Marks end of valid values; And a special case in adrv903x_TlsSet */ +} adi_hal_TlsType_e; + +/** + * \brief Data Structure for Logging Facility + */ +typedef struct adi_hal_LogCfg +{ + uint8_t interfaceEnabled; /*!< Interface Enabled Flag */ + uint32_t logMask; /*!< Logging BitMask */ +#ifndef __KERNEL__ + FILE* logfd; /*!< File Pointer for Log File */ +#endif + char logFileName[ADI_HAL_STRING_LENGTH]; /*!< Log File Name */ + uint32_t currentLineNumber; /*!< Current Line Number */ + adi_hal_LogConsole_e logConsole; /*!< Logging to Console Flag */ + uint8_t errCount; /*!< Logging Feature Error Count */ + uint32_t errFlags; /*!< Bit Mask for Logging Feature Error Types */ +} adi_hal_LogCfg_t; + +/** + * \brief Data Structure for Logging Status + */ +typedef struct adi_hal_LogStatusGet +{ + uint8_t interfaceEnabled; /*!< Interface Enabled Flag */ + uint8_t fileOpen; /*!< Logging BitMask */ + const char* logFileName; /*!< File Pointer for Log File */ + uint32_t logMask; /*!< Log File Name */ + adi_hal_LogConsole_e logConsole; /*!< Logging to Console Flag */ + uint8_t errCount; /*!< Logging Feature Error Count */ + uint32_t errFlags; /*!< Bit Mask of adi_hal_LogErr_e Flags for Logging Feature Error Types */ + uint32_t currentLineNumber; /*!< Current Line Number */ +} adi_hal_LogStatusGet_t; + +/** + * \brief Data structure for SPI configuration + */ +typedef struct adi_hal_SpiCfg +{ + uint8_t interfaceEnabled; + int fd; + char spidevName[ADI_HAL_STRING_LENGTH]; + uint8_t chipSelectIndex; /*!< valid 1~8 */ + uint8_t CPHA; /*!< clock phase, sets which clock edge the data updates (valid 0 or 1) */ + uint8_t CPOL; /*!< clock polarity 0 = clock starts low, 1 = clock starts high */ + uint8_t enSpiStreaming; /*!< Not implemented. SW feature to improve SPI throughput. */ + uint8_t autoIncAddrUp; /*!< Not implemented. For SPI Streaming, set address increment direction. 1= next addr = addr+1, 0:addr = addr-1 */ + uint8_t fourWireMode; /*!< 1: Use 4-wire SPI, 0: 3-wire SPI (SDIO pin is bidirectional). NOTE: ADI's FPGA platform always uses 4-wire mode. */ + uint32_t spiClkFreq_Hz; /*!< SPI Clk frequency in Hz (default 25000000), platform will use next lowest frequency that it's baud rate generator can create */ +} adi_hal_SpiCfg_t; + +/** + * \brief Data structure for Hardware reset pin functionality + */ + typedef struct adi_hal_HwResetCfg +{ + uint8_t interfaceEnabled; /*!< */ + uint32_t resetPinIndex; /*!< */ +} adi_hal_HwResetCfg_t; + +/** + * \brief Data structure for I2C configuration + */ +typedef struct adi_hal_I2cCfg +{ + uint8_t interfaceEnabled; + int fd; + char drvName[ADI_HAL_STRING_LENGTH]; +} adi_hal_I2cCfg_t; + +#ifndef __KERNEL__ +/** + * \brief Data structure for EEPROM configuration + */ +typedef struct adi_hal_EepromCfg +{ + uint8_t interfaceEnabled; + FILE* fd; + char drvName[ADI_HAL_STRING_LENGTH]; +} adi_hal_EepromCfg_t; +#endif + +/** + * \brief Data structure for memory Fpga Driver configuration + */ +typedef struct adi_hal_fpga_AxiCfg +{ + char drvName[ADI_HAL_STRING_LENGTH]; + uint32_t mapSize; + uintptr_t mappedMemoryPtr; + int fd; +} adi_hal_fpga_AxiCfg_t; + +/** + * \brief Data structure to hold platform Hardware layer + * settings for all system related feature of the ADI transceiver device + * If the system has multiple ADI transceivers, the user should create one of + * theses structures per transceiver device to specify the HAL settings + * per transceiver device. + */ +typedef struct adi_hal_BbicCfg +{ + uint8_t interfaceEnabled; /*!< Bitmask for the BBIC interfaces. Follows adi_hal_BbicInterfaces_e */ + adi_hal_fpga_AxiCfg_t coreRegsCfg; + adi_hal_fpga_AxiCfg_t ramCfg; + adi_hal_fpga_AxiCfg_t spiAdvRegsCfg; + adi_hal_fpga_AxiCfg_t spi2AdvRegsCfg; +} adi_hal_BbicCfg_t; + +typedef struct adi_hal_TimerCfg +{ + uint8_t interfaceEnabled; /*!< 1: Enable timer interface // 0: Disable timer interface */ +} adi_hal_TimerCfg_t; + +/** + * \brief Data structure to hold platform Hardware layer + * settings for all system/platform related features. + + * If the system has multiple ADI transceivers/devices, the user should create one of + * theses structures per device to specify the HAL settings + * per transceiver device. + */ +typedef struct adi_hal_Cfg +{ + uint32_t interfacemask; /*!< Interface Mask Requested */ + uint8_t openFlag; /*!< Device Open Status Flag */ + char typeName[ADI_HAL_STRING_LENGTH]; /*!< Type Name */ + adi_hal_SpiCfg_t spiCfg; /*!< SPI Configuration */ + adi_hal_LogCfg_t logCfg; /*!< LOG Configuration */ + adi_hal_BbicCfg_t bbicCfg; /*!< BBIC Configuration */ + adi_hal_HwResetCfg_t hwResetCfg; /*!< HW Reset Configuration */ + adi_hal_I2cCfg_t i2cCfg; /*!< I2C Configuration */ + adi_hal_TimerCfg_t timerCfg; /*!< Timer Configuration */ +#ifndef __KERNEL__ + adi_hal_EepromCfg_t eepromCfg; /*!< Eeprom Configuration */ +#endif + int32_t error; /*!< Operating System Error Code */ +} adi_hal_Cfg_t; + +/** + * \brief HAL Board Information Structure + */ +typedef struct adi_hal_BoardInfo +{ + uint8_t manufacturer[ADI_HAL_STRING_LENGTH]; /* Manufacturer */ + uint8_t productName[ADI_HAL_STRING_LENGTH]; /* Product Name */ + uint8_t serialNumber[ADI_HAL_STRING_LENGTH]; /* Serial Number */ + uint8_t partNumber[ADI_HAL_STRING_LENGTH]; /* Part Number */ + uint8_t pcbId[ADI_HAL_STRING_LENGTH]; /* PCB ID */ + uint8_t pcbName[ADI_HAL_STRING_LENGTH]; /* PCB Name */ + uint8_t bomRev[ADI_HAL_STRING_LENGTH]; /* BOM Revision */ +} adi_hal_BoardInfo_t; + +#endif /* __ADI_PLATFORM_TYPES_H__*/ diff --git a/drivers/iio/adc/adrv903x/platforms/linux_platform.c b/drivers/iio/adc/adrv903x/platforms/linux_platform.c new file mode 100644 index 0000000000000..2483058bb67d2 --- /dev/null +++ b/drivers/iio/adc/adrv903x/platforms/linux_platform.c @@ -0,0 +1,995 @@ +// SPDX-License-Identifier: GPL-2.0 +/** +* Copyright 2015 - 2025 Analog Devices Inc. +* Released under the ADRV903X API license, for more information. +* see the "LICENSE.txt" file in this zip file. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "adi_platform.h" +#include "adi_platform_impl_types.h" + +#include "adi_common_error.h" + +#define ADI_HAL_OK ADI_HAL_ERR_OK +#define ADI_HAL_NULL_PTR ADI_HAL_ERR_NULL_PTR + +typedef struct +{ + void* value; +} thread_to_value_t; + +/* ADI Error Reporting Dependency on HAL_TLS_ERR being set to NULL if not configured */ +static thread_to_value_t store = { NULL }; + +/** + * \brief Opens a logFile. If the file is already open it will be closed and reopened. + * + * This function opens the file for writing and saves the resulting file + * descriptor to the devHalCfg structure. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param filename The user provided name of the file to open. + * + * \retval ADI_HAL_OK Function completed successfully, no action required + * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer + * \retval ADI_HAL_LOGGING_FAIL If the function failed to open or write to the specified filename + */ +adi_hal_Err_e linux_adrv903x_LogFileOpen(void *devHalCfg, const char *filename) +{ + return ADI_HAL_OK; +} + +/** + * \brief Flushes the logFile buffer to the currently open log file. + * + * \param devHalCfg Pointer to device instance specific platform settings + * + * \retval ADI_HAL_OK Function completed successfully, no action required + * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer + */ +adi_hal_Err_e linux_adrv903x_LogFileFlush(void *devHalCfg) +{ + return ADI_HAL_OK; +} + +/** + * \brief Gracefully closes the log file(s). + * + * \param devHalCfg Pointer to device instance specific platform settings + * + * \retval ADI_HAL_OK Function completed successfully, no action required + * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer + * \retval ADI_HAL_LOGGING_FAIL Error while flushing or closing the log file. + */ +adi_hal_Err_e linux_adrv903x_LogFileClose(void *devHalCfg) +{ + return ADI_HAL_OK; +} + +/** + * \brief Get logging status. Functions has no effect since logging is + * disabled on Linux. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param logStatus Logging status. + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +adi_hal_Err_e linux_LogStatusGet(void* devHalCfg, adi_hal_LogStatusGet_t* const logStatus) +{ + return ADI_HAL_OK; +} + +/** + * \brief Set console output. Functions has no effect since logging is + * disabled on Linux. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param logConsoleFlag Console logging enable flag. + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +adi_hal_Err_e linux_LogConsoleSet(void* devHalCfg, const adi_hal_LogConsole_e logConsoleFlag) +{ + return ADI_HAL_OK; +} + +/** + * \brief Sets the log level, allowing the end user to select the granularity of + * what events get logged. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param logLevel A mask of valid log levels to allow to be written to the log file. + * + * \retval ADI_ADRV903X_ERR_ACT_CHECK_PARAM Recovery action for bad parameter check + * \retval ADI_ADRV903X_ERR_ACT_NONE Function completed successfully, no action required + */ +adi_hal_Err_e linux_adrv903x_LogLevelSet(void *devHalCfg, const uint32_t logMask) +{ + adi_hal_Cfg_t *halCfg = NULL; + + if (devHalCfg == NULL) { + return ADI_COMMON_ERR_ACT_CHECK_PARAM; + } + + halCfg = (adi_hal_Cfg_t *)devHalCfg; + + halCfg->logCfg.logMask = (logMask & (int32_t)ADI_HAL_LOG_ALL); + + return ADI_COMMON_ERR_ACT_NONE; +} + +/** + * \brief Gets the currently set log level: the mask of different types of log + * events that are currently enabled to be logged. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param logLevel Returns the current log level mask. + * + * \retval ADI_HAL_OK Function completed successfully, no action required + * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer + */ +adi_hal_Err_e linux_adrv903x_LogLevelGet(void *devHalCfg, uint32_t* const logMask) +{ + int32_t halError = (int32_t)ADI_HAL_OK; + adi_hal_Cfg_t *halCfg = NULL; + + if (devHalCfg == NULL) { + halError = (int32_t)ADI_HAL_NULL_PTR; + return halError; + } + + halCfg = (adi_hal_Cfg_t *)devHalCfg; + + *logMask = halCfg->logCfg.logMask; + + return halError; +} + +/** + * \brief Writes a message to the currently open logFile specified in the + * adi_hal_LogCfg_t of the devHalCfg structure passed + * + * Uses the vfprintf functionality to allow the user to supply the format and + * the number of aguments that will be logged. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param logLevel the log level to be written into + * \param comment the string to include in the line added to the log. + * \param argp variable argument list to be printed + * + * \retval ADI_HAL_OK Function completed successfully, no action required + * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer + * \retval ADI_HAL_LOGGING_FAIL If the function failed to flush to write + */ + +adi_hal_Err_e linux_adrv903x_LogWrite(void *devHalCfg, const adrv903x_LogLevel_e logLevel, + const uint8_t indent, const char* const comment, + va_list argp) +{ + int32_t halError = (int32_t)ADI_HAL_OK; + int32_t result = 0; + adi_hal_Cfg_t *halCfg = NULL; + static char logMessage[ADI_HAL_MAX_LOG_LINE] = { 0 }; + + const char *logLevelChar = NULL; + logMessage[0] = 0; + + if (devHalCfg == NULL) { + halError = (int32_t)ADI_HAL_NULL_PTR; + return halError; + } + + halCfg = (adi_hal_Cfg_t *)devHalCfg; + + if (halCfg->logCfg.logMask == (int32_t)ADI_HAL_LOG_NONE) { + /* If logging disabled, exit gracefully */ + halError = (int32_t)ADI_HAL_OK; + return halError; + } + + if (logLevel > (int32_t)ADI_HAL_LOG_ALL) { + halError = (int32_t)ADI_HAL_ERR_LOG; + return halError; + } + + /* Print Log type */ + if ((halCfg->logCfg.logMask & ADI_HAL_LOG_MSG) && + (logLevel == (int32_t)ADI_HAL_LOG_MSG)) { + logLevelChar = "MESSAGE:"; + } else if ((halCfg->logCfg.logMask & ADI_HAL_LOG_WARN) && + (logLevel == (int32_t)ADI_HAL_LOG_WARN)) { + logLevelChar = "WARNING:"; + } else if ((halCfg->logCfg.logMask & ADI_HAL_LOG_ERR) && + (logLevel == (int32_t)ADI_HAL_LOG_ERR)) { + logLevelChar = "ERROR:"; + } else if ((halCfg->logCfg.logMask & ADI_HAL_LOG_API) && + (logLevel == (int32_t)ADI_HAL_LOG_API)) { + logLevelChar = "API_LOG:"; + } else if ((halCfg->logCfg.logMask & ADI_HAL_LOG_HAL) && + (logLevel == (int32_t)ADI_HAL_LOG_HAL)) { + logLevelChar = "ADI_HAL_LOG:"; + } else if ((halCfg->logCfg.logMask & ADI_HAL_LOG_SPI) && + (logLevel == (int32_t)ADI_HAL_LOG_SPI)) { + logLevelChar = "SPI_LOG:"; + } else if ((halCfg->logCfg.logMask & ADI_HAL_LOG_API_PRIV) && + (logLevel == (int32_t)ADI_HAL_LOG_API_PRIV)) { + logLevelChar = "API_PRIV_LOG:"; + } else { + /* Nothing to log - exit cleanly */ + return (int32_t)ADI_HAL_OK; + } + + result = snprintf(logMessage, ADI_HAL_MAX_LOG_LINE, "%s", logLevelChar); + if (result < 0) { + halError = (int32_t)ADI_HAL_ERR_LOG; + return halError; + } + + result = vsnprintf(logMessage + strlen(logMessage), + ADI_HAL_MAX_LOG_LINE, comment, argp); + if (result < 0) { + halError = (int32_t)ADI_HAL_ERR_LOG; + return halError; + } + + switch (logLevel) { + case ADI_HAL_LOG_NONE: + break; + case ADI_HAL_LOG_WARN: + dev_warn(&halCfg->spi->dev, "%s", logMessage); + break; + case ADI_HAL_LOG_ERR: + dev_err(&halCfg->spi->dev, "%s", logMessage); + break; + case ADI_HAL_LOG_SPI: + dev_vdbg(&halCfg->spi->dev, "%s", logMessage); + break; + case ADI_HAL_LOG_API: + case ADI_HAL_LOG_API_PRIV: + case ADI_HAL_LOG_BF: + case ADI_HAL_LOG_MSG: + case ADI_HAL_LOG_HAL: + dev_dbg(&halCfg->spi->dev, "%s", logMessage); + break; + case ADI_HAL_LOG_ALL: + printk(logMessage); + break; + } + + printk("MESSAGE: %s\n", logMessage); + + return halError; +} + +/** + * \brief Opens/allocates any necessary resources to communicate via SPI to a + * particular device specified in the devHalCfg structure. + * + * This function should perform any necessary steps to open the SPI master resource + * on the BBIC to enable SPI communications to a particular SPI device. + * + * \param devHalCfg Pointer to device instance specific platform settings + * + * \retval ADI_HAL_OK function completed successfully, no action required + * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer + * \retval ADI_HAL_SPI_FAIL the device driver was not opened successfully + */ +adi_hal_Err_e linux_adrv903x_SpiOpen(void *devHalCfg) +{ + return ADI_HAL_OK; +} + +/** + * \brief Closes any resources open/allocated for a specific SPI device + * + * Any information needed to close the particular SPI device should be passed in + * the devHalCfg structure. + * + * \param devHalCfg Pointer to device instance specific platform settings + * + * \retval ADI_HAL_OK function completed successfully, no action required + * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer + * \retval ADI_HAL_SPI_FAIL the device driver was not closed successfully + */ +adi_hal_Err_e linux_adrv903x_SpiClose(void *devHalCfg) +{ + return ADI_HAL_OK; +} + +/** + * \brief Initializes the SPI device driver mode, bits per word, and speed + * + * Any settings needed should be passed in the devHalCfg structure + * + * \param devHalCfg Pointer to device instance specific platform settings + * + * \retval ADI_HAL_OK function completed successfully, no action required + * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer + * \retval ADI_HAL_SPI_FAIL the SPI initialization failed + */ +int32_t linux_adrv903x_SpiInit(void *devHalCfg) +{ + return ADI_HAL_OK; +} + +/** + * \brief Write an array of 8-bit data to a SPI device + * + * The function will write numTxBytes number of bytes to the SPI device + * selected in the devHalCfg structure. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param txData Pointer to byte array txData buffer that has numTxBytes number of bytes + * \param numTxBytes The length of txData array + * + * \retval ADI_HAL_OK function completed successfully, no action required + * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer + * \retval ADI_HAL_SPI_FAIL the data was not written successfully + */ +adi_hal_Err_e linux_adrv903x_SpiWrite(void *devHalCfg, const uint8_t txData[], + uint32_t numTxBytes) +{ + static const uint32_t MAX_SIZE = 4096; + uint32_t toWrite = 0; + int32_t remaining = numTxBytes; + int32_t halError = (int32_t)ADI_HAL_OK; + adi_hal_Cfg_t *halCfg = NULL; + + if (devHalCfg == NULL) { + halError = (int32_t)ADI_HAL_NULL_PTR; + return halError; + } + + halCfg = (adi_hal_Cfg_t *)devHalCfg; + + if (halCfg->spiCfg.interfaceEnabled != 0) { + int32_t result = 0; + do { + toWrite = (remaining > MAX_SIZE) ? MAX_SIZE : remaining; + result = spi_write(halCfg->spi, + &txData[numTxBytes - remaining], + toWrite); + if (result < 0) { + return ADI_HAL_ERR_SPI_WRITE; + } + remaining -= toWrite; + } while (remaining > 0); + } + + return halError; +} + +/** + * \brief Read one or more bytes from the device specified by the devHalCfg structure + * + * The function will read numTxRxBytes number of bytes from the SPI device selected in + * the devHalCfg parameter and store the resulting data sent by the device in the rxData + * data buffer. + * + * For each byte in txData written to the device, a byte is read and returned by this + * function at the pointer provided by the rxData parameter. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param txData Pointer to byte array that has numTxRxBytes number of bytes + * \param rxData Pointer to byte array where read back data will be returned, that is at least numTxRxBytes in size. + * \param numTxBytes The length of txData and rxData arrays + * + * \retval ADI_HAL_OK function completed successfully, no action required + * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer + * \retval ADI_HAL_SPI_FAIL the data was not read successfully + */ +adi_hal_Err_e linux_adrv903x_SpiRead(void *devHalCfg, const uint8_t txData[], uint8_t rxData[], + uint32_t numTxRxBytes) +{ + static const uint32_t MAX_SIZE = 4096; + int32_t remaining = numTxRxBytes; + int32_t halError = (int32_t)ADI_HAL_OK; + int32_t result = 0; + adi_hal_Cfg_t *halCfg = NULL; + + if (devHalCfg == NULL) { + halError = (int32_t)ADI_HAL_NULL_PTR; + return halError; + } + + halCfg = (adi_hal_Cfg_t *)devHalCfg; + + if (halCfg->spiCfg.interfaceEnabled != 0) { + do { + struct spi_transfer t = { + .tx_buf = &txData[numTxRxBytes - remaining], + .rx_buf = &rxData[numTxRxBytes - remaining], + .len = (remaining > MAX_SIZE) ? MAX_SIZE : + remaining, + }; + + result = spi_sync_transfer(halCfg->spi, &t, 1); + if (result < 0) { + halError = ADI_HAL_ERR_SPI_READ; + } + + remaining -= t.len; + } while (remaining > 0); + } + + return halError; +} + +/** + * \brief Function to open/allocate any necessary resources for the timer wait + * functions below. + * + * \param devHalCfg Pointer to device instance specific platform settings + * + * \retval ADI_HAL_OK Function completed successfully + */ +int32_t linux_adrv903x_TimerOpen(void *devHalCfg) +{ + /* ADI ZC706 platform does not require any timer open /close */ + return (int32_t)ADI_HAL_OK; +} + +/** + * \brief Function to close any necessary resources for the timer wait + * functions below. + * + * \param devHalCfg Pointer to device instance specific platform settings + * + * \retval ADI_HAL_OK Function completed successfully + */ +int32_t linux_adrv903x_TimerClose(void *devHalCfg) +{ + /* ADI ZC706 platform does not require any timer open /close */ + return (int32_t)ADI_HAL_OK; +} + +/** + * \brief Function to initialize any necessary resources for the timer wait + * functions below. + * + * \param devHalCfg Pointer to device instance specific platform settings + * + * \retval ADI_HAL_OK Function completed successfully + */ +int32_t linux_adrv903x_TimerInit(void *devHalCfg) +{ + /* ADI ZC706 platform does not require any timer init */ + return (int32_t)ADI_HAL_OK; +} + +/** + * \brief Provides a blocking delay of the current thread + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param time_us the time to delay in mico seconds + * + * \retval ADI_HAL_OK Function completed successfully + * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer + */ +adi_hal_Err_e linux_adrv903x_TimerWait_us(void *devHalCfg, const uint32_t time_us) +{ + int32_t halError = (int32_t)ADI_HAL_OK; + + usleep_range(time_us, time_us + 10); + + return halError; +} + +/** + * \brief Provides a blocking delay of the current thread + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param time_ms the Time to delay in milli seconds + * + * \retval ADI_HAL_OK Function completed successfully + * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer + */ +adi_hal_Err_e linux_adrv903x_TimerWait_ms(void *devHalCfg, const uint32_t time_ms) +{ + int32_t halError = (int32_t)ADI_HAL_OK; + + msleep(time_ms); + + return halError; +} + +/** + * \brief Opens all neccessary files and device drivers for a specific device + * + * \param devHalCfg Pointer to device instance specific platform settings + * + * \retval ADI_HAL_OK Function completed successfully, no action required + * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer + * \retval errors returned by other function calls. + */ +adi_hal_Err_e linux_adrv903x_HwOpen(void *devHalCfg) +{ + return ADI_HAL_OK; +} +/** + * \brief Mutex init function. No action, single-threaded + * + * \param mutex Mutex instance + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +adi_hal_Err_e linux_mutex_init(adi_hal_mutex_t* mutex) +{ + (void)mutex; + return ADI_HAL_OK; +} +/** + * \brief Mutex destroy function. No action, single-threaded + * + * \param mutex Mutex instance + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +adi_hal_Err_e linux_mutex_destroy(adi_hal_mutex_t* mutex) +{ + (void)mutex; + return ADI_HAL_OK; +} +/** + * \brief Mutex lock function. No action, single-threaded + * + * \param mutex Mutex instance + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +adi_hal_Err_e linux_mutex_lock(adi_hal_mutex_t* mutex) +{ + (void)mutex; + return ADI_HAL_OK; +} +/** + * \brief Mutex unlock function. No action, single-threaded + * + * \param mutex Mutex instance + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +adi_hal_Err_e linux_mutex_unlock(adi_hal_mutex_t* mutex) +{ + (void)mutex; + return ADI_HAL_OK; +} +/** + * \brief Tls get. This function will return the same value, single-threaded + * + * \param tlsType Key value associated with a thread + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +void* linux_tls_get(const adi_hal_TlsType_e tlsType) +{ + if (tlsType == HAL_TLS_END) { + return NULL; + } + + return store.value; +} +/** + * \brief Tls set. This function will set the same value, single-threaded + * + * \param tlsType Key value associated with a thread + * \param value Value to associate to a thread + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +adi_hal_Err_e linux_tls_set(const adi_hal_TlsType_e tlsType, void* const value) +{ + if (tlsType == HAL_TLS_END) { + /* Special convenience case that a thread can remove all it TLS + * items in one call by passing (HAL_TLS_END, NULL); */ + if (value != NULL) { + return ADI_HAL_ERR_PARAM; + } + + /* Passing NULL cannot fail by definition - no need to check rtn values */ + (void) linux_tls_set(HAL_TLS_ERR, NULL); + (void) linux_tls_set(HAL_TLS_USR, NULL); + + return ADI_HAL_ERR_OK; + } + + store.value = value; + return ADI_HAL_ERR_OK; +} + +/** + * \brief Gracefully shuts down the the hardware closing any open resources + * such as log files, I2C, SPI, GPIO drivers, timer resources, etc. + * + * \param devHalCfg Pointer to device instance specific platform settings + * + * \retval ADI_HAL_OK Function completed successfully, no action required + * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer + */ +adi_hal_Err_e linux_adrv903x_HwClose(void *devHalCfg) +{ + return ADI_HAL_OK; +} + +/** + * \brief This function control a BBIC GPIO pin that connects to the reset pin + * of each device. + * + * This function is called by each device API giving access to the Reset pin + * connected to each device. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param pinLevel The desired pin logic level 0=low, 1=high to set the GPIO pin to. + * + * \retval ADI_HAL_OK Function completed successfully, no action required + * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer + */ +adi_hal_Err_e linux_adrv903x_HwReset(void *devHalCfg, uint8_t pinLevel) +{ + adi_hal_Cfg_t *halCfg; + + if (devHalCfg == NULL) { + return ADI_HAL_NULL_PTR; + } + + halCfg = (adi_hal_Cfg_t *)devHalCfg; + + gpiod_set_value(halCfg->reset_gpio, pinLevel); + + return ADI_HAL_OK; +} + +/* + * Function pointer assignemt for default configuration + */ + +/* Initialization interface to open, init, close drivers and pointers to resources */ +adi_hal_Err_e (*adrv903x_HwOpen)(void *devHalCfg) = NULL; +adi_hal_Err_e (*adrv903x_HwClose)(void *devHalCfg) = NULL; +adi_hal_Err_e (*adrv903x_HwReset)(void *devHalCfg, uint8_t pinLevel) = NULL; +adi_hal_Err_e (*adrv903x_SpiInit)(void *devHalCfg) = + NULL; /* TODO: remove? called by HwOpen() */ +void *(*adrv903x_DevHalCfgCreate)(uint32_t interfaceMask, uint8_t spiChipSelect, + const char *logFilename) = NULL; +adi_hal_Err_e (*adrv903x_DevHalCfgFree)(void *devHalCfg) = NULL; +adi_hal_Err_e (*adrv903x_HwVerify)(void *devHalCfg) = NULL; + +/* SPI Interface */ +adi_hal_Err_e (*adrv903x_hal_SpiWrite)(void *devHalCfg, const uint8_t txData[], + uint32_t numTxBytes) = NULL; + +adi_hal_Err_e (*adrv903x_hal_SpiRead)(void *devHalCfg, const uint8_t txData[], + uint8_t rxData[], uint32_t numRxBytes) = NULL; + +/* Custom SPI streaming interface*/ +adi_hal_Err_e (*adrv903x_CustomSpiStreamWrite)(void *devHalCfg, const uint16_t address, + const uint8_t txData[], + uint32_t numTxBytes, + uint8_t numBytesofAddress, + uint8_t numBytesOfDataPerStream) = NULL; + +adi_hal_Err_e (*adrv903x_CustomSpiStreamRead)(void *devHalCfg, const uint16_t address, + uint8_t rxData[], uint32_t numRxBytes, + uint8_t numBytesofAddress, + uint8_t numBytesOfDataPerStream) = NULL; + +/* Logging interface */ +adi_hal_Err_e (*adrv903x_LogFileOpen)(void *devHalCfg, const char *filename) = NULL; + +adi_hal_Err_e (*adrv903x_LogLevelSet)(void *devHalCfg, const uint32_t logMask) = NULL; + +adi_hal_Err_e (*adrv903x_LogLevelGet)(void *devHalCfg, uint32_t *const logMask) = NULL; + +adi_hal_Err_e (*adrv903x_LogWrite)(void *devHalCfg, const adrv903x_LogLevel_e logLevel, + const uint8_t indent, const char *comment, va_list args) = NULL; + +adi_hal_Err_e (*adrv903x_LogFileClose)(void *devHalCfg) = NULL; + +adi_hal_Err_e (*adi_adrv903x_LogStatusGet)(void* const devHalCfg, + adi_hal_LogStatusGet_t* const logStatus) = NULL; + +adi_hal_Err_e (*adi_adrv903x_LogConsoleSet)(void* const devHalCfg, + const adi_hal_LogConsole_e logConsoleFlag) = NULL; + +/* Timer interface */ +adi_hal_Err_e (*adrv903x_Wait_ms)(void *devHalCfg, uint32_t time_ms) = NULL; + +adi_hal_Err_e (*adrv903x_Wait_us)(void *devHalCfg, uint32_t time_us) = NULL; + +/* Mutexes */ +adi_hal_Err_e (*adi_adrv903x_MutexInit)(adi_hal_mutex_t* const mutex) = NULL; +adi_hal_Err_e (*adi_adrv903x_MutexDestroy)(adi_hal_mutex_t* const mutex) = NULL; +adi_hal_Err_e (*adi_adrv903x_MutexLock)(adi_hal_mutex_t* const mutex) = NULL; +adi_hal_Err_e (*adi_adrv903x_MutexUnlock)(adi_hal_mutex_t* const mutex) = NULL; + +/* TLS */ +void* (*adi_adrv903x_TlsGet)(const adi_hal_TlsType_e tlsType); +adi_hal_Err_e (*adi_adrv903x_TlsSet)(const adi_hal_TlsType_e tlsType, void* const value); + +/** + * \brief Platform setup + * + * \param platform Platform to be assigning the function pointers + * + * \return + */ +adi_hal_Err_e adrv903x_hal_PlatformSetup(adi_hal_Platforms_e platform) +{ + adi_hal_Err_e error = ADI_HAL_OK; + + switch (platform) + { + case ADI_LINUX: + adrv903x_HwOpen = linux_adrv903x_HwOpen; + adrv903x_HwClose = linux_adrv903x_HwClose; + adrv903x_HwReset = linux_adrv903x_HwReset; + + adrv903x_hal_SpiWrite = linux_adrv903x_SpiWrite; + adrv903x_hal_SpiRead = linux_adrv903x_SpiRead; + + adrv903x_LogFileOpen = linux_adrv903x_LogFileOpen; + adrv903x_LogLevelSet = linux_adrv903x_LogLevelSet; + adrv903x_LogLevelGet = linux_adrv903x_LogLevelGet; + adrv903x_LogWrite = linux_adrv903x_LogWrite; + adrv903x_LogFileClose = linux_adrv903x_LogFileClose; + adi_adrv903x_LogStatusGet = linux_LogStatusGet; + adi_adrv903x_LogConsoleSet = linux_LogConsoleSet; + + adrv903x_Wait_us = linux_adrv903x_TimerWait_us; + adrv903x_Wait_ms = linux_adrv903x_TimerWait_ms; + + adrv903x_SpiInit = linux_adrv903x_HwOpen; + adrv903x_HwVerify = linux_adrv903x_HwOpen; + + adi_adrv903x_MutexInit = linux_mutex_init; + adi_adrv903x_MutexDestroy = linux_mutex_destroy; + adi_adrv903x_MutexLock = linux_mutex_lock; + adi_adrv903x_MutexUnlock = linux_mutex_unlock; + + adi_adrv903x_TlsGet = linux_tls_get; + adi_adrv903x_TlsSet = linux_tls_set; + break; + + default: + error = ADI_HAL_ERR_NOT_IMPLEMENTED; + break; + } + + return error; +} + +/* + * FileIO abstraction using Linux kernel firmware subsystem + * + */ + +int __adrv903x_fseek (FILE * stream, long int offset, int origin) +{ + char *ptr; + + switch (origin) { + case SEEK_END: + ptr = stream->end + offset; + break; + case SEEK_SET: + ptr = stream->start + offset; + break; + case SEEK_CUR: + ptr = stream->ptr + offset; + break; + default: + return -EINVAL; + } + + if (ptr > stream->end || ptr < stream->start) + return -1; + + stream->ptr = ptr; + + return 0; +} + +long int __adrv903x_ftell (FILE *stream) +{ + return stream->ptr - stream->start; +} + +FILE* __adrv903x_fopen (adi_hal_Cfg_t *hal, const char * filename, const char *mode) +{ + int ret; + + FILE *stream = devm_kzalloc(&hal->spi->dev, sizeof(*stream), GFP_KERNEL); + stream->hal = hal; + + ret = request_firmware(&stream->fw, filename, &hal->spi->dev); + if (ret < 0) + return NULL; + + stream->start = stream->ptr = (char *)stream->fw->data; + stream->end = stream->start + stream->fw->size; + + return stream; +} + +int __adrv903x_fclose (FILE *stream) +{ + if (stream == NULL) + return -ENODEV; + + if (stream->fw) + release_firmware(stream->fw); + + devm_kfree(&stream->hal->spi->dev, stream); + + return 0; +} + +char * __adrv903x_fgets(char *dst, int num, FILE *stream) +{ + char *p; + int c; + + for (p = dst, num--; num > 0; num--) { + if (stream->ptr + 1 > stream->end) { + return NULL; + } + + c = *stream->ptr++; + *p++ = c; + + if (c == '\n') + break; + } + *p = 0; + if (p == dst) + return NULL; + + return p; +} + +size_t __adrv903x_fread(void *ptr, size_t size, size_t count, FILE *stream) +{ + int total = size * count; + + if ((stream->ptr + total) > stream->end) + total = stream->end - stream->ptr; + + memcpy(ptr, stream->ptr, total); + stream->ptr += total; + + return total; +} + +size_t __adrv903x_fwrite (const void * ptr, size_t size, size_t count, FILE *stream) +{ + return 0; +} + +int __adrv903x_fflush (FILE *stream) +{ + return 0; +} + +int ferror(FILE *stream) +{ + return 0; +} + +int fprintf(FILE *stream, const char *fmt, ...) +{ + return 0; +} + +/* + * Memory allocation abstraction using Linux kernel firmware subsystem + */ + +void *__adrv903x_calloc(size_t size, size_t nmemb) +{ + size_t total_size; + + total_size = size * nmemb; + return kzalloc(total_size, GFP_KERNEL); +} + +void *__adrv903x_malloc(size_t size) +{ + return kzalloc(size, GFP_KERNEL); +} + +/* + * log2 using Linux kernel firmware subsystem + */ +unsigned int __adrv903x_log2(unsigned int v) +{ + return __ilog2_u32(v); +} + +/* + * Iterative algorithm based on the fact that + * multiplication (division) in the linear domain is equivalent to + * addition (subtraction) in the log domain. + */ + +#define COMPUTE(n, d) if (neg) {a *= d; a /= n;} else {a *= n; a /= d;}; + +long int_20db_to_mag(long a, int mdB) +{ + unsigned neg = 0; + + if (mdB < 0) { + neg = 1; + mdB *= -1; + } + + while (mdB > 0) { + if (mdB >= 20000) { + mdB -= 20000; + COMPUTE(10, 1); /* 10^(20/20) */ + continue; + } + if (mdB >= 6000) { + mdB -= 6000; + COMPUTE(199526, 100000); /* 10^(6/20) */ + continue; + } + if (mdB >= 1000) { + mdB -= 1000; + COMPUTE(112202, 100000); /* 10^(1/20) */ + continue; + } + if (mdB >= 100) { + mdB -= 100; + COMPUTE(101158, 100000); /* 10^(0.1/20) */ + continue; + } + if (mdB >= 10) { + mdB -= 10; + COMPUTE(100115, 100000); /* 10^(0.01/20) */ + continue; + } + if (mdB >= 1) { + mdB -= 1; + COMPUTE(100012, 100000); /* 10^(0.001/20) */ + continue; + } + } + + return a; +} + +/* + * Timkeeping abstraction using Linux kernel firmware subsystem + * + */ + +void time(ktime_t *second) +{ + *second = ktime_get_seconds(); +} + +struct tm* __gmtime(adi_hal_Cfg_t *hal, const ktime_t *timer) +{ + struct tm *tmPtr = devm_kzalloc(&hal->spi->dev, sizeof(*tmPtr), GFP_KERNEL); + + tmPtr->tm_sec = *timer % 60; + tmPtr->tm_min = (*timer / 60) % 60; + tmPtr->tm_hour = (*timer / 3600) % 24; + tmPtr->tm_mday = (*timer / 86400) + 1; // Add 1 to start from day 1 + tmPtr->tm_mon = 0; // Month is always January + tmPtr->tm_year = 70; // Year 1970 (UNIX epoch) + + return tmPtr; +} From cfe7eea2dfdafcbbd2ef7ea5d5f62915cf596eb0 Mon Sep 17 00:00:00 2001 From: George Mois Date: Mon, 15 Dec 2025 11:28:01 +0200 Subject: [PATCH 2/6] firmware: Add ADRV9030 firmware Add ADRV9030 binaries and gain tables. Signed-off-by: George Mois --- arch/arm64/configs/adi_zynqmp_defconfig | 2 +- firmware/ADRV9030_DeviceProfileTest_M4.bin | Bin 0 -> 3952 bytes firmware/ADRV9030_FW.bin | Bin 0 -> 655372 bytes firmware/ADRV9030_RxGainTable.csv | 259 ++++++++++++++++++ .../ADRV9030_RxGainTable_GainCompensated.csv | 259 ++++++++++++++++++ firmware/ADRV9030_RxGainTable_HB.csv | 259 ++++++++++++++++++ firmware/ADRV9030_stream_image.bin | Bin 0 -> 90112 bytes firmware/ADRV903X_stream_image.bin | Bin 0 -> 90112 bytes 8 files changed, 778 insertions(+), 1 deletion(-) create mode 100644 firmware/ADRV9030_DeviceProfileTest_M4.bin create mode 100644 firmware/ADRV9030_FW.bin create mode 100644 firmware/ADRV9030_RxGainTable.csv create mode 100644 firmware/ADRV9030_RxGainTable_GainCompensated.csv create mode 100644 firmware/ADRV9030_RxGainTable_HB.csv create mode 100644 firmware/ADRV9030_stream_image.bin create mode 100644 firmware/ADRV903X_stream_image.bin diff --git a/arch/arm64/configs/adi_zynqmp_defconfig b/arch/arm64/configs/adi_zynqmp_defconfig index 33a94605c6216..5644db8d5df05 100644 --- a/arch/arm64/configs/adi_zynqmp_defconfig +++ b/arch/arm64/configs/adi_zynqmp_defconfig @@ -111,7 +111,7 @@ CONFIG_PCI=y CONFIG_PCIE_XILINX_NWL=y CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y -CONFIG_EXTRA_FIRMWARE="ad9467_intbypass_ad9517.stp ad9517.stp ad9144_fmc_ebz_ad9516.stp Mykonos_M3.bin TaliseStream.bin TaliseTDDArmFirmware.bin TaliseTxArmFirmware.bin TaliseRxArmFirmware.bin adau1761.bin Navassa_EvaluationFw.bin RxGainTable.csv RxGainTable_GainCompensated.csv ORxGainTable.csv TxAttenTable.csv Navassa_Stream.bin Navassa_CMOS_profile.json Navassa_LVDS_profile.json Navassa_CMOS_profile_adrv9003.json Navassa_LVDS_profile_adrv9003.json Navassa_LVDS_init_cals.bin Navassa_CMOS_init_cals.bin Navassa_CMOS_init_cals_adrv9003.bin Navassa_LVDS_init_cals_adrv9003.bin Navassa_CMOS_profile_adrv9004.json Navassa_LVDS_profile_adrv9004.json Navassa_CMOS_profile_adrv9005.json Navassa_LVDS_profile_adrv9005.json Navassa_CMOS_profile_adrv9006.json Navassa_LVDS_profile_adrv9006.json ADRV9025_DPDCORE_FW.bin ADRV9025_FW.bin ADRV9025_RxGainTable.csv ADRV9025_TxAttenTable.csv stream_image_6E3E00EFB74FE7D465FA88A171B81B8F.bin ActiveUseCase.profile ActiveUtilInit.profile ActiveUseCase_NLS.profile ActiveUseCase_204C.profile" +CONFIG_EXTRA_FIRMWARE="ad9467_intbypass_ad9517.stp ad9517.stp ad9144_fmc_ebz_ad9516.stp Mykonos_M3.bin TaliseStream.bin TaliseTDDArmFirmware.bin TaliseTxArmFirmware.bin TaliseRxArmFirmware.bin adau1761.bin Navassa_EvaluationFw.bin RxGainTable.csv RxGainTable_GainCompensated.csv ORxGainTable.csv TxAttenTable.csv Navassa_Stream.bin Navassa_CMOS_profile.json Navassa_LVDS_profile.json Navassa_CMOS_profile_adrv9003.json Navassa_LVDS_profile_adrv9003.json Navassa_LVDS_init_cals.bin Navassa_CMOS_init_cals.bin Navassa_CMOS_init_cals_adrv9003.bin Navassa_LVDS_init_cals_adrv9003.bin Navassa_CMOS_profile_adrv9004.json Navassa_LVDS_profile_adrv9004.json Navassa_CMOS_profile_adrv9005.json Navassa_LVDS_profile_adrv9005.json Navassa_CMOS_profile_adrv9006.json Navassa_LVDS_profile_adrv9006.json ADRV9025_DPDCORE_FW.bin ADRV9025_FW.bin ADRV9025_RxGainTable.csv ADRV9025_TxAttenTable.csv stream_image_6E3E00EFB74FE7D465FA88A171B81B8F.bin ActiveUseCase.profile ActiveUtilInit.profile ActiveUseCase_NLS.profile ActiveUseCase_204C.profile ADRV9030_FW.bin ADRV9030_DeviceProfileTest_M4.bin ADRV9030_stream_image.bin ADRV9030_RxGainTable.csv ADRV9030_RxGainTable_GainCompensated.csv ADRV9030_RxGainTable_HB.csv" CONFIG_EXTRA_FIRMWARE_DIR="./firmware" CONFIG_CONNECTOR=y CONFIG_MTD=y diff --git a/firmware/ADRV9030_DeviceProfileTest_M4.bin b/firmware/ADRV9030_DeviceProfileTest_M4.bin new file mode 100644 index 0000000000000000000000000000000000000000..ec9fe6f2abe7946d290c6167874644a62f9a573a GIT binary patch literal 3952 zcmeHKJ!lj`6n<}aZ<9?7cc*xko{AC_!;v7IeIT|r-)PDJS~=(PhA+(&*F z2jPjh3ti$m&aNEL$Cu{K$3F_Y_Szr69&guvoiko9pVBTk`|zZ=3D3lScq7ihW$_(u zJKfsc@_nQ8=h@DgFCQlN?0mW4Bpxjt(x0w8#ESC*ro=G3tA7fD&ew7Nug^Y1jm5{- z`)K)8#PL2{FkE2EJ$$na+{LIA^X15t#aUgws2_b*7260OkFE(GndhZpnw(b*|4Q8c zyodYJXU5{kqcGO)wlY?u-$)_Smq`PiWRWheM1ZNZ9f8P?yyY&q{yn~OHDAh)5ZUfr zK7uPdZ1saEsyryo#4TUT-%#N;nH|anAn}71nKZy24V5 z*qmhF;-jUd}JkiTC*8~{yr8ti5>g`v}9 QM{|Arr@Sg%IdbvaZ#V8LTL1t6 literal 0 HcmV?d00001 diff --git a/firmware/ADRV9030_FW.bin b/firmware/ADRV9030_FW.bin new file mode 100644 index 0000000000000000000000000000000000000000..b8ffdcf012d2b4f4d689c42506e9f5e4dd622b56 GIT binary patch literal 655372 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 xL%zL<3eJpHt+!+#Adjccq-%0ZvhF%nT?tBy;z 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 z z#z%a$wdl+ILM`M830Y$XNI3!D>+xlm8xDa3+}l zcq_|=B%W0L))`j{V_$NiyD3v;aL&RHWg>yMJxyQZx7SakB2F|SPeg?hM&Rp0-Spl z`$FtnurI>?73_<#Zyu(rvxn*0Wy5r3<}jU~p`L$0J%68ie!Y7B?qS$pui`Bh_&~Hm;E5-KE$Li@r(1Rk(UC!fp8^k{(2X22Q{3FKjSM&^*ndhWotdlZYqULjWaIm zHLzrO?5phO7Sh|gbi^;Zvi-jD4oHH_sDIhmS<14zy4WAqLMyqEsqf?9Kk2O;sQin% zf35QUf0Dc)RtEn-=r0e;kDyj=RyedOvRVIy!iO(MFZ!U$RRjbhTHRa)QZ~oi(DJPI z6YqmA!UGMcQID=b-xh-oh0?oDO>YHKfrbU?`4GBgG`$%G46j;rC(I7oN-A<<_3W!3S1 z&E>uHpIp;zRn=FKe-BqS*T6Nc5gXhS4vONM-U|dPKE(W@hZCrd#nXn}38e0e=ks2pO_)Tik~;76#P|gStJ}jG+lHimY6DtuObtP9 zO@5B!QU{}LUM0ABA%*Y|Be80Mk-gtF-xlD(X~h*}hOxG8U^%!OETvz|N8mfm=1-2O z954muu;A~Niv}6cKCF>q5sTIPumu>eO8rSs-2nN-uVYiL%AP;Dm7ks-()Cy)MzED? zB3zC>0>6xET^BG0#6#q(Rw~=`Wr{ty%7y-Z|3HdR>LZCiwDgc|F)eb$wAgeU!Zw7l z>3HJiJ@Gd2#=ZP<05Y~K!J#`F+n3mmVXNUx^Y7zL^Os=14BHLZeArfE6S1wrwhq^W z*gQH`(F9I#sLvlbg?lj{QHowiSf%fzhcxoU&2jX2UKi}uTnq(X9|Nk>KA5%U`Cx7V?0j#`EkLO+M+s?SO zfkxcdHB-Gc%2Z#HSMB4|z{iU@$VcE|jE@9*)%WY4V_(6tWvWjfO$3MG0?D-~+g6ED zvpaSYIuR!62jG`JDj1JKn!%(yl_M0}f5l}Q@QK6PM;(bdmD`ZQyJHwf5{d!~&fJ$~ zLHzXtw*@d0U1UZ0Gv%^LFXPC+oQ~kDAewFNL(B)2?eJ1;t(z5gka^$3fU>?!Xha=>y^8;7L8vhjOi;vs8LJ?F-d+896EXsMlv z$1VFG`kr51%&OK{!TQK>e)GSbf8BZJE3)ZG@~*GEEnvgfwc)#E7{=aq5q!4O8-(Yd zsDLtlHuCbec$tZ7uW#F(^Ty#yHm-z6UP3<*TuxdBjrSJy+a@a~@kWwxjCZbrm7M_7H#LcovTTP-;DNrumI*Ht~ex_U0@19l&TA7pGqv3Vc%uVZ5@f@KaS1n_Z6 zJfEatW0ItC7U{tgWQK&h6Dx?*a%-nP{N3@0T>4tDC^0;{8diP`{%V~Qp@*ZGR>+bH zU_H0sTrvJh(o~{Knr4us2|UXS&iw?ECd^(c%)2*1+CwFRrOC(wXy3W1?HyAqx%FIu zEzF7L0+L+bwEpsgtnUr(=RRI!eQ#=>*~nr42LI7Ujd*>w#-~GG6LvX^Y9K2z9fVEM z;}?4i;khsQyb1l`jq9@`hVaBos$X_R_r97&jMGJbfjj!wLshF z(P=)_D(RMbzq8Y7qmYPD5_r<%@r*~j^D~t6nj}Bsa@B!!T&+IG)j09}s-Mfostq18 zbA=8HZeb;_N^c7wrELU?qWT=a1pe#Jao~U*-N2vR%Qy@_7h3PDSOp3CTF+eTtLS$k@;*gsbNE*Im>@21 z_C2Wli2YaXAC;N#=cbX?sVI%3JtU*Fgbd)+Na>%oknFjty_|g|=K5dPd@U~+EM3kC zO!_VKi%U38I3@2M3@mqbXh@^yp%wX^t9i_vceaBc1gI#b>_KQhSswrRy5C`jBJCI~ zjFfC(HVtgzQ15d1XE(d1xQ!vrvr{~pr{GuO*~>kRZtY|ILGqh%x`%&>$6fQ3_};JZ zO@UVb2F`IL%)g|;l`C+C_A7AZnBu&dIsOVvdP;xgvN$@(b_h1x1Fr(ZVI5cFNw!|@ z^{?U@G(xn_EV3QE&5bwpV@O6d(xpTFb)45CvW`^WB^`fLn&IF39sEmmI+3(9f9uI; zrIODWba?etTFl9bRS+7Usa$T0__|AQXJIa1s6OqLj2c+Kw!?dtw(CS)1fB)UVAZ9O zRw}O6lXXVlm!1|;aJBemh>5P5K1%-xY5kDq`HCPUw0KtyzXE#0_hKO|6uG=k*L1fX zsShbsmib5>s323lYTc%hb}4&XPkE-h+M%z{?%Ji8px4D}zRA(LS9G}c`fOs7E6?|d zl5Jt|*GW%!NXvMBp;TEVd%)#vB!(R=a=oCX(Rpr+vnqG z7^+dBoJ!Al>yxNGU{2{z$US*ns^jWrv@+zk1+4C{c@99E)UV4ua@<)Tksaq})N?|m z53~Fkf%;RjX^2={%e|Ixb_czASetsw=bA!+`uM8y6xc#X`EP+kS(%P;2==dIT8qCa zudo@wTE2t*yYXG^10AW^(PBk+=NQm9cH=D!`~0tpC1OJWDJ-- z{VukHv!zGO5jvlM^VeKB&urvzX_5c#&iMEhkv~7c0q0PNu?5%?L<4HMWltajA|iMR4wGka%AWtUjjU>{W_Y#Pb!S|IH!K2>LaP& z&Q~>&BRM&w#}4P9_XgP0|ec4*xu0U=?O zbeXf~F1~)j@;f#_QsFbh)=l*7^Y!{Hwpl)_EmD`^JSJBT2=z2SJ0^PuvLlbhnxwV#c5%zSWp|Wa(hXO^@&k*_=uB$YkJ^$)=&+rO{z=J3~^04Dr%!3U?|WW zMjb+FzCKR(UOsSG-Om|-`90SVhyJ>46wzov(stTqvL64I-_qVQP=3dmPYva_~Mxy+HQ< z%=tnGtuSeQsgIllTP4<#>Y9_Y3H5#Q3$b){EvfaURCd>q9-G*&8Kf-EV7%uu9*RLm z8*`XLui7es<>c!REvF}a(-TK!k{*2ExDzwn$6wH>7>SP%4ldK!HayF0Wh+-KxO>ei zhW(63miN*a< z5pGCDRUr4qx$!q;g|7TC>|u4@kI>_s(bjpq){h{KLLD4d+MK?-FovzGeMq^Cy`vO2 zP%m=dzysObMaMoNH0}fYvHn{*<37BR+=U%U;2&NxO#eOSQ~JxwDD?U;6Y^9XndT!% z8XU?ewUNW%y&^^s=Y9VlX>S4^MU}OW->P2I*%}CtgoxE)NhbvDAZkFA?oMbDzySg? zgWF68LAwKJgP>7SI)EBb$FQh@(IKca6VTBFWj+GN1Xpl$rjxKQrg51-Vlv$!p{ld> z|2zZEBU=!M&VAGlrCTZlpxeG#7`qn6n&3cs`HeAMPRK^i!^?wywNbA9w>^~aUp>1ouTbS~wJW371!mHrCQ?+DOu zqUR$fF7@*QwJf*WQV`pIB9k+HExwMH(FPCc^6HKQ@$_||rZ!6V&I{oDgHCn+0e`;G zP?1kxUWOjY2W?j1{TaJbPM5ojrl}g-Zo-vV9%8~ic-y)^ROk$#4UBXEmMixyN}ULDX%zqmSF z4*&V;P`~e&SBFirk6g7n6uA$&|J&+NCtX<`BCt9n{nypu=FpYZArbcjtHUa+4n%Ky zY~UIo*QHhAS?K$n61#vD9llXn64ar=uVN1nd&3>G=I1b46QTsj3X_?z+j$%lG#W$A;r$m_s2O-9#O;;Qf=tOFLT1DWzVaHCX@bs)nzJL_hw z11GT#fPOD$n-0np{1mjBkC@W0qTuF&uf;*q`K4}n4M>%}Jeq$-!D)YaO1vw4BzdHa zvx4=%fcA`Ei5)cwIV|`AKj?`e@Y0Z*G-$;=Nkg26_Ye~O3#7kqQ#*_~)@x|;#D1C_ z0jhQixH&|XkH}Q{WB1GXM7P>bUQLx5+n0;;w6|5JIM8I@R)szjO+2R#49hSqdBGN>LiRS(+{4(*r9RG6yuH?IxfL{|PuLJTcuIM5C!nxwrbp5Mr zg{}_=KmK?>RsZlRs(xSBFH`lSU9@KT!5fo}1tD58;jE-DYm`=R1*a1@qUXkvCDweP z+PUHmKZ!MRH1J=#_=}0q<52mMvaCtPz!A<%(x+VnVxqQ7BTli$`^@Nv{62j*gN{)= zG{7TSqj;n*0=jI#0PeO{B9sef&6OgBDORIX2mk7%=hX=9bx@V`&){EN+okJ{gErC- zaOK7jO6qhwB3d-ae@}Ogod02H?5M2_d1u_kN{uq#{ar(26aO0br`UGiWR`MekMbW0 zB?O?wr@75xmUk$-%k1)E1-!)_2aU$uUQ3#Wl!l}1wwlo zrMPvel@=G|Ou$iNft#d&yHUKo?+W!Ug&(nF(jgXf6JLIaDHOcL7v6JYe?F2W4wqKr zO$pZZ_BffM!@sFd*=6{XZw7@p1-aN&RJuq$f3kf2Z-qji5;yez5`{h`K6N?#rxdzT zuBA@+zqjw*FTr^dmC=eo9Q0`NAu7x>4K%JeE`9 zb-h2Q(~rNQ1}|_*)b|mc?iHWwB|1ISN_5)!|AS6X?-`)eclP|0PUqvD)C>RY9iY>3 z)+=<{+CIekb2^>ZqtNO3JwK<@J9`G`^ev#%$HjYk2k7)ozeuOI^@L$-dcUrI))KfX;XSAAw)L|S>H_wZ|lQQ7df++VRJx7v<{e*H4zsxcJGIb`7dEC!v z^G`Wu_(KLwKC(?^dJWiOftk!y_WWh~JpX^;mFE}!oYWGHo?p0h;Wfne+OR9cmSn+@ z4G4`QdAQ)9`QI_$>>&>`H$&#pDE;^r=J8C0&Zf#MO*7`D8R?G1MZ)UA2?}7&R;ROI zafGh^E=Uo-fk#v`&Ii5`Uk^utGpvBkg+5zDs8CJ^*?X0wB|wMKXp>SHY#^5tjrk|h zVo;di>_1env8q?t=$KN!^`I^Z7#F9+N+9*17FJi5wgenv94OC3;wj<_T~*=nQ9fI{ zMo^W|8s8`i;HI--f0q*a)*l`ZWK6F<7_Xb+Y!vf)*bPx7sX%d!Q$vEam9>1v>6bd+ zuamONAT`47QouRVJ0Tser^Jjdt~Ae~+ocMO!RXf4d?BgJ48E^n`!>oE5nRa+Ht`tM z_xIS^^<&u$57ZU9SP8{sB8KMJZ+hvX$Sfq!g~6s%qOpf;8Fi&=r?oVY9lIW~_(T2m z#jp7z~K8z|Yzq1kYphNJU&0ZPhc>4{dt!leb z2jN+}7N|bhYXqi-wA_$ zVZ?>qf0(&-Mm$EYsZO1qR3D$f9?z^A=TLg;4|s=qbb{Y(%Fm*)l#u<*o!MDju$VU| zFs#c!Zb0pUkK~Z0HSmv}i8fYC7+a7wPpDQ(S#m&;t2BzG-B;-HQ@B?+XRm1`=rZwZ zB-y_nwQA`)CC-Ik7PUE{o>s&MbDi)8M%v}jl4*$W$Bj0-%Ix}vWVFTn{%>A;?`f>O;CY^Qj&ve$Q1|bwmF=Eb)H2J`Ne%IP6g4Y!hZh z|1l?vylKU&eeMTbTuJ&kV*w8z@pB4PB_##w5?_I)#JEITqHl=$6QNy^M{YH&3@lCq zzBhj*eRT?2eawuom>X7FoqXsCu-|dxU1#?xr*zOD@8@u$Woq=MY@21w<$(S?fyLFp z_n%3-$hL^6N;5dCcA0iJqPd*j!yg;; zh}YLDHY9TntNE>n8~sl;pI11~v#MV-L2`@R6;T7DP{)eJ%d_&A-ai>ka>OHxS1elm z$Zzg{cxKKM!tDY%ypPB$ob@mzx)MZT!mm~>6YTj9EqdfiI(ock%%b}y3t6z*UcBOV z5|h{;!v$p%|67E!em3SkSdM(SHnmFwdlBI%@t&hX@C_sE`?bFF#PV$E7USgWOxN)( z&k8o_7B;)XoBxe?q-QB?r1ULX_Ko<@p7VRo!Pkf4BW7xdc+ulBPdqTj$6mIcXcQwa zTTfU`o8>VcoV^}aBpV#u)<*HI5M)Ge;Iv?^q4R`?jpa+!r2)`yYw!iH1vNV+tpg$p zkTwJBy%8q=NMxEtVD0U)K%!RH7cG1PjB;i^ zAw@y&J;7IOA5u?g&Wq2&x|Y(mcPn{Pdq`V4GlY|WgeLbG{dCp#X#K@@b$_0veQH0y zZ8Gwm7u#`~vFHE?>zYWcM7kC)2ZTqJVaeT#tVt^KrG|Y=&5J`z-HS7ql`npL*@eZL z;396{GV=qv&c{4!iw$1p%E8#_&&Nj=4q0VQnprq+Rg`%{;igsX4RjV)^M+Pl4}KLg zK~~==`rx&UYUPowK*AkM-W#x7x-!4(q*LPUl46gt)O5@LVvllMJdM46gn#MJ=C)#w z0!lPpzr*mSQpZ<&*qHlA-tJWS?itCA)1I8<2R-Cywf?gEW@y~7Q9_rh=l9KDtw_;@2cK>>Z=(EF}^CeCC8l&ZrBnCu$?T`d8v=M0U2b`;&+6XHu%yDo^e*#E)u zjj8_fVVK5h_QeRKewz|RST=L;2t6MKMma2&-+u5Cf0B9TOg-k;KP(O zZ6~dlB8FQ0EHGE%QocZH`CK$$Lt49>RyeRGDTLAjCs~S4j=vFc8Td_*)NSF#?0Gd*0KNuRD8i zIOE9@$qJop)mfiapPgfce*FZ)Spoa)j}cR1&9Tn3T4f(qp6Rv;D&L_jFZ8=1p+YZ` zoQiarJNtDFB9Fyasbvjot$#rOV4wW#nf{OAwefe^7Fh4Hp4L@XR(2J&+hF@d@5qN; zR8ccdPHU`?m-E5bIbNI9d~oiHAhX+AjDlzSf=X!Mw^QoZc@A+O=PeI1n_Z6kcuC&K zP4>w()+G_~MN9M!suS@5Q4XNoYc^JR9p_!CPk$|q_A>MCLj7jg+IDz7OvoL%!Nx}E zwj7R4S)+YbH7bo(%oNRLpmn~=Z6a*Y@~2tJj@G4yB~O#)3zCt3czylym7T2yMue|U3+E+;-iwf`F4A@ zbpp^uUm-kGE?Kpie}&4Rn$i0)Ka$*TY0qJx7a8g?Dxr(ABy1`ywjXK0JQCQblTGC= zo8q0<783uppE0tAC+kEttU=OsyDMtR>r|uh(-{?CQ4Q?k(JPb~EAg3pmHQz~hH=e}@ZS z6cru^pVXV%&YDE@QG7W ze91Aq?=a|)HfUC76mF38M(r-4P_;?3Tm3e_ncKoUOa;*ROS$+$`mRCS>z1hg7el%!UhAjD@-`O-nJa2j?4?P zrs-zzV!v_-C|_q}oo^MsjyIkFvK>5*M1;h@cWr2m!ZVPX5FQfW?V`7DXpJ_ET2qGI z#za0s9%)e+DQ48g%>G!VKO}1I&>qYDSv_RO-YNXAKx^w7Ln(r$jZXeUFm=?a-r1CU-!dBi}-f z7(X_}|NE}zgH*y%lu&FRR#i;3BM(8+1L4L#hZ53{4d?J_*GO-O&Sxxc)1 zA;J(axe*qid3OTV(I)qKx%{E^7v!4l>Rs!|EL=M+SU-?!9=^>9Zvr!hXps98^ugIC z;VDa{Dp{#zR_GAgT^ICYZOsB=t`b@n@;}AQcN3~X#1Ox>J0g%7&sx5U`358An+x%y zyr8uI#C;TOtuhPOPit);DA z6uobWpNmrX%cXqZpzHk5gE8jzA@wT>SuGI}wel1HHb&a0#1@{P*`iX_;@)>boqytj zdeolynYLP7Pe4}Izuey4MC;U>Eg`o6*{X4(l_ zBY@VNb7o$qHBQi)vQ-A~OQuz70lD%IC!KSG3Yna%cCMmQi|xAlH&EKz_>KMEL7ATu z{Hvhb^@sHL)ejl_&&3EhdV2V!u`?50BLha@ zZV9c%jlzY%Y@;*cgV_NK^InA^-XvD_pk3v#hz}E7dRGO!O(^*)el%|MUW@?V_`@&3 z2j9$r*nzNte4go1uzzGO??rvF5*Amy@bCG5AJCCtjgXwM0i1GLeH5WkEnED^ zBl!<5h6Nj0?($Ny(^!4*qG4WEcG>v)M@L>0->2#xiTIfQcvbzoK`w?; zY(NPmb05_>n*VUawdHt!R?e@QwK3PG`NemMs_x-+~)fe70J*3Vh9+mY6wnThwz00nzi`8fvpZ^{l{}d|SY8V?v<1TDMGZ zZH}2^>+lXb66Dk$1O=_()Tj8%1NwmL(q24gjnCR+9hw#6pO`-64ER^|v}UVjnO^A9 zwhzrRL2qoQH9Cu#sfodkeBPy={s@fcXkL~@gb)vdvPuJQ@H3^YZ{|BYt zSi__216FXj+T_+sxHn`JD z^~3v-DwOW8V!2(J^NrkMvykCCa*b5ThoMloyC#wNW!;k<_4+}8l|r} zm_;?5-NA+pYq7I~?N;{G$hRmQ5o&;M~sYca~V!CoXSMX;t-XM5S$T!Xq}kF)0ae znOL*BB};AhM@7HYGUPWm-!S{kwB}Dnoi~T`0qhM6MgpnF3qJD>$A-&&0w5k zPYZCG+W5Ia#zoZ+@h|MscD7r8ZM|r_+xousqV;YojW=CGuKxGU7WVt*n>A)R2iNHx zWY-V$j1A-9S8N#Oo9DyK8me(bbcDt;ooZyPr}m2UeTaL_iKytevmO{Z@rJ*j<^6AG zQQ02g^3#v8ioFB#iRRX|b83?R`-D-=)8^4!!u&xWVh;W83w{v$Yd6o!_WG=?n-kDV z+;`nNQ+$mbI=$9-X3DjF*B!&Xg^>%tpY?gnYRk3F$9P(0g_p^?i)o_c6RbA99k4>e2Qo*(2(H->i$dl(d${TudB|znF*do#^x7!!e#V)+9KFqjmQ-4b;1TzUg9VzUlJx zX1O(tUAj*4ymqc8Ez57s%sK}v)|=By&!C3tyk;vebm`iacFTZf&`zrXbMHzEMM2#j zE5u$!|7Y+yk_{9CJs}pdKUn>Q)Ic{&17;jy`)mic2T;2^rxy~Mhc&R-3w;eqUGgHh zQ)Zg%(rnglV#$RrbxGkHLF-wLHhW z-N3d9>;tcO?x~mTK>RTO;G6BRK%Z&1YbVOeL|Gq(F?u3KqO1s%6_2tqQP$%jy0XB( zpk0#$sDurCs$ACQP-c~;Q-{(w@Vn%Y4I$!D&ONnZ8kK+ASLH}?pw6ht_u`F`x(fI3 z)$@bc2Of%i^+;lhMCZi%nzasf)qH&2^tzY9>mCIUt9V-W%bN1i)3D){Jri(dp{*>j z5>HVzR$;0@cqrHn`E!%Hp4wy|RSz^i%hYk=2~A58|7t6rSTF0nIAy&TTTOlI^u&Y6 z|3O>6tXKct(apeBIo_&5s9@;m4?S^I@0e;XhJ=P&WburyQvA*t(E5TyPZIR!V4Z}0 zWDfSJnR~g;->w`}_-0{h_9iK5RDK~@H9%(_XO7Po8VYmqJQUC5V=o$Q!Gpu@0A2-; z9ghUv3m3elNMde?PL9ffOhh|4Zk!r8A5k^2CgR7yhxqKiJ|K)lm-8(aXVTwWnT@)#Ls&N{4QIe0W($LPcd^2 zcE~%Q=2D|-YWINGG)4QZ$vXemP=c^7KKW_Bo10)w>#ScApPRG}z5gx7V4&d{>Aw4U zXhbO99scKF{!zs9%fpWlr3#(APg4P4d};-wzhgE8*D z=qBH_Zq(*De5d@rndw)9)<>|M8mpcCiFSlEM+4ZC?o05(Ypt?7JcvCtd1Q5MB%j}2 zc&u#}e}H$}k|*GIb~o)SooySpQ%fVPfQ^Ri>2CM|-VPtGyP1Dkl4}n$k2phkk3p1- za^V?VpEw!mH=s8y@T`IG#EQ0q`wzF7_CMb?&Tve;&_j5h{-fOJw6=}%I}eF#WKZHK zz2H$uZa=`gVVfFA21-H!D9H>%ZrhhYPx9|~w;B3N`5dJrNZKP*hiC2FX_o$PUsUB^ zTOxGu#pdBFtk~n~VMUMm-~a98kC(74#$hDQL}|6qvCEMu3s&<(izYCYHj0y_Yb32R z9I1aloOY`(FFu?$i)>QnqMStd>b6fn_&6Ul?CXJA(I1*OazkQS%f~YEMnY=*iG#s4 z++iSKln^aTGzG3_LWeZx9BM+keh4$*K9NO?sVCHnAL>v8@KID#dhYS9N!6ZMlcAJA zIbcZ>=tF#ooPW(Ek^xdJ-)lM;Z3B7?r8Fig_#4%jR}@b?3fVZA`fVQW>%Xq*zdqG} zZSA*(xb0@eCZe+cxuO5+?oao}zbf%};!4^vbV?l!d_;BXQ}u+QSDXSJ+4lMO8?$F- z$@_P;_0obEwKJxh>x19iFaDjKb;(@FcmClKzVqFcd}rKaF)jKizVkOvXF1n9zra~} zTy3pn^z%U{D_^)|p#^15Nr7!etu1R#JPX#UK9e&2=kv!c{Bhxp_ghS7#P7rA0=oL4 z+XG784J(EcO>n-7WY>ggP#ZGiEUQ^u(QS6s?%@N*J~K4!=q^RR;{$)gl{4{yU48C? z@`4`mEY4WU3pi6)To~rk)pbv#mU|R%6@WL42R2O8LO9ui;Wa<7q9jS=)7}*$?8|K)k&OO9d$_#-VZWH(({# z^EJENIZwj_ObxyD?_CV`CYUK*=b>3TYvfxt{sv9ZsvA>xR$SPV3CokI-gB||p1>^< z`XLosfT`>T-meX4s9rwH^V-_#v%^0?TxBKzq2u=vMtZ2P@=bXr0qBP^DL zxfEu$wrkB_!aMg1h@FqvL~3F4!6sEY@1uHTR_$7H-W`{G6zBXG+%C7?`45SCGqF0i zzXbX7E0Z0g;5mv~`AcXsNYPk{OPh zToa*5aYB5l+gxZgU+2@AZ}3H%BkC&LHdm&*S!{z%2wzwDkTt3B0T=Aj|52BTK6to$ zpR*F0awYap8esQfro8I9jDkZ2tkOF2&_a5Suh9X;QzO?kGNjI;`poQAXL0E&xjuG@ zycDq5p>;ga3(kt|T@}#FKh*20RIZs1LofM3y8oy*zVa;aK$yANSGmMeK&=?)$|&%l z6+yG%^{EI_`Kro;E-qE;<5P7$b*kQ{PbGgw)^;x0fWJIeb!)pS8PlFIGAzc2A5G$JxODQo%Up?`6t z3t3%c_Tua;g)herfXj8+D&KJXTp98?4L63c3Q~Z-OnR=GZFeEg=pKjzzqbi=9<+W0 z&fh-$i&8>_n@X5-ITe+l?JvRXhyc%mT(3@$$10Cevl3?#G_Q}q_V4XCh+EcRURz-m z?|h&f`pT|+QxzwW#aq5Jqx!4}Y(^*S^W~782r*l@Rm>F@&%zrWgLGfO{plX(Dx-q@ zH)g9el^G8R=v|_?>Aiw$L2fP182kE2TVyQpyTwKJVy3C@hrVx6#8T;~sDR59E*@4_VD; z%I`O!AMQX|3?<*e%AB7{6%6Z`^M2R(8JuH5){uA=R-`k)hw-CVpXeEvlU&HTeki!2 zDP&AOgq^$FljixhZ9oPqEnj)_CVG-{5C!@_Qd^-|b#R9plk zGF44=2(6D*o4B+c@Kp8;c2|}pZ3>oAUtVG$kk}YuFzE`YMj;Z<8U#a==lGizPel`>p;l-*|Ks7KD0j{ z0{Y7wNFr-}Fa}kTE0sg~Yw9;|{`3se7*ULAhd|iIL#k|lB9tC<~tUNygXM~#IExO$cTNYl(XF{Pz6MTz156cxcYQ3ZAe6*3c zlM7;TPo)dq%Pg(}F1b!D0cT>VdLNv`=oMsda6)_w^Sd2-5-i}C6ix@oE;6Tc0kru1 zB4)ZE_97SQ3{rXL!1ZJ}_`tUAN0ZbyNDbx!)vm+hd93WbkB4hc6*%li!P^)>7d|Fr zb>JWXl^XoR3GpE*+X0RzIST96uC6In@z-!Uv$`4d>50qvK;|WW3qB`%n!@MI?wGcm zIGo9NJ8+MNP)%Oz9zxuYY|FZ(0v1Im^nNZ%_Y84) zOoO_kdQ_00a+emEsfW@{Nz;8x`Jd z2z2E*KabhJx+)dr&jJLWjW<5e0U4U?)(RZv0^W33+y^@kPB7ur=n*++ja0P8 zk9nMMTx<%X|0gE+&o8Amp4rC<6`&?S3<*3N(q(b54`G2i?7MY!E;qNDOV#09E{GeT zISM^8eC5_I!4XF-P^8#2d8W@JJ@67$c`D{}OTq2}cR`)_aJ4cH-aKG-?aJNVKkpUm zc?~$HTguD@8yts$aR8r0jxWTSJ(}PY^3du6rghlkWGP6~&q#&_LscI5o-eWw1rM|rT+Zk`9^d&$m=MOGBR!Ezv0_atM@*930uRV7 zKqaZsvI=MV9;9aQOcYBJFZdE<eq$QtOUMgr&^xW-!Ryc_H102m zE4yjrd~a8QLpm-_3cKCKPdY1Kma5@VP>&O;XK=@vs0Giboc`bxAq+vLoUbedTV*y_~yU_WZ*Vvl4H1={d8*06AbEX1dz} zu{k6&cn`|k5SpEn>as|KfF7=l45-HKRz}9#eOj!7Q*_V;bYBqf>{Z^j8#QC4-$UX@ z{F%Axj9Ade%y;>+9l!On^m%m#tX;5jmgn`#F3vp5$0rl-pv|(dv2`qcVx76*u&ld& zM!d7ne4y~593V`wzPso;Zr--d<>;w z=G_ok7ZzWV^*LFx1|xG4=E7mfFtTA2c1C=vZ=W+RITc*%5ph!A`O9tdz1R)(ENW|; z+RWdK_G85R73ce!;1?F_2ieb*o#ag?U{muXD`ac%BR!^lz{aV?FB|tNwB;9K z*M6-2CYHR;)nGlNQy<-)VM%-&M&fu>$<0Ss-GL9kKzPthV5g9)GHDr8^ zzmXYVB0OvP7r2kk_!NI*G7jQzY{o|j&t852_k%L_;qTy#z4$vMV-Nlg&v*}3PUz1u zIN>Zf=kzXPu7$7?-03tv8DA-&6`ern_hYsweB4W6!Hs%OC`wfMaQ*T*6N2G@&x&T^S9Ogs<^tPBlxCY}O z!MOn4Mv^Y7VHtl$Tmst$3sVQnGzK5u;PNlMAVxq-TZNHtO)@)2`Ok>sdKow?qLb4? z9CoV~%#=*zE$Yp8Zv@WhxAinC1oTf@7k$yH9@qumZ1ATRrm?b0aH)g0sno&AygE1u-+4+Bu&R(h+NZ-;__ed}G`t?^jr}~`t^GXRpt_yz zGFMLiD$mUxHVWxw9aV5TM5va?{-wQ?~$1c9fKc?=5v zIj{3Gn=WE@2GSF=^Gj^WRhcd`G6Q-38zXa7o<;fh3y-W^b^j827gomMgu8U$GVT&< z&xR%#^||1B06mHG@^JVDtd)UMFG*M48ScrN-4VS)pS>cBr3}iR?&N|_)$EQTt5wdZ zZY}HpN*?<#JF8v#9S3c9uCwQnsFoNV*Qr~**7=EZdOjp8waCGQg$oxZp}a*YZ!UCX zl_YT2?aXJvl`7(XZ)HsjzsqMPb?`0rsbr}==LBCqmZf;lf60zYtBivSomi))_X(~{ zSWT_6#I~oeARC+G(Elgv)alSqC(cA2yuz9ENq(6#spvw_L-xW2{(+t+zT|75We{Jo z45Ne)GyRpwX&QyK;XHVd<6?Tx?2dJd*~>~;0G!5gXt}D!?(JOnFeu*G36MX<*hm*o zjS>mFkz_ku;E%A=&0F;?=Cs0TRLGo02pHj*F{tGypxtV$@?)eq@*8P2Dwj*Y*o`+X z8q&Yc|F%n6=2fi`%4kToT81^CjoqUbo`kLl3m%2m?#Wd7m%kQh2kWjw@xO@*s=3B*IpjSp)y{ zLLX)8b28QzXJn(n5#n^kOzXWCTwBNj>DUEvUWnH2ufbn_CY6B(zS&je80qI;ivvBq zB#y@Fe#VFO9}R`XEU04Xx8qCSN8S%4TC*d~|A8M?PEWDSe4`H( zAGU*L*Cp}C5Uu~{qrhfadvzc3EFYplBekOPkea-Ki_3TTOc%38o$aDjyIf0}5fsU6QWUEwNrHPP6=sjK2LPx7D86`tg`m3%1=AJSKPt3~Gb zWZvYZ0(hr0I}+gEkQwz^#KU{06X)@{Sp5-kJbJ=S>W`t&eIL=vM|XewNZP9f-nbrL z)EUy@FSI_##8-JBsjRZc$}6M=>9+Nm3iVln2j4i&f)X1g<(XE+|Hj+YS8{11e0*Ax zPnC9^Pn|Z>r%$`y7m+6T3~44`WLmN>Ds7Z6K5euwA#IE=F>S1GL|Te36?22LeFGkZ zx1GjcmF)!ns%=N{S7WQkU#*So@O8GYz`qpbAI5!z?Q{G!*gnDENLwxbM%k+IH`=xz ze`9U`gTI4qAN(I2jR>2TD;&*Mg`=?-CH}u~Gk@4e@*Rbn`AQ;gMv=t)lvjuixtzZu zp5VbxF(%6U`2;TTI5bYKqRNF>O}A7KUlbM{@Oe*nT;Piyr`x_dA%`nuV>a3~ zKHhT-Ya6X>r?5uF<;Go>xF~xx6ZUA|6}(Z9j}%qlo>aRIiPJzm)tDP$aVGdBAoXMQ zyaiIJI3Pz5zfAUwB!h{9ZQ~i(IKFm7%?rZ(LgANql=+3T>_25vKpx1baX>6GV8JN! z8x-+N49ZXP3@|B|^ZXYk<-hSLw3e-dY@a-15`GdlHnLmOrS2ZKI}eyiwBE;pTIhX$ zPl~xA2;ED~_|}Gg8F&izTxC*IKt?=+uPZ;-vR>2XTIPa&{bQ|(e{OkDyT|@Uji%*6 z-K%y^Sd?TCPdcn%O*fhCT(EQw+!K_26O zq@vBXJL&Te!e;JxXo)=V=c@{N#9? z8bjAG6lk+|gb8`Qn50E1oX`aLnS{#8Gq@^$p_hg&$h(x_lr@~|>M_-AS+ep2q zwBajqdqjVzw3!-h=8~vwlyk9PXi zJ%`=E?@U%uUmICys0PCD#__u^^OZ_hzV*6nCV zLxcDhaJdJg_KR`u@aM1+R*En^!VLXigu3F3QqlHY;M4((IE)DwMq|+djAn$L?7ub~ zAdQjh9m*Gd1uU%0y((y8C}U(3(jo?W8Cm-+ZQs&;qO&a$2$)IxF%k{eIgo-{V>@em z8>RjkmOqJTV`aQ&V!TtirnX4<1sI3;m%Gvas0q!BDcx7venNF*&On=&$n~3d;7n|; z6*>^Lr(<*RBV7pZ?F|1ucz~Hc#81IaY-nW|o%v~)FKOK9IKK*19`6gn()&LaCXKsk!061~-#IH66D-vcX5occpQLe^XP7&(@=9fYQV zQ|{dy%w2j%N55wZI-@6~&y6w~s;0B=Q7+lyvI4D*1DF}itk86_RYP1x z=LFZmW}aD`NY&xB&`3AC1R&{~oo1H_`=~WmQ(z6eLC`bGk;9dEPc`KdkjvuqOn->p zXyiKkmK$7lVD=iE1v1L$fWLtB8-b)O`w8$&zkfy^qiu4JUvLqpG-$D z#}#qB2fEVWq{$QIZxy^!IV@M7%P5R@%$+$8`q50#r?Q5je!jDB#SmBi#l-uE$gwl} zV|m1CFUQ8sqgc>80e|~z!Fd?IGt3*jwHLJl4=nN8pcnLX4a@P$x~F@2$RChr^ozw4 zsZ?O59xfgnh=m;=R_yV`_#5N!-k|DKJrY-6Ry88#&JY64-+wB}E5PObbr z=+)lBYdiWJH)mx@$#WoMfSiHsoCvRQWKKr$9B77t8$sPFJH2a`7n^I;4lhtlA%(2Z zJ}}{N9eQkX6$eCM!V#ukvd%F(q0{)-B$uU_sUN;L(#AU0FfPkeY_62QK?|J$E0;CN zX?Ywz)Ui9W%6X`S6!-y>CCH3$U3>7mj7j>-xG}OFPPC(<0-9Kmd}sbyN4E2k%ia1- z74C?VfZI@FDTplb6hxI&7DR6{~*l>o6uGfc&Ycsp0avxX!k=WXLop4e%>V4tSk%rK`Rh<4Z+bs)_o{E6ILyR4s8g|!Se&*tySvX$6(d- zN-J-eNEjguzP?{ax(4xktS~b{Ywr)Sz;8lI*a?K$ z5H=4xc_Z7=x_6@&^+i~SXebxBKJ)?BiUAsA-MA>pnEs!JXIfPofeXRCg0n!{Grfef z7j4}xxph78nR~t5;sfm;6(ZZL?^R}3Tvb^7O&{>wAvK%aXQ{wAko|+SzeILXg1kaD z?jt>e@vUm`N-tFC(BqntVUEY$TIj9rb5qZ!M@VjcNoGMrNnwGZq^clt6We@LDwFqW zWz1+c*I;)mAOxpTK$i@rW^=)}^rCn#=!@N<*@YR0J+r>9aLH%Vc@?+YhFut>2qXtj zw+7zvQqEUl0kwA~atF-WA6PVibKy%cuv(#39`e`>EuJZWeUK zbGu5UuLShSb`4J8j1jPz$M}j@tKQ}VvAh~KMPYFbyh0AGQ!Iq$Of<;XGzq{RQI-%ZU^)ieckR=Nw8 zGLb$#tndk0;h6YQmj^gMo_wNGL;WU`6d6KVsj60hh^-FW8y+W;saNy*e$NF0BWMZ z#*Tq4!eQO@M*~&rmd|xM)PP!!1zr!+J@HM-Gc+JvZbtxo6V5QhnN=2!ZR1K{v$>0O z1xCTw@1Pq_G^qRS3YE941wxA2L1o}wudo!iBNO9plI)3kD@K>T-i5Y)9ji6QnY@a( z9$7Q;Mknc;(m3HOlzE7j9!v9vcz8k!H^?jQ0A9UDrWe0K8)!f&6r^^Aa?JdJaI;rK zkF5AJ!qVp0O56wjHGq$BCyac4KkcFXg-aKkQ zlT4Ag=7bI9Y_!^QS}Y<>?S(H&vy5L$Ic03@tWuk6R_U-!!?zaUI&>4XzDi$|oJP(S z2j36*Ru#OMwNqT(TjUtJ?RCjn0S_tV zT**D4b*H6jNiXoIX{Y!^cXWx8azk%qNnB~6STaDO{(DT20&*J{Y z)y;TjtAePmH}QRkZ5Rj{zqCil8t}D$8IRBlfT5mHbn>1aAJ!S zb7*VaS0|K5z_M{zsdfwOfwvgom(=?RC+I9&;XN+1Ijw3{@W)SFZ^FOp&3zuCMi?vIrBj&5%B zxjpg8mh!n-_IOxQZ`N*sMe`QmKySfYx3Dc-vUwM!OzmEjAdHs#2nr2+J!jKmrD)Bbx27&jPy{TdY@IYY~ zVf8vrN^x_B0UPr=$+8f>=P_!Eq?Mp(d>UGF+#UW2kkk?9@))EuR*cZEds+H~I*Z>> z>aB#fS5;)GC*R|a#OUNPI)4YLW)#MzVHcIOSlWhBdG@N+V<`OOQp~GT1xDs87@5c9 zkvU2F93%6Tcq+^}EEt)Il4l{8vTWqg_hS#h#+Vu8adJ|MvYf;T8^4QcG7Z{+x;jWv zYnFko@xoE@Quv3a*D(sY)HmyR^WW-V-5|#WfutK-H3t%&InZxl!XP@ue+fGY>|~wL z)v>|PYZ3PLcY<A!#QnE8BH|bmR|&|G=pmsxD6jD6m|yKU0I=T?S#E9X|qqo z4yy<|gtEk1#KUGet)!JpckS*MR17s;#$|L!LzFWS%qh9Vv)N9sVIdH zu~y{Fi}xa=7Ef#Oc9J>}wT^adMSC4VyVYV}{u!=YQQ}ryVM#6PCmjJdLC>@kh5l(z z!cSHTue<}MJu}f=D#?qIfVqzFf%PQ^IthA4+|X9&FAcn{2P^Am=+82@IiF}Sq5IOm zC$bNLjxGf~Rj_8V^H=6)<$Hwr0A+l5)k;v)Ys06lSn)8x8u9O%@OiHM6^j=M1F^pp zccn!3zv3-s?!B4T1*^I}Zk6J*iF{4`JFIR`T1gnTr1=1^7~sW~H3IV*VMpO>BjvKM zjiLajqEOcPt@9Ah&*67yIwU=*xB9NnjctFy06Z(T`7c}xyDJIUJZu3=`3k-M)eS8T=l5VOB@K9%B>R4daxxa}%!5SNGSAyTm_#MX2>$MKXZ_<=##yt3WV__qUaE}h@AeSfWm=S-` z0(VU9nC;30rm7jzT&_#qk=@L=OrXPbhUss9_&3tcM!Nd~&){UNjbb@`(812w&k3xC zq{|UIxt32=@S5#vgojy;0~`l%fK*3K4vV8p{7Ocb>41-6EwbH)A6=*5M|s(p4Zj*K z;|4_lH|VIy0qaohivxD3CHs{4u|!BfZOA)-jR}tAHQ>S(>1BKsoYojv`Z6Ee7E#Cq zHSOhwdow>^;C{2ZB#YE^6G;L;Ah? znnMmkC~I!8lBP(%=jl^oaqj>=*eP)t?iGA6t7#mtlL+aDq)w;AGd)K|dk-5E#u?Lt zRT-|h)ToBIWD_t36XFF&J^U@i0U=991Y0HhnqEa1I(fj*As@+v8h=XM4>|r(@p^nQ zFJrZPs>eB!(Q2fFV9bGLw0s&ta;~HBY#%lcMo&k`m_mBDvvPc820YtSTJZPP%AG2g z1s<&SRBwG(WvW=nOh@peu{-vvvD*mWQ`e5&SNmwhs`>`Tt{czF*qwoS#RQF?6X1CY zV_4Nch6i6YhTD68I)-QVkfw3RNl$2=E+Rh=jba(> zHYR`@pFQ9$3H0kuxl9&_lBQoS-D16a6!|b=?P1HNrYrZ)H<3>_wPR`yPQl}Wg(dOt z>VZeEXKc)E7z-9?L+cAYo||!>Cg}?+Jc0Y}hPS-ClQ|$$i~@qSTBd|z_fdHCBRZ?P zv9%$M-fPsm#^nOb#YePwl;b8D*Yl|OEm9sv%6`gPL@BxUa0YCG_X;GRniGY6@j2jy zYvJ#J?o=TQ+0+H;W4&(W5NO>uHtjYeAmk3hbUqIL^}(Q3xM`pbDD9rXQC zmJwJ_&fqL*HGcPkrqkKdhq#}D`@S##_V#KzYr=0@Uf%4y^nM*$5P4xy<~7v)=kYg9 zxH`el$NvoIiCs;*hxgL>U)M7*{x9?ljQ=m89Q1#U{}u3+aV-tsf!&|}2BP6avk8rV zAYK{&dl7%__`kh>yx-A(gwMGyl`0#lj{cvirXkhG|7R-T$L@Ns$-fu1NOXbr-_!HgtDf%dDZ`2R z;t#O{g8bP@GHC2z^1)|qK)aHjG8+volC=05S4)n5gX3SrA?tL^aNGvkc&aN#?PxYS zG-`8{wOMP;h}+f8MnN8PldhZHRF>#!QE?G!TeH!|)H57U8fQ08;JML|3hHgsG^e>U zWp=)SY}`3N;Xo*5LVG5Dxosd9L%EzaA`V=|I&Rb@>~MI;$MDLb>f+nM6@$CACE5`B zVcR(wqY82agoe}L@i%cjyb_VLl=kDDyxTj~b z8rhQr*+^nod>ax#Pl!T*?k%Z-1{i3|MT%L_Jz6z2C0#yVb78T2NDOp(dyuK^@(eHQX|ZzLm@>UTu1G%uY*k_cbg+N zc_%pjK5jW*i)WB}_K8)Yk(Z@afg%pOTa+$v*pc;#^Ju)| z#7j9Vg?8XaBx$FUOSNM?@H+qM5?n)plh-HqbepS|I5>O{4_WO+Xx&-^`@Phf@Qzwk zFGit%K8K|4L;Ma&6kabfgnf8fW~c6a{4wP0%>c?fHd?V8?3RpOo7$QdHCQnWZ9jb>4TKhB#hx4 z7mEhApu(s0%LPZ_9AS+;9=->?;C0>&lU#81HFCi>n@BF0)S%|Qd&%yWpD~EV3vYka z-87c*I9G-4p?s2ZP8rePfy_V~fu-yzYp`us#|uAg{0 zZfvyUFIJWk*dtkMb^4>J*l|cABl{zc?xuv5okiQ}w8A&6!96~dktCT{GwjfUa!DQ5 z(Q--AK*Th|=1qt9OX6F7ma0sI%nO&>FEv0fNygQ^de#0IJ2MuD2Vz7ed>gj!f!~1B z*RJbI3LR3sb5)AbkRx+ALk#RuD1Lk)@d1OOTNUj~fNxje<6&OXPDT=613ykzZ(q#i zn2BHai$gduCS#2u|V%yny`)~`I%+;4Dr@2hq=hq?m5vH9dtEeZ;nZg ztsHQ3^jWmp4yhg$2xnzAe>x9OlZR9rDtp9KX-IY6k4Ah+t>I8?E@Tt|w1c@O$}%YE zU6WZe7=NScH`+66ya6>EY>)FztRdN!BDE6sQ!2e2S1PB~pV$cO9F{yg@N^#Dk_HWu z{STuC^qurAM$D-XDol?Hu8TNHq*@tv83cHj8Wpig51Fra3-KKO;v;R&DY2*RTp~B>Ye?u+n<4GlqR5H`7c?!vn~ad9#U0{Zp~07B#orav zdsWFDVzQLjFDGWBfC8T^ON+NaR=k;Q8H{t34lzv|#$COM+k@htE@EG`QB zRMLUdndDFj9XQRu8Q~oW->W3+BU|6zsr$FQ3a%tTwN}2^Z|FIKa8IB zcrHoIWqQ(^s*B*&zJzn?iXE+gFbq3KDU}!vV&b7Cl4Gz23`LZ~1QdpfPRKdxvD@6_ zsdPC+ac3{RQ}3^hHU+}Ar!#GV)pJ=1&^8F`DosFXIVdd`ypMHbX4@gqLzk=_Gu=0EZXSEIxUG0QPEZUH zZ4rh~fn`1k_r>_BE1)Z8xXJH@o>T(LX94H{W6pZBKE+x)5_4W4VgZx3ZTt)_-13$l!Lq7>dz%bNUuOR*bP1l@jv!QHLmn!fHFblU? zDfJv1q#NM3@OCz&#W?le8Wv-3uAL+Ap{DEq1gi=7DT`^*>9sAz`WT=H9zu)!ds=71 zJGj@i{7!FZc_s#N5#JzuS&|cN#f?9V`v*8DVvwPZ)dv^=9v zk~Fm^kcLvv4zQSGO(YxlBE&0ms2r|p{9tztUbz-jycXviUaZ$%oG_6TOQAy;wb-dR z!N=M*vN7kcZ)|;%c9+oV6F}{2`*~gH#s<>6)h(Z~Wl6^I#7SRhP=lMKF-`BRZRIxN zOb7QWT-DppoFhJ!1vBBs5ga@EJg^sUO4PgtP9E#*Ndp^0x^FU0akuu1`DmK{)VtZNS9v>a&HB*x7e|^q7-_&F*`IsgB^)ATMX?6Mk-K${OlFt)oI?&gw*V`TQuS(G@;K^#+`xGW57lP-3{Q3>Y`fr?OKU8YlTyo}T&e^dwe zA#}1tS887hryUx3o>#-OHVdR9u9lhnh5fl`euc$Klsc$e9Xx~-Baq_I<=hmnl&}M7 zpzjj&Ax#9*_~bP7b-`-VQ$$M;k3&0{#6I!jM;`F|B<1D=W=g~fV@;UW%76$xRE!Mt z`9`8$Oo)=vi3w-A4sE93D|rp1B?$drpi%AjE4`t8er?6@LU=sX5B?JiuGg#{xk&$V zE592Wh`X_`+P=un#(3drWixcM6QOfO=d6ur<&h!ksRH!W4D?hUb_xp+bE>aT{3l{J zLSxg9T_fMOC}~+zwf$T47!YRqNVl0h(hxOK{*AvNLWhBBQRIl*aaNk|Ju59h+BRuB znp;(}_ahM6U`O$%{d48+y~)($IS^;NBN^~s- zrUyRrnk15$ykkGrKvM6>ldRO5#7YcUy^3Lp5rGtJ?55V_-4QL%GPcdvD(sFZ)xvU{ zjeh3d@0w_wQH{ly6b!QU9kvbz9wd7{zmR)_KI;755HYeBLvj*l`wd<5}+h8_TwREct4E2J91w@4+5VrXy#~kg~h*Ov|DgbvWXcOkp&pzulJ{IK-$Gr zsvO=253{sqhg~Pq$1|FZ&o$AkrrCY1#*ngyABgJ{i)0j!>&oi)5EZ1af{0mb4u$UJ949`6J;QwRq-Q%08(*Du4b8ni` za1l$XkhBFtsZ!7x5gAR>vS|SYZzJNUDWa2d(G(dhj1DO`OAt-DrWFJnXWq7WDU8gt zTx@Yfv4S=&D1yAi+lbV}q_*sxq-}oRXD0!iGw*pn=f874pVJSU?7jBdYp=ETTF-jc zbNN2{EUsSB^HQ0z7UKmLb)1CnP3zq*-&5(M8(_aHaRbz=jgS*A(2~BG);mU$j`RRz z3kiOlX4w{CW%mn@_FWK7Nr<@7OQ=3ufT!J$h@~uWckdSQ5$vnsF&G#M3D zJcjae$a_}GYl`R1>sLuwkS}1~QGWUO3go{CRP*0THo$BGR`v06_};5ch=SoQ=u%}f z1D@d|?2#U3+27;1lkUr}+^4TY(g;aT+G4e@&wC6<+;%(8n-G5@@hORG>6a`O(YxRV zX}-{&X_xO@x}xXc^4A+6m90;Kot%U8Q3u)Ig*UM*Gs5JTjXl$^{C^5D{o#LhUGfAJdH#}2*rIX zxDUI(7M2p6#EYH=C$d&bt3#R+wWnTTTE7s$>^2`%_B>*zd8h1otjzA8L6Su$@ec6O z0FJ{5@aoo@!L`)(a)0ST<{~N}%fgBXU+f0NLWv4RksE4b>8Y3958_^rYl)(#vWyVf zCr6aQFE!Pui+pbm_*pJf4@>4_!XV(1sj3E4VHTs;pdCYR$@kLTW5Uod^@%=faQ$GZ zPdZ__{?hWn^?IOh9upj4`X-5Td?6Fst_)se8noGf6~h6qfi|?y<_pr#}Y*_0NVnrdEvx+9}Z`OzLTUf zxSD7P#w2_`Vp7n4;krY#mdDod)I-cgJu1txPjmQw4T?xnfProXPxvoYsh90VY+F?D zLxQ$jro_8x)%|N2v;W!D%X5m^_9&3(l&FIeb)dD;je9SxnANQ*qu4MrA`^K%tf`I( z5vx+HXH}SHQ;<#>J;FxX92o7MD;qG#@s3*vEktyR%;U)crU zEXm+-DSb5#nyr+E`lU}evc;!I$vW5xX(Zm7>Jt^FMaM$MNHWYfVN*l) zQbdg#!ENJwGRaeR`94YiYl8!0K_^*~+VIpwcxuy1Md+8%r1YNheM-AMiI*JRz+o)) z;Hwgi2bBelkBx#DkE7U7i-;xJhy$YIbhT};FG!POf~au*PA_NF)sFLOxz%a#J;BWS zd#~}7E^9`?`)NCUx*W1^I`7k^v(5^I6>^;|pyRqXvI^y$6>=k16+DwO&!3qCDO&mx zc!4A^Yq`@bYxV5n3^(*2RhCaXU}@wX$laS!Fk6-r{$e37&s4$QdTT%KBLd*XMwXp6 z<`%Ecr~$WKRxmYfD`;82@Et7DUQILgqzhDc|?uP|-VT9cUUhvN- z<(Q~NY`#|PMHXk=HFXlu0hw0lxN)Z&@h$p==TN`Y-hRZPPHrMw++ zW5iI&EHF>HoDwWuTDnU(x`Os*}YV{seyPlS}TcLMMMEL&BlJ=9c*1ro;dNFtF&itV--eIzYuN& z#dd;rJ8Pu+bX~coc?3W5!?-W;KvZ%7TBd$sBju6OUO}FIVQ(Yofhv(k&-Dv?@WxdZ z>sh&MK8{nbN_v_aS|ft_Z!I%-Ff}1Do7t0FsfeU9Tx}aqd-9dAM2!e zD;uFdr7yG*JwiHz2Fy!}zrwbSgC;tkSAZHX=#_7iZRNJG?KCrI@G5u=Q2L5qEvRwK zVm;9U`!tVemYXw<;(wyNUrGC4+6h&{c2U1U(=)4Ve?t}TT%_2W_XYaeSq{m-CEBmy4$+&O7`^dJxi%sPz3u(*MsOwpv3P`Y{v6e3sWVgS zXr~nsIjn$OR%%z_yi{muqr&yXeT31^VSSbyxst(&p)arGGsN@BLrJwsbwC!&#*BZ5 z#um{^@_gtM{)zP*`j>z!49#emzHuMW1SuX5%5Fv3t=P+8=k*%y!$e&ej&nQCZQ)(M z=K5IvKO()GByIy z{0>62E5QoUYV&LAHCd_kcoR3cw#Z*w4>@{7UCU+SdpPMmJ2B?YV{gG_W53c$yh2oX zCS>sE))Q}c)_1)mU4nk6m8=}llb4cD8NfBx_|mW%k;Q>ox?>KmawzLkYpI^}tyy3* z#>rji_r<99U;2rEvti#^9G5bXA93PtUH{*Ufzu=T8ubYWkdJKpQ%P%|-Y0RsiEmsP zsxQKr?28JIhX&RW_Z9Fj)Y7PYoaiKtOi-DjTH^2C!B?j`C*wO82bB!C;Bg7r%2d%N$03c(nzhc&`Mv>r5p3Q_bge7W5xn`PNddZr9B|+ zrOp!N3VbA5nrlGY61&f7&1W&siC?IJB{qG#vl6vy5NA@~;Coo%0ZRDR`mhq(&eui7 zDJqrof=X)N6K?4T)v{w=$l5^H3Ay7jl&_KOy%YXR@p|CCrsuvt%Bm}@nx47KH*0u^Uu6SsppXT zn0+ipX115b=SX3HtnZGaACu6JDd@-d`i$u5AFyi{daJRz_6becHP00Lgn7_lBzkyj zpSpIJZ}260$6an&HD_f(oeUgceNr8Gj4*IhiQkj>JoR1{%#e{y32~i}ab99#_N=M) zi4Cw2`%#aT5Gc9v{rs0$ho%50fn?dVCVh(ovqu_<_GyWJk|Y!L0l&4L&SISV)w2fw zER5@?QS+oDiMvnU6-U4i)qd@(2}VZGMMySp0ddh+cuD6>o&s5AiH9yP{8pX!P1UXX(m`eV>-NkQhh8 znSroLD7etYM^~=|$874;LOt6O?y zK%!KD&b}{v7TLUm8x8cKHtb29z!z{5o%;28+4xlOs#e(Hn^E4jh`d%7^G4cMAX)or zY6n2pe><;9qEIk7W-Eh#m!;ysUjptFKAeJH z%Zq!xk~afmns~i|%(O|dmpIsd$g33_Rzo|DISCv5!QKbbW{9J#@`y}{U;DioHI|-p zy6OvJ@6B9i%N6=$&e$pD>RDB#Wx(0|f`YW<&ef9sEkS#}JB|B!Ec3$mY*e~ex-XYS z*n_kmOzwOETq_|3&~A@*d3lgs)>=Bxf&NF5A-i5I=|)fjW3IIpN7q`1tpNDau328T zRD!Ayt>VsZ?4=9LPy2R;+*|i#Pbk zYGpOaovRqh5|?GXWyw0rs>=$vswL=?RUA0)z_3u)d8IoqO@_FgcouI&ER?{E5a%|f z$su1dJ1G^k(h0r|cdo~w3N^#CD%T*xF7YXpw2o1onPK7gZ1e@uzG+7HAgfS?tp3 zm-s-5hmQ5?I`r2?a6Kn+cyJsP=Z|2y$4@7BRx;i8o4`YTgVc9Kog4dRj&{S#Xk^TO z%VIzKhXPfnQiGfvx3vg4w~DWyhh!J|mX4?bZNSQcw>!jG8u@Lx=!})LlN<3Bj(xZkDJL zXW zT+r>pCNEZlJ*dHTsKFSvYy`VWizq5}Q`H@ch)U36grEoEeR~RewkN$Oe_$M~y?w$L z61t&7@+O2AsDWjxsYZi~#4K}hM)6d!L(dmY9o%lo7|09XR}7%mxG5(e`@%g<8(^$9yr``g4-(04|KrYO+6 z5rM}X>J#3H7D;{hUl!m(NSHsvMB)4ql$GegFTei_UBzk6;qOTXNSe;1h&ljoDa4(! zPeWf{GeYmpAj;09@hsz$(N3;d6dr>n15@u#l9UjhT@qHw89elwGH6_&p^FMX^%I@_ zS&Aqh%QZ;Uc{y0$s{?E^z6+#d4sHgxg{bg_ls6#d)x1iQ<v5%<7RwA`7(lPsEx? zvQYRcQO^V2fvm4mU^xmL0@!g=C^!8R zJ<`*mFerm_IE#hD$fJAIPlyIDgZG-KHjxfH(4jW`V4DV=k~u?b3Uz4lM7C5G$qxrg z

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 literal 0 HcmV?d00001 diff --git a/firmware/ADRV9030_RxGainTable.csv b/firmware/ADRV9030_RxGainTable.csv new file mode 100644 index 0000000000000..41e5b74330803 --- /dev/null +++ b/firmware/ADRV9030_RxGainTable.csv @@ -0,0 +1,259 @@ +Version,2,12,1,4 +Checksum,3032671981,0,0,0 +Gain Index,FE Control Word,Ext Control,Phase Offset,Digital Gain +0,0,0,0,0 +1,0,0,0,0 +2,0,0,0,0 +3,0,0,0,0 +4,0,0,0,0 +5,0,0,0,0 +6,0,0,0,0 +7,0,0,0,0 +8,0,0,0,0 +9,0,0,0,0 +10,0,0,0,0 +11,0,0,0,0 +12,0,0,0,0 +13,0,0,0,0 +14,0,0,0,0 +15,0,0,0,0 +16,0,0,0,0 +17,0,0,0,0 +18,0,0,0,0 +19,0,0,0,0 +20,0,0,0,0 +21,0,0,0,0 +22,0,0,0,0 +23,0,0,0,0 +24,0,0,0,0 +25,0,0,0,0 +26,0,0,0,0 +27,0,0,0,0 +28,0,0,0,0 +29,0,0,0,0 +30,0,0,0,0 +31,0,0,0,0 +32,0,0,0,0 +33,0,0,0,0 +34,0,0,0,0 +35,0,0,0,0 +36,0,0,0,0 +37,0,0,0,0 +38,0,0,0,0 +39,0,0,0,0 +40,0,0,0,0 +41,0,0,0,0 +42,0,0,0,0 +43,0,0,0,0 +44,0,0,0,0 +45,0,0,0,0 +46,0,0,0,0 +47,0,0,0,0 +48,0,0,0,0 +49,0,0,0,0 +50,0,0,0,0 +51,0,0,0,0 +52,0,0,0,0 +53,0,0,0,0 +54,0,0,0,0 +55,0,0,0,0 +56,0,0,0,0 +57,0,0,0,0 +58,0,0,0,0 +59,0,0,0,0 +60,0,0,0,0 +61,0,0,0,0 +62,0,0,0,0 +63,0,0,0,0 +64,0,0,0,0 +65,0,0,0,0 +66,0,0,0,0 +67,0,0,0,0 +68,0,0,0,0 +69,0,0,0,0 +70,0,0,0,0 +71,0,0,0,0 +72,0,0,0,0 +73,0,0,0,0 +74,0,0,0,0 +75,0,0,0,0 +76,0,0,0,0 +77,0,0,0,0 +78,0,0,0,0 +79,0,0,0,0 +80,0,0,0,0 +81,0,0,0,0 +82,0,0,0,0 +83,0,0,0,0 +84,0,0,0,0 +85,0,0,0,0 +86,0,0,0,0 +87,0,0,0,0 +88,0,0,0,0 +89,0,0,0,0 +90,0,0,0,0 +91,0,0,0,0 +92,0,0,0,0 +93,0,0,0,0 +94,0,0,0,0 +95,0,0,0,0 +96,0,0,0,0 +97,0,0,0,0 +98,0,0,0,0 +99,0,0,0,0 +100,0,0,0,0 +101,0,0,0,0 +102,0,0,0,0 +103,0,0,0,0 +104,0,0,0,0 +105,0,0,0,0 +106,0,0,0,0 +107,0,0,0,0 +108,0,0,0,0 +109,0,0,0,0 +110,0,0,0,0 +111,0,0,0,0 +112,0,0,0,0 +113,0,0,0,0 +114,0,0,0,0 +115,0,0,0,0 +116,0,0,0,0 +117,0,0,0,0 +118,0,0,0,0 +119,0,0,0,0 +120,0,0,0,0 +121,0,0,0,0 +122,0,0,0,0 +123,0,0,0,0 +124,0,0,0,0 +125,0,0,0,0 +126,0,0,0,0 +127,0,0,0,0 +128,0,0,0,0 +129,0,0,0,0 +130,0,0,0,0 +131,0,0,0,0 +132,0,0,0,0 +133,0,0,0,0 +134,0,0,0,0 +135,0,0,0,0 +136,0,0,0,0 +137,0,0,0,0 +138,0,0,0,0 +139,0,0,0,0 +140,0,0,0,0 +141,0,0,0,0 +142,0,0,0,0 +143,0,0,0,0 +144,0,0,0,0 +145,0,0,0,0 +146,0,0,0,0 +147,0,0,0,0 +148,0,0,0,0 +149,0,0,0,0 +150,0,0,0,0 +151,0,0,0,0 +152,0,0,0,0 +153,0,0,0,0 +154,0,0,0,0 +155,0,0,0,0 +156,0,0,0,0 +157,0,0,0,0 +158,0,0,0,0 +159,0,0,0,0 +160,0,0,0,0 +161,0,0,0,0 +162,0,0,0,0 +163,0,0,0,0 +164,0,0,0,0 +165,0,0,0,0 +166,0,0,0,0 +167,0,0,0,0 +168,0,0,0,0 +169,0,0,0,0 +170,0,0,0,0 +171,0,0,0,0 +172,0,0,0,0 +173,0,0,0,0 +174,0,0,0,0 +175,0,0,0,0 +176,0,0,0,0 +177,0,0,0,0 +178,0,0,0,0 +179,0,0,0,0 +180,0,0,0,0 +181,0,0,0,0 +182,0,0,0,0 +183,251,0,0,-20 +184,251,0,0,-10 +185,251,0,0,0 +186,251,0,0,10 +187,250,0,0,-17 +188,250,0,0,-7 +189,250,0,0,3 +190,250,0,0,13 +191,249,0,0,-9 +192,249,0,0,1 +193,249,0,0,11 +194,248,0,0,-4 +195,248,0,0,6 +196,247,0,0,-11 +197,247,0,0,-1 +198,247,0,0,9 +199,246,0,0,0 +200,246,0,0,10 +201,245,0,0,0 +202,244,0,0,-5 +203,244,0,0,5 +204,243,0,0,0 +205,242,0,0,-3 +206,241,0,0,-6 +207,241,0,0,4 +208,240,0,0,3 +209,239,0,0,0 +210,238,0,0,0 +211,237,0,0,0 +212,236,0,0,1 +213,235,0,0,2 +214,234,0,0,4 +215,232,0,0,-1 +216,231,0,0,0 +217,229,0,0,-3 +218,228,0,0,1 +219,226,0,0,-1 +220,225,0,0,3 +221,223,0,0,1 +222,221,0,0,1 +223,219,0,0,1 +224,216,0,0,-2 +225,214,0,0,-1 +226,212,0,0,1 +227,209,0,0,0 +228,206,0,0,-1 +229,203,0,0,-1 +230,200,0,0,0 +231,197,0,0,0 +232,193,0,0,0 +233,189,0,0,-1 +234,185,0,0,-1 +235,181,0,0,0 +236,176,0,0,-1 +237,172,0,0,1 +238,166,0,0,-1 +239,161,0,0,0 +240,155,0,0,0 +241,149,0,0,0 +242,142,0,0,0 +243,135,0,0,0 +244,127,0,0,-1 +245,119,0,0,0 +246,111,0,0,0 +247,101,0,0,0 +248,91,0,0,0 +249,81,0,0,0 +250,70,0,0,0 +251,57,0,0,0 +252,45,0,0,0 +253,31,0,0,0 +254,16,0,0,0 +255,0,0,0,0 diff --git a/firmware/ADRV9030_RxGainTable_GainCompensated.csv b/firmware/ADRV9030_RxGainTable_GainCompensated.csv new file mode 100644 index 0000000000000..cc59d1c2e1cc4 --- /dev/null +++ b/firmware/ADRV9030_RxGainTable_GainCompensated.csv @@ -0,0 +1,259 @@ +Version,2,12,1,4 +Checksum,963198120,0,0,0 +Gain Index,FE Control Word,Ext Control,Phase Offset,Digital Gain +0,0,0,0,0 +1,0,0,0,0 +2,0,0,0,0 +3,0,0,0,0 +4,0,0,0,0 +5,0,0,0,0 +6,0,0,0,0 +7,0,0,0,0 +8,0,0,0,0 +9,0,0,0,0 +10,0,0,0,0 +11,0,0,0,0 +12,0,0,0,0 +13,0,0,0,0 +14,0,0,0,0 +15,0,0,0,0 +16,0,0,0,0 +17,0,0,0,0 +18,0,0,0,0 +19,0,0,0,0 +20,0,0,0,0 +21,0,0,0,0 +22,0,0,0,0 +23,0,0,0,0 +24,0,0,0,0 +25,0,0,0,0 +26,0,0,0,0 +27,0,0,0,0 +28,0,0,0,0 +29,0,0,0,0 +30,0,0,0,0 +31,0,0,0,0 +32,0,0,0,0 +33,0,0,0,0 +34,0,0,0,0 +35,0,0,0,0 +36,0,0,0,0 +37,0,0,0,0 +38,0,0,0,0 +39,0,0,0,0 +40,0,0,0,0 +41,0,0,0,0 +42,0,0,0,0 +43,0,0,0,0 +44,0,0,0,0 +45,0,0,0,0 +46,0,0,0,0 +47,0,0,0,0 +48,0,0,0,0 +49,0,0,0,0 +50,0,0,0,0 +51,0,0,0,0 +52,0,0,0,0 +53,0,0,0,0 +54,0,0,0,0 +55,0,0,0,0 +56,0,0,0,0 +57,0,0,0,0 +58,0,0,0,0 +59,0,0,0,0 +60,0,0,0,0 +61,0,0,0,0 +62,0,0,0,0 +63,0,0,0,0 +64,0,0,0,0 +65,0,0,0,0 +66,0,0,0,0 +67,0,0,0,0 +68,0,0,0,0 +69,0,0,0,0 +70,0,0,0,0 +71,0,0,0,0 +72,0,0,0,0 +73,0,0,0,0 +74,0,0,0,0 +75,0,0,0,0 +76,0,0,0,0 +77,0,0,0,0 +78,0,0,0,0 +79,0,0,0,0 +80,0,0,0,0 +81,0,0,0,0 +82,0,0,0,0 +83,0,0,0,0 +84,0,0,0,0 +85,0,0,0,0 +86,0,0,0,0 +87,0,0,0,0 +88,0,0,0,0 +89,0,0,0,0 +90,0,0,0,0 +91,0,0,0,0 +92,0,0,0,0 +93,0,0,0,0 +94,0,0,0,0 +95,0,0,0,0 +96,0,0,0,0 +97,0,0,0,0 +98,0,0,0,0 +99,0,0,0,0 +100,0,0,0,0 +101,0,0,0,0 +102,0,0,0,0 +103,0,0,0,0 +104,0,0,0,0 +105,0,0,0,0 +106,0,0,0,0 +107,0,0,0,0 +108,0,0,0,0 +109,0,0,0,0 +110,0,0,0,0 +111,0,0,0,0 +112,0,0,0,0 +113,0,0,0,0 +114,0,0,0,0 +115,0,0,0,0 +116,0,0,0,0 +117,0,0,0,0 +118,0,0,0,0 +119,0,0,0,0 +120,0,0,0,0 +121,0,0,0,0 +122,0,0,0,0 +123,0,0,0,0 +124,0,0,0,0 +125,0,0,0,0 +126,0,0,0,0 +127,0,0,0,0 +128,0,0,0,0 +129,0,0,0,0 +130,0,0,0,0 +131,0,0,0,0 +132,0,0,0,0 +133,0,0,0,0 +134,0,0,0,0 +135,0,0,0,0 +136,0,0,0,0 +137,0,0,0,0 +138,0,0,0,0 +139,0,0,0,0 +140,0,0,0,0 +141,0,0,0,0 +142,0,0,0,0 +143,0,0,0,0 +144,0,0,0,0 +145,0,0,0,0 +146,0,0,0,0 +147,0,0,0,0 +148,0,0,0,0 +149,0,0,0,0 +150,0,0,0,0 +151,0,0,0,0 +152,0,0,0,0 +153,0,0,0,0 +154,0,0,0,0 +155,0,0,0,0 +156,0,0,0,0 +157,0,0,0,0 +158,0,0,0,0 +159,0,0,0,0 +160,0,0,0,0 +161,0,0,0,0 +162,0,0,0,0 +163,0,0,0,0 +164,0,0,0,0 +165,0,0,0,0 +166,0,0,0,0 +167,0,0,0,0 +168,0,0,0,0 +169,0,0,0,0 +170,0,0,0,0 +171,0,0,0,0 +172,0,0,0,0 +173,0,0,0,0 +174,0,0,0,0 +175,0,0,0,0 +176,0,0,0,0 +177,0,0,0,0 +178,0,0,0,0 +179,0,0,0,0 +180,0,0,0,0 +181,0,0,0,0 +182,0,0,0,0 +183,252,0,0,0 +184,252,0,0,725 +185,251,0,0,681 +186,251,0,0,682 +187,251,0,0,682 +188,251,0,0,681 +189,250,0,0,647 +190,250,0,0,647 +191,250,0,0,647 +192,249,0,0,617 +193,249,0,0,617 +194,248,0,0,592 +195,248,0,0,592 +196,247,0,0,568 +197,247,0,0,568 +198,246,0,0,549 +199,246,0,0,549 +200,245,0,0,531 +201,245,0,0,531 +202,244,0,0,515 +203,243,0,0,500 +204,242,0,0,487 +205,242,0,0,487 +206,241,0,0,474 +207,240,0,0,463 +208,239,0,0,452 +209,238,0,0,442 +210,237,0,0,432 +211,236,0,0,423 +212,234,0,0,406 +213,233,0,0,398 +214,232,0,0,390 +215,230,0,0,376 +216,229,0,0,369 +217,227,0,0,357 +218,226,0,0,351 +219,224,0,0,340 +220,222,0,0,330 +221,220,0,0,320 +222,218,0,0,311 +223,215,0,0,297 +224,213,0,0,289 +225,210,0,0,277 +226,208,0,0,270 +227,205,0,0,260 +228,202,0,0,250 +229,199,0,0,241 +230,195,0,0,229 +231,192,0,0,221 +232,188,0,0,212 +233,184,0,0,203 +234,180,0,0,193 +235,175,0,0,183 +236,170,0,0,173 +237,165,0,0,163 +238,160,0,0,154 +239,154,0,0,145 +240,148,0,0,135 +241,142,0,0,126 +242,135,0,0,117 +243,128,0,0,108 +244,120,0,0,99 +245,112,0,0,89 +246,104,0,0,81 +247,94,0,0,71 +248,85,0,0,62 +249,75,0,0,53 +250,64,0,0,44 +251,53,0,0,35 +252,41,0,0,27 +253,28,0,0,18 +254,14,0,0,9 +255,0,0,0,0 diff --git a/firmware/ADRV9030_RxGainTable_HB.csv b/firmware/ADRV9030_RxGainTable_HB.csv new file mode 100644 index 0000000000000..e5534bd267d09 --- /dev/null +++ b/firmware/ADRV9030_RxGainTable_HB.csv @@ -0,0 +1,259 @@ +Version,2,12,1,4 +Checksum,3032671981,0,0,0 +Gain Index,FE Control Word,Ext Control,Phase Offset,Digital Gain +0,0,0,0,0 +1,0,0,0,0 +2,0,0,0,0 +3,0,0,0,0 +4,0,0,0,0 +5,0,0,0,0 +6,0,0,0,0 +7,0,0,0,0 +8,0,0,0,0 +9,0,0,0,0 +10,0,0,0,0 +11,0,0,0,0 +12,0,0,0,0 +13,0,0,0,0 +14,0,0,0,0 +15,0,0,0,0 +16,0,0,0,0 +17,0,0,0,0 +18,0,0,0,0 +19,0,0,0,0 +20,0,0,0,0 +21,0,0,0,0 +22,0,0,0,0 +23,0,0,0,0 +24,0,0,0,0 +25,0,0,0,0 +26,0,0,0,0 +27,0,0,0,0 +28,0,0,0,0 +29,0,0,0,0 +30,0,0,0,0 +31,0,0,0,0 +32,0,0,0,0 +33,0,0,0,0 +34,0,0,0,0 +35,0,0,0,0 +36,0,0,0,0 +37,0,0,0,0 +38,0,0,0,0 +39,0,0,0,0 +40,0,0,0,0 +41,0,0,0,0 +42,0,0,0,0 +43,0,0,0,0 +44,0,0,0,0 +45,0,0,0,0 +46,0,0,0,0 +47,0,0,0,0 +48,0,0,0,0 +49,0,0,0,0 +50,0,0,0,0 +51,0,0,0,0 +52,0,0,0,0 +53,0,0,0,0 +54,0,0,0,0 +55,0,0,0,0 +56,0,0,0,0 +57,0,0,0,0 +58,0,0,0,0 +59,0,0,0,0 +60,0,0,0,0 +61,0,0,0,0 +62,0,0,0,0 +63,0,0,0,0 +64,0,0,0,0 +65,0,0,0,0 +66,0,0,0,0 +67,0,0,0,0 +68,0,0,0,0 +69,0,0,0,0 +70,0,0,0,0 +71,0,0,0,0 +72,0,0,0,0 +73,0,0,0,0 +74,0,0,0,0 +75,0,0,0,0 +76,0,0,0,0 +77,0,0,0,0 +78,0,0,0,0 +79,0,0,0,0 +80,0,0,0,0 +81,0,0,0,0 +82,0,0,0,0 +83,0,0,0,0 +84,0,0,0,0 +85,0,0,0,0 +86,0,0,0,0 +87,0,0,0,0 +88,0,0,0,0 +89,0,0,0,0 +90,0,0,0,0 +91,0,0,0,0 +92,0,0,0,0 +93,0,0,0,0 +94,0,0,0,0 +95,0,0,0,0 +96,0,0,0,0 +97,0,0,0,0 +98,0,0,0,0 +99,0,0,0,0 +100,0,0,0,0 +101,0,0,0,0 +102,0,0,0,0 +103,0,0,0,0 +104,0,0,0,0 +105,0,0,0,0 +106,0,0,0,0 +107,0,0,0,0 +108,0,0,0,0 +109,0,0,0,0 +110,0,0,0,0 +111,0,0,0,0 +112,0,0,0,0 +113,0,0,0,0 +114,0,0,0,0 +115,0,0,0,0 +116,0,0,0,0 +117,0,0,0,0 +118,0,0,0,0 +119,0,0,0,0 +120,0,0,0,0 +121,0,0,0,0 +122,0,0,0,0 +123,0,0,0,0 +124,0,0,0,0 +125,0,0,0,0 +126,0,0,0,0 +127,0,0,0,0 +128,0,0,0,0 +129,0,0,0,0 +130,0,0,0,0 +131,0,0,0,0 +132,0,0,0,0 +133,0,0,0,0 +134,0,0,0,0 +135,0,0,0,0 +136,0,0,0,0 +137,0,0,0,0 +138,0,0,0,0 +139,0,0,0,0 +140,0,0,0,0 +141,0,0,0,0 +142,0,0,0,0 +143,0,0,0,0 +144,0,0,0,0 +145,0,0,0,0 +146,0,0,0,0 +147,0,0,0,0 +148,0,0,0,0 +149,0,0,0,0 +150,0,0,0,0 +151,0,0,0,0 +152,0,0,0,0 +153,0,0,0,0 +154,0,0,0,0 +155,0,0,0,0 +156,0,0,0,0 +157,0,0,0,0 +158,0,0,0,0 +159,0,0,0,0 +160,0,0,0,0 +161,0,0,0,0 +162,0,0,0,0 +163,0,0,0,0 +164,0,0,0,0 +165,0,0,0,0 +166,0,0,0,0 +167,0,0,0,0 +168,0,0,0,0 +169,0,0,0,0 +170,0,0,0,0 +171,0,0,0,0 +172,0,0,0,0 +173,0,0,0,0 +174,0,0,0,0 +175,0,0,0,0 +176,0,0,0,0 +177,0,0,0,0 +178,0,0,0,0 +179,0,0,0,0 +180,0,0,0,0 +181,0,0,0,0 +182,0,0,0,0 +183,251,0,0,-20 +184,251,0,0,-10 +185,251,0,0,-2 +186,251,0,0,8 +187,250,0,0,-17 +188,250,0,0,-7 +189,250,0,0,3 +190,250,0,0,13 +191,249,0,0,-7 +192,249,0,0,3 +193,249,0,0,13 +194,248,0,0,0 +195,248,0,0,10 +196,247,0,0,-11 +197,247,0,0,-1 +198,247,0,0,9 +199,246,0,0,0 +200,246,0,0,10 +201,245,0,0,0 +202,244,0,0,-5 +203,244,0,0,5 +204,243,0,0,0 +205,242,0,0,-3 +206,241,0,0,-6 +207,241,0,0,4 +208,240,0,0,3 +209,239,0,0,0 +210,238,0,0,0 +211,237,0,0,0 +212,236,0,0,1 +213,235,0,0,2 +214,234,0,0,4 +215,232,0,0,-1 +216,231,0,0,0 +217,229,0,0,-3 +218,228,0,0,1 +219,226,0,0,-1 +220,225,0,0,3 +221,223,0,0,1 +222,221,0,0,1 +223,219,0,0,1 +224,216,0,0,-2 +225,214,0,0,-1 +226,212,0,0,1 +227,209,0,0,0 +228,206,0,0,-1 +229,203,0,0,-1 +230,200,0,0,0 +231,197,0,0,0 +232,193,0,0,0 +233,189,0,0,-1 +234,185,0,0,-1 +235,181,0,0,0 +236,176,0,0,-1 +237,172,0,0,1 +238,166,0,0,-1 +239,161,0,0,0 +240,155,0,0,0 +241,149,0,0,0 +242,142,0,0,0 +243,135,0,0,0 +244,127,0,0,-1 +245,119,0,0,0 +246,111,0,0,0 +247,101,0,0,0 +248,91,0,0,0 +249,81,0,0,0 +250,70,0,0,0 +251,57,0,0,0 +252,45,0,0,0 +253,31,0,0,0 +254,16,0,0,0 +255,0,0,0,0 diff --git a/firmware/ADRV9030_stream_image.bin b/firmware/ADRV9030_stream_image.bin new file mode 100644 index 0000000000000000000000000000000000000000..e6258d3f101fbb89bb77dcc9d8ef8ff1a00d0e8c GIT binary patch literal 90112 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 literal 0 HcmV?d00001 diff --git a/firmware/ADRV903X_stream_image.bin b/firmware/ADRV903X_stream_image.bin new file mode 100644 index 0000000000000000000000000000000000000000..a2ab7d8a39267e8e8c43994a0778f1455afedf53 GIT binary patch literal 90112 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 Date: Mon, 15 Dec 2025 11:55:20 +0200 Subject: [PATCH 3/6] drivers: iio: adc: Add ADRV903X support Add driver files for ADRV903X and add option to makefiles. Signed-off-by: George Mois --- drivers/iio/adc/Kconfig | 12 + drivers/iio/adc/Makefile | 2 + drivers/iio/adc/adrv903x/Makefile | 72 + drivers/iio/adc/adrv903x/adrv903x.c | 3404 +++++++++++++++++ drivers/iio/adc/adrv903x/adrv903x.h | 219 ++ drivers/iio/adc/adrv903x/adrv903x_conv.c | 246 ++ .../adrv903x/platforms/adi_library_types.h | 34 +- .../iio/adc/adrv903x/platforms/adi_platform.c | 6 + .../adrv903x/platforms/adi_platform_types.h | 41 + .../adc/adrv903x/platforms/linux_platform.c | 891 +---- .../adc/adrv903x/platforms/linux_platform.h | 249 ++ drivers/iio/frequency/cf_axi_dds.c | 10 + include/dt-bindings/iio/adc/adi,adrv903x.h | 21 + 13 files changed, 4525 insertions(+), 682 deletions(-) create mode 100644 drivers/iio/adc/adrv903x/Makefile create mode 100644 drivers/iio/adc/adrv903x/adrv903x.c create mode 100644 drivers/iio/adc/adrv903x/adrv903x.h create mode 100644 drivers/iio/adc/adrv903x/adrv903x_conv.c create mode 100644 drivers/iio/adc/adrv903x/platforms/linux_platform.h create mode 100644 include/dt-bindings/iio/adc/adi,adrv903x.h diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index 3b2a85bf9d942..ec791c2294e23 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -650,6 +650,18 @@ config ADRV9025 To compile this driver as a module, choose M here: the module will be called adrv9025_drv. +config ADRV903X + tristate "Analog Devices ADRV903X/ADRV9030 RF Transceiver driver" + depends on SPI + select CF_AXI_ADC + help + Say yes here to build support for Analog Devices: + ADRV903X/ADRV9030 RF Transceivers. Provides direct access + via sysfs. + + To compile this driver as a module, choose M here: the module will be + called adrv903x_drv. + config AD6676 tristate "Analog Devices AD6676 Wideband IF Receiver driver" depends on SPI diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile index 8f14ea9cd3f36..75c11c6449f8e 100644 --- a/drivers/iio/adc/Makefile +++ b/drivers/iio/adc/Makefile @@ -114,6 +114,8 @@ obj-$(CONFIG_ADRV9009) += adrv9009_drv.o obj-$(CONFIG_ADRV9025) += adrv902x/ +obj-$(CONFIG_ADRV903X) += adrv903x/ + obj-$(CONFIG_ADRV9001) += navassa/ obj-$(CONFIG_AD9680) += ad9680.o diff --git a/drivers/iio/adc/adrv903x/Makefile b/drivers/iio/adc/adrv903x/Makefile new file mode 100644 index 0000000000000..c75a247ca066a --- /dev/null +++ b/drivers/iio/adc/adrv903x/Makefile @@ -0,0 +1,72 @@ +adrv903x_drv-y = \ + devices/adrv903x/private/src/adrv903x_tx.o \ + devices/adrv903x/private/src/adrv903x_reg_addr_macros.o \ + devices/adrv903x/private/src/adrv903x_binloader.o \ + devices/adrv903x/private/src/adrv903x_cpu.o \ + devices/adrv903x/private/src/adrv903x_shared_resource_manager.o \ + devices/adrv903x/private/src/adrv903x_agc.o \ + devices/adrv903x/private/src/adrv903x_rx.o \ + devices/adrv903x/private/src/adrv903x_radioctrl.o \ + devices/adrv903x/private/src/adrv903x_datainterface.o \ + devices/adrv903x/private/src/adrv903x_struct_endian.o \ + devices/adrv903x/private/src/adrv903x_gpio.o \ + devices/adrv903x/private/src/adrv903x_init.o \ + devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_phy_regmap_core1p2.o \ + devices/adrv903x/private/bf/adrv903x_bf_actrl_orx_west_regmap.o \ + devices/adrv903x/private/bf/adrv903x_bf_streamproc.o \ + devices/adrv903x/private/bf/adrv903x_bf_rx_ddc.o \ + devices/adrv903x/private/bf/adrv903x_bf_jrx_link.o \ + devices/adrv903x/private/bf/adrv903x_bf_core.o \ + devices/adrv903x/private/bf/adrv903x_bf_orx_dig.o \ + devices/adrv903x/private/bf/adrv903x_bf_rx_dig.o \ + devices/adrv903x/private/bf/adrv903x_bf_tx_datapath.o \ + devices/adrv903x/private/bf/adrv903x_bf_tx_funcs.o \ + devices/adrv903x/private/bf/adrv903x_bf_tdr_dpath_top.o \ + devices/adrv903x/private/bf/adrv903x_bf_pll_mem_map.o \ + devices/adrv903x/private/bf/adrv903x_bf_serdes_rxdig_8pack_regmap_core1p2.o \ + devices/adrv903x/private/bf/adrv903x_bf_serdes_txdig_phy_regmap_core1p2.o \ + devices/adrv903x/private/bf/adrv903x_bf_jtx_link.o \ + devices/adrv903x/private/bf/adrv903x_bf_rx_funcs.o \ + devices/adrv903x/private/bf/adrv903x_bf_jesd_common.o \ + devices/adrv903x/private/bf/adrv903x_bf_tx_dig.o \ + devices/adrv903x/public/src/adi_adrv903x_error.o \ + devices/adrv903x/public/src/adi_adrv903x_tx.o \ + devices/adrv903x/public/src/adi_adrv903x_hal.o \ + devices/adrv903x/public/src/adi_adrv903x_cals.o \ + devices/adrv903x/public/src/adi_adrv903x_gpio.o \ + devices/adrv903x/public/src/adi_adrv903x_radioctrl.o \ + devices/adrv903x/public/src/adi_adrv903x_cpu.o \ + devices/adrv903x/public/src/adi_adrv903x_datainterface.o \ + devices/adrv903x/public/src/adi_adrv903x_agc.o \ + devices/adrv903x/public/src/adi_adrv903x_rx.o \ + devices/adrv903x/public/src/adi_adrv903x_core.o \ + devices/adrv903x/public/src/adi_adrv903x_utilities.o \ + common/adi_logging/adi_common_log.o \ + common/adi_error/adi_common_error.o \ + common/adi_hal/adi_common_hal.o \ + platforms/linux_platform.o \ + platforms/adi_library.o \ + platforms/adi_platform.o \ + initdata.o \ + adrv903x.o \ + adrv903x_conv.o + +ccflags-y += -I$(srctree)/$(src)/devices/adrv903x/private/include/ \ + -I$(srctree)/$(src)/devices/adrv903x/public/include/ \ + -I$(srctree)/$(src)/devices/adrv903x/multiver/ \ + -I$(srctree)/$(src)/common/ \ + -I$(srctree)/$(src)/common/adi_libc/ \ + -I$(srctree)/$(src)/common/adi_hal/ \ + -I$(srctree)/$(src)/common/adi_error/ \ + -I$(srctree)/$(src)/common/adi_logging/ \ + -I$(srctree)/$(src)/platforms/ \ + -DADI_COMMON_VERBOSE=1 \ + -DADRV903X_CHANNELID_CHECK=0 \ + -DADI_ADRV903X_RADIOCTRL_RANGE_CHECK=1 \ + -DADRV903X_BITFIELD_ADDR_CHECK=0 \ + -DADRV903X_BITFIELD_NULL_CHECK=0 \ + -DADRV903X_BITFIELD_VALUE_CHECK=0 \ + -Wno-error=missing-prototypes + +obj-$(CONFIG_ADRV903X) += adrv903x_drv.o + diff --git a/drivers/iio/adc/adrv903x/adrv903x.c b/drivers/iio/adc/adrv903x/adrv903x.c new file mode 100644 index 0000000000000..491a99bcfc3a4 --- /dev/null +++ b/drivers/iio/adc/adrv903x/adrv903x.c @@ -0,0 +1,3404 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ADRV903X RF Transceiver + * + * Copyright 2020-2025 Analog Devices Inc. + * + * Licensed under the GPL-2. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include + +#include "adrv903x.h" +#include "initdata.h" + +#define ADI_FILE ADI_COMMON_FILE_HAL + +enum adrv903x_iio_dev_attr { + ADRV903X_INIT_CAL, + ADRV903X_CAL_MASK_RX, + ADRV903X_CAL_MASK_TX, + ADRV903X_CAL_MASK_ORX, + ADRV903X_JESD204_FSM_ERROR, + ADRV903X_JESD204_FSM_PAUSED, + ADRV903X_JESD204_FSM_STATE, + ADRV903X_JESD204_FSM_RESUME, + ADRV903X_JESD204_FSM_CTRL, +}; + +static int __adrv903x_dev_err(struct adrv903x_rf_phy *phy, const char *function, + const int line) +{ + int ret = 0; + + dev_err(&phy->spi->dev, "%s, %d: failed with %s (%d)\n", function, line, + phy->palauDevice->common.errPtr->errDebugInfo.errCause, + phy->palauDevice->common.errPtr->errDebugInfo.highestPriorityAction); + + switch (phy->palauDevice->common.errPtr->errDebugInfo.highestPriorityAction) { + case ADI_COMMON_ERR_ACT_CHECK_PARAM: + ret = -EINVAL; + break; + case ADI_COMMON_ERR_ACT_RESET_FEATURE: + ret = -EFAULT; + break; + case ADI_COMMON_ERR_ACT_CHECK_INTERFACE: + ret = -EIO; + break; + case ADI_COMMON_ERR_ACT_NONE: + ret = 0; + break; + default: + ret = -EFAULT; + } + + adi_common_ErrClear(phy->palauDevice->common.errPtr); + + return ret; +} + +#define adrv903x_dev_err(phy) __adrv903x_dev_err(phy, __func__, __LINE__) + +int adrv903x_spi_read(struct spi_device *spi, unsigned int reg) +{ + unsigned char buf[3]; + int ret; + + buf[0] = 0x80 | (reg >> 8); + buf[1] = reg & 0xFF; + ret = spi_write_then_read(spi, &buf[0], 2, &buf[2], 1); + + dev_dbg(&spi->dev, "%s: REG: 0x%X VAL: 0x%X (%d)\n", __func__, reg, + buf[2], ret); + + if (ret < 0) { + dev_err(&spi->dev, "%s: failed (%d)\n", __func__, ret); + return ret; + } + + return buf[2]; +} + +int adrv903x_spi_write(struct spi_device *spi, unsigned int reg, unsigned int val) +{ + unsigned char buf[3]; + int ret; + + buf[0] = reg >> 8; + buf[1] = reg & 0xFF; + buf[2] = val; + + ret = spi_write_then_read(spi, buf, 3, NULL, 0); + if (ret < 0) { + dev_err(&spi->dev, "%s: failed (%d)\n", __func__, ret); + return ret; + } + + dev_dbg(&spi->dev, "%s: REG: 0x%X VAL: 0x%X (%d)\n", __func__, reg, val, + ret); + + return 0; +} + +/* + * Helper function to find the sampling rate for a specific deframer + * Returns recovery action required. + */ +static int adrv903x_TxLinkSamplingRateFind(adi_adrv903x_Device_t *device, + adi_adrv903x_DeframerSel_e deframerSel, + u32 *iqRate_kHz) +{ + int recoveryAction = ADI_COMMON_ERR_ACT_NONE; + u32 deframerIndex = 0; + u32 rate; + + /* Check device pointer is not null */ + ADI_NULL_DEVICE_PTR_RETURN(device); + ADI_NULL_PTR_RETURN(iqRate_kHz); + + ADI_FUNCTION_ENTRY_LOG(&device->common, ADI_HAL_LOG_API); + + switch (deframerSel) { + case ADI_ADRV903X_DEFRAMER_0: + deframerIndex = 0; + break; + case ADI_ADRV903X_DEFRAMER_1: + deframerIndex = 1; + break; + default: + ADI_ERROR_REPORT(&device->common, ADI_COMMON_ERRSRC_API, + ADI_COMMON_ERRCODE_INVALID_PARAM, + ADI_COMMON_ERR_ACT_CHECK_PARAM, deframerSel, + "Only one deframer can be selected at a time."); + if (device->common.errPtr->errDebugInfo.highestPriorityAction) + return device->common.errPtr->errDebugInfo.highestPriorityAction; + break; + } + + if (device->initExtract.jesdSetting.deframerSetting[deframerIndex].jesdM < 1) { + *iqRate_kHz = 0; + return recoveryAction; + } + + rate = device->initExtract.jesdSetting.deframerSetting[deframerIndex].iqRate_kHz; + + *iqRate_kHz = rate; + + return recoveryAction; +} + +static ssize_t adrv903x_phy_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t len) +{ + struct iio_dev *indio_dev = dev_to_iio_dev(dev); + struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); + struct adrv903x_rf_phy *phy = iio_priv(indio_dev); + bool enable; + int ret = 0; + u64 val; + + mutex_lock(&phy->lock); + + switch ((u32)this_attr->address & 0xFF) { + case ADRV903X_INIT_CAL: + ret = kstrtobool(buf, &enable); + if (ret) + break; + + val = (u64)this_attr->address >> 8; + + if (val) { + if (enable) + phy->cal_mask.calMask |= val; + else + phy->cal_mask.calMask &= ~val; + } else if (enable) { + static const u32 INIT_CALS_TIMEOUT_MS = + 60000; /*60 seconds timeout*/ + + phy->cal_mask.orxChannelMask = + phy->adrv903xPostMcsInitInst.initCals.orxChannelMask; + phy->cal_mask.rxChannelMask = + phy->adrv903xPostMcsInitInst.initCals.rxChannelMask; + phy->cal_mask.txChannelMask = + phy->adrv903xPostMcsInitInst.initCals.txChannelMask; + + /* Run Init Cals */ + ret = adi_adrv903x_InitCalsRun(phy->palauDevice, + &phy->cal_mask); + if (ret) { + ret = adrv903x_dev_err(phy); + break; + } + + ret = adi_adrv903x_InitCalsWait(phy->palauDevice, + INIT_CALS_TIMEOUT_MS); + if (ret) + ret = adrv903x_dev_err(phy); + } + break; + case ADRV903X_CAL_MASK_RX: + ret = kstrtou64(buf, 0, &val); + if (ret) + break; + + if (phy->spi_device_id == ID_ADRV9032R && val & 0xEE) { + ret = -EINVAL; + break; + } + + if (val <= 0xFF) + phy->cal_mask.rxChannelMask = val; + else + ret = -EINVAL; + break; + case ADRV903X_CAL_MASK_TX: + ret = kstrtou64(buf, 0, &val); + if (ret) + break; + + if (phy->spi_device_id == ID_ADRV9032R && val & 0xEE) { + ret = -EINVAL; + break; + } + + if (val <= 0xFF) + phy->cal_mask.txChannelMask = val; + else + ret = -EINVAL; + break; + case ADRV903X_CAL_MASK_ORX: + ret = kstrtou64(buf, 0, &val); + if (ret) + break; + + if (val <= 0x03) + phy->cal_mask.orxChannelMask = val; + else + ret = -EINVAL; + break; + case ADRV903X_JESD204_FSM_RESUME: + if (!phy->jdev) { + ret = -EOPNOTSUPP; + break; + } + + ret = jesd204_fsm_resume(phy->jdev, JESD204_LINKS_ALL); + break; + case ADRV903X_JESD204_FSM_CTRL: + if (!phy->jdev) { + ret = -EOPNOTSUPP; + break; + } + + ret = kstrtobool(buf, &enable); + if (ret) + break; + + if (enable) { + jesd204_fsm_stop(phy->jdev, JESD204_LINKS_ALL); + jesd204_fsm_clear_errors(phy->jdev, JESD204_LINKS_ALL); + ret = jesd204_fsm_start(phy->jdev, JESD204_LINKS_ALL); + } else { + jesd204_fsm_stop(phy->jdev, JESD204_LINKS_ALL); + jesd204_fsm_clear_errors(phy->jdev, JESD204_LINKS_ALL); + ret = 0; + } + + break; + default: + ret = -EINVAL; + } + + mutex_unlock(&phy->lock); + + return ret ? ret : len; +} + +static ssize_t adrv903x_phy_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct iio_dev *indio_dev = dev_to_iio_dev(dev); + struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); + struct adrv903x_rf_phy *phy = iio_priv(indio_dev); + struct jesd204_dev *jdev = phy->jdev; + struct jesd204_link *links[5]; + int ret = 0, i, err, num_links; + bool paused; + u64 val; + + mutex_lock(&phy->lock); + switch ((u32)this_attr->address & 0xFF) { + case ADRV903X_INIT_CAL: + val = this_attr->address >> 8; + + if (val) + ret = sysfs_emit(buf, "%d\n", + !!(phy->cal_mask.calMask & val)); + break; + case ADRV903X_CAL_MASK_RX: + ret = sysfs_emit(buf, "0x%x\n", + phy->cal_mask.rxChannelMask); + break; + case ADRV903X_CAL_MASK_TX: + ret = sysfs_emit(buf, "0x%x\n", + phy->cal_mask.txChannelMask); + break; + case ADRV903X_CAL_MASK_ORX: + ret = sysfs_emit(buf, "0x%x\n", + phy->cal_mask.orxChannelMask); + break; + case ADRV903X_JESD204_FSM_ERROR: + if (!phy->jdev) { + ret = -EOPNOTSUPP; + break; + } + + num_links = jesd204_get_active_links_num(jdev); + if (num_links < 0) { + ret = num_links; + break; + } + + ret = jesd204_get_links_data(jdev, links, num_links); + if (ret) + break; + + err = 0; + for (i = 0; i < num_links; i++) { + if (links[i]->error) { + err = links[i]->error; + break; + } + } + ret = sysfs_emit(buf, "%d\n", err); + break; + case ADRV903X_JESD204_FSM_PAUSED: + if (!phy->jdev) { + ret = -EOPNOTSUPP; + break; + } + + num_links = jesd204_get_active_links_num(jdev); + if (num_links < 0) { + ret = num_links; + break; + } + + ret = jesd204_get_links_data(jdev, links, num_links); + if (ret) + break; + /* + * Take the slowest link; if there are N links and one is paused, all are paused. + * Not sure if this can happen yet, but best design it like this here. + */ + paused = false; + for (i = 0; i < num_links; i++) { + if (jesd204_link_get_paused(links[i])) { + paused = true; + break; + } + } + ret = sysfs_emit(buf, "%d\n", paused); + break; + case ADRV903X_JESD204_FSM_STATE: + if (!phy->jdev) { + ret = -EOPNOTSUPP; + break; + } + + num_links = jesd204_get_active_links_num(jdev); + if (num_links < 0) { + ret = num_links; + break; + } + + ret = jesd204_get_links_data(jdev, links, num_links); + if (ret) + break; + /* + * just get the first link state; we're assuming that all 3 are in sync + * and that ADRV903X_JESD204_FSM_PAUSED was called before + */ + ret = sysfs_emit(buf, "%s\n", jesd204_link_get_state_str(links[0])); + break; + case ADRV903X_JESD204_FSM_CTRL: + if (!phy->jdev) { + ret = -EOPNOTSUPP; + break; + } + + ret = sysfs_emit(buf, "%d\n", phy->is_initialized); + break; + default: + ret = -EINVAL; + } + mutex_unlock(&phy->lock); + + return ret; +} + +static IIO_DEVICE_ATTR(calibrate, 0644, adrv903x_phy_show, + adrv903x_phy_store, ADRV903X_INIT_CAL); + +static IIO_DEVICE_ATTR(calibrate_rx_dc_offset_en, 0644, + adrv903x_phy_show, adrv903x_phy_store, + ADRV903X_INIT_CAL | (ADI_ADRV903X_IC_RX_DC_OFFSET << 8)); + +static IIO_DEVICE_ATTR(calibrate_rx_adc_en, 0644, + adrv903x_phy_show, adrv903x_phy_store, + ADRV903X_INIT_CAL | (ADI_ADRV903X_IC_ADC_RX << 8)); + +static IIO_DEVICE_ATTR(calibrate_orx_adc_en, 0644, + adrv903x_phy_show, adrv903x_phy_store, + ADRV903X_INIT_CAL | (ADI_ADRV903X_IC_ADC_ORX << 8)); + +static IIO_DEVICE_ATTR(calibrate_tx_loopback_en, 0644, + adrv903x_phy_show, adrv903x_phy_store, + ADRV903X_INIT_CAL | (ADI_ADRV903X_IC_ADC_TXLB << 8)); + +static IIO_DEVICE_ATTR(calibrate_tx_dac_en, 0644, + adrv903x_phy_show, adrv903x_phy_store, + ADRV903X_INIT_CAL | (ADI_ADRV903X_IC_TXDAC << 8)); + +static IIO_DEVICE_ATTR(calibrate_tx_bb_filter_en, 0644, + adrv903x_phy_show, adrv903x_phy_store, + ADRV903X_INIT_CAL | (ADI_ADRV903X_IC_TXBBF << 8)); + +static IIO_DEVICE_ATTR(calibrate_tx_loopback_filter_en, 0644, + adrv903x_phy_show, adrv903x_phy_store, + ADRV903X_INIT_CAL | (ADI_ADRV903X_IC_TXLB_FILTER << 8)); + +static IIO_DEVICE_ATTR(calibrate_tx_loopback_path_delay_en, 0644, + adrv903x_phy_show, adrv903x_phy_store, + ADRV903X_INIT_CAL | (ADI_ADRV903X_IC_TXLB_PATH_DLY << 8)); + +static IIO_DEVICE_ATTR(calibrate_tx_hrm_en, 0644, + adrv903x_phy_show, adrv903x_phy_store, + ADRV903X_INIT_CAL | (ADI_ADRV903X_IC_HRM << 8)); + +static IIO_DEVICE_ATTR(calibrate_tx_qec_en, 0644, + adrv903x_phy_show, adrv903x_phy_store, + ADRV903X_INIT_CAL | (ADI_ADRV903X_IC_TXQEC << 8)); + +static IIO_DEVICE_ATTR(calibrate_tx_lol_en, 0644, + adrv903x_phy_show, adrv903x_phy_store, + ADRV903X_INIT_CAL | + (ADI_ADRV903X_IC_TXLOL << 8)); + +static IIO_DEVICE_ATTR(calibrate_mask_rx, 0644, adrv903x_phy_show, + adrv903x_phy_store, ADRV903X_CAL_MASK_RX); + +static IIO_DEVICE_ATTR(calibrate_mask_tx, 0644, adrv903x_phy_show, + adrv903x_phy_store, ADRV903X_CAL_MASK_TX); + +static IIO_DEVICE_ATTR(calibrate_mask_orx, 0644, adrv903x_phy_show, + adrv903x_phy_store, ADRV903X_CAL_MASK_ORX); + +static IIO_DEVICE_ATTR(jesd204_fsm_error, 0444, + adrv903x_phy_show, + NULL, + ADRV903X_JESD204_FSM_ERROR); + +static IIO_DEVICE_ATTR(jesd204_fsm_paused, 0444, + adrv903x_phy_show, + NULL, + ADRV903X_JESD204_FSM_PAUSED); + +static IIO_DEVICE_ATTR(jesd204_fsm_state, 0444, + adrv903x_phy_show, + NULL, + ADRV903X_JESD204_FSM_STATE); + +static IIO_DEVICE_ATTR(jesd204_fsm_resume, 0200, + NULL, + adrv903x_phy_store, + ADRV903X_JESD204_FSM_RESUME); + +static IIO_DEVICE_ATTR(jesd204_fsm_ctrl, 0644, + adrv903x_phy_show, + adrv903x_phy_store, + ADRV903X_JESD204_FSM_CTRL); + +static struct attribute *adrv903x_phy_attributes[] = { + &iio_dev_attr_calibrate.dev_attr.attr, + &iio_dev_attr_calibrate_rx_dc_offset_en.dev_attr.attr, + &iio_dev_attr_calibrate_rx_adc_en.dev_attr.attr, + &iio_dev_attr_calibrate_orx_adc_en.dev_attr.attr, + &iio_dev_attr_calibrate_tx_loopback_en.dev_attr.attr, + &iio_dev_attr_calibrate_tx_dac_en.dev_attr.attr, + &iio_dev_attr_calibrate_tx_bb_filter_en.dev_attr.attr, + &iio_dev_attr_calibrate_tx_loopback_filter_en.dev_attr.attr, + &iio_dev_attr_calibrate_tx_loopback_path_delay_en.dev_attr.attr, + &iio_dev_attr_calibrate_tx_hrm_en.dev_attr.attr, + &iio_dev_attr_calibrate_tx_qec_en.dev_attr.attr, + &iio_dev_attr_calibrate_tx_lol_en.dev_attr.attr, + &iio_dev_attr_calibrate_mask_rx.dev_attr.attr, + &iio_dev_attr_calibrate_mask_tx.dev_attr.attr, + &iio_dev_attr_calibrate_mask_orx.dev_attr.attr, + &iio_dev_attr_jesd204_fsm_error.dev_attr.attr, + &iio_dev_attr_jesd204_fsm_state.dev_attr.attr, + &iio_dev_attr_jesd204_fsm_paused.dev_attr.attr, + &iio_dev_attr_jesd204_fsm_resume.dev_attr.attr, + &iio_dev_attr_jesd204_fsm_ctrl.dev_attr.attr, + NULL, +}; + +static const struct attribute_group adrv903x_phy_attribute_group = { + .attrs = adrv903x_phy_attributes, +}; + +static int adrv903x_phy_reg_access(struct iio_dev *indio_dev, u32 reg, + u32 writeval, u32 *readval) +{ + struct adrv903x_rf_phy *phy = iio_priv(indio_dev); + int ret; + + mutex_lock(&phy->lock); + if (!readval) { + ret = adrv903x_spi_write(phy->spi, reg, writeval); + } else { + *readval = adrv903x_spi_read(phy->spi, reg); + ret = 0; + } + mutex_unlock(&phy->lock); + + return ret; +} + +enum lo_ext_info { + LOEXT_FREQ, +}; + +static ssize_t adrv903x_phy_lo_write(struct iio_dev *indio_dev, + uintptr_t private, + const struct iio_chan_spec *chan, + const char *buf, size_t len) +{ + struct adrv903x_rf_phy *phy = iio_priv(indio_dev); + adi_adrv903x_LoConfig_t loConfig = { 0 }; + int ret = 0; + u64 readin; + + switch (private) { + case LOEXT_FREQ: + + ret = kstrtoull(buf, 10, &readin); + if (ret) + return ret; + + loConfig.loFrequency_Hz = readin; + loConfig.loName = ADI_ADRV903X_LO0 + chan->channel; + + mutex_lock(&phy->lock); + + ret = adi_adrv903x_LoFrequencySet(phy->palauDevice, &loConfig); + if (ret) + ret = adrv903x_dev_err(phy); + break; + default: + ret = -EINVAL; + break; + } + + mutex_unlock(&phy->lock); + + return ret ? ret : len; +} + +static ssize_t adrv903x_phy_lo_read(struct iio_dev *indio_dev, + uintptr_t private, + const struct iio_chan_spec *chan, char *buf) +{ + struct adrv903x_rf_phy *phy = iio_priv(indio_dev); + adi_adrv903x_LoConfigReadback_t loConfig = { 0 }; + int ret; + + mutex_lock(&phy->lock); + switch (private) { + case LOEXT_FREQ: + loConfig.loName = ADI_ADRV903X_LO0 + chan->channel; + ret = adi_adrv903x_LoFrequencyGet(phy->palauDevice, &loConfig); + if (ret) + ret = adrv903x_dev_err(phy); + break; + default: + ret = 0; + } + mutex_unlock(&phy->lock); + + return ret ? ret : sysfs_emit(buf, "%llu\n", loConfig.loFrequency_Hz); +} + +#define _ADRV903X_EXT_LO_INFO(_name, _ident) \ + { \ + .name = _name, .read = adrv903x_phy_lo_read, \ + .write = adrv903x_phy_lo_write, .private = _ident, \ + } + +static const struct iio_chan_spec_ext_info adrv903x_phy_ext_lo_info[] = { + /* Ideally we use IIO_CHAN_INFO_FREQUENCY, but there are + * values > 2^32 in order to support the entire frequency range + * in Hz. Using scale is a bit ugly. + */ + _ADRV903X_EXT_LO_INFO("frequency", LOEXT_FREQ), + {}, +}; + +/* Helper function to populate rxNcoConfig structure with stored values */ +static void adrv903x_populate_rx_nco_config(struct adrv903x_rf_phy *phy, + adi_adrv903x_RxNcoConfig_t *rxNcoConfig, + u8 channel) +{ + rxNcoConfig->chanSelect = ADI_ADRV903X_RX0 << channel; + rxNcoConfig->enable = phy->rx_nco_en[channel]; + rxNcoConfig->bandSelect = phy->rx_nco_band_sel[channel]; + rxNcoConfig->frequencyKhz = phy->rx_nco_freq_khz[channel]; + rxNcoConfig->phase = phy->rx_nco_phase[channel]; +} + +/* Helper function to populate orxNcoConfig structure with stored values */ +static void adrv903x_populate_orx_nco_config(struct adrv903x_rf_phy *phy, + adi_adrv903x_ORxNcoConfig_t *orxNcoConfig, + u8 orx_channel) +{ + orxNcoConfig->chanSelect = ADI_ADRV903X_ORX0 << orx_channel; + orxNcoConfig->enable = phy->orx_nco_en[orx_channel]; + orxNcoConfig->ncoSelect = phy->orx_nco_sel[orx_channel]; + orxNcoConfig->frequencyKhz = phy->orx_nco_freq_khz[orx_channel]; + orxNcoConfig->phase = phy->orx_nco_phase[orx_channel]; +} + +static ssize_t adrv903x_phy_rx_write(struct iio_dev *indio_dev, + uintptr_t private, + const struct iio_chan_spec *chan, + const char *buf, size_t len) +{ + struct adrv903x_rf_phy *phy = iio_priv(indio_dev); + + adi_adrv903x_TrackingCalibrationMask_t calMask = 0; + bool enable; + int ret = 0; + u32 mask; + s32 val; + + switch (private) { + case RX_NCO_FREQ: + case RX_NCO_PHASE: + case RX_NCO_BAND_SEL: + case ORX_NCO_FREQ: + case ORX_NCO_PHASE: + case ORX_NCO_SEL: + ret = kstrtos32(buf, 0, &val); + if (ret) + return ret; + break; + default: + ret = kstrtobool(buf, &enable); + if (ret) + return ret; + break; + } + + mutex_lock(&phy->lock); + + switch (private) { + case RX_QEC: + if (chan->channel <= CHAN_RX8) { + mask = ADI_ADRV903X_RX0 << chan->channel; + calMask = ADI_ADRV903X_TC_RX_QEC_MASK; + + ret = adi_adrv903x_TrackingCalsEnableSet(phy->palauDevice, calMask, + mask, + enable ? ADI_ADRV903X_TRACKING_CAL_ENABLE : + ADI_ADRV903X_TRACKING_CAL_DISABLE); + if (ret) + ret = adrv903x_dev_err(phy); + } + break; + case RX_DIG_DC: + if (chan->channel <= CHAN_RX8) { + mask = ADI_ADRV903X_RX0 << chan->channel; + + ret = adi_adrv903x_DigDcOffsetEnableSet(phy->palauDevice, mask, + enable ? 0xFF : 0x00); + if (ret) + ret = adrv903x_dev_err(phy); + } + break; + case RX_ADC: + if (chan->channel <= CHAN_RX8) { + mask = ADI_ADRV903X_RX0 << chan->channel; + calMask = ADI_ADRV903X_TC_RX_ADC_MASK; + + ret = adi_adrv903x_TrackingCalsEnableSet(phy->palauDevice, calMask, + mask, + enable ? ADI_ADRV903X_TRACKING_CAL_ENABLE : + ADI_ADRV903X_TRACKING_CAL_DISABLE); + if (ret) + ret = adrv903x_dev_err(phy); + } else { + mask = chan->channel - CHAN_RX8; + calMask = ADI_ADRV903X_TC_ORX_ADC_MASK; + + ret = adi_adrv903x_TrackingCalsEnableSet(phy->palauDevice, calMask, + mask, + enable ? ADI_ADRV903X_TRACKING_CAL_ENABLE : + ADI_ADRV903X_TRACKING_CAL_DISABLE); + if (ret) + ret = adrv903x_dev_err(phy); + } + break; + case RX_NCO_EN: + if (chan->channel <= CHAN_RX8) { + adi_adrv903x_RxNcoConfig_t rxNcoConfig = { 0 }; + + adrv903x_populate_rx_nco_config(phy, &rxNcoConfig, chan->channel); + rxNcoConfig.enable = enable; + + ret = adi_adrv903x_RxNcoShifterSet(phy->palauDevice, &rxNcoConfig); + if (ret) + ret = adrv903x_dev_err(phy); + else + phy->rx_nco_en[chan->channel] = enable; + } else { + ret = -EINVAL; + } + break; + case RX_NCO_FREQ: + if (chan->channel <= CHAN_RX8) { + adi_adrv903x_RxNcoConfig_t rxNcoConfigFreq = { 0 }; + + phy->rx_nco_freq_khz[chan->channel] = val; + + if (phy->rx_nco_en[chan->channel]) { + adrv903x_populate_rx_nco_config(phy, &rxNcoConfigFreq, chan->channel); + rxNcoConfigFreq.frequencyKhz = val; + + ret = adi_adrv903x_RxNcoShifterSet(phy->palauDevice, &rxNcoConfigFreq); + if (ret) + ret = adrv903x_dev_err(phy); + } + } else { + ret = -EINVAL; + } + break; + case RX_NCO_PHASE: + if (chan->channel <= CHAN_RX8) { + adi_adrv903x_RxNcoConfig_t rxNcoConfigPhase = { 0 }; + + if (val < 0 || val > 359) { + ret = -EINVAL; + break; + } + + phy->rx_nco_phase[chan->channel] = val; + + if (phy->rx_nco_en[chan->channel]) { + adrv903x_populate_rx_nco_config(phy, &rxNcoConfigPhase, chan->channel); + rxNcoConfigPhase.phase = val; + + ret = adi_adrv903x_RxNcoShifterSet(phy->palauDevice, &rxNcoConfigPhase); + if (ret) + ret = adrv903x_dev_err(phy); + } + } else { + ret = -EINVAL; + } + break; + case RX_NCO_BAND_SEL: + if (chan->channel <= CHAN_RX8) { + adi_adrv903x_RxNcoConfig_t rxNcoConfigBand = { 0 }; + + if (val < 0 || val > 1) { + ret = -EINVAL; + break; + } + + phy->rx_nco_band_sel[chan->channel] = val; + + if (phy->rx_nco_en[chan->channel]) { + adrv903x_populate_rx_nco_config(phy, &rxNcoConfigBand, chan->channel); + rxNcoConfigBand.bandSelect = val; + + ret = adi_adrv903x_RxNcoShifterSet(phy->palauDevice, &rxNcoConfigBand); + if (ret) + ret = adrv903x_dev_err(phy); + } + } else { + ret = -EINVAL; + } + break; + case ORX_NCO_EN: + if (chan->channel > CHAN_RX8) { + adi_adrv903x_ORxNcoConfig_t orxNcoConfig = { 0 }; + u8 orx_idx = chan->channel - CHAN_OBS_RX1; + + adrv903x_populate_orx_nco_config(phy, &orxNcoConfig, orx_idx); + orxNcoConfig.enable = enable; + + ret = adi_adrv903x_OrxNcoSet_v2(phy->palauDevice, &orxNcoConfig); + if (ret) + ret = adrv903x_dev_err(phy); + else + phy->orx_nco_en[orx_idx] = enable; + } else { + ret = -EINVAL; + } + break; + case ORX_NCO_FREQ: + if (chan->channel > CHAN_RX8) { + adi_adrv903x_ORxNcoConfig_t orxNcoConfigFreq = { 0 }; + u8 orx_idx = chan->channel - CHAN_OBS_RX1; + + phy->orx_nco_freq_khz[orx_idx] = val; + + if (phy->orx_nco_en[orx_idx]) { + adrv903x_populate_orx_nco_config(phy, &orxNcoConfigFreq, orx_idx); + orxNcoConfigFreq.frequencyKhz = val; + + ret = adi_adrv903x_OrxNcoSet_v2(phy->palauDevice, &orxNcoConfigFreq); + if (ret) + ret = adrv903x_dev_err(phy); + } + } else { + ret = -EINVAL; + } + break; + case ORX_NCO_PHASE: + if (chan->channel > CHAN_RX8) { + adi_adrv903x_ORxNcoConfig_t orxNcoConfigPhase = { 0 }; + u8 orx_idx = chan->channel - CHAN_OBS_RX1; + + if (val < 0 || val > 359) { + ret = -EINVAL; + break; + } + + phy->orx_nco_phase[orx_idx] = val; + + if (phy->orx_nco_en[orx_idx]) { + adrv903x_populate_orx_nco_config(phy, &orxNcoConfigPhase, orx_idx); + orxNcoConfigPhase.phase = val; + + ret = adi_adrv903x_OrxNcoSet_v2(phy->palauDevice, &orxNcoConfigPhase); + if (ret) + ret = adrv903x_dev_err(phy); + } + } else { + ret = -EINVAL; + } + break; + case ORX_NCO_SEL: + if (chan->channel > CHAN_RX8) { + adi_adrv903x_ORxNcoConfig_t orxNcoConfigSel = { 0 }; + u8 orx_idx = chan->channel - CHAN_OBS_RX1; + + if (val < 0 || val > 1) { + ret = -EINVAL; + break; + } + + phy->orx_nco_sel[orx_idx] = val; + + if (phy->orx_nco_en[orx_idx]) { + adrv903x_populate_orx_nco_config(phy, &orxNcoConfigSel, orx_idx); + orxNcoConfigSel.ncoSelect = val; + + ret = adi_adrv903x_OrxNcoSet_v2(phy->palauDevice, &orxNcoConfigSel); + if (ret) + ret = adrv903x_dev_err(phy); + } + } else { + ret = -EINVAL; + } + break; + default: + ret = -EINVAL; + } + + mutex_unlock(&phy->lock); + + return ret ? ret : len; +} + +static ssize_t adrv903x_phy_rx_read(struct iio_dev *indio_dev, + uintptr_t private, + const struct iio_chan_spec *chan, char *buf) +{ + struct adrv903x_rf_phy *phy = iio_priv(indio_dev); + adi_adrv903x_TrackingCalEnableMasks_t enableMasks; + adi_adrv903x_TrackingCalibrationMask_t chan_cals; + u8 isEnabled; + int ret = 0; + u32 mask; + + mutex_lock(&phy->lock); + + switch (private) { + case RX_QEC: + if (chan->channel <= CHAN_RX8) { + ret = adi_adrv903x_TrackingCalsEnableGet(phy->palauDevice, &enableMasks); + if (ret == 0) { + chan_cals = enableMasks.enableMask[chan->channel]; + ret = sysfs_emit(buf, "%d\n", + !!(chan_cals & ADI_ADRV903X_TC_RX_QEC_MASK)); + } + } + break; + case RX_DIG_DC: + mask = ADI_ADRV903X_RX0 << chan->channel; + ret = adi_adrv903x_DigDcOffsetEnableGet(phy->palauDevice, mask, &isEnabled); + + if (ret == 0) + ret = sysfs_emit(buf, "%d\n", isEnabled); + else + ret = adrv903x_dev_err(phy); + break; + case RX_RF_BANDWIDTH: + if (chan->channel <= CHAN_RX8) + ret = sysfs_emit(buf, "%u\n", + phy->adi_adrv903x_device.initExtract.rx.rxChannelCfg[chan->channel].rfBandwidth_kHz * + 1000); + else + ret = sysfs_emit(buf, "%u\n", + phy->adi_adrv903x_device.initExtract.orx.orxChannelCfg[chan->channel - CHAN_OBS_RX1].rfBandwidth_kHz * + 1000); + break; + case RX_ADC: + if (chan->channel <= CHAN_RX8) { + ret = adi_adrv903x_TrackingCalsEnableGet(phy->palauDevice, &enableMasks); + if (ret == 0) { + chan_cals = enableMasks.enableMask[chan->channel]; + ret = sysfs_emit(buf, "%d\n", + !!(chan_cals & ADI_ADRV903X_TC_RX_ADC_MASK)); + } + } else { + ret = adi_adrv903x_TrackingCalsEnableGet(phy->palauDevice, &enableMasks); + if (ret == 0) { + chan_cals = enableMasks.enableMask[chan->channel - CHAN_OBS_RX1]; + ret = sysfs_emit(buf, "%d\n", + !!(chan_cals & ADI_ADRV903X_TC_ORX_ADC_MASK)); + } + } + break; + case RX_NCO_EN: + if (chan->channel <= CHAN_RX8) + ret = sysfs_emit(buf, "%d\n", phy->rx_nco_en[chan->channel]); + else + ret = -EINVAL; + break; + case RX_NCO_FREQ: + if (chan->channel <= CHAN_RX8) + ret = sysfs_emit(buf, "%d\n", phy->rx_nco_freq_khz[chan->channel]); + else + ret = -EINVAL; + break; + case RX_NCO_PHASE: + if (chan->channel <= CHAN_RX8) + ret = sysfs_emit(buf, "%d\n", phy->rx_nco_phase[chan->channel]); + else + ret = -EINVAL; + break; + case RX_NCO_BAND_SEL: + if (chan->channel <= CHAN_RX8) + ret = sysfs_emit(buf, "%d\n", phy->rx_nco_band_sel[chan->channel]); + else + ret = -EINVAL; + break; + case ORX_NCO_EN: + if (chan->channel > CHAN_RX8) + ret = sysfs_emit(buf, "%d\n", phy->orx_nco_en[chan->channel - CHAN_OBS_RX1]); + else + ret = -EINVAL; + break; + case ORX_NCO_FREQ: + if (chan->channel > CHAN_RX8) + ret = sysfs_emit(buf, "%d\n", phy->orx_nco_freq_khz[chan->channel - CHAN_OBS_RX1]); + else + ret = -EINVAL; + break; + case ORX_NCO_PHASE: + if (chan->channel > CHAN_RX8) + ret = sysfs_emit(buf, "%d\n", phy->orx_nco_phase[chan->channel - CHAN_OBS_RX1]); + else + ret = -EINVAL; + break; + case ORX_NCO_SEL: + if (chan->channel > CHAN_RX8) + ret = sysfs_emit(buf, "%d\n", phy->orx_nco_sel[chan->channel - CHAN_OBS_RX1]); + else + ret = -EINVAL; + break; + default: + ret = -EINVAL; + } + + mutex_unlock(&phy->lock); + + return ret; +} + +#define _ADRV903X_EXT_RX_INFO(_name, _ident) \ + { \ + .name = _name, .read = adrv903x_phy_rx_read, \ + .write = adrv903x_phy_rx_write, .private = _ident, \ + } + +static ssize_t adrv903x_phy_tx_read(struct iio_dev *indio_dev, + uintptr_t private, + const struct iio_chan_spec *chan, char *buf) +{ + struct adrv903x_rf_phy *phy = iio_priv(indio_dev); + adi_adrv903x_TrackingCalEnableMasks_t enableMasks[ADI_ADRV903X_NUM_TRACKING_CAL_CHANNELS] = { 0 }; + adi_adrv903x_TrackingCalibrationMask_t chan_cals; + int val, ret = 0; + + if (chan->channel > CHAN_TX8) + return -EINVAL; + + mutex_lock(&phy->lock); + switch (private) { + case TX_QEC: + ret = adi_adrv903x_TrackingCalsEnableGet(phy->palauDevice, enableMasks); + if (ret == 0) { + chan_cals = enableMasks->enableMask[chan->channel]; + val = !!(chan_cals & ADI_ADRV903X_TC_TX_QEC_MASK); + } + break; + case TX_LOL: + ret = adi_adrv903x_TrackingCalsEnableGet(phy->palauDevice, enableMasks); + if (ret == 0) { + chan_cals = enableMasks->enableMask[chan->channel]; + val = !!(chan_cals & ADI_ADRV903X_TC_TX_LOL_MASK); + } + break; + case TX_RF_BANDWIDTH: + val = phy->adi_adrv903x_device.initExtract.tx.txChannelCfg[chan->channel] + .rfBandwidth_kHz * 1000; + break; + case TX_LB_ADC: + ret = adi_adrv903x_TrackingCalsEnableGet(phy->palauDevice, enableMasks); + if (ret == 0) { + chan_cals = enableMasks->enableMask[chan->channel]; + val = !!(chan_cals & ADI_ADRV903X_TC_TX_LB_ADC_MASK); + } + break; + case TX_TEST_TONE_EN: + /* Store test tone enable state in phy structure */ + val = phy->tx_test_tone_en[chan->channel]; + break; + case TX_TEST_TONE_FREQ: + val = phy->tx_test_tone_freq_khz[chan->channel]; + break; + case TX_TEST_TONE_PHASE: + val = phy->tx_test_tone_phase[chan->channel]; + break; + case TX_TEST_TONE_NCO_SEL: + val = phy->tx_test_tone_nco_sel[chan->channel]; + break; + case TX_TEST_TONE_ATTEN: + val = phy->tx_test_tone_atten[chan->channel]; + break; + default: + ret = -EINVAL; + } + + mutex_unlock(&phy->lock); + + if (ret == 0) + ret = sysfs_emit(buf, "%d\n", val); + else + return adrv903x_dev_err(phy); + + return ret; +} + +static void adrv903x_populate_tx_nco_config(struct adrv903x_rf_phy *phy, + adi_adrv903x_TxTestNcoConfig_t *txNcoConfig, + u8 channel) +{ + txNcoConfig->chanSelect = ADI_ADRV903X_TX0 << channel; + txNcoConfig->enable = phy->tx_test_tone_en[channel]; + txNcoConfig->ncoSelect = phy->tx_test_tone_nco_sel[channel]; + txNcoConfig->frequencyKhz = phy->tx_test_tone_freq_khz[channel] ?: 10000; + txNcoConfig->phase = phy->tx_test_tone_phase[channel]; + txNcoConfig->attenCtrl = phy->tx_test_tone_atten[channel]; +} + +static ssize_t adrv903x_phy_tx_write(struct iio_dev *indio_dev, + uintptr_t private, + const struct iio_chan_spec *chan, + const char *buf, size_t len) +{ + adi_adrv903x_TrackingCalibrationMask_t calMask = 0; + struct adrv903x_rf_phy *phy = iio_priv(indio_dev); + bool enable; + int ret = 0; + u64 mask; + u32 val; + + if (chan->channel > CHAN_TX8) + return -EINVAL; + + switch (private) { + case TX_TEST_TONE_FREQ: + case TX_TEST_TONE_PHASE: + case TX_TEST_TONE_NCO_SEL: + case TX_TEST_TONE_ATTEN: + ret = kstrtou32(buf, 0, &val); + if (ret) + return ret; + break; + default: + ret = kstrtobool(buf, &enable); + if (ret) + return ret; + break; + } + + mutex_lock(&phy->lock); + + switch (private) { + case TX_QEC: + mask = ADI_ADRV903X_TX0 << chan->channel; + calMask = ADI_ADRV903X_TC_TX_QEC_MASK; + + ret = adi_adrv903x_TrackingCalsEnableSet(phy->palauDevice, calMask, + mask, + enable ? ADI_ADRV903X_TRACKING_CAL_ENABLE : + ADI_ADRV903X_TRACKING_CAL_DISABLE); + if (ret) + ret = adrv903x_dev_err(phy); + break; + case TX_LOL: + mask = ADI_ADRV903X_TX0 << chan->channel; + calMask = ADI_ADRV903X_TC_TX_LOL_MASK; + + adi_adrv903x_ChannelTrackingCals_t channelMask = { 0 }; + + channelMask.txChannel = mask; + + ret = adi_adrv903x_TxToOrxMappingSet(phy->palauDevice, 0x50); + if (ret) + ret = adrv903x_dev_err(phy); + + ret = adi_adrv903x_TrackingCalsEnableSet(phy->palauDevice, calMask, + mask, + enable ? ADI_ADRV903X_TRACKING_CAL_ENABLE : + ADI_ADRV903X_TRACKING_CAL_DISABLE); + if (ret) + ret = adrv903x_dev_err(phy); + break; + case TX_LB_ADC: + mask = ADI_ADRV903X_TX0 << chan->channel; + calMask = ADI_ADRV903X_TC_TX_LB_ADC_MASK; + + ret = adi_adrv903x_TrackingCalsEnableSet(phy->palauDevice, calMask, + mask, + enable ? ADI_ADRV903X_TRACKING_CAL_ENABLE : + ADI_ADRV903X_TRACKING_CAL_DISABLE); + if (ret) + ret = adrv903x_dev_err(phy); + break; + case TX_TEST_TONE_EN: + adi_adrv903x_TxTestNcoConfig_t txNcoConfig = { 0 }; + + adrv903x_populate_tx_nco_config(phy, &txNcoConfig, chan->channel); + txNcoConfig.enable = enable; + + ret = adi_adrv903x_TxTestToneSet(phy->palauDevice, &txNcoConfig); + if (ret) + ret = adrv903x_dev_err(phy); + else + phy->tx_test_tone_en[chan->channel] = enable; + break; + case TX_TEST_TONE_FREQ: + adi_adrv903x_TxTestNcoConfig_t txNcoConfigFreq = { 0 }; + + phy->tx_test_tone_freq_khz[chan->channel] = val; + + if (phy->tx_test_tone_en[chan->channel]) { + adrv903x_populate_tx_nco_config(phy, &txNcoConfigFreq, chan->channel); + txNcoConfigFreq.frequencyKhz = val; + + ret = adi_adrv903x_TxTestToneSet(phy->palauDevice, &txNcoConfigFreq); + if (ret) + ret = adrv903x_dev_err(phy); + } + break; + case TX_TEST_TONE_PHASE: + adi_adrv903x_TxTestNcoConfig_t txNcoConfigPhase = { 0 }; + + if (val > 359) { + ret = -EINVAL; + break; + } + + phy->tx_test_tone_phase[chan->channel] = val; + + if (phy->tx_test_tone_en[chan->channel]) { + adrv903x_populate_tx_nco_config(phy, &txNcoConfigPhase, chan->channel); + txNcoConfigPhase.phase = val; + + ret = adi_adrv903x_TxTestToneSet(phy->palauDevice, &txNcoConfigPhase); + if (ret) + ret = adrv903x_dev_err(phy); + } + break; + case TX_TEST_TONE_NCO_SEL: + adi_adrv903x_TxTestNcoConfig_t txNcoConfigNco = { 0 }; + + if (val > 1) { + ret = -EINVAL; + break; + } + + phy->tx_test_tone_nco_sel[chan->channel] = val; + + if (phy->tx_test_tone_en[chan->channel]) { + adrv903x_populate_tx_nco_config(phy, &txNcoConfigNco, chan->channel); + txNcoConfigNco.ncoSelect = val; + + ret = adi_adrv903x_TxTestToneSet(phy->palauDevice, &txNcoConfigNco); + if (ret) + ret = adrv903x_dev_err(phy); + } + break; + case TX_TEST_TONE_ATTEN: + adi_adrv903x_TxTestNcoConfig_t txNcoConfigAtten = { 0 }; + + if (val > 8) { + ret = -EINVAL; + break; + } + + phy->tx_test_tone_atten[chan->channel] = val; + + if (phy->tx_test_tone_en[chan->channel]) { + adrv903x_populate_tx_nco_config(phy, &txNcoConfigAtten, chan->channel); + txNcoConfigAtten.attenCtrl = val; + + ret = adi_adrv903x_TxTestToneSet(phy->palauDevice, &txNcoConfigAtten); + if (ret) + ret = adrv903x_dev_err(phy); + } + break; + default: + ret = -EINVAL; + } + + mutex_unlock(&phy->lock); + + return ret ? ret : len; +} + +#define _ADRV903X_EXT_TX_INFO(_name, _ident) \ + { \ + .name = _name, .read = adrv903x_phy_tx_read, \ + .write = adrv903x_phy_tx_write, .private = _ident, \ + } + +static const struct iio_chan_spec_ext_info adrv903x_phy_rx_ext_info[] = { + /* Ideally we use IIO_CHAN_INFO_FREQUENCY, but there are + * values > 2^32 in order to support the entire frequency range + * in Hz. Using scale is a bit ugly. + */ + _ADRV903X_EXT_RX_INFO("quadrature_tracking_en", RX_QEC), + _ADRV903X_EXT_RX_INFO("bb_dc_offset_tracking_en", RX_DIG_DC), + _ADRV903X_EXT_RX_INFO("rf_bandwidth", RX_RF_BANDWIDTH), + _ADRV903X_EXT_RX_INFO("adc_tracking_en", RX_ADC), + _ADRV903X_EXT_RX_INFO("nco_en", RX_NCO_EN), + _ADRV903X_EXT_RX_INFO("nco_frequency_khz", RX_NCO_FREQ), + _ADRV903X_EXT_RX_INFO("nco_phase_degrees", RX_NCO_PHASE), + _ADRV903X_EXT_RX_INFO("nco_band_select", RX_NCO_BAND_SEL), + {}, +}; + +static const struct iio_chan_spec_ext_info adrv903x_phy_obs_rx_ext_info[] = { + /* Ideally we use IIO_CHAN_INFO_FREQUENCY, but there are + * values > 2^32 in order to support the entire frequency range + * in Hz. Using scale is a bit ugly. + */ + _ADRV903X_EXT_RX_INFO("rf_bandwidth", RX_RF_BANDWIDTH), + _ADRV903X_EXT_RX_INFO("adc_tracking_en", RX_ADC), + _ADRV903X_EXT_RX_INFO("nco_en", ORX_NCO_EN), + _ADRV903X_EXT_RX_INFO("nco_frequency_khz", ORX_NCO_FREQ), + _ADRV903X_EXT_RX_INFO("nco_phase_degrees", ORX_NCO_PHASE), + _ADRV903X_EXT_RX_INFO("nco_select", ORX_NCO_SEL), + {}, +}; + +static struct iio_chan_spec_ext_info adrv903x_phy_tx_ext_info[] = { + _ADRV903X_EXT_TX_INFO("quadrature_tracking_en", TX_QEC), + _ADRV903X_EXT_TX_INFO("lo_leakage_tracking_en", TX_LOL), + _ADRV903X_EXT_TX_INFO("rf_bandwidth", TX_RF_BANDWIDTH), + _ADRV903X_EXT_TX_INFO("loopback_adc_tracking_en", TX_LB_ADC), + _ADRV903X_EXT_TX_INFO("test_tone_en", TX_TEST_TONE_EN), + _ADRV903X_EXT_TX_INFO("test_tone_frequency_khz", TX_TEST_TONE_FREQ), + _ADRV903X_EXT_TX_INFO("test_tone_phase_degrees", TX_TEST_TONE_PHASE), + _ADRV903X_EXT_TX_INFO("test_tone_nco_select", TX_TEST_TONE_NCO_SEL), + _ADRV903X_EXT_TX_INFO("test_tone_attenuation", TX_TEST_TONE_ATTEN), + {}, +}; + +static int adrv903x_gainindex_to_gain(struct adrv903x_rf_phy *phy, int channel, + unsigned int index, int *val, int *val2) +{ + int code; + + code = MAX_RX_GAIN_mdB - (255 - index) * RX_GAIN_STEP_mdB; + + *val = code / 1000; + *val2 = (code % 1000) * 1000; + if (!*val) + *val2 *= -1; + + return 0; +} + +static int adrv903x_gain_to_gainindex(struct adrv903x_rf_phy *phy, int channel, + int val, int val2, unsigned int *index) +{ + int gain = ((abs(val) * 1000) + (abs(val2) / 1000)); + + gain = clamp(gain, MIN_GAIN_mdB, MAX_RX_GAIN_mdB); + *index = (gain - MAX_RX_GAIN_mdB) / RX_GAIN_STEP_mdB + 255; + + return 0; +} + +static int adrv903x_phy_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, int *val, + int *val2, long m) +{ + adi_adrv903x_DevTempSensorMask_e avg_mask = ADI_ADRV903X_DEVTEMP_MASK_TX0; + struct adrv903x_rf_phy *phy = iio_priv(indio_dev); + u32 orxchan = 0, rxchan = 0, txchan = 0; + adi_adrv903x_DevTempData_t temp = { 0 }; + int ret; + + mutex_lock(&phy->lock); + switch (m) { + case IIO_CHAN_INFO_ENABLE: + ret = adi_adrv903x_RxTxEnableGet(phy->palauDevice, &orxchan, &rxchan, + &txchan); + if (ret) { + ret = adrv903x_dev_err(phy); + break; + } + + if (chan->output) + *val = !!(txchan & (ADI_ADRV903X_TX0 << chan->channel)); + else if (chan->channel <= CHAN_RX8) + *val = !!(rxchan & (ADI_ADRV903X_RX0 << chan->channel)); + else + *val = !!(orxchan & (ADI_ADRV903X_RX0 << chan->channel)); + + ret = IIO_VAL_INT; + break; + case IIO_CHAN_INFO_HARDWAREGAIN: + if (chan->output) { + adi_adrv903x_TxAtten_t txAtten; + + ret = adi_adrv903x_TxAttenGet(phy->palauDevice, + 1 << chan->channel, &txAtten); + if (ret) { + ret = adrv903x_dev_err(phy); + break; + } + + *val = -1 * (txAtten.txAttenuation_mdB / 1000); + *val2 = (txAtten.txAttenuation_mdB % 1000) * 1000; + if (!*val) + *val2 *= -1; + + } else { + if (chan->channel <= CHAN_RX8) { + adi_adrv903x_RxGain_t rxGain; + + ret = adi_adrv903x_RxGainGet(phy->palauDevice, + 1 << chan->channel, &rxGain); + if (ret) { + ret = adrv903x_dev_err(phy); + break; + } + + ret = adrv903x_gainindex_to_gain(phy, chan->channel, + rxGain.gainIndex, val, + val2); + } else { + u8 attenDb = 0; + + ret = adi_adrv903x_OrxAttenGet(phy->palauDevice, chan->channel - CHAN_OBS_RX1, &attenDb); + if (ret) { + ret = adrv903x_dev_err(phy); + break; + } + *val = attenDb; + } + } + ret = IIO_VAL_INT_PLUS_MICRO_DB; + break; + case IIO_CHAN_INFO_SAMP_FREQ: + switch (chan->channel) { + case CHAN_RX1: + case CHAN_RX2: + case CHAN_RX3: + case CHAN_RX4: + case CHAN_RX5: + case CHAN_RX6: + case CHAN_RX7: + case CHAN_RX8: + *val = clk_get_rate(phy->clks[RX_SAMPL_CLK]); + break; + case CHAN_OBS_RX1: + case CHAN_OBS_RX2: + *val = clk_get_rate(phy->clks[OBS_SAMPL_CLK]); + break; + } + + ret = IIO_VAL_INT; + break; + case IIO_CHAN_INFO_PROCESSED: + adi_adrv903x_TemperatureGet(phy->palauDevice, avg_mask, &temp); + *val = (temp.tempDegreesCelsius[avg_mask] * 1000); + ret = IIO_VAL_INT; + break; + default: + ret = -EINVAL; + } + + mutex_unlock(&phy->lock); + + return ret; +}; + +static int adrv903x_phy_write_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, int val, + int val2, long mask) +{ + u32 orxchan_msk = 0, rxchan_msk = 0, txchan_msk = 0; + struct adrv903x_rf_phy *phy = iio_priv(indio_dev); + u32 orxchan_en = 0, rxchan_en = 0, txchan_en = 0; + int ret = 0; + u32 code; + + mutex_lock(&phy->lock); + switch (mask) { + case IIO_CHAN_INFO_ENABLE: + ret = adi_adrv903x_RxTxEnableGet(phy->palauDevice, &orxchan_msk, &rxchan_msk, + &txchan_msk); + if (ret) { + ret = adrv903x_dev_err(phy); + goto out; + } + + pr_err("chans are orx 0x%X rx 0x%X tx 0x%X\n", orxchan_msk, rxchan_msk, txchan_msk); + + txchan_msk = 0; + rxchan_msk = 0; + orxchan_msk = 0; + if (chan->output) { + txchan_msk = (1 << chan->channel); + if (val) + txchan_en |= (ADI_ADRV903X_TX0 << chan->channel); + else + txchan_en &= ~(ADI_ADRV903X_TX0 << chan->channel); + } else { + if (chan->channel <= CHAN_RX8) { + rxchan_msk = (1 << chan->channel); + if (val) + rxchan_en |= (ADI_ADRV903X_RX0 << chan->channel); + else + rxchan_en &= ~(ADI_ADRV903X_RX0 << chan->channel); + } else { + orxchan_msk = (1 << chan->channel); + if (val) + orxchan_en |= (ADI_ADRV903X_RX0 << chan->channel); + else + orxchan_en &= ~(ADI_ADRV903X_RX0 << chan->channel); + } + } + + pr_err("chans to write are orx 0x%X rx 0x%X tx 0x%X\n", orxchan_msk, rxchan_msk, txchan_msk); + ret = adi_adrv903x_RxTxEnableSet(phy->palauDevice, orxchan_msk, orxchan_en, rxchan_msk, rxchan_en, + txchan_msk, txchan_en); + if (ret) + ret = adrv903x_dev_err(phy); + break; + + case IIO_CHAN_INFO_HARDWAREGAIN: + if (chan->output) { + adi_adrv903x_TxAtten_t txAtten; + + if (val > 0 || (val == 0 && val2 > 0)) { + ret = -EINVAL; + goto out; + } + + code = ((abs(val) * 1000) + (abs(val2) / 1000)); + + txAtten.txChannelMask = 1 << chan->channel; + txAtten.txAttenuation_mdB = + code; /* Back off Tx output power by 30dB */ + ret = adi_adrv903x_TxAttenSet(phy->palauDevice, &txAtten, + 1); + if (ret) + adrv903x_dev_err(phy); + + } else { + if (chan->channel <= CHAN_RX8) { + adi_adrv903x_RxGain_t rxGain; + + ret = adrv903x_gain_to_gainindex(phy, chan->channel, + val, val2, &code); + if (ret < 0) + break; + + if (chan->channel <= CHAN_RX8) { + rxGain.gainIndex = code; + rxGain.rxChannelMask = 1 << chan->channel; + + ret = adi_adrv903x_RxGainSet(phy->palauDevice, &rxGain, 1); + if (ret) + adrv903x_dev_err(phy); + } + } else { + u8 attenDb = val; + + ret = adi_adrv903x_OrxAttenSet(phy->palauDevice, + chan->channel - CHAN_RX8, attenDb); + if (ret) + adrv903x_dev_err(phy); + } + } + break; + case IIO_CHAN_INFO_SAMP_FREQ: + break; + default: + ret = -EINVAL; + } +out: + mutex_unlock(&phy->lock); + + return ret; +} + +static const struct iio_chan_spec adrv903x_phy_chan[] = { + { + /* LO1 */ + .type = IIO_ALTVOLTAGE, + .indexed = 1, + .output = 1, + .channel = 0, + .extend_name = "LO1", + .ext_info = adrv903x_phy_ext_lo_info, + }, + { + /* LO2 */ + .type = IIO_ALTVOLTAGE, + .indexed = 1, + .output = 1, + .channel = 1, + .extend_name = "LO2", + .ext_info = adrv903x_phy_ext_lo_info, + }, + { + /* TX1 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .output = 1, + .channel = CHAN_TX1, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_tx_ext_info, + }, + { + /* RX1 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_RX1, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_rx_ext_info, + }, + { + /* TX2 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .output = 1, + .channel = CHAN_TX2, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_tx_ext_info, + }, + { + /* RX2 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_RX2, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_rx_ext_info, + }, + { + /* TX3 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .output = 1, + .channel = CHAN_TX3, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_tx_ext_info, + }, + { + /* RX3 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_RX3, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_rx_ext_info, + }, + { + /* TX4 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .output = 1, + .channel = CHAN_TX4, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_tx_ext_info, + }, + { + /* RX4 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_RX4, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_rx_ext_info, + }, + { + /* TX5 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .output = 1, + .channel = CHAN_TX5, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_tx_ext_info, + }, + { + /* RX5 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_RX5, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_rx_ext_info, + }, + { + /* TX6 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .output = 1, + .channel = CHAN_TX6, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_tx_ext_info, + }, + { + /* RX6 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_RX6, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_rx_ext_info, + }, + { + /* TX7 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .output = 1, + .channel = CHAN_TX7, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_tx_ext_info, + }, + { + /* RX7 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_RX7, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_rx_ext_info, + }, + { + /* TX8 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .output = 1, + .channel = CHAN_TX8, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_tx_ext_info, + }, + { + /* RX8 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_RX8, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_rx_ext_info, + }, + { + /* RX Sniffer/Observation */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_OBS_RX1, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_obs_rx_ext_info, + }, + { + /* RX Sniffer/Observation */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_OBS_RX2, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_obs_rx_ext_info, + }, + { + .type = IIO_TEMP, + .indexed = 1, + .channel = 0, + .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), + }, +}; + +static const struct iio_chan_spec adrv903x_phy_chan_2t2r[] = { + { + /* LO1 */ + .type = IIO_ALTVOLTAGE, + .indexed = 1, + .output = 1, + .channel = 0, + .extend_name = "LO1", + .ext_info = adrv903x_phy_ext_lo_info, + }, + { + /* LO2 */ + .type = IIO_ALTVOLTAGE, + .indexed = 1, + .output = 1, + .channel = 1, + .extend_name = "LO2", + .ext_info = adrv903x_phy_ext_lo_info, + }, + { + /* TX1 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .output = 1, + .channel = CHAN_TX1, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_tx_ext_info, + }, + { + /* RX1 */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_RX1, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_rx_ext_info, + }, + { + /* TX2 - mapped to TX4 hardware channel (output 3) */ + .type = IIO_VOLTAGE, + .indexed = 1, + .output = 1, + .channel = CHAN_TX5, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_tx_ext_info, + }, + { + /* RX2 - mapped to RX4 hardware channel (input 3) */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_RX5, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_rx_ext_info, + }, + { + /* RX Sniffer/Observation */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_OBS_RX1, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_obs_rx_ext_info, + }, + { + /* RX Sniffer/Observation */ + .type = IIO_VOLTAGE, + .indexed = 1, + .channel = CHAN_OBS_RX2, + .info_mask_separate = BIT(IIO_CHAN_INFO_HARDWAREGAIN) | + BIT(IIO_CHAN_INFO_ENABLE), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), + .ext_info = adrv903x_phy_obs_rx_ext_info, + }, + { + .type = IIO_TEMP, + .indexed = 1, + .channel = 0, + .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), + }, +}; + +static ssize_t adrv903x_tr_cal_status_read(struct adrv903x_rf_phy *phy, + adi_adrv903x_TrackingCalibrationMask_e mask, + adi_adrv903x_Channels_e channel, + char *buf) +{ + adi_adrv903x_CalStatus_t calStatus = { 0 }; + int ret; + + mutex_lock(&phy->lock); + ret = adi_adrv903x_TrackingCalStatusGet(phy->palauDevice, mask, + channel, &calStatus); + mutex_unlock(&phy->lock); + if (ret) + return adrv903x_dev_err(phy); + + return scnprintf(buf, PAGE_SIZE, "err %d %% %d perf %d iter cnt %d update cnt %d\n", + calStatus.errorCode, calStatus.percentComplete, + calStatus.performanceMetric, calStatus.iterCount, + calStatus.updateCount); +} + +static const struct iio_info adrv903x_phy_info = { + .read_raw = &adrv903x_phy_read_raw, + .write_raw = &adrv903x_phy_write_raw, + .debugfs_reg_access = &adrv903x_phy_reg_access, + .attrs = &adrv903x_phy_attribute_group, +}; + +static ssize_t adrv903x_debugfs_read(struct file *file, char __user *userbuf, + size_t count, loff_t *ppos) +{ + struct adrv903x_debugfs_entry *entry = file->private_data; + struct adrv903x_rf_phy *phy = entry->phy; + ssize_t len = 0; + char buf[700]; + u64 val = 0; + u8 chan; + int ret; + + if (entry->out_value) { + switch (entry->size) { + case 1: + val = *(u8 *)entry->out_value; + break; + case 2: + val = *(u16 *)entry->out_value; + break; + case 4: + val = *(u32 *)entry->out_value; + break; + case 5: + val = *(bool *)entry->out_value; + break; + case 8: + val = *(u64 *)entry->out_value; + break; + default: + ret = -EINVAL; + } + } else if (entry->cmd) { + switch (entry->cmd) { + case DBGFS_TX0_QEC_STATUS: + case DBGFS_TX1_QEC_STATUS: + case DBGFS_TX2_QEC_STATUS: + case DBGFS_TX3_QEC_STATUS: + case DBGFS_TX4_QEC_STATUS: + case DBGFS_TX5_QEC_STATUS: + case DBGFS_TX6_QEC_STATUS: + case DBGFS_TX7_QEC_STATUS: + chan = ADI_ADRV903X_TX0 << (entry->cmd - DBGFS_TX0_QEC_STATUS); + ret = adrv903x_tr_cal_status_read(phy, ADI_ADRV903X_TC_TX_QEC_MASK, chan, buf); + if (ret < 0) + return ret; + len = ret; + break; + case DBGFS_TX0_LOL_STATUS: + case DBGFS_TX1_LOL_STATUS: + case DBGFS_TX2_LOL_STATUS: + case DBGFS_TX3_LOL_STATUS: + case DBGFS_TX4_LOL_STATUS: + case DBGFS_TX5_LOL_STATUS: + case DBGFS_TX6_LOL_STATUS: + case DBGFS_TX7_LOL_STATUS: + chan = ADI_ADRV903X_TX0 << (entry->cmd - DBGFS_TX0_LOL_STATUS); + ret = adrv903x_tr_cal_status_read(phy, ADI_ADRV903X_TC_TX_LOL_MASK, chan, buf); + if (ret < 0) + return ret; + len = ret; + break; + case DBGFS_RX0_QEC_STATUS: + case DBGFS_RX1_QEC_STATUS: + case DBGFS_RX2_QEC_STATUS: + case DBGFS_RX3_QEC_STATUS: + case DBGFS_RX4_QEC_STATUS: + case DBGFS_RX5_QEC_STATUS: + case DBGFS_RX6_QEC_STATUS: + case DBGFS_RX7_QEC_STATUS: + chan = ADI_ADRV903X_RX0 << (entry->cmd - DBGFS_RX0_QEC_STATUS); + ret = adrv903x_tr_cal_status_read(phy, ADI_ADRV903X_TC_RX_QEC_MASK, chan, buf); + if (ret < 0) + return ret; + len = ret; + break; + case DBGFS_RX0_ADC_STATUS: + case DBGFS_RX1_ADC_STATUS: + case DBGFS_RX2_ADC_STATUS: + case DBGFS_RX3_ADC_STATUS: + case DBGFS_RX4_ADC_STATUS: + case DBGFS_RX5_ADC_STATUS: + case DBGFS_RX6_ADC_STATUS: + case DBGFS_RX7_ADC_STATUS: + case DBGFS_ORX0_ADC_STATUS: + case DBGFS_ORX1_ADC_STATUS: + chan = ADI_ADRV903X_RX0 << (entry->cmd - DBGFS_RX0_ADC_STATUS); + if (chan < ADI_ADRV903X_RX7) { + ret = adrv903x_tr_cal_status_read(phy, ADI_ADRV903X_TC_RX_ADC_MASK, chan, buf); + } else { + chan = ADI_ADRV903X_ORX0 << (entry->cmd - DBGFS_ORX0_ADC_STATUS); + ret = adrv903x_tr_cal_status_read(phy, ADI_ADRV903X_TC_ORX_ADC_MASK, chan, buf); + } + if (ret < 0) + return ret; + len = ret; + break; + default: + val = entry->val; + } + } else { + return -EFAULT; + } + + if (!len) + len = snprintf(buf, sizeof(buf), "%llu\n", val); + + return simple_read_from_buffer(userbuf, count, ppos, buf, len); +} + +static ssize_t adrv903x_debugfs_write(struct file *file, + const char __user *userbuf, size_t count, + loff_t *ppos) +{ + struct adrv903x_debugfs_entry *entry = file->private_data; + struct adrv903x_rf_phy *phy = entry->phy; + adi_adrv903x_FrmTestDataCfg_t frm_test_data; + adi_adrv903x_TxTestNcoConfig_t txNcoConfig = { 0 }; + u32 val2, val3, val4; + s64 val; + char buf[80]; + int ret; + + count = min_t(size_t, count, (sizeof(buf) - 1)); + if (copy_from_user(buf, userbuf, count)) + return -EFAULT; + + buf[count] = 0; + + ret = sscanf(buf, "%lli %i %i %i", &val, &val2, &val3, &val4); + if (ret < 1) + return -EINVAL; + + switch (entry->cmd) { + case DBGFS_BIST_FRAMER_0_PRBS: + mutex_lock(&phy->lock); + + frm_test_data.injectPoint = ADI_ADRV903X_FTD_FRAMERINPUT; + frm_test_data.testDataSource = val; + frm_test_data.framerSelMask = ADI_ADRV903X_FRAMER_0; + + ret = adi_adrv903x_FramerTestDataSet(phy->palauDevice, + &frm_test_data); + mutex_unlock(&phy->lock); + if (ret) + return adrv903x_dev_err(phy); + + entry->val = val; + return count; + + case DBGFS_BIST_FRAMER_1_PRBS: + mutex_lock(&phy->lock); + + frm_test_data.injectPoint = ADI_ADRV903X_FTD_FRAMERINPUT; + frm_test_data.testDataSource = val; + frm_test_data.framerSelMask = ADI_ADRV903X_FRAMER_1; + + ret = adi_adrv903x_FramerTestDataSet(phy->palauDevice, + &frm_test_data); + mutex_unlock(&phy->lock); + if (ret) + return adrv903x_dev_err(phy); + + entry->val = val; + return count; + case DBGFS_BIST_FRAMER_0_LOOPBACK: + mutex_lock(&phy->lock); + ret = adi_adrv903x_FramerLoopbackSet(phy->palauDevice, ADI_ADRV903X_FRAMER_0); + mutex_unlock(&phy->lock); + if (ret) + return ret; + + entry->val = val; + return count; + case DBGFS_BIST_FRAMER_1_LOOPBACK: + mutex_lock(&phy->lock); + ret = adi_adrv903x_FramerLoopbackSet(phy->palauDevice, ADI_ADRV903X_FRAMER_1); + mutex_unlock(&phy->lock); + if (ret) + return ret; + + entry->val = val; + return count; + case DBGFS_BIST_TONE: + + if (ret > 4) + return -EINVAL; + + /* Channel select: val = 0-7 for TX0-TX7 */ + if (val > 7) + val = 7; + txNcoConfig.chanSelect = ADI_ADRV903X_TX0 << val; + + txNcoConfig.enable = val2; + txNcoConfig.ncoSelect = ADI_ADRV903X_TX_TEST_NCO_0; + txNcoConfig.frequencyKhz = val3; + if (ret >= 4) { + if (val4 > 8) + val4 = 8; + txNcoConfig.attenCtrl = val4; + } else { + txNcoConfig.attenCtrl = ADI_ADRV903X_TX_TEST_NCO_ATTEN_0DB; + } + + mutex_lock(&phy->lock); + ret = adi_adrv903x_TxTestToneSet(phy->palauDevice, &txNcoConfig); + mutex_unlock(&phy->lock); + if (ret) + return adrv903x_dev_err(phy); + + entry->val = val; + return count; + + default: + break; + } + + if (entry->out_value) { + switch (entry->size) { + case 1: + *(u8 *)entry->out_value = val; + break; + case 2: + *(u16 *)entry->out_value = val; + break; + case 4: + *(u32 *)entry->out_value = val; + break; + case 5: + *(bool *)entry->out_value = val; + break; + case 8: + *(u64 *)entry->out_value = val; + break; + default: + ret = -EINVAL; + } + } + + return count; +} + +static const struct file_operations adrv903x_debugfs_reg_fops = { + .open = simple_open, + .read = adrv903x_debugfs_read, + .write = adrv903x_debugfs_write, +}; + +static void adrv903x_add_debugfs_entry(struct adrv903x_rf_phy *phy, + const char *propname, unsigned int cmd) +{ + unsigned int i = phy->adrv903x_debugfs_entry_index; + + if (WARN_ON(i >= ARRAY_SIZE(phy->debugfs_entry))) + return; + + phy->debugfs_entry[i].phy = phy; + phy->debugfs_entry[i].propname = propname; + phy->debugfs_entry[i].cmd = cmd; + + phy->adrv903x_debugfs_entry_index++; +} + +static int adrv903x_register_debugfs(struct iio_dev *indio_dev) +{ + struct adrv903x_rf_phy *phy = iio_priv(indio_dev); + umode_t mode = 0644; + int i; + + if (!iio_get_debugfs_dentry(indio_dev)) + return -ENODEV; + + adrv903x_add_debugfs_entry(phy, "bist_framer_0_prbs", + DBGFS_BIST_FRAMER_0_PRBS); + adrv903x_add_debugfs_entry(phy, "bist_framer_1_prbs", + DBGFS_BIST_FRAMER_1_PRBS); + adrv903x_add_debugfs_entry(phy, "bist_framer_0_loopback", + DBGFS_BIST_FRAMER_0_LOOPBACK); + adrv903x_add_debugfs_entry(phy, "bist_framer_1_loopback", + DBGFS_BIST_FRAMER_1_LOOPBACK); + adrv903x_add_debugfs_entry(phy, "bist_tone", DBGFS_BIST_TONE); + for (i = CHAN_TX1; i < ADI_ADRV903X_MAX_TXCHANNELS; i++) { + if (i == CHAN_TX1 || i == CHAN_TX5 || phy->spi_device_id != ID_ADRV9032R) { + adrv903x_add_debugfs_entry(phy, + devm_kasprintf(&phy->spi->dev, GFP_KERNEL, "tx%d_qec_status", i), + DBGFS_TX0_QEC_STATUS + i); + adrv903x_add_debugfs_entry(phy, + devm_kasprintf(&phy->spi->dev, GFP_KERNEL, "tx%d_lol_status", i), + DBGFS_TX0_LOL_STATUS + i); + adrv903x_add_debugfs_entry(phy, + devm_kasprintf(&phy->spi->dev, GFP_KERNEL, "rx%d_qec_status", i), + DBGFS_RX0_QEC_STATUS + i); + adrv903x_add_debugfs_entry(phy, + devm_kasprintf(&phy->spi->dev, GFP_KERNEL, "rx%d_adc_status", i), + DBGFS_RX0_ADC_STATUS + i); + } + } + adrv903x_add_debugfs_entry(phy, "orx0_adc_status", DBGFS_ORX0_ADC_STATUS); + adrv903x_add_debugfs_entry(phy, "orx1_adc_status", DBGFS_ORX1_ADC_STATUS); + + for (i = 0; i < phy->adrv903x_debugfs_entry_index; i++) { + if (phy->adrv903x_debugfs_entry_index > DBGFS_BIST_TONE) + mode = 0400; + debugfs_create_file(phy->debugfs_entry[i].propname, mode, + iio_get_debugfs_dentry(indio_dev), + &phy->debugfs_entry[i], + &adrv903x_debugfs_reg_fops); + } + + return 0; +} + +#define ADRV903X_MAX_CLK_NAME 79 + +static char *adrv903x_clk_set_dev_name(struct adrv903x_rf_phy *phy, char *dest, + const char *name) +{ + size_t len = 0; + + if (!name) + return NULL; + + if (*name == '-') + len = strscpy(dest, dev_name(&phy->spi->dev), + ADRV903X_MAX_CLK_NAME); + else + *dest = '\0'; + + return strncat(dest, name, ADRV903X_MAX_CLK_NAME - len); +} + +static unsigned long adrv903x_bb_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct adrv903x_clock *clk_priv = to_clk_priv(hw); + + return clk_priv->rate; +} + +static int adrv903x_bb_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) +{ + struct adrv903x_clock *clk_priv = to_clk_priv(hw); + + clk_priv->rate = rate; + + return 0; +} + +static long adrv903x_bb_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *prate) +{ + struct adrv903x_clock *clk_priv = to_clk_priv(hw); + + dev_dbg(&clk_priv->spi->dev, "%s: Rate %lu Hz", __func__, rate); + + return rate; +} + +static const struct clk_ops bb_clk_ops = { + .round_rate = adrv903x_bb_round_rate, + .set_rate = adrv903x_bb_set_rate, + .recalc_rate = adrv903x_bb_recalc_rate, +}; + +static int adrv903x_clk_register(struct adrv903x_rf_phy *phy, const char *name, + const char *parent_name, + const char *parent_name2, unsigned long flags, + u32 source) +{ + struct adrv903x_clock *clk_priv = &phy->clk_priv[source]; + struct clk_init_data init; + struct clk *clk; + char c_name[ADRV903X_MAX_CLK_NAME + 1], + p_name[2][ADRV903X_MAX_CLK_NAME + 1]; + const char *_parent_name[2]; + u32 rate; + + /* struct adrv903x_clock assignments */ + clk_priv->source = source; + clk_priv->hw.init = &init; + clk_priv->spi = phy->spi; + clk_priv->phy = phy; + + _parent_name[0] = + adrv903x_clk_set_dev_name(phy, p_name[0], parent_name); + _parent_name[1] = + adrv903x_clk_set_dev_name(phy, p_name[1], parent_name2); + + init.name = adrv903x_clk_set_dev_name(phy, c_name, name); + init.flags = flags; + init.parent_names = &_parent_name[0]; + init.num_parents = _parent_name[1] ? 2 : _parent_name[0] ? 1 : 0; + + switch (source) { + case RX_SAMPL_CLK: + phy->rx_iqRate_kHz = phy->palauDevice->initExtract.rx.rxChannelCfg[0].rxDdc0OutputRate_kHz; + init.ops = &bb_clk_ops; + clk_priv->rate = phy->rx_iqRate_kHz; + break; + case OBS_SAMPL_CLK: + phy->orx_iqRate_kHz = phy->palauDevice->initExtract.jesdSetting.framerSetting[1].iqRate_kHz; + init.ops = &bb_clk_ops; + clk_priv->rate = phy->orx_iqRate_kHz; + break; + case TX_SAMPL_CLK: + adrv903x_TxLinkSamplingRateFind(phy->palauDevice, + ADI_ADRV903X_DEFRAMER_0, + &rate); + init.ops = &bb_clk_ops; + clk_priv->rate = rate; + break; + default: + return -EINVAL; + } + + clk_priv->rate *= 1000; + + clk = devm_clk_register(&phy->spi->dev, &clk_priv->hw); + phy->clks[source] = clk; + + return 0; +} + +static void adrv903x_info(struct adrv903x_rf_phy *phy) +{ + struct spi_device *spi = phy->spi; + adi_adrv903x_Version_t apiVersion; + u8 siRevision = 0xbb; + + adi_adrv903x_ApiVersionGet(phy->palauDevice, &apiVersion); + adi_adrv903x_DeviceRevGet(phy->palauDevice, &siRevision); + + dev_info(&spi->dev, "\n%s Rev %d, API version: %u.%u.%u.%u successfully initialized%s", + spi_get_device_id(spi)->name, + phy->palauDevice->devStateInfo.deviceSiRev, + apiVersion.majorVer, apiVersion.minorVer, + apiVersion.maintenanceVer, apiVersion.buildVer, + phy->jdev ? " via jesd204-fsm" : ""); +} + +struct adrv903x_jesd204_link { + unsigned int source_id; + bool is_framer; +}; + +struct adrv903x_jesd204_priv { + struct adrv903x_rf_phy *phy; + struct adrv903x_jesd204_link link[5]; +}; + +static int adrv903x_jesd204_device_init(struct jesd204_dev *jdev, + enum jesd204_state_op_reason reason) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + struct adrv903x_jesd204_priv *priv = jesd204_dev_priv(jdev); + struct device *dev = jesd204_dev_to_device(jdev); + struct adrv903x_rf_phy *phy = priv->phy; + + dev_dbg(dev, "%s:%d device init %s\n", __func__, __LINE__, jesd204_state_op_reason_str(reason)); + + switch (reason) { + case JESD204_STATE_OP_REASON_INIT: + break; + default: + return JESD204_STATE_CHANGE_DONE; + } + + ADI_LIBRARY_MEMSET(&phy->adi_adrv903x_device.devStateInfo, 0, + sizeof(phy->adi_adrv903x_device.devStateInfo)); + + recoveryAction = adi_adrv903x_HwOpen(phy->palauDevice, &phy->spiSettings); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) { + pr_err("ERROR adi_adrv903x_HwOpen failed in %s at line %d.\n", __func__, + __LINE__); + return JESD204_STATE_CHANGE_ERROR; + } + + adi_adrv903x_LogLevelSet(&phy->palauDevice->common, + ADI_HAL_LOG_ERR | ADI_HAL_LOG_WARN); + + recoveryAction = adi_adrv903x_HwReset(phy->palauDevice); + + recoveryAction = adi_adrv903x_PreMcsInit(phy->palauDevice, &deviceInitStruct, + &phy->trxBinaryInfoPtr); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) { + pr_err("ERROR adi_adrv903x_PreMcsInit failed in %s at line %d.\n", __func__, + __LINE__); + return JESD204_STATE_CHANGE_ERROR; + } + + recoveryAction = adi_adrv903x_PreMcsInit_NonBroadcast(phy->palauDevice, + &deviceInitStruct); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) { + pr_err("ERROR adi_adrv903x_PreMcsInit_NonBroadcast failed in %s at line %d.\n", + __func__, __LINE__); + return JESD204_STATE_CHANGE_ERROR; + } + + return JESD204_STATE_CHANGE_DONE; +} + +static int adrv903x_jesd204_link_init(struct jesd204_dev *jdev, + enum jesd204_state_op_reason reason, + struct jesd204_link *lnk) +{ + adi_adrv903x_ErrAction_e recoveryAction = ADI_ADRV903X_ERR_ACT_NONE; + struct adrv903x_jesd204_priv *priv = jesd204_dev_priv(jdev); + struct device *dev = jesd204_dev_to_device(jdev); + struct adrv903x_rf_phy *phy = priv->phy; + u8 source_id; + u32 rate; + + dev_dbg(dev, "%s:%d link_num %u reason %s\n", __func__, __LINE__, + lnk->link_id, jesd204_state_op_reason_str(reason)); + + switch (reason) { + case JESD204_STATE_OP_REASON_INIT: + break; + default: + return JESD204_STATE_CHANGE_DONE; + } + + switch (lnk->link_id) { + case DEFRAMER0_LINK_TX: + case DEFRAMER1_LINK_TX: + adi_adrv903x_DeframerCfg_t deframerCfg = { 0 }; + + if (lnk->link_id == DEFRAMER0_LINK_TX) + source_id = ADI_ADRV903X_DEFRAMER_0; + else + source_id = ADI_ADRV903X_DEFRAMER_1; + + recoveryAction = adi_adrv903x_DeframerCfgGet(phy->palauDevice, source_id, &deframerCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) { + pr_err("ERROR adi_adrv903x_DeframerCfgGet failed in %s at line %d.\n", __func__, + __LINE__); + return JESD204_STATE_CHANGE_ERROR; + } + + priv->link[lnk->link_id].source_id = source_id; + phy->tx_iqRate_kHz = + phy->palauDevice->initExtract.jesdSetting.deframerSetting[source_id - 1].iqRate_kHz; + rate = phy->palauDevice->initExtract.jesdSetting.deframerSetting[source_id - 1].iqRate_kHz; + lnk->num_lanes = + hweight8(phy->palauDevice->initExtract.jesdSetting.deframerSetting[source_id - 1].deserialLaneEnabled); + lnk->num_converters = + phy->palauDevice->initExtract.jesdSetting.deframerSetting[source_id - 1].jesdM; + lnk->bits_per_sample = + phy->palauDevice->initExtract.jesdSetting.deframerSetting[source_id - 1].jesdNp; + + lnk->octets_per_frame = deframerCfg.jesd204F; + lnk->frames_per_multiframe = deframerCfg.jesd204K; + lnk->device_id = deframerCfg.deviceId; + lnk->bank_id = deframerCfg.bankId; + lnk->scrambling = deframerCfg.decrambling; + lnk->converter_resolution = deframerCfg.jesd204Np; + lnk->ctrl_bits_per_sample = 0; // ToDo - from where + lnk->jesd_version = deframerCfg.enableJesd204C ? JESD204_VERSION_C : + JESD204_VERSION_B; + lnk->subclass = JESD204_SUBCLASS_1; // ToDo - from where + lnk->is_transmit = true; + lnk->jesd_encoder = JESD204_ENCODER_64B66B; + break; + case FRAMER0_LINK_RX: + case FRAMER1_LINK_RX: + case FRAMER2_LINK_RX: + adi_adrv903x_FramerCfg_t framerCfg = { 0 }; + + if (lnk->link_id == FRAMER0_LINK_RX) + source_id = ADI_ADRV903X_FRAMER_0; + else if (lnk->link_id == FRAMER1_LINK_RX) + source_id = ADI_ADRV903X_FRAMER_1; + else + source_id = ADI_ADRV903X_FRAMER_2; + + recoveryAction = adi_adrv903x_FramerCfgGet(phy->palauDevice, source_id, &framerCfg); + if (recoveryAction != ADI_ADRV903X_ERR_ACT_NONE) { + pr_err("ERROR adi_adrv903x_FramerCfgGet failed in %s at line %d.\n", __func__, + __LINE__); + return JESD204_STATE_CHANGE_ERROR; + } + + priv->link[lnk->link_id].source_id = source_id; + priv->link[lnk->link_id].is_framer = true; + rate = phy->palauDevice->initExtract.jesdSetting.framerSetting[source_id - 1].iqRate_kHz; + if (lnk->link_id == FRAMER0_LINK_RX) + phy->rx_iqRate_kHz = rate; + if (lnk->link_id == FRAMER1_LINK_RX) + phy->orx_iqRate_kHz = rate; + lnk->num_lanes = + hweight8(phy->palauDevice->initExtract.jesdSetting.framerSetting[source_id - 1].serialLaneEnabled); + lnk->num_converters = + phy->palauDevice->initExtract.jesdSetting.framerSetting[source_id - 1].jesdM; + lnk->bits_per_sample = + phy->palauDevice->initExtract.jesdSetting.framerSetting[source_id - 1].jesdNp; + + lnk->octets_per_frame = framerCfg.jesd204F; + lnk->frames_per_multiframe = framerCfg.jesd204K; + lnk->device_id = framerCfg.deviceId; + lnk->bank_id = framerCfg.bankId; + lnk->scrambling = framerCfg.scramble; + lnk->converter_resolution = framerCfg.jesd204Np; + lnk->ctrl_bits_per_sample = 0; + lnk->jesd_version = framerCfg.enableJesd204C ? JESD204_VERSION_C : + JESD204_VERSION_B; + lnk->subclass = JESD204_SUBCLASS_1; + lnk->is_transmit = false; + lnk->jesd_encoder = JESD204_ENCODER_64B66B; + + break; + default: + return -EINVAL; + } + + lnk->sample_rate = rate * 1000; + + return JESD204_STATE_CHANGE_DONE; +} + +static int adrv903x_jesd204_link_pre_setup(struct jesd204_dev *jdev, + enum jesd204_state_op_reason reason) +{ + struct adrv903x_jesd204_priv *priv = jesd204_dev_priv(jdev); + struct device *dev = jesd204_dev_to_device(jdev); + struct adrv903x_rf_phy *phy = priv->phy; + u32 deviceClockScaled_kHz = 0; + long dev_clk; + + dev_dbg(dev, "%s:%d reason %s\n", __func__, __LINE__, + jesd204_state_op_reason_str(reason)); + + switch (reason) { + case JESD204_STATE_OP_REASON_INIT: + break; + default: + return JESD204_STATE_CHANGE_DONE; + } + + deviceClockScaled_kHz = + phy->palauDevice->initExtract.clocks.deviceClockScaled_kHz; + + dev_clk = clk_round_rate(phy->dev_clk, + deviceClockScaled_kHz * 1000); + + if (dev_clk > 0 && ((dev_clk / 1000) == + deviceClockScaled_kHz)) { + clk_set_rate(phy->dev_clk, (unsigned long)dev_clk); + } else { + dev_err(&phy->spi->dev, + "Requesting device clock %u failed got %ld", + deviceClockScaled_kHz * 1000, dev_clk); + return -EINVAL; + } + + return JESD204_STATE_CHANGE_DONE; +} + +static int adrv903x_jesd204_link_setup(struct jesd204_dev *jdev, + enum jesd204_state_op_reason reason) +{ + struct adrv903x_jesd204_priv *priv = jesd204_dev_priv(jdev); + struct device *dev = jesd204_dev_to_device(jdev); + struct adrv903x_rf_phy *phy = priv->phy; + int ret; + + dev_dbg(dev, "%s:%d reason %s\n", __func__, __LINE__, + jesd204_state_op_reason_str(reason)); + + if (reason == JESD204_STATE_OP_REASON_UNINIT) { + phy->is_initialized = 0; + + adi_adrv903x_Shutdown(phy->palauDevice); + adi_adrv903x_HwClose(phy->palauDevice); + + memset(&phy->adi_adrv903x_device.devStateInfo, 0, + sizeof(phy->adi_adrv903x_device.devStateInfo)); + + return JESD204_STATE_CHANGE_DONE; + } + + ret = adi_adrv903x_MultichipSyncSet_v2(phy->palauDevice, ADI_ENABLE); + if (ret) + return adrv903x_dev_err(phy); + + return JESD204_STATE_CHANGE_DONE; +} + +static int adrv903x_jesd204_setup_stage1(struct jesd204_dev *jdev, + enum jesd204_state_op_reason reason) +{ + struct adrv903x_jesd204_priv *priv = jesd204_dev_priv(jdev); + struct device *dev = jesd204_dev_to_device(jdev); + struct adrv903x_rf_phy *phy = priv->phy; + int ret, i; + u32 mcsStatus; + + dev_dbg(dev, "%s:%d reason %s\n", __func__, __LINE__, + jesd204_state_op_reason_str(reason)); + + if (reason != JESD204_STATE_OP_REASON_INIT) + return JESD204_STATE_CHANGE_DONE; + + /* This loop will send SysRef pulses up to 255 times unless MCS status achieved before. */ + for (i = 0; i < 255; i++) { + ret = adi_adrv903x_MultichipSyncStatusGet(phy->palauDevice, + &mcsStatus); + if (ret) + return adrv903x_dev_err(phy); + + if ((mcsStatus & 0x01) == 0x01) + break; + + jesd204_sysref_async_force(phy->jdev); + } + + if (mcsStatus != 0x01) { + dev_err(&phy->spi->dev, + "%s:%d Unexpected MCS sync status (0x%X)", + __func__, __LINE__, mcsStatus); + + return adrv903x_dev_err(phy); + } + + return JESD204_STATE_CHANGE_DONE; +} + +static int adrv903x_jesd204_setup_stage2(struct jesd204_dev *jdev, + enum jesd204_state_op_reason reason) +{ + struct adrv903x_jesd204_priv *priv = jesd204_dev_priv(jdev); + struct device *dev = jesd204_dev_to_device(jdev); + struct adrv903x_rf_phy *phy = priv->phy; + int ret; + + dev_dbg(dev, "%s:%d reason %s\n", __func__, __LINE__, + jesd204_state_op_reason_str(reason)); + + if (reason != JESD204_STATE_OP_REASON_INIT) + return JESD204_STATE_CHANGE_DONE; + + /* MCS end sequence*/ + ret = adi_adrv903x_MultichipSyncSet_v2(phy->palauDevice, ADI_DISABLE); + if (ret) + return adrv903x_dev_err(phy); + + /* Post MCS */ + ret = adi_adrv903x_PostMcsInit(phy->palauDevice, + &utilityInit); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_SerializerReset(phy->palauDevice); + if (ret) + return adrv903x_dev_err(phy); + + return JESD204_STATE_CHANGE_DONE; +} + +static int adrv903x_jesd204_clks_enable(struct jesd204_dev *jdev, + enum jesd204_state_op_reason reason, + struct jesd204_link *lnk) +{ + struct adrv903x_jesd204_priv *priv = jesd204_dev_priv(jdev); + struct device *dev = jesd204_dev_to_device(jdev); + struct adrv903x_rf_phy *phy = priv->phy; + int ret; + + dev_err(dev, "%s:%d link_num %u reason %s\n", __func__, __LINE__, + lnk->link_id, jesd204_state_op_reason_str(reason)); + + if (reason != JESD204_STATE_OP_REASON_INIT) + return JESD204_STATE_CHANGE_DONE; + + if (!lnk->num_converters) + return JESD204_STATE_CHANGE_DONE; + + if (priv->link[lnk->link_id].is_framer) { + if (phy->palauDevice->devStateInfo.linkSharingEnabled == 1) { + ret = adi_adrv903x_FramerSysrefCtrlSet(phy->palauDevice, + ADI_ADRV903X_FRAMER_1, + ADI_DISABLE); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_FramerLinkStateSet(phy->palauDevice, + ADI_ADRV903X_FRAMER_1, + ADI_DISABLE); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_FramerLinkStateSet(phy->palauDevice, + ADI_ADRV903X_FRAMER_1, + ADI_ENABLE); + if (ret) + return adrv903x_dev_err(phy); + + dev_dbg(&phy->spi->dev, + "%s:%d Link %d Framer enabled", __func__, __LINE__, + ADI_ADRV903X_FRAMER_1); + + /*************************************************/ + /***** Enable SYSREF to Koror JESD204B Framer ****/ + /*************************************************/ + /*** < User: Make sure SYSREF is stopped/disabled > ***/ + ret = adi_adrv903x_FramerSysrefCtrlSet(phy->palauDevice, + ADI_ADRV903X_FRAMER_1, + ADI_ENABLE); + if (ret) + return adrv903x_dev_err(phy); + + jesd204_sysref_async_force(phy->jdev); + + ret = adi_adrv903x_FramerLinkStateSet(phy->palauDevice, + ADI_ADRV903X_FRAMER_1, + ADI_DISABLE); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_FramerSysrefCtrlSet(phy->palauDevice, + ADI_ADRV903X_FRAMER_1, + ADI_DISABLE); + if (ret) + return adrv903x_dev_err(phy); + } + + ret = adi_adrv903x_FramerSysrefCtrlSet(phy->palauDevice, + priv->link[lnk->link_id].source_id, + ADI_ENABLE); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_FramerLinkStateSet(phy->palauDevice, + priv->link[lnk->link_id].source_id, + ADI_DISABLE); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_FramerLinkStateSet(phy->palauDevice, + priv->link[lnk->link_id].source_id, + ADI_ENABLE); + if (ret) + return adrv903x_dev_err(phy); + + dev_dbg(&phy->spi->dev, + "%s:%d Link %d Framer enabled", __func__, __LINE__, + priv->link[lnk->link_id].source_id); + + ret = adi_adrv903x_FramerSysrefCtrlSet(phy->palauDevice, + priv->link[lnk->link_id].source_id, + ADI_DISABLE); + if (ret) + return adrv903x_dev_err(phy); + + } else { + ret = adi_adrv903x_DeframerSysrefCtrlSet(phy->palauDevice, + (uint8_t)ADI_ADRV903X_ALL_DEFRAMER, + ADI_DISABLE); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_DeframerLinkStateSet(phy->palauDevice, + (uint8_t)ADI_ADRV903X_ALL_DEFRAMER, + ADI_DISABLE); + if (ret) + return adrv903x_dev_err(phy); + }; + + return JESD204_STATE_CHANGE_DONE; +} + +static int adrv903x_jesd204_link_enable(struct jesd204_dev *jdev, + enum jesd204_state_op_reason reason, + struct jesd204_link *lnk) +{ + struct adrv903x_jesd204_priv *priv = jesd204_dev_priv(jdev); + struct device *dev = jesd204_dev_to_device(jdev); + struct adrv903x_rf_phy *phy = priv->phy; + int ret; + + dev_dbg(dev, "%s:%d link_num %u reason %s\n", __func__, __LINE__, + lnk->link_id, jesd204_state_op_reason_str(reason)); + + if (reason != JESD204_STATE_OP_REASON_INIT) + return JESD204_STATE_CHANGE_DONE; + + if (!lnk->num_converters) + return JESD204_STATE_CHANGE_DONE; + + if (!priv->link[lnk->link_id].is_framer) { /* DEFRAMER */ + adi_adrv903x_InitCals_t serdesCal = { + .calMask = ADI_ADRV903X_IC_SERDES, + .orxChannelMask = 0x00U, + .rxChannelMask = 0xFFU, + .txChannelMask = 0x00U, + .warmBoot = 0, + }; + + ret = adi_adrv903x_DeframerLinkStateSet(phy->palauDevice, + priv->link[lnk->link_id].source_id, + ADI_ENABLE); + if (ret) + return adrv903x_dev_err(phy); + + /* Notify ARM to run SERDES Calbriation if necessary */ + ret = adi_adrv903x_InitCalsRun(phy->palauDevice, &serdesCal); + if (ret) + return adrv903x_dev_err(phy); + + /* Wait up to 60 seconds for ARM */ + ret = adi_adrv903x_InitCalsWait(phy->palauDevice, 60000); + if (ret) { + dev_err(&phy->spi->dev, "Error: InitCalsWait\n"); + return adrv903x_dev_err(phy); + } + + /***********************************************************/ + /**** Enable SYSREF to Koror JESD204B/JESD204C Deframer ****/ + /***********************************************************/ + ret = adi_adrv903x_DeframerSysrefCtrlSet(phy->palauDevice, + priv->link[lnk->link_id].source_id, + ADI_DISABLE); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_DeframerLinkStateSet(phy->palauDevice, + priv->link[lnk->link_id].source_id, + ADI_ENABLE); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_DeframerSysrefCtrlSet(phy->palauDevice, + priv->link[lnk->link_id].source_id, + ADI_ENABLE); + if (ret) + return adrv903x_dev_err(phy); + }; + + return JESD204_STATE_CHANGE_DONE; +} + +static int adrv903x_jesd204_link_running(struct jesd204_dev *jdev, + enum jesd204_state_op_reason reason, + struct jesd204_link *lnk) +{ + struct adrv903x_jesd204_priv *priv = jesd204_dev_priv(jdev); + struct device *dev = jesd204_dev_to_device(jdev); + struct adrv903x_rf_phy *phy = priv->phy; + int ret; + + adi_adrv903x_DeframerStatus_v2_t deframerStatus; + adi_adrv903x_FramerStatus_t framerStatus; + u8 deframerLinkCondition = 0; + + dev_dbg(dev, "%s:%d link_num %u reason %s\n", __func__, __LINE__, + lnk->link_id, jesd204_state_op_reason_str(reason)); + + if (reason != JESD204_STATE_OP_REASON_INIT) + return JESD204_STATE_CHANGE_DONE; + + if (!lnk->num_converters) + return JESD204_STATE_CHANGE_DONE; + + if (priv->link[lnk->link_id].is_framer) { + ret = adi_adrv903x_FramerStatusGet(phy->palauDevice, + priv->link[lnk->link_id].source_id, + &framerStatus); + if (ret) + return adrv903x_dev_err(phy); + + if (framerStatus.status != 0x82) + dev_warn(&phy->spi->dev, + "Link%u framerStatus 0x%X", + lnk->link_id, framerStatus.status); + } else { + ret = adi_adrv903x_DeframerStatusGet_v2(phy->palauDevice, + priv->link[lnk->link_id].source_id, + &deframerStatus); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_DfrmLinkConditionGet(phy->palauDevice, + priv->link[lnk->link_id].source_id, + &deframerLinkCondition); + if (ret) + return adrv903x_dev_err(phy); + + for (int i = 0; i < lnk->num_lanes; i++) { + dev_warn(&phy->spi->dev, + "Link%u deframerStatus lane %d 0x%X", + lnk->link_id, i, deframerStatus.laneStatus[i]); + } + }; + + return JESD204_STATE_CHANGE_DONE; +} + +/* Helper function to convert between tracking cals to init cals + * + * Returns init cal. + */ +static ADI_API adi_adrv903x_InitCalibrations_e drv_cals_TrackingCalConvert(const adi_adrv903x_TrackingCalibrationMask_e trackingCal) +{ + adi_adrv903x_InitCalibrations_e initCal = (adi_adrv903x_InitCalibrations_e) 0U; + + switch (trackingCal) { + case ADI_ADRV903X_TC_TX_LOL_MASK: + initCal = ADI_ADRV903X_IC_TXLOL; + break; + case ADI_ADRV903X_TC_TX_QEC_MASK: + initCal = ADI_ADRV903X_IC_TXQEC; + break; + case ADI_ADRV903X_TC_TX_SERDES_MASK: + initCal = ADI_ADRV903X_IC_SERDES; + break; + case ADI_ADRV903X_TC_RX_ADC_MASK: + initCal = ADI_ADRV903X_IC_ADC_RX; + break; + case ADI_ADRV903X_TC_TX_LB_ADC_MASK: + initCal = ADI_ADRV903X_IC_ADC_TXLB; + break; + case ADI_ADRV903X_TC_ORX_ADC_MASK: + initCal = ADI_ADRV903X_IC_ADC_ORX; + break; + case ADI_ADRV903X_TC_RX_QEC_MASK: + fallthrough; + default: + initCal = (adi_adrv903x_InitCalibrations_e)0U; + break; + } + + return initCal; +} + +static int adrv903x_jesd204_post_running_stage(struct jesd204_dev *jdev, + enum jesd204_state_op_reason reason) +{ + adi_adrv903x_TrackingCalibrationMask_e trackingCal = (adi_adrv903x_TrackingCalibrationMask_e)0U; + adi_adrv903x_InitCalibrations_e currentInitCalMask = (adi_adrv903x_InitCalibrations_e)0U; + struct adrv903x_jesd204_priv *priv = jesd204_dev_priv(jdev); + static adi_adrv903x_InitCalStatus_t initCalStatus; + struct device *dev = jesd204_dev_to_device(jdev); + u32 tx_mask = 0, rx_mask = 0, orx_mask = 0; + const u32 ALL_CHANNELS_MASK = 0xFFU; + struct adrv903x_rf_phy *phy = priv->phy; + adi_adrv903x_TxAtten_t txAttenuation[1]; + const u32 NUM_TRACKING_CALS = 7U; + u32 init_chans = 0; + u8 i, j; + int ret; + + const u32 trackingCalMask = (u32)(ADI_ADRV903X_TC_RX_ADC_MASK | + ADI_ADRV903X_TC_ORX_ADC_MASK | + ADI_ADRV903X_TC_TX_LB_ADC_MASK | + ADI_ADRV903X_TC_TX_SERDES_MASK); + + dev_dbg(dev, "%s:%d reason %s\n", __func__, __LINE__, + jesd204_state_op_reason_str(reason)); + + if (reason != JESD204_STATE_OP_REASON_INIT) { + phy->is_initialized = 0; + return JESD204_STATE_CHANGE_DONE; + } + + clk_set_rate(phy->clks[RX_SAMPL_CLK], phy->rx_iqRate_kHz * 1000); + clk_set_rate(phy->clks[OBS_SAMPL_CLK], phy->orx_iqRate_kHz * 1000); + clk_set_rate(phy->clks[TX_SAMPL_CLK], phy->tx_iqRate_kHz * 1000); + + init_chans = phy->palauDevice->devStateInfo.initializedChannels; + + for (i = 0; i < ADI_ADRV903X_MAX_TXCHANNELS; i++) { + if (init_chans & (1 << (i + ADI_ADRV903X_TX_INITIALIZED_CH_OFFSET))) + tx_mask |= (ADI_ADRV903X_TX0 << i); + } + + for (i = 0; i < ADI_ADRV903X_MAX_RX_ONLY; i++) { + if (init_chans & (1 << (i))) + rx_mask |= (ADI_ADRV903X_RX0 << i); + } + + for (i = 0; i < ADI_ADRV903X_MAX_ORX_ONLY; i++) { + if (init_chans & (1 << (i + ADI_ADRV903X_MAX_TXCHANNELS))) + orx_mask |= (ADI_ADRV903X_ORX0 << i); + } + + dev_info(dev, "Initialized RF channels: 0x%x (TX: 0x%x, RX: 0x%x, ORX: 0x%x)\n", + init_chans, tx_mask, rx_mask, orx_mask); + + ret = adi_adrv903x_RxTxEnableSet(phy->palauDevice, orx_mask, orx_mask, + rx_mask, rx_mask, tx_mask, tx_mask); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_RxTxEnableSet(phy->palauDevice, orx_mask, 0x00, + rx_mask, 0x00, tx_mask, 0x00); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_RxTxEnableSet(phy->palauDevice, orx_mask, orx_mask, + rx_mask, rx_mask, tx_mask, tx_mask); + if (ret) + return adrv903x_dev_err(phy); + + txAttenuation[0].txChannelMask = tx_mask; + txAttenuation[0].txAttenuation_mdB = 6000; + ret = adi_adrv903x_TxAttenSet(phy->palauDevice, txAttenuation, 1); + if (ret) + return adrv903x_dev_err(phy); + + memset(&initCalStatus, 0, sizeof(adi_adrv903x_InitCalStatus_t)); + + ret = adi_adrv903x_InitCalsDetailedStatusGet(phy->palauDevice, &initCalStatus); + if (ret) + return adrv903x_dev_err(phy); + + for (i = 0U; i < NUM_TRACKING_CALS; ++i) { + trackingCal = (adi_adrv903x_TrackingCalibrationMask_e)(1U << i); + + if (((uint32_t)trackingCal & trackingCalMask) == 0U) { + /* Tracking Cal not configured to run */ + continue; + } + + /* Check if the Current Tracking Cal was initially run */ + currentInitCalMask = drv_cals_TrackingCalConvert(trackingCal); + + for (j = 0U; j < ADI_ADRV903X_MAX_CHANNELS; ++j) { + if ((initCalStatus.calsSincePowerUp[j] & currentInitCalMask) == 0U) { + /* Tracking Cal was already run */ + continue; + } + } + + ret = adi_adrv903x_TrackingCalsEnableSet(phy->palauDevice, + trackingCal, + ALL_CHANNELS_MASK, + ADI_ADRV903X_TRACKING_CAL_ENABLE); + if (ret) + return adrv903x_dev_err(phy); + } + + phy->is_initialized = 1; + adrv903x_info(phy); + + return JESD204_STATE_CHANGE_DONE; +} + +static const struct jesd204_dev_data jesd204_adrv903x_init = { + .state_ops = { + [JESD204_OP_DEVICE_INIT] = { + .per_device = adrv903x_jesd204_device_init, + .mode = JESD204_STATE_OP_MODE_PER_DEVICE, + }, + [JESD204_OP_LINK_INIT] = { + .per_link = adrv903x_jesd204_link_init, + }, + [JESD204_OP_LINK_PRE_SETUP] = { + .per_device = adrv903x_jesd204_link_pre_setup, + .mode = JESD204_STATE_OP_MODE_PER_DEVICE, + }, + [JESD204_OP_LINK_SETUP] = { + .per_device = adrv903x_jesd204_link_setup, + .mode = JESD204_STATE_OP_MODE_PER_DEVICE, + .post_state_sysref = true, + }, + [JESD204_OP_OPT_SETUP_STAGE1] = { + .per_device = adrv903x_jesd204_setup_stage1, + .mode = JESD204_STATE_OP_MODE_PER_DEVICE, + .post_state_sysref = true, + }, + [JESD204_OP_OPT_SETUP_STAGE2] = { + .per_device = adrv903x_jesd204_setup_stage2, + .mode = JESD204_STATE_OP_MODE_PER_DEVICE, + .post_state_sysref = true, + }, + [JESD204_OP_CLOCKS_ENABLE] = { + .per_link = adrv903x_jesd204_clks_enable, + }, + [JESD204_OP_LINK_ENABLE] = { + .per_link = adrv903x_jesd204_link_enable, + .post_state_sysref = true, + }, + [JESD204_OP_LINK_RUNNING] = { + .per_link = adrv903x_jesd204_link_running, + }, + [JESD204_OP_OPT_POST_RUNNING_STAGE] = { + .per_device = adrv903x_jesd204_post_running_stage, + .mode = JESD204_STATE_OP_MODE_PER_DEVICE, + }, + }, + + .max_num_links = 10, + .sizeof_priv = sizeof(struct adrv903x_jesd204_priv), +}; + +static int adrv903x_probe(struct spi_device *spi) +{ + adi_adrv903x_ExtractInitDataOutput_e checkExtractInitData = + ADI_ADRV903X_EXTRACT_INIT_DATA_NOT_POPULATED; + struct device_node *np = spi->dev.of_node; + adi_common_ErrData_t *errData = NULL; + struct adrv903x_jesd204_priv *priv; + adi_adrv903x_Version_t apiVersion; + struct adrv903x_rf_phy *phy; + struct iio_dev *indio_dev; + struct jesd204_dev *jdev; + struct clk *clk = NULL; + const char *name; + int ret, i; + u32 val; + + int id = spi_get_device_id(spi)->driver_data; + + jdev = devm_jesd204_dev_register(&spi->dev, &jesd204_adrv903x_init); + if (IS_ERR(jdev)) + return PTR_ERR(jdev); + + clk = devm_clk_get(&spi->dev, "dev_clk"); + if (IS_ERR(clk)) + ret = PTR_ERR(clk); + + indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*phy)); + if (!indio_dev) + return -ENOMEM; + + phy = iio_priv(indio_dev); + phy->indio_dev = indio_dev; + phy->spi = spi; + phy->spi_device_id = id; + phy->dev_clk = clk; + phy->jdev = jdev; + mutex_init(&phy->lock); + + priv = jesd204_dev_priv(jdev); + priv->phy = phy; + + phy->palauDevice = &phy->adi_adrv903x_device; + phy->linux_hal.spi = spi; + phy->linux_hal.logCfg.logMask = ADI_HAL_LOG_ERR | ADI_HAL_LOG_WARN; + phy->palauDevice->common.devHalInfo = &phy->linux_hal; + phy->palauDevice->common.type = "RF"; + + if (!of_property_read_string(np, "adi,device-config-name", &name)) { + ret = strscpy(phy->trxBinaryInfoPtr.cpuProfile.filePath, name, + sizeof(phy->trxBinaryInfoPtr.cpuProfile.filePath)); + if (ret < 0) { + dev_err(&spi->dev, "device-config-name too long\n"); + return ret; + } + } else { + dev_err(&spi->dev, "error missing dt property: adi,device-config-name\n"); + return -EINVAL; + } + + if (!of_property_read_string(np, "adi,arm-firmware-name", &name)) { + ret = strscpy(phy->trxBinaryInfoPtr.cpu.filePath, name, + sizeof(phy->trxBinaryInfoPtr.cpu.filePath)); + if (ret < 0) { + dev_err(&spi->dev, "arm-firmware-name too long\n"); + return ret; + } + } else { + dev_err(&spi->dev, "error missing dt property: adi,arm-firmware-name\n"); + return -EINVAL; + } + + if (!of_property_read_string(np, "adi,stream-firmware-name", &name)) { + ret = strscpy(phy->trxBinaryInfoPtr.stream.filePath, name, + sizeof(phy->trxBinaryInfoPtr.stream.filePath)); + if (ret < 0) { + dev_err(&spi->dev, "stream-firmware-name too long\n"); + return ret; + } + } else { + dev_err(&spi->dev, "error missing dt property: adi,stream-firmware-name\n"); + return -EINVAL; + } + + for (i = 0; i < ADI_ADRV903X_RX_GAIN_TABLE_ARR_MAX; i++) { + ret = of_property_read_string_index(np, "adi,rx-gaintable-names", i, &name); + + if (!ret && !of_property_read_u32_index(np, "adi,rx-gaintable-channel-masks", i, &val)) { + ret = strscpy(phy->trxBinaryInfoPtr.rxGainTable[i].filePath, name, + sizeof(phy->trxBinaryInfoPtr.rxGainTable[i].filePath)); + if (ret < 0) { + dev_err(&spi->dev, "rx-gaintable-name[%d] too long\n", i); + return ret; + } + phy->trxBinaryInfoPtr.rxGainTable[i].channelMask = val; + } + } + + if (adi_adrv903x_hal_PlatformSetup(ADI_LINUX) != ADI_HAL_ERR_OK) { + dev_err(&spi->dev, "error HAL function(s) not implemented.\n"); + return -EINVAL; + } + + phy->linux_hal.reset_gpio = + devm_gpiod_get(&spi->dev, "reset", GPIOD_OUT_LOW); + + ret = clk_prepare_enable(phy->dev_clk); + if (ret) + return ret; + + phy->spiSettings.msbFirst = 1; + phy->spiOptions.allowSpiStreaming = 0; + phy->spiOptions.allowAhbAutoIncrement = 1; + phy->spiOptions.allowAhbSpiFifoMode = 0; + phy->spiSettings.fourWireMode = 1; + phy->spiSettings.cmosPadDrvStrength = ADI_ADRV903X_CMOSPAD_DRV_STRONG; + phy->linux_hal.spiCfg.interfaceEnabled = 1; + + adi_adrv903x_LogLevelSet(&phy->palauDevice->common, ADI_HAL_LOG_ALL); + + /* Register errData to use for API calls */ + errData = ADI_CREATE_ERROR_MEMORY(); + if (!errData) + return -ENOMEM; + + ret = adrv903x_TlsSet(HAL_TLS_ERR, errData); + if (ret != ADI_HAL_ERR_OK) { + (void)ADI_DESTROY_ERROR_MEMORY(errData); + return -EINVAL; + } + + phy->palauDevice->common.deviceInfo.id = id; + phy->palauDevice->common.deviceInfo.name = spi_get_device_id(spi)->name; + phy->palauDevice->common.deviceInfo.type = 0x00; + + ret = adi_adrv903x_HwOpen(phy->palauDevice, &phy->spiSettings); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_SpiVerify(phy->palauDevice); + if (ret) + return adrv903x_dev_err(phy); + + ret = adi_adrv903x_ApiVersionGet(phy->palauDevice, &apiVersion); + if (ret) + return adrv903x_dev_err(phy); + + dev_info(&spi->dev, + "%s Rev %d, API version: %u.%u.%u.%u found", + spi_get_device_id(spi)->name, + phy->palauDevice->devStateInfo.deviceSiRev, + apiVersion.majorVer, apiVersion.minorVer, + apiVersion.maintenanceVer, apiVersion.buildVer); + + if (apiVersion.majorVer > 1U) { + ret = adi_adrv903x_InitDataExtract(phy->palauDevice, + &phy->trxBinaryInfoPtr.cpuProfile, + &initStructApiVersion, + &initStructArmVersion, + &initStructStreamVersion, + &deviceInitStruct, + &utilityInit, + &checkExtractInitData); + + switch (checkExtractInitData) { + case ADI_ADRV903X_EXTRACT_INIT_DATA_LEGACY_PROFILE_BIN: + dev_info(&spi->dev, "\tUsing the Default Init and PostMcsInit Structures\n"); + break; + case ADI_ADRV903X_EXTRACT_INIT_DATA_POPULATED: + dev_info(&spi->dev, "\tUsing the Profile Init and PostMcsInit Structures\n"); + break; + case ADI_ADRV903X_EXTRACT_INIT_DATA_NOT_POPULATED: + fallthrough; + default: + ADI_APP_ERROR_REPORT(ADI_COMMON_ERRCODE_INVALID_PARAM, + ret, + &deviceInitStruct, + "PreMcsInit and/or PostMcsInit Data Structures Not Populated"); + return -EINVAL; + } + } + + /* Copy the data structure that holds Utility Init structures to the device */ + memcpy(&phy->adrv903xPostMcsInitInst, &utilityInit, sizeof(adi_adrv903x_PostMcsInit_t)); + + /* Extract Info from CPU Profile Binary */ + /* Required for Link init */ + ret = adi_adrv903x_DeviceInfoExtract(phy->palauDevice, + &phy->trxBinaryInfoPtr.cpuProfile); + if (ret != ADI_ADRV903X_ERR_ACT_NONE) { + ADI_API_ERROR_REPORT(&phy->palauDevice->common, ret, + "Issue during CPU Profile Binary Image Extract"); + return -1; + } + + adrv903x_clk_register(phy, "-rx_sampl_clk", __clk_get_name(phy->dev_clk), NULL, + CLK_GET_RATE_NOCACHE | CLK_IGNORE_UNUSED, + RX_SAMPL_CLK); + adrv903x_clk_register(phy, "-obs_sampl_clk", __clk_get_name(phy->dev_clk), NULL, + CLK_GET_RATE_NOCACHE | CLK_IGNORE_UNUSED, + OBS_SAMPL_CLK); + adrv903x_clk_register(phy, "-tx_sampl_clk", __clk_get_name(phy->dev_clk), NULL, + CLK_GET_RATE_NOCACHE | CLK_IGNORE_UNUSED, + TX_SAMPL_CLK); + + phy->clk_data.clks = phy->clks; + phy->clk_data.clk_num = NUM_ADRV903X_CLKS; + + ret = of_clk_add_provider(np, of_clk_src_onecell_get, + &phy->clk_data); + if (ret) + goto out_disable_clocks; + + indio_dev->dev.parent = &spi->dev; + + if (np) + indio_dev->name = np->name; + else + indio_dev->name = "adrv903x-phy"; + + indio_dev->modes = INDIO_DIRECT_MODE; + + switch (id) { + case ID_ADRV9032: + indio_dev->info = &adrv903x_phy_info; + indio_dev->channels = adrv903x_phy_chan; + indio_dev->num_channels = ARRAY_SIZE(adrv903x_phy_chan); + break; + case ID_ADRV9032R: + indio_dev->info = &adrv903x_phy_info; + indio_dev->channels = adrv903x_phy_chan_2t2r; + indio_dev->num_channels = ARRAY_SIZE(adrv903x_phy_chan_2t2r); + break; + default: + ret = -EINVAL; + goto out_clk_del_provider; + } + + ret = iio_device_register(indio_dev); + if (ret < 0) + goto out_clk_del_provider; + + ret = adrv903x_register_axi_converter(phy); + if (ret < 0) + goto out_iio_device_unregister; + + ret = adrv903x_register_debugfs(indio_dev); + if (ret < 0) + dev_warn(&spi->dev, "%s: failed to register debugfs", __func__); + + adi_adrv903x_ApiVersionGet(phy->palauDevice, &apiVersion); + adi_adrv903x_HwClose(phy->palauDevice); + + dev_info(&spi->dev, + "%s Rev %d, API version: %u.%u.%u.%u found", + spi_get_device_id(spi)->name, + phy->palauDevice->devStateInfo.deviceSiRev, + apiVersion.majorVer, apiVersion.minorVer, + apiVersion.maintenanceVer, apiVersion.buildVer); + + ret = jesd204_fsm_start(phy->jdev, JESD204_LINKS_ALL); + if (ret) + goto out_iio_device_unregister; + + return 0; + +out_iio_device_unregister: + iio_device_unregister(indio_dev); +out_clk_del_provider: + of_clk_del_provider(np); +out_disable_clocks: + clk_disable_unprepare(phy->dev_clk); + + return ret; +} + +static const struct spi_device_id adrv903x_id[] = { + { "adrv9032", ID_ADRV9032 }, + { "adrv9032r", ID_ADRV9032R }, + {} +}; +MODULE_DEVICE_TABLE(spi, adrv903x_id); + +static const struct of_device_id adrv903x_of_match[] = { + { .compatible = "adi,adrv9032" }, + { .compatible = "adi,adrv9032r" }, + {}, +}; +MODULE_DEVICE_TABLE(of, adrv903x_of_match); + +static struct spi_driver adrv903x_driver = { + .driver = { + .name = "adrv903x", + .of_match_table = of_match_ptr(adrv903x_of_match), + }, + .probe = adrv903x_probe, + .id_table = adrv903x_id, +}; +module_spi_driver(adrv903x_driver); + +MODULE_AUTHOR("George Mois "); +MODULE_DESCRIPTION("Analog Devices ADRV903X TRX"); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/iio/adc/adrv903x/adrv903x.h b/drivers/iio/adc/adrv903x/adrv903x.h new file mode 100644 index 0000000000000..862926cde125f --- /dev/null +++ b/drivers/iio/adc/adrv903x/adrv903x.h @@ -0,0 +1,219 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * ADRV903X + * + * Copyright 2020-2024 Analog Devices Inc. + * + * Licensed under the GPL-2. + */ + +#ifndef IIO_TRX_ADRV903X_H_ +#define IIO_TRX_ADRV903X_H_ + +#include "adi_adrv903x_utilities_types.h" +#include "adi_adrv903x_datainterface.h" +#include "adi_adrv903x_utilities.h" +#include "adi_adrv903x_radioctrl.h" +#include "adi_common_error_types.h" +#include "adi_adrv903x_version.h" +#include "adi_adrv903x_error.h" +#include "adi_adrv903x_cals.h" +#include "adi_adrv903x_core.h" +#include "adi_adrv903x_gpio.h" +#include "adi_adrv903x_user.h" +#include "adi_adrv903x_agc.h" +#include "adi_adrv903x_hal.h" +#include "adi_adrv903x_rx.h" +#include "adi_adrv903x_tx.h" +#include "adi_platform.h" + +#define MIN_GAIN_mdB 0 +#define MAX_RX_GAIN_mdB 32000 +#define MAX_OBS_RX_GAIN_mdB 32000 +#define RX_GAIN_STEP_mdB 500 + +enum debugfs_cmd { + DBGFS_NONE, + DBGFS_BIST_FRAMER_0_PRBS, + DBGFS_BIST_FRAMER_1_PRBS, + DBGFS_BIST_FRAMER_0_LOOPBACK, + DBGFS_BIST_FRAMER_1_LOOPBACK, + DBGFS_BIST_TONE, + DBGFS_TX0_QEC_STATUS, + DBGFS_TX1_QEC_STATUS, + DBGFS_TX2_QEC_STATUS, + DBGFS_TX3_QEC_STATUS, + DBGFS_TX4_QEC_STATUS, + DBGFS_TX5_QEC_STATUS, + DBGFS_TX6_QEC_STATUS, + DBGFS_TX7_QEC_STATUS, + DBGFS_TX0_LOL_STATUS, + DBGFS_TX1_LOL_STATUS, + DBGFS_TX2_LOL_STATUS, + DBGFS_TX3_LOL_STATUS, + DBGFS_TX4_LOL_STATUS, + DBGFS_TX5_LOL_STATUS, + DBGFS_TX6_LOL_STATUS, + DBGFS_TX7_LOL_STATUS, + DBGFS_RX0_QEC_STATUS, + DBGFS_RX1_QEC_STATUS, + DBGFS_RX2_QEC_STATUS, + DBGFS_RX3_QEC_STATUS, + DBGFS_RX4_QEC_STATUS, + DBGFS_RX5_QEC_STATUS, + DBGFS_RX6_QEC_STATUS, + DBGFS_RX7_QEC_STATUS, + DBGFS_RX0_ADC_STATUS, + DBGFS_RX1_ADC_STATUS, + DBGFS_RX2_ADC_STATUS, + DBGFS_RX3_ADC_STATUS, + DBGFS_RX4_ADC_STATUS, + DBGFS_RX5_ADC_STATUS, + DBGFS_RX6_ADC_STATUS, + DBGFS_RX7_ADC_STATUS, + DBGFS_ORX0_ADC_STATUS, + DBGFS_ORX1_ADC_STATUS, +}; + +enum adrv903x_rx_ext_info { + RX_QEC, + RX_DIG_DC, + RX_RF_BANDWIDTH, + RX_ADC, + RX_NCO_EN, + RX_NCO_FREQ, + RX_NCO_PHASE, + RX_NCO_BAND_SEL, + ORX_NCO_EN, + ORX_NCO_FREQ, + ORX_NCO_PHASE, + ORX_NCO_SEL, +}; + +enum adrv903x_tx_ext_info { + TX_QEC, + TX_LOL, + TX_RF_BANDWIDTH, + TX_LB_ADC, + TX_TEST_TONE_EN, + TX_TEST_TONE_FREQ, + TX_TEST_TONE_PHASE, + TX_TEST_TONE_NCO_SEL, + TX_TEST_TONE_ATTEN, +}; + +enum adrv903x_iio_voltage_in { + CHAN_RX1, + CHAN_RX2, + CHAN_RX3, + CHAN_RX4, + CHAN_RX5, + CHAN_RX6, + CHAN_RX7, + CHAN_RX8, + CHAN_OBS_RX1, + CHAN_OBS_RX2, +}; + +enum adrv903x_iio_voltage_out { + CHAN_TX1, + CHAN_TX2, + CHAN_TX3, + CHAN_TX4, + CHAN_TX5, + CHAN_TX6, + CHAN_TX7, + CHAN_TX8, +}; + +enum adrv903x_device_id { + ID_ADRV9032 = 0x01, + ID_ADRV9032R = 0x02, +}; + +struct adrv903x_debugfs_entry { + struct adrv903x_rf_phy *phy; + const char *propname; + void *out_value; + u32 val; + u8 size; + u8 cmd; +}; + +enum adrv903x_clocks { + RX_SAMPL_CLK, + TX_SAMPL_CLK, + OBS_SAMPL_CLK, + NUM_ADRV903X_CLKS, +}; + +struct adrv903x_clock { + struct clk_hw hw; + struct spi_device *spi; + struct adrv903x_rf_phy *phy; + unsigned long rate; + enum adrv903x_clocks source; +}; + +#define to_clk_priv(_hw) container_of(_hw, struct adrv903x_clock, hw) +#define MAX_NUM_GAIN_TABLES 10 + +struct adrv903x_rf_phy { + struct spi_device *spi; + adi_adrv903x_Device_t adi_adrv903x_device; + adi_adrv903x_Device_t *palauDevice; + adi_adrv903x_SpiConfigSettings_t spiSettings; + adi_adrv903x_SpiOptions_t spiOptions; + adi_adrv903x_Init_t deviceInitStruct; + adi_adrv903x_TrxFileInfo_t trxBinaryInfoPtr; + adi_adrv903x_PostMcsInit_t adrv903xPostMcsInitInst; + adi_adrv903x_InitCals_t cal_mask; + + struct jesd204_dev *jdev; + /* protect against device accesses */ + struct mutex lock; + + u32 tx_iqRate_kHz; + u32 rx_iqRate_kHz; + u32 orx_iqRate_kHz; + + adi_hal_Cfg_t linux_hal; + struct clk *dev_clk; + + struct clk *clks[NUM_ADRV903X_CLKS]; + struct adrv903x_clock clk_priv[NUM_ADRV903X_CLKS]; + struct clk_onecell_data clk_data; + struct adrv903x_debugfs_entry debugfs_entry[342]; + struct iio_dev *indio_dev; + + struct gpio_desc *sysref_req_gpio; + + u8 device_id; + + u32 adrv903x_debugfs_entry_index; + u32 tracking_cal_mask; + + bool is_initialized; + int spi_device_id; + bool tx_test_tone_en[8]; + u32 tx_test_tone_freq_khz[8]; + u32 tx_test_tone_phase[8]; + u8 tx_test_tone_nco_sel[8]; + u8 tx_test_tone_atten[8]; + bool rx_nco_en[8]; + s32 rx_nco_freq_khz[8]; + u32 rx_nco_phase[8]; + u8 rx_nco_band_sel[8]; + bool orx_nco_en[2]; + s32 orx_nco_freq_khz[2]; + u32 orx_nco_phase[2]; + u8 orx_nco_sel[2]; +}; + +int adrv903x_hdl_loopback(struct adrv903x_rf_phy *phy, bool enable); +int adrv903x_register_axi_converter(struct adrv903x_rf_phy *phy); +struct adrv903x_rf_phy *adrv903x_spi_to_phy(struct spi_device *spi); +int adrv903x_spi_read(struct spi_device *spi, u32 reg); +int adrv903x_spi_write(struct spi_device *spi, u32 reg, u32 val); + +#endif diff --git a/drivers/iio/adc/adrv903x/adrv903x_conv.c b/drivers/iio/adc/adrv903x/adrv903x_conv.c new file mode 100644 index 0000000000000..c4a9eec6dd767 --- /dev/null +++ b/drivers/iio/adc/adrv903x/adrv903x_conv.c @@ -0,0 +1,246 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ADRV903X RF Transceiver + * + * Copyright 2020-2023 Analog Devices Inc. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "adrv903x.h" + +#if IS_ENABLED(CONFIG_CF_AXI_ADC) +#include "../cf_axi_adc.h" + +#define AIM_CHAN(_chan, _mod, _si, _bits, _sign) \ + { \ + .type = IIO_VOLTAGE, .indexed = 1, .modified = 1, \ + .channel = _chan, .channel2 = _mod, \ + .info_mask_separate = BIT(IIO_CHAN_INFO_CALIBSCALE) | \ + BIT(IIO_CHAN_INFO_CALIBBIAS) | \ + BIT(IIO_CHAN_INFO_CALIBPHASE), \ + .info_mask_shared_by_type = BIT( \ + IIO_CHAN_INFO_SAMP_FREQ), /*.ext_info = axiadc_ext_info,*/ \ + .scan_index = _si, \ + .scan_type = { \ + .sign = _sign, \ + .realbits = _bits, \ + .storagebits = 16, \ + .shift = 0, \ + }, \ + } + +#define AIM_MC_CHAN(_chan, _si, _bits, _sign) \ + { \ + .type = IIO_VOLTAGE, .indexed = 1, .channel = _chan, \ + .scan_index = _si, \ + .scan_type = { \ + .sign = _sign, \ + .realbits = _bits, \ + .storagebits = 16, \ + .shift = 0, \ + }, \ + } + +static const struct axiadc_chip_info axiadc_chip_info_tbl[] = { + [ID_ADRV9032] = { + .name = "ADRV903X", + .max_rate = 245760000, + .max_testmode = 0, + .num_channels = 16, + .channel[0] = AIM_CHAN(0, IIO_MOD_I, 0, 16, 'S'), + .channel[1] = AIM_CHAN(0, IIO_MOD_Q, 1, 16, 'S'), + .channel[2] = AIM_CHAN(1, IIO_MOD_I, 2, 16, 'S'), + .channel[3] = AIM_CHAN(1, IIO_MOD_Q, 3, 16, 'S'), + .channel[4] = AIM_CHAN(2, IIO_MOD_I, 4, 16, 'S'), + .channel[5] = AIM_CHAN(2, IIO_MOD_Q, 5, 16, 'S'), + .channel[6] = AIM_CHAN(3, IIO_MOD_I, 6, 16, 'S'), + .channel[7] = AIM_CHAN(3, IIO_MOD_Q, 7, 16, 'S'), + .channel[8] = AIM_CHAN(4, IIO_MOD_I, 8, 16, 'S'), + .channel[9] = AIM_CHAN(4, IIO_MOD_Q, 9, 16, 'S'), + .channel[10] = AIM_CHAN(5, IIO_MOD_I, 10, 16, 'S'), + .channel[11] = AIM_CHAN(5, IIO_MOD_Q, 11, 16, 'S'), + .channel[12] = AIM_CHAN(6, IIO_MOD_I, 12, 16, 'S'), + .channel[13] = AIM_CHAN(6, IIO_MOD_Q, 13, 16, 'S'), + .channel[14] = AIM_CHAN(7, IIO_MOD_I, 14, 16, 'S'), + .channel[15] = AIM_CHAN(7, IIO_MOD_Q, 15, 16, 'S'), + }, + [ID_ADRV9032R] = { + .name = "ADRV9032R", + .max_rate = 245760000, + .max_testmode = 0, + .num_channels = 4, + .channel[0] = AIM_CHAN(0, IIO_MOD_I, 0, 16, 'S'), + .channel[1] = AIM_CHAN(0, IIO_MOD_Q, 1, 16, 'S'), + .channel[2] = AIM_CHAN(1, IIO_MOD_I, 2, 16, 'S'), + .channel[3] = AIM_CHAN(1, IIO_MOD_Q, 3, 16, 'S'), + }, +}; + +static int adrv903x_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, int *val, + int *val2, long m) +{ + struct axiadc_converter *conv = iio_device_get_drvdata(indio_dev); + + switch (m) { + case IIO_CHAN_INFO_SAMP_FREQ: + if (!conv->clk) + return -ENODEV; + + *val = conv->adc_clk = clk_get_rate(conv->clk); + + return IIO_VAL_INT; + } + return -EINVAL; +} + +static int adrv903x_write_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, int val, + int val2, long mask) +{ + switch (mask) { + case IIO_CHAN_INFO_SAMP_FREQ: + return -ENODEV; + default: + return -EINVAL; + } + + return 0; +} + +int adrv903x_hdl_loopback(struct adrv903x_rf_phy *phy, bool enable) +{ + struct axiadc_converter *conv = spi_get_drvdata(phy->spi); + unsigned int reg, addr, chan, version; + struct axiadc_state *st; + + if (!conv) + return -ENODEV; + + st = iio_priv(conv->indio_dev); + version = axiadc_read(st, 0x4000); + + addr = 0x4418; + + for (chan = 0; chan < conv->chip_info->num_channels; chan++) { + reg = axiadc_read(st, addr + (chan) * 0x40); + + if (enable && reg != 0x8) { + conv->scratch_reg[chan] = reg; + reg = 0x8; + } else if (reg == 0x8) { + reg = conv->scratch_reg[chan]; + } + + axiadc_write(st, addr + (chan) * 0x40, reg); + } + + return 0; +} +EXPORT_SYMBOL(adrv903x_hdl_loopback); + +static int adrv903x_post_setup(struct iio_dev *indio_dev) +{ + struct axiadc_state *st = iio_priv(indio_dev); + struct axiadc_converter *conv = iio_device_get_drvdata(indio_dev); + unsigned int tmp, num_chan; + int i; + + num_chan = conv->chip_info->num_channels; + + conv->indio_dev = indio_dev; + axiadc_write(st, ADI_REG_CNTRL, 0); + tmp = axiadc_read(st, 0x4048); + + tmp &= ~BIT(5); + axiadc_write(st, 0x4048, tmp); + axiadc_write(st, 0x404c, 3); /* RATE */ + + for (i = 0; i < num_chan; i++) { + axiadc_write(st, ADI_REG_CHAN_CNTRL_1(i), ADI_DCFILT_OFFSET(0)); + axiadc_write(st, ADI_REG_CHAN_CNTRL_2(i), + (i & 1) ? 0x00004000 : 0x40000000); + axiadc_write(st, ADI_REG_CHAN_CNTRL(i), + ADI_FORMAT_SIGNEXT | ADI_FORMAT_ENABLE | + ADI_ENABLE | ADI_IQCOR_ENB); + } + + return 0; +} + +int adrv903x_register_axi_converter(struct adrv903x_rf_phy *phy) +{ + struct axiadc_converter *conv; + struct spi_device *spi = phy->spi; + + conv = devm_kzalloc(&spi->dev, sizeof(*conv), GFP_KERNEL); + if (!conv) + return -ENOMEM; + + conv->chip_info = &axiadc_chip_info_tbl[phy->spi_device_id]; + conv->write_raw = adrv903x_write_raw; + conv->read_raw = adrv903x_read_raw; + conv->post_setup = adrv903x_post_setup; + conv->spi = spi; + conv->phy = phy; + + conv->clk = phy->clks[RX_SAMPL_CLK]; + conv->adc_clk = clk_get_rate(conv->clk); + + spi_set_drvdata(spi, conv); /* Take care here */ + + return 0; +} +EXPORT_SYMBOL(adrv903x_register_axi_converter); + +struct adrv903x_rf_phy *adrv903x_spi_to_phy(struct spi_device *spi) +{ + struct axiadc_converter *conv = spi_get_drvdata(spi); + + return conv->phy; +} +EXPORT_SYMBOL(adrv903x_spi_to_phy); + +#else /* CONFIG_CF_AXI_ADC */ + +int adrv903x_hdl_loopback(struct adrv903x_rf_phy *phy, bool enable) +{ + return -ENODEV; +} +EXPORT_SYMBOL(adrv903x_hdl_loopback); + +int adrv903x_register_axi_converter(struct adrv903x_rf_phy *phy) +{ + struct spi_device *spi = phy->spi; + + spi_set_drvdata(spi, phy); /* Take care here */ + + return 0; +} +EXPORT_SYMBOL(adrv903x_register_axi_converter); + +struct adrv903x_rf_phy *adrv903x_spi_to_phy(struct spi_device *spi) +{ + return spi_get_drvdata(spi); +} +EXPORT_SYMBOL(adrv903x_spi_to_phy); + +#endif /* CONFIG_CF_AXI_ADC */ diff --git a/drivers/iio/adc/adrv903x/platforms/adi_library_types.h b/drivers/iio/adc/adrv903x/platforms/adi_library_types.h index 7188992b38c1d..e2f117ca48c95 100644 --- a/drivers/iio/adc/adrv903x/platforms/adi_library_types.h +++ b/drivers/iio/adc/adrv903x/platforms/adi_library_types.h @@ -54,27 +54,55 @@ typedef time64_t time_t; #define ADI_LIBRARY_OFFSETOF offsetof /* stdio.h */ +#ifndef __KERNEL__ #define ADI_LIBRARY_PRINTF printf #define ADI_LIBRARY_FPRINTF fprintf +#else +#define ADI_LIBRARY_PRINTF printk +#define ADI_LIBRARY_FPRINTF adrv903x_fprintf +#endif #define ADI_LIBRARY_SPRINTF sprintf #define ADI_LIBRARY_SNPRINTF snprintf #define ADI_LIBRARY_VPRINTF vprintf #define ADI_LIBRARY_VSNPRINTF vsnprintf +#ifndef __KERNEL__ #define ADI_LIBRARY_FFLUSH fflush #define ADI_LIBRARY_FSEEK fseek #define ADI_LIBRARY_FREAD fread #define ADI_LIBRARY_FWRITE fwrite +#else +#define ADI_LIBRARY_FFLUSH adrv903x_fflush +#define ADI_LIBRARY_FSEEK adrv903x_fseek +#define ADI_LIBRARY_FREAD adrv903x_fread +#define ADI_LIBRARY_FWRITE adrv903x_fwrite +#endif + #define ADI_LIBRARY_FOPEN fopen #define ADI_LIBRARY_FOPEN_S fopen_s +#ifndef __KERNEL__ #define ADI_LIBRARY_FCLOSE fclose #define ADI_LIBRARY_FTELL ftell #define ADI_LIBRARY_FERROR ferror +#else +#define ADI_LIBRARY_FCLOSE adrv903x_fclose +#define ADI_LIBRARY_FTELL adrv903x_ftell +#define ADI_LIBRARY_FERROR adrv903x_ferror +#endif #define ADI_LIBRARY_SETVBUF setvbuf +#ifndef __KERNEL__ #define ADI_LIBRARY_FGETS fgets +#else +#define ADI_LIBRARY_FGETS adrv903x_fgets +#endif /* stdlib.h */ +#ifndef __KERNEL__ #define ADI_LIBRARY_CALLOC calloc #define ADI_LIBRARY_FREE free +#else +#define ADI_LIBRARY_CALLOC __adrv903x_calloc +#define ADI_LIBRARY_FREE kfree +#endif #define ADI_LIBRARY_RAND rand #define ADI_LIBRARY_EXIT exit #define ADI_LIBRARY_ABS abs @@ -116,7 +144,11 @@ typedef time64_t time_t; /* time.h */ +#ifndef __KERNEL__ #define ADI_LIBRARY_TIME time +#else +#define ADI_LIBRARY_TIME adrv903x_time +#endif #define ADI_LIBRARY_LOCALTIME_R localtime_r #define ADI_LIBRARY_MKTIME mktime #define ADI_LIBRARY_CTIME ctime @@ -139,7 +171,7 @@ typedef time64_t time_t; * it gives a pointer to an array and not an actual array so be careful using sizeof() with it, or * taking its address! */ -/*#define ADI_PLATFORM_LARGE_VARS_ON_HEAP*/ +#define ADI_PLATFORM_LARGE_VARS_ON_HEAP #ifdef ADI_PLATFORM_LARGE_VARS_ON_HEAP diff --git a/drivers/iio/adc/adrv903x/platforms/adi_platform.c b/drivers/iio/adc/adrv903x/platforms/adi_platform.c index d4b0b34631148..310f4f945262c 100644 --- a/drivers/iio/adc/adrv903x/platforms/adi_platform.c +++ b/drivers/iio/adc/adrv903x/platforms/adi_platform.c @@ -22,8 +22,12 @@ #include "posix/posix_mutex.h" #endif +#ifdef __KERNEL__ +#include "linux_platform.h" +#else #include "../platforms/common/tls.h" #include "../platforms/common/adi_logging.h" +#endif /* * Function pointer assignment for default configuration @@ -110,8 +114,10 @@ adi_hal_Err_e (*adi_hal_BbicRegistersWrite)(void* const devHalCfg, const uint32_t data[], const uint32_t numDataWords) = NULL; +#ifndef __KERNEL__ /* Thread Interface */ adi_hal_thread_t (*adi_hal_ThreadSelf)(void) = NULL; +#endif adi_hal_Err_e (*adrv903x_TlsSet)(const adi_hal_TlsType_e tlsType, void* const value) = NULL; diff --git a/drivers/iio/adc/adrv903x/platforms/adi_platform_types.h b/drivers/iio/adc/adrv903x/platforms/adi_platform_types.h index 71c29c4c49d3e..8ec3448e8ac66 100644 --- a/drivers/iio/adc/adrv903x/platforms/adi_platform_types.h +++ b/drivers/iio/adc/adrv903x/platforms/adi_platform_types.h @@ -292,6 +292,11 @@ typedef struct adi_hal_Cfg adi_hal_EepromCfg_t eepromCfg; /*!< Eeprom Configuration */ #endif int32_t error; /*!< Operating System Error Code */ +#ifdef __KERNEL__ + struct spi_device *spi; + struct gpio_desc *reset_gpio; + struct gpio_desc *int_gpio; +#endif } adi_hal_Cfg_t; /** @@ -308,4 +313,40 @@ typedef struct adi_hal_BoardInfo uint8_t bomRev[ADI_HAL_STRING_LENGTH]; /* BOM Revision */ } adi_hal_BoardInfo_t; +#ifdef __KERNEL__ +typedef struct linux_hal_fileio +{ + adi_hal_Cfg_t *hal; + const struct firmware *fw; + char *ptr, *start, *end; +} FILE; + +FILE* fopen(const char * filename, const char *mode); + +struct tm* gmtime(const ktime_t *timer); + +extern int adrv903x_fseek (FILE * stream, long int offset, int origin); +extern size_t adrv903x_fread(void *ptr, size_t size, size_t count, FILE *stream); +extern size_t adrv903x_fwrite(const void * ptr, size_t size, size_t count, FILE *stream); +extern int adrv903x_fprintf(FILE *stream, const char *fmt, ...); +extern int adrv903x_fclose(FILE *stream); +extern long int adrv903x_ftell(FILE *stream); +extern int adrv903x_ferror(FILE *stream); +extern char *adrv903x_fgets(char *dst, int num, FILE *stream); +extern int adrv903x_fflush(FILE *stream); + +extern FILE* adrv903x_fopen (adi_hal_Cfg_t *hal, const char * filename, const char *mode); +#define fopen(filename, mode) adrv903x_fopen(device->common.devHalInfo, filename, mode) + +extern void *adrv903x_malloc(size_t size); +#define malloc(size) adrv903x_malloc(size) + +extern void *__adrv903x_calloc(size_t size, size_t nmemb); + +extern void adrv903x_time(ktime_t *second); +extern struct tm* adrv903x_gmtime(adi_hal_Cfg_t *hal, const ktime_t *timer); +#define gmtime(timer) adrv903x_gmtime(device->common.devHalInfo, timer) + +#endif + #endif /* __ADI_PLATFORM_TYPES_H__*/ diff --git a/drivers/iio/adc/adrv903x/platforms/linux_platform.c b/drivers/iio/adc/adrv903x/platforms/linux_platform.c index 2483058bb67d2..c301aa3f8180d 100644 --- a/drivers/iio/adc/adrv903x/platforms/linux_platform.c +++ b/drivers/iio/adc/adrv903x/platforms/linux_platform.c @@ -5,24 +5,16 @@ * see the "LICENSE.txt" file in this zip file. */ -#include -#include #include #include #include -#include -#include -#include #include +#include #include - -#include "adi_platform.h" -#include "adi_platform_impl_types.h" - -#include "adi_common_error.h" - -#define ADI_HAL_OK ADI_HAL_ERR_OK -#define ADI_HAL_NULL_PTR ADI_HAL_ERR_NULL_PTR +#include +#include +#include +#include "linux_platform.h" typedef struct { @@ -32,121 +24,138 @@ typedef struct /* ADI Error Reporting Dependency on HAL_TLS_ERR being set to NULL if not configured */ static thread_to_value_t store = { NULL }; -/** - * \brief Opens a logFile. If the file is already open it will be closed and reopened. - * - * This function opens the file for writing and saves the resulting file - * descriptor to the devHalCfg structure. - * - * \param devHalCfg Pointer to device instance specific platform settings - * \param filename The user provided name of the file to open. - * - * \retval ADI_HAL_OK Function completed successfully, no action required - * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer - * \retval ADI_HAL_LOGGING_FAIL If the function failed to open or write to the specified filename - */ -adi_hal_Err_e linux_adrv903x_LogFileOpen(void *devHalCfg, const char *filename) +#include "adi_common_error.h" + +adi_hal_Err_e linux_adrv903x_HwOpen(void *devHalCfg) { - return ADI_HAL_OK; + return ADI_HAL_ERR_OK; } -/** - * \brief Flushes the logFile buffer to the currently open log file. - * - * \param devHalCfg Pointer to device instance specific platform settings - * - * \retval ADI_HAL_OK Function completed successfully, no action required - * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer - */ -adi_hal_Err_e linux_adrv903x_LogFileFlush(void *devHalCfg) +ADI_API adi_hal_Err_e linux_adrv903x_HwReset(void *devHalCfg, u8 pinLevel) { - return ADI_HAL_OK; + adi_hal_Cfg_t *halCfg; + + if (!devHalCfg) + return ADI_HAL_ERR_NULL_PTR; + + halCfg = (adi_hal_Cfg_t *)devHalCfg; + + gpiod_set_value(halCfg->reset_gpio, pinLevel); + + return ADI_HAL_ERR_OK; } -/** - * \brief Gracefully closes the log file(s). - * - * \param devHalCfg Pointer to device instance specific platform settings - * - * \retval ADI_HAL_OK Function completed successfully, no action required - * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer - * \retval ADI_HAL_LOGGING_FAIL Error while flushing or closing the log file. - */ -adi_hal_Err_e linux_adrv903x_LogFileClose(void *devHalCfg) +ADI_API adi_hal_Err_e linux_adrv903x_HwClose(void *devHalCfg) { - return ADI_HAL_OK; + return ADI_HAL_ERR_OK; } -/** - * \brief Get logging status. Functions has no effect since logging is - * disabled on Linux. - * - * \param devHalCfg Pointer to device instance specific platform settings - * \param logStatus Logging status. - * - * \retval ADI_HAL_OK Function completed successfully, no action required - */ -adi_hal_Err_e linux_LogStatusGet(void* devHalCfg, adi_hal_LogStatusGet_t* const logStatus) +ADI_API adi_hal_Err_e linux_adrv903x_SpiWrite(void * const devHalCfg, + const u8 txData[], + const u32 numTxBytes) { - return ADI_HAL_OK; + static const u32 MAX_SIZE = 4096; + u32 toWrite = 0; + s32 remaining = numTxBytes; + s32 halError = (s32)ADI_HAL_ERR_OK; + adi_hal_Cfg_t *halCfg = NULL; + + if (!devHalCfg) { + halError = (s32)ADI_HAL_ERR_NULL_PTR; + return halError; + } + + halCfg = (adi_hal_Cfg_t *)devHalCfg; + + if (halCfg->spiCfg.interfaceEnabled != 0) { + s32 result = 0; + + do { + toWrite = (remaining > MAX_SIZE) ? MAX_SIZE : remaining; + result = spi_write(halCfg->spi, + &txData[numTxBytes - remaining], + toWrite); + if (result < 0) + return ADI_HAL_ERR_SPI_WRITE; + + remaining -= toWrite; + } while (remaining > 0); + } + + return halError; } -/** - * \brief Set console output. Functions has no effect since logging is - * disabled on Linux. - * - * \param devHalCfg Pointer to device instance specific platform settings - * \param logConsoleFlag Console logging enable flag. - * - * \retval ADI_HAL_OK Function completed successfully, no action required - */ -adi_hal_Err_e linux_LogConsoleSet(void* devHalCfg, const adi_hal_LogConsole_e logConsoleFlag) +ADI_API adi_hal_Err_e linux_adrv903x_SpiRead(void *const devHalCfg, + const u8 txData[], + u8 rxData[], + const u32 numTxRxBytes) { - return ADI_HAL_OK; + static const u32 MAX_SIZE = 4096; + s32 remaining = numTxRxBytes; + s32 halError = (s32)ADI_HAL_ERR_OK; + s32 result = 0; + adi_hal_Cfg_t *halCfg = NULL; + + if (!devHalCfg) { + halError = (s32)ADI_HAL_ERR_NULL_PTR; + return halError; + } + + halCfg = (adi_hal_Cfg_t *)devHalCfg; + + if (halCfg->spiCfg.interfaceEnabled != 0) { + do { + struct spi_transfer t = { + .tx_buf = &txData[numTxRxBytes - remaining], + .rx_buf = &rxData[numTxRxBytes - remaining], + .len = (remaining > MAX_SIZE) ? MAX_SIZE : + remaining, + }; + + result = spi_sync_transfer(halCfg->spi, &t, 1); + if (result < 0) + halError = ADI_HAL_ERR_SPI_READ; + + remaining -= t.len; + } while (remaining > 0); + } + + return halError; } -/** - * \brief Sets the log level, allowing the end user to select the granularity of - * what events get logged. - * - * \param devHalCfg Pointer to device instance specific platform settings - * \param logLevel A mask of valid log levels to allow to be written to the log file. - * - * \retval ADI_ADRV903X_ERR_ACT_CHECK_PARAM Recovery action for bad parameter check - * \retval ADI_ADRV903X_ERR_ACT_NONE Function completed successfully, no action required - */ -adi_hal_Err_e linux_adrv903x_LogLevelSet(void *devHalCfg, const uint32_t logMask) +ADI_API adi_hal_Err_e linux_adrv903x_LogFileOpen(void *devHalCfg, const char *filename) +{ + return ADI_HAL_ERR_OK; +} + +ADI_API adi_hal_Err_e linux_adrv903x_LogFileClose(void *devHalCfg) +{ + return ADI_HAL_ERR_OK; +} + +ADI_API adi_hal_Err_e linux_adrv903x_LogLevelSet(void *const devHalCfg, + const u32 logMask) { adi_hal_Cfg_t *halCfg = NULL; - if (devHalCfg == NULL) { - return ADI_COMMON_ERR_ACT_CHECK_PARAM; - } + if (!devHalCfg) + return ADI_HAL_ERR_PARAM; halCfg = (adi_hal_Cfg_t *)devHalCfg; - halCfg->logCfg.logMask = (logMask & (int32_t)ADI_HAL_LOG_ALL); + halCfg->logCfg.logMask = (logMask & (s32)ADI_HAL_LOG_ALL); - return ADI_COMMON_ERR_ACT_NONE; + return ADI_HAL_ERR_OK; } -/** - * \brief Gets the currently set log level: the mask of different types of log - * events that are currently enabled to be logged. - * - * \param devHalCfg Pointer to device instance specific platform settings - * \param logLevel Returns the current log level mask. - * - * \retval ADI_HAL_OK Function completed successfully, no action required - * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer - */ -adi_hal_Err_e linux_adrv903x_LogLevelGet(void *devHalCfg, uint32_t* const logMask) +ADI_API adi_hal_Err_e linux_adrv903x_LogLevelGet(void *const devHalCfg, + u32 *const logMask) { - int32_t halError = (int32_t)ADI_HAL_OK; + s32 halError = (s32)ADI_HAL_ERR_OK; adi_hal_Cfg_t *halCfg = NULL; - if (devHalCfg == NULL) { - halError = (int32_t)ADI_HAL_NULL_PTR; + if (!devHalCfg) { + halError = (s32)ADI_HAL_ERR_NULL_PTR; return halError; } @@ -157,90 +166,75 @@ adi_hal_Err_e linux_adrv903x_LogLevelGet(void *devHalCfg, uint32_t* const logMas return halError; } -/** - * \brief Writes a message to the currently open logFile specified in the - * adi_hal_LogCfg_t of the devHalCfg structure passed - * - * Uses the vfprintf functionality to allow the user to supply the format and - * the number of aguments that will be logged. - * - * \param devHalCfg Pointer to device instance specific platform settings - * \param logLevel the log level to be written into - * \param comment the string to include in the line added to the log. - * \param argp variable argument list to be printed - * - * \retval ADI_HAL_OK Function completed successfully, no action required - * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer - * \retval ADI_HAL_LOGGING_FAIL If the function failed to flush to write - */ - -adi_hal_Err_e linux_adrv903x_LogWrite(void *devHalCfg, const adrv903x_LogLevel_e logLevel, - const uint8_t indent, const char* const comment, - va_list argp) +ADI_API adi_hal_Err_e linux_adrv903x_LogWrite(void *const devHalCfg, + const adi_hal_LogLevel_e logLevel, + const u8 indent, + const char *const comment, + va_list argp) { - int32_t halError = (int32_t)ADI_HAL_OK; - int32_t result = 0; + s32 halError = (s32)ADI_HAL_ERR_OK; + s32 result = 0; adi_hal_Cfg_t *halCfg = NULL; static char logMessage[ADI_HAL_MAX_LOG_LINE] = { 0 }; const char *logLevelChar = NULL; logMessage[0] = 0; - if (devHalCfg == NULL) { - halError = (int32_t)ADI_HAL_NULL_PTR; + if (!devHalCfg) { + halError = (s32)ADI_HAL_ERR_NULL_PTR; return halError; } halCfg = (adi_hal_Cfg_t *)devHalCfg; - if (halCfg->logCfg.logMask == (int32_t)ADI_HAL_LOG_NONE) { + if (halCfg->logCfg.logMask == (s32)ADI_HAL_LOG_NONE) { /* If logging disabled, exit gracefully */ - halError = (int32_t)ADI_HAL_OK; + halError = (s32)ADI_HAL_ERR_OK; return halError; } - if (logLevel > (int32_t)ADI_HAL_LOG_ALL) { - halError = (int32_t)ADI_HAL_ERR_LOG; + if (logLevel > (s32)ADI_HAL_LOG_ALL) { + halError = (s32)ADI_HAL_ERR_LOG; return halError; } /* Print Log type */ if ((halCfg->logCfg.logMask & ADI_HAL_LOG_MSG) && - (logLevel == (int32_t)ADI_HAL_LOG_MSG)) { + (logLevel == (s32)ADI_HAL_LOG_MSG)) { logLevelChar = "MESSAGE:"; } else if ((halCfg->logCfg.logMask & ADI_HAL_LOG_WARN) && - (logLevel == (int32_t)ADI_HAL_LOG_WARN)) { + (logLevel == (s32)ADI_HAL_LOG_WARN)) { logLevelChar = "WARNING:"; } else if ((halCfg->logCfg.logMask & ADI_HAL_LOG_ERR) && - (logLevel == (int32_t)ADI_HAL_LOG_ERR)) { + (logLevel == (s32)ADI_HAL_LOG_ERR)) { logLevelChar = "ERROR:"; } else if ((halCfg->logCfg.logMask & ADI_HAL_LOG_API) && - (logLevel == (int32_t)ADI_HAL_LOG_API)) { + (logLevel == (s32)ADI_HAL_LOG_API)) { logLevelChar = "API_LOG:"; } else if ((halCfg->logCfg.logMask & ADI_HAL_LOG_HAL) && - (logLevel == (int32_t)ADI_HAL_LOG_HAL)) { + (logLevel == (s32)ADI_HAL_LOG_HAL)) { logLevelChar = "ADI_HAL_LOG:"; } else if ((halCfg->logCfg.logMask & ADI_HAL_LOG_SPI) && - (logLevel == (int32_t)ADI_HAL_LOG_SPI)) { + (logLevel == (s32)ADI_HAL_LOG_SPI)) { logLevelChar = "SPI_LOG:"; } else if ((halCfg->logCfg.logMask & ADI_HAL_LOG_API_PRIV) && - (logLevel == (int32_t)ADI_HAL_LOG_API_PRIV)) { + (logLevel == (s32)ADI_HAL_LOG_API_PRIV)) { logLevelChar = "API_PRIV_LOG:"; } else { /* Nothing to log - exit cleanly */ - return (int32_t)ADI_HAL_OK; + return (s32)ADI_HAL_ERR_OK; } result = snprintf(logMessage, ADI_HAL_MAX_LOG_LINE, "%s", logLevelChar); if (result < 0) { - halError = (int32_t)ADI_HAL_ERR_LOG; + halError = (s32)ADI_HAL_ERR_LOG; return halError; } result = vsnprintf(logMessage + strlen(logMessage), ADI_HAL_MAX_LOG_LINE, comment, argp); if (result < 0) { - halError = (int32_t)ADI_HAL_ERR_LOG; + halError = (s32)ADI_HAL_ERR_LOG; return halError; } @@ -273,307 +267,27 @@ adi_hal_Err_e linux_adrv903x_LogWrite(void *devHalCfg, const adrv903x_LogLevel_e return halError; } -/** - * \brief Opens/allocates any necessary resources to communicate via SPI to a - * particular device specified in the devHalCfg structure. - * - * This function should perform any necessary steps to open the SPI master resource - * on the BBIC to enable SPI communications to a particular SPI device. - * - * \param devHalCfg Pointer to device instance specific platform settings - * - * \retval ADI_HAL_OK function completed successfully, no action required - * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer - * \retval ADI_HAL_SPI_FAIL the device driver was not opened successfully - */ -adi_hal_Err_e linux_adrv903x_SpiOpen(void *devHalCfg) -{ - return ADI_HAL_OK; -} - -/** - * \brief Closes any resources open/allocated for a specific SPI device - * - * Any information needed to close the particular SPI device should be passed in - * the devHalCfg structure. - * - * \param devHalCfg Pointer to device instance specific platform settings - * - * \retval ADI_HAL_OK function completed successfully, no action required - * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer - * \retval ADI_HAL_SPI_FAIL the device driver was not closed successfully - */ -adi_hal_Err_e linux_adrv903x_SpiClose(void *devHalCfg) -{ - return ADI_HAL_OK; -} - -/** - * \brief Initializes the SPI device driver mode, bits per word, and speed - * - * Any settings needed should be passed in the devHalCfg structure - * - * \param devHalCfg Pointer to device instance specific platform settings - * - * \retval ADI_HAL_OK function completed successfully, no action required - * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer - * \retval ADI_HAL_SPI_FAIL the SPI initialization failed - */ -int32_t linux_adrv903x_SpiInit(void *devHalCfg) -{ - return ADI_HAL_OK; -} - -/** - * \brief Write an array of 8-bit data to a SPI device - * - * The function will write numTxBytes number of bytes to the SPI device - * selected in the devHalCfg structure. - * - * \param devHalCfg Pointer to device instance specific platform settings - * \param txData Pointer to byte array txData buffer that has numTxBytes number of bytes - * \param numTxBytes The length of txData array - * - * \retval ADI_HAL_OK function completed successfully, no action required - * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer - * \retval ADI_HAL_SPI_FAIL the data was not written successfully - */ -adi_hal_Err_e linux_adrv903x_SpiWrite(void *devHalCfg, const uint8_t txData[], - uint32_t numTxBytes) -{ - static const uint32_t MAX_SIZE = 4096; - uint32_t toWrite = 0; - int32_t remaining = numTxBytes; - int32_t halError = (int32_t)ADI_HAL_OK; - adi_hal_Cfg_t *halCfg = NULL; - - if (devHalCfg == NULL) { - halError = (int32_t)ADI_HAL_NULL_PTR; - return halError; - } - - halCfg = (adi_hal_Cfg_t *)devHalCfg; - - if (halCfg->spiCfg.interfaceEnabled != 0) { - int32_t result = 0; - do { - toWrite = (remaining > MAX_SIZE) ? MAX_SIZE : remaining; - result = spi_write(halCfg->spi, - &txData[numTxBytes - remaining], - toWrite); - if (result < 0) { - return ADI_HAL_ERR_SPI_WRITE; - } - remaining -= toWrite; - } while (remaining > 0); - } - - return halError; -} - -/** - * \brief Read one or more bytes from the device specified by the devHalCfg structure - * - * The function will read numTxRxBytes number of bytes from the SPI device selected in - * the devHalCfg parameter and store the resulting data sent by the device in the rxData - * data buffer. - * - * For each byte in txData written to the device, a byte is read and returned by this - * function at the pointer provided by the rxData parameter. - * - * \param devHalCfg Pointer to device instance specific platform settings - * \param txData Pointer to byte array that has numTxRxBytes number of bytes - * \param rxData Pointer to byte array where read back data will be returned, that is at least numTxRxBytes in size. - * \param numTxBytes The length of txData and rxData arrays - * - * \retval ADI_HAL_OK function completed successfully, no action required - * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer - * \retval ADI_HAL_SPI_FAIL the data was not read successfully - */ -adi_hal_Err_e linux_adrv903x_SpiRead(void *devHalCfg, const uint8_t txData[], uint8_t rxData[], - uint32_t numTxRxBytes) -{ - static const uint32_t MAX_SIZE = 4096; - int32_t remaining = numTxRxBytes; - int32_t halError = (int32_t)ADI_HAL_OK; - int32_t result = 0; - adi_hal_Cfg_t *halCfg = NULL; - - if (devHalCfg == NULL) { - halError = (int32_t)ADI_HAL_NULL_PTR; - return halError; - } - - halCfg = (adi_hal_Cfg_t *)devHalCfg; - - if (halCfg->spiCfg.interfaceEnabled != 0) { - do { - struct spi_transfer t = { - .tx_buf = &txData[numTxRxBytes - remaining], - .rx_buf = &rxData[numTxRxBytes - remaining], - .len = (remaining > MAX_SIZE) ? MAX_SIZE : - remaining, - }; - - result = spi_sync_transfer(halCfg->spi, &t, 1); - if (result < 0) { - halError = ADI_HAL_ERR_SPI_READ; - } - - remaining -= t.len; - } while (remaining > 0); - } - - return halError; -} - -/** - * \brief Function to open/allocate any necessary resources for the timer wait - * functions below. - * - * \param devHalCfg Pointer to device instance specific platform settings - * - * \retval ADI_HAL_OK Function completed successfully - */ -int32_t linux_adrv903x_TimerOpen(void *devHalCfg) -{ - /* ADI ZC706 platform does not require any timer open /close */ - return (int32_t)ADI_HAL_OK; -} - -/** - * \brief Function to close any necessary resources for the timer wait - * functions below. - * - * \param devHalCfg Pointer to device instance specific platform settings - * - * \retval ADI_HAL_OK Function completed successfully - */ -int32_t linux_adrv903x_TimerClose(void *devHalCfg) +ADI_API adi_hal_Err_e linux_adrv903x_TimerWait_us(void *devHalCfg, + u32 time_us) { - /* ADI ZC706 platform does not require any timer open /close */ - return (int32_t)ADI_HAL_OK; -} - -/** - * \brief Function to initialize any necessary resources for the timer wait - * functions below. - * - * \param devHalCfg Pointer to device instance specific platform settings - * - * \retval ADI_HAL_OK Function completed successfully - */ -int32_t linux_adrv903x_TimerInit(void *devHalCfg) -{ - /* ADI ZC706 platform does not require any timer init */ - return (int32_t)ADI_HAL_OK; -} - -/** - * \brief Provides a blocking delay of the current thread - * - * \param devHalCfg Pointer to device instance specific platform settings - * \param time_us the time to delay in mico seconds - * - * \retval ADI_HAL_OK Function completed successfully - * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer - */ -adi_hal_Err_e linux_adrv903x_TimerWait_us(void *devHalCfg, const uint32_t time_us) -{ - int32_t halError = (int32_t)ADI_HAL_OK; + s32 halError = (s32)ADI_HAL_ERR_OK; usleep_range(time_us, time_us + 10); return halError; } -/** - * \brief Provides a blocking delay of the current thread - * - * \param devHalCfg Pointer to device instance specific platform settings - * \param time_ms the Time to delay in milli seconds - * - * \retval ADI_HAL_OK Function completed successfully - * \retval ADI_HAL_NULL_PTR the function has been called with a null pointer - */ -adi_hal_Err_e linux_adrv903x_TimerWait_ms(void *devHalCfg, const uint32_t time_ms) +ADI_API adi_hal_Err_e linux_adrv903x_TimerWait_ms(void *devHalCfg, + u32 time_ms) { - int32_t halError = (int32_t)ADI_HAL_OK; + s32 halError = (s32)ADI_HAL_ERR_OK; msleep(time_ms); return halError; } -/** - * \brief Opens all neccessary files and device drivers for a specific device - * - * \param devHalCfg Pointer to device instance specific platform settings - * - * \retval ADI_HAL_OK Function completed successfully, no action required - * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer - * \retval errors returned by other function calls. - */ -adi_hal_Err_e linux_adrv903x_HwOpen(void *devHalCfg) -{ - return ADI_HAL_OK; -} -/** - * \brief Mutex init function. No action, single-threaded - * - * \param mutex Mutex instance - * - * \retval ADI_HAL_OK Function completed successfully, no action required - */ -adi_hal_Err_e linux_mutex_init(adi_hal_mutex_t* mutex) -{ - (void)mutex; - return ADI_HAL_OK; -} -/** - * \brief Mutex destroy function. No action, single-threaded - * - * \param mutex Mutex instance - * - * \retval ADI_HAL_OK Function completed successfully, no action required - */ -adi_hal_Err_e linux_mutex_destroy(adi_hal_mutex_t* mutex) -{ - (void)mutex; - return ADI_HAL_OK; -} -/** - * \brief Mutex lock function. No action, single-threaded - * - * \param mutex Mutex instance - * - * \retval ADI_HAL_OK Function completed successfully, no action required - */ -adi_hal_Err_e linux_mutex_lock(adi_hal_mutex_t* mutex) -{ - (void)mutex; - return ADI_HAL_OK; -} -/** - * \brief Mutex unlock function. No action, single-threaded - * - * \param mutex Mutex instance - * - * \retval ADI_HAL_OK Function completed successfully, no action required - */ -adi_hal_Err_e linux_mutex_unlock(adi_hal_mutex_t* mutex) -{ - (void)mutex; - return ADI_HAL_OK; -} -/** - * \brief Tls get. This function will return the same value, single-threaded - * - * \param tlsType Key value associated with a thread - * - * \retval ADI_HAL_OK Function completed successfully, no action required - */ -void* linux_tls_get(const adi_hal_TlsType_e tlsType) +ADI_API void *linux_adrv903x_TlsGet(const adi_hal_TlsType_e tlsType) { if (tlsType == HAL_TLS_END) { return NULL; @@ -581,15 +295,9 @@ void* linux_tls_get(const adi_hal_TlsType_e tlsType) return store.value; } -/** - * \brief Tls set. This function will set the same value, single-threaded - * - * \param tlsType Key value associated with a thread - * \param value Value to associate to a thread - * - * \retval ADI_HAL_OK Function completed successfully, no action required - */ -adi_hal_Err_e linux_tls_set(const adi_hal_TlsType_e tlsType, void* const value) + +ADI_API adi_hal_Err_e linux_adrv903x_TlsSet(const adi_hal_TlsType_e tlsType, + void *const value) { if (tlsType == HAL_TLS_END) { /* Special convenience case that a thread can remove all it TLS @@ -599,8 +307,8 @@ adi_hal_Err_e linux_tls_set(const adi_hal_TlsType_e tlsType, void* const value) } /* Passing NULL cannot fail by definition - no need to check rtn values */ - (void) linux_tls_set(HAL_TLS_ERR, NULL); - (void) linux_tls_set(HAL_TLS_USR, NULL); + (void)linux_adrv903x_TlsSet(HAL_TLS_ERR, NULL); + (void)linux_adrv903x_TlsSet(HAL_TLS_USR, NULL); return ADI_HAL_ERR_OK; } @@ -609,165 +317,28 @@ adi_hal_Err_e linux_tls_set(const adi_hal_TlsType_e tlsType, void* const value) return ADI_HAL_ERR_OK; } -/** - * \brief Gracefully shuts down the the hardware closing any open resources - * such as log files, I2C, SPI, GPIO drivers, timer resources, etc. - * - * \param devHalCfg Pointer to device instance specific platform settings - * - * \retval ADI_HAL_OK Function completed successfully, no action required - * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer - */ -adi_hal_Err_e linux_adrv903x_HwClose(void *devHalCfg) +ADI_API adi_hal_Err_e linux_adrv903x_MutexInit(adi_hal_mutex_t *mutex) { - return ADI_HAL_OK; + (void)mutex; + return ADI_HAL_ERR_OK; } -/** - * \brief This function control a BBIC GPIO pin that connects to the reset pin - * of each device. - * - * This function is called by each device API giving access to the Reset pin - * connected to each device. - * - * \param devHalCfg Pointer to device instance specific platform settings - * \param pinLevel The desired pin logic level 0=low, 1=high to set the GPIO pin to. - * - * \retval ADI_HAL_OK Function completed successfully, no action required - * \retval ADI_HAL_NULL_PTR The function has been called with a null pointer - */ -adi_hal_Err_e linux_adrv903x_HwReset(void *devHalCfg, uint8_t pinLevel) +ADI_API adi_hal_Err_e linux_adrv903x_MutexDestroy(adi_hal_mutex_t *mutex) { - adi_hal_Cfg_t *halCfg; - - if (devHalCfg == NULL) { - return ADI_HAL_NULL_PTR; - } - - halCfg = (adi_hal_Cfg_t *)devHalCfg; - - gpiod_set_value(halCfg->reset_gpio, pinLevel); - - return ADI_HAL_OK; + (void)mutex; + return ADI_HAL_ERR_OK; } -/* - * Function pointer assignemt for default configuration - */ - -/* Initialization interface to open, init, close drivers and pointers to resources */ -adi_hal_Err_e (*adrv903x_HwOpen)(void *devHalCfg) = NULL; -adi_hal_Err_e (*adrv903x_HwClose)(void *devHalCfg) = NULL; -adi_hal_Err_e (*adrv903x_HwReset)(void *devHalCfg, uint8_t pinLevel) = NULL; -adi_hal_Err_e (*adrv903x_SpiInit)(void *devHalCfg) = - NULL; /* TODO: remove? called by HwOpen() */ -void *(*adrv903x_DevHalCfgCreate)(uint32_t interfaceMask, uint8_t spiChipSelect, - const char *logFilename) = NULL; -adi_hal_Err_e (*adrv903x_DevHalCfgFree)(void *devHalCfg) = NULL; -adi_hal_Err_e (*adrv903x_HwVerify)(void *devHalCfg) = NULL; - -/* SPI Interface */ -adi_hal_Err_e (*adrv903x_hal_SpiWrite)(void *devHalCfg, const uint8_t txData[], - uint32_t numTxBytes) = NULL; - -adi_hal_Err_e (*adrv903x_hal_SpiRead)(void *devHalCfg, const uint8_t txData[], - uint8_t rxData[], uint32_t numRxBytes) = NULL; - -/* Custom SPI streaming interface*/ -adi_hal_Err_e (*adrv903x_CustomSpiStreamWrite)(void *devHalCfg, const uint16_t address, - const uint8_t txData[], - uint32_t numTxBytes, - uint8_t numBytesofAddress, - uint8_t numBytesOfDataPerStream) = NULL; - -adi_hal_Err_e (*adrv903x_CustomSpiStreamRead)(void *devHalCfg, const uint16_t address, - uint8_t rxData[], uint32_t numRxBytes, - uint8_t numBytesofAddress, - uint8_t numBytesOfDataPerStream) = NULL; - -/* Logging interface */ -adi_hal_Err_e (*adrv903x_LogFileOpen)(void *devHalCfg, const char *filename) = NULL; - -adi_hal_Err_e (*adrv903x_LogLevelSet)(void *devHalCfg, const uint32_t logMask) = NULL; - -adi_hal_Err_e (*adrv903x_LogLevelGet)(void *devHalCfg, uint32_t *const logMask) = NULL; - -adi_hal_Err_e (*adrv903x_LogWrite)(void *devHalCfg, const adrv903x_LogLevel_e logLevel, - const uint8_t indent, const char *comment, va_list args) = NULL; - -adi_hal_Err_e (*adrv903x_LogFileClose)(void *devHalCfg) = NULL; - -adi_hal_Err_e (*adi_adrv903x_LogStatusGet)(void* const devHalCfg, - adi_hal_LogStatusGet_t* const logStatus) = NULL; - -adi_hal_Err_e (*adi_adrv903x_LogConsoleSet)(void* const devHalCfg, - const adi_hal_LogConsole_e logConsoleFlag) = NULL; - -/* Timer interface */ -adi_hal_Err_e (*adrv903x_Wait_ms)(void *devHalCfg, uint32_t time_ms) = NULL; - -adi_hal_Err_e (*adrv903x_Wait_us)(void *devHalCfg, uint32_t time_us) = NULL; - -/* Mutexes */ -adi_hal_Err_e (*adi_adrv903x_MutexInit)(adi_hal_mutex_t* const mutex) = NULL; -adi_hal_Err_e (*adi_adrv903x_MutexDestroy)(adi_hal_mutex_t* const mutex) = NULL; -adi_hal_Err_e (*adi_adrv903x_MutexLock)(adi_hal_mutex_t* const mutex) = NULL; -adi_hal_Err_e (*adi_adrv903x_MutexUnlock)(adi_hal_mutex_t* const mutex) = NULL; - -/* TLS */ -void* (*adi_adrv903x_TlsGet)(const adi_hal_TlsType_e tlsType); -adi_hal_Err_e (*adi_adrv903x_TlsSet)(const adi_hal_TlsType_e tlsType, void* const value); - -/** - * \brief Platform setup - * - * \param platform Platform to be assigning the function pointers - * - * \return - */ -adi_hal_Err_e adrv903x_hal_PlatformSetup(adi_hal_Platforms_e platform) +ADI_API adi_hal_Err_e linux_adrv903x_MutexLock(adi_hal_mutex_t *mutex) { - adi_hal_Err_e error = ADI_HAL_OK; - - switch (platform) - { - case ADI_LINUX: - adrv903x_HwOpen = linux_adrv903x_HwOpen; - adrv903x_HwClose = linux_adrv903x_HwClose; - adrv903x_HwReset = linux_adrv903x_HwReset; - - adrv903x_hal_SpiWrite = linux_adrv903x_SpiWrite; - adrv903x_hal_SpiRead = linux_adrv903x_SpiRead; - - adrv903x_LogFileOpen = linux_adrv903x_LogFileOpen; - adrv903x_LogLevelSet = linux_adrv903x_LogLevelSet; - adrv903x_LogLevelGet = linux_adrv903x_LogLevelGet; - adrv903x_LogWrite = linux_adrv903x_LogWrite; - adrv903x_LogFileClose = linux_adrv903x_LogFileClose; - adi_adrv903x_LogStatusGet = linux_LogStatusGet; - adi_adrv903x_LogConsoleSet = linux_LogConsoleSet; - - adrv903x_Wait_us = linux_adrv903x_TimerWait_us; - adrv903x_Wait_ms = linux_adrv903x_TimerWait_ms; - - adrv903x_SpiInit = linux_adrv903x_HwOpen; - adrv903x_HwVerify = linux_adrv903x_HwOpen; - - adi_adrv903x_MutexInit = linux_mutex_init; - adi_adrv903x_MutexDestroy = linux_mutex_destroy; - adi_adrv903x_MutexLock = linux_mutex_lock; - adi_adrv903x_MutexUnlock = linux_mutex_unlock; - - adi_adrv903x_TlsGet = linux_tls_get; - adi_adrv903x_TlsSet = linux_tls_set; - break; - - default: - error = ADI_HAL_ERR_NOT_IMPLEMENTED; - break; - } + (void)mutex; + return ADI_HAL_ERR_OK; +} - return error; +ADI_API adi_hal_Err_e linux_adrv903x_MutexUnlock(adi_hal_mutex_t *mutex) +{ + (void)mutex; + return ADI_HAL_ERR_OK; } /* @@ -775,7 +346,7 @@ adi_hal_Err_e adrv903x_hal_PlatformSetup(adi_hal_Platforms_e platform) * */ -int __adrv903x_fseek (FILE * stream, long int offset, int origin) +int adrv903x_fseek(FILE *stream, long offset, int origin) { char *ptr; @@ -801,12 +372,21 @@ int __adrv903x_fseek (FILE * stream, long int offset, int origin) return 0; } -long int __adrv903x_ftell (FILE *stream) +long adrv903x_ftell(FILE *stream) { return stream->ptr - stream->start; } -FILE* __adrv903x_fopen (adi_hal_Cfg_t *hal, const char * filename, const char *mode) +/* + * No file logging when using Linux kernel firmware subsystem + * + */ +int adrv903x_ferror(FILE *stream) +{ + return 0; +} + +FILE *adrv903x_fopen(adi_hal_Cfg_t *hal, const char *filename, const char *mode) { int ret; @@ -823,7 +403,7 @@ FILE* __adrv903x_fopen (adi_hal_Cfg_t *hal, const char * filename, const char *m return stream; } -int __adrv903x_fclose (FILE *stream) +int adrv903x_fclose(FILE *stream) { if (stream == NULL) return -ENODEV; @@ -836,7 +416,7 @@ int __adrv903x_fclose (FILE *stream) return 0; } -char * __adrv903x_fgets(char *dst, int num, FILE *stream) +char *adrv903x_fgets(char *dst, int num, FILE *stream) { char *p; int c; @@ -859,7 +439,7 @@ char * __adrv903x_fgets(char *dst, int num, FILE *stream) return p; } -size_t __adrv903x_fread(void *ptr, size_t size, size_t count, FILE *stream) +size_t adrv903x_fread(void *ptr, size_t size, size_t count, FILE *stream) { int total = size * count; @@ -872,124 +452,73 @@ size_t __adrv903x_fread(void *ptr, size_t size, size_t count, FILE *stream) return total; } -size_t __adrv903x_fwrite (const void * ptr, size_t size, size_t count, FILE *stream) -{ - return 0; -} - -int __adrv903x_fflush (FILE *stream) -{ - return 0; -} - -int ferror(FILE *stream) +/* + * No file logging when using Linux kernel firmware subsystem + * + */ +int adrv903x_fprintf(FILE *stream, const char *fmt, ...) { return 0; } -int fprintf(FILE *stream, const char *fmt, ...) +/* + * No file logging when using Linux kernel firmware subsystem + * + */ +int adrv903x_fflush(FILE *stream) { return 0; } /* - * Memory allocation abstraction using Linux kernel firmware subsystem + * Malloc using Linux kernel firmware subsystem + * */ - -void *__adrv903x_calloc(size_t size, size_t nmemb) -{ - size_t total_size; - - total_size = size * nmemb; - return kzalloc(total_size, GFP_KERNEL); -} - -void *__adrv903x_malloc(size_t size) +void *adrv903x_malloc(size_t size) { return kzalloc(size, GFP_KERNEL); } /* - * log2 using Linux kernel firmware subsystem + * No adrv903x_CpuMemDumpBinWrite when using Linux kernel firmware subsystem + * */ -unsigned int __adrv903x_log2(unsigned int v) +size_t adrv903x_fwrite(const void *ptr, size_t size, size_t count, FILE *stream) { - return __ilog2_u32(v); + return 0; } /* - * Iterative algorithm based on the fact that - * multiplication (division) in the linear domain is equivalent to - * addition (subtraction) in the log domain. + * Timkeeping abstraction using Linux kernel firmware subsystem + * */ +void adrv903x_time(ktime_t *second) +{ + *second = ktime_get_seconds(); +} -#define COMPUTE(n, d) if (neg) {a *= d; a /= n;} else {a *= n; a /= d;}; - -long int_20db_to_mag(long a, int mdB) +struct tm *adrv903x_gmtime(adi_hal_Cfg_t *hal, const ktime_t *timer) { - unsigned neg = 0; + struct tm *tmPtr = devm_kzalloc(&hal->spi->dev, sizeof(*tmPtr), GFP_KERNEL); + struct timespec64 ts; - if (mdB < 0) { - neg = 1; - mdB *= -1; - } + if (!tmPtr) + return NULL; - while (mdB > 0) { - if (mdB >= 20000) { - mdB -= 20000; - COMPUTE(10, 1); /* 10^(20/20) */ - continue; - } - if (mdB >= 6000) { - mdB -= 6000; - COMPUTE(199526, 100000); /* 10^(6/20) */ - continue; - } - if (mdB >= 1000) { - mdB -= 1000; - COMPUTE(112202, 100000); /* 10^(1/20) */ - continue; - } - if (mdB >= 100) { - mdB -= 100; - COMPUTE(101158, 100000); /* 10^(0.1/20) */ - continue; - } - if (mdB >= 10) { - mdB -= 10; - COMPUTE(100115, 100000); /* 10^(0.01/20) */ - continue; - } - if (mdB >= 1) { - mdB -= 1; - COMPUTE(100012, 100000); /* 10^(0.001/20) */ - continue; - } - } + ts = ktime_to_timespec64(*timer); + time64_to_tm(ts.tv_sec, 0, tmPtr); - return a; + return tmPtr; } /* - * Timkeeping abstraction using Linux kernel firmware subsystem - * + * Memory allocation abstraction using Linux kernel firmware subsystem */ -void time(ktime_t *second) -{ - *second = ktime_get_seconds(); -} - -struct tm* __gmtime(adi_hal_Cfg_t *hal, const ktime_t *timer) +void *__adrv903x_calloc(size_t size, size_t nmemb) { - struct tm *tmPtr = devm_kzalloc(&hal->spi->dev, sizeof(*tmPtr), GFP_KERNEL); - - tmPtr->tm_sec = *timer % 60; - tmPtr->tm_min = (*timer / 60) % 60; - tmPtr->tm_hour = (*timer / 3600) % 24; - tmPtr->tm_mday = (*timer / 86400) + 1; // Add 1 to start from day 1 - tmPtr->tm_mon = 0; // Month is always January - tmPtr->tm_year = 70; // Year 1970 (UNIX epoch) + size_t total_size; - return tmPtr; + total_size = size * nmemb; + return kzalloc(total_size, GFP_KERNEL); } diff --git a/drivers/iio/adc/adrv903x/platforms/linux_platform.h b/drivers/iio/adc/adrv903x/platforms/linux_platform.h new file mode 100644 index 0000000000000..32ea3c49ba3eb --- /dev/null +++ b/drivers/iio/adc/adrv903x/platforms/linux_platform.h @@ -0,0 +1,249 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/** + * Copyright 2015 - 2025 Analog Devices Inc. + * Released under the ADRV903X API license, for more information. + * see the "LICENSE.txt" file in this zip file. + */ + +/** + * \file linux_platform.h + * \brief Contains ADI Transceiver Hardware Abstraction functions for the Linux Kernel. + * Analog Devices maintains and provides updates to this code layer for the Linux platform. + * The end user should not modify this file or any code in this directory. The end user + * may provide a similar platform layer that can be used in place of this platform layer, + * that uses the same function prototypes. + */ + +#ifndef __LINUX_PLATFORM_H__ +#define __LINUX_PLATFORM_H__ + +#include "adi_platform.h" + +/** + * \brief Opens all necessary files and device drivers for a specific device + * + * \param devHalCfg Pointer to device instance specific platform settings + * + * \retval ADI_HAL_ERR_OK Function completed successfully, no action required + */ +ADI_API adi_hal_Err_e linux_adrv903x_HwOpen(void * const devHalCfg); + +/** + * \brief Service to control HwReset Signal via a Logic Level + * + * Caller is responsible for handling triggering (i.e. Level or Edge) + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param pinLevel The desired pin logic level 0=low, 1=high to set the GPIO pin to. + * + * \retval ADI_HAL_ERR_OK Function completed successfully, no action required + */ +ADI_API adi_hal_Err_e linux_adrv903x_HwReset(void * const devHalCfg, + const u8 pinLevel); + +/** + * \brief Gracefully shuts down the hardware closing any open resources + * such as log files, I2C, SPI, GPIO drivers, timer resources, etc. + * + * \param devHalCfg Pointer to device instance specific platform settings + * + * \retval ADI_HAL_ERR_OK Function completed successfully, no action required + */ +ADI_API adi_hal_Err_e linux_adrv903x_HwClose(void * const devHalCfg); + +/** + * \brief Write an array of 8-bit data to a SPI device + * + * The function will write numTxBytes number of bytes to the SPI device + * selected in the devHalCfg structure. + * + * \dep_begin + * \dep{adi_hal_SpiCfg_t} + * \dep{adi_hal_SpiCfg_t->fd} + * \dep_end + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param txData Pointer to byte array txData buffer that has numTxBytes number of bytes + * \param numTxBytes The length of txData array + * + * \retval ADI_HAL_ERR_OK function completed successfully, no action required + */ +ADI_API adi_hal_Err_e linux_adrv903x_SpiWrite(void * const devHalCfg, + const u8 txData[], + const u32 numTxBytes); + +/** + * \brief Read one or more bytes from the device specified by the devHalCfg structure + * + * The function will read numTxRxBytes number of bytes from the SPI device selected in + * the devHalCfg parameter and store the resulting data sent by the device in the rxData + * data buffer. + * + * For each byte in txData written to the device, a byte is read and returned by this + * function at the pointer provided by the rxData parameter. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param txData Pointer to byte array that has numTxRxBytes number of bytes + * \param rxData Pointer to byte array where read back data will be returned, + * that is at least numTxRxBytes in size. + * \param numTxBytes The length of txData and rxData arrays + * + * \retval ADI_HAL_ERR_OK function completed successfully, no action required + */ +ADI_API adi_hal_Err_e linux_adrv903x_SpiRead(void * const devHalCfg, + const u8 txData[], + u8 rxData[], + const u32 numTxRxBytes); + +/** + * \brief Opens a logFile. If the file is already open it will be closed and reopened. + * + * This function does nothing in case of the Linux kernel driver. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param filename The user provided name of the file to open. + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + * + */ +ADI_API adi_hal_Err_e linux_adrv903x_LogFileOpen(void * const devHalCfg, + const char * const filename); + +/** + * \brief Service to Close a Log File + * + * This function does nothing in case of the Linux kernel driver. + * + * \param devHalCfg Pointer to device instance specific platform settings + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + * + */ +ADI_API adi_hal_Err_e linux_adrv903x_LogFileClose(void * const devHalCfg); + +/** + * \brief Sets the log level, allowing the end user to select the granularity of + * what events get logged. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param logMask A mask of valid log levels to allow to be written to the log file. + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + * + */ +ADI_API adi_hal_Err_e linux_adrv903x_LogLevelSet(void * const devHalCfg, + const uint32_t logMask); + +/** + * \brief Gets the currently set log level: the mask of different types of log + * events that are currently enabled to be logged. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param logMask Returns the current log level mask. + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + * + */ +ADI_API adi_hal_Err_e linux_adrv903x_LogLevelGet(void * const devHalCfg, + u32 * const logMask); + +/** + * \brief Writes a message to the currently open logFile specified in the + * adi_hal_LogCfg_t of the devHalCfg structure passed + * + * Uses the vfprintf functionality to allow the user to supply the format and + * the number of arguments that will be logged. + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param logLevel the log level to be written into + * \param comment the string to include in the line added to the log. + * \param argp variable argument list to be printed + * + * \retval adi_hal_Err_e - ADI_HAL_ERR_OK if successful + * + */ +ADI_API adi_hal_Err_e linux_adrv903x_LogWrite(void * const devHalCfg, + const adi_hal_LogLevel_e logLevel, + const u8 indent, + const char * const comment, + va_list argp); + +/** + * \brief Provides a blocking delay of the current thread + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param time_ms the Time to delay in milli seconds + * + * \retval ADI_HAL_ERR_OK Function completed successfully + */ +ADI_API adi_hal_Err_e linux_adrv903x_TimerWait_ms(void * const devHalCfg, + const u32 time_ms); + +/** + * \brief Provides a blocking delay of the current thread + * + * \param devHalCfg Pointer to device instance specific platform settings + * \param time_us the time to delay in micro seconds + * + * \retval ADI_HAL_ERR_OK Function completed successfully + */ +ADI_API adi_hal_Err_e linux_adrv903x_TimerWait_us(void * const devHalCfg, + const u32 time_us); + +/** + * \brief Tls get. This function will return the same value, single-threaded + * + * \param tlsType Key value associated with a thread + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +ADI_API void *linux_adrv903x_TlsGet(const adi_hal_TlsType_e tlsType); + +/** + * \brief Tls set. This function will set the same value, single-threaded + * + * \param tlsType Key value associated with a thread + * \param value The value to associate to a thread + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +ADI_API adi_hal_Err_e linux_adrv903x_TlsSet(const adi_hal_TlsType_e tlsType, + void * const value); + +/** + * \brief Mutex init function - no action, single threaded + * + * \param mutex Instance + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +ADI_API adi_hal_Err_e linux_adrv903x_MutexInit(adi_hal_mutex_t * const mutex); + +/** + * \brief Mutex destroy function - no action, single threaded + * + * \param mutex Instance + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +ADI_API adi_hal_Err_e linux_adrv903x_MutexDestroy(adi_hal_mutex_t * const mutex); + +/** + * \brief Mutex lock function - no action, single threaded + * + * \param mutex Instance + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +ADI_API adi_hal_Err_e linux_adrv903x_MutexLock(adi_hal_mutex_t * const mutex); + +/** + * \brief Mutex unlock function - no action, single threaded + * + * \param mutex Instance + * + * \retval ADI_HAL_OK Function completed successfully, no action required + */ +ADI_API adi_hal_Err_e linux_adrv903x_MutexUnlock(adi_hal_mutex_t * const mutex); + +#endif /*__LINUX_PLATFORM_H__*/ diff --git a/drivers/iio/frequency/cf_axi_dds.c b/drivers/iio/frequency/cf_axi_dds.c index db85a24c4f7b3..c2c49f4d71f88 100644 --- a/drivers/iio/frequency/cf_axi_dds.c +++ b/drivers/iio/frequency/cf_axi_dds.c @@ -2175,6 +2175,13 @@ static const struct axidds_core_info adrv9025_1_00_a_info = { .complex_modified = true, }; +static const struct axidds_core_info adrv903x_1_00_a_info = { + .version = ADI_AXI_PCORE_VER(9, 1, 'b'), + .name = "ADRV903X", + .standalone = true, + .complex_modified = true, +}; + /* Match table for of_platform binding */ static const struct of_device_id cf_axi_dds_of_match[] = { { .compatible = "adi,axi-ad9122-6.00.a", .data = &ad9122_6_00_a_info}, @@ -2248,6 +2255,9 @@ static const struct of_device_id cf_axi_dds_of_match[] = { }, { .compatible = "adi,axi-adrv9025-tx-1.0", .data = &adrv9025_1_00_a_info, + }, { + .compatible = "adi,axi-adrv903x-tx-1.0", + .data = &adrv903x_1_00_a_info, }, { }, }; diff --git a/include/dt-bindings/iio/adc/adi,adrv903x.h b/include/dt-bindings/iio/adc/adi,adrv903x.h new file mode 100644 index 0000000000000..42127382c1e61 --- /dev/null +++ b/include/dt-bindings/iio/adc/adi,adrv903x.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * This header provides constants for ADRV903X + * + * Copyright 2025 Analog Devices Inc. + */ + +#ifndef _DT_BINDINGS_IIO_ADC_ADRV903X_H +#define _DT_BINDINGS_IIO_ADC_ADRV903X_H + + /* + * JESD204-FSM defines + */ + +#define DEFRAMER0_LINK_TX 0 +#define DEFRAMER1_LINK_TX 1 +#define FRAMER0_LINK_RX 2 +#define FRAMER1_LINK_RX 3 +#define FRAMER2_LINK_RX 4 + +#endif From c331ad829f51ed18a4107c7d4cf504a24612e093 Mon Sep 17 00:00:00 2001 From: George Mois Date: Tue, 16 Dec 2025 09:32:24 +0200 Subject: [PATCH 4/6] iio: adc: ad_adc.c: Add ORX info for ADRV903X Add info table for observation receiver for the ADRV903X family. Signed-off-by: George Mois --- drivers/iio/adc/ad_adc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/adc/ad_adc.c b/drivers/iio/adc/ad_adc.c index a2b03e7b09176..b03b10ee06270 100644 --- a/drivers/iio/adc/ad_adc.c +++ b/drivers/iio/adc/ad_adc.c @@ -637,6 +637,8 @@ static const struct of_device_id adc_of_match[] = { .data = &adrv9002_rx_chip_info }, { .compatible = "adi,axi-adrv9006-rx2-1.0", .data = &adrv9002_rx_chip_info }, + { .compatible = "adi,axi-adrv903x-obs-1.0", + .data = &obs_rx_chip_info }, { .compatible = "adi,axi-adc-tpl-so-10.0.a", .data = &obs_rx_chip_info }, { /* end of list */ }, From 7c2e931a4ae3b985da1ba5f60e0a3dc31765a920 Mon Sep 17 00:00:00 2001 From: George Mois Date: Mon, 15 Dec 2025 12:31:58 +0200 Subject: [PATCH 5/6] drivers: iio: Kconfig.adi: Imply ADRV903X Make sure that the ADRV903X driver is built. Signed-off-by: George Mois --- drivers/iio/Kconfig.adi | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/Kconfig.adi b/drivers/iio/Kconfig.adi index fec57fcc58f2a..c5588edda2944 100644 --- a/drivers/iio/Kconfig.adi +++ b/drivers/iio/Kconfig.adi @@ -206,6 +206,7 @@ config IIO_ALL_ADI_DRIVERS imply MAX31865 imply MAX11205 imply ADRV9025 + imply ADRV903X imply ADL5580 imply LTC2664 imply AD8460 From d7e5a53e48dd6914e320716f86bee663db4bcefa Mon Sep 17 00:00:00 2001 From: George Mois Date: Tue, 16 Dec 2025 09:08:30 +0200 Subject: [PATCH 6/6] arch: arm64: dts: Add ADRV9032R dts. Add the dts file for the ADRV9032R development board: arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev10-adrv9032r-nls.dts. Signed-off-by: George Mois --- .../zynqmp-zcu102-rev10-adrv9032r-nls.dts | 438 ++++++++++++++++++ 1 file changed, 438 insertions(+) create mode 100644 arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev10-adrv9032r-nls.dts diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev10-adrv9032r-nls.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev10-adrv9032r-nls.dts new file mode 100644 index 0000000000000..37cfc03f26342 --- /dev/null +++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev10-adrv9032r-nls.dts @@ -0,0 +1,438 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Analog Devices ADRV903X + * https://wiki.analog.com/resources/eval/user-guides/adrv903x + * https://wiki.analog.com/resources/tools-software/linux-drivers/iio-transceiver/adrv903x + * + * hdl_project: + * board_revision: <> + * + * Copyright (C) 2020-2025 Analog Devices Inc. + */ +#include "zynqmp-zcu102-rev1.0.dts" +#include +#include + +#include +#include +#include + +&spi0 { + status = "okay"; + + clk0_ad9528: ad9528-1@1 { + compatible = "adi,ad9528"; + reg = <1>; + + #address-cells = <1>; + #size-cells = <0>; + + spi-max-frequency = <10000000>; + + clock-output-names = "ad9528-1_out0", "ad9528-1_out1", "ad9528-1_out2", + "ad9528-1_out3", "ad9528-1_out4", "ad9528-1_out5", "ad9528-1_out6", + "ad9528-1_out7", "ad9528-1_out8", "ad9528-1_out9", "ad9528-1_out10", + "ad9528-1_out11", "ad9528-1_out12", "ad9528-1_out13"; + #clock-cells = <1>; + + jesd204-device; + #jesd204-cells = <2>; + jesd204-sysref-provider; + + adi,vcxo-freq = <122880000>; + + adi,refa-enable; + + adi,refa-diff-rcv-enable; + adi,refa-r-div = <1>; + + /* PLL1 config */ + adi,pll1-feedback-div = <4>; + adi,pll1-charge-pump-current-nA = <5000>; + + /* PLL2 config */ /* 983040000 Hz */ + adi,pll2-vco-div-m1 = <4>; + adi,pll2-n2-div = <4>; /* N / M1 */ + adi,pll2-r1-div = <1>; + adi,pll2-charge-pump-current-nA = <815000>; + adi,pll2-freq-doubler-enable; + + /* SYSREF config */ + adi,sysref-src = ; + adi,sysref-pattern-mode = ; + adi,sysref-k-div = <512>; + adi,sysref-nshot-mode = ; + adi,sysref-request-trigger-mode = ; + adi,jesd204-desired-sysref-frequency-hz = <3840000>; + + adi,rpole2 = ; + adi,rzero = ; + adi,cpole1 = ; + + adi,status-mon-pin0-function-select = <9>; /* PLL1 in holdover */ + adi,status-mon-pin1-function-select = <3>; /* PLL2 locked */ + + ad9528_0_c0: channel@0 { + reg = <0>; + adi,extended-name = "DEV_SYSREF"; + adi,driver-mode = ; + adi,divider-phase = <0>; + adi,channel-divider = <4>; + adi,signal-source = ; + //adi,output-dis; + }; + + ad9528_0_c1: channel@1 { + reg = <1>; + adi,extended-name = "DEV_CLK"; + adi,driver-mode = ; + adi,divider-phase = <0>; + adi,channel-divider = <4>; + adi,signal-source = ; + //adi,output-dis; + }; + + ad9528_0_c3: channel@3 { + reg = <3>; + adi,extended-name = "CORE_CLK"; + adi,driver-mode = ; + adi,divider-phase = <0>; + adi,channel-divider = <4>; + adi,signal-source = ; + //adi,output-dis; + }; + + ad9528_0_c11: channel@11 { + reg = <11>; + adi,extended-name = "REF_CLK1"; + adi,driver-mode = ; + adi,divider-phase = <0>; + adi,channel-divider = <2>; + adi,signal-source = ; + adi,output-dis; + }; + + ad9528_0_c12: channel@12 { + reg = <12>; + adi,extended-name = "FPGA_SYSREF"; + adi,driver-mode = ; + adi,divider-phase = <0>; + adi,channel-divider = <4>; + adi,signal-source = ; + //adi,output-dis; + }; + + ad9528_0_c13: channel@13 { + reg = <13>; + adi,extended-name = "REF_CLK0"; + adi,driver-mode = ; + adi,divider-phase = <0>; + adi,channel-divider = <2>; + adi,signal-source = ; + adi,output-dis; + }; + }; + + trx0_adrv903x: adrv903x-phy@0 { + compatible = "adrv9032r"; + reg = <0>; + + #address-cells = <1>; + #size-cells = <0>; + + /* SPI Setup */ + spi-max-frequency = <25000000>; + + interrupt-parent = <&gpio>; + interrupts = <134 IRQ_TYPE_EDGE_RISING>; /* adrv903x_gpint1 - CHECK */ + + /* Clocks */ + clocks = <&clk0_ad9528 1>; + + clock-names = "dev_clk"; + + clock-output-names = "rx_sampl_clk", "tx_sampl_clk", "obs_sampl_clk"; + #clock-cells = <1>; + + //jesd204-ignore-errors; + + jesd204-device; + #jesd204-cells = <2>; + jesd204-top-device = <0>; /* This is the TOP device */ + jesd204-link-ids = ; + + jesd204-inputs = + <&axi_adrv903x_rx_jesd 0 FRAMER0_LINK_RX>, + <&axi_adrv903x_rx_os_jesd 0 FRAMER1_LINK_RX>, + <&axi_adrv903x_core_tx 0 DEFRAMER0_LINK_TX>; + + adi,device-config-name = "ADRV9030_DeviceProfileTest_M4.bin"; + adi,arm-firmware-name = "ADRV9030_FW.bin"; + adi,stream-firmware-name = "ADRV9030_stream_image.bin"; + adi,rx-gaintable-names = "ADRV9030_RxGainTable.csv"; + adi,rx-gaintable-channel-masks = <0xFF>; + }; +}; + +&i2c1 { + i2c-mux@75 { + i2c@1 { /* HPC1 */ + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + /* HPC0_IIC */ + ad7291@2f { + compatible = "adi,ad7291"; + reg = <0x2f>; + }; + + eeprom@50 { + compatible = "at24,24c02"; + reg = <0x50>; + }; + }; + }; +}; + + +/ { + fpga_axi: fpga-axi@0 { + interrupt-parent = <&gic>; + compatible = "simple-bus"; + #address-cells = <0x1>; + #size-cells = <0x1>; + ranges = <0 0 0 0xffffffff>; + + rx_dma: dma@9c400000 { + compatible = "adi,axi-dmac-1.00.a"; + reg = <0x9c400000 0x1000>; + #dma-cells = <1>; + #clock-cells = <0>; + dma-coherent; + interrupts = <0 110 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&zynqmp_clk 73>; + }; + + tx_dma: dma@9c420000 { + compatible = "adi,axi-dmac-1.00.a"; + reg = <0x9c420000 0x1000>; + #dma-cells = <1>; + #clock-cells = <0>; + dma-coherent; + interrupts = <0 109 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&zynqmp_clk 73>; + }; + + rx_os_dma: dma@9c800000 { + compatible = "adi,axi-dmac-1.00.a"; + reg = <0x9c800000 0x10000>; + #dma-cells = <1>; + #clock-cells = <0>; + dma-coherent; + interrupts = <0 111 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&zynqmp_clk 73>; + }; + + axi_rx_clkgen: axi-clkgen@83c10000 { + compatible = "adi,axi-clkgen-2.00.a"; + reg = <0x83c10000 0x10000>; + #clock-cells = <0>; + clocks = <&clk0_ad9528 3>, <&zynqmp_clk 71>; + clock-names = "clkin1", "s_axi_aclk"; + clock-output-names = "axi_rx_clkgen"; + }; + + axi_tx_clkgen: axi-clkgen@83c00000 { + compatible = "adi,axi-clkgen-2.00.a"; + reg = <0x83c00000 0x10000>; + #clock-cells = <0>; + clocks = <&clk0_ad9528 3>, <&zynqmp_clk 71>; + clock-names = "clkin1", "s_axi_aclk"; + clock-output-names = "axi_tx_clkgen"; + }; + + axi_rx_os_clkgen: axi-clkgen@83c20000 { + compatible = "adi,axi-clkgen-2.00.a"; + reg = <0x83c20000 0x10000>; + #clock-cells = <0>; + clocks = <&clk0_ad9528 3>, <&zynqmp_clk 71>; + clock-names = "clkin1", "s_axi_aclk"; + clock-output-names = "axi_rx_os_clkgen"; + }; + + axi_adrv903x_core_rx: axi-adrv903x-rx-hpc@84a00000 { + compatible = "adi,axi-adc-legacy-10.0.a"; + reg = <0x84a00000 0x6000>; + dmas = <&rx_dma 0>; + dma-names = "rx"; + spibus-connected = <&trx0_adrv903x>; + }; + + axi_adrv903x_core_tx: axi-adrv903x-tx-hpc@84a04000 { + compatible = "adi,axi-adrv903x-tx-1.0"; + reg = <0x84a04000 0x2000>; + dmas = <&tx_dma 0>; + dma-names = "tx"; + clocks = <&trx0_adrv903x 1>; + clock-names = "sampl_clk"; + adi,axi-pl-fifo-enable; + adi,axi-data-offload-connected = <&axi_data_offload_tx>; + + jesd204-device; + #jesd204-cells = <2>; + jesd204-inputs = <&axi_adrv903x_tx_jesd 0 DEFRAMER0_LINK_TX>; + }; + + axi_adrv903x_core_rx_os: axi-adrv903x-rx-os-hpc@84a08000 { + compatible = "adi,axi-adrv903x-obs-1.0"; + reg = <0x84a08000 0x8000>; + dmas = <&rx_os_dma 0>; + dma-names = "rx"; + clocks = <&trx0_adrv903x 2>; + clock-names = "sampl_clk"; + spibus-connected=<&trx0_adrv903x>; + label="axi-adrv903x-rx-os-hpc"; + }; + + axi_adrv903x_rx_jesd: axi-jesd204-rx@84aa0000 { + compatible = "adi,axi-jesd204-rx-1.0"; + reg = <0x84aa0000 0x4000>; + + interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>; + + clocks = <&zynqmp_clk 71>, <&axi_rx_clkgen>, <&axi_adrv903x_adxcvr_rx 0>; + clock-names = "s_axi_aclk", "device_clk", "lane_clk"; + + #clock-cells = <0>; + clock-output-names = "jesd_rx_lane_clk"; + + jesd204-device; + #jesd204-cells = <2>; + jesd204-inputs = <&axi_adrv903x_adxcvr_rx 0 FRAMER0_LINK_RX>; + }; + + axi_adrv903x_tx_jesd: axi-jesd204-tx@84a90000 { + compatible = "adi,axi-jesd204-tx-1.0"; + reg = <0x84a90000 0x4000>; + + interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>; + + clocks = <&zynqmp_clk 71>, <&axi_tx_clkgen>, <&axi_adrv903x_adxcvr_tx 0>; + clock-names = "s_axi_aclk", "device_clk", "lane_clk"; + + #clock-cells = <0>; + clock-output-names = "jesd_tx_lane_clk"; + + jesd204-device; + #jesd204-cells = <2>; + jesd204-inputs = <&axi_adrv903x_adxcvr_tx 0 DEFRAMER0_LINK_TX>; + + }; + + axi_adrv903x_rx_os_jesd: axi-jesd204-rx-os@85aa0000 { + compatible = "adi,axi-jesd204-rx-1.0"; + reg = <0x85aa0000 0x1000>; + + interrupts = <0 108 IRQ_TYPE_LEVEL_HIGH>; + + clocks = <&zynqmp_clk 71>, <&axi_rx_os_clkgen>, <&axi_adrv903x_adxcvr_rx_os 0>; + clock-names = "s_axi_aclk", "device_clk", "lane_clk"; + + #clock-cells = <0>; + clock-output-names = "jesd_rx_os_lane_clk"; + + jesd204-device; + #jesd204-cells = <2>; + jesd204-inputs = <&axi_adrv903x_adxcvr_rx_os 0 FRAMER1_LINK_RX>; + }; + + axi_adrv903x_adxcvr_rx: axi-adxcvr-rx@84a60000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "adi,axi-adxcvr-1.0"; + reg = <0x84a60000 0x10000>; + + clocks = <&clk0_ad9528 13>; + clock-names = "conv"; + + #clock-cells = <1>; + clock-output-names = "rx_gt_clk", "rx_out_clk"; + + adi,sys-clk-select = ; + adi,out-clk-select = ; + + jesd204-device; + #jesd204-cells = <2>; + jesd204-inputs = <&clk0_ad9528 0 FRAMER0_LINK_RX>; + + }; + + axi_adrv903x_adxcvr_tx: axi-adxcvr-tx@84a80000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "adi,axi-adxcvr-1.0"; + reg = <0x84a80000 0x1000>; + + clocks = <&clk0_ad9528 13>; + clock-names = "conv"; + + #clock-cells = <1>; + clock-output-names = "tx_gt_clk", "tx_out_clk"; + + adi,sys-clk-select = ; + adi,out-clk-select = ; + + jesd204-device; + #jesd204-cells = <2>; + jesd204-inputs = <&clk0_ad9528 0 DEFRAMER0_LINK_TX>; + }; + + axi_adrv903x_adxcvr_rx_os: axi-adxcvr-rx-os@85a60000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "adi,axi-adxcvr-1.0"; + reg = <0x85a60000 0x1000>; + + clocks = <&clk0_ad9528 13>; + clock-names = "conv"; + + #clock-cells = <1>; + clock-output-names = "rx_os_gt_clk", "rx_os_out_clk"; + + adi,sys-clk-select = ; + adi,out-clk-select = ; + + jesd204-device; + #jesd204-cells = <2>; + jesd204-inputs = <&clk0_ad9528 0 FRAMER1_LINK_RX>; + }; + + axi_sysid_0: axi-sysid-0@85000000 { + compatible = "adi,axi-sysid-1.00.a"; + reg = <0x85000000 0x10000>; + }; + + axi_data_offload_tx: axi-data-offload-0@9c440000 { + compatible = "adi,axi-data-offload-1.0.a"; + reg = <0x9c440000 0x10000>; + // adi,bringup; + // adi,oneshot; + // adi,bypass; + // adi,sync-config = <2>; + // adi,transfer-length = /bits/ 64 <0x10000>; // 2**16 bytes + }; + + axi_data_offload_rx: axi-data-offload-1@9c450000 { + compatible = "adi,axi-data-offload-1.0.a"; + reg = <0x9c450000 0x10000>; + }; + }; +}; + +&trx0_adrv903x { + reset-gpios = <&gpio 134 0>; +}; + +&clk0_ad9528 { + reset-gpios = <&gpio 147 0>; +}; \ No newline at end of file