precision-converters-firmware
Macros | Functions
common.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
#include "iio.h"
#include "24xx32a.h"
#include "no_os_eeprom.h"
#include "no_os_error.h"
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EEPROM_DEV_ADDR_START   0x50
 
#define EEPROM_DEV_ADDR_END   0x57
 
#define MAX_REGISTER_ADDRESS   0xFFF
 
#define XSTR(s)   #s
 
#define STR(s)   XSTR(s)
 

Functions

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 eeprom_init (struct no_os_eeprom_desc **eeprom_desc, struct no_os_eeprom_init_param *eeprom_init_params)
 Initialize the EEPROM. More...
 
uint8_t get_eeprom_detected_dev_addr (void)
 Get the EEPROM device address detected by firmware. More...
 
bool is_eeprom_valid_dev_addr_detected (void)
 Return the flag indicating if valid EEPROM address is detected. More...
 
int32_t sdram_init (void)
 Initialize the SDP-K1 SDRAM. More...
 

Macro Definition Documentation

◆ EEPROM_DEV_ADDR_END

#define EEPROM_DEV_ADDR_END   0x57

◆ EEPROM_DEV_ADDR_START

#define EEPROM_DEV_ADDR_START   0x50

◆ MAX_REGISTER_ADDRESS

#define MAX_REGISTER_ADDRESS   0xFFF

◆ STR

#define STR (   s)    XSTR(s)

◆ XSTR

#define XSTR (   s)    #s

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)

◆ sdram_init()

int32_t sdram_init ( void  )

Initialize the SDP-K1 SDRAM.

Returns
0 in case of success, negative error code otherwise