relay5 2.1.0.0
relay5.h File Reference

This file contains API for Relay 5 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  relay5_t
 Relay 5 Click context object. More...
 
struct  relay5_cfg_t
 Relay 5 Click configuration object. More...
 

Macros

#define RELAY5_REG_INPUT   0x00
 Relay 5 PCA9538A registers.
 
#define RELAY5_REG_OUTPUT   0x01
 
#define RELAY5_REG_POLARITY   0x02
 
#define RELAY5_REG_CONFIG   0x03
 
#define RELAY5_DEFAULT_CONFIG   0xF8
 Relay 5 PCA9538A pin direction config.
 
#define RELAY5_PIN_RL3   0x01
 Relay 5 PCA9538A pin mask.
 
#define RELAY5_PIN_RL2   0x02
 
#define RELAY5_PIN_RL1   0x04
 
#define RELAY5_PIN_STATE_LOW   0
 Relay 5 pin logic state setting.
 
#define RELAY5_PIN_STATE_HIGH   1
 
#define RELAY5_DEVICE_ADDRESS_A1A0_00   0x70
 Relay 5 device address setting.
 
#define RELAY5_DEVICE_ADDRESS_A1A0_01   0x71
 
#define RELAY5_DEVICE_ADDRESS_A1A0_10   0x72
 
#define RELAY5_DEVICE_ADDRESS_A1A0_11   0x73
 
#define RELAY5_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  relay5_return_value_t { RELAY5_OK = 0 , RELAY5_ERROR = -1 }
 Relay 5 Click return value data. More...
 

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

This file contains API for Relay 5 Click Driver.

Enumeration Type Documentation

◆ relay5_return_value_t

Relay 5 Click return value data.

Predefined enum values for driver return values.

Enumerator
RELAY5_OK 
RELAY5_ERROR