sx1280-hal.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*
  2. ______ _
  3. / _____) _ | |
  4. ( (____ _____ ____ _| |_ _____ ____| |__
  5. \____ \| ___ | (_ _) ___ |/ ___) _ \
  6. _____) ) ____| | | || |_| ____( (___| | | |
  7. (______/|_____)_|_|_| \__)_____)\____)_| |_|
  8. (C)2015 Semtech
  9. Description: Handling of the node configuration protocol
  10. License: Revised BSD License, see LICENSE.TXT file include in the project
  11. Maintainer: Miguel Luis and Gregory Cristian
  12. */
  13. #ifndef __SX1280_HAL_H__
  14. #define __SX1280_HAL_H__
  15. #include "sx1280.h"
  16. #include "sx1280-hal.h"
  17. void SX1280HalWaitOnBusy( void );
  18. void SX1280HalInit( DioIrqHandler **irqHandlers );
  19. void SX1280HalIoInit( void );
  20. /*!
  21. * \brief Soft resets the radio
  22. */
  23. void SX1280HalReset( void );
  24. /*!
  25. * \brief Clears the instruction ram memory block
  26. */
  27. void SX1280HalClearInstructionRam( void );
  28. /*!
  29. * \brief Wakes up the radio
  30. */
  31. void SX1280HalWakeup( void );
  32. /*!
  33. * \brief Send a command that write data to the radio
  34. *
  35. * \param [in] opcode Opcode of the command
  36. * \param [in] buffer Buffer to be send to the radio
  37. * \param [in] size Size of the buffer to send
  38. */
  39. void SX1280HalWriteCommand( RadioCommands_t opcode, uint8_t *buffer, uint16_t size );
  40. /*!
  41. * \brief Send a command that read data from the radio
  42. *
  43. * \param [in] opcode Opcode of the command
  44. * \param [out] buffer Buffer holding data from the radio
  45. * \param [in] size Size of the buffer
  46. */
  47. void SX1280HalReadCommand( RadioCommands_t opcode, uint8_t *buffer, uint16_t size );
  48. /*!
  49. * \brief Write data to the radio memory
  50. *
  51. * \param [in] address The address of the first byte to write in the radio
  52. * \param [in] buffer The data to be written in radio's memory
  53. * \param [in] size The number of bytes to write in radio's memory
  54. */
  55. void SX1280HalWriteRegisters( uint16_t address, uint8_t *buffer, uint16_t size );
  56. /*!
  57. * \brief Write a single byte of data to the radio memory
  58. *
  59. * \param [in] address The address of the first byte to write in the radio
  60. * \param [in] value The data to be written in radio's memory
  61. */
  62. void SX1280HalWriteRegister( uint16_t address, uint8_t value );
  63. /*!
  64. * \brief Read data from the radio memory
  65. *
  66. * \param [in] address The address of the first byte to read from the radio
  67. * \param [out] buffer The buffer that holds data read from radio
  68. * \param [in] size The number of bytes to read from radio's memory
  69. */
  70. void SX1280HalReadRegisters( uint16_t address, uint8_t *buffer, uint16_t size );
  71. /*!
  72. * \brief Read a single byte of data from the radio memory
  73. *
  74. * \param [in] address The address of the first byte to write in the
  75. * radio
  76. *
  77. * \retval value The value of the byte at the given address in
  78. * radio's memory
  79. */
  80. uint8_t SX1280HalReadRegister( uint16_t address );
  81. /*!
  82. * \brief Write data to the buffer holding the payload in the radio
  83. *
  84. * \param [in] offset The offset to start writing the payload
  85. * \param [in] buffer The data to be written (the payload)
  86. * \param [in] size The number of byte to be written
  87. */
  88. void SX1280HalWriteBuffer( uint8_t offset, uint8_t *buffer, uint8_t size );
  89. /*!
  90. * \brief Read data from the buffer holding the payload in the radio
  91. *
  92. * \param [in] offset The offset to start reading the payload
  93. * \param [out] buffer A pointer to a buffer holding the data from the radio
  94. * \param [in] size The number of byte to be read
  95. */
  96. void SX1280HalReadBuffer( uint8_t offset, uint8_t *buffer, uint8_t size );
  97. /*!
  98. * \brief Returns the status of DIOs pins
  99. *
  100. * \retval dioStatus A byte where each bit represents a DIO state:
  101. * [ DIOx | BUSY ]
  102. */
  103. uint8_t SX1280HalGetDioStatus( void );
  104. void SX1280HalIoIrqInit( DioIrqHandler **irqHandlers );
  105. #endif // __SX1280_HAL_H__