relay5 2.1.0.0
Relay 5 Click Driver

API for configuring and manipulating Relay 5 Click driver. More...

Topics

 Relay 5 Registers List
 List of registers of Relay 5 Click driver.
 
 Relay 5 Registers Settings
 Settings for registers of Relay 5 Click driver.
 
 Relay 5 MikroBUS Map
 MikroBUS pin mapping of Relay 5 Click driver.
 

Functions

void relay5_cfg_setup (relay5_cfg_t *cfg)
 Relay 5 configuration object setup function.
 
err_t relay5_init (relay5_t *ctx, relay5_cfg_t *cfg)
 Relay 5 initialization function.
 
err_t relay5_default_cfg (relay5_t *ctx)
 Relay 5 default configuration function.
 
err_t relay5_write_register (relay5_t *ctx, uint8_t reg, uint8_t data_in)
 Relay 5 write register function.
 
err_t relay5_read_register (relay5_t *ctx, uint8_t reg, uint8_t *data_out)
 Relay 5 read register function.
 
err_t relay5_set_relay1_open (relay5_t *ctx)
 Relay 5 set relay 1 open function.
 
err_t relay5_set_relay1_close (relay5_t *ctx)
 Relay 5 set relay 1 close function.
 
err_t relay5_switch_relay1 (relay5_t *ctx)
 Relay 5 switch relay 1 function.
 
err_t relay5_set_relay2_open (relay5_t *ctx)
 Relay 5 set relay 2 open function.
 
err_t relay5_set_relay2_close (relay5_t *ctx)
 Relay 5 set relay 2 close function.
 
err_t relay5_switch_relay2 (relay5_t *ctx)
 Relay 5 switch relay 2 function.
 
err_t relay5_set_relay3_open (relay5_t *ctx)
 Relay 5 set relay 3 open function.
 
err_t relay5_set_relay3_close (relay5_t *ctx)
 Relay 5 set relay 3 close function.
 
err_t relay5_switch_relay3 (relay5_t *ctx)
 Relay 5 switch relay 3 function.
 
void relay5_set_rst_pin (relay5_t *ctx, uint8_t state)
 Relay 5 set rst pin function.
 
void relay5_reset_device (relay5_t *ctx)
 Relay 5 reset device function.
 

Detailed Description

API for configuring and manipulating Relay 5 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ relay5_cfg_setup()

void relay5_cfg_setup ( relay5_cfg_t * cfg)

Relay 5 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See relay5_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ relay5_default_cfg()

err_t relay5_default_cfg ( relay5_t * ctx)

Relay 5 default configuration function.

This function executes a default configuration of Relay 5 click board.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ relay5_init()

err_t relay5_init ( relay5_t * ctx,
relay5_cfg_t * cfg )

Relay 5 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See relay5_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See relay5_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ relay5_read_register()

err_t relay5_read_register ( relay5_t * ctx,
uint8_t reg,
uint8_t * data_out )

Relay 5 read register function.

This function reads data from the selected PCA9538A register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ relay5_reset_device()

void relay5_reset_device ( relay5_t * ctx)

Relay 5 reset device function.

This function resets the device by toggling the RST pin.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ relay5_set_relay1_close()

err_t relay5_set_relay1_close ( relay5_t * ctx)

Relay 5 set relay 1 close function.

This function sets the relay 1 to normally close state by setting the RL1 pin to high logic level.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ relay5_set_relay1_open()

err_t relay5_set_relay1_open ( relay5_t * ctx)

Relay 5 set relay 1 open function.

This function sets the relay 1 to normally open state by setting the RL1 pin to low logic level.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ relay5_set_relay2_close()

err_t relay5_set_relay2_close ( relay5_t * ctx)

Relay 5 set relay 2 close function.

This function sets the relay 2 to normally close state by setting the RL2 pin to high logic level.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ relay5_set_relay2_open()

err_t relay5_set_relay2_open ( relay5_t * ctx)

Relay 5 set relay 2 open function.

This function sets the relay 2 to normally open state by setting the RL2 pin to low logic level.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ relay5_set_relay3_close()

err_t relay5_set_relay3_close ( relay5_t * ctx)

Relay 5 set relay 3 close function.

This function sets the relay 3 to normally close state by setting the RL3 pin to high logic level.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ relay5_set_relay3_open()

err_t relay5_set_relay3_open ( relay5_t * ctx)

Relay 5 set relay 3 open function.

This function sets the relay 3 to normally open state by setting the RL3 pin to low logic level.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ relay5_set_rst_pin()

void relay5_set_rst_pin ( relay5_t * ctx,
uint8_t state )

Relay 5 set rst pin function.

This function sets the RST pin logic state.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
[in]state:
  • 0 - Low logic state,
  • 1 - High logic state.
Returns
None.
Note
None.

◆ relay5_switch_relay1()

err_t relay5_switch_relay1 ( relay5_t * ctx)

Relay 5 switch relay 1 function.

This function switches the relay 1 state by toggling the RL1 pin logic level.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ relay5_switch_relay2()

err_t relay5_switch_relay2 ( relay5_t * ctx)

Relay 5 switch relay 2 function.

This function switches the relay 2 state by toggling the RL2 pin logic level.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ relay5_switch_relay3()

err_t relay5_switch_relay3 ( relay5_t * ctx)

Relay 5 switch relay 3 function.

This function switches the relay 3 state by toggling the RL3 pin logic level.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ relay5_write_register()

err_t relay5_write_register ( relay5_t * ctx,
uint8_t reg,
uint8_t data_in )

Relay 5 write register function.

This function writes a desired data byte to the selected PCA9538A register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See relay5_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.