api-hal-bt.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #include <m-string.h>
  3. #include <stdbool.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /** Initialize */
  8. void api_hal_bt_init();
  9. /** Start BLE app */
  10. bool api_hal_bt_start_app();
  11. /** Get BT/BLE system component state */
  12. void api_hal_bt_dump_state(string_t buffer);
  13. /** Get BT/BLE system component state */
  14. bool api_hal_bt_is_alive();
  15. /**
  16. * Lock shared access to flash controller
  17. * @return true if lock was successful, false if not
  18. */
  19. bool api_hal_bt_lock_flash();
  20. /** Unlock shared access to flash controller */
  21. void api_hal_bt_unlock_flash();
  22. /** Start ble tone tx at given channel and power */
  23. void api_hal_bt_start_tone_tx(uint8_t tx_channel, uint8_t power);
  24. /** Stop ble tone tx */
  25. void api_hal_bt_stop_tone_tx();
  26. /** Start sending ble packets at a given frequency and datarate */
  27. void api_hal_bt_start_packet_tx(uint8_t frequency, uint8_t datarate);
  28. /** Stop sending ble packets */
  29. void api_hal_bt_stop_packet_tx();
  30. /** Set up the RF to listen to a given RF channel */
  31. void api_hal_bt_start_rx(uint8_t frequency);
  32. /** Stop RF listenning */
  33. void api_hal_bt_stop_rx();
  34. #ifdef __cplusplus
  35. }
  36. #endif