hal_spi.c 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /**************************************************************************************************
  2. Filename: hal_spi.c
  3. Revised: $Date: 2010-08-10 19:12:51 -0700 (Tue, 10 Aug 2010) $
  4. Revision: $Revision: 23375 $
  5. Description: This file contains the interface to the HAL SPI.
  6. Copyright 2009 Texas Instruments Incorporated. All rights reserved.
  7. IMPORTANT: Your use of this Software is limited to those specific rights
  8. granted under the terms of a software license agreement between the user
  9. who downloaded the software, his/her employer (which must be your employer)
  10. and Texas Instruments Incorporated (the "License"). You may not use this
  11. Software unless you agree to abide by the terms of the License. The License
  12. limits your use, and you acknowledge, that the Software may not be modified,
  13. copied or distributed unless embedded on a Texas Instruments microcontroller
  14. or used solely and exclusively in conjunction with a Texas Instruments radio
  15. frequency transceiver, which is integrated into your product. Other than for
  16. the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  17. works of, modify, distribute, perform, display or sell this Software and/or
  18. its documentation for any purpose.
  19. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  20. PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  21. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  22. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  23. TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  24. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  25. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  26. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  27. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  28. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  29. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  30. Should you have any questions regarding your right to use this Software,
  31. contact Texas Instruments Incorporated at www.TI.com.
  32. **************************************************************************************************/
  33. /**************************************************************************************************
  34. * INCLUDES
  35. **************************************************************************************************/
  36. #include "hal_mcu.h"
  37. #include "hal_defs.h"
  38. #include "hal_types.h"
  39. #include "hal_spi.h"
  40. #include "znp_spi.h"
  41. #if (defined HAL_SPI) && (HAL_SPI == TRUE)
  42. /**************************************************************************************************
  43. * CONSTANTS
  44. **************************************************************************************************/
  45. /**************************************************************************************************
  46. * MACROS
  47. **************************************************************************************************/
  48. /**************************************************************************************************
  49. * TYPEDEFS
  50. **************************************************************************************************/
  51. /**************************************************************************************************
  52. * GLOBAL VARIABLES
  53. **************************************************************************************************/
  54. /**************************************************************************************************
  55. * FUNCTIONS - API
  56. **************************************************************************************************/
  57. /**************************************************************************************************
  58. * @fn HalSpiInit
  59. *
  60. * @brief Initialize SPI Service
  61. *
  62. * @param None
  63. *
  64. * @return None
  65. **************************************************************************************************/
  66. void HalSpiInit(void)
  67. {
  68. npSpiInit();
  69. }
  70. /**************************************************************************************************
  71. * @fn HalSpiPoll
  72. *
  73. * @brief Poll the SPI.
  74. *
  75. * @param None
  76. *
  77. * @return None
  78. **************************************************************************************************/
  79. void HalSpiPoll(void)
  80. {
  81. npSpiMonitor();
  82. }
  83. /**************************************************************************************************
  84. * @fn HalSpiRxIsr
  85. *
  86. * @brief RxIsr for the SPI.
  87. *
  88. * @param None
  89. *
  90. * @return None
  91. **************************************************************************************************/
  92. void HalSpiRxIsr(void)
  93. {
  94. npSpiRxIsr();
  95. }
  96. /**************************************************************************************************
  97. * @fn HalSpiTxIsr
  98. *
  99. * @brief TxIsr for the SPI.
  100. *
  101. * @param None
  102. *
  103. * @return None
  104. **************************************************************************************************/
  105. void HalSpiTxIsr(void)
  106. {
  107. npSpiTxIsr();
  108. }
  109. #endif
  110. /**************************************************************************************************
  111. **************************************************************************************************/