tile_features.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /**
  2. * NOTICE
  3. *
  4. * Copyright 2020 Tile Inc. All Rights Reserved.
  5. * All code or other information included in the accompanying files ("Tile Source Material")
  6. * is PROPRIETARY information of Tile Inc. ("Tile") and access and use of the Tile Source Material
  7. * is subject to these terms. The Tile Source Material may only be used for demonstration purposes,
  8. * and may not be otherwise distributed or made available to others, including for commercial purposes.
  9. * Without limiting the foregoing , you understand and agree that no production use
  10. * of the Tile Source Material is allowed without a Tile ID properly obtained under a separate
  11. * agreement with Tile.
  12. * You also understand and agree that Tile may terminate the limited rights granted under these terms
  13. * at any time in its discretion.
  14. * All Tile Source Material is provided AS-IS without warranty of any kind.
  15. * Tile does not warrant that the Tile Source Material will be error-free or fit for your purposes.
  16. * Tile will not be liable for any damages resulting from your use of or inability to use
  17. * the Tile Source Material.
  18. *
  19. * Support: firmware_support@tile.com
  20. */
  21. /**
  22. * @file tile_features.h
  23. * @brief Support for features in Tile Lib
  24. */
  25. #ifndef TILE_FEATURES_H_
  26. #define TILE_FEATURES_H_
  27. #include "app_timer.h"
  28. #include "tile_gatt_db/tile_gatt_db.h"
  29. #include "drivers/tile_timer_driver.h"
  30. #include "modules/tile_test_module.h"
  31. typedef struct
  32. {
  33. tile_gatt_db_t service;
  34. uint16_t conn_handle;
  35. } tile_ble_env_t;
  36. enum CUSTOM_EVENTS
  37. {
  38. NOTIFICATION_WRITTEN_EVT
  39. };
  40. struct my_evt
  41. {
  42. uint8_t type;
  43. };
  44. enum TILE_APP_TEST_CMDS
  45. {
  46. TEST_CMD_REBOOT = TILE_TEST_MODULE_CODE_BASE,
  47. TEST_CMD_STORAGE,
  48. };
  49. /**
  50. * @brief Types of reboots which can be triggered by \ref TEST_CMD_REBOOT
  51. */
  52. enum TEST_REBOOT
  53. {
  54. TEST_CMD_REBOOT_RESET = 0x00,
  55. TEST_CMD_REBOOT_WATCHDOG = 0x01,
  56. TEST_CMD_REBOOT_MEMORY_FAULT = 0x02,
  57. TEST_CMD_REBOOT_OTHER = 0x03,
  58. TEST_CMD_REBOOT_ASSERT = 0x04,
  59. TEST_CMD_REBOOT_DURING_FLASH = 0x05,
  60. };
  61. extern tile_ble_env_t tile_ble_env;
  62. extern app_timer_id_t tile_timer_id[TILE_MAX_TIMERS];
  63. void tile_features_init(void);
  64. void tile_button_was_pressed(void);
  65. int tile_read_button_state(uint8_t *button_state);
  66. void tile_update_tileID_char(void);
  67. #endif