expand14 2.0.0.0
expand14.h File Reference

This file contains API for Expand 14 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  expand14_t
 Expand 14 Click context object. More...
 
struct  expand14_cfg_t
 Expand 14 Click configuration object. More...
 

Macros

#define EXPAND14_REG_INPUT_PORT_0   0x00
 Expand 14 register list.
 
#define EXPAND14_REG_INPUT_PORT_1   0x01
 
#define EXPAND14_REG_OUTPUT_PORT_0   0x02
 
#define EXPAND14_REG_OUTPUT_PORT_1   0x03
 
#define EXPAND14_REG_POLARITY_INV_PORT_0   0x04
 
#define EXPAND14_REG_POLARITY_INV_PORT_1   0x05
 
#define EXPAND14_REG_CONFIG_PORT_0   0x06
 
#define EXPAND14_REG_CONFIG_PORT_1   0x07
 
#define EXPAND14_NO_PIN_MASK   0x00
 Expand 14 pin mask values.
 
#define EXPAND14_PIN_0_MASK   0x01
 
#define EXPAND14_PIN_1_MASK   0x02
 
#define EXPAND14_PIN_2_MASK   0x04
 
#define EXPAND14_PIN_3_MASK   0x08
 
#define EXPAND14_PIN_4_MASK   0x10
 
#define EXPAND14_PIN_5_MASK   0x20
 
#define EXPAND14_PIN_6_MASK   0x40
 
#define EXPAND14_PIN_7_MASK   0x80
 
#define EXPAND14_ALL_PINS_MASK   0xFF
 
#define EXPAND14_PORT_0   0x00
 Expand 14 port values.
 
#define EXPAND14_PORT_1   0x01
 
#define EXPAND14_OUTPUT_DIRECTION   0x00
 Expand 14 pin direction values.
 
#define EXPAND14_INPUT_DIRECTION   0x01
 
#define EXPAND14_PIN_LOW_LEVEL   0x00
 Expand 14 pin logic level values.
 
#define EXPAND14_PIN_HIGH_LEVEL   0x01
 
#define EXPAND14_DEVICE_ADDRESS_A2A1A0_000   0x20
 Expand 14 device address setting.
 
#define EXPAND14_DEVICE_ADDRESS_A2A1A0_001   0x21
 
#define EXPAND14_DEVICE_ADDRESS_A2A1A0_010   0x22
 
#define EXPAND14_DEVICE_ADDRESS_A2A1A0_011   0x23
 
#define EXPAND14_DEVICE_ADDRESS_A2A1A0_100   0x24
 
#define EXPAND14_DEVICE_ADDRESS_A2A1A0_101   0x25
 
#define EXPAND14_DEVICE_ADDRESS_A2A1A0_110   0x26
 
#define EXPAND14_DEVICE_ADDRESS_A2A1A0_111   0x27
 
#define EXPAND14_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  expand14_return_value_t { EXPAND14_OK = 0 , EXPAND14_ERROR = -1 }
 Expand 14 Click return value data. More...
 

Functions

void expand14_cfg_setup (expand14_cfg_t *cfg)
 Expand 14 configuration object setup function.
 
err_t expand14_init (expand14_t *ctx, expand14_cfg_t *cfg)
 Expand 14 initialization function.
 
err_t expand14_default_cfg (expand14_t *ctx)
 Expand 14 default configuration function.
 
err_t expand14_generic_write (expand14_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Expand 14 I2C writing function.
 
err_t expand14_generic_read (expand14_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Expand 14 I2C reading function.
 
err_t expand14_write_register (expand14_t *ctx, uint8_t reg, uint8_t data_in)
 Expand 14 write register function.
 
err_t expand14_read_register (expand14_t *ctx, uint8_t reg, uint8_t *data_out)
 Expand 14 read register function.
 
err_t expand14_set_pin_direction (expand14_t *ctx, uint8_t direction, uint8_t port, uint8_t pin_mask)
 Expand 14 set pin direction function.
 
err_t expand14_set_all_pins_direction (expand14_t *ctx, uint8_t direction)
 Expand 14 set all pins direction function.
 
err_t expand14_set_all_pins_value (expand14_t *ctx, uint8_t set_mask)
 Expand 14 set all pins value function.
 
err_t expand14_set_pin_value (expand14_t *ctx, uint8_t port, uint8_t clr_mask, uint8_t set_mask)
 Expand 14 set pin value function.
 
err_t expand14_read_port_value (expand14_t *ctx, uint8_t port, uint8_t *data_out)
 Expand 14 read port value function.
 
uint8_t expand14_get_int_pin (expand14_t *ctx)
 Expand 14 get INT pin function.
 

Detailed Description

This file contains API for Expand 14 Click Driver.

Enumeration Type Documentation

◆ expand14_return_value_t

Expand 14 Click return value data.

Predefined enum values for driver return values.

Enumerator
EXPAND14_OK 
EXPAND14_ERROR