Driver_SAI.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * Copyright (c) 2013-2020 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. 0 /* reserved (must be zero) */
  39. };
  40. //
  41. // Functions
  42. //
  43. static ARM_DRIVER_VERSION ARM_SAI_GetVersion (void)
  44. {
  45. return DriverVersion;
  46. }
  47. static ARM_SAI_CAPABILITIES ARM_SAI_GetCapabilities (void)
  48. {
  49. return DriverCapabilities;
  50. }
  51. static int32_t ARM_SAI_Initialize (ARM_SAI_SignalEvent_t cb_event)
  52. {
  53. }
  54. static int32_t ARM_SAI_Uninitialize (void)
  55. {
  56. }
  57. static int32_t ARM_SAI_PowerControl (ARM_POWER_STATE state)
  58. {
  59. switch (state)
  60. {
  61. case ARM_POWER_OFF:
  62. break;
  63. case ARM_POWER_LOW:
  64. break;
  65. case ARM_POWER_FULL:
  66. break;
  67. }
  68. return ARM_DRIVER_OK;
  69. }
  70. static int32_t ARM_SAI_Send (const void *data, uint32_t num)
  71. {
  72. }
  73. static int32_t ARM_SAI_Receive (void *data, uint32_t num)
  74. {
  75. }
  76. static uint32_t ARM_SAI_GetTxCount (void)
  77. {
  78. }
  79. static uint32_t ARM_SAI_GetRxCount (void)
  80. {
  81. }
  82. static int32_t ARM_SAI_Control (uint32_t control, uint32_t arg1, uint32_t arg2)
  83. {
  84. }
  85. static ARM_SAI_STATUS ARM_SAI_GetStatus (void)
  86. {
  87. }
  88. static void ARM_SAI_SignalEvent(uint32_t event)
  89. {
  90. // function body
  91. }
  92. // End SAI Interface
  93. extern \
  94. ARM_DRIVER_SAI Driver_SAI0;
  95. ARM_DRIVER_SAI Driver_SAI0 = {
  96. ARM_SAI_GetVersion,
  97. ARM_SAI_GetCapabilities,
  98. ARM_SAI_Initialize,
  99. ARM_SAI_Uninitialize,
  100. ARM_SAI_PowerControl,
  101. ARM_SAI_Send,
  102. ARM_SAI_Receive,
  103. ARM_SAI_GetTxCount,
  104. ARM_SAI_GetRxCount,
  105. ARM_SAI_Control,
  106. ARM_SAI_GetStatus
  107. };