no-OS
axi_jesd204_tx.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef AXI_JESD204_TX_H_
40 #define AXI_JESD204_TX_H_
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include <stdint.h>
46 #include <stdbool.h>
47 
48 /******************************************************************************/
49 /*************************** Types Declarations *******************************/
50 /******************************************************************************/
52  uint8_t device_id;
53  uint8_t bank_id;
54  uint8_t lane_id;
59  uint8_t resolution;
60  uint8_t bits_per_sample;
62  uint8_t jesd_version;
65  uint32_t version;
68 };
69 
70 /* JESD204 Supported encoding scheme */
76 };
77 
84  const char *name;
86  uint32_t base;
88  uint32_t num_lanes;
90  uint32_t data_path_width;
96  uint32_t device_clk_khz;
98  uint32_t lane_clk_khz;
101 };
102 
109  const char *name;
111  uint32_t base;
127  uint8_t subclass;
129  uint32_t device_clk_khz;
131  uint32_t lane_clk_khz;
132 };
133 
134 /******************************************************************************/
135 /************************ Functions Declarations ******************************/
136 /******************************************************************************/
138 int32_t axi_jesd204_tx_lane_clk_enable(struct axi_jesd204_tx *jesd);
140 int32_t axi_jesd204_tx_lane_clk_disable(struct axi_jesd204_tx *jesd);
142 uint32_t axi_jesd204_tx_status_read(struct axi_jesd204_tx *jesd);
144 int32_t axi_jesd204_tx_init(struct axi_jesd204_tx **jesd204,
145  const struct jesd204_tx_init *init);
147 int32_t axi_jesd204_tx_remove(struct axi_jesd204_tx *jesd);
148 #endif
jesd204_tx_config::subclass_version
uint8_t subclass_version
Definition: axi_jesd204_tx.h:63
JESD204_TX_REG_LINK_CONF4
#define JESD204_TX_REG_LINK_CONF4
Definition: axi_jesd204_tx.c:75
jesd204_tx_config::converters_per_device
uint8_t converters_per_device
Definition: axi_jesd204_tx.h:58
JESD204_TX_REG_MAGIC
#define JESD204_TX_REG_MAGIC
Definition: axi_jesd204_tx.c:55
ADI_AXI_PCORE_VER
#define ADI_AXI_PCORE_VER(major, minor, patch)
Definition: axi_jesd204_tx.c:89
jesd204_tx_config::device_id
uint8_t device_id
Definition: axi_jesd204_tx.h:52
axi_jesd204_tx::name
const char * name
Definition: axi_jesd204_tx.h:84
JESD204_TX_REG_LINK_STATE
#define JESD204_TX_REG_LINK_STATE
Definition: axi_jesd204_tx.c:65
JESD204_TX_REG_LINK_STATUS
#define JESD204_TX_REG_LINK_STATUS
Definition: axi_jesd204_tx.c:77
axi_jesd204_tx_calc_ilas_chksum
uint32_t axi_jesd204_tx_calc_ilas_chksum(const struct jesd204_tx_config *config)
Compute the JESD204 TX ILAS checksum.
Definition: axi_jesd204_tx.c:250
jesd204_tx_init::bits_per_sample
uint8_t bits_per_sample
Definition: axi_jesd204_tx.h:121
JESD204_TX_REG_SYSREF_CONF_SYSREF_DISABLE
#define JESD204_TX_REG_SYSREF_CONF_SYSREF_DISABLE
Definition: axi_jesd204_tx.c:69
jesd204_tx_config::control_bits_per_sample
uint8_t control_bits_per_sample
Definition: axi_jesd204_tx.h:64
jesd204_tx_config::bits_per_sample
uint8_t bits_per_sample
Definition: axi_jesd204_tx.h:60
JESD204_TX_ENCODER_GET
#define JESD204_TX_ENCODER_GET(x)
Definition: axi_jesd204_tx.c:62
jesd204_tx_config::octets_per_frame
uint8_t octets_per_frame
Definition: axi_jesd204_tx.h:56
axi_jesd204_tx::device_clk_khz
uint32_t device_clk_khz
Definition: axi_jesd204_tx.h:96
axi_jesd204_tx_apply_config
int32_t axi_jesd204_tx_apply_config(struct axi_jesd204_tx *jesd, struct jesd204_tx_config *config)
Apply the JESD204 TX configuration.
Definition: axi_jesd204_tx.c:325
jesd204_tx_config::high_density
bool high_density
Definition: axi_jesd204_tx.h:67
JESD204_TX_REG_VERSION
#define JESD204_TX_REG_VERSION
Definition: axi_jesd204_tx.c:54
jesd204_tx_init::subclass
uint8_t subclass
Definition: axi_jesd204_tx.h:127
jesd204_tx_init::control_bits_per_sample
uint8_t control_bits_per_sample
Definition: axi_jesd204_tx.h:125
NO_OS_DIV_ROUND_CLOSEST_ULL
#define NO_OS_DIV_ROUND_CLOSEST_ULL(x, y)
Definition: no_os_util.h:60
axi_jesd204_tx::num_lanes
uint32_t num_lanes
Definition: axi_jesd204_tx.h:88
JESD204_TX_REG_SYSREF_CONF
#define JESD204_TX_REG_SYSREF_CONF
Definition: axi_jesd204_tx.c:68
JESD204_TX_REG_ILAS
#define JESD204_TX_REG_ILAS(x, y)
Definition: axi_jesd204_tx.c:79
JESD204_TX_REG_LINK_CLK_RATIO
#define JESD204_TX_REG_LINK_CLK_RATIO
Definition: axi_jesd204_tx.c:66
JESD204_TX_REG_CONF_DATA_PATH_WIDTH
#define JESD204_TX_REG_CONF_DATA_PATH_WIDTH
Definition: axi_jesd204_tx.c:58
jesd204_tx_config
Definition: axi_jesd204_tx.h:51
no_os_axi_io.h
Header file of AXI IO.
JESD204_TX_REG_SYNTH_REG_1
#define JESD204_TX_REG_SYNTH_REG_1
Definition: axi_jesd204_tx.c:60
jesd204_tx_init::device_clk_khz
uint32_t device_clk_khz
Definition: axi_jesd204_tx.h:129
axi_jesd204_tx_lane_clk_enable
int32_t axi_jesd204_tx_lane_clk_enable(struct axi_jesd204_tx *jesd)
JESD204 TX Lane Clock Enable.
Definition: axi_jesd204_tx.c:142
jesd204_tx_config::resolution
uint8_t resolution
Definition: axi_jesd204_tx.h:59
JESD204_TX_ENCODER_MAX
@ JESD204_TX_ENCODER_MAX
Definition: axi_jesd204_tx.h:75
axi_jesd204_tx_lane_clk_enable
int32_t axi_jesd204_tx_lane_clk_enable(struct axi_jesd204_tx *jesd)
JESD204 TX Lane Clock Enable.
Definition: axi_jesd204_tx.c:142
jesd204_tx_encoder
jesd204_tx_encoder
Definition: axi_jesd204_tx.h:71
no_os_error.h
Error codes definition.
axi_jesd204_tx_remove
int32_t axi_jesd204_tx_remove(struct axi_jesd204_tx *jesd)
Free resoulces allocated for JESD204 TX peripheral.
Definition: axi_jesd204_tx.c:468
jesd204_tx_config::enable_scrambling
bool enable_scrambling
Definition: axi_jesd204_tx.h:66
jesd204_tx_config::lanes_per_device
uint8_t lanes_per_device
Definition: axi_jesd204_tx.h:55
axi_jesd204_tx::base
uint32_t base
Definition: axi_jesd204_tx.h:86
JESD204_TX_MAGIC
#define JESD204_TX_MAGIC
Definition: axi_jesd204_tx.c:82
jesd204_tx_init::high_density
bool high_density
Definition: axi_jesd204_tx.h:123
JESD204_TX_ENCODER_64B66B
@ JESD204_TX_ENCODER_64B66B
Definition: axi_jesd204_tx.h:74
jesd204_tx_init::octets_per_frame
uint8_t octets_per_frame
Definition: axi_jesd204_tx.h:113
axi_jesd204_tx::tpl_data_path_width
uint32_t tpl_data_path_width
Definition: axi_jesd204_tx.h:92
jesd204_tx_init::base
uint32_t base
Definition: axi_jesd204_tx.h:111
axi_jesd204_tx_status_read
uint32_t axi_jesd204_tx_status_read(struct axi_jesd204_tx *jesd)
Read status of the JESD204 Transmit Peripherial.
Definition: axi_jesd204_tx.c:165
axi_jesd204_tx_remove
int32_t axi_jesd204_tx_remove(struct axi_jesd204_tx *jesd)
Free resoulces allocated for JESD204 TX peripheral.
Definition: axi_jesd204_tx.c:468
PCORE_VERSION_MAJOR
#define PCORE_VERSION_MAJOR(x)
Definition: axi_jesd204_tx.c:92
axi_jesd204_tx_write
int32_t axi_jesd204_tx_write(struct axi_jesd204_tx *jesd, uint32_t reg_addr, uint32_t reg_val)
JESD204 TX AXI Data Write.
Definition: axi_jesd204_tx.c:114
JESD204_TX_REG_LINK_DISABLE
#define JESD204_TX_REG_LINK_DISABLE
Definition: axi_jesd204_tx.c:64
no_os_axi_io_read
int32_t no_os_axi_io_read(uint32_t base, uint32_t offset, uint32_t *data)
AXI IO Altera specific read function.
Definition: axi_io.c:59
JESD204_TX_REG_SYSREF_STATUS
#define JESD204_TX_REG_SYSREF_STATUS
Definition: axi_jesd204_tx.c:71
jesd204_tx_config::lane_id
uint8_t lane_id
Definition: axi_jesd204_tx.h:54
axi_jesd204_tx_lane_clk_disable
int32_t axi_jesd204_tx_lane_clk_disable(struct axi_jesd204_tx *jesd)
JESD204 TX Lane Clock Disable.
Definition: axi_jesd204_tx.c:155
jesd204_tx_config::version
uint32_t version
Definition: axi_jesd204_tx.h:65
JESD204_SYNTH_DATA_PATH_WIDTH_GET
#define JESD204_SYNTH_DATA_PATH_WIDTH_GET(x)
Definition: axi_jesd204_tx.c:86
PCORE_VERSION_PATCH
#define PCORE_VERSION_PATCH(x)
Definition: axi_jesd204_tx.c:94
JESD204_TX_ENCODER_8B10B
@ JESD204_TX_ENCODER_8B10B
Definition: axi_jesd204_tx.h:73
jesd204_tx_init::converter_resolution
uint8_t converter_resolution
Definition: axi_jesd204_tx.h:119
axi_jesd204_tx_read
int32_t axi_jesd204_tx_read(struct axi_jesd204_tx *jesd, uint32_t reg_addr, uint32_t *reg_val)
JESD204 TX AXI Data Read.
Definition: axi_jesd204_tx.c:129
axi_jesd204_tx_set_lane_ilas
void axi_jesd204_tx_set_lane_ilas(struct axi_jesd204_tx *jesd, struct jesd204_tx_config *config, uint32_t lane)
Set the JESD204 TX lane ILAS.
Definition: axi_jesd204_tx.c:279
axi_jesd204_tx
Definition: axi_jesd204_tx.h:82
axi_jesd204_tx_init
int32_t axi_jesd204_tx_init(struct axi_jesd204_tx **jesd204, const struct jesd204_tx_init *init)
Device initialization.
Definition: axi_jesd204_tx.c:379
JESD204_TX_REG_CONF_NUM_LANES
#define JESD204_TX_REG_CONF_NUM_LANES
Definition: axi_jesd204_tx.c:57
JESD204_TX_REG_CONF0
#define JESD204_TX_REG_CONF0
Definition: axi_jesd204_tx.c:73
JESD204_TPL_DATA_PATH_WIDTH_GET
#define JESD204_TPL_DATA_PATH_WIDTH_GET(x)
Definition: axi_jesd204_tx.c:88
axi_jesd204_tx_init
int32_t axi_jesd204_tx_init(struct axi_jesd204_tx **jesd204, const struct jesd204_tx_init *init)
Device initialization.
Definition: axi_jesd204_tx.c:379
axi_jesd204_tx::data_path_width
uint32_t data_path_width
Definition: axi_jesd204_tx.h:90
axi_jesd204_tx_status_read
uint32_t axi_jesd204_tx_status_read(struct axi_jesd204_tx *jesd)
Read status of the JESD204 Transmit Peripherial.
Definition: axi_jesd204_tx.c:165
axi_jesd204_tx::encoder
enum jesd204_tx_encoder encoder
Definition: axi_jesd204_tx.h:100
axi_jesd204_tx::config
struct jesd204_tx_config config
Definition: axi_jesd204_tx.h:94
jesd204_tx_init::converters_per_device
uint8_t converters_per_device
Definition: axi_jesd204_tx.h:117
axi_jesd204_tx_lane_clk_disable
int32_t axi_jesd204_tx_lane_clk_disable(struct axi_jesd204_tx *jesd)
JESD204 TX Lane Clock Disable.
Definition: axi_jesd204_tx.c:155
no_os_axi_io_write
int32_t no_os_axi_io_write(uint32_t base, uint32_t offset, uint32_t data)
AXI IO Altera specific write function.
Definition: axi_io.c:73
jesd204_tx_init::frames_per_multiframe
uint16_t frames_per_multiframe
Definition: axi_jesd204_tx.h:115
JESD204_TX_ENCODER_UNKNOWN
@ JESD204_TX_ENCODER_UNKNOWN
Definition: axi_jesd204_tx.h:72
jesd204_tx_config::bank_id
uint8_t bank_id
Definition: axi_jesd204_tx.h:53
jesd204_tx_init::name
const char * name
Definition: axi_jesd204_tx.h:109
no_os_util.h
Implementation of utility functions.
axi_jesd204_tx::lane_clk_khz
uint32_t lane_clk_khz
Definition: axi_jesd204_tx.h:98
PCORE_VERSION_MINOR
#define PCORE_VERSION_MINOR(x)
Definition: axi_jesd204_tx.c:93
jesd204_tx_config::samples_per_frame
uint8_t samples_per_frame
Definition: axi_jesd204_tx.h:61
jesd204_tx_config::jesd_version
uint8_t jesd_version
Definition: axi_jesd204_tx.h:62
jesd204_tx_init
JESD204B/C Transmit Peripheral Initialization Structure.
Definition: axi_jesd204_tx.h:107
axi_jesd204_tx_link_status_label
const char * axi_jesd204_tx_link_status_label[]
Definition: axi_jesd204_tx.c:96
jesd204_tx_init::lane_clk_khz
uint32_t lane_clk_khz
Definition: axi_jesd204_tx.h:131
NO_OS_DIV_ROUND_CLOSEST
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:58
axi_jesd204_tx.h
Driver for the Analog Devices AXI-JESD204-TX peripheral.
jesd204_tx_config::frames_per_multiframe
uint16_t frames_per_multiframe
Definition: axi_jesd204_tx.h:57