api-hal-version.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #pragma once
  2. #include <stdbool.h>
  3. #include <stdint.h>
  4. #include <string.h>
  5. #include <version.h>
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. /** Device Colors */
  10. typedef enum {
  11. ApiHalVersionColorUnknown=0x00,
  12. ApiHalVersionColorBlack=0x01,
  13. ApiHalVersionColorWhite=0x02,
  14. } ApiHalVersionColor;
  15. /** Device Regions */
  16. typedef enum {
  17. ApiHalVersionRegionUnknown=0x00,
  18. ApiHalVersionRegionEuRu=0x01,
  19. ApiHalVersionRegionUsCaAu=0x02,
  20. ApiHalVersionRegionJp=0x03,
  21. } ApiHalVersionRegion;
  22. /** Init flipper version */
  23. void api_hal_version_init();
  24. /** Check target firmware version */
  25. bool api_hal_version_do_i_belong_here();
  26. /** Get model name */
  27. const char* api_hal_version_get_model_name();
  28. /** Get hardware version */
  29. const uint8_t api_hal_version_get_hw_version();
  30. /** Get hardware target */
  31. const uint8_t api_hal_version_get_hw_target();
  32. /** Get hardware body */
  33. const uint8_t api_hal_version_get_hw_body();
  34. /** Get hardware body color */
  35. const ApiHalVersionColor api_hal_version_get_hw_color();
  36. /** Get hardware connect */
  37. const uint8_t api_hal_version_get_hw_connect();
  38. /** Get hardware region */
  39. const ApiHalVersionRegion api_hal_version_get_hw_region();
  40. /** Get hardware timestamp */
  41. const uint32_t api_hal_version_get_hw_timestamp();
  42. /** Get pointer to target name */
  43. const char* api_hal_version_get_name_ptr();
  44. /** Get pointer to target device name */
  45. const char* api_hal_version_get_device_name_ptr();
  46. /** Get pointer to target ble local device name */
  47. const char* api_hal_version_get_ble_local_device_name_ptr();
  48. const uint8_t* api_hal_version_get_ble_mac();
  49. /**
  50. * Get address of version structure of bootloader, stored in chip flash.
  51. *
  52. * @return Address of boot version structure.
  53. */
  54. const struct Version* api_hal_version_get_boot_version(void);
  55. /**
  56. * Get address of version structure of firmware.
  57. *
  58. * @return Address of firmware version structure.
  59. */
  60. const struct Version* api_hal_version_get_firmware_version(void);
  61. /** Get platform UID size in bytes */
  62. size_t api_hal_version_uid_size();
  63. /** Get const pointer to UID */
  64. const uint8_t* api_hal_version_uid();
  65. #ifdef __cplusplus
  66. }
  67. #endif