- Main
- Tutorials
- Library
- Samples

Functions
Relay
Library

## Functions
IOTHINX_ERR | ioThinx_Relay_GetValues (uint32_t slot, uint32_t *p_values)
IOTHINX_ERR | ioThinx_Relay_SetValues (uint32_t slot, uint32_t values)
IOTHINX_ERR | ioThinx_Relay_GetTotalCounts (uint32_t slot, uint8_t start, uint8_t count, uint32_t buf[])
IOTHINX_ERR | ioThinx_Relay_GetCurrentCounts (uint32_t slot, uint8_t start, uint8_t count, uint32_t buf[])
IOTHINX_ERR | ioThinx_Relay_ResetCurrentCounts (uint32_t slot, uint32_t resets)

## Detailed Description

Sample Code:
relay.c

## Function Documentation

IOTHINX_ERR ioThinx_Relay_GetValues | ( | uint32_t | slot,
|  | uint32_t * | p_values
| ) |  |

Parameters

  [in] | slot | Slot number of the I/O module.
  [out] | p_values | A pointer that stores Relay values of the contiguous channels; each bit holds one channel's value. The bit 0 represents relay status of the channel 0 and so on.

Returns
  IOTHINX_ERR_OK if everything is ok. Otherwise, refer to the IOTHINX_ERR.

IOTHINX_ERR ioThinx_Relay_SetValues | ( | uint32_t | slot,
|  | uint32_t | values
| ) |  |

Parameters

  [in] | slot | Slot number of the I/O module.
  [in] | values | Relay values of the contiguous channels; each bit holds one channel's value. The bit 0 represents relay status of the channel 0 and so on.

Returns
  IOTHINX_ERR_OK if everything is ok. Otherwise, refer to the IOTHINX_ERR.

IOTHINX_ERR ioThinx_Relay_GetTotalCounts | ( | uint32_t | slot,
|  | uint8_t | start,
|  | uint8_t | count,
|  | uint32_t | buf[]
| ) |  |

Parameters

  [in] | slot | Slot number of the I/O module.
  [in] | start | Specifies the start channel.
  [in] | count | The number of channels to be get.
  [out] | buf | An array that stores the relay total count for the contiguous channels. buf[0] represents the value of the start channel.

Returns
  IOTHINX_ERR_OK if everything is ok. Otherwise, refer to the IOTHINX_ERR.

IOTHINX_ERR ioThinx_Relay_GetCurrentCounts | ( | uint32_t | slot,
|  | uint8_t | start,
|  | uint8_t | count,
|  | uint32_t | buf[]
| ) |  |

Parameters

  [in] | slot | Slot number of the I/O module.
  [in] | start | Specifies the start channel.
  [in] | count | The number of channels to be get.
  [out] | buf | An array that stores the relay current count for the contiguous channels. buf[0] represents the value of the start channel.

Returns
  IOTHINX_ERR_OK if everything is ok. Otherwise, refer to the IOTHINX_ERR.

IOTHINX_ERR ioThinx_Relay_ResetCurrentCounts | ( | uint32_t | slot,
|  | uint32_t | resets
| ) |  |

Parameters

  [in] | slot | Slot number of the I/O module.
  [in] | resets | Stores the current count reset flags of the contiguous channels (0: ignore, 1: reset); each bit holds one channel's flag. The bit 0 represents value of the channel 0 and so on.

Returns
  IOTHINX_ERR_OK if everything is ok. Otherwise, refer to the IOTHINX_ERR.