Analog to Digital Converter#

Modules#

sl_adc_threshold_config_t

sl_adc_fifo_thrld_config_t

sl_adc_clock_config_t

sl_adc_version_t

Enumerations#

enum
SL_ADC_SINGLE_ENDED
SL_ADC_DIFFERENTIAL
SL_ADC_INPUT_TYPE_LAST
}

Enumeration for ADC input type.

enum
SL_ADC_FIFO_MODE = ADC_FIFOMODE_ENABLE
SL_ADC_STATIC_MODE = ADC_STATICMODE_ENABLE
SL_ADC_OPERATION_MODE_LAST
}

Enumeration for ADC operation mode.

enum
SL_ADC_INTERNAL_DMA = INTERNAL_DMA_EN
SL_ADC_EXTERNAL_DMA = EXTERNAL_DMA_EN
SL_ADC_DMA_TYPE_LAST
}

Enumeration for ADC DMA type.

enum
SL_ADC_SINGLE_CHNL = DYNAMIC_MODE_DI
SL_ADC_MULTI_CHNL = DYNAMIC_MODE_EN
SL_ADC_CHANNEL_TYPE_LAST
}

Enumeration for ADC multiple channel selection.

enum
SL_ULP_TIMER_EXT_TRIGGER = ULP_TIMER_EXT_TRIGGER
SL_ULP_GPIO_EXT_TRIGGER = ULP_GPIO_EXT_TRIGGER
SL_M4_CT_EXT_TRIGGER = M4_CT_EXT_TRIGGER
SL_ADC_EXT_TRIGGER_TYPE_LAST
}

Enumeration for ADC external trigger type.

enum
SL_ADC_EXT_TRIGGER_1 = DETECTION1
SL_ADC_EXT_TRIGGER_2 = DETECTION2
SL_ADC_EXT_TRIGGER_3 = DETECTION3
SL_ADC_EXT_TRIGGER_4 = DETECTION4
SL_ADC_EXT_TRIGGER_LAST
}

Enumeration for ADC external trigger number.

enum
SL_ADC_EXT_TRIGGER_POS_EDGE = POSITIVE_EDGE
SL_ADC_EXT_TRIGGER_NEG_EDGE = NEGATIVE_EDGE
SL_ADC_EXT_TRIGGER_POS_NEG_EDGE = POS_NEG_EDGE
SL_ADC_EXT_TRIGGER_EDGE_LAST
}

Enumeration for ADC external trigger edge selection.

enum
SL_ADC_EXT_TRIGGER_SEL_1 = EXT_TRIGGER_SEL1
SL_ADC_EXT_TRIGGER_SEL_2 = EXT_TRIGGER_SEL2
SL_ADC_EXT_TRIGGER_SEL_3 = EXT_TRIGGER_SEL3
SL_ADC_EXT_TRIGGER_SEL_4 = EXT_TRIGGER_SEL4
SL_ADC_EXT_TRIGGER_SEL_LAST
}

Enumeration for ADC external trigger selection.

enum
SL_ADC_CHANNEL_0
SL_ADC_CHANNEL_1
SL_ADC_CHANNEL_2
SL_ADC_CHANNEL_3
SL_ADC_CHANNEL_4
SL_ADC_CHANNEL_5
SL_ADC_CHANNEL_6
SL_ADC_CHANNEL_7
SL_ADC_CHANNEL_8
SL_ADC_CHANNEL_9
SL_ADC_CHANNEL_10
SL_ADC_CHANNEL_11
SL_ADC_CHANNEL_12
SL_ADC_CHANNEL_13
SL_ADC_CHANNEL_14
SL_ADC_CHANNEL_15
}

Enumeration for ADC channel.

Typedefs#

typedef adc_ch_config_t

Renamed ADC channel configuration structure.

typedef adc_config_t

Renamed ADC configuration structure.

typedef adc_inter_config_t

Renamed ADC internal configuration structure.

typedef adc_extr_config_t

Renamed ADC external trigger configuration structure.

typedef void(*
sl_adc_callback_t)(uint8_t channel, uint8_t event)

Typedef for user supplied callback function, which is called when ADC sample completes.

Functions#

sl_status_t
sl_si91x_adc_configure_clock(sl_adc_clock_config_t *clock_configuration)

Set the clock for the ADC peripheral, Configures the PLL clock with the value set by user in the clock configuration structure.

sl_status_t
sl_si91x_adc_init(sl_adc_channel_config_t adc_channel_config, sl_adc_config_t adc_config, float vref_value)

Initialize the ADC peripheral.

sl_status_t
sl_si91x_adc_set_channel_configuration(sl_adc_channel_config_t adc_channel_config, sl_adc_config_t adc_config)

Configure ADC channel parameters.

sl_status_t
sl_si91x_adc_register_event_callback(sl_adc_callback_t callback_event)

Register the user callback function.

void

Un-register the user callback function.

sl_status_t
sl_si91x_adc_configure_external_trigger(sl_adc_external_config_t adc_external_trigger)

Configure the ADC external trigger.

sl_status_t
sl_si91x_adc_configure_channel_sampling_rate(sl_adc_internal_config_t adc_internal_config, uint8_t channel_num)

Configure the ADC sampling rate for the ADC channels.

sl_status_t
sl_si91x_adc_get_external_trigger_status(sl_adc_external_config_t adc_external_trigger, uint8_t *ext_trigger)

ADC can give a sample for the selected trigger with a trigger match.

sl_status_t
sl_si91x_adc_clear_external_trigger(sl_adc_external_config_t adc_external_trigger)

Clear the ADC external trigger.

sl_status_t
sl_si91x_adc_configure_ping_pong_memory_address(sl_adc_internal_config_t adc_internal_config, uint8_t channel_num)

Configure the ADC ping and pong memory location and length To configure the Ping and pong memory location along with length of ping memory and pong memory.

sl_status_t
sl_si91x_adc_enable_ping_pong(uint8_t channel_num)

Enable ping pong for the corresponding ADC channels It is an applicable only for FIFO mode of ADC operation.

sl_status_t
sl_si91x_adc_disable_ping_pong(uint8_t channel_num)

Disable ping pong for the corresponding ADC channels.

sl_status_t

Enable DMA for the corresponding ADC channels.

sl_status_t

Disable DMA for the corresponding ADC channels.

sl_status_t
sl_si91x_adc_configure_static_mode(sl_adc_channel_config_t adc_channel_config, uint8_t channel_num)

Configure the ADC in Static Mode it can be programmed for setting input type, positive and negative input channel selection.

sl_status_t
sl_si91x_adc_configure_fifo_mode(sl_adc_channel_config_t adc_channel_config, uint8_t channel_num)

Configure the ADC in FIFO Mode.

sl_status_t
sl_si91x_adc_channel_enable(uint8_t channel_num)

Enable the ADC channel.

sl_status_t
sl_si91x_adc_channel_disable(uint8_t channel_num)

Disable the ADC channel.

sl_status_t
sl_si91x_adc_set_power_mode(POWER_STATE state)

Set the Power On and off for ADC.

sl_status_t

Enable or Disable the Noise averaging mode to ADC.

sl_status_t

Enable BJT based Temperature sensor as an input to ADC.

sl_status_t
sl_si91x_adc_fifo_threshold_configuration(sl_adc_config_t adc_config, sl_adc_fifo_thrld_config_t adc_fifo_threshold)

Configuring ADC fifo threshold.

sl_status_t
sl_si91x_adc_threshold_configuration(sl_adc_threshold_config_t adc_threshold)

Configure the ADC threshold to compare threshold value with ADC data.

sl_status_t
sl_si91x_adc_read_data(sl_adc_channel_config_t adcchconfig, uint8_t channel_num)

Read the ADC samples when FIFO mode is enabled.

sl_status_t
sl_si91x_adc_read_data_static(sl_adc_channel_config_t adc_channel_config, sl_adc_config_t adc_config, uint16_t *adc_value)

Read the ADC samples when static mode is enabled.

uint32_t
sl_si91x_adc_get_sampling_rate(uint8_t channel_num)

To get the channel sampling rate value which is configured to ADC.

sl_status_t
sl_si91x_adc_deinit(sl_adc_config_t adc_config)

Uninitialize the ADC.

sl_status_t
sl_si91x_adc_start(sl_adc_config_t adc_config)

Start the ADC operation.

sl_status_t
sl_si91x_adc_stop(sl_adc_config_t adc_config)

Stop the ADC operation.

Get the ADC version.

Macros#

#define
SL_INTERNAL_DMA INTERNAL_DMA
#define
SL_ADC_STATIC_MODE_EVENT ADC_STATIC_MODE_CALLBACK
#define
SIGN_BIT BIT(11)

Enumeration Documentation#

sl_adc_input_type_typedef_t#

sl_adc_input_type_typedef_t

Enumeration for ADC input type.

Enumerator
SL_ADC_SINGLE_ENDED

Input type single ended.

SL_ADC_DIFFERENTIAL

Input type differential.

SL_ADC_INPUT_TYPE_LAST

Last member of enum for validation.


Definition at line 69 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_adc_operation_mode_typedef_t#

sl_adc_operation_mode_typedef_t

Enumeration for ADC operation mode.

Enumerator
SL_ADC_FIFO_MODE

operation mode as fifo mode

SL_ADC_STATIC_MODE

operation mode as static mode

SL_ADC_OPERATION_MODE_LAST

Last member of enum for validation.


Definition at line 76 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_adc_dma_type_typedef_t#

sl_adc_dma_type_typedef_t

Enumeration for ADC DMA type.

Enumerator
SL_ADC_INTERNAL_DMA

Internal DMA type.

SL_ADC_EXTERNAL_DMA

External DMA type.

SL_ADC_DMA_TYPE_LAST

Last member of enum for validation.


Definition at line 83 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_adc_channel_type_typedef_t#

sl_adc_channel_type_typedef_t

Enumeration for ADC multiple channel selection.

Enumerator
SL_ADC_SINGLE_CHNL

Dynamic mode disable.

SL_ADC_MULTI_CHNL

Dynamic mode enable.

SL_ADC_CHANNEL_TYPE_LAST

Last member of enum for validation.


Definition at line 90 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_adc_ext_trigger_type_t#

sl_adc_ext_trigger_type_t

Enumeration for ADC external trigger type.

Enumerator
SL_ULP_TIMER_EXT_TRIGGER

ULP timer external trigger type.

SL_ULP_GPIO_EXT_TRIGGER

ULP gpio external trigger type.

SL_M4_CT_EXT_TRIGGER

M4 CT external trigger type.

SL_ADC_EXT_TRIGGER_TYPE_LAST

Last member of enum for validation.


Definition at line 97 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_adc_ext_trigger_num_t#

sl_adc_ext_trigger_num_t

Enumeration for ADC external trigger number.

Enumerator
SL_ADC_EXT_TRIGGER_1

External trigger detection 1.

SL_ADC_EXT_TRIGGER_2

External trigger detection 2.

SL_ADC_EXT_TRIGGER_3

External trigger detection 3.

SL_ADC_EXT_TRIGGER_4

External trigger detection 4.

SL_ADC_EXT_TRIGGER_LAST

Last member of enum for validation.


Definition at line 105 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_adc_ext_trigger_edge_t#

sl_adc_ext_trigger_edge_t

Enumeration for ADC external trigger edge selection.

Enumerator
SL_ADC_EXT_TRIGGER_POS_EDGE

External trigger positive edge.

SL_ADC_EXT_TRIGGER_NEG_EDGE

External trigger negative edge.

SL_ADC_EXT_TRIGGER_POS_NEG_EDGE

External trigger positive and negative edge.

SL_ADC_EXT_TRIGGER_EDGE_LAST

Last member of enum for validation.


Definition at line 114 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_adc_ext_trigger_sel_t#

sl_adc_ext_trigger_sel_t

Enumeration for ADC external trigger selection.

Enumerator
SL_ADC_EXT_TRIGGER_SEL_1

External trigger selection 1.

SL_ADC_EXT_TRIGGER_SEL_2

External trigger selection 2.

SL_ADC_EXT_TRIGGER_SEL_3

External trigger selection 3.

SL_ADC_EXT_TRIGGER_SEL_4

External trigger selection 4.

SL_ADC_EXT_TRIGGER_SEL_LAST

Last member of enum for validation.


Definition at line 122 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_adc_channel_id_t#

sl_adc_channel_id_t

Enumeration for ADC channel.

Enumerator
SL_ADC_CHANNEL_0

ADC channel 1.

SL_ADC_CHANNEL_1

ADC channel 2.

SL_ADC_CHANNEL_2

ADC channel 3.

SL_ADC_CHANNEL_3

ADC channel 4.

SL_ADC_CHANNEL_4

ADC channel 5.

SL_ADC_CHANNEL_5

ADC channel 6.

SL_ADC_CHANNEL_6

ADC channel 7.

SL_ADC_CHANNEL_7

ADC channel 8.

SL_ADC_CHANNEL_8

ADC channel 9.

SL_ADC_CHANNEL_9

ADC channel 10.

SL_ADC_CHANNEL_10

ADC channel 11.

SL_ADC_CHANNEL_11

ADC channel 12.

SL_ADC_CHANNEL_12

ADC channel 13.

SL_ADC_CHANNEL_13

ADC channel 14.

SL_ADC_CHANNEL_14

ADC channel 15.

SL_ADC_CHANNEL_15

ADC channel 16.


Definition at line 131 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

Typedef Documentation#

sl_adc_channel_config_t#

typedef adc_ch_config_t sl_adc_channel_config_t

Renamed ADC channel configuration structure.


Definition at line 48 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_adc_config_t#

typedef adc_config_t sl_adc_config_t

Renamed ADC configuration structure.


Definition at line 49 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_adc_internal_config_t#

typedef adc_inter_config_t sl_adc_internal_config_t

Renamed ADC internal configuration structure.


Definition at line 50 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_adc_external_config_t#

typedef adc_extr_config_t sl_adc_external_config_t

Renamed ADC external trigger configuration structure.


Definition at line 51 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_adc_callback_t#

typedef void(* sl_adc_callback_t) (uint8_t channel, uint8_t event) )(uint8_t channel, uint8_t event)

Typedef for user supplied callback function, which is called when ADC sample completes.

Parameters
[in]channel

ADC channel number

[in]event

ADC event for different interrupt.


Definition at line 60 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

Function Documentation#

sl_si91x_adc_configure_clock#

sl_status_t sl_si91x_adc_configure_clock (sl_adc_clock_config_t * clock_configuration)

Set the clock for the ADC peripheral, Configures the PLL clock with the value set by user in the clock configuration structure.

Parameters
[in]clock_configuration

: clock structure variables ( sl_adc_clock_config_t)

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_FAIL (0x0001) - The function is failed

    • SL_STATUS_NOT_INITIALIZED (0x0011) - Clock is not initialized


Definition at line 196 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_init#

sl_status_t sl_si91x_adc_init (sl_adc_channel_config_t adc_channel_config, sl_adc_config_t adc_config, float vref_value)

Initialize the ADC peripheral.

Parameters
[in]adc_channel_config

: ADC channels configuration structure variable

[in]adc_config

: ADC operation configuration structure variable

[in]vref_value

: Reference voltage

Based on the sampling rate, the ADC clock source will set and Pass the Vref value to set the reference voltage to ADC.

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_BUSY (0x0004) - The function is already active

    • SL_STATUS_INVALID_COUNT (0x002B) - Mismatch count

    • SL_STATUS_INVALID_RANGE (0x0028) - Mismatch Range


Definition at line 216 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_set_channel_configuration#

sl_status_t sl_si91x_adc_set_channel_configuration (sl_adc_channel_config_t adc_channel_config, sl_adc_config_t adc_config)

Configure ADC channel parameters.

Parameters
[in]adc_channel_config

: ADC channels configuration structure variable.

[in]adc_config

: ADC operation configuration structure variable.

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_INVALID_RANGE (0x0028) - Mismatch Range


Definition at line 238 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_register_event_callback#

sl_status_t sl_si91x_adc_register_event_callback (sl_adc_callback_t callback_event)

Register the user callback function.

Parameters
[in]callback_event

Pointer to the function which needs to be called at the time of interrupt

At the time of events, the function passed in the parameter is called with the respective event as the parameter. Before calling this function again, it is mandatory to call the sl_si91x_adc_unregister_event_callback function to unregister the callback, otherwise it returns SL_STATUS_BUSY error code.

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer

    • SL_STATUS_BUSY (0x0004) - Driver is busy


Definition at line 261 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_unregister_event_callback#

void sl_si91x_adc_unregister_event_callback (void )

Un-register the user callback function.

Parameters
[in]

It is mandatory to call this function before registering the callback again.

Returns

  • none


Definition at line 273 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_configure_external_trigger#

sl_status_t sl_si91x_adc_configure_external_trigger (sl_adc_external_config_t adc_external_trigger)

Configure the ADC external trigger.

Parameters
[in]adc_external_trigger

: ADC external trigger configuration structure variable.

Triggers can be used in PS4 State to collect the sample from a pre-defined channel. ADC can give a sample for the selected trigger with a trigger match. There are 3 external triggers, which are enabled by

sl_si91x_adc_configure_clock

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid


Definition at line 299 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_configure_channel_sampling_rate#

sl_status_t sl_si91x_adc_configure_channel_sampling_rate (sl_adc_internal_config_t adc_internal_config, uint8_t channel_num)

Configure the ADC sampling rate for the ADC channels.

Parameters
[in]adc_internal_config

: Channel offset and frequency for each channel to set sampling rate.

[in]channel_num

: Channel number

It will set the channel offset value and channel frequency for each channel to set the sampling rate. The minimum allowed value is 3 to satisfy the Nyquist criteria of sampling rates. Freq_value 1 and 2 are not allowed.

Returns

  • sl_status_t : Returns 'SL_STATUS_OK' on successful execution.


Definition at line 316 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_get_external_trigger_status#

sl_status_t sl_si91x_adc_get_external_trigger_status (sl_adc_external_config_t adc_external_trigger, uint8_t * ext_trigger)

ADC can give a sample for the selected trigger with a trigger match.

Parameters
[in]adc_external_trigger

: ADC external trigger configuration structure variable.

[in]ext_trigger

: The status of external trigger will be store in this.

Read the ADC external trigger match.

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid


Definition at line 339 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_clear_external_trigger#

sl_status_t sl_si91x_adc_clear_external_trigger (sl_adc_external_config_t adc_external_trigger)

Clear the ADC external trigger.

Parameters
[in]adc_external_trigger

: ADC external trigger configuration structure variable.

After reading the trigger match can clear specific trigger using sl_si91x_adc_clear_external_trigger API.

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid


Definition at line 361 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_configure_ping_pong_memory_address#

sl_status_t sl_si91x_adc_configure_ping_pong_memory_address (sl_adc_internal_config_t adc_internal_config, uint8_t channel_num)

Configure the ADC ping and pong memory location and length To configure the Ping and pong memory location along with length of ping memory and pong memory.

Parameters
[in]adc_internal_config

: ADC internal trigger configuration structure variable.

[in]channel_num

: Channel number

It is an applicable only for FIFO mode of ADC operation. FIFO mode supports dual buffer cyclic mode to avoid loss of data when buffer is full. In dual buffer cyclic mode, if Ping buffer is full for particular channel, incoming sampled data is written into Pong buffer such that, samples from Ping buffer are read back by controller during this time. That’s why there are two start addresses, two buffer lengths and two valid signals for each channel.

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid


Definition at line 384 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_enable_ping_pong#

sl_status_t sl_si91x_adc_enable_ping_pong (uint8_t channel_num)

Enable ping pong for the corresponding ADC channels It is an applicable only for FIFO mode of ADC operation.

Parameters
[in]channel_num

: Channel number

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid


Definition at line 403 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_disable_ping_pong#

sl_status_t sl_si91x_adc_disable_ping_pong (uint8_t channel_num)

Disable ping pong for the corresponding ADC channels.

Parameters
[in]channel_num

: Channel number

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid


Definition at line 424 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_internal_per_channel_dma_enable#

sl_status_t sl_si91x_adc_internal_per_channel_dma_enable (uint8_t channel_num)

Enable DMA for the corresponding ADC channels.

Parameters
[in]channel_num

: Channel number

It is an applicable only for FIFO mode of ADC operation.

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid


Definition at line 442 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_internal_per_channel_dma_disable#

sl_status_t sl_si91x_adc_internal_per_channel_dma_disable (uint8_t channel_num)

Disable DMA for the corresponding ADC channels.

Parameters
[in]channel_num

: Channel number

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid


Definition at line 463 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_configure_static_mode#

sl_status_t sl_si91x_adc_configure_static_mode (sl_adc_channel_config_t adc_channel_config, uint8_t channel_num)

Configure the ADC in Static Mode it can be programmed for setting input type, positive and negative input channel selection.

Parameters
[in]adc_channel_config

: ADC channels configuration structure variable.

N/Achannel_num

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_INVALID_RANGE (0x0028) - Mismatch Range


Definition at line 488 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_configure_fifo_mode#

sl_status_t sl_si91x_adc_configure_fifo_mode (sl_adc_channel_config_t adc_channel_config, uint8_t channel_num)

Configure the ADC in FIFO Mode.

Parameters
[in]adc_channel_config

: ADC channels configuration structure variable.

[in]channel_num

: Channel number

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_INVALID_RANGE (0x0028) - Mismatch Range


Definition at line 513 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_channel_enable#

sl_status_t sl_si91x_adc_channel_enable (uint8_t channel_num)

Enable the ADC channel.

Parameters
[in]channel_num

: Channel number

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid


Definition at line 528 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_channel_disable#

sl_status_t sl_si91x_adc_channel_disable (uint8_t channel_num)

Disable the ADC channel.

Parameters
[in]channel_num

: Channel number

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid


Definition at line 547 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_set_power_mode#

sl_status_t sl_si91x_adc_set_power_mode (POWER_STATE state)

Set the Power On and off for ADC.

Parameters
[in]state

: ADC_POWER_ON - To powerup adc powergates, ADC_POWER_OFF - To powerdown adc powergates ( POWER_STATE )

Returns

  • status 0 if successful,

    • SL_STATUS_OK (0x0000) - Success


Definition at line 563 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_set_noise_average_mode#

sl_status_t sl_si91x_adc_set_noise_average_mode (boolean_t state)

Enable or Disable the Noise averaging mode to ADC.

Parameters
[in]state

: 1 - To enable noise averaging mode, 0 - To disable noise averaging mode

Returns

  • Returns 'SL_STATUS_OK' on successful execution.


Definition at line 579 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_temperature_sensor_enable#

sl_status_t sl_si91x_adc_temperature_sensor_enable (void )

Enable BJT based Temperature sensor as an input to ADC.

Parameters
[in]

Operation mode of ADC should be Static.

Returns

  • Returns 'SL_STATUS_OK' on successful execution.


Definition at line 593 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_fifo_threshold_configuration#

sl_status_t sl_si91x_adc_fifo_threshold_configuration (sl_adc_config_t adc_config, sl_adc_fifo_thrld_config_t adc_fifo_threshold)

Configuring ADC fifo threshold.

Parameters
[in]adc_config

: ADC operation configuration structure variable.

[in]adc_fifo_threshold

: ADC fifo structure variable like an empty fifo, a full fifo threshold level. ( sl_adc_fifo_thrld_config_t )

Maximum FIFO depth is 16 can configure the threshold value.

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_INVALID_RANGE (0x0028) - Mismatch Range


Definition at line 613 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_threshold_configuration#

sl_status_t sl_si91x_adc_threshold_configuration (sl_adc_threshold_config_t adc_threshold)

Configure the ADC threshold to compare threshold value with ADC data.

Parameters
[in]adc_threshold

: ADC threshold configuration structure variables.

This is valid in ADC Static mode only.

Returns

  • Returns 'SL_STATUS_OK' on successful execution.


Definition at line 632 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_read_data#

sl_status_t sl_si91x_adc_read_data (sl_adc_channel_config_t adcchconfig, uint8_t channel_num)

Read the ADC samples when FIFO mode is enabled.

Parameters
[in]adcchconfig

: ADC channels configuration structure variable.

[in]channel_num

channel_num : Channel number

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_INVALID_RANGE (0x0028) - Mismatch Range


Definition at line 653 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_read_data_static#

sl_status_t sl_si91x_adc_read_data_static (sl_adc_channel_config_t adc_channel_config, sl_adc_config_t adc_config, uint16_t * adc_value)

Read the ADC samples when static mode is enabled.

Parameters
[in]adc_channel_config

: ADC channels configuration structure variable.

[in]adc_config

: ADC operation configuration structure variable.

[in]adc_value

: Store the reading data on adc_value.

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid

    • SL_STATUS_INVALID_RANGE (0x0028) - Mismatch Range


Definition at line 675 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_get_sampling_rate#

uint32_t sl_si91x_adc_get_sampling_rate (uint8_t channel_num)

To get the channel sampling rate value which is configured to ADC.

Parameters
[in]channel_num

: Channel number

Returns

  • Returns sampling rate what it get from register


Definition at line 694 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_deinit#

sl_status_t sl_si91x_adc_deinit (sl_adc_config_t adc_config)

Uninitialize the ADC.

Parameters
[in]adc_config

: ADC operation configuration structure variable.

If the DMA is enabled, it also uninitializes the DMA.

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid


Definition at line 710 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_start#

sl_status_t sl_si91x_adc_start (sl_adc_config_t adc_config)

Start the ADC operation.

Parameters
[in]adc_config

: ADC operation configuration structure variable.

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid


Definition at line 727 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_stop#

sl_status_t sl_si91x_adc_stop (sl_adc_config_t adc_config)

Stop the ADC operation.

Parameters
[in]adc_config

: ADC operation configuration structure variable.

Returns

  • status 0 if successful, else error code as follow

    • SL_STATUS_OK (0x0000) - Success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - Parameters are invalid


Definition at line 746 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

sl_si91x_adc_get_version#

sl_adc_version_t sl_si91x_adc_get_version (void )

Get the ADC version.

Parameters
[in]

It returns the API version of ADC.

Returns


Definition at line 755 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

Macro Definition Documentation#

SL_INTERNAL_DMA#

#define SL_INTERNAL_DMA
Value:
INTERNAL_DMA

Definition at line 64 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

SL_ADC_STATIC_MODE_EVENT#

#define SL_ADC_STATIC_MODE_EVENT
Value:
ADC_STATIC_MODE_CALLBACK

Definition at line 65 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h

SIGN_BIT#

#define SIGN_BIT
Value:
BIT(11)

Definition at line 66 of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_adc.h