2021-10-21 15:24:34 +03:00
|
|
|
/**
|
2022-01-05 19:10:18 +03:00
|
|
|
* @file furi_hal_version.h
|
2021-10-21 15:24:34 +03:00
|
|
|
* Version HAL API
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <lib/toolbox/version.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define FURI_HAL_VERSION_NAME_LENGTH 8
|
|
|
|
#define FURI_HAL_VERSION_ARRAY_NAME_LENGTH (FURI_HAL_VERSION_NAME_LENGTH + 1)
|
|
|
|
/** BLE symbol + "Flipper " + name */
|
|
|
|
#define FURI_HAL_VERSION_DEVICE_NAME_LENGTH (1 + 8 + FURI_HAL_VERSION_ARRAY_NAME_LENGTH)
|
|
|
|
|
|
|
|
/** OTP Versions enum */
|
|
|
|
typedef enum {
|
|
|
|
FuriHalVersionOtpVersion0 = 0x00,
|
|
|
|
FuriHalVersionOtpVersion1 = 0x01,
|
|
|
|
FuriHalVersionOtpVersion2 = 0x02,
|
|
|
|
FuriHalVersionOtpVersionEmpty = 0xFFFFFFFE,
|
|
|
|
FuriHalVersionOtpVersionUnknown = 0xFFFFFFFF,
|
|
|
|
} FuriHalVersionOtpVersion;
|
|
|
|
|
|
|
|
/** Device Colors */
|
|
|
|
typedef enum {
|
|
|
|
FuriHalVersionColorUnknown = 0x00,
|
|
|
|
FuriHalVersionColorBlack = 0x01,
|
|
|
|
FuriHalVersionColorWhite = 0x02,
|
2023-08-01 10:56:11 +03:00
|
|
|
FuriHalVersionColorTransparent = 0x03,
|
2021-10-21 15:24:34 +03:00
|
|
|
} FuriHalVersionColor;
|
|
|
|
|
|
|
|
/** Device Regions */
|
|
|
|
typedef enum {
|
|
|
|
FuriHalVersionRegionUnknown = 0x00,
|
|
|
|
FuriHalVersionRegionEuRu = 0x01,
|
|
|
|
FuriHalVersionRegionUsCaAu = 0x02,
|
|
|
|
FuriHalVersionRegionJp = 0x03,
|
2022-08-12 13:19:29 +03:00
|
|
|
FuriHalVersionRegionWorld = 0x04,
|
2021-10-21 15:24:34 +03:00
|
|
|
} FuriHalVersionRegion;
|
|
|
|
|
|
|
|
/** Device Display */
|
|
|
|
typedef enum {
|
|
|
|
FuriHalVersionDisplayUnknown = 0x00,
|
|
|
|
FuriHalVersionDisplayErc = 0x01,
|
|
|
|
FuriHalVersionDisplayMgg = 0x02,
|
|
|
|
} FuriHalVersionDisplay;
|
|
|
|
|
|
|
|
/** Init flipper version
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
void furi_hal_version_init(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Check target firmware version
|
|
|
|
*
|
|
|
|
* @return true if target and real matches
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
bool furi_hal_version_do_i_belong_here(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get model name
|
|
|
|
*
|
|
|
|
* @return model name C-string
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const char* furi_hal_version_get_model_name(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
2023-02-07 19:33:05 +03:00
|
|
|
/** Get model name
|
|
|
|
*
|
|
|
|
* @return model code C-string
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const char* furi_hal_version_get_model_code(void);
|
2023-02-07 19:33:05 +03:00
|
|
|
|
|
|
|
/** Get FCC ID
|
|
|
|
*
|
|
|
|
* @return FCC id as C-string
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const char* furi_hal_version_get_fcc_id(void);
|
2023-02-07 19:33:05 +03:00
|
|
|
|
|
|
|
/** Get IC id
|
|
|
|
*
|
|
|
|
* @return IC id as C-string
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const char* furi_hal_version_get_ic_id(void);
|
2023-02-07 19:33:05 +03:00
|
|
|
|
2023-07-10 09:48:00 +03:00
|
|
|
/** Get MIC id
|
|
|
|
*
|
|
|
|
* @return MIC id as C-string
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const char* furi_hal_version_get_mic_id(void);
|
2023-07-10 09:48:00 +03:00
|
|
|
|
2023-12-26 09:12:17 +03:00
|
|
|
/** Get SRRC id
|
|
|
|
*
|
|
|
|
* @return SRRC id as C-string
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const char* furi_hal_version_get_srrc_id(void);
|
2023-12-26 09:12:17 +03:00
|
|
|
|
|
|
|
/** Get NCC id
|
|
|
|
*
|
|
|
|
* @return NCC id as C-string
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const char* furi_hal_version_get_ncc_id(void);
|
2023-12-26 09:12:17 +03:00
|
|
|
|
2021-10-21 15:24:34 +03:00
|
|
|
/** Get OTP version
|
|
|
|
*
|
|
|
|
* @return OTP Version
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
FuriHalVersionOtpVersion furi_hal_version_get_otp_version(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get hardware version
|
|
|
|
*
|
|
|
|
* @return Hardware Version
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
uint8_t furi_hal_version_get_hw_version(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get hardware target
|
|
|
|
*
|
|
|
|
* @return Hardware Target
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
uint8_t furi_hal_version_get_hw_target(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get hardware body
|
|
|
|
*
|
|
|
|
* @return Hardware Body
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
uint8_t furi_hal_version_get_hw_body(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get hardware body color
|
|
|
|
*
|
|
|
|
* @return Hardware Color
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
FuriHalVersionColor furi_hal_version_get_hw_color(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get hardware connect
|
|
|
|
*
|
|
|
|
* @return Hardware Interconnect
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
uint8_t furi_hal_version_get_hw_connect(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get hardware region
|
|
|
|
*
|
|
|
|
* @return Hardware Region
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
FuriHalVersionRegion furi_hal_version_get_hw_region(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
2022-04-14 18:08:29 +03:00
|
|
|
/** Get hardware region name
|
|
|
|
*
|
|
|
|
* @return Hardware Region name
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const char* furi_hal_version_get_hw_region_name(void);
|
2022-04-14 18:08:29 +03:00
|
|
|
|
2021-10-21 15:24:34 +03:00
|
|
|
/** Get hardware display id
|
|
|
|
*
|
|
|
|
* @return Display id
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
FuriHalVersionDisplay furi_hal_version_get_hw_display(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get hardware timestamp
|
|
|
|
*
|
|
|
|
* @return Hardware Manufacture timestamp
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
uint32_t furi_hal_version_get_hw_timestamp(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get pointer to target name
|
|
|
|
*
|
|
|
|
* @return Hardware Name C-string
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const char* furi_hal_version_get_name_ptr(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get pointer to target device name
|
|
|
|
*
|
|
|
|
* @return Hardware Device Name C-string
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const char* furi_hal_version_get_device_name_ptr(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get pointer to target ble local device name
|
|
|
|
*
|
|
|
|
* @return Ble Device Name C-string
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const char* furi_hal_version_get_ble_local_device_name_ptr(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get BLE MAC address
|
|
|
|
*
|
|
|
|
* @return pointer to BLE MAC address
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const uint8_t* furi_hal_version_get_ble_mac(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get address of version structure of firmware.
|
|
|
|
*
|
|
|
|
* @return Address of firmware version structure.
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const struct Version* furi_hal_version_get_firmware_version(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get platform UID size in bytes
|
|
|
|
*
|
|
|
|
* @return UID size in bytes
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
size_t furi_hal_version_uid_size(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
/** Get const pointer to UID
|
|
|
|
*
|
|
|
|
* @return pointer to UID
|
|
|
|
*/
|
2024-03-19 17:43:52 +03:00
|
|
|
const uint8_t* furi_hal_version_uid(void);
|
2021-10-21 15:24:34 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|