ibutton 2.1.0.0
iButton Click Driver

API for configuring and manipulating iButton Click driver. More...

Topics

 iButton Commands List
 List of commands of iButton Click driver.
 
 iButton Settings
 Settings of iButton Click driver.
 
 iButton MikroBUS Map
 MikroBUS pin mapping of iButton Click driver.
 

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

API for configuring and manipulating iButton Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ ibutton_add_key()

err_t ibutton_add_key ( ibutton_t * ctx)

iButton add key function.

This function reads the ROM address from a DS1990A Serial Number iButton and stores it in the ctx->key_rom buffer.

Parameters
[in]ctx: Click context object. See ibutton_t object definition for detailed explanation.
Returns
  • 0 - Success, the key is registered.
  • -1 - Error, no communication with the key.
  • -2 - The key is already registered. See #err_t definition for detailed explanation.
Note
None.

◆ ibutton_cfg_setup()

void ibutton_cfg_setup ( ibutton_cfg_t * cfg)

iButton configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See ibutton_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ ibutton_check_key()

err_t ibutton_check_key ( ibutton_t * ctx)

iButton check key function.

This function reads the ROM address from a DS1990A Serial Number iButton and checks if it is already stored in the ctx->key_rom buffer.

Parameters
[in]ctx: Click context object. See ibutton_t object definition for detailed explanation.
Returns
  • 0 - Success, the key is found in the buffer.
  • -1 - Error, no communication with the key.
  • -3 - No match, the key is NOT found in the buffer. See #err_t definition for detailed explanation.
Note
None.

◆ ibutton_disable_green_led()

void ibutton_disable_green_led ( ibutton_t * ctx)

iButton disable green led function.

This function disables the green LED indication by setting the ST1 pin to high logic state.

Parameters
[in]ctx: Click context object. See ibutton_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ibutton_disable_red_led()

void ibutton_disable_red_led ( ibutton_t * ctx)

iButton disable red led function.

This function disables the red LED indication by setting the ST2 pin to high logic state.

Parameters
[in]ctx: Click context object. See ibutton_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ibutton_enable_green_led()

void ibutton_enable_green_led ( ibutton_t * ctx)

iButton enable green led function.

This function enables the green LED indication by setting the ST1 pin to low logic state.

Parameters
[in]ctx: Click context object. See ibutton_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ibutton_enable_red_led()

void ibutton_enable_red_led ( ibutton_t * ctx)

iButton enable red led function.

This function enables the red LED indication by setting the ST2 pin to low logic state.

Parameters
[in]ctx: Click context object. See ibutton_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ibutton_gpio_selection()

void ibutton_gpio_selection ( ibutton_cfg_t * cfg,
ibutton_gpio_sel_t gpio_sel )

iButton driver interface setup function.

This function sets a communication GPIO pin which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See ibutton_cfg_t object definition for detailed explanation.
[in]gpio_sel: GPIO pin selection. See ibutton_gpio_sel_t object definition for detailed explanation.
Returns
Nothing.
Note
This gpio selection should be called before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ ibutton_init()

err_t ibutton_init ( ibutton_t * ctx,
ibutton_cfg_t * cfg )

iButton initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See ibutton_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See ibutton_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ibutton_remove_keys()

void ibutton_remove_keys ( ibutton_t * ctx)

iButton remove keys function.

This function removes all stored keys by clearing the ctx->key_rom buffer.

Parameters
[in]ctx: Click context object. See ibutton_t object definition for detailed explanation.
Returns
None.
Note
None.