unleashed-firmware/firmware/targets/furi-hal-include/furi-hal-bt.h

61 lines
1.4 KiB
C
Raw Normal View History

#pragma once
#include <m-string.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/** Initialize */
2021-08-08 18:03:25 +00:00
void furi_hal_bt_init();
/** Start BLE app */
2021-08-08 18:03:25 +00:00
bool furi_hal_bt_start_app();
/** Get BT/BLE system component state */
2021-08-08 18:03:25 +00:00
void furi_hal_bt_dump_state(string_t buffer);
/** Get BT/BLE system component state */
2021-08-08 18:03:25 +00:00
bool furi_hal_bt_is_alive();
/**
* Lock shared access to flash controller
* @return true if lock was successful, false if not
*/
2021-08-08 18:03:25 +00:00
bool furi_hal_bt_lock_flash();
/** Unlock shared access to flash controller */
2021-08-08 18:03:25 +00:00
void furi_hal_bt_unlock_flash();
/** Start ble tone tx at given channel and power */
2021-08-08 18:03:25 +00:00
void furi_hal_bt_start_tone_tx(uint8_t channel, uint8_t power);
/** Stop ble tone tx */
2021-08-08 18:03:25 +00:00
void furi_hal_bt_stop_tone_tx();
/** Start sending ble packets at a given frequency and datarate */
2021-08-08 18:03:25 +00:00
void furi_hal_bt_start_packet_tx(uint8_t channel, uint8_t pattern, uint8_t datarate);
/** Stop sending ble packets */
2021-08-08 18:03:25 +00:00
uint16_t furi_hal_bt_stop_packet_test();
/** Start receiving packets */
2021-08-08 18:03:25 +00:00
void furi_hal_bt_start_packet_rx(uint8_t channel, uint8_t datarate);
/** Set up the RF to listen to a given RF channel */
2021-08-08 18:03:25 +00:00
void furi_hal_bt_start_rx(uint8_t channel);
/** Stop RF listenning */
2021-08-08 18:03:25 +00:00
void furi_hal_bt_stop_rx();
/** Get RSSI */
2021-08-08 18:03:25 +00:00
float furi_hal_bt_get_rssi();
/** Get number of transmitted packets */
2021-08-08 18:03:25 +00:00
uint32_t furi_hal_bt_get_transmitted_packets();
#ifdef __cplusplus
}
#endif