mibspi.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /** @file mibspi.h
  2. * @brief MIBSPI Driver Definition File
  3. * @date 29.May.2013
  4. * @version 03.05.02
  5. *
  6. */
  7. /* (c) Texas Instruments 2009-2013, All rights reserved. */
  8. #ifndef __MIBSPI_H__
  9. #define __MIBSPI_H__
  10. #include "reg_mibspi.h"
  11. /** @enum triggerEvent
  12. * @brief Transfer Group Trigger Event
  13. */
  14. enum triggerEvent
  15. {
  16. TRG_NEVER = 0U,
  17. TRG_RISING = 1U,
  18. TRG_FALLING = 2U,
  19. TRG_BOTH = 3U,
  20. TRG_HIGH = 5U,
  21. TRG_LOW = 6U,
  22. TRG_ALWAYS = 7U
  23. };
  24. /** @enum triggerSource
  25. * @brief Transfer Group Trigger Source
  26. */
  27. enum triggerSource
  28. {
  29. TRG_DISABLED,
  30. TRG_GIOA0,
  31. TRG_GIOA1,
  32. TRG_GIOA2,
  33. TRG_GIOA3,
  34. TRG_GIOA4,
  35. TRG_GIOA5,
  36. TRG_GIOA6,
  37. TRG_GIOA7,
  38. TRG_HET1_8,
  39. TRG_HET1_10,
  40. TRG_HET1_12,
  41. TRG_HET1_14,
  42. TRG_HET1_16,
  43. TRG_HET1_18,
  44. TRG_TICK
  45. };
  46. /** @enum mibspiPinSelect
  47. * @brief mibspi Pin Select
  48. */
  49. enum mibspiPinSelect
  50. {
  51. PIN_CS0 = 0U,
  52. PIN_CS1 = 1U,
  53. PIN_CS2 = 2U,
  54. PIN_CS3 = 3U,
  55. PIN_CS4 = 4U,
  56. PIN_CS5 = 5U,
  57. PIN_CS6 = 6U,
  58. PIN_CS7 = 7U,
  59. PIN_ENA = 8U,
  60. PIN_CLK = 9U,
  61. PIN_SIMO = 10U,
  62. PIN_SOMI = 11U,
  63. PIN_SIMO_1 = 17U,
  64. PIN_SIMO_2 = 18U,
  65. PIN_SIMO_3 = 19U,
  66. PIN_SIMO_4 = 20U,
  67. PIN_SIMO_5 = 21U,
  68. PIN_SIMO_6 = 22U,
  69. PIN_SIMO_7 = 23U,
  70. PIN_SOMI_1 = 25U,
  71. PIN_SOMI_2 = 26U,
  72. PIN_SOMI_3 = 27U,
  73. PIN_SOMI_4 = 28U,
  74. PIN_SOMI_5 = 29U,
  75. PIN_SOMI_6 = 30U,
  76. PIN_SOMI_7 = 31U
  77. };
  78. /** @enum chipSelect
  79. * @brief Transfer Group Chip Select
  80. */
  81. enum chipSelect
  82. {
  83. CS_NONE = 0xFFU,
  84. CS_0 = 0xFEU,
  85. CS_1 = 0xFDU,
  86. CS_2 = 0xFBU,
  87. CS_3 = 0xF7U,
  88. CS_4 = 0xEFU,
  89. CS_5 = 0xDFU,
  90. CS_6 = 0xBFU,
  91. CS_7 = 0x7FU
  92. };
  93. /**
  94. * @defgroup MIBSPI MIBSPI
  95. * @brief Multi-Buffered Serial Peripheral Interface Module.
  96. *
  97. * The MibSPI/MibSPIP is a high-speed synchronous serial input/output port that allows a serial bit stream of
  98. * programmed length (2 to 16 bits) to be shifted in and out of the device at a programmed bit-transfer rate.
  99. * The MibSPI has a programmable buffer memory that enables programmed transmission to be completed
  100. * without CPU intervention
  101. *
  102. * Related Files
  103. * - reg_mibspi.h
  104. * - mibspi.h
  105. * - mibspi.c
  106. * @addtogroup MIBSPI
  107. * @{
  108. */
  109. /* MIBSPI Interface Functions */
  110. void mibspiInit(void);
  111. void mibspiSetFunctional(mibspiBASE_t *mibspi, uint32 port);
  112. void mibspiSetData(mibspiBASE_t *mibspi, uint32 group, uint16 * data);
  113. uint32 mibspiGetData(mibspiBASE_t *mibspi, uint32 group, uint16 * data);
  114. void mibspiTransfer(mibspiBASE_t *mibspi, uint32 group);
  115. boolean mibspiIsTransferComplete(mibspiBASE_t *mibspi, uint32 group);
  116. void mibspiEnableGroupNotification(mibspiBASE_t *mibspi, uint32 group, uint32 level);
  117. void mibspiDisableGroupNotification(mibspiBASE_t *mibspi, uint32 group);
  118. void mibspiEnableLoopback(mibspiBASE_t *mibspi, loopBackType_t Loopbacktype);
  119. void mibspiDisableLoopback(mibspiBASE_t *mibspi);
  120. /** @fn void mibspiNotification(mibspiBASE_t *mibspi, uint32 flags)
  121. * @brief Error interrupt callback
  122. * @param[in] mibspi - mibSpi module base address
  123. * @param[in] flags - Copy of error interrupt flags
  124. *
  125. * This is a error callback that is provided by the application and is call upon
  126. * an error interrupt. The paramer passed to the callback is a copy of the error
  127. * interrupt flag register.
  128. */
  129. void mibspiNotification(mibspiBASE_t *mibspi, uint32 flags);
  130. /** @fn void mibspiGroupNotification(mibspiBASE_t *mibspi, uint32 group)
  131. * @brief Transfer complete notification callback
  132. * @param[in] mibspi - mibSpi module base address
  133. * @param[in] group - Transfer group
  134. *
  135. * This is a callback function provided by the application. It is call when
  136. * a transfer is complete. The parameter is the transfer group that triggered
  137. * the interrupt.
  138. */
  139. void mibspiGroupNotification(mibspiBASE_t *mibspi, uint32 group);
  140. /**@}*/
  141. #endif