2021-10-03 10:36:05 +00:00
|
|
|
/**
|
|
|
|
* @file furi-hal-version.h
|
|
|
|
* Version HAL API
|
|
|
|
*/
|
|
|
|
|
2021-08-08 18:03:25 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <lib/toolbox/version.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/** Device Colors */
|
|
|
|
typedef enum {
|
|
|
|
FuriHalVersionColorUnknown=0x00,
|
|
|
|
FuriHalVersionColorBlack=0x01,
|
|
|
|
FuriHalVersionColorWhite=0x02,
|
|
|
|
} FuriHalVersionColor;
|
|
|
|
|
|
|
|
/** Device Regions */
|
|
|
|
typedef enum {
|
|
|
|
FuriHalVersionRegionUnknown=0x00,
|
|
|
|
FuriHalVersionRegionEuRu=0x01,
|
|
|
|
FuriHalVersionRegionUsCaAu=0x02,
|
|
|
|
FuriHalVersionRegionJp=0x03,
|
|
|
|
} FuriHalVersionRegion;
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Init flipper version
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
void furi_hal_version_init();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Check target firmware version
|
|
|
|
*
|
|
|
|
* @return true if target and real matches
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
bool furi_hal_version_do_i_belong_here();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get model name
|
|
|
|
*
|
|
|
|
* @return model name C-string
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
const char* furi_hal_version_get_model_name();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get hardware version
|
|
|
|
*
|
|
|
|
* @return Hardware Version
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
const uint8_t furi_hal_version_get_hw_version();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get hardware target
|
|
|
|
*
|
|
|
|
* @return Hardware Target
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
const uint8_t furi_hal_version_get_hw_target();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get hardware body
|
|
|
|
*
|
|
|
|
* @return Hardware Body
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
const uint8_t furi_hal_version_get_hw_body();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get hardware body color
|
|
|
|
*
|
|
|
|
* @return Hardware Color
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
const FuriHalVersionColor furi_hal_version_get_hw_color();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get hardware connect
|
|
|
|
*
|
|
|
|
* @return Hardware Interconnect
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
const uint8_t furi_hal_version_get_hw_connect();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get hardware region
|
|
|
|
*
|
|
|
|
* @return Hardware Region
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
const FuriHalVersionRegion furi_hal_version_get_hw_region();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get hardware timestamp
|
|
|
|
*
|
|
|
|
* @return Hardware Manufacture timestamp
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
const uint32_t furi_hal_version_get_hw_timestamp();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get pointer to target name
|
|
|
|
*
|
|
|
|
* @return Hardware Name C-string
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
const char* furi_hal_version_get_name_ptr();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get pointer to target device name
|
|
|
|
*
|
|
|
|
* @return Hardware Device Name C-string
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
const char* furi_hal_version_get_device_name_ptr();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get pointer to target ble local device name
|
|
|
|
*
|
|
|
|
* @return Ble Device Name C-string
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
const char* furi_hal_version_get_ble_local_device_name_ptr();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get BLE MAC address
|
|
|
|
*
|
|
|
|
* @return pointer to BLE MAC address
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
const uint8_t* furi_hal_version_get_ble_mac();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get address of version structure of bootloader, stored in chip flash.
|
2021-08-08 18:03:25 +00:00
|
|
|
*
|
2021-10-03 10:36:05 +00:00
|
|
|
* @return Address of boot version structure.
|
2021-08-08 18:03:25 +00:00
|
|
|
*/
|
2021-10-03 10:36:05 +00:00
|
|
|
const struct Version* furi_hal_version_get_boot_version();
|
2021-08-08 18:03:25 +00:00
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get address of version structure of firmware.
|
2021-08-08 18:03:25 +00:00
|
|
|
*
|
2021-10-03 10:36:05 +00:00
|
|
|
* @return Address of firmware version structure.
|
2021-08-08 18:03:25 +00:00
|
|
|
*/
|
2021-10-03 10:36:05 +00:00
|
|
|
const struct Version* furi_hal_version_get_firmware_version();
|
2021-08-08 18:03:25 +00:00
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get platform UID size in bytes
|
|
|
|
*
|
|
|
|
* @return UID size in bytes
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
size_t furi_hal_version_uid_size();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get const pointer to UID
|
|
|
|
*
|
|
|
|
* @return pointer to UID
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
const uint8_t* furi_hal_version_uid();
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|