expand17  2.1.0.0
Data Structures | Macros | Enumerations | Functions
expand17.h File Reference

This file contains API for Expand 17 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  expand17_t
 Expand 17 Click context object. More...
 
struct  expand17_cfg_t
 Expand 17 Click configuration object. More...
 

Macros

#define EXPAND17_REG_INPUT_PORT   0x00
 Expand 17 description register. More...
 
#define EXPAND17_REG_OUTPUT_PORT   0x01
 
#define EXPAND17_REG_POLARITY_INVERSION   0x02
 
#define EXPAND17_REG_CONFIGURATION   0x03
 
#define EXPAND17_REG_OUTPUT_STRENGTH_0   0x40
 
#define EXPAND17_REG_OUTPUT_STRENGTH_1   0x41
 
#define EXPAND17_REG_INPUT_LATCH   0x42
 
#define EXPAND17_REG_PULL_UP_DOWN_EN   0x43
 
#define EXPAND17_REG_PULL_UP_DOWN_SELECT   0x44
 
#define EXPAND17_REG_INTERRUPT_MASK   0x45
 
#define EXPAND17_REG_INTERRUPT_STATUS   0x46
 
#define EXPAND17_REG_OUTPUT_PORT_CFG   0x4F
 
#define EXPAND17_IO_1_PIN_MASK   0x01
 Expand 17 description setting. More...
 
#define EXPAND17_IO_2_PIN_MASK   0x02
 
#define EXPAND17_IO_3_PIN_MASK   0x04
 
#define EXPAND17_IO_4_PIN_MASK   0x08
 
#define EXPAND17_IO_5_PIN_MASK   0x10
 
#define EXPAND17_IO_6_PIN_MASK   0x20
 
#define EXPAND17_IO_7_PIN_MASK   0x40
 
#define EXPAND17_IO_8_PIN_MASK   0x80
 
#define EXPAND17_ALL_IO_PIN_MASK   0xFF
 
#define EXPAND17_NO_IO_PIN_MASK   0x00
 
#define EXPAND17_OUTPUT_STRENGTH_FULL   0x03
 Expand 17 output state strength setting. More...
 
#define EXPAND17_OUTPUT_STRENGTH_3_QUARTERS   0x02
 
#define EXPAND17_OUTPUT_STRENGTH_HALF   0x01
 
#define EXPAND17_OUTPUT_STRENGTH_1_QUARTER   0x00
 
#define EXPAND17_PORT_PUSH_PULL   0x00
 Expand 17 output port configuration setting. More...
 
#define EXPAND17_PORT_OPEN_DRAIN   0x01
 
#define EXPAND17_PIN_STATE_HIGH   0x01
 Expand 17 pin state setting. More...
 
#define EXPAND17_PIN_STATE_LOW   0x00
 
#define EXPAND17_DEVICE_ADDRESS_0   0x20
 Expand 17 device address setting. More...
 
#define EXPAND17_DEVICE_ADDRESS_1   0x21
 
#define EXPAND17_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping. More...
 

Enumerations

enum  expand17_return_value_t { EXPAND17_OK = 0, EXPAND17_ERROR = -1 }
 Expand 17 Click return value data. More...
 

Functions

void expand17_cfg_setup (expand17_cfg_t *cfg)
 Expand 17 configuration object setup function. More...
 
err_t expand17_init (expand17_t *ctx, expand17_cfg_t *cfg)
 Expand 17 initialization function. More...
 
err_t expand17_default_cfg (expand17_t *ctx)
 Expand 17 default configuration function. More...
 
err_t expand17_generic_write (expand17_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Expand 17 I2C writing function. More...
 
err_t expand17_generic_read (expand17_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Expand 17 I2C reading function. More...
 
void expand17_set_rst_pin (expand17_t *ctx, uint8_t pin_state)
 Expand 17 set reset pin state function. More...
 
uint8_t expand17_get_int_pin (expand17_t *ctx)
 Expand 17 get interrupt pin state function. More...
 
void expand17_hw_reset (expand17_t *ctx)
 Expand 17 hardware reset function. More...
 
err_t expand17_set_io_dir (expand17_t *ctx, uint8_t input_pins, uint8_t output_pins)
 Expand 17 set pin input or output direction function. More...
 
err_t expand17_set_output_state (expand17_t *ctx, uint8_t clr_mask, uint8_t set_mask)
 Expand 17 set output pins state function. More...
 
err_t expand17_get_input_state (expand17_t *ctx, uint8_t *input_state)
 Expand 17 get input pins state function. More...
 

Detailed Description

This file contains API for Expand 17 Click Driver.

Enumeration Type Documentation

◆ expand17_return_value_t

Expand 17 Click return value data.

Predefined enum values for driver return values.

Enumerator
EXPAND17_OK 
EXPAND17_ERROR