Skip to content

File syn_port_adc.h

FileList > port > syn_port_adc.h

Go to the source code of this file

Port contract for Analog-to-Digital Converter (ADC) hardware.

  • #include "../common/syn_defs.h"

Public Functions

Type Name
SYN_Status syn_port_adc_deinit (uint8_t adc_id)
De-initialize the ADC peripheral.
SYN_Status syn_port_adc_init (uint8_t adc_id, uint32_t channel_mask)
Initialize the ADC peripheral.
uint16_t syn_port_adc_read_channel (uint8_t adc_id, uint8_t channel)
Read a single analog channel (single-shot polled read).
SYN_Status syn_port_adc_start_dma_scan (uint8_t adc_id, uint16_t * dest, size_t num_channels)
Start continuous multi-channel background scan via DMA.

Public Functions Documentation

function syn_port_adc_deinit

De-initialize the ADC peripheral.

SYN_Status syn_port_adc_deinit (
    uint8_t adc_id
) 

Parameters:

  • adc_id ADC instance index.

Returns:

SYN_OK on success.


function syn_port_adc_init

Initialize the ADC peripheral.

SYN_Status syn_port_adc_init (
    uint8_t adc_id,
    uint32_t channel_mask
) 

Parameters:

  • adc_id ADC instance index (0 = ADC1, 1 = ADC2, etc.).
  • channel_mask Bitmask of channels to configure for analog input.

Returns:

SYN_OK on success.


function syn_port_adc_read_channel

Read a single analog channel (single-shot polled read).

uint16_t syn_port_adc_read_channel (
    uint8_t adc_id,
    uint8_t channel
) 

Parameters:

  • adc_id ADC instance index.
  • channel Channel index (0..18).

Returns:

12-bit raw conversion value (0..4095).


function syn_port_adc_start_dma_scan

Start continuous multi-channel background scan via DMA.

SYN_Status syn_port_adc_start_dma_scan (
    uint8_t adc_id,
    uint16_t * dest,
    size_t num_channels
) 

Parameters:

  • adc_id ADC instance index.
  • dest Destination buffer in SRAM.
  • num_channels Number of active channels in scan sequence.

Returns:

SYN_OK on success.



The documentation for this class was generated from the following file src/syntropic/port/syn_port_adc.h