2 * Copyright (c) 2013-2016 ARM Limited. All rights reserved.
4 * SPDX-License-Identifier: Apache-2.0
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
10 * www.apache.org/licenses/LICENSE-2.0
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.
19 #include "Driver_SAI.h"
21 #define ARM_SAI_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(1, 0) /* driver version */
24 static const ARM_DRIVER_VERSION DriverVersion = {
29 /* Driver Capabilities */
30 static const ARM_SAI_CAPABILITIES DriverCapabilities = {
31 1, /* supports asynchronous Transmit/Receive */
32 0, /* supports synchronous Transmit/Receive */
33 0, /* supports user defined Protocol */
34 1, /* supports I2S Protocol */
35 0, /* supports MSB/LSB justified Protocol */
36 0, /* supports PCM short/long frame Protocol */
37 0, /* supports AC'97 Protocol */
38 0, /* supports Mono mode */
39 0, /* supports Companding */
40 0, /* supports MCLK (Master Clock) pin */
41 0 /* supports Frame error event: \ref ARM_SAI_EVENT_FRAME_ERROR */
48 ARM_DRIVER_VERSION ARM_SAI_GetVersion (void)
52 ARM_SAI_CAPABILITIES ARM_SAI_GetCapabilities (void)
56 int32_t ARM_SAI_Initialize (ARM_SAI_SignalEvent_t cb_event)
60 int32_t ARM_SAI_Uninitialize (void)
64 int32_t ARM_SAI_PowerControl (ARM_POWER_STATE state)
78 return ARM_DRIVER_ERROR_UNSUPPORTED;
82 int32_t ARM_SAI_Send (const void *data, uint32_t num)
86 int32_t ARM_SAI_Receive (void *data, uint32_t num)
90 uint32_t ARM_SAI_GetTxCount (void)
94 uint32_t ARM_SAI_GetRxCount (void)
98 int32_t ARM_SAI_Control (uint32_t control, uint32_t arg1, uint32_t arg2)
102 ARM_SAI_STATUS ARM_SAI_GetStatus (void)
106 void ARM_SAI_SignalEvent(uint32_t event)
113 ARM_DRIVER_SAI Driver_SAI = {
115 ARM_SAI_GetCapabilities,
117 ARM_SAI_Uninitialize,
118 ARM_SAI_PowerControl,