VitroIO SDK
Software development kit for Vitro Shard.
Loading...
Searching...
No Matches
vitroio::sdk::ShardEdge Class Reference

#include <shard_edge.h>

Public Member Functions

 ShardEdge (bool i2c3Enabled, bool uartUserEnabled, bool spi1Enabled, bool rs232Enabled, uint8_t adc1_range, uint8_t adc2_range, uint8_t adc3_range, uint8_t adc4_range)
 Function creates instance of ShardEdge class and set private variables to given input values. More...
 
int configureShardEdge (void)
 Function configures Shard Edge according to variables set during instance creation. More...
 
double readVoltage (int adc_port)
 Function reads voltage from given ADC port. More...
 
double readCurrentLoop (int cl_port)
 Function reads current loop value from given CL. More...
 
int manageShardEdge24V (bool state)
 Function manage Shard Edge 24V output. More...
 

Constructor & Destructor Documentation

◆ ShardEdge()

vitroio::sdk::ShardEdge::ShardEdge ( bool  i2c3Enabled,
bool  uartUserEnabled,
bool  spi1Enabled,
bool  rs232Enabled,
uint8_t  adc1_range,
uint8_t  adc2_range,
uint8_t  adc3_range,
uint8_t  adc4_range 
)

Function creates instance of ShardEdge class and set private variables to given input values.

Parameters
i2c3EnabledPass true to enable I2C3. False to disable.
uartUserEnabledPass true to enable UART. False to disable.
spi1EnabledPass true to enable SPI1. False to disable.
rs232EnabledPass true to enable RS232. False to disable.
adc1_rangeADC1 range in Volts. Variable can only take values 2, 4, 8, 16, 30 V. Default value is 30V.
adc2_rangeADC2 range in Volts. Variable can only take values 2, 4, 8, 16, 30 V. Default value is 30V.
adc3_rangeADC3 range in Volts. Variable can only take values 2, 4, 8, 16, 30 V. Default value is 30V.
adc4_rangeADC4 range in Volts. Variable can only take values 2, 4, 8, 16, 30 V. Default value is 30V.

Member Function Documentation

◆ configureShardEdge()

int vitroio::sdk::ShardEdge::configureShardEdge ( void  )

Function configures Shard Edge according to variables set during instance creation.

Returns
Function returns 0 on success or -1 on error.

◆ manageShardEdge24V()

int vitroio::sdk::ShardEdge::manageShardEdge24V ( bool  state)

Function manage Shard Edge 24V output.

Parameters
statedefinition for the 24V output. Variable can only take values 0 for "OFF", 1 for "ON". Default value is 0.
Returns
Function returns 0 on success or -1 on error.

◆ readCurrentLoop()

double vitroio::sdk::ShardEdge::readCurrentLoop ( int  cl_port)

Function reads current loop value from given CL.

Parameters
cl_portCL which is read by this function.
Returns
Function returns current already scaled in mA.

◆ readVoltage()

double vitroio::sdk::ShardEdge::readVoltage ( int  adc_port)

Function reads voltage from given ADC port.

Parameters
adc_portADC which is read by this function.
Returns
Function returns voltage already scaled depending on set ADC range.