39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define RELAY5_REG_INPUT 0x00
74#define RELAY5_REG_OUTPUT 0x01
75#define RELAY5_REG_POLARITY 0x02
76#define RELAY5_REG_CONFIG 0x03
94#define RELAY5_DEFAULT_CONFIG 0xF8
100#define RELAY5_PIN_RL3 0x01
101#define RELAY5_PIN_RL2 0x02
102#define RELAY5_PIN_RL1 0x04
108#define RELAY5_PIN_STATE_LOW 0
109#define RELAY5_PIN_STATE_HIGH 1
116#define RELAY5_DEVICE_ADDRESS_A1A0_00 0x70
117#define RELAY5_DEVICE_ADDRESS_A1A0_01 0x71
118#define RELAY5_DEVICE_ADDRESS_A1A0_10 0x72
119#define RELAY5_DEVICE_ADDRESS_A1A0_11 0x73
137#define RELAY5_MAP_MIKROBUS( cfg, mikrobus ) \
138 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
139 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
140 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST );
err_t relay5_default_cfg(relay5_t *ctx)
Relay 5 default configuration function.
err_t relay5_switch_relay3(relay5_t *ctx)
Relay 5 switch relay 3 function.
err_t relay5_set_relay3_close(relay5_t *ctx)
Relay 5 set relay 3 close function.
err_t relay5_set_relay1_close(relay5_t *ctx)
Relay 5 set relay 1 close function.
void relay5_reset_device(relay5_t *ctx)
Relay 5 reset device function.
err_t relay5_set_relay2_close(relay5_t *ctx)
Relay 5 set relay 2 close function.
err_t relay5_set_relay2_open(relay5_t *ctx)
Relay 5 set relay 2 open function.
void relay5_set_rst_pin(relay5_t *ctx, uint8_t state)
Relay 5 set rst pin function.
err_t relay5_init(relay5_t *ctx, relay5_cfg_t *cfg)
Relay 5 initialization function.
err_t relay5_write_register(relay5_t *ctx, uint8_t reg, uint8_t data_in)
Relay 5 write register function.
err_t relay5_switch_relay1(relay5_t *ctx)
Relay 5 switch relay 1 function.
void relay5_cfg_setup(relay5_cfg_t *cfg)
Relay 5 configuration object setup function.
err_t relay5_set_relay1_open(relay5_t *ctx)
Relay 5 set relay 1 open function.
err_t relay5_set_relay3_open(relay5_t *ctx)
Relay 5 set relay 3 open function.
err_t relay5_switch_relay2(relay5_t *ctx)
Relay 5 switch relay 2 function.
err_t relay5_read_register(relay5_t *ctx, uint8_t reg, uint8_t *data_out)
Relay 5 read register function.
relay5_return_value_t
Relay 5 Click return value data.
Definition relay5.h:183
@ RELAY5_OK
Definition relay5.h:184
@ RELAY5_ERROR
Definition relay5.h:185
Relay 5 Click configuration object.
Definition relay5.h:167
uint32_t i2c_speed
Definition relay5.h:173
pin_name_t scl
Definition relay5.h:168
pin_name_t sda
Definition relay5.h:169
pin_name_t rst
Definition relay5.h:171
uint8_t i2c_address
Definition relay5.h:174
Relay 5 Click context object.
Definition relay5.h:150
i2c_master_t i2c
Definition relay5.h:155
digital_out_t rst
Definition relay5.h:152
uint8_t slave_address
Definition relay5.h:158