mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-01 00:39:12 +00:00
4d6b170769
* Fixing compiler warnings with -Wextra * More warnings suppression, WIP * Even more warning fixes * Added new lines at end of text files. * Padding fix * Additional fixes to warnings on different build configurations; added -Wextra to default build pipeline * Fixes for Secplus v1 * -additional warnings * +-Wredundant-decls fixes * FuriHal: print stack overflow task name in console * FuriHal: add missing include Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
60 lines
1 KiB
C
60 lines
1 KiB
C
/**
|
|
* @file ibutton_writer.h
|
|
*
|
|
* iButton blanks writer
|
|
*/
|
|
|
|
#pragma once
|
|
#include <furi_hal_gpio.h>
|
|
#include "ibutton_key.h"
|
|
#include "../one_wire_host.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
iButtonWriterOK,
|
|
iButtonWriterSameKey,
|
|
iButtonWriterNoDetect,
|
|
iButtonWriterCannotWrite,
|
|
} iButtonWriterResult;
|
|
|
|
typedef struct iButtonWriter iButtonWriter;
|
|
|
|
/**
|
|
* Allocate writer
|
|
* @param host
|
|
* @return iButtonWriter*
|
|
*/
|
|
iButtonWriter* ibutton_writer_alloc(OneWireHost* host);
|
|
|
|
/**
|
|
* Deallocate writer
|
|
* @param writer
|
|
*/
|
|
void ibutton_writer_free(iButtonWriter* writer);
|
|
|
|
/**
|
|
* Write key to blank
|
|
* @param writer
|
|
* @param key
|
|
* @return iButtonWriterResult
|
|
*/
|
|
iButtonWriterResult ibutton_writer_write(iButtonWriter* writer, iButtonKey* key);
|
|
|
|
/**
|
|
* Start writing. Must be called before write attempt
|
|
* @param writer
|
|
*/
|
|
void ibutton_writer_start(iButtonWriter* writer);
|
|
|
|
/**
|
|
* Stop writing
|
|
* @param writer
|
|
*/
|
|
void ibutton_writer_stop(iButtonWriter* writer);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|