adapter 2.0.0.0
adapter.h File Reference

This file contains API for Adapter Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  adapter_s
 Click ctx object definition. More...
 
struct  adapter_cfg_t
 Click configuration structure definition. More...
 

Macros

#define ADAPTER_MAP_MIKROBUS(cfg, mikrobus)
 
#define ADAPTER_MASTER_I2C   0
 
#define ADAPTER_MASTER_SPI   1
 
#define ADAPTER_RETVAL   uint8_t
 
#define ADAPTER_OK   0x00
 
#define ADAPTER_INIT_ERROR   0xFF
 
#define I2C_SLAVE_ADDR_DEMO   0x4C
 

Typedefs

typedef uint8_t adapter_select_t
 Communication type.
 
typedef void(* adapter_master_io_t) (struct adapter_s *, uint8_t, uint8_t *, uint8_t)
 Master Input/Output type.
 
typedef struct adapter_s adapter_t
 Click ctx object definition.
 

Functions

void adapter_cfg_setup (adapter_cfg_t *cfg)
 Config Object Initialization function.
 
ADAPTER_RETVAL adapter_init (adapter_t *ctx, adapter_cfg_t *cfg)
 Initialization function.
 
void adapter_generic_write (adapter_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void adapter_generic_read (adapter_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void adapter_generic_transfer (adapter_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void adapter_turn_tx_on (adapter_t *ctx)
 Turn TX on function.
 
void adapter_turn_rx_on (adapter_t *ctx)
 Turn RX on function.
 
void adapter_turn_pwm_on (adapter_t *ctx)
 Turn PWM on function.
 
void adapter_turn_tx_off (adapter_t *ctx)
 Turn TX off function.
 
void adapter_turn_rx_off (adapter_t *ctx)
 Turn RX off function.
 
void adapter_turn_pwm_off (adapter_t *ctx)
 Turn PWM off function.
 
uint8_t adapter_check_int (adapter_t *ctx)
 Check INT function.
 

Detailed Description

This file contains API for Adapter Click driver.