[FL-3168] Add one_wire lib to f18, separate ibutton (#2509)

* 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>
This commit is contained in:
Georgii Surkov
2023-03-20 19:23:17 +03:00
committed by GitHub
parent 1d91a572cc
commit 0917494a80
55 changed files with 156 additions and 72 deletions

54
lib/ibutton/ibutton_key.h Normal file
View File

@@ -0,0 +1,54 @@
/**
* @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