flipperzero-firmware/firmware/targets/furi_hal_include/furi_hal_rfid.h
あく c4a0847c99
FuriHal: replace HAL with LL in RFID Part 1. Drop F6. (#1049)
* FuriHal: new speaker HAL
* FuriHal: drop PWM
* FuriHal: move COMP1 to LL
* FuriHal: move COMP1 to LL backport to F6
* FuriHal: remove missing gpio_rfid_carrier from F6
* FurHal: use LL for system controls in flash HAL
* Drop F6 source tree
* Drop F6 from GitHub workflow
* Tie USE_FULL_ASSERT with APP_UNIT_TESTS
* Speaker: return to old volume calculation
* FreeRTOS: move TCB header to glue

Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
2022-03-23 20:59:20 +03:00

126 lines
2.5 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @file furi_hal_rfid.h
* RFID HAL API
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <main.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);
/** Start emulation timer
*/
void furi_hal_rfid_tim_emulate_start();
/** Stop emulation timer
*/
void furi_hal_rfid_tim_emulate_stop();
/** Config rfid timers to reset state
*/
void furi_hal_rfid_tim_reset();
/** Check that timer instance is emulation timer
*
* @param hw timer instance
*
* @return true if instance is emulation timer
*/
bool furi_hal_rfid_is_tim_emulate(TIM_HandleTypeDef* hw);
/** 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