loragw_sx1261.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. / _____) _ | |
  3. ( (____ _____ ____ _| |_ _____ ____| |__
  4. \____ \| ___ | (_ _) ___ |/ ___) _ \
  5. _____) ) ____| | | || |_| ____( (___| | | |
  6. (______/|_____)_|_|_| \__)_____)\____)_| |_|
  7. (C)2019 Semtech
  8. Description:
  9. Functions used to handle LoRa concentrator SX1261 radio used to handle LBT
  10. and Spectral Scan.
  11. License: Revised BSD License, see LICENSE.TXT file include in the project
  12. */
  13. #ifndef _LORAGW_SX1261_H
  14. #define _LORAGW_SX1261_H
  15. /* -------------------------------------------------------------------------- */
  16. /* --- DEPENDANCIES --------------------------------------------------------- */
  17. #include <stdint.h> /* C99 types*/
  18. #include <stdbool.h> /* bool type */
  19. #include "loragw_hal.h"
  20. #include "sx1261_defs.h"
  21. #include "config.h" /* library configuration options (dynamically generated) */
  22. /* -------------------------------------------------------------------------- */
  23. /* --- PUBLIC MACROS -------------------------------------------------------- */
  24. /* -------------------------------------------------------------------------- */
  25. /* --- PUBLIC CONSTANTS ----------------------------------------------------- */
  26. static const char sx1261_pram_version_string[] = "2D06";
  27. /* -------------------------------------------------------------------------- */
  28. /* --- PUBLIC TYPES --------------------------------------------------------- */
  29. /* -------------------------------------------------------------------------- */
  30. /* --- PUBLIC FUNCTIONS PROTOTYPES ------------------------------------------ */
  31. int sx1261_connect(lgw_com_type_t com_type, const char *com_path);
  32. int sx1261_disconnect(void);
  33. int sx1261_reg_w(sx1261_op_code_t op_code, uint8_t *data, uint16_t size);
  34. int sx1261_reg_r(sx1261_op_code_t op_code, uint8_t *data, uint16_t size);
  35. int sx1261_load_pram(void);
  36. int sx1261_calibrate(uint32_t freq_hz);
  37. int sx1261_setup(void);
  38. int sx1261_set_rx_params(uint32_t freq_hz, uint8_t bandwidth);
  39. int sx1261_lbt_start(lgw_lbt_scan_time_t scan_time_us, int8_t threshold_dbm);
  40. int sx1261_lbt_stop(void);
  41. int sx1261_spectral_scan_start(uint16_t nb_scan);
  42. int sx1261_spectral_scan_status(lgw_spectral_scan_status_t * status);
  43. int sx1261_spectral_scan_get_results(int8_t rssi_offset, int16_t * levels_dbm, uint16_t * results);
  44. int sx1261_spectral_scan_abort(void);
  45. #endif
  46. /* --- EOF ------------------------------------------------------------------ */