- Main
- Tutorials
- Library
- Samples

Modules | Functions
DI
Library

## Modules
| DI_MODE
| CNT_TRIGGER

## Functions
IOTHINX_ERR | ioThinx_DI_GetValues (uint32_t slot, uint32_t *p_values)
IOTHINX_ERR | ioThinx_DI_GetCntValues (uint32_t slot, uint8_t start, uint8_t count, uint32_t buf[])
IOTHINX_ERR | ioThinx_DI_SetCntValues (uint32_t slot, uint8_t start, uint8_t count, uint32_t buf[])
IOTHINX_ERR | ioThinx_DI_GetCntStarts (uint32_t slot, uint32_t *p_starts)
IOTHINX_ERR | ioThinx_DI_SetCntStarts (uint32_t slot, uint32_t starts)
IOTHINX_ERR | ioThinx_DI_SetCntStops (uint32_t slot, uint32_t stops)
IOTHINX_ERR | ioThinx_DI_GetCntOverflows (uint32_t slot, uint32_t *p_overflows)
IOTHINX_ERR | ioThinx_DI_SetCntOverflows (uint32_t slot, uint32_t overflows)
IOTHINX_ERR | ioThinx_DI_Config_GetModes (uint32_t slot, uint8_t start, uint8_t count, uint8_t buf[])
IOTHINX_ERR | ioThinx_DI_Config_SetModes (uint32_t slot, uint8_t start, uint8_t count, uint8_t buf[])
IOTHINX_ERR | ioThinx_DI_Config_GetFilters (uint32_t slot, uint8_t start, uint8_t count, uint16_t buf[])
IOTHINX_ERR | ioThinx_DI_Config_SetFilters (uint32_t slot, uint8_t start, uint8_t count, uint16_t buf[])
IOTHINX_ERR | ioThinx_DI_Config_GetCntTriggers (uint32_t slot, uint8_t start, uint8_t count, uint8_t buf[])
IOTHINX_ERR | ioThinx_DI_Config_SetCntTriggers (uint32_t slot, uint8_t start, uint8_t count, uint8_t buf[])
IOTHINX_ERR | ioThinx_DI_Config_GetCntValues (uint32_t slot, uint8_t start, uint8_t count, uint32_t buf[])
IOTHINX_ERR | ioThinx_DI_Config_SetCntValues (uint32_t slot, uint8_t start, uint8_t count, uint32_t buf[])

## Detailed Description

Sample Code:
di.c
counter.c

## Function Documentation

IOTHINX_ERR ioThinx_DI_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 DI values of the contiguous channels; each bit holds one channel's value. The bit 0 represents digital input 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_DI_GetCntValues | ( | 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 counter values 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_DI_SetCntValues | ( | 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.
  [in] | buf | An array that stores the counter values 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_DI_GetCntStarts | ( | uint32_t | slot,
|  | uint32_t * | p_starts
| ) |  |

Parameters

  [in] | slot | Slot number of the I/O module.
  [out] | p_starts | A pointer that stores counter start flags of the contiguous channels (0: stop, 1: start); 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.

IOTHINX_ERR ioThinx_DI_SetCntStarts | ( | uint32_t | slot,
|  | uint32_t | starts
| ) |  |

Parameters

  [in] | slot | Slot number of the I/O module.
  [in] | starts | Stores counter start flags of the contiguous channels (0: ignore, 1: start); 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.

IOTHINX_ERR ioThinx_DI_SetCntStops | ( | uint32_t | slot,
|  | uint32_t | stops
| ) |  |

Parameters

  [in] | slot | Slot number of the I/O module.
  [in] | stops | Stores counter stop flags of the contiguous channels (0: ignore, 1: stop); 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.

IOTHINX_ERR ioThinx_DI_GetCntOverflows | ( | uint32_t | slot,
|  | uint32_t * | p_overflows
| ) |  |

Parameters

  [in] | slot | Slot number of the I/O module.
  [out] | p_overflows | A pointer that stores counter overflow flags of the contiguous channels (0: normal, 1: overflow); 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.

IOTHINX_ERR ioThinx_DI_SetCntOverflows | ( | uint32_t | slot,
|  | uint32_t | overflows
| ) |  |

Parameters

  [in] | slot | Slot number of the I/O module.
  [in] | overflows | Stores counter overflow flags of the contiguous channels (0: normal, 1: overflow); 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.

IOTHINX_ERR ioThinx_DI_Config_GetModes | ( | uint32_t | slot,
|  | uint8_t | start,
|  | uint8_t | count,
|  | uint8_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 DI modes of 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_DI_Config_SetModes | ( | uint32_t | slot,
|  | uint8_t | start,
|  | uint8_t | count,
|  | uint8_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.
  [in] | buf | An array that stores DI modes of 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_DI_Config_GetFilters | ( | uint32_t | slot,
|  | uint8_t | start,
|  | uint8_t | count,
|  | uint16_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 filter values for the contiguous channels. buf[0] represents the value of the start channel. 45MR-16xx: one unit = 500us.

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

IOTHINX_ERR ioThinx_DI_Config_SetFilters | ( | uint32_t | slot,
|  | uint8_t | start,
|  | uint8_t | count,
|  | uint16_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.
  [in] | buf | An array that stores the filter values for the contiguous channels. buf[0] represents the value of the start channel. 45MR-16xx: one unit = 500us.

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

IOTHINX_ERR ioThinx_DI_Config_GetCntTriggers | ( | uint32_t | slot,
|  | uint8_t | start,
|  | uint8_t | count,
|  | uint8_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 counter triggers of 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_DI_Config_SetCntTriggers | ( | uint32_t | slot,
|  | uint8_t | start,
|  | uint8_t | count,
|  | uint8_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.
  [in] | buf | An array that stores counter triggers of 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_DI_Config_GetCntValues | ( | 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 counter values in config 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_DI_Config_SetCntValues | ( | 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.
  [in] | buf | An array that stores the counter values in config 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.