API  2.2
TSmarT Software Library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions

Functions

void TSMART_AI_Init (tsmart_ai_t *TSMART_AI, tsmart_ai_config_t *TSMART_AI_config)
 Initialize an Analog Input. More...
 
int16_t TSMART_AI_Read (tsmart_ai_t *TSMART_AI)
 Reads data from an Analog Input. More...
 
int16_t TSMART_AI_Read_N (tsmart_ai_t *TSMART_AI, uint16_t TSMART_AI_samples)
 Reads data from an Analog Input. More...
 
int16_t TSMART_AI_FastRead (tsmart_ai_t *TSMART_AI)
 Reads data from an Analog Input. More...
 

Detailed Description

Function Documentation

int16_t TSMART_AI_FastRead ( tsmart_ai_t TSMART_AI)

Reads data from an Analog Input.

Reads the analog value of a selected pin through an associated ADC.

Parameters
TSMART_AIAnalog input structure handler.
Returns
  • ADC value [0...4096] of the Analog Input
  • TSMART_FAIL - Error reading the Analog Input
void TSMART_AI_Init ( tsmart_ai_t TSMART_AI,
tsmart_ai_config_t TSMART_AI_config 
)

Initialize an Analog Input.

This functions initializes the hardware configuration of the selected input and the associated OS mechanisms.

Parameters
TSMART_AIAnalog input structure handler.
TSMART_AI_configIndicates the ADC configuration
Examples:
ai_read.c, and modbus_slave_rtu.c.
int16_t TSMART_AI_Read ( tsmart_ai_t TSMART_AI)

Reads data from an Analog Input.

Reads the analog value (average 10) of a selected pin through an associated ADC.

Parameters
TSMART_AIAnalog input structure handler.
Returns
  • ADC value [0...4096] of the Analog Input
  • TSMART_FAIL - Error reading the Analog Input
Examples:
ai_read.c, and modbus_slave_rtu.c.
int16_t TSMART_AI_Read_N ( tsmart_ai_t TSMART_AI,
uint16_t  TSMART_AI_samples 
)

Reads data from an Analog Input.

Reads the analog value (average TSMART_AI_samples) of a selected pin through an associated ADC.

Parameters
TSMART_AIAnalog input structure handler.
TSMART_AI_samplesnumber os iterations
Returns
  • ADC value [0...4096] of the Analog Input
  • TSMART_FAIL - Error reading the Analog Input