| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- /*
- * Copyright (c) 2013-2018 Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the License); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- #include "Driver_I2C.h"
- #define ARM_I2C_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(2, 0) /* driver version */
- /* Driver Version */
- static const ARM_DRIVER_VERSION DriverVersion = {
- ARM_I2C_API_VERSION,
- ARM_I2C_DRV_VERSION
- };
- /* Driver Capabilities */
- static const ARM_I2C_CAPABILITIES DriverCapabilities = {
- 0 /* supports 10-bit addressing */
- };
- //
- // Functions
- //
- ARM_DRIVER_VERSION ARM_I2C_GetVersion(void)
- {
- }
- ARM_I2C_CAPABILITIES ARM_I2C_GetCapabilities(void)
- {
- }
- int32_t ARM_I2C_Initialize(ARM_I2C_SignalEvent_t cb_event)
- {
- }
- int32_t ARM_I2C_Uninitialize(void)
- {
- }
- int32_t ARM_I2C_PowerControl(ARM_POWER_STATE state)
- {
- switch (state)
- {
- case ARM_POWER_OFF:
- break;
- case ARM_POWER_LOW:
- break;
- case ARM_POWER_FULL:
- break;
- default:
- return ARM_DRIVER_ERROR_UNSUPPORTED;
- }
- }
- int32_t ARM_I2C_MasterTransmit(uint32_t addr, const uint8_t *data, uint32_t num, bool xfer_pending)
- {
- }
- int32_t ARM_I2C_MasterReceive(uint32_t addr, uint8_t *data, uint32_t num, bool xfer_pending)
- {
- }
- int32_t ARM_I2C_SlaveTransmit(const uint8_t *data, uint32_t num)
- {
- }
- int32_t ARM_I2C_SlaveReceive(uint8_t *data, uint32_t num)
- {
- }
- int32_t ARM_I2C_GetDataCount(void)
- {
- }
- int32_t ARM_I2C_Control(uint32_t control, uint32_t arg)
- {
- switch (control)
- {
- case ARM_I2C_OWN_ADDRESS:
- break;
- case ARM_I2C_BUS_SPEED:
- switch (arg)
- {
- case ARM_I2C_BUS_SPEED_STANDARD:
- break;
- case ARM_I2C_BUS_SPEED_FAST:
- break;
- case ARM_I2C_BUS_SPEED_FAST_PLUS:
- break;
- default:
- return ARM_DRIVER_ERROR_UNSUPPORTED;
- }
- break;
- case ARM_I2C_BUS_CLEAR:
- break;
- case ARM_I2C_ABORT_TRANSFER:
- break;
- default:
- return ARM_DRIVER_ERROR_UNSUPPORTED;
- }
- }
- ARM_I2C_STATUS ARM_I2C_GetStatus(void)
- {
- }
- void ARM_I2C_SignalEvent(uint32_t event)
- {
- // function body
- }
- // End I2C Interface
- ARM_DRIVER_I2C Driver_I2C = {
- ARM_I2C_GetVersion,
- ARM_I2C_GetCapabilities,
- ARM_I2C_Initialize,
- ARM_I2C_Uninitialize,
- ARM_I2C_PowerControl,
- ARM_I2C_MasterTransmit,
- ARM_I2C_MasterReceive,
- ARM_I2C_SlaveTransmit,
- ARM_I2C_SlaveReceive,
- ARM_I2C_GetDataCount,
- ARM_I2C_Control,
- ARM_I2C_GetStatus
- };
|