ibutton 2.1.0.0
ibutton.h File Reference

This file contains API for iButton 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  ibutton_t
 iButton Click context object. More...
 
struct  ibutton_cfg_t
 iButton Click configuration object. More...
 

Macros

#define IBUTTON_CMD_WRITE_SCRATCHPAD   0x4E
 iButton commands list.
 
#define IBUTTON_CMD_READ_SCRATCHPAD   0xBE
 
#define IBUTTON_FAMILY_CODE   0x01
 iButton family code value.
 
#define IBUTTON_MAX_KEY_NUMBER   5
 iButton max key number.
 
#define IBUTTON_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  ibutton_gpio_sel_t { IBUTTON_GPIO_0 , IBUTTON_GPIO_1 }
 iButton Click gpio selector. More...
 
enum  ibutton_return_value_t { IBUTTON_OK = 0 , IBUTTON_ERROR = -1 , IBUTTON_KEY_ALREADY_EXIST = -2 , IBUTTON_KEY_NO_MATCH = -3 }
 iButton Click return value data. More...
 
enum  ibutton_led_state_t { IBUTTON_LED_DISABLE , IBUTTON_LED_WAIT_KEY , IBUTTON_LED_SUCCESS , IBUTTON_LED_WRONG_KEY }
 iButton Click led indication state. More...
 

Functions

void ibutton_cfg_setup (ibutton_cfg_t *cfg)
 iButton configuration object setup function.
 
void ibutton_gpio_selection (ibutton_cfg_t *cfg, ibutton_gpio_sel_t gpio_sel)
 iButton driver interface setup function.
 
err_t ibutton_init (ibutton_t *ctx, ibutton_cfg_t *cfg)
 iButton initialization function.
 
err_t ibutton_add_key (ibutton_t *ctx)
 iButton add key function.
 
void ibutton_remove_keys (ibutton_t *ctx)
 iButton remove keys function.
 
err_t ibutton_check_key (ibutton_t *ctx)
 iButton check key function.
 
void ibutton_enable_red_led (ibutton_t *ctx)
 iButton enable red led function.
 
void ibutton_disable_red_led (ibutton_t *ctx)
 iButton disable red led function.
 
void ibutton_enable_green_led (ibutton_t *ctx)
 iButton enable green led function.
 
void ibutton_disable_green_led (ibutton_t *ctx)
 iButton disable green led function.
 

Detailed Description

This file contains API for iButton Click Driver.

Enumeration Type Documentation

◆ ibutton_gpio_sel_t

iButton Click gpio selector.

Selects gpio pin of iButton Click driver.

Enumerator
IBUTTON_GPIO_0 

GPIO 0 pin.

IBUTTON_GPIO_1 

GPIO 1 pin.

◆ ibutton_led_state_t

iButton Click led indication state.

Predefined enum values for led indication state.

Enumerator
IBUTTON_LED_DISABLE 
IBUTTON_LED_WAIT_KEY 
IBUTTON_LED_SUCCESS 
IBUTTON_LED_WRONG_KEY 

◆ ibutton_return_value_t

iButton Click return value data.

Predefined enum values for driver return values.

Enumerator
IBUTTON_OK 
IBUTTON_ERROR 
IBUTTON_KEY_ALREADY_EXIST 
IBUTTON_KEY_NO_MATCH