Intel® MAX® 10 Analog to Digital Converter User Guide

ID 683596
Date 1/03/2024
Public
Document Table of Contents

5.6.1. Driver API

Table 40.  adc_stop
Prototype: void adc_stop(int sequencer_base)
Include:
  • altera_modular_adc.h
  • altera_modular_dual_adc.h
Parameter:
  • sequencer_base – Sequencer base value
Return: -
Description: Writes 0 to the Sequencer CMD register RUN bit, and polls the RUN bit until it is 0.
Table 41.  adc_start
Prototype: void adc_start(int sequencer_base)
Include:
  • altera_modular_adc.h
  • altera_modular_dual_adc.h
Parameter:
  • sequencer_base – Sequencer base value
Return: -
Description: Writes 1 to the Sequencer CMD register RUN bit.
Table 42.  adc_set_mode_run_once
Prototype: void adc_set_mode_run_once(int sequencer_base)
Include:
  • altera_modular_adc.h
  • altera_modular_dual_adc.h
Parameter:
  • sequencer_base – Sequencer base value
Return: -
Description:

Writes 1 to the Sequencer CMD register MODE bit once.

Note: Stop the ADC before calling this function. While RUN bit is set, changing ADC mode has no effect.

Table 43.  adc_set_mode_run_continuously
Prototype: void adc_set_mode_run_continuously(int sequencer_base)
Include:
  • altera_modular_adc.h
  • altera_modular_dual_adc.h
Parameter:
  • sequencer_base – Sequencer base value
Return: -
Description:

Writes 1 to the Sequencer CMD register MODE bit to continuous.

Note: Stop the ADC before calling this function. While RUN bit is set, changing ADC mode has no effect.

Table 44.  adc_recalibrate
Prototype: void adc_recalibrate(int sequencer_base)
Include:
  • altera_modular_adc.h
  • altera_modular_dual_adc.h
Parameter:
  • sequencer_base – Sequencer base value
Return: -
Description:

The function performs as follows,

  1. Backup Sequencer CMD register (because some values can be overwritten).
  2. Stop the ADC Sequencer Core.
  3. Set the recalibration request bits.
  4. Start the ADC Sequencer Core.
  5. Poll for RUN bit to be clear.
  6. Restore Sequencer CMD register
Table 45.  adc_interrupt_enable
Prototype: void adc_interrupt_enable(int sample_store_base)
Include:
  • altera_modular_adc.h
  • altera_modular_dual_adc.h
Parameter:
  • sample_store_base – Base address of sample store core
Return: -
Description: Sets the M_EOP bit in the ADC Sample Storage IER register.
Table 46.  adc_interrupt_disable
Prototype: void adc_interrupt_disable(int sample_store_base)
Include:
  • altera_modular_adc.h
  • altera_modular_dual_adc.h
Parameter:
  • sample_store_base – Base address of sample store core
Return: -
Description: Clears the M_EOP bit in the ADC Sample Storage IER register.
Table 47.  adc_clear_interrupt_status
Prototype: void adc_clear_interrupt_status(int sample_store_base)
Include:
  • altera_modular_adc.h
  • altera_modular_dual_adc.h
Parameter:
  • sample_store_base – Base address of sample store core
Return: -
Description: Clears the EOP bits in the Sample Storage ISR register.
Table 48.  adc_wait_for_interrupt
Prototype: void adc_wait_for_interrupt(int sample_store_base)
Include:
  • altera_modular_adc.h
  • altera_modular_dual_adc.h
Parameter:
  • sample_store_base – Base address of sample store core
Return: -
Description: Waits while the EOP bit of Sample Storage ISR register is 0.
Table 49.  adc_interrupt_asserted
Prototype: int adc_interrupt_asserted(int sample_store_base)
Include:
  • altera_modular_adc.h
  • altera_modular_dual_adc.h
Parameter:
  • sample_store_base – Base address of sample store core
Return: Return -1 if EOP bit is set, 0 if otherwise
Description: Reads the EOP bit of Sample Storage IRQ ISR register.
Table 50.  alt_adc_word_read
Prototype: void alt_adc_word_read(alt_u32 sample_store_base, alt_u32* dest_ptr, alt_u32 len)
Include:
  • altera_modular_adc.h
  • altera_modular_dual_adc.h
Parameter:
  • sample_store_base – Base address of sample store core
  • dest_ptr – destination buffer
  • len – number of 32-bit reads
Return: -
Description: Reads words from the sample store.