expand10 2.0.0.0
expand10.h File Reference

This file contains API for Expand 10 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  expand10_t
 Expand 10 Click context object. More...
 
struct  expand10_cfg_t
 Expand 10 Click configuration object. More...
 

Macros

#define EXPAND10_REG_INPUT_P0   0x00
 Expand 10 register list.
 
#define EXPAND10_REG_INPUT_P1   0x01
 
#define EXPAND10_REG_INPUT_P2   0x02
 
#define EXPAND10_REG_OUTPUT_P0   0x04
 
#define EXPAND10_REG_OUTPUT_P1   0x05
 
#define EXPAND10_REG_OUTPUT_P2   0x06
 
#define EXPAND10_REG_POLARITY_INV_P0   0x08
 
#define EXPAND10_REG_POLARITY_INV_P1   0x09
 
#define EXPAND10_REG_POLARITY_INV_P2   0x0A
 
#define EXPAND10_REG_CONFIG_P0   0x0C
 
#define EXPAND10_REG_CONFIG_P1   0x0D
 
#define EXPAND10_REG_CONFIG_P2   0x0E
 
#define EXPAND10_REG_OUTPUT_DRIVE_P0A   0x40
 
#define EXPAND10_REG_OUTPUT_DRIVE_P0B   0x41
 
#define EXPAND10_REG_OUTPUT_DRIVE_P1A   0x42
 
#define EXPAND10_REG_OUTPUT_DRIVE_P1B   0x43
 
#define EXPAND10_REG_OUTPUT_DRIVE_P2A   0x44
 
#define EXPAND10_REG_OUTPUT_DRIVE_P2B   0x45
 
#define EXPAND10_REG_INPUT_LAT_P0   0x48
 
#define EXPAND10_REG_INPUT_LAT_P1   0x49
 
#define EXPAND10_REG_INPUT_LAT_P2   0x4A
 
#define EXPAND10_REG_PULL_ENABLE_P0   0x4C
 
#define EXPAND10_REG_PULL_ENABLE_P1   0x4D
 
#define EXPAND10_REG_PULL_ENABLE_P2   0x4E
 
#define EXPAND10_REG_PULL_SELECTION_P0   0x50
 
#define EXPAND10_REG_PULL_SELECTION_P1   0x51
 
#define EXPAND10_REG_PULL_SELECTION_P2   0x52
 
#define EXPAND10_REG_INT_MASK_P0   0x54
 
#define EXPAND10_REG_INT_MASK_P1   0x55
 
#define EXPAND10_REG_INT_MASK_P2   0x56
 
#define EXPAND10_REG_INT_STATUS_P0   0x58
 
#define EXPAND10_REG_INT_STATUS_P1   0x59
 
#define EXPAND10_REG_INT_STATUS_P2   0x5A
 
#define EXPAND10_REG_OUTPUT_PORT_CONFIG   0x5C
 
#define EXPAND10_REG_INT_EDGE_P0A   0x60
 
#define EXPAND10_REG_INT_EDGE_P0B   0x61
 
#define EXPAND10_REG_INT_EDGE_P1A   0x62
 
#define EXPAND10_REG_INT_EDGE_P1B   0x63
 
#define EXPAND10_REG_INT_EDGE_P2A   0x64
 
#define EXPAND10_REG_INT_EDGE_P2B   0x65
 
#define EXPAND10_REG_INT_CLEAR_P0   0x68
 
#define EXPAND10_REG_INT_CLEAR_P1   0x69
 
#define EXPAND10_REG_INT_CLEAR_P2   0x6A
 
#define EXPAND10_REG_INPUT_STATUS_P0   0x6C
 
#define EXPAND10_REG_INPUT_STATUS_P1   0x6D
 
#define EXPAND10_REG_INPUT_STATUS_P2   0x6E
 
#define EXPAND10_REG_PIN_OUTPUT_P0_CONFIG   0x70
 
#define EXPAND10_REG_PIN_OUTPUT_P1_CONFIG   0x71
 
#define EXPAND10_REG_PIN_OUTPUT_P2_CONFIG   0x72
 
#define EXPAND10_REG_SWITCH_DEBOUNCE_EN_0   0x74
 
#define EXPAND10_REG_SWITCH_DEBOUNCE_EN_1   0x75
 
#define EXPAND10_REG_SWITCH_DEBOUNCE_CNT   0x76
 
#define EXPAND10_NO_PIN_MASK   0x00
 Expand 10 pin mask values.
 
#define EXPAND10_PIN_0_MASK   0x01
 
#define EXPAND10_PIN_1_MASK   0x02
 
#define EXPAND10_PIN_2_MASK   0x04
 
#define EXPAND10_PIN_3_MASK   0x08
 
#define EXPAND10_PIN_4_MASK   0x10
 
#define EXPAND10_PIN_5_MASK   0x20
 
#define EXPAND10_PIN_6_MASK   0x40
 
#define EXPAND10_PIN_7_MASK   0x80
 
#define EXPAND10_ALL_PINS_MASK   0xFF
 
#define EXPAND10_PORT_0   0x00
 Expand 10 port values.
 
#define EXPAND10_PORT_1   0x01
 
#define EXPAND10_PORT_2   0x02
 
#define EXPAND10_OUTPUT_DIRECTION   0x00
 Expand 10 pin direction values.
 
#define EXPAND10_INPUT_DIRECTION   0x01
 
#define EXPAND10_PIN_LOW_LEVEL   0x00
 Expand 10 pin logic level values.
 
#define EXPAND10_PIN_HIGH_LEVEL   0x01
 
#define EXPAND10_AUTO_INCREMENT_BIT   0x80
 Expand 10 auto increment bit mask.
 
#define EXPAND10_DEVICE_ID   0x000830
 Expand 10 device ID value.
 
#define EXPAND10_SOFTWARE_RESET   0x06
 Expand 10 software reset value.
 
#define EXPAND10_GEN_CALL_ADDR   0x00
 Expand 10 general call and device ID addresses.
 
#define EXPAND10_DEV_ID_ADDR   0x7C
 
#define EXPAND10_SET_DEV_ADDR_0   0x22
 Expand 10 device address setting.
 
#define EXPAND10_SET_DEV_ADDR_1   0x23
 
#define EXPAND10_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  expand10_return_value_t { EXPAND10_OK = 0 , EXPAND10_ERROR = -1 }
 Expand 10 Click return value data. More...
 

Functions

void expand10_cfg_setup (expand10_cfg_t *cfg)
 Expand 10 configuration object setup function.
 
err_t expand10_init (expand10_t *ctx, expand10_cfg_t *cfg)
 Expand 10 initialization function.
 
err_t expand10_default_cfg (expand10_t *ctx)
 Expand 10 default configuration function.
 
err_t expand10_generic_write (expand10_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Expand 10 I2C writing function.
 
err_t expand10_generic_read (expand10_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Expand 10 I2C reading function.
 
void expand10_set_rst_pin (expand10_t *ctx, uint8_t logic_level)
 Expand 10 set RST pin function.
 
uint8_t expand10_get_int_pin (expand10_t *ctx)
 Expand 10 get INT pin function.
 
err_t expand10_write_register (expand10_t *ctx, uint8_t reg, uint8_t data_in)
 Expand 10 write register function.
 
err_t expand10_read_register (expand10_t *ctx, uint8_t reg, uint8_t *data_out)
 Expand 10 read register function.
 
err_t expand10_check_device_id (expand10_t *ctx)
 Expand 10 check device ID function.
 
err_t expand10_software_reset (expand10_t *ctx)
 Expand 10 software reset function.
 
err_t expand10_set_pin_direction (expand10_t *ctx, uint8_t direction, uint8_t port, uint8_t pin_mask)
 Expand 10 set pin direction function.
 
err_t expand10_set_all_pins_direction (expand10_t *ctx, uint8_t direction)
 Expand 10 set all pins direction function.
 
err_t expand10_set_all_pins_value (expand10_t *ctx, uint8_t set_mask)
 Expand 10 set all pins value function.
 
err_t expand10_set_pin_value (expand10_t *ctx, uint8_t port, uint8_t clr_mask, uint8_t set_mask)
 Expand 10 set pin value function.
 
err_t expand10_read_port_value (expand10_t *ctx, uint8_t port, uint8_t *data_out)
 Expand 10 read port value function.
 

Detailed Description

This file contains API for Expand 10 Click Driver.

Enumeration Type Documentation

◆ expand10_return_value_t

Expand 10 Click return value data.

Predefined enum values for driver return values.

Enumerator
EXPAND10_OK 
EXPAND10_ERROR