Driver_SAI.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * Copyright (c) 2013-2018 Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the License); you may
  7. * not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  14. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. #include "Driver_SAI.h"
  19. #define ARM_SAI_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(1, 0) /* driver version */
  20. /* Driver Version */
  21. static const ARM_DRIVER_VERSION DriverVersion = {
  22. ARM_SAI_API_VERSION,
  23. ARM_SAI_DRV_VERSION
  24. };
  25. /* Driver Capabilities */
  26. static const ARM_SAI_CAPABILITIES DriverCapabilities = {
  27. 1, /* supports asynchronous Transmit/Receive */
  28. 0, /* supports synchronous Transmit/Receive */
  29. 0, /* supports user defined Protocol */
  30. 1, /* supports I2S Protocol */
  31. 0, /* supports MSB/LSB justified Protocol */
  32. 0, /* supports PCM short/long frame Protocol */
  33. 0, /* supports AC'97 Protocol */
  34. 0, /* supports Mono mode */
  35. 0, /* supports Companding */
  36. 0, /* supports MCLK (Master Clock) pin */
  37. 0 /* supports Frame error event: \ref ARM_SAI_EVENT_FRAME_ERROR */
  38. };
  39. //
  40. // Functions
  41. //
  42. ARM_DRIVER_VERSION ARM_SAI_GetVersion (void)
  43. {
  44. }
  45. ARM_SAI_CAPABILITIES ARM_SAI_GetCapabilities (void)
  46. {
  47. }
  48. int32_t ARM_SAI_Initialize (ARM_SAI_SignalEvent_t cb_event)
  49. {
  50. }
  51. int32_t ARM_SAI_Uninitialize (void)
  52. {
  53. }
  54. int32_t ARM_SAI_PowerControl (ARM_POWER_STATE state)
  55. {
  56. switch (state)
  57. {
  58. case ARM_POWER_OFF:
  59. break;
  60. case ARM_POWER_LOW:
  61. break;
  62. case ARM_POWER_FULL:
  63. break;
  64. default:
  65. return ARM_DRIVER_ERROR_UNSUPPORTED;
  66. }
  67. }
  68. int32_t ARM_SAI_Send (const void *data, uint32_t num)
  69. {
  70. }
  71. int32_t ARM_SAI_Receive (void *data, uint32_t num)
  72. {
  73. }
  74. uint32_t ARM_SAI_GetTxCount (void)
  75. {
  76. }
  77. uint32_t ARM_SAI_GetRxCount (void)
  78. {
  79. }
  80. int32_t ARM_SAI_Control (uint32_t control, uint32_t arg1, uint32_t arg2)
  81. {
  82. }
  83. ARM_SAI_STATUS ARM_SAI_GetStatus (void)
  84. {
  85. }
  86. void ARM_SAI_SignalEvent(uint32_t event)
  87. {
  88. // function body
  89. }
  90. // End SAI Interface
  91. ARM_DRIVER_SAI Driver_SAI = {
  92. ARM_SAI_GetVersion,
  93. ARM_SAI_GetCapabilities,
  94. ARM_SAI_Initialize,
  95. ARM_SAI_Uninitialize,
  96. ARM_SAI_PowerControl,
  97. ARM_SAI_Send,
  98. ARM_SAI_Receive,
  99. ARM_SAI_GetTxCount,
  100. ARM_SAI_GetRxCount,
  101. ARM_SAI_Control,
  102. ARM_SAI_GetStatus
  103. };