Developer Docs v3

Classes

struct  pixtIn
 
struct  pixtOut
 
struct  pixtOutDAC
 

Macros

#define ARRAY_SIZE(x)   (sizeof((x)) / sizeof((x)[0]))
 
#define bitClear(value, bit)   ((value) &= ~(1UL << (bit)))
 
#define bitRead(value, bit)   (((value) >> (bit)) & 0x01)
 
#define bitSet(value, bit)   ((value) |= (1UL << (bit)))
 
#define bitWrite(value, bit, bitvalue)   (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
 
#define MAX_ANALOG_IN   4
 
#define MAX_ANALOG_OUT   4
 
#define MAX_DIG_IN   8
 
#define MAX_DIG_OUT   10
 

Functions

int Change_Gpio_Mode (char pin, char mode)
 
int Change_Serial_Mode (uint8_t mode)
 
uint16_t crc16_calc (uint16_t crc, uint8_t data)
 
void finalizeHardware ()
 Resource clearing. More...
 
void initializeHardware ()
 Initialization procedures. More...
 
void sleep_ms (int milliseconds)
 
int Spi_AutoMode (struct pixtOut *OutputData, struct pixtIn *InputData)
 
int Spi_AutoModeDAC (struct pixtOutDAC *OutputDataDAC)
 
uint16_t Spi_Get_Ain (int Idx)
 
int Spi_Get_Din ()
 
uint8_t Spi_Get_Dout ()
 
int Spi_Get_Gpio ()
 
uint16_t Spi_Get_Hum (int Idx)
 
uint8_t Spi_Get_Relays ()
 
uint16_t Spi_Get_Temp (int Idx)
 
int Spi_Get_uC_Status ()
 
uint16_t Spi_Get_uC_Version ()
 
int Spi_Set_AiControl (int value0, int value1)
 
int Spi_Set_Aout (int channel, uint16_t value)
 
int Spi_Set_Dout (int value)
 
int Spi_Set_Gpio (int value)
 
int Spi_Set_GpioControl (int value)
 
int Spi_Set_Pwm (int channel, uint16_t value)
 
int Spi_Set_PwmControl (int value0, int value1, int value2)
 
int Spi_Set_RaspStat (int value)
 
int Spi_Set_Relays (int value)
 
int Spi_Set_Servo (int channel, int value)
 
int Spi_Set_UcControl (int value)
 
int Spi_Setup (int spi_device)
 
int Spi_uC_Reset ()
 
void updateBuffersIn ()
 Update internal buffers. More...
 
void updateBuffersOut ()
 Update output buffers. More...
 
void * updateLocalBuffers (void *args)
 

Variables

struct pixtIn InputData
 
std::mutex localBufferLock
 
struct pixtOut OutputData
 
struct pixtOutDAC OutputDataDAC
 

Detailed Description

Macro Definition Documentation

◆ ARRAY_SIZE

#define ARRAY_SIZE (   x)    (sizeof((x)) / sizeof((x)[0]))

Definition at line 48 of file pixtend.cpp.

◆ bitClear

#define bitClear (   value,
  bit 
)    ((value) &= ~(1UL << (bit)))

Definition at line 58 of file pixtend.cpp.

◆ bitRead

#define bitRead (   value,
  bit 
)    (((value) >> (bit)) & 0x01)

Definition at line 56 of file pixtend.cpp.

◆ bitSet

#define bitSet (   value,
  bit 
)    ((value) |= (1UL << (bit)))

Definition at line 57 of file pixtend.cpp.

◆ bitWrite

#define bitWrite (   value,
  bit,
  bitvalue 
)    (bitvalue ? bitSet(value, bit) : bitClear(value, bit))

Definition at line 59 of file pixtend.cpp.

◆ MAX_ANALOG_IN

#define MAX_ANALOG_IN   4

Definition at line 53 of file pixtend.cpp.

◆ MAX_ANALOG_OUT

#define MAX_ANALOG_OUT   4

Definition at line 54 of file pixtend.cpp.

◆ MAX_DIG_IN

#define MAX_DIG_IN   8

Definition at line 51 of file pixtend.cpp.

◆ MAX_DIG_OUT

#define MAX_DIG_OUT   10

Definition at line 52 of file pixtend.cpp.

Function Documentation

◆ Change_Gpio_Mode()

int Change_Gpio_Mode ( char  pin,
char  mode 
)

Definition at line 715 of file pixtend.cpp.

◆ Change_Serial_Mode()

int Change_Serial_Mode ( uint8_t  mode)

Definition at line 730 of file pixtend.cpp.

◆ crc16_calc()

uint16_t crc16_calc ( uint16_t  crc,
uint8_t  data 
)

Definition at line 160 of file pixtend.cpp.

◆ finalizeHardware()

void finalizeHardware ( )

Resource clearing.

This function is called by the main OpenPLC routine when it is finalizing. Resource clearing procedures should be here.

Definition at line 831 of file pixtend.cpp.

◆ initializeHardware()

void initializeHardware ( )

Initialization procedures.

This function is called by the main OpenPLC routine when it is initializing. Hardware initialization procedures should be here.

Definition at line 818 of file pixtend.cpp.

◆ sleep_ms()

void sleep_ms ( int  milliseconds)

Definition at line 65 of file pixtend.cpp.

◆ Spi_AutoMode()

int Spi_AutoMode ( struct pixtOut OutputData,
struct pixtIn InputData 
)

Definition at line 186 of file pixtend.cpp.

◆ Spi_AutoModeDAC()

int Spi_AutoModeDAC ( struct pixtOutDAC OutputDataDAC)

Definition at line 178 of file pixtend.cpp.

◆ Spi_Get_Ain()

uint16_t Spi_Get_Ain ( int  Idx)

Definition at line 336 of file pixtend.cpp.

◆ Spi_Get_Din()

int Spi_Get_Din ( )

Definition at line 319 of file pixtend.cpp.

◆ Spi_Get_Dout()

uint8_t Spi_Get_Dout ( )

Definition at line 302 of file pixtend.cpp.

◆ Spi_Get_Gpio()

int Spi_Get_Gpio ( )

Definition at line 764 of file pixtend.cpp.

◆ Spi_Get_Hum()

uint16_t Spi_Get_Hum ( int  Idx)

Definition at line 474 of file pixtend.cpp.

◆ Spi_Get_Relays()

uint8_t Spi_Get_Relays ( )

Definition at line 420 of file pixtend.cpp.

◆ Spi_Get_Temp()

uint16_t Spi_Get_Temp ( int  Idx)

Definition at line 437 of file pixtend.cpp.

◆ Spi_Get_uC_Status()

int Spi_Get_uC_Status ( )

Definition at line 673 of file pixtend.cpp.

◆ Spi_Get_uC_Version()

uint16_t Spi_Get_uC_Version ( )

Definition at line 690 of file pixtend.cpp.

◆ Spi_Set_AiControl()

int Spi_Set_AiControl ( int  value0,
int  value1 
)

Definition at line 609 of file pixtend.cpp.

◆ Spi_Set_Aout()

int Spi_Set_Aout ( int  channel,
uint16_t  value 
)

Definition at line 373 of file pixtend.cpp.

◆ Spi_Set_Dout()

int Spi_Set_Dout ( int  value)

Definition at line 286 of file pixtend.cpp.

◆ Spi_Set_Gpio()

int Spi_Set_Gpio ( int  value)

Definition at line 748 of file pixtend.cpp.

◆ Spi_Set_GpioControl()

int Spi_Set_GpioControl ( int  value)

Definition at line 577 of file pixtend.cpp.

◆ Spi_Set_Pwm()

int Spi_Set_Pwm ( int  channel,
uint16_t  value 
)

Definition at line 535 of file pixtend.cpp.

◆ Spi_Set_PwmControl()

int Spi_Set_PwmControl ( int  value0,
int  value1,
int  value2 
)

Definition at line 560 of file pixtend.cpp.

◆ Spi_Set_RaspStat()

int Spi_Set_RaspStat ( int  value)

Definition at line 626 of file pixtend.cpp.

◆ Spi_Set_Relays()

int Spi_Set_Relays ( int  value)

Definition at line 404 of file pixtend.cpp.

◆ Spi_Set_Servo()

int Spi_Set_Servo ( int  channel,
int  value 
)

Definition at line 511 of file pixtend.cpp.

◆ Spi_Set_UcControl()

int Spi_Set_UcControl ( int  value)

Definition at line 593 of file pixtend.cpp.

◆ Spi_Setup()

int Spi_Setup ( int  spi_device)

Definition at line 642 of file pixtend.cpp.

◆ Spi_uC_Reset()

int Spi_uC_Reset ( )

Definition at line 660 of file pixtend.cpp.

◆ updateBuffersIn()

void updateBuffersIn ( )

Update internal buffers.

This function is called by the OpenPLC in a loop. Here the internal buffers must be updated to reflect the actual Input state. The mutex bufferLock must be used to protect access to the buffers on a threaded environment.

Definition at line 840 of file pixtend.cpp.

◆ updateBuffersOut()

void updateBuffersOut ( )

Update output buffers.

This function is called by the OpenPLC in a loop. Here the internal buffers must be updated to reflect the actual Output state. The mutex bufferLock must be used to protect access to the buffers on a threaded environment.

Definition at line 868 of file pixtend.cpp.

◆ updateLocalBuffers()

void* updateLocalBuffers ( void *  args)

Definition at line 786 of file pixtend.cpp.

Variable Documentation

◆ InputData

struct pixtIn InputData

Definition at line 782 of file pixtend.cpp.

◆ localBufferLock

std::mutex localBufferLock

Definition at line 781 of file pixtend.cpp.

◆ OutputData

struct pixtOut OutputData

Definition at line 783 of file pixtend.cpp.

◆ OutputDataDAC

struct pixtOutDAC OutputDataDAC

Definition at line 784 of file pixtend.cpp.