API  2.3.0
TSmarT Software Library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions

Functions

void TSMART_DIO_Init (tsmart_dio_t *TSMART_DIO, tsmart_dio_config_t *TSMART_DIO_config)
 Initialize a Digital Input/Output. More...
 
void TSMART_DIO_Set (tsmart_dio_t *TSMART_DIO)
 Sets the Digital Output. More...
 
void TSMART_DIO_Reset (tsmart_dio_t *TSMART_DIO)
 Resets the Digital Output. More...
 
void TSMART_DIO_Toggle (tsmart_dio_t *TSMART_DIO)
 Toggles the value of Digital Input/Output. More...
 
int8_t TSMART_DIO_Read (tsmart_dio_t *TSMART_DIO)
 Reads the Digital Input/Output. More...
 
int8_t TSMART_DIO_Wfi (tsmart_dio_t *TSMART_DIO, portTickType TSMART_DIO_xticks)
 Wait for the interrupt of the Digital Input. More...
 
int8_t TSMART_DIO_GroupInit (tsmart_dio_group_t *TSMART_DIO_group)
 Initialize an Digital Inputs/Outputs group for interruption. More...
 
int8_t TSMART_DIO_Group (tsmart_dio_t *TSMART_DIO, tsmart_dio_group_t *TSMART_DIO_group)
 Associate a Digital Input to a selected group. More...
 
int8_t TSMART_DIO_Wfgi (tsmart_dio_group_t *TSMART_DIO_group, portTickType TSMART_DIO_xticks)
 Wait for one interrupt of Digital Inputs/Outputs group. More...
 

Detailed Description

Function Documentation

int8_t TSMART_DIO_Group ( tsmart_dio_t TSMART_DIO,
tsmart_dio_group_t TSMART_DIO_group 
)

Associate a Digital Input to a selected group.

Associates a selected Digital I/O to an already initialized group in order to share OS resources and group event notifications.

Parameters
TSMART_DIODigital I/O structure handler.
TSMART_DIO_groupGroup structure handler.
Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Failure
Examples:
db_dio.c.
int8_t TSMART_DIO_GroupInit ( tsmart_dio_group_t TSMART_DIO_group)

Initialize an Digital Inputs/Outputs group for interruption.

In order to have a single associated interrupt for a group of Digital Inputs, this functions initializes the configuration of the associated OS mechanisms.

Parameters
TSMART_DIO_groupDigital I/O group
Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Failure
Note
The incompatibilities in TSgaTe_v2 are:
  • DIO_5 –> WiFi or Ethernet
  • DIO_6 –> WiFi or Ethernet
  • DIO_7 –> WiFi or Ethernet
The incompatibilities when used as interrupt are:
  • If you are using TSmoTe or TSgaTe_v2 board
    • DIO_0a DIO_6x –> xBee with ON_Sleep Interrupt Enable
    • DIO_1a DIO_7x
    • DIO_2a DIO_1 DIO_5x
    • DIO_3a DIO_0 DIO_3x –> NFC with I2c
    • DIO_2 DIO_13 DIO_2x
    • DIO_3 DIO_1x
    • DIO_4 DIO_4x
    • DIO_4 DIO_4x
    • DIO_8 DIO_14
    • DIO_9 DIO_11
    • DIO_10 DIO_12
Examples:
db_dio.c.
void TSMART_DIO_Init ( tsmart_dio_t TSMART_DIO,
tsmart_dio_config_t TSMART_DIO_config 
)

Initialize a Digital Input/Output.

This functions initializes the hardware configuration of the selected I/O and the associated OS mechanisms.

Parameters
TSMART_DIODigital I/O structure handler.
TSMART_DIO_configIndicates the mode of operation and the associated interruption configuration.
Note
The incompatibilities in TSgaTe_v2 are:
  • DIO_5 –> WiFi or Ethernet
  • DIO_6 –> WiFi or Ethernet
  • DIO_7 –> WiFi or Ethernet
The incompatibilities when used as interrupt are:
  • If you are using TSmoTe or TSgaTe_v2 board
    • DIO_0a DIO_6x –> xBee with ON_Sleep Interrupt Enable
    • DIO_1a DIO_7x
    • DIO_2a DIO_1 DIO_5x
    • DIO_3a DIO_0 DIO_3x –> NFC with I2c
    • DIO_2 DIO_13 DIO_2x
    • DIO_3 DIO_1x
    • DIO_4 DIO_4x
    • DIO_8 DIO_14
    • DIO_9 DIO_11
    • DIO_10 DIO_12
Examples:
db_dio.c, dio_read.c, freertos_advance.c, freertos_basic.c, modbus_slave_rtu.c, nfc_read.c, pwr.c, rtc.c, and sg01c.c.
int8_t TSMART_DIO_Read ( tsmart_dio_t TSMART_DIO)

Reads the Digital Input/Output.

Reads the Digital I/O value.

Parameters
TSMART_DIODigital I/O structure handler.
Returns
  • 0 or 1 (Logic Value)
  • TSMART_FAIL - Failure
Examples:
db_dio.c, dio_read.c, modbus_slave_rtu.c, and sg01c.c.
void TSMART_DIO_Reset ( tsmart_dio_t TSMART_DIO)

Resets the Digital Output.

Resets (0) the Digital I/O.

Parameters
TSMART_DIODigital I/O structure handler.
Examples:
db_dio.c, dio_read.c, freertos_advance.c, modbus_slave_rtu.c, nfc_read.c, and sg01c.c.
void TSMART_DIO_Set ( tsmart_dio_t TSMART_DIO)

Sets the Digital Output.

Sets (1) the Digital I/O.

Parameters
TSMART_DIODigital I/O structure handler.
Examples:
db_dio.c, dio_read.c, freertos_advance.c, modbus_slave_rtu.c, nfc_read.c, rtc.c, and sg01c.c.
void TSMART_DIO_Toggle ( tsmart_dio_t TSMART_DIO)

Toggles the value of Digital Input/Output.

Toggles the Digital I/O whatever its current state is (1->0 or 0->1)

Parameters
TSMART_DIODigital I/O structure handler.
Examples:
db_dio.c, freertos_advance.c, freertos_basic.c, and pwr.c.
int8_t TSMART_DIO_Wfgi ( tsmart_dio_group_t TSMART_DIO_group,
portTickType  TSMART_DIO_xticks 
)

Wait for one interrupt of Digital Inputs/Outputs group.

Wait for the interrupt associated to a Digital Input group. Whenever one of the group inputs meets the configured working method, a handler will be triggered and a semaphore will be set, releasing the current function.

The function will also be released after a timeout of TSMART_DIO_xticks returning a TSMART_FAIL.

Parameters
TSMART_DIO_groupGroup structure handler.
TSMART_DIO_xticksMaximum timeout to wait for interrupt.
Returns
  • exti_num Number of associated Digital Input interrupt that has been triggered
  • TSMART_FAIL - Maximum timeout expired
Note
The incompatibilities when used WiFi or Ethernet in TSgaTe_v2 are:
  • DIO_5 –> WiFi or Ethernet
  • DIO_6 –> WiFi or Ethernet
  • DIO_7 –> WiFi or Ethernet
The incompatibilities when used as interrupt are:
  • If you are using TSmoTe or TSgaTe_v2 board
    • DIO_0a DIO_6x –> xBee with ON_Sleep Interrupt Enable
    • DIO_1a DIO_7x
    • DIO_2a DIO_1 DIO_5x
    • DIO_3a DIO_0 DIO_3x –> NFC with I2c
    • DIO_2 DIO_13 DIO_2x
    • DIO_3 DIO_1x
    • DIO_4 DIO_4x
    • DIO_4 DIO_4x
    • DIO_8 DIO_14
    • DIO_9 DIO_11
    • DIO_10 DIO_12
Examples:
db_dio.c.
int8_t TSMART_DIO_Wfi ( tsmart_dio_t TSMART_DIO,
portTickType  TSMART_DIO_xticks 
)

Wait for the interrupt of the Digital Input.

Wait for the interrupt associated to a Digital Input. Whenever the input meets the configured working method, a handler will be triggered and a semaphore will be set, releasing the current function.

The function will also be released after a timeout of TSMART_DIO_xticks returning a TSMART_FAIL.

Parameters
TSMART_DIODigital I/O structure handler.
TSMART_DIO_xticksMaximum timeout to wait for interrupt.
Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Maximum timeout expired
Note
The incompatibilities in TSgaTe_v2 are:
  • DIO_5 –> WiFi or Ethernet
  • DIO_6 –> WiFi or Ethernet
  • DIO_7 –> WiFi or Ethernet
The incompatibilities when used as interrupt are:
  • If you are using TSmoTe or TSgaTe_v2 board
    • DIO_0a DIO_6x –> xBee with ON_Sleep Interrupt Enable
    • DIO_1a DIO_7x
    • DIO_2a DIO_1 DIO_5x
    • DIO_3a DIO_0 DIO_3x –> NFC with I2c
    • DIO_2 DIO_13 DIO_2x
    • DIO_3 DIO_1x
    • DIO_4 DIO_4x
    • DIO_8 DIO_14
    • DIO_9 DIO_11
    • DIO_10 DIO_12
Examples:
db_dio.c, and freertos_advance.c.