c1wirei2c 2.1.0.0
c1wirei2c.h File Reference

This file contains API for 1-Wire I2C Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_one_wire.h"

Go to the source code of this file.

Data Structures

struct  c1wirei2c_t
 1-Wire I2C Click context object. More...
 
struct  c1wirei2c_cfg_t
 1-Wire I2C Click configuration object. More...
 

Macros

#define C1WIREI2C_CMD_WRITE_DATA_WITH_STOP   0x4B
 1-Wire I2C commands list.
 
#define C1WIREI2C_CMD_WRITE_DATA_NO_STOP   0x5A
 
#define C1WIREI2C_CMD_WRITE_DATA_ONLY   0x69
 
#define C1WIREI2C_CMD_WRITE_DATA_ONLY_WITH_STOP   0x78
 
#define C1WIREI2C_CMD_READ_DATA_WITH_STOP   0x87
 
#define C1WIREI2C_CMD_WRITE_READ_DATA_WITH_STOP   0x2D
 
#define C1WIREI2C_CMD_WRITE_CONFIGURATION   0xD2
 
#define C1WIREI2C_CMD_READ_CONFIGURATION   0xE1
 
#define C1WIREI2C_CMD_ENABLE_SLEEP_MODE   0x1E
 
#define C1WIREI2C_CMD_READ_DEVICE_REVISION   0xC3
 
#define C1WIREI2C_CONFIGURATION_SPD_100KHZ   0x00
 1-Wire I2C configuration register settings.
 
#define C1WIREI2C_CONFIGURATION_SPD_400KHZ   0x01
 
#define C1WIREI2C_CONFIGURATION_SPD_900KHZ   0x02
 
#define C1WIREI2C_CONFIGURATION_SPD_MASK   0x03
 
#define C1WIREI2C_FAMILY_CODE   0x19
 1-Wire I2C family code value.
 
#define C1WIREI2C_ADDRESS_0   0x00
 1-Wire I2C address selection macros.
 
#define C1WIREI2C_ADDRESS_ALL   0xFF
 
#define C1WIREI2C_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  c1wirei2c_gpio_sel_t { C1WIREI2C_GPIO_OW1 , C1WIREI2C_GPIO_OW2 }
 1-Wire I2C Click gpio selector. More...
 
enum  c1wirei2c_return_value_t { C1WIREI2C_OK = 0 , C1WIREI2C_ERROR = -1 }
 1-Wire I2C Click return value data. More...
 

Functions

void c1wirei2c_cfg_setup (c1wirei2c_cfg_t *cfg)
 1-Wire I2C configuration object setup function.
 
void c1wirei2c_gpio_selection (c1wirei2c_cfg_t *cfg, c1wirei2c_gpio_sel_t gpio_sel)
 1-Wire I2C driver interface setup function.
 
err_t c1wirei2c_init (c1wirei2c_t *ctx, c1wirei2c_cfg_t *cfg)
 1-Wire I2C initialization function.
 
err_t c1wirei2c_default_cfg (c1wirei2c_t *ctx)
 1-Wire I2C default configuration function.
 
err_t c1wirei2c_check_communication (c1wirei2c_t *ctx)
 1-Wire I2C check communication function.
 
err_t c1wirei2c_select_device (c1wirei2c_t *ctx)
 1-Wire I2C select device function.
 
err_t c1wirei2c_write_data_stop (c1wirei2c_t *ctx, uint8_t slave_addr, uint8_t *data_in, uint8_t len)
 1-Wire I2C write data stop function.
 
err_t c1wirei2c_write_data (c1wirei2c_t *ctx, uint8_t slave_addr, uint8_t *data_in, uint8_t len)
 1-Wire I2C write data function.
 
err_t c1wirei2c_write_data_only (c1wirei2c_t *ctx, uint8_t *data_in, uint8_t len)
 1-Wire I2C write data only function.
 
err_t c1wirei2c_write_data_only_stop (c1wirei2c_t *ctx, uint8_t *data_in, uint8_t len)
 1-Wire I2C write data only stop function.
 
err_t c1wirei2c_read_data_stop (c1wirei2c_t *ctx, uint8_t slave_addr, uint8_t *data_out, uint8_t len)
 1-Wire I2C read data stop function.
 
err_t c1wirei2c_write_read_data_stop (c1wirei2c_t *ctx, uint8_t slave_addr, uint8_t *data_in, uint8_t in_len, uint8_t *data_out, uint8_t out_len)
 1-Wire I2C write read data stop function.
 
err_t c1wirei2c_write_configuration (c1wirei2c_t *ctx, uint8_t config)
 1-Wire I2C write configuration function.
 
err_t c1wirei2c_read_configuration (c1wirei2c_t *ctx, uint8_t *config)
 1-Wire I2C read configuration function.
 
err_t c1wirei2c_enable_sleep_mode (c1wirei2c_t *ctx)
 1-Wire I2C enable sleep mode function.
 
err_t c1wirei2c_read_device_revision (c1wirei2c_t *ctx, uint8_t *revision)
 1-Wire I2C read device revision function.
 
void c1wirei2c_set_rst_pin (c1wirei2c_t *ctx, uint8_t state)
 1-Wire I2C set rst pin function.
 
void c1wirei2c_reset_device (c1wirei2c_t *ctx)
 1-Wire I2C reset device function.
 

Detailed Description

This file contains API for 1-Wire I2C Click Driver.

Enumeration Type Documentation

◆ c1wirei2c_gpio_sel_t

1-Wire I2C Click gpio selector.

Selects gpio pin of 1-Wire I2C Click driver.

Enumerator
C1WIREI2C_GPIO_OW1 

GPIO OW1 pin.

C1WIREI2C_GPIO_OW2 

GPIO OW2 pin.

◆ c1wirei2c_return_value_t

1-Wire I2C Click return value data.

Predefined enum values for driver return values.

Enumerator
C1WIREI2C_OK 
C1WIREI2C_ERROR