mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-23 05:14:16 +03:00
2f3ea9494e
* gpio, hsem, crypto: switch from HAL to LL/registers * Moved GPIO initialization to furi_hal * More HAL removed * All HAL modules disabled * HAL is finally removed * hal_gpio -> furi_hal_gpio, main.h removed * Bootloader build fix * RTOS config moved to freertos-glue * delay -> furi_hal_delay Co-authored-by: あく <alleteam@gmail.com>
119 lines
2.4 KiB
C
119 lines
2.4 KiB
C
/**
|
||
* @file furi_hal_rfid.h
|
||
* RFID HAL API
|
||
*/
|
||
|
||
#pragma once
|
||
|
||
#include <stdint.h>
|
||
#include <stdbool.h>
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
/** Initialize RFID subsystem
|
||
*/
|
||
void furi_hal_rfid_init();
|
||
|
||
/** Config rfid pins to reset state
|
||
*/
|
||
void furi_hal_rfid_pins_reset();
|
||
|
||
/** Config rfid pins to emulate state
|
||
*/
|
||
void furi_hal_rfid_pins_emulate();
|
||
|
||
/** Config rfid pins to read state
|
||
*/
|
||
void furi_hal_rfid_pins_read();
|
||
|
||
/** Release rfid pull pin
|
||
*/
|
||
void furi_hal_rfid_pin_pull_release();
|
||
|
||
/** Pulldown rfid pull pin
|
||
*/
|
||
void furi_hal_rfid_pin_pull_pulldown();
|
||
|
||
/** Config rfid timer to read state
|
||
*
|
||
* @param freq timer frequency
|
||
* @param duty_cycle timer duty cycle, 0.0-1.0
|
||
*/
|
||
void furi_hal_rfid_tim_read(float freq, float duty_cycle);
|
||
|
||
/** Start read timer
|
||
*/
|
||
void furi_hal_rfid_tim_read_start();
|
||
|
||
/** Stop read timer
|
||
*/
|
||
void furi_hal_rfid_tim_read_stop();
|
||
|
||
/** Config rfid timer to emulate state
|
||
*
|
||
* @param freq timer frequency
|
||
*/
|
||
void furi_hal_rfid_tim_emulate(float freq);
|
||
|
||
typedef void (*FuriHalRfidEmulateCallback)(void* context);
|
||
|
||
/** Start emulation timer
|
||
*/
|
||
void furi_hal_rfid_tim_emulate_start(FuriHalRfidEmulateCallback callback, void* context);
|
||
|
||
/** Stop emulation timer
|
||
*/
|
||
void furi_hal_rfid_tim_emulate_stop();
|
||
|
||
/** Config rfid timers to reset state
|
||
*/
|
||
void furi_hal_rfid_tim_reset();
|
||
|
||
/** Set emulation timer period
|
||
*
|
||
* @param period overall duration
|
||
*/
|
||
void furi_hal_rfid_set_emulate_period(uint32_t period);
|
||
|
||
/** Set emulation timer pulse
|
||
*
|
||
* @param pulse duration of high level
|
||
*/
|
||
void furi_hal_rfid_set_emulate_pulse(uint32_t pulse);
|
||
|
||
/** Set read timer period
|
||
*
|
||
* @param period overall duration
|
||
*/
|
||
void furi_hal_rfid_set_read_period(uint32_t period);
|
||
|
||
/** Set read timer pulse
|
||
*
|
||
* @param pulse duration of high level
|
||
*/
|
||
void furi_hal_rfid_set_read_pulse(uint32_t pulse);
|
||
|
||
/** Сhanges the configuration of the RFID timer "on a fly"
|
||
*
|
||
* @param freq new frequency
|
||
* @param duty_cycle new duty cycle
|
||
*/
|
||
void furi_hal_rfid_change_read_config(float freq, float duty_cycle);
|
||
|
||
/** Start/Enable comparator */
|
||
void furi_hal_rfid_comp_start();
|
||
|
||
/** Stop/Disable comparator */
|
||
void furi_hal_rfid_comp_stop();
|
||
|
||
typedef void (*FuriHalRfidCompCallback)(bool level, void* context);
|
||
|
||
/** Set comparator callback */
|
||
void furi_hal_rfid_comp_set_callback(FuriHalRfidCompCallback callback, void* context);
|
||
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|