furi-hal-version.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /**
  2. * @file furi-hal-version.h
  3. * Version HAL API
  4. */
  5. #pragma once
  6. #include <stdbool.h>
  7. #include <stdint.h>
  8. #include <string.h>
  9. #include <lib/toolbox/version.h>
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /** Device Colors */
  14. typedef enum {
  15. FuriHalVersionColorUnknown=0x00,
  16. FuriHalVersionColorBlack=0x01,
  17. FuriHalVersionColorWhite=0x02,
  18. } FuriHalVersionColor;
  19. /** Device Regions */
  20. typedef enum {
  21. FuriHalVersionRegionUnknown=0x00,
  22. FuriHalVersionRegionEuRu=0x01,
  23. FuriHalVersionRegionUsCaAu=0x02,
  24. FuriHalVersionRegionJp=0x03,
  25. } FuriHalVersionRegion;
  26. /** Init flipper version
  27. */
  28. void furi_hal_version_init();
  29. /** Check target firmware version
  30. *
  31. * @return true if target and real matches
  32. */
  33. bool furi_hal_version_do_i_belong_here();
  34. /** Get model name
  35. *
  36. * @return model name C-string
  37. */
  38. const char* furi_hal_version_get_model_name();
  39. /** Get hardware version
  40. *
  41. * @return Hardware Version
  42. */
  43. const uint8_t furi_hal_version_get_hw_version();
  44. /** Get hardware target
  45. *
  46. * @return Hardware Target
  47. */
  48. const uint8_t furi_hal_version_get_hw_target();
  49. /** Get hardware body
  50. *
  51. * @return Hardware Body
  52. */
  53. const uint8_t furi_hal_version_get_hw_body();
  54. /** Get hardware body color
  55. *
  56. * @return Hardware Color
  57. */
  58. const FuriHalVersionColor furi_hal_version_get_hw_color();
  59. /** Get hardware connect
  60. *
  61. * @return Hardware Interconnect
  62. */
  63. const uint8_t furi_hal_version_get_hw_connect();
  64. /** Get hardware region
  65. *
  66. * @return Hardware Region
  67. */
  68. const FuriHalVersionRegion furi_hal_version_get_hw_region();
  69. /** Get hardware timestamp
  70. *
  71. * @return Hardware Manufacture timestamp
  72. */
  73. const uint32_t furi_hal_version_get_hw_timestamp();
  74. /** Get pointer to target name
  75. *
  76. * @return Hardware Name C-string
  77. */
  78. const char* furi_hal_version_get_name_ptr();
  79. /** Get pointer to target device name
  80. *
  81. * @return Hardware Device Name C-string
  82. */
  83. const char* furi_hal_version_get_device_name_ptr();
  84. /** Get pointer to target ble local device name
  85. *
  86. * @return Ble Device Name C-string
  87. */
  88. const char* furi_hal_version_get_ble_local_device_name_ptr();
  89. /** Get BLE MAC address
  90. *
  91. * @return pointer to BLE MAC address
  92. */
  93. const uint8_t* furi_hal_version_get_ble_mac();
  94. /** Get address of version structure of bootloader, stored in chip flash.
  95. *
  96. * @return Address of boot version structure.
  97. */
  98. const struct Version* furi_hal_version_get_boot_version();
  99. /** Get address of version structure of firmware.
  100. *
  101. * @return Address of firmware version structure.
  102. */
  103. const struct Version* furi_hal_version_get_firmware_version();
  104. /** Get platform UID size in bytes
  105. *
  106. * @return UID size in bytes
  107. */
  108. size_t furi_hal_version_uid_size();
  109. /** Get const pointer to UID
  110. *
  111. * @return pointer to UID
  112. */
  113. const uint8_t* furi_hal_version_uid();
  114. #ifdef __cplusplus
  115. }
  116. #endif