expand12 2.0.0.0
expand12.h File Reference

This file contains API for Expand 12 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  expand12_t
 Expand 12 Click context object. More...
 
struct  expand12_cfg_t
 Expand 12 Click configuration object. More...
 

Macros

#define EXPAND12_REG_NOP   0x00
 Expand 12 register map.
 
#define EXPAND12_REG_CONFIG   0x04
 
#define EXPAND12_REG_TRANSITION_DETECT_MASK   0x06
 
#define EXPAND12_REG_RESERVED   0x07
 
#define EXPAND12_REG_CONFIG_P7_4   0x09
 
#define EXPAND12_REG_CONFIG_P11_8   0x0A
 
#define EXPAND12_REG_CONFIG_P15_12   0x0B
 
#define EXPAND12_REG_CONFIG_P19_16   0x0C
 
#define EXPAND12_REG_CONFIG_P23_20   0x0D
 
#define EXPAND12_REG_CONFIG_P27_24   0x0E
 
#define EXPAND12_REG_CONFIG_P31_28   0x0F
 
#define EXPAND12_REG_P0   0x20
 
#define EXPAND12_REG_P1   0x21
 
#define EXPAND12_REG_P2   0x22
 
#define EXPAND12_REG_P3   0x23
 
#define EXPAND12_REG_P4   0x24
 
#define EXPAND12_REG_P5   0x25
 
#define EXPAND12_REG_P6   0x26
 
#define EXPAND12_REG_P7   0x27
 
#define EXPAND12_REG_P8   0x28
 
#define EXPAND12_REG_P9   0x29
 
#define EXPAND12_REG_P10   0x2A
 
#define EXPAND12_REG_P11   0x2B
 
#define EXPAND12_REG_P12   0x2C
 
#define EXPAND12_REG_P13   0x2D
 
#define EXPAND12_REG_P14   0x2E
 
#define EXPAND12_REG_P15   0x2F
 
#define EXPAND12_REG_P16   0x30
 
#define EXPAND12_REG_P17   0x31
 
#define EXPAND12_REG_P18   0x32
 
#define EXPAND12_REG_P19   0x33
 
#define EXPAND12_REG_P20   0x34
 
#define EXPAND12_REG_P21   0x35
 
#define EXPAND12_REG_P22   0x36
 
#define EXPAND12_REG_P23   0x37
 
#define EXPAND12_REG_P24   0x38
 
#define EXPAND12_REG_P25   0x39
 
#define EXPAND12_REG_P26   0x3A
 
#define EXPAND12_REG_P27   0x3B
 
#define EXPAND12_REG_P28   0x3C
 
#define EXPAND12_REG_P29   0x3D
 
#define EXPAND12_REG_P30   0x3E
 
#define EXPAND12_REG_P31   0x3F
 
#define EXPAND12_REG_P4_7   0x40
 
#define EXPAND12_REG_P4_8   0x41
 
#define EXPAND12_REG_P4_9   0x42
 
#define EXPAND12_REG_P4_10   0x43
 
#define EXPAND12_REG_P4_11   0x44
 
#define EXPAND12_REG_P5_12   0x45
 
#define EXPAND12_REG_P6_13   0x46
 
#define EXPAND12_REG_P7_14   0x47
 
#define EXPAND12_REG_P8_15   0x48
 
#define EXPAND12_REG_P9_16   0x49
 
#define EXPAND12_REG_P10_17   0x4A
 
#define EXPAND12_REG_P11_18   0x4B
 
#define EXPAND12_REG_P12_19   0x4C
 
#define EXPAND12_REG_P13_20   0x4D
 
#define EXPAND12_REG_P14_21   0x4E
 
#define EXPAND12_REG_P15_22   0x4F
 
#define EXPAND12_REG_P16_23   0x50
 
#define EXPAND12_REG_P17_24   0x51
 
#define EXPAND12_REG_P18_25   0x52
 
#define EXPAND12_REG_P19_26   0x53
 
#define EXPAND12_REG_P20_27   0x54
 
#define EXPAND12_REG_P21_28   0x55
 
#define EXPAND12_REG_P22_29   0x56
 
#define EXPAND12_REG_P23_30   0x57
 
#define EXPAND12_REG_P24_31   0x58
 
#define EXPAND12_REG_P25_31   0x59
 
#define EXPAND12_REG_P26_31   0x5A
 
#define EXPAND12_REG_P27_31   0x5B
 
#define EXPAND12_REG_P28_31   0x5C
 
#define EXPAND12_REG_P29_31   0x5D
 
#define EXPAND12_REG_P30_31   0x5E
 
#define EXPAND12_REG_P31_ONLY   0x5F
 
#define EXPAND12_PIN_4   0x00
 Expand 12 pin and port selection values.
 
#define EXPAND12_PIN_5   0x01
 
#define EXPAND12_PIN_6   0x02
 
#define EXPAND12_PIN_7   0x03
 
#define EXPAND12_PIN_8   0x04
 
#define EXPAND12_PIN_9   0x05
 
#define EXPAND12_PIN_10   0x06
 
#define EXPAND12_PIN_11   0x07
 
#define EXPAND12_PIN_12   0x08
 
#define EXPAND12_PIN_13   0x09
 
#define EXPAND12_PIN_14   0x0A
 
#define EXPAND12_PIN_15   0x0B
 
#define EXPAND12_PIN_16   0x0C
 
#define EXPAND12_PIN_17   0x0D
 
#define EXPAND12_PIN_18   0x0E
 
#define EXPAND12_PIN_19   0x0F
 
#define EXPAND12_PIN_20   0x10
 
#define EXPAND12_PIN_21   0x11
 
#define EXPAND12_PIN_22   0x12
 
#define EXPAND12_PIN_23   0x13
 
#define EXPAND12_PIN_24   0x14
 
#define EXPAND12_PIN_25   0x15
 
#define EXPAND12_PIN_26   0x16
 
#define EXPAND12_PIN_27   0x17
 
#define EXPAND12_PIN_28   0x18
 
#define EXPAND12_PIN_29   0x19
 
#define EXPAND12_PIN_30   0x1A
 
#define EXPAND12_PIN_31   0x1B
 
#define EXPAND12_ALL_PINS   0xFF
 
#define EXPAND12_NO_PINS   0x00
 
#define EXPAND12_PORT_4_7   0x00
 
#define EXPAND12_PORT_8_15   0x01
 
#define EXPAND12_PORT_16_23   0x02
 
#define EXPAND12_PORT_24_31   0x03
 
#define EXPAND12_DIR_OUTPUT   0x01
 Expand 12 pin direction setting.
 
#define EXPAND12_DIR_INPUT   0x02
 
#define EXPAND12_DIR_INPUT_WITH_PULLUP   0x03
 
#define EXPAND12_OPMODE_SHUTDOWN   0x00
 Expand 12 operating mode setting.
 
#define EXPAND12_OPMODE_NORMAL   0x01
 
#define EXPAND12_PIN_LOW_LEVEL   0x00
 Expand 12 pin logic level values.
 
#define EXPAND12_PIN_HIGH_LEVEL   0x01
 
#define EXPAND12_SET_DEV_ADDR_A1A0_00   0x40
 Expand 12 device address setting.
 
#define EXPAND12_SET_DEV_ADDR_A1A0_01   0x41
 
#define EXPAND12_SET_DEV_ADDR_A1A0_10   0x44
 
#define EXPAND12_SET_DEV_ADDR_A1A0_11   0x45
 
#define EXPAND12_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  expand12_return_value_t { EXPAND12_OK = 0 , EXPAND12_ERROR = -1 }
 Expand 12 Click return value data. More...
 

Functions

void expand12_cfg_setup (expand12_cfg_t *cfg)
 Expand 12 configuration object setup function.
 
err_t expand12_init (expand12_t *ctx, expand12_cfg_t *cfg)
 Expand 12 initialization function.
 
err_t expand12_default_cfg (expand12_t *ctx)
 Expand 12 default configuration function.
 
err_t expand12_generic_write (expand12_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Expand 12 I2C writing function.
 
err_t expand12_generic_read (expand12_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Expand 12 I2C reading function.
 
err_t expand12_write_register (expand12_t *ctx, uint8_t reg, uint8_t data_in)
 Expand 12 write register function.
 
err_t expand12_read_register (expand12_t *ctx, uint8_t reg, uint8_t *data_out)
 Expand 12 read register function.
 
err_t expand12_set_operating_mode (expand12_t *ctx, uint8_t state)
 Expand 12 set operating mode function.
 
err_t expand12_set_pin_direction (expand12_t *ctx, uint8_t pin, uint8_t direction)
 Expand 12 set pin direction function.
 
err_t expand12_set_port_direction (expand12_t *ctx, uint8_t port, uint8_t direction)
 Expand 12 set port direction function.
 
err_t expand12_set_all_pins_direction (expand12_t *ctx, uint8_t direction)
 Expand 12 set all pins direction function.
 
err_t expand12_set_pin_value (expand12_t *ctx, uint8_t pin, uint8_t pin_value)
 Expand 12 set pin value function.
 
err_t expand12_set_port_value (expand12_t *ctx, uint8_t port, uint8_t clr_mask, uint8_t set_mask)
 Expand 12 set port value function.
 
err_t expand12_set_all_pins_value (expand12_t *ctx, uint8_t pin_value)
 Expand 12 set all pins value function.
 
err_t expand12_read_pin_value (expand12_t *ctx, uint8_t pin, uint8_t *pin_value)
 Expand 12 read pin value function.
 
err_t expand12_read_port_value (expand12_t *ctx, uint8_t port, uint8_t *port_value)
 Expand 12 read port value function.
 
err_t expand12_read_all_pins_value (expand12_t *ctx, uint32_t *pins_value)
 Expand 12 read all pins value function.
 

Detailed Description

This file contains API for Expand 12 Click Driver.

Enumeration Type Documentation

◆ expand12_return_value_t

Expand 12 Click return value data.

Predefined enum values for driver return values.

Enumerator
EXPAND12_OK 
EXPAND12_ERROR