precision-converters-firmware
Macros | Enumerations | Functions
common.c File Reference

Precision converters firmware common functions. More...

#include "common.h"
#include "board_info.h"
Include dependency graph for common.c:

Macros

#define EEPROM_OPS_START_DELAY   0xfffff
 

Enumerations

enum  context_attr_ids {
  HW_MEZZANINE_ID ,
  HW_CARRIER_ID ,
  HW_NAME_ID ,
  DEF_NUM_OF_CONTXT_ATTRS ,
  HW_MEZZANINE_ID ,
  HW_CARRIER_ID ,
  HW_NAME_ID ,
  DEF_NUM_OF_CONTXT_ATTRS
}
 

Functions

int32_t eeprom_init (struct no_os_eeprom_desc **eeprom_desc, struct no_os_eeprom_init_param *eeprom_init_params)
 Initialize the EEPROM. More...
 
int32_t load_eeprom_dev_address (struct no_os_eeprom_desc *eeprom_desc, uint8_t dev_addr)
 Store the EEPROM device address. More...
 
bool is_eeprom_valid_dev_addr_detected (void)
 Return the flag indicating if valid EEPROM address is detected. More...
 
uint8_t get_eeprom_detected_dev_addr (void)
 Get the EEPROM device address detected by firmware. More...
 
int32_t get_iio_context_attributes (struct iio_ctx_attr **ctx_attr, uint32_t *attrs_cnt, struct no_os_eeprom_desc *eeprom_desc, const char *hw_mezzanine, const char *hw_carrier, bool *hw_mezzanine_is_valid)
 Read IIO context attributes. More...
 
int32_t sdram_init (void)
 Initialize the SDP-K1 SDRAM. More...
 

Detailed Description

Precision converters firmware common functions.

Copyright (c) 2023 Analog Devices, Inc. All rights reserved.

This software is proprietary to Analog Devices, Inc. and its licensors. By using this software you agree to the terms of the associated Analog Devices Software License Agreement.

Macro Definition Documentation

◆ EEPROM_OPS_START_DELAY

#define EEPROM_OPS_START_DELAY   0xfffff

Enumeration Type Documentation

◆ context_attr_ids

Enumerator
HW_MEZZANINE_ID 
HW_CARRIER_ID 
HW_NAME_ID 
DEF_NUM_OF_CONTXT_ATTRS 
HW_MEZZANINE_ID 
HW_CARRIER_ID 
HW_NAME_ID 
DEF_NUM_OF_CONTXT_ATTRS 

Function Documentation

◆ eeprom_init()

int32_t eeprom_init ( struct no_os_eeprom_desc **  eeprom_desc,
struct no_os_eeprom_init_param *  eeprom_init_params 
)

Initialize the EEPROM.

Parameters
eeprom_desc[in]- EEPROM descriptor
extra[in]- EEPROM extra init param structure pointer (interface type such as i2c)
Returns
0 in case of success, negative error code otherwise

◆ get_eeprom_detected_dev_addr()

uint8_t get_eeprom_detected_dev_addr ( void  )

Get the EEPROM device address detected by firmware.

Returns
EEPROM device address

◆ get_iio_context_attributes()

int32_t get_iio_context_attributes ( struct iio_ctx_attr **  ctx_attr,
uint32_t *  attrs_cnt,
struct no_os_eeprom_desc *  eeprom_desc,
const char *  hw_mezzanine,
const char *  hw_carrier,
bool *  hw_mezzanine_is_valid 
)

Read IIO context attributes.

Parameters
ctx_attr[in,out]- Pointer to IIO context attributes init param
attrs_cnt[in,out]- IIO contxt attributes count
eeprom_desc[in]- EEPROM descriptor
hw_mezzanine[in,out]- HW Mezzanine ID string
hw_carrier[in,out]- HW Carrier ID string
hw_mezzanine_is_valid[in,out]- HW Mezzanine valid status
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ is_eeprom_valid_dev_addr_detected()

bool is_eeprom_valid_dev_addr_detected ( void  )

Return the flag indicating if valid EEPROM address is detected.

Returns
EEPROM valid address detect flag (true/false)

◆ load_eeprom_dev_address()

int32_t load_eeprom_dev_address ( struct no_os_eeprom_desc *  eeprom_desc,
uint8_t  dev_addr 
)

Store the EEPROM device address.

Parameters
eeprom_desc[in]- EEPROM descriptor
dev_addr[in]- EEPROM device address
Returns
0 in case of success, negative error code otherwise

◆ sdram_init()

int32_t sdram_init ( void  )

Initialize the SDP-K1 SDRAM.

Returns
0 in case of success, negative error code otherwise