API  2.3.0
TSmarT Software Library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
tsmart_ai_config_t Struct Reference

Analog Input configuration structure. More...

#include <tsmart_ai.h>

Data Fields

tsmart_ai_mode_t ai_mode
 
tsmart_ai_sample_time_t ai_sample_time
 
uint8_t ai_scan_conv_mode
 
uint8_t ai_continuous_conv_mode
 
tsmart_ai_ext_trig_t ai_external_trig_conv
 
tsmart_ai_data_align_t ai_data_align
 
tsmart_ai_adc_t adc
 

Detailed Description

Analog Input configuration structure.

Examples:
ai_read.c, and modbus_slave_rtu.c.

Field Documentation

ADC to use.

Examples:
ai_read.c, and modbus_slave_rtu.c.
uint8_t ai_continuous_conv_mode

Specifies whether the conversion is performed in Continuous or Single mode. This parameter can be set to ENABLE or DISABLE.

Examples:
ai_read.c, and modbus_slave_rtu.c.
tsmart_ai_data_align_t ai_data_align

Specifies whether the ADC data alignment is left or right. This parameter can be one of the following values:

  • TSMART_AI_DATAALIGN_RIGHT
  • TSMART_AI_DATAALIGN_LEFT
Examples:
ai_read.c, and modbus_slave_rtu.c.
tsmart_ai_ext_trig_t ai_external_trig_conv

Defines the external trigger used to start the analog to digital conversion of regular channels. This parameter can be one of the following values:

  • TSMART_AI_EXTERNALTRIGCONV_T1_CC1
  • TSMART_AI_EXTERNALTRIGCONV_T1_CC2
  • TSMART_AI_EXTERNALTRIGCONV_T2_CC2
  • TSMART_AI_EXTERNALTRIGCONV_T3_TRGO
  • TSMART_AI_EXTERNALTRIGCONV_T4_CC4
  • TSMART_AI_EXTERNALTRIGCONV_EXT_IT11_TIM8_TRGO

  • TSMART_AI_EXTERNALTRIGCONV_T1_CC3
  • TSMART_AI_EXTERNALTRIGCONV_NONE

  • TSMART_AI_EXTERNALTRIGCONV_T3_CC1
  • TSMART_AI_EXTERNALTRIGCONV_T2_CC3
  • TSMART_AI_EXTERNALTRIGCONV_T8_CC1
  • TSMART_AI_EXTERNALTRIGCONV_T8_TRGO
  • TSMART_AI_EXTERNALTRIGCONV_T5_CC1
  • TSMART_AI_EXTERNALTRIGCONV_T5_CC3
Examples:
ai_read.c, and modbus_slave_rtu.c.

Configures the ADC to operate in independent or dual mode. This parameter can be one of the following values:

  • TSMART_AI_MODE_INDEPENDENT
  • TSMART_AI_MODE_REGINJECSIMULT
  • TSMART_AI_MODE_REGSIMULT_ALTERTRIG
  • TSMART_AI_MODE_INJECSIMULT_FASTINTERL
  • TSMART_AI_MODE_INJECSIMULT_SLOWINTERL
  • TSMART_AI_MODE_INJECSIMULT
  • TSMART_AI_MODE_REGSIMULT
  • TSMART_AI_MODE_FASTINTERL
  • TSMART_AI_MODE_SLOWINTERL
  • TSMART_AI_MODE_ATERTRIG
Examples:
ai_read.c, and modbus_slave_rtu.c.
tsmart_ai_sample_time_t ai_sample_time

Configures the ADC sampling time with one of the following values:

  • TSMART_AI_SAMPLETIME_1CYCLES5
  • TSMART_AI_SAMPLETIME_7CYCLES5
  • TSMART_AI_SAMPLETIME_13CYCLES5
  • TSMART_AI_SAMPLETIME_28CYCLES5
  • TSMART_AI_SAMPLETIME_41CYCLES5
  • TSMART_AI_SAMPLETIME_55CYCLES5
  • TSMART_AI_SAMPLETIME_71CYCLES5
  • TSMART_AI_SAMPLETIME_239CYCLES5
Examples:
ai_read.c, and modbus_slave_rtu.c.
uint8_t ai_scan_conv_mode

Specifies whether the conversion is performed in Scan (multichannels) or Single (one channel) mode. This parameter can be set to ENABLE or DISABLE

Examples:
ai_read.c, and modbus_slave_rtu.c.