mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 04:53:08 +00:00
0917494a80
* Separate ibutton to its own module, add one_wire to f18 * Move onewire cli to a separate app Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
54 lines
1.1 KiB
C
54 lines
1.1 KiB
C
/**
|
|
* @file ibutton_key.h
|
|
*
|
|
* iButton key data holder
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <core/string.h>
|
|
|
|
#include "protocols/protocol_common.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct iButtonKey iButtonKey;
|
|
|
|
/**
|
|
* Allocate a key object
|
|
* @param [in] data_size maximum data size held by the key
|
|
* @return pointer to the key object
|
|
*/
|
|
iButtonKey* ibutton_key_alloc(size_t data_size);
|
|
|
|
/**
|
|
* Destroy the key object, free resources
|
|
* @param [in] key pointer to the key object
|
|
*/
|
|
void ibutton_key_free(iButtonKey* key);
|
|
|
|
/**
|
|
* Get the protocol id held by the key
|
|
* @param [in] key pointer to the key object
|
|
* @return protocol id held by the key
|
|
*/
|
|
iButtonProtocolId ibutton_key_get_protocol_id(const iButtonKey* key);
|
|
|
|
/**
|
|
* Set the protocol id held by the key
|
|
* @param [in] key pointer to the key object
|
|
* @param [in] protocol_id new protocol id
|
|
*/
|
|
void ibutton_key_set_protocol_id(iButtonKey* key, iButtonProtocolId protocol_id);
|
|
|
|
/**
|
|
* Reset the protocol id and data held by the key
|
|
* @param [in] key pointer to the key object
|
|
*/
|
|
void ibutton_key_reset(iButtonKey* key);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|