ST / X_NUCLEO_PLC01A1

Dependents:   HelloWorld_PLC01A1

Embed: (wiki syntax)

« Back to documentation index

VNI8200XP Class Reference

Class representing an VNI8200XP component. More...

#include <VNI8200XP.h>

Inherits PLCOutput.

Public Member Functions

 VNI8200XP (PinName output_en, PinName output_ssel, SPI &spi)
 Constructor.
virtual ~VNI8200XP (void)
 Destructor.
virtual int init (void *init=NULL)
 Initializing the component in 1/16 Microstepping mode.
virtual int read_id (uint8_t *id=NULL)
 Getting the ID of the component.
virtual void set_channels (uint8_t Out_array)
 Set output channels state.
virtual uint8_t manage_fault (void)
 Get output fault status.
virtual uint8_t check_dcdc_status (void)
 Get DC-DC status of the output channels component.
virtual uint8_t temperature_warning (void)
 Get temperature warning status.
virtual uint8_t check_parity (void)
 Get parity check status.
virtual uint8_t check_power_good (void)
 Get power supply status.
virtual uint8_t check_comm_error (void)
 Get parity bits for input data.
virtual void ssrelay_set_output (uint8_t *outputArray)
 Set output for output channels component.

Protected Member Functions

status_t ReadWrite (uint8_t *pBufferToRead, uint8_t *pBufferToWrite, uint16_t NumValues)
 Utility function to read and write data from/to VNI8200XP at the same time.
void VNI8200XP_Delay (uint32_t delay)
 Making the CPU wait.
uint8_t VNI8200XP_SpiWriteBytes (uint8_t *pByteToTransmit, uint8_t *pReceivedByte)
 Writing and reading bytes to/from the component through the SPI at the same time.

Detailed Description

Class representing an VNI8200XP component.

Definition at line 71 of file VNI8200XP.h.


Constructor & Destructor Documentation

VNI8200XP ( PinName  output_en,
PinName  output_ssel,
SPI &  spi 
)

Constructor.

Parameters:
out_enpin name of the OUTPUT ENABLE pin used for communication.
sselpin name of the SSEL pin of the SPI device to be used for communication.
spiSPI device to be used for communication.

Definition at line 83 of file VNI8200XP.h.

virtual ~VNI8200XP ( void   ) [virtual]

Destructor.

Definition at line 98 of file VNI8200XP.h.


Member Function Documentation

virtual uint8_t check_comm_error ( void   ) [virtual]

Get parity bits for input data.

Parameters:
None
Return values:
Paritybits

Implements PLCOutput.

Definition at line 208 of file VNI8200XP.h.

virtual uint8_t check_dcdc_status ( void   ) [virtual]

Get DC-DC status of the output channels component.

Parameters:
None
Return values:
Feedbackstatus, 1 if OK else 0

Implements PLCOutput.

Definition at line 168 of file VNI8200XP.h.

virtual uint8_t check_parity ( void   ) [virtual]

Get parity check status.

Parameters:
None
Return values:
Paritycheck flag

Implements PLCOutput.

Definition at line 188 of file VNI8200XP.h.

virtual uint8_t check_power_good ( void   ) [virtual]

Get power supply status.

Parameters:
None
Return values:
Powergood bit, 1 in case of power good

Implements PLCOutput.

Definition at line 198 of file VNI8200XP.h.

virtual int init ( void *  init = NULL ) [virtual]

Initializing the component in 1/16 Microstepping mode.

Parameters:
initPointer to device specific initalization structure.
Return values:
0in case of success, an error code otherwise.

Implements Component.

Definition at line 128 of file VNI8200XP.h.

virtual uint8_t manage_fault ( void   ) [virtual]

Get output fault status.

Parameters:
None
Return values:
Outputchannel fault data

Implements PLCOutput.

Definition at line 158 of file VNI8200XP.h.

virtual int read_id ( uint8_t *  id = NULL ) [virtual]

Getting the ID of the component.

Parameters:
idPointer to an allocated variable to store the ID into.
Return values:
0in case of success, an error code otherwise.

Implements Component.

Definition at line 138 of file VNI8200XP.h.

status_t ReadWrite ( uint8_t *  pBufferToRead,
uint8_t *  pBufferToWrite,
uint16_t  NumValues 
) [protected]

Utility function to read and write data from/to VNI8200XP at the same time.

Parameters:
[out]pBufferToReadpointer to the buffer to read data into.
[in]pBufferToWritepointer to the buffer of data to send.
[in]NumValuesnumber of values to read and write.
Return values:
COMPONENT_OKin case of success, COMPONENT_ERROR otherwise.

Definition at line 273 of file VNI8200XP.h.

virtual void set_channels ( uint8_t  Out_array ) [virtual]

Set output channels state.

Parameters:
Outputchannel data
Return values:
None

Implements PLCOutput.

Definition at line 148 of file VNI8200XP.h.

virtual void ssrelay_set_output ( uint8_t *  outputArray ) [virtual]

Set output for output channels component.

Parameters:
TXbuffer
RXbuffer
Return values:
None

Implements PLCOutput.

Definition at line 219 of file VNI8200XP.h.

virtual uint8_t temperature_warning ( void   ) [virtual]

Get temperature warning status.

Parameters:
None
Return values:
Temperaturewarning status, 1 if over temperature

Implements PLCOutput.

Definition at line 178 of file VNI8200XP.h.

void VNI8200XP_Delay ( uint32_t  delay ) [protected]

Making the CPU wait.

Parameters:
None.
Return values:
None.

Definition at line 305 of file VNI8200XP.h.

uint8_t VNI8200XP_SpiWriteBytes ( uint8_t *  pByteToTransmit,
uint8_t *  pReceivedByte 
) [protected]

Writing and reading bytes to/from the component through the SPI at the same time.

Parameters:
[in]pByteToTransmitpointer to the buffer of data to send.
[out]pReceivedBytepointer to the buffer to read data into.
Return values:
0in case of success, "1" otherwise.

Definition at line 316 of file VNI8200XP.h.