expand16 2.1.0.0
expand16.h File Reference

This file contains API for Expand 16 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  expand16_t
 Expand 16 Click context object. More...
 
struct  expand16_cfg_t
 Expand 16 Click configuration object. More...
 

Macros

#define EXPAND16_REG_DEV_ID_AND_CTRL   0x01
 Expand 16 description register.
 
#define EXPAND16_REG_IO_DIRECTION   0x03
 
#define EXPAND16_REG_OUTPUT_STATE   0x05
 
#define EXPAND16_REG_OUTPUT_HIGH_Z   0x07
 
#define EXPAND16_REG_INPUT_DEF_STATE   0x09
 
#define EXPAND16_REG_PULL_ENABLE   0x0B
 
#define EXPAND16_REG_PULL_DOWN_UP   0x0D
 
#define EXPAND16_REG_INPUT_STATE   0x0F
 
#define EXPAND16_REG_INTERRUPT_MASK   0x11
 
#define EXPAND16_REG_INTERRUPT_STATUS   0x13
 
#define EXPAND16_PIN_MASK_NONE   0x00
 Expand 16 description setting.
 
#define EXPAND16_PIN_MASK_GPIO_0   0x01
 
#define EXPAND16_PIN_MASK_GPIO_1   0x02
 
#define EXPAND16_PIN_MASK_GPIO_2   0x04
 
#define EXPAND16_PIN_MASK_GPIO_3   0x08
 
#define EXPAND16_PIN_MASK_GPIO_4   0x10
 
#define EXPAND16_PIN_MASK_GPIO_5   0x20
 
#define EXPAND16_PIN_MASK_GPIO_6   0x40
 
#define EXPAND16_PIN_MASK_GPIO_7   0x80
 
#define EXPAND16_PIN_MASK_ALL   0xFF
 
#define EXPAND16_SW_RESET_CMD   0x01
 Expand 16 software reset command.
 
#define EXPAND16_DEVICE_ID   0xA0
 Expand 16 device ID.
 
#define EXPAND16_DEVICE_ID_MASK   0xE0
 
#define EXPAND16_PIN_STATE_HIGH   0x01
 Expand 16 pin state setting.
 
#define EXPAND16_PIN_STATE_LOW   0x00
 
#define EXPAND16_DEVICE_ADDRESS_GND   0x43
 Expand 16 device address setting.
 
#define EXPAND16_DEVICE_ADDRESS_VCC   0x44
 
#define EXPAND16_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  expand16_return_value_t { EXPAND16_OK = 0 , EXPAND16_ERROR = -1 }
 Expand 16 Click return value data. More...
 

Functions

void expand16_cfg_setup (expand16_cfg_t *cfg)
 Expand 16 configuration object setup function.
 
err_t expand16_init (expand16_t *ctx, expand16_cfg_t *cfg)
 Expand 16 initialization function.
 
err_t expand16_default_cfg (expand16_t *ctx)
 Expand 16 default configuration function.
 
err_t expand16_generic_write (expand16_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Expand 16 I2C writing function.
 
err_t expand16_generic_read (expand16_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Expand 16 I2C reading function.
 
void expand16_set_rst_pin (expand16_t *ctx, uint8_t pin_state)
 Expand 16 set RST pin state function.
 
void expand16_hw_reset (expand16_t *ctx)
 Expand 16 Hardware reset function.
 
uint8_t expand16_get_int_pin (expand16_t *ctx)
 Expand 16 get INT pin function.
 
err_t expand16_write_reg (expand16_t *ctx, uint8_t reg, uint8_t data_in)
 Expand 16 register write function.
 
err_t expand16_read_reg (expand16_t *ctx, uint8_t reg, uint8_t *data_out)
 Expand 16 register read function.
 
err_t expand16_set_io_dir (expand16_t *ctx, uint8_t input_pins, uint8_t output_pins)
 Expand 16 set pin input or output direction function.
 
err_t expand16_set_output_state (expand16_t *ctx, uint8_t clr_mask, uint8_t set_mask)
 Expand 16 set output pins state function.
 

Detailed Description

This file contains API for Expand 16 Click Driver.

Enumeration Type Documentation

◆ expand16_return_value_t

Expand 16 Click return value data.

Predefined enum values for driver return values.

Enumerator
EXPAND16_OK 
EXPAND16_ERROR