Rename api-hal to furi-hal (#629)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "decoder-analyzer.h"
|
||||
#include <furi.h>
|
||||
#include <api-hal.h>
|
||||
#include <furi-hal.h>
|
||||
|
||||
bool DecoderAnalyzer::read(uint8_t* _data, uint8_t _data_size) {
|
||||
bool result = false;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "emmarine.h"
|
||||
#include "decoder-emmarine.h"
|
||||
#include <furi.h>
|
||||
#include <api-hal.h>
|
||||
#include <furi-hal.h>
|
||||
|
||||
constexpr uint32_t clocks_in_us = 64;
|
||||
constexpr uint32_t short_time = 255 * clocks_in_us;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "decoder-gpio-out.h"
|
||||
#include <furi.h>
|
||||
#include <api-hal.h>
|
||||
#include <furi-hal.h>
|
||||
|
||||
void DecoderGpioOut::process_front(bool polarity, uint32_t time) {
|
||||
hal_gpio_write(&gpio_ext_pa7, polarity);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "decoder-hid26.h"
|
||||
#include <api-hal.h>
|
||||
#include <furi-hal.h>
|
||||
|
||||
constexpr uint32_t clocks_in_us = 64;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "decoder-indala.h"
|
||||
#include <api-hal.h>
|
||||
#include <furi-hal.h>
|
||||
|
||||
constexpr uint32_t clocks_in_us = 64;
|
||||
constexpr uint32_t us_per_bit = 255;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "rfid-reader.h"
|
||||
#include <furi.h>
|
||||
#include <api-hal.h>
|
||||
#include <furi-hal.h>
|
||||
#include <stm32wbxx_ll_cortex.h>
|
||||
#include <tim.h>
|
||||
|
||||
@@ -49,11 +49,11 @@ void RfidReader::switch_mode() {
|
||||
switch(type) {
|
||||
case Type::Normal:
|
||||
type = Type::Indala;
|
||||
api_hal_rfid_change_read_config(62500.0f, 0.25f);
|
||||
furi_hal_rfid_change_read_config(62500.0f, 0.25f);
|
||||
break;
|
||||
case Type::Indala:
|
||||
type = Type::Normal;
|
||||
api_hal_rfid_change_read_config(125000.0f, 0.5f);
|
||||
furi_hal_rfid_change_read_config(125000.0f, 0.5f);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -76,9 +76,9 @@ RfidReader::RfidReader() {
|
||||
void RfidReader::start() {
|
||||
type = Type::Normal;
|
||||
|
||||
api_hal_rfid_pins_read();
|
||||
api_hal_rfid_tim_read(125000, 0.5);
|
||||
api_hal_rfid_tim_read_start();
|
||||
furi_hal_rfid_pins_read();
|
||||
furi_hal_rfid_tim_read(125000, 0.5);
|
||||
furi_hal_rfid_tim_read_start();
|
||||
start_comparator();
|
||||
|
||||
switch_timer_reset();
|
||||
@@ -92,9 +92,9 @@ void RfidReader::start_forced(RfidReader::Type _type) {
|
||||
start();
|
||||
break;
|
||||
case Type::Indala:
|
||||
api_hal_rfid_pins_read();
|
||||
api_hal_rfid_tim_read(62500.0f, 0.25f);
|
||||
api_hal_rfid_tim_read_start();
|
||||
furi_hal_rfid_pins_read();
|
||||
furi_hal_rfid_tim_read(62500.0f, 0.25f);
|
||||
furi_hal_rfid_tim_read_start();
|
||||
start_comparator();
|
||||
|
||||
switch_timer_reset();
|
||||
@@ -104,9 +104,9 @@ void RfidReader::start_forced(RfidReader::Type _type) {
|
||||
}
|
||||
|
||||
void RfidReader::stop() {
|
||||
api_hal_rfid_pins_reset();
|
||||
api_hal_rfid_tim_read_stop();
|
||||
api_hal_rfid_tim_reset();
|
||||
furi_hal_rfid_pins_reset();
|
||||
furi_hal_rfid_tim_read_stop();
|
||||
furi_hal_rfid_tim_reset();
|
||||
stop_comparator();
|
||||
}
|
||||
|
||||
|
@@ -21,12 +21,12 @@ void RfidTimerEmulator::start(LfrfidKeyType type, const uint8_t* data, uint8_t d
|
||||
if(data_size >= lfrfid_key_get_type_data_count(type)) {
|
||||
current_encoder->init(data, data_size);
|
||||
|
||||
api_hal_rfid_tim_emulate(125000);
|
||||
api_hal_rfid_pins_emulate();
|
||||
furi_hal_rfid_tim_emulate(125000);
|
||||
furi_hal_rfid_pins_emulate();
|
||||
|
||||
api_interrupt_add(timer_update_callback, InterruptTypeTimerUpdate, this);
|
||||
|
||||
api_hal_rfid_tim_emulate_start();
|
||||
furi_hal_rfid_tim_emulate_start();
|
||||
}
|
||||
} else {
|
||||
// not found
|
||||
@@ -34,18 +34,18 @@ void RfidTimerEmulator::start(LfrfidKeyType type, const uint8_t* data, uint8_t d
|
||||
}
|
||||
|
||||
void RfidTimerEmulator::stop() {
|
||||
api_hal_rfid_tim_emulate_stop();
|
||||
furi_hal_rfid_tim_emulate_stop();
|
||||
api_interrupt_remove(timer_update_callback, InterruptTypeTimerUpdate);
|
||||
|
||||
api_hal_rfid_tim_reset();
|
||||
api_hal_rfid_pins_reset();
|
||||
furi_hal_rfid_tim_reset();
|
||||
furi_hal_rfid_pins_reset();
|
||||
}
|
||||
|
||||
void RfidTimerEmulator::timer_update_callback(void* _hw, void* ctx) {
|
||||
RfidTimerEmulator* _this = static_cast<RfidTimerEmulator*>(ctx);
|
||||
TIM_HandleTypeDef* hw = static_cast<TIM_HandleTypeDef*>(_hw);
|
||||
|
||||
if(api_hal_rfid_is_tim_emulate(hw)) {
|
||||
if(furi_hal_rfid_is_tim_emulate(hw)) {
|
||||
bool result;
|
||||
bool polarity;
|
||||
uint16_t period;
|
||||
@@ -58,7 +58,7 @@ void RfidTimerEmulator::timer_update_callback(void* _hw, void* ctx) {
|
||||
|
||||
_this->pulse_joiner.pop_pulse(&period, &pulse);
|
||||
|
||||
api_hal_rfid_set_emulate_period(period - 1);
|
||||
api_hal_rfid_set_emulate_pulse(pulse);
|
||||
furi_hal_rfid_set_emulate_period(period - 1);
|
||||
furi_hal_rfid_set_emulate_pulse(pulse);
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include <api-hal.h>
|
||||
#include <furi-hal.h>
|
||||
#include "key-info.h"
|
||||
#include "encoder-generic.h"
|
||||
#include "encoder-emmarine.h"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "rfid-writer.h"
|
||||
#include <api-hal.h>
|
||||
#include <furi-hal.h>
|
||||
#include "protocols/protocol-emmarin.h"
|
||||
#include "protocols/protocol-hid-h10301.h"
|
||||
#include "protocols/protocol-indala-40134.h"
|
||||
@@ -34,21 +34,21 @@ RfidWriter::~RfidWriter() {
|
||||
}
|
||||
|
||||
void RfidWriter::start() {
|
||||
api_hal_rfid_tim_read(125000, 0.5);
|
||||
api_hal_rfid_pins_read();
|
||||
api_hal_rfid_tim_read_start();
|
||||
furi_hal_rfid_tim_read(125000, 0.5);
|
||||
furi_hal_rfid_pins_read();
|
||||
furi_hal_rfid_tim_read_start();
|
||||
}
|
||||
|
||||
void RfidWriter::stop() {
|
||||
api_hal_rfid_tim_read_stop();
|
||||
api_hal_rfid_tim_reset();
|
||||
api_hal_rfid_pins_reset();
|
||||
furi_hal_rfid_tim_read_stop();
|
||||
furi_hal_rfid_tim_reset();
|
||||
furi_hal_rfid_pins_reset();
|
||||
}
|
||||
|
||||
void RfidWriter::write_gap(uint32_t gap_time) {
|
||||
api_hal_rfid_tim_read_stop();
|
||||
furi_hal_rfid_tim_read_stop();
|
||||
delay_us(gap_time * 8);
|
||||
api_hal_rfid_tim_read_start();
|
||||
furi_hal_rfid_tim_read_start();
|
||||
}
|
||||
|
||||
void RfidWriter::write_bit(bool value) {
|
||||
|
Reference in New Issue
Block a user