ibutton 2.1.0.0
|
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. | |
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.
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.
[in] | ctx | : Click context object. See ibutton_t object definition for detailed explanation. |
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. void ibutton_cfg_setup | ( | ibutton_cfg_t * | cfg | ) |
iButton configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See ibutton_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See ibutton_t object definition for detailed explanation. |
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. 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.
[in] | ctx | : Click context object. See ibutton_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See ibutton_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See ibutton_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See ibutton_t object definition for detailed explanation. |
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.
[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. |
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.