digiisolator2 2.1.0.0
digiisolator2.h File Reference

This file contains API for DIGI Isolator 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  digiisolator2_t
 DIGI Isolator 2 Click context object. More...
 
struct  digiisolator2_cfg_t
 DIGI Isolator 2 Click configuration object. More...
 

Macros

#define DIGIISOLATOR2_REG_INPUT_DATA   0x00
 DIGI Isolator 2 register list.
 
#define DIGIISOLATOR2_REG_WIRE_BREAK   0x01
 
#define DIGIISOLATOR2_REG_FAULT   0x02
 
#define DIGIISOLATOR2_REG_FILTER_CH1_CH2   0x03
 
#define DIGIISOLATOR2_REG_FILTER_CH3_CH4   0x04
 
#define DIGIISOLATOR2_REG_FILTER_CH5_CH6   0x05
 
#define DIGIISOLATOR2_REG_FILTER_CH7_CH8   0x06
 
#define DIGIISOLATOR2_CHANNEL_IN1   0x01
 DIGI Isolator 2 input channel setting.
 
#define DIGIISOLATOR2_CHANNEL_IN2   0x02
 
#define DIGIISOLATOR2_CHANNEL_IN3   0x04
 
#define DIGIISOLATOR2_CHANNEL_IN4   0x08
 
#define DIGIISOLATOR2_CHANNEL_IN5   0x10
 
#define DIGIISOLATOR2_CHANNEL_IN6   0x20
 
#define DIGIISOLATOR2_CHANNEL_IN7   0x40
 
#define DIGIISOLATOR2_CHANNEL_IN8   0x80
 
#define DIGIISOLATOR2_CHANNEL_ALL   0xFF
 
#define DIGIISOLATOR2_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define DIGIISOLATOR2_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define DIGIISOLATOR2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  digiisolator2_drv_t { DIGIISOLATOR2_DRV_SEL_SPI , DIGIISOLATOR2_DRV_SEL_GPIO }
 DIGI Isolator 2 Click driver selector. More...
 
enum  digiisolator2_return_value_t { DIGIISOLATOR2_OK = 0 , DIGIISOLATOR2_ERROR = -1 }
 DIGI Isolator 2 Click return value data. More...
 

Functions

void digiisolator2_cfg_setup (digiisolator2_cfg_t *cfg)
 DIGI Isolator 2 configuration object setup function.
 
void digiisolator2_drv_interface_sel (digiisolator2_cfg_t *cfg, digiisolator2_drv_t drv_sel)
 DIGI Isolator 2 driver interface setup function.
 
err_t digiisolator2_init (digiisolator2_t *ctx, digiisolator2_cfg_t *cfg)
 DIGI Isolator 2 initialization function.
 
err_t digiisolator2_spi_write (digiisolator2_t *ctx, uint8_t reg, uint8_t data_in)
 DIGI Isolator 2 SPI writing function.
 
err_t digiisolator2_spi_read (digiisolator2_t *ctx, uint8_t reg, uint8_t *data_out)
 DIGI Isolator 2 SPI reading function.
 
void digiisolator2_set_rst_pin (digiisolator2_t *ctx, uint8_t state)
 DIGI Isolator 2 set rst pin function.
 
uint8_t digiisolator2_get_int_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get int pin function.
 
uint8_t digiisolator2_get_sync_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get sync pin function.
 
err_t digiisolator2_read_inputs (digiisolator2_t *ctx, uint8_t *data_out)
 DIGI Isolator 2 read inputs function.
 
uint8_t digiisolator2_get_out1_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out1 pin function.
 
uint8_t digiisolator2_get_out2_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out2 pin function.
 
uint8_t digiisolator2_get_out3_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out3 pin function.
 
uint8_t digiisolator2_get_out4_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out4 pin function.
 
uint8_t digiisolator2_get_out5_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out5 pin function.
 
uint8_t digiisolator2_get_out6_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out6 pin function.
 
uint8_t digiisolator2_get_out8_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out8 pin function.
 
void digiisolator2_enable_output (digiisolator2_t *ctx)
 DIGI Isolator 2 enable output function.
 
void digiisolator2_disable_output (digiisolator2_t *ctx)
 DIGI Isolator 2 disable output function.
 

Detailed Description

This file contains API for DIGI Isolator 2 Click Driver.

Enumeration Type Documentation

◆ digiisolator2_drv_t

DIGI Isolator 2 Click driver selector.

Selects target driver interface of DIGI Isolator 2 Click driver.

Enumerator
DIGIISOLATOR2_DRV_SEL_SPI 

SPI driver descriptor.

DIGIISOLATOR2_DRV_SEL_GPIO 

GPIO driver descriptor.

◆ digiisolator2_return_value_t

DIGI Isolator 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
DIGIISOLATOR2_OK 
DIGIISOLATOR2_ERROR