expand8 2.0.0.0
expand8.h File Reference

This file contains API for Expand 8 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  expand8_t
 Expand 8 Click context object. More...
 
struct  expand8_cfg_t
 Expand 8 Click configuration object. More...
 

Macros

#define EXPAND8_ADDR_OUT_LVL_PORT_P0   0x00
 Expand 8 port adresses.
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P1   0x01
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P2   0x02
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P3   0x03
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P4   0x04
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P5   0x05
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P6   0x06
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P7   0x07
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P8   0x08
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P9   0x09
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P0_THROUGH_P9   0x0A
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P0_THROUGH_P3   0x0B
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P4_THROUGH_P7   0x0C
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P8_THROUGH_P9   0x0D
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P7_THROUGH_P0   0x0E
 
#define EXPAND8_ADDR_OUT_LVL_PORT_P9_THROUGH_P8   0x0F
 
#define EXPAND8_ADDR_RAM   0x13
 
#define EXPAND8_ADDR_NOP   0x20
 
#define EXPAND8_SET_LOW_IMPEDANCE   0x00
 Expand 8 impedance set values.
 
#define EXPAND8_SET_HIGH_IMPEDANCE   0xFF
 
#define EXPAND8_CMD_WRITE   0x00
 Expand 8 commands.
 
#define EXPAND8_CMD_READ   0x80
 
#define EXPAND8_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define EXPAND8_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define EXPAND8_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  expand8_return_value_t { EXPAND8_OK = 0 , EXPAND8_ERROR = -1 }
 Expand 8 Click return value data. More...
 

Functions

void expand8_cfg_setup (expand8_cfg_t *cfg)
 Expand 8 configuration object setup function.
 
err_t expand8_init (expand8_t *ctx, expand8_cfg_t *cfg)
 Expand 8 initialization function.
 
err_t expand8_generic_write (expand8_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Expand 8 data writing function.
 
err_t expand8_generic_read (expand8_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Expand 8 data reading function.
 
void expand8_write_data (expand8_t *ctx, uint8_t addr, uint8_t tx_data)
 Generic write data function.
 
uint8_t expand8_read_data (expand8_t *ctx, uint8_t addr)
 Generic read data function.
 
err_t expand8_set_port (expand8_t *ctx, uint8_t sel_port, uint8_t sel_imped)
 Set port function.
 

Detailed Description

This file contains API for Expand 8 Click Driver.

Enumeration Type Documentation

◆ expand8_return_value_t

Expand 8 Click return value data.

Predefined enum values for driver return values.

Enumerator
EXPAND8_OK 
EXPAND8_ERROR