This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
resources:eval:user-guides:ad469x [10 Dec 2020 11:04] – [HDL Design Description] Cristian Pop | resources:eval:user-guides:ad469x [10 Dec 2020 11:26] – [Functions Declarations] Cristian Pop | ||
---|---|---|---|
Line 30: | Line 30: | ||
===== No-OS Driver Description ===== | ===== No-OS Driver Description ===== | ||
+ | ==== Functions Declarations ==== | ||
+ | ^ Function | ||
+ | |<code c> | ||
+ | uint16_t reg_addr, | ||
+ | uint8_t *reg_data);</ | ||
+ | |<code c> | ||
+ | | ||
+ | | ||
+ | |<code c> | ||
+ | | ||
+ | | ||
+ | | ||
+ | |<code c> | ||
+ | uint16_t reg_addr, | ||
+ | uint8_t mask, | ||
+ | uint8_t data);</ | ||
+ | |<code c> | ||
+ | uint8_t channel, | ||
+ | uint32_t *buf, | ||
+ | uint16_t samples);</ | ||
+ | |<code c> | ||
+ | | ||
+ | | ||
+ | |<code c> | ||
+ | enum ad469x_channel_sequencing seq);</ | ||
+ | |<code c> | ||
+ | | ||
+ | |<code c> | ||
+ | | ||
+ | |||
+ | |<code c> | ||
+ | | ||
+ | | ||
+ | |<code c> | ||
+ | |<code c> | ||
+ | |<code c> | ||
+ | enum ad469x_osr_ratios ratio);</ | ||
+ | |<code c> | ||
+ | enum ad469x_osr_ratios ratio);</ | ||
+ | |<code c> | ||
+ | |<code c> | ||
+ | |<code c> | ||
+ | struct ad469x_init_param *init_param);</ | ||
+ | |<code c> | ||
+ | |||
+ | ==== Types Declarations ==== | ||
+ | |||
+ | |<code c> | ||
+ | /** | ||
+ | * @enum ad469x_channel_sequencing | ||
+ | * @brief Channel sequencing modes | ||
+ | */ | ||
+ | enum ad469x_channel_sequencing { | ||
+ | /** Single cycle read */ | ||
+ | AD469x_single_cycle, | ||
+ | /** Two cycle read */ | ||
+ | AD469x_two_cycle, | ||
+ | /** Sequence trough channels, standard mode */ | ||
+ | AD469x_standard_seq, | ||
+ | /** Sequence trough channels, advanced mode */ | ||
+ | AD469x_advanced_seq, | ||
+ | }; | ||
+ | |||
+ | /** | ||
+ | * @enum ad469x_busy_gp_sel | ||
+ | * @brief Busy state, possible general purpose pin selections | ||
+ | */ | ||
+ | enum ad469x_busy_gp_sel { | ||
+ | /** Busy on gp0 */ | ||
+ | AD469x_busy_gp0 = 0, | ||
+ | /** Busy on gp3 */ | ||
+ | AD469x_busy_gp3 = 1, | ||
+ | }; | ||
+ | |||
+ | /** | ||
+ | * @enum ad469x_reg_access | ||
+ | * @brief Register access modes | ||
+ | */ | ||
+ | enum ad469x_reg_access { | ||
+ | AD469x_BYTE_ACCESS, | ||
+ | AD469x_WORD_ACCESS, | ||
+ | }; | ||
+ | |||
+ | /** | ||
+ | * @enum ad469x_supported_dev_ids | ||
+ | * @brief Supported devices | ||
+ | */ | ||
+ | enum ad469x_supported_dev_ids { | ||
+ | ID_AD4695, | ||
+ | ID_AD4696, | ||
+ | ID_AD4697, | ||
+ | }; | ||
+ | |||
+ | /** | ||
+ | * @enum ad469x_osr_ratios | ||
+ | * @brief Supported oversampling ratios | ||
+ | */ | ||
+ | enum ad469x_osr_ratios { | ||
+ | AD469x_OSR_1, | ||
+ | AD469x_OSR_4, | ||
+ | AD469x_OSR_16, | ||
+ | AD469x_OSR_64 | ||
+ | }; | ||
+ | |||
+ | /** | ||
+ | * @struct ad469x_init_param | ||
+ | * @brief | ||
+ | */ | ||
+ | struct ad469x_init_param { | ||
+ | /* SPI */ | ||
+ | spi_init_param *spi_init; | ||
+ | /* SPI module offload init */ | ||
+ | struct spi_engine_offload_init_param *offload_init_param; | ||
+ | /* PWM generator init structure */ | ||
+ | struct pwm_init_param *trigger_pwm_init; | ||
+ | /** RESET GPIO initialization structure. */ | ||
+ | struct gpio_init_param *gpio_resetn; | ||
+ | /* Clock gen for hdl design init structure */ | ||
+ | struct axi_clkgen_init *clkgen_init; | ||
+ | /* Clock generator rate */ | ||
+ | uint32_t axi_clkgen_rate; | ||
+ | /* Register access speed */ | ||
+ | uint32_t reg_access_speed; | ||
+ | /* Register data width */ | ||
+ | uint8_t reg_data_width; | ||
+ | /* Capture data width */ | ||
+ | uint8_t capture_data_width; | ||
+ | /* Device Settings */ | ||
+ | enum ad469x_supported_dev_ids dev_id; | ||
+ | /** Invalidate the Data cache for the given address range */ | ||
+ | void (*dcache_invalidate_range)(uint32_t address, uint32_t bytes_count); | ||
+ | }; | ||
+ | |||
+ | /** | ||
+ | * @struct ad469x_dev | ||
+ | * @brief | ||
+ | */ | ||
+ | struct ad469x_dev { | ||
+ | /* SPI descriptor */ | ||
+ | spi_desc *spi_desc; | ||
+ | /* Clock gen for hdl design structure */ | ||
+ | struct axi_clkgen *clkgen; | ||
+ | /* Trigger conversion PWM generator descriptor */ | ||
+ | struct pwm_desc *trigger_pwm_desc; | ||
+ | /* SPI module offload init */ | ||
+ | struct spi_engine_offload_init_param *offload_init_param; | ||
+ | /* Register access speed */ | ||
+ | uint32_t reg_access_speed; | ||
+ | /* Register data width */ | ||
+ | uint8_t reg_data_width; | ||
+ | /* Capture data width */ | ||
+ | uint8_t capture_data_width; | ||
+ | /* Device Settings */ | ||
+ | enum ad469x_supported_dev_ids dev_id; | ||
+ | /** RESET GPIO handler. */ | ||
+ | struct gpio_desc *gpio_resetn; | ||
+ | /** Invalidate the Data cache for the given address range */ | ||
+ | void (*dcache_invalidate_range)(uint32_t address, uint32_t bytes_count); | ||
+ | /** Current channel sequence */ | ||
+ | enum ad469x_channel_sequencing ch_sequence; | ||
+ | /** OSR resolution corresponding to each channel, when advanced | ||
+ | * sequencer is selected. */ | ||
+ | enum ad469x_osr_ratios adv_seq_osr_resol[AD469x_CHANNEL_NO]; | ||
+ | /** Channel slots for advanced sequencer */ | ||
+ | uint8_t ch_slots[AD469x_SLOTS_NO]; | ||
+ | /** Temperature enabled for standard and advanced sequencer if set. */ | ||
+ | bool temp_enabled; | ||
+ | /** Number of active channel slots, for advanced sequencer */ | ||
+ | uint8_t num_slots; | ||
+ | }; | ||
+ | </ | ||
===== HDL Downloads ===== | ===== HDL Downloads ===== | ||
<WRAP round download 50%> | <WRAP round download 50%> |