2021-05-04 13:21:16 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
#include <stdint.h>
|
2021-05-18 09:54:48 +00:00
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <main.h>
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief config rfid pins to reset state
|
|
|
|
|
*
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_pins_reset();
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief config rfid pins to emulate state
|
|
|
|
|
*
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_pins_emulate();
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief config rfid pins to read state
|
|
|
|
|
*
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_pins_read();
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief config rfid timer to read state
|
|
|
|
|
*
|
|
|
|
|
* @param freq timer frequency
|
|
|
|
|
* @param duty_cycle timer duty cycle, 0.0-1.0
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_tim_read(float freq, float duty_cycle);
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief start read timer
|
|
|
|
|
*
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_tim_read_start();
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief stop read timer
|
|
|
|
|
*
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_tim_read_stop();
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief config rfid timer to emulate state
|
|
|
|
|
*
|
|
|
|
|
* @param freq timer frequency
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_tim_emulate(float freq);
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief start emulation timer
|
|
|
|
|
*
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_tim_emulate_start();
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief stop emulation timer
|
|
|
|
|
*
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_tim_emulate_stop();
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief config rfid timers to reset state
|
|
|
|
|
*
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_tim_reset();
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
2021-05-18 09:54:48 +00:00
|
|
|
|
/**
|
|
|
|
|
* @brief check that timer instance is emulation timer
|
|
|
|
|
*
|
|
|
|
|
* @param hw timer instance
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
bool furi_hal_rfid_is_tim_emulate(TIM_HandleTypeDef* hw);
|
2021-05-18 09:54:48 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief set emulation timer period
|
|
|
|
|
*
|
|
|
|
|
* @param period overall duration
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_set_emulate_period(uint32_t period);
|
2021-05-18 09:54:48 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief set emulation timer pulse
|
|
|
|
|
*
|
|
|
|
|
* @param pulse duration of high level
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_set_emulate_pulse(uint32_t pulse);
|
2021-05-18 09:54:48 +00:00
|
|
|
|
|
2021-06-28 14:42:30 +00:00
|
|
|
|
/**
|
|
|
|
|
* @brief set read timer period
|
|
|
|
|
*
|
|
|
|
|
* @param period overall duration
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_set_read_period(uint32_t period);
|
2021-06-28 14:42:30 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief set read timer pulse
|
|
|
|
|
*
|
|
|
|
|
* @param pulse duration of high level
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_set_read_pulse(uint32_t pulse);
|
2021-06-28 14:42:30 +00:00
|
|
|
|
|
2021-08-01 22:11:18 +00:00
|
|
|
|
/**
|
|
|
|
|
* Сhanges the configuration of the RFID timer "on a fly"
|
|
|
|
|
* @param freq new frequency
|
|
|
|
|
* @param duty_cycle new duty cycle
|
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
|
void furi_hal_rfid_change_read_config(float freq, float duty_cycle);
|
2021-08-01 22:11:18 +00:00
|
|
|
|
|
2021-05-04 13:21:16 +00:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|