tile_player.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #ifndef TILE_PLAYER_H
  22. #define TILE_PLAYER_H
  23. #include <stdint.h>
  24. #include <stdbool.h>
  25. extern uint8_t g_FindActivate_SongPlayed;
  26. #include "modules/tile_song_module.h"
  27. #include "boards.h"
  28. #define PIN_PIEZO ARDUINO_13_PIN
  29. #define GPIOTE_SOUND_CHANNEL ((nrf_timer_cc_channel_t) 0) /**< PPI channel to use for connecting timer to piezo output */
  30. #define PLAYER_TIMER_ID 1 /**< Timer ID to use with the player */
  31. void InitPlayer(void);
  32. void UninitPlayer(void);
  33. int PlaySong(uint8_t number, uint8_t strength, uint8_t duration);
  34. int StopSong(void);
  35. bool SongPlaying(void);
  36. void tile_boot_config_player(void);
  37. bool CheckFindSong(void);
  38. typedef struct song_info
  39. {
  40. const uint8_t *p_firstNote; // pointer to start of song
  41. const uint8_t *p_currentNote; // pointer to current note
  42. uint8_t duration;
  43. }song_t;
  44. #endif