Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: HelloWorld_PLC01A1
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:
-
ssel pin name of the SSEL pin of the SPI device to be used for communication. spi SPI 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:
-
Parity bits 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] pByteToTransmit pointer to the buffer of data to send. [out] pReceivedByte pointer to the buffer to read data into.
- Return values:
-
0 in 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:
-
TX buffer RX buffer
- 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:
-
Channels status 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:
-
init Pointer to device specific initalization structure.
- Return values:
-
0 in 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:
-
Overtemperature bit, 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:
-
id Pointer to an allocated variable to store the ID into.
- Return values:
-
0 in 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] pBufferToRead pointer to the buffer to read data into. [in] pBufferToWrite pointer to the buffer of data to send. [in] NumValues number of values to read and write.
- Return values:
-
COMPONENT_OK in 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:
-
l flag 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:
-
Under voltage alarm bit, 1 in case of alarm
Implements PLCInput.
Definition at line 197 of file CLT01_38S.h.
Generated on Fri Jul 15 2022 00:11:30 by
