sx1276_api.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef __SX1276_API_H__
  2. #define __SX1276_API_H__
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. #include "queue.h"
  6. //#define SX1276_API_DEBUG_EN 1
  7. #ifdef SX1276_API_DEBUG_EN
  8. #include <stdio.h>
  9. #define SX1276_API_DEBUG(fmt, x...) \
  10. do \
  11. { \
  12. printf(fmt,##x); \
  13. }while(0)
  14. #define SX1276_API_DEBUG1(fmt, x...) \
  15. do \
  16. { \
  17. printf("%s(Line %d): "fmt,__FUNCTION__,__LINE__, ##x); \
  18. }while(0)
  19. #define SX1276_API_DEBUG_F(fmt, x...) \
  20. do \
  21. { \
  22. printf("%s %s(Line %d): "fmt,__FILE__,__FUNCTION__,__LINE__, ##x); \
  23. }while(0)
  24. #else
  25. #define SX1276_API_DEBUG(fmt, x...)
  26. #define SX1276_API_DEBUG1(fmt, x...)
  27. #define SX1276_API_DEBUG_F(fmt, x...)
  28. #endif
  29. #define LoRa_SendTimeOut 60*1000
  30. extern uint32_t LoRa_SendTimeCouter;
  31. uint8_t SX1276_Send_Data(uint8_t * buffer,uint16_t bufferLen );
  32. int16_t SX1276_Read_Data( void *Buffer ,uint32_t Timeout, int8_t *snr,double *rssi );
  33. uint8_t SX1276_Send_Data_Listen_Ch(uint8_t * buffer,uint16_t bufferLen,uint32_t ldelay_ms,uint8_t num);
  34. bool SX1276IsLoraChannelFree( int16_t rssiThresh );
  35. double SX1276_Ambience_Rssi(void);
  36. void SX1276_Sleep(void);
  37. uint8_t SX1276_Cad_Listen(void);
  38. uint16_t SX1276_CAD_Task( void *Buffer ,uint32_t Timeout,int8_t *snr,int16_t *rssi );
  39. void SX1276_Read_Data_Sp(uint32_t Timeout );
  40. void SX1276_CAD_Start( void );
  41. void SX1276_Send_Data_Sp(uint8_t * buffer,uint16_t bufferLen );
  42. sequeue_t *SX1276_Send_sq_init(void);
  43. uint8_t SX1276_Send_sq(uint32_t ldelay_ms,uint8_t num);
  44. extern sequeue_t *lora_tx_sq;
  45. #endif // __RADIO_H__