[FL-2627] Flipper applications: SDK, build and debug system (#1387)
* Added support for running applications from SD card (FAPs - Flipper Application Packages) * Added plugin_dist target for fbt to build FAPs * All apps of type FlipperAppType.EXTERNAL and FlipperAppType.PLUGIN are built as FAPs by default * Updated VSCode configuration for new fbt features - re-deploy stock configuration to use them * Added debugging support for FAPs with fbt debug & VSCode * Added public firmware API with automated versioning Co-authored-by: hedger <hedger@users.noreply.github.com> Co-authored-by: SG <who.just.the.doctor@gmail.com> Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
Import("env")
|
||||
|
||||
env.Append(LINT_SOURCES=["firmware"])
|
||||
env.Append(
|
||||
LINT_SOURCES=["firmware"],
|
||||
# SDK_HEADERS=[env.File("#/firmware/targets/furi_hal_include/furi_hal.h")],
|
||||
SDK_HEADERS=[
|
||||
*env.GlobRecursive("*.h", "#/firmware/targets/furi_hal_include", "*_i.h"),
|
||||
*env.GlobRecursive("*.h", "#/firmware/targets/f${TARGET_HW}/furi_hal", "*_i.h"),
|
||||
File("#/firmware/targets/f7/platform_specific/intrinsic_export.h"),
|
||||
],
|
||||
)
|
||||
env.SetDefault(SDK_DEFINITION=env.File("./targets/f${TARGET_HW}/api_symbols.csv"))
|
||||
|
||||
|
||||
libenv = env.Clone(FW_LIB_NAME="flipper${TARGET_HW}")
|
||||
libenv.Append(
|
||||
|
2870
firmware/targets/f7/api_symbols.csv
Normal file
2870
firmware/targets/f7/api_symbols.csv
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,17 @@
|
||||
FORCE_COMMON_ALLOCATION
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text 0x00000000 :
|
||||
.text 0x00000000 : ALIGN(4)
|
||||
{
|
||||
*(.text)
|
||||
*(.stub)
|
||||
*(.text*)
|
||||
*(.text.*)
|
||||
*(.text._*)
|
||||
|
||||
KEEP (*(.init))
|
||||
KEEP (*(.fini))
|
||||
}
|
||||
|
||||
.rodata :
|
||||
@@ -20,15 +28,22 @@ SECTIONS
|
||||
*(.data.*)
|
||||
}
|
||||
|
||||
|
||||
.bss :
|
||||
{
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(.bss*)
|
||||
*(.sbss)
|
||||
*(.sbss.*)
|
||||
*(.sbss*)
|
||||
*(COMMON)
|
||||
}
|
||||
|
||||
.ARM.attributes :
|
||||
{
|
||||
*(.ARM.attributes)
|
||||
*(.ARM.attributes.*)
|
||||
}
|
||||
|
||||
/DISCARD/ :
|
||||
{
|
||||
*(.comment)
|
||||
|
@@ -1,5 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Early initialization */
|
||||
void furi_hal_clock_init_early();
|
||||
|
||||
@@ -20,3 +24,7 @@ void furi_hal_clock_suspend_tick();
|
||||
|
||||
/** Continue SysTick counter operation */
|
||||
void furi_hal_clock_resume_tick();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -4,6 +4,10 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define FURI_HAL_FLASH_OB_RAW_SIZE_BYTES 0x80
|
||||
#define FURI_HAL_FLASH_OB_SIZE_WORDS (FURI_HAL_FLASH_OB_RAW_SIZE_BYTES / sizeof(uint32_t))
|
||||
#define FURI_HAL_FLASH_OB_TOTAL_VALUES (FURI_HAL_FLASH_OB_SIZE_WORDS / 2)
|
||||
@@ -142,3 +146,7 @@ void furi_hal_flash_ob_apply();
|
||||
* @return pointer to read-only data of OB (raw + complementary values)
|
||||
*/
|
||||
const FuriHalFlashRawOptionByteData* furi_hal_flash_ob_get_raw_ptr();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -124,9 +124,9 @@ bool furi_hal_nfc_detect(FuriHalNfcDevData* nfc_data, uint32_t timeout) {
|
||||
}
|
||||
nfc_data->cuid = (cuid_start[0] << 24) | (cuid_start[1] << 16) | (cuid_start[2] << 8) |
|
||||
(cuid_start[3]);
|
||||
} else if(dev_list[0].type == RFAL_NFC_LISTEN_TYPE_NFCB ||
|
||||
dev_list[0].type == RFAL_NFC_LISTEN_TYPE_ST25TB)
|
||||
{
|
||||
} else if(
|
||||
dev_list[0].type == RFAL_NFC_LISTEN_TYPE_NFCB ||
|
||||
dev_list[0].type == RFAL_NFC_LISTEN_TYPE_ST25TB) {
|
||||
nfc_data->type = FuriHalNfcTypeB;
|
||||
} else if(dev_list[0].type == RFAL_NFC_LISTEN_TYPE_NFCF) {
|
||||
nfc_data->type = FuriHalNfcTypeF;
|
||||
@@ -738,3 +738,46 @@ void furi_hal_nfc_sleep() {
|
||||
rfalNfcDeactivate(false);
|
||||
rfalLowPowerModeStart();
|
||||
}
|
||||
|
||||
FuriHalNfcReturn furi_hal_nfc_ll_set_mode(FuriHalNfcMode mode, FuriHalNfcBitrate txBR, FuriHalNfcBitrate rxBR) {
|
||||
return rfalSetMode((rfalMode)mode, (rfalBitRate)txBR, (rfalBitRate)rxBR);
|
||||
}
|
||||
|
||||
void furi_hal_nfc_ll_set_error_handling(FuriHalNfcErrorHandling eHandling) {
|
||||
rfalSetErrorHandling((rfalEHandling)eHandling);
|
||||
}
|
||||
|
||||
void furi_hal_nfc_ll_set_guard_time(uint32_t cycles) {
|
||||
rfalSetGT(cycles);
|
||||
}
|
||||
|
||||
void furi_hal_nfc_ll_set_fdt_listen(uint32_t cycles) {
|
||||
rfalSetFDTListen(cycles);
|
||||
}
|
||||
|
||||
void furi_hal_nfc_ll_set_fdt_poll(uint32_t FDTPoll) {
|
||||
rfalSetFDTPoll(FDTPoll);
|
||||
}
|
||||
|
||||
void furi_hal_nfc_ll_txrx_on() {
|
||||
st25r3916TxRxOn();
|
||||
}
|
||||
|
||||
void furi_hal_nfc_ll_txrx_off() {
|
||||
st25r3916TxRxOff();
|
||||
}
|
||||
|
||||
FuriHalNfcReturn furi_hal_nfc_ll_txrx(
|
||||
uint8_t* txBuf,
|
||||
uint16_t txBufLen,
|
||||
uint8_t* rxBuf,
|
||||
uint16_t rxBufLen,
|
||||
uint16_t* actLen,
|
||||
uint32_t flags,
|
||||
uint32_t fwt) {
|
||||
return rfalTransceiveBlockingTxRx(txBuf, txBufLen, rxBuf, rxBufLen, actLen, flags, fwt);
|
||||
}
|
||||
|
||||
void furi_hal_nfc_ll_poll() {
|
||||
rfalWorker();
|
||||
}
|
@@ -17,7 +17,6 @@
|
||||
|
||||
#define TAG "FuriHalSubGhz"
|
||||
|
||||
|
||||
/*
|
||||
* Uncomment define to enable duplication of
|
||||
* IO GO0 CC1101 to an external comb.
|
||||
@@ -33,7 +32,7 @@
|
||||
* Attention this setting switches pin to output.
|
||||
* Make sure it is not connected directly to power or ground
|
||||
*/
|
||||
|
||||
|
||||
//#define SUBGHZ_DEBUG_CC1101_PIN gpio_ext_pa7
|
||||
#ifdef SUBGHZ_DEBUG_CC1101_PIN
|
||||
uint32_t subghz_debug_gpio_buff[2];
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "furi_hal_version.h"
|
||||
#include "furi_hal_usb_i.h"
|
||||
#include "furi_hal_usb.h"
|
||||
#include "furi_hal_usb_cdc_i.h"
|
||||
#include "furi_hal_usb_cdc.h"
|
||||
#include <furi.h>
|
||||
|
||||
#include "usb.h"
|
||||
|
@@ -5,6 +5,10 @@
|
||||
|
||||
#define CDC_DATA_SZ 64
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
void (*tx_ep_callback)(void* context);
|
||||
void (*rx_ep_callback)(void* context);
|
||||
@@ -22,3 +26,7 @@ uint8_t furi_hal_cdc_get_ctrl_line_state(uint8_t if_num);
|
||||
void furi_hal_cdc_send(uint8_t if_num, uint8_t* buf, uint16_t len);
|
||||
|
||||
int32_t furi_hal_cdc_receive(uint8_t if_num, uint8_t* buf, uint16_t max_len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
11
firmware/targets/f7/platform_specific/intrinsic_export.h
Normal file
11
firmware/targets/f7/platform_specific/intrinsic_export.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void __clear_cache(void*, void*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@@ -131,7 +131,7 @@ SECTIONS
|
||||
_sidata = LOADADDR(.data);
|
||||
|
||||
/* Initialized data sections goes into RAM, load LMA copy after code */
|
||||
.data :
|
||||
.data :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sdata = .; /* create a global symbol at data start */
|
||||
@@ -143,7 +143,6 @@ SECTIONS
|
||||
_edata = .; /* define a global symbol at data end */
|
||||
} >RAM1 AT> FLASH
|
||||
|
||||
|
||||
/* Uninitialized data section */
|
||||
. = ALIGN(4);
|
||||
.bss :
|
||||
@@ -161,7 +160,8 @@ SECTIONS
|
||||
} >RAM1
|
||||
|
||||
/* User_heap_stack section, used to check that there is enough RAM left */
|
||||
._user_heap_stack(NOLOAD):
|
||||
/* DSECT: https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_linker_special_section_types.html */
|
||||
._user_heap_stack(DSECT):
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__heap_start__ = .;
|
||||
@@ -172,11 +172,11 @@ SECTIONS
|
||||
} >RAM1
|
||||
|
||||
/* Free Flash space, that can be used for internal storage */
|
||||
.free_flash(NOLOAD):
|
||||
.free_flash(DSECT):
|
||||
{
|
||||
__free_flash_start__ = .;
|
||||
. = ORIGIN(FLASH) + LENGTH(FLASH);
|
||||
} >FLASH
|
||||
} >FLASH
|
||||
|
||||
/* Remove information from the standard libraries */
|
||||
/DISCARD/ :
|
||||
|
@@ -159,7 +159,7 @@ SECTIONS
|
||||
} >RAM1
|
||||
|
||||
/* User_heap_stack section, used to check that there is enough RAM left */
|
||||
._user_heap_stack :
|
||||
._user_heap_stack(DSECT) :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__heap_start__ = .;
|
||||
@@ -170,7 +170,7 @@ SECTIONS
|
||||
} >RAM1
|
||||
|
||||
/* Free Flash space, that can be used for internal storage */
|
||||
/*.free_flash(NOLOAD):
|
||||
/*.free_flash(DSECT):
|
||||
{
|
||||
__free_flash_start__ = .;
|
||||
. = ORIGIN(FLASH) + LENGTH(FLASH);
|
||||
|
@@ -6,7 +6,8 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <unsigned int N> struct STOP_EXTERNING_ME {};
|
||||
template <unsigned int N>
|
||||
struct STOP_EXTERNING_ME {};
|
||||
#endif
|
||||
|
||||
#include "furi_hal_cortex.h"
|
||||
|
@@ -3,6 +3,10 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Start Hid Keyboard Profile
|
||||
*/
|
||||
void furi_hal_bt_hid_start();
|
||||
@@ -81,3 +85,7 @@ bool furi_hal_bt_hid_consumer_key_release(uint16_t button);
|
||||
* @param button key code
|
||||
*/
|
||||
bool furi_hal_bt_hid_consumer_key_release_all();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -2,6 +2,10 @@
|
||||
|
||||
#include "serial_service.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define FURI_HAL_BT_SERIAL_PACKET_SIZE_MAX SERIAL_SVC_DATA_LEN_MAX
|
||||
|
||||
/** Serial service callback type */
|
||||
@@ -38,3 +42,7 @@ void furi_hal_bt_serial_notify_buffer_is_empty();
|
||||
* @return true on success
|
||||
*/
|
||||
bool furi_hal_bt_serial_tx(uint8_t* data, uint16_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -8,6 +8,10 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Defines encoder and decoder window size */
|
||||
#define FURI_HAL_COMPRESS_EXP_BUFF_SIZE_LOG (8)
|
||||
|
||||
@@ -77,3 +81,7 @@ bool furi_hal_compress_decode(
|
||||
uint8_t* data_out,
|
||||
size_t data_out_size,
|
||||
size_t* data_res_size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -8,6 +8,10 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** FuriHalCryptoKey Type */
|
||||
typedef enum {
|
||||
FuriHalCryptoKeyTypeMaster, /**< Master key */
|
||||
@@ -82,3 +86,7 @@ bool furi_hal_crypto_encrypt(const uint8_t* input, uint8_t* output, size_t size)
|
||||
* @return true on success
|
||||
*/
|
||||
bool furi_hal_crypto_decrypt(const uint8_t* input, uint8_t* output, size_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -5,16 +5,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rfal_nfc.h>
|
||||
#include <st_errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <lib/nfc/protocols/nfca.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <rfal_nfc.h>
|
||||
#include <lib/nfc/protocols/nfca.h>
|
||||
|
||||
#define FURI_HAL_NFC_UID_MAX_LEN 10
|
||||
#define FURI_HAL_NFC_DATA_BUFF_SIZE (512)
|
||||
@@ -229,6 +228,158 @@ void furi_hal_nfc_sleep();
|
||||
|
||||
void furi_hal_nfc_stop();
|
||||
|
||||
|
||||
/* Low level transport API, use it to implement your own transport layers */
|
||||
|
||||
#define furi_hal_nfc_ll_ms2fc rfalConvMsTo1fc
|
||||
|
||||
#define FURI_HAL_NFC_LL_TXRX_FLAGS_CRC_TX_MANUAL RFAL_TXRX_FLAGS_CRC_TX_MANUAL
|
||||
#define FURI_HAL_NFC_LL_TXRX_FLAGS_AGC_ON RFAL_TXRX_FLAGS_AGC_ON
|
||||
#define FURI_HAL_NFC_LL_TXRX_FLAGS_PAR_RX_REMV RFAL_TXRX_FLAGS_PAR_RX_REMV
|
||||
#define FURI_HAL_NFC_LL_TXRX_FLAGS_CRC_RX_KEEP RFAL_TXRX_FLAGS_CRC_RX_KEEP
|
||||
|
||||
typedef enum {
|
||||
FuriHalNfcReturnOk = 0, /*!< no error occurred */
|
||||
FuriHalNfcReturnNomem = 1, /*!< not enough memory to perform the requested operation */
|
||||
FuriHalNfcReturnBusy = 2, /*!< device or resource busy */
|
||||
FuriHalNfcReturnIo = 3, /*!< generic IO error */
|
||||
FuriHalNfcReturnTimeout = 4, /*!< error due to timeout */
|
||||
FuriHalNfcReturnRequest = 5, /*!< invalid request or requested function can't be executed at the moment */
|
||||
FuriHalNfcReturnNomsg = 6, /*!< No message of desired type */
|
||||
FuriHalNfcReturnParam = 7, /*!< Parameter error */
|
||||
FuriHalNfcReturnSystem = 8, /*!< System error */
|
||||
FuriHalNfcReturnFraming = 9, /*!< Framing error */
|
||||
FuriHalNfcReturnOverrun = 10, /*!< lost one or more received bytes */
|
||||
FuriHalNfcReturnProto = 11, /*!< protocol error */
|
||||
FuriHalNfcReturnInternal = 12, /*!< Internal Error */
|
||||
FuriHalNfcReturnAgain = 13, /*!< Call again */
|
||||
FuriHalNfcReturnMemCorrupt = 14, /*!< memory corruption */
|
||||
FuriHalNfcReturnNotImplemented = 15, /*!< not implemented */
|
||||
FuriHalNfcReturnPcCorrupt = 16, /*!< Program Counter has been manipulated or spike/noise trigger illegal operation */
|
||||
FuriHalNfcReturnSend = 17, /*!< error sending*/
|
||||
FuriHalNfcReturnIgnore = 18, /*!< indicates error detected but to be ignored */
|
||||
FuriHalNfcReturnSemantic = 19, /*!< indicates error in state machine (unexpected cmd) */
|
||||
FuriHalNfcReturnSyntax = 20, /*!< indicates error in state machine (unknown cmd) */
|
||||
FuriHalNfcReturnCrc = 21, /*!< crc error */
|
||||
FuriHalNfcReturnNotfound = 22, /*!< transponder not found */
|
||||
FuriHalNfcReturnNotunique = 23, /*!< transponder not unique - more than one transponder in field */
|
||||
FuriHalNfcReturnNotsupp = 24, /*!< requested operation not supported */
|
||||
FuriHalNfcReturnWrite = 25, /*!< write error */
|
||||
FuriHalNfcReturnFifo = 26, /*!< fifo over or underflow error */
|
||||
FuriHalNfcReturnPar = 27, /*!< parity error */
|
||||
FuriHalNfcReturnDone = 28, /*!< transfer has already finished */
|
||||
FuriHalNfcReturnRfCollision = 29, /*!< collision error (Bit Collision or during RF Collision avoidance ) */
|
||||
FuriHalNfcReturnHwOverrun = 30, /*!< lost one or more received bytes */
|
||||
FuriHalNfcReturnReleaseReq = 31, /*!< device requested release */
|
||||
FuriHalNfcReturnSleepReq = 32, /*!< device requested sleep */
|
||||
FuriHalNfcReturnWrongState = 33, /*!< incorrent state for requested operation */
|
||||
FuriHalNfcReturnMaxReruns = 34, /*!< blocking procedure reached maximum runs */
|
||||
FuriHalNfcReturnDisabled = 35, /*!< operation aborted due to disabled configuration */
|
||||
FuriHalNfcReturnHwMismatch = 36, /*!< expected hw do not match */
|
||||
FuriHalNfcReturnLinkLoss = 37, /*!< Other device's field didn't behave as expected: turned off by Initiator in Passive mode, or AP2P did not turn on field */
|
||||
FuriHalNfcReturnInvalidHandle = 38, /*!< invalid or not initalized device handle */
|
||||
FuriHalNfcReturnIncompleteByte = 40, /*!< Incomplete byte rcvd */
|
||||
FuriHalNfcReturnIncompleteByte01 = 41, /*!< Incomplete byte rcvd - 1 bit */
|
||||
FuriHalNfcReturnIncompleteByte02 = 42, /*!< Incomplete byte rcvd - 2 bit */
|
||||
FuriHalNfcReturnIncompleteByte03 = 43, /*!< Incomplete byte rcvd - 3 bit */
|
||||
FuriHalNfcReturnIncompleteByte04 = 44, /*!< Incomplete byte rcvd - 4 bit */
|
||||
FuriHalNfcReturnIncompleteByte05 = 45, /*!< Incomplete byte rcvd - 5 bit */
|
||||
FuriHalNfcReturnIncompleteByte06 = 46, /*!< Incomplete byte rcvd - 6 bit */
|
||||
FuriHalNfcReturnIncompleteByte07 = 47, /*!< Incomplete byte rcvd - 7 bit */
|
||||
} FuriHalNfcReturn;
|
||||
|
||||
typedef enum {
|
||||
FuriHalNfcModeNone = 0, /*!< No mode selected/defined */
|
||||
FuriHalNfcModePollNfca = 1, /*!< Mode to perform as NFCA (ISO14443A) Poller (PCD) */
|
||||
FuriHalNfcModePollNfcaT1t = 2, /*!< Mode to perform as NFCA T1T (Topaz) Poller (PCD) */
|
||||
FuriHalNfcModePollNfcb = 3, /*!< Mode to perform as NFCB (ISO14443B) Poller (PCD) */
|
||||
FuriHalNfcModePollBPrime = 4, /*!< Mode to perform as B' Calypso (Innovatron) (PCD) */
|
||||
FuriHalNfcModePollBCts = 5, /*!< Mode to perform as CTS Poller (PCD) */
|
||||
FuriHalNfcModePollNfcf = 6, /*!< Mode to perform as NFCF (FeliCa) Poller (PCD) */
|
||||
FuriHalNfcModePollNfcv = 7, /*!< Mode to perform as NFCV (ISO15963) Poller (PCD) */
|
||||
FuriHalNfcModePollPicopass = 8, /*!< Mode to perform as PicoPass / iClass Poller (PCD) */
|
||||
FuriHalNfcModePollActiveP2p = 9, /*!< Mode to perform as Active P2P (ISO18092) Initiator */
|
||||
FuriHalNfcModeListenNfca = 10, /*!< Mode to perform as NFCA (ISO14443A) Listener (PICC) */
|
||||
FuriHalNfcModeListenNfcb = 11, /*!< Mode to perform as NFCA (ISO14443B) Listener (PICC) */
|
||||
FuriHalNfcModeListenNfcf = 12, /*!< Mode to perform as NFCA (ISO15963) Listener (PICC) */
|
||||
FuriHalNfcModeListenActiveP2p = 13 /*!< Mode to perform as Active P2P (ISO18092) Target */
|
||||
} FuriHalNfcMode;
|
||||
|
||||
typedef enum {
|
||||
FuriHalNfcBitrate106 = 0, /*!< Bit Rate 106 kbit/s (fc/128) */
|
||||
FuriHalNfcBitrate212 = 1, /*!< Bit Rate 212 kbit/s (fc/64) */
|
||||
FuriHalNfcBitrate424 = 2, /*!< Bit Rate 424 kbit/s (fc/32) */
|
||||
FuriHalNfcBitrate848 = 3, /*!< Bit Rate 848 kbit/s (fc/16) */
|
||||
FuriHalNfcBitrate1695 = 4, /*!< Bit Rate 1695 kbit/s (fc/8) */
|
||||
FuriHalNfcBitrate3390 = 5, /*!< Bit Rate 3390 kbit/s (fc/4) */
|
||||
FuriHalNfcBitrate6780 = 6, /*!< Bit Rate 6780 kbit/s (fc/2) */
|
||||
FuriHalNfcBitrate13560 = 7, /*!< Bit Rate 13560 kbit/s (fc) */
|
||||
FuriHalNfcBitrate52p97 = 0xEB, /*!< Bit Rate 52.97 kbit/s (fc/256) Fast Mode VICC->VCD */
|
||||
FuriHalNfcBitrate26p48 = 0xEC, /*!< Bit Rate 26,48 kbit/s (fc/512) NFCV VICC->VCD & VCD->VICC 1of4 */
|
||||
FuriHalNfcBitrate1p66 = 0xED, /*!< Bit Rate 1,66 kbit/s (fc/8192) NFCV VCD->VICC 1of256 */
|
||||
FuriHalNfcBitrateKeep = 0xFF /*!< Value indicating to keep the same previous bit rate */
|
||||
} FuriHalNfcBitrate;
|
||||
|
||||
FuriHalNfcReturn furi_hal_nfc_ll_set_mode(FuriHalNfcMode mode, FuriHalNfcBitrate txBR, FuriHalNfcBitrate rxBR);
|
||||
|
||||
#define FURI_HAL_NFC_LL_GT_NFCA furi_hal_nfc_ll_ms2fc(5U) /*!< GTA Digital 2.0 6.10.4.1 & B.2 */
|
||||
#define FURI_HAL_NFC_LL_GT_NFCB furi_hal_nfc_ll_ms2fc(5U) /*!< GTB Digital 2.0 7.9.4.1 & B.3 */
|
||||
#define FURI_HAL_NFC_LL_GT_NFCF furi_hal_nfc_ll_ms2fc(20U) /*!< GTF Digital 2.0 8.7.4.1 & B.4 */
|
||||
#define FURI_HAL_NFC_LL_GT_NFCV furi_hal_nfc_ll_ms2fc(5U) /*!< GTV Digital 2.0 9.7.5.1 & B.5 */
|
||||
#define FURI_HAL_NFC_LL_GT_PICOPASS furi_hal_nfc_ll_ms2fc(1U) /*!< GT Picopass */
|
||||
#define FURI_HAL_NFC_LL_GT_AP2P furi_hal_nfc_ll_ms2fc(5U) /*!< TIRFG Ecma 340 11.1.1 */
|
||||
#define FURI_HAL_NFC_LL_GT_AP2P_ADJUSTED furi_hal_nfc_ll_ms2fc(5U + 25U) /*!< Adjusted GT for greater interoperability (Sony XPERIA P, Nokia N9, Huawei P2) */
|
||||
|
||||
void furi_hal_nfc_ll_set_guard_time(uint32_t cycles);
|
||||
|
||||
typedef enum {
|
||||
FuriHalNfcErrorHandlingNone = 0, /*!< No special error handling will be performed */
|
||||
FuriHalNfcErrorHandlingNfc = 1, /*!< Error handling set to perform as NFC compliant device */
|
||||
FuriHalNfcErrorHandlingEmvco = 2 /*!< Error handling set to perform as EMVCo compliant device */
|
||||
} FuriHalNfcErrorHandling;
|
||||
|
||||
void furi_hal_nfc_ll_set_error_handling(FuriHalNfcErrorHandling eHandling);
|
||||
|
||||
/* RFAL Frame Delay Time (FDT) Listen default values */
|
||||
#define FURI_HAL_NFC_LL_FDT_LISTEN_NFCA_POLLER 1172U /*!< FDTA,LISTEN,MIN (n=9) Last bit: Logic "1" - tnn,min/2 Digital 1.1 6.10 ; EMV CCP Spec Book D v2.01 4.8.1.3 */
|
||||
#define FURI_HAL_NFC_LL_FDT_LISTEN_NFCB_POLLER 1008U /*!< TR0B,MIN Digital 1.1 7.1.3 & A.3 ; EMV CCP Spec Book D v2.01 4.8.1.3 & Table A.5 */
|
||||
#define FURI_HAL_NFC_LL_FDT_LISTEN_NFCF_POLLER 2672U /*!< TR0F,LISTEN,MIN Digital 1.1 8.7.1.1 & A.4 */
|
||||
#define FURI_HAL_NFC_LL_FDT_LISTEN_NFCV_POLLER 4310U /*!< FDTV,LISTEN,MIN t1 min Digital 2.1 B.5 ; ISO15693-3 2009 9.1 */
|
||||
#define FURI_HAL_NFC_LL_FDT_LISTEN_PICOPASS_POLLER 3400U /*!< ISO15693 t1 min - observed adjustment */
|
||||
#define FURI_HAL_NFC_LL_FDT_LISTEN_AP2P_POLLER 64U /*!< FDT AP2P No actual FDTListen is required as fields switch and collision avoidance */
|
||||
#define FURI_HAL_NFC_LL_FDT_LISTEN_NFCA_LISTENER 1172U /*!< FDTA,LISTEN,MIN Digital 1.1 6.10 */
|
||||
#define FURI_HAL_NFC_LL_FDT_LISTEN_NFCB_LISTENER 1024U /*!< TR0B,MIN Digital 1.1 7.1.3 & A.3 ; EMV CCP Spec Book D v2.01 4.8.1.3 & Table A.5 */
|
||||
#define FURI_HAL_NFC_LL_FDT_LISTEN_NFCF_LISTENER 2688U /*!< TR0F,LISTEN,MIN Digital 2.1 8.7.1.1 & B.4 */
|
||||
#define FURI_HAL_NFC_LL_FDT_LISTEN_AP2P_LISTENER 64U /*!< FDT AP2P No actual FDTListen exists as fields switch and collision avoidance */
|
||||
|
||||
void furi_hal_nfc_ll_set_fdt_listen(uint32_t cycles);
|
||||
|
||||
/* RFAL Frame Delay Time (FDT) Poll default values */
|
||||
#define FURI_HAL_NFC_LL_FDT_POLL_NFCA_POLLER 6780U /*!< FDTA,POLL,MIN Digital 1.1 6.10.3.1 & A.2 */
|
||||
#define FURI_HAL_NFC_LL_FDT_POLL_NFCA_T1T_POLLER 384U /*!< RRDDT1T,MIN,B1 Digital 1.1 10.7.1 & A.5 */
|
||||
#define FURI_HAL_NFC_LL_FDT_POLL_NFCB_POLLER 6780U /*!< FDTB,POLL,MIN = TR2B,MIN,DEFAULT Digital 1.1 7.9.3 & A.3 ; EMVCo 3.0 FDTB,PCD,MIN Table A.5 */
|
||||
#define FURI_HAL_NFC_LL_FDT_POLL_NFCF_POLLER 6800U /*!< FDTF,POLL,MIN Digital 2.1 8.7.3 & B.4 */
|
||||
#define FURI_HAL_NFC_LL_FDT_POLL_NFCV_POLLER 4192U /*!< FDTV,POLL Digital 2.1 9.7.3.1 & B.5 */
|
||||
#define FURI_HAL_NFC_LL_FDT_POLL_PICOPASS_POLLER 1790U /*!< FDT Max */
|
||||
#define FURI_HAL_NFC_LL_FDT_POLL_AP2P_POLLER 0U /*!< FDT AP2P No actual FDTPoll exists as fields switch and collision avoidance */
|
||||
|
||||
void furi_hal_nfc_ll_set_fdt_poll(uint32_t FDTPoll);
|
||||
|
||||
void furi_hal_nfc_ll_txrx_on();
|
||||
|
||||
void furi_hal_nfc_ll_txrx_off();
|
||||
|
||||
FuriHalNfcReturn furi_hal_nfc_ll_txrx(
|
||||
uint8_t* txBuf,
|
||||
uint16_t txBufLen,
|
||||
uint8_t* rxBuf,
|
||||
uint16_t rxBufLen,
|
||||
uint16_t* actLen,
|
||||
uint32_t flags,
|
||||
uint32_t fwt);
|
||||
|
||||
void furi_hal_nfc_ll_poll();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -4,6 +4,10 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
uint32_t start;
|
||||
uint32_t end;
|
||||
@@ -71,3 +75,7 @@ bool furi_hal_region_is_frequency_allowed(uint32_t frequency);
|
||||
* @return { description_of_the_return_value }
|
||||
*/
|
||||
const FuriHalRegionBand* furi_hal_region_get_band(uint32_t frequency);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -2,6 +2,10 @@
|
||||
|
||||
#include "usb.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct FuriHalUsbInterface FuriHalUsbInterface;
|
||||
|
||||
struct FuriHalUsbInterface {
|
||||
@@ -81,3 +85,7 @@ void furi_hal_usb_set_state_callback(FuriHalUsbStateCallback cb, void* ctx);
|
||||
/** Restart USB device
|
||||
*/
|
||||
void furi_hal_usb_reinit();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -5,6 +5,10 @@
|
||||
#include "hid_usage_consumer.h"
|
||||
#include "hid_usage_led.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define HID_KEYBOARD_NONE 0x00
|
||||
// Remapping the colon key which is shift + ; to comma
|
||||
#define HID_KEYBOARD_COMMA HID_KEYBOARD_COLON
|
||||
@@ -251,3 +255,7 @@ bool furi_hal_hid_consumer_key_press(uint16_t button);
|
||||
* @param button key code
|
||||
*/
|
||||
bool furi_hal_hid_consumer_key_release(uint16_t button);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,5 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define HID_U2F_PACKET_LEN 64
|
||||
|
||||
typedef enum {
|
||||
@@ -34,3 +38,7 @@ uint32_t furi_hal_hid_u2f_get_request(uint8_t* data);
|
||||
* @param len packet length
|
||||
*/
|
||||
void furi_hal_hid_u2f_send_response(uint8_t* data, uint8_t len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user