ST / X_NUCLEO_PLC01A1

Dependents:   HelloWorld_PLC01A1

Embed: (wiki syntax)

« Back to documentation index

CLT01_38S Class Reference

Class representing an CLT01_38S component. More...

#include <CLT01_38S.h>

Inherits PLCInput.

Public Member Functions

 CLT01_38S (PinName input_ssel, SPI &spi)
 Constructor.
virtual ~CLT01_38S (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 uint8_t get_read_status (void)
 Set Read Status.
virtual void set_read_status (uint8_t status)
 Set Read Status.
virtual uint8_t get_input_data (void)
 Get Input Status.
virtual uint8_t over_temp_alarm (void)
 Over Temperature Alarm bit.
virtual uint8_t check_parity (void)
 Parity Check bits.
virtual uint8_t under_volt_alarm (void)
 Under Voltage Alarm bit.
virtual void dig_inp_array_get_input (uint8_t *inputArray)
 Get input information from output channels component.
virtual void set_input_spi (uint8_t l)
 Auxiliary method to enable or disable SPI CS pin.

Protected Member Functions

status_t ReadWrite (uint8_t *pBufferToRead, uint8_t *pBufferToWrite, uint16_t NumValues)
 Utility function to read and write data from/to CLT01_38S at the same time.
void CLT01_38S_Delay (uint32_t delay)
 Making the CPU wait.
uint8_t CLT01_38S_SpiReadBytes (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 CLT01_38S component.

Definition at line 71 of file CLT01_38S.h.


Constructor & Destructor Documentation

CLT01_38S ( PinName  input_ssel,
SPI &  spi 
)

Constructor.

Parameters:
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 82 of file CLT01_38S.h.

virtual ~CLT01_38S ( void   ) [virtual]

Destructor.

Definition at line 97 of file CLT01_38S.h.


Member Function Documentation

virtual uint8_t check_parity ( void   ) [virtual]

Parity Check bits.

Parameters:
None
Return values:
Paritybits for diagnosing inconsistency in data transmission

Implements PLCInput.

Definition at line 187 of file CLT01_38S.h.

void CLT01_38S_Delay ( uint32_t  delay ) [protected]

Making the CPU wait.

Parameters:
None.
Return values:
None.

Definition at line 287 of file CLT01_38S.h.

uint8_t CLT01_38S_SpiReadBytes ( 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 298 of file CLT01_38S.h.

virtual void dig_inp_array_get_input ( uint8_t *  inputArray ) [virtual]

Get input information from output channels component.

Parameters:
TXbuffer
RXbuffer
Return values:
None

Implements PLCInput.

Definition at line 208 of file CLT01_38S.h.

virtual uint8_t get_input_data ( void   ) [virtual]

Get Input Status.

Parameters:
None
Return values:
Channelsstatus corresponding to 8 inputs

Implements PLCInput.

Definition at line 167 of file CLT01_38S.h.

virtual uint8_t get_read_status ( void   ) [virtual]

Set Read Status.

Parameters:
None
Return values:
Status

Implements PLCInput.

Definition at line 147 of file CLT01_38S.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 127 of file CLT01_38S.h.

virtual uint8_t over_temp_alarm ( void   ) [virtual]

Over Temperature Alarm bit.

Parameters:
None
Return values:
Overtemperaturebit, 1 in case of alarm

Implements PLCInput.

Definition at line 177 of file CLT01_38S.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 137 of file CLT01_38S.h.

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

Utility function to read and write data from/to CLT01_38S 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 255 of file CLT01_38S.h.

virtual void set_input_spi ( uint8_t  l ) [virtual]

Auxiliary method to enable or disable SPI CS pin.

Parameters:
lflag to enable or disable SPI CS pin

Implements PLCInput.

Definition at line 214 of file CLT01_38S.h.

virtual void set_read_status ( uint8_t  status ) [virtual]

Set Read Status.

Parameters:
Status
Return values:
None

Implements PLCInput.

Definition at line 157 of file CLT01_38S.h.

virtual uint8_t under_volt_alarm ( void   ) [virtual]

Under Voltage Alarm bit.

Parameters:
None
Return values:
Undervoltage alarm bit, 1 in case of alarm

Implements PLCInput.

Definition at line 197 of file CLT01_38S.h.