SESTILIO  3.0.2
C Library for SESTILIO a smart A/D and D/A interface on USB 2.0
Port controls

Functions

CTYPE int DLL SE_WriteKPortConfig (int regAdd, int regValue, int usbDevice)
 Allow to write a register of the Port Expander (MCP23S17) used for PORT A and B. More...
 
CTYPE int DLL SE_ReadKPortConfig (int regAdd, int usbDevice)
 Allow to read a register of the Port Expander (MCP23S17) used for PORT A and B. More...
 
CTYPE int DLL SE_SetPortDirection (int port, int bit7, int bit6, int bit5, int bit4, int bit3, int bit2, int bit1, int bit0, int usbDevice)
 Allow to set direction (Input or Output) of the selected port. More...
 
CTYPE int DLL SE_WritePort (int portAddress, int portValue, int usbDevice)
 Allow to write on the selected port. More...
 
CTYPE int DLL SE_SetPortBit (int portAddress, int bit, int usbDevice)
 Allow to set a bit on the selected port. More...
 
CTYPE int DLL SE_ClrPortBit (int portAddress, int bit, int usbDevice)
 Allow to clear a bit on the selected port. More...
 
CTYPE int DLL SE_ReadPort (int portAddress, int usbDevice)
 Allow to read of the selected port. More...
 
CTYPE int DLL SE_PortPulse (int port, int initialValue, int finalValue, int pulseWidth, int timeBase, int usbDevice)
 Generate a pulse on the specified port. More...
 
CTYPE int DLL SE_CheckPortBit (int port, int bit, int usbDevice)
 Check a bit of the opto-coupled port. More...
 
CTYPE int DLL SE_PwmOptoCoupledPowerPort (int bitSelect, int enable, int lowWidth, int highWidth, int usbDevice)
 Start (or stop) a PWM the optically decoupled power port. More...
 
CTYPE int DLL SE_AuxPower (int pwrCtrl, int usbDevice)
 Turn on/off the power on Y4.16, maximum allowed current is 50mA. More...
 

Detailed Description

Basic functions used to read or write all available ports.

Function Documentation

◆ SE_AuxPower()

int SE_AuxPower ( int  pwrCtrl,
int  usbDevice 
)

Turn on/off the power on Y4.16, maximum allowed current is 50mA.

Parameters
pwrCtrl0 = Turn off, 1 = Turn on.
usbDeviceSpecify a SESTILIO USB identifier.
Returns
Operation status. Operation Status

Definition at line 470 of file sestilio.cpp.

◆ SE_CheckPortBit()

int SE_CheckPortBit ( int  port,
int  bit,
int  usbDevice 
)

Check a bit of the opto-coupled port.

Parameters
portPort selection. 0 = P4, 1 = P5, 2 = PA, 3 = PB, 4 = Opto-Coupled input. Port Identification Number
bitBit selection 0-7
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_ReadPort.
Returns
Bit activity 0 or 1.

Definition at line 409 of file sestilio.cpp.

◆ SE_ClrPortBit()

int SE_ClrPortBit ( int  portAddress,
int  bit,
int  usbDevice 
)

Allow to clear a bit on the selected port.

Parameters
portAddressPort selection. 0 = P4, 1 = P5, 2 = PA, 3 = PB, 4 = Opto-Coupled output. Port Identification Number
bitBit to set 0-7.
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_SetPortDirection, SE_WritePort, SE_SetPortBit, SE_ReadPort, SE_PortPulse.
Returns
Operation status. Operation Status

Definition at line 384 of file sestilio.cpp.

◆ SE_PortPulse()

int SE_PortPulse ( int  port,
int  initialValue,
int  finalValue,
int  pulseWidth,
int  timeBase,
int  usbDevice 
)

Generate a pulse on the specified port.

Parameters
portPort selection. 0 = P4, 1 = P5, 2 = PA, 3 = PB, 4 = Opto-Coupled output, 5 = Opto-Coupled power output. Port Identification Number
initialValueContents of the port for the pulse activity.
finalValueContents of the port at the end of activity.
pulseWidthPulse duration in time base unit.
timeBaseTime base. 0 = 40.816ns, 1 = 1uS, 2 = 1ms. Time base unit
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_SetPortDirection, SE_WritePort, SE_SetPortBit, SE_ReadPort, SE_ClrPortBit.
#include "sest.h"
if(SE_Open('0', 0) == SE_S_SUCCESS)
{
// Turn ON output 1 and 4 on Opto-Power-Isolated port (Y14)
// output 1 will be active only for 1 second
SE_PortPulse(SE_PORT_POWER, 0x05, 0x04, 1000, SE_P_TB_1_MS, 0);
}
Returns
Operation status. Operation Status

Definition at line 402 of file sestilio.cpp.

◆ SE_PwmOptoCoupledPowerPort()

int SE_PwmOptoCoupledPowerPort ( int  bit,
int  enable,
int  lowWidth,
int  highWidth,
int  usbDevice 
)

Start (or stop) a PWM the optically decoupled power port.

Parameters
bitBit selection 0-3.
enableEnable (1) or disable (0) the PWM.
lowWidthLow level duration.
highWidthHigh level duration.
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_WritePort, SE_PulsePort.
Returns
Operation status. Operation Status

Definition at line 463 of file sestilio.cpp.

◆ SE_ReadKPortConfig()

int SE_ReadKPortConfig ( int  regAdd,
int  usbDevice 
)

Allow to read a register of the Port Expander (MCP23S17) used for PORT A and B.

Parameters
regAddRegister address.
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_WriteKPortConfig.
Returns
Register contents.

Definition at line 344 of file sestilio.cpp.

◆ SE_ReadPort()

int SE_ReadPort ( int  portAddress,
int  usbDevice 
)

Allow to read of the selected port.

Parameters
portAddressPort selection. 0 = P4, 1 = P5, 2 = PA, 3 = PB, 4 = Opto-Coupled input, 5 = Opto-Power. Port Identification Number
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_SetPortDirection, SE_WritePort, SE_SetPortBit, SE_ClrPortBit, SE_PortPulse.
#include "sest.h"
if(SE_Open('0', 0) == SE_S_SUCCESS)
{
int ps; // Port status
//
if(ps & 1) // Check if bit 1 of the Opto-Isolated port is 1
// Your code ...
}
Returns
The port contents.

Definition at line 395 of file sestilio.cpp.

◆ SE_SetPortBit()

int SE_SetPortBit ( int  portAddress,
int  bit,
int  usbDevice 
)

Allow to set a bit on the selected port.

Parameters
portAddressPort selection. 0 = P4, 1 = P5, 2 = PA, 3 = PB, 4 = Opto-Coupled output. Port Identification Number
bitBit to set 0-7.
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_SetPortDirection, SE_WritePort, SE_ClrPortBit, SE_ReadPort, SE_PortPulse.
Returns
Operation status. Operation Status

Definition at line 373 of file sestilio.cpp.

◆ SE_SetPortDirection()

int SE_SetPortDirection ( int  port,
int  bit7,
int  bit6,
int  bit5,
int  bit4,
int  bit3,
int  bit2,
int  bit1,
int  bit0,
int  usbDevice 
)

Allow to set direction (Input or Output) of the selected port.

Parameters
portPort selection. 0 = P4, 1 = P5, 2 = PA, 3 = PB. Port Identification Number
bit70 = Input, 1 = Output. Port Direction Controls
bit60 = Input, 1 = Output. Port Direction Controls
bit50 = Input, 1 = Output. Port Direction Controls
bit40 = Input, 1 = Output. Port Direction Controls
bit30 = Input, 1 = Output. Port Direction Controls
bit20 = Input, 1 = Output. Port Direction Controls
bit10 = Input, 1 = Output. Port Direction Controls
bit00 = Input, 1 = Output. Port Direction Controls
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_WritePort, SE_SetPortBit, SE_ClrPortBit, SE_ReadPort, SE_PortPulse.
Returns
Operation status. Operation Status

Definition at line 351 of file sestilio.cpp.

◆ SE_WriteKPortConfig()

int SE_WriteKPortConfig ( int  regAdd,
int  regValue,
int  usbDevice 
)

Allow to write a register of the Port Expander (MCP23S17) used for PORT A and B.

Parameters
regAddRegister address.
regValueValue to load in the register.
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_ReadKPortConfig.
Returns
Operation status. Operation Status

Definition at line 337 of file sestilio.cpp.

◆ SE_WritePort()

int SE_WritePort ( int  portAddress,
int  portValue,
int  usbDevice 
)

Allow to write on the selected port.

Parameters
portAddressPort selection. 0 = P4, 1 = P5, 2 = PA, 3 = PB, 4 = Opto-Coupled output, 5 = Opto-Coupled power output. Port Identification Number
portValueValue to write on the selected port.
usbDeviceSpecify a SESTILIO USB identifier.
See also
SE_SetPortDirection, SE_SetPortBit, SE_ClrPortBit, SE_ReadPort, SE_PortPulse.
#include "sest.h"
if(SE_Open('0', 0) == SE_S_SUCCESS)
{
// Turn ON output 1 and 8 on Opto-Isolated port (Y9)
}
#include "sest.h"
if(SE_Open('0', 0) == SE_S_SUCCESS)
{
// Turn ON output 1 and 4 on Opto-Power-Isolated port (Y14)
}
Returns
Operation status. Operation Status

Definition at line 366 of file sestilio.cpp.