sx12xxEiger.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * THE FOLLOWING FIRMWARE IS PROVIDED: (1) "AS IS" WITH NO WARRANTY; AND
  3. * (2)TO ENABLE ACCESS TO CODING INFORMATION TO GUIDE AND FACILITATE CUSTOMER.
  4. * CONSEQUENTLY, SEMTECH SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR
  5. * CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
  6. * OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
  7. * CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  8. *
  9. * Copyright (C) SEMTECH S.A.
  10. */
  11. /*!
  12. * \file sx12xxEiger.h
  13. * \brief
  14. *
  15. * \version 1.0
  16. * \date Nov 21 2012
  17. * \author Miguel Luis
  18. */
  19. #ifndef __SX12XXEIGER_H__
  20. #define __SX12XXEIGER_H__
  21. #include <stdint.h>
  22. #include <stdbool.h>
  23. //#include "stm32f2xx.h"
  24. #define USE_USB 1
  25. #if defined( STM32F4XX ) || defined( STM32F2XX ) || defined( STM32F429_439xx )
  26. #define BACKUP_REG_BOOTLOADER RTC_BKP_DR0 /* Booloader enter*/
  27. #else
  28. #define BACKUP_REG_BOOTLOADER BKP_DR1 /* Booloader enter*/
  29. #endif
  30. #define FW_VERSION "2.1.0"
  31. #define SK_NAME "SX12xxEiger"
  32. /*!
  33. * Functions return codes definition
  34. */
  35. typedef enum
  36. {
  37. SX_OK,
  38. SX_ERROR,
  39. SX_BUSY,
  40. SX_EMPTY,
  41. SX_DONE,
  42. SX_TIMEOUT,
  43. SX_UNSUPPORTED,
  44. SX_WAIT,
  45. SX_CLOSE,
  46. SX_YES,
  47. SX_NO,
  48. }tReturnCodes;
  49. extern volatile uint32_t TickCounter;
  50. /**
  51. * @brief Small printf for GCC/RAISONANCE
  52. */
  53. #ifdef __GNUC__
  54. /* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf
  55. set to 'Yes') calls __io_putchar() */
  56. #define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
  57. #endif /* __GNUC__ */
  58. /*!
  59. * Initializes board peripherals
  60. */
  61. void BoardInit( void );
  62. /*!
  63. * Delay code execution for "delay" ms
  64. */
  65. void Delay ( uint32_t delay );
  66. /*!
  67. * Delay code execution for "delay" s
  68. */
  69. void LongDelay ( uint8_t delay );
  70. /*!
  71. * \brief Computes a random number between min and max
  72. *
  73. * \param [IN] min range minimum value
  74. * \param [IN] max range maximum value
  75. * \retval random random value in range min..max
  76. */
  77. uint32_t randr( uint32_t min, uint32_t max );
  78. #endif // __SX12XXEIGER_H__