|
| 1 | +/* mbed Microcontroller Library |
| 2 | + * Copyright (c) 2019 ARM Limited |
| 3 | + * SPDX-License-Identifier: Apache-2.0 |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + */ |
| 17 | + |
| 18 | +/** \addtogroup hal_GeneralI2C_tests */ |
| 19 | +/** @{*/ |
| 20 | + |
| 21 | +#ifndef MBED_FPGA_I2C_TEST_H |
| 22 | +#define MBED_FPGA_I2C_TEST_H |
| 23 | + |
| 24 | +#if DEVICE_I2C |
| 25 | + |
| 26 | +#ifdef __cplusplus |
| 27 | +extern "C" { |
| 28 | +#endif |
| 29 | + |
| 30 | +/** Test that the i2c-master can be initialized/de-initialized using all possible |
| 31 | + * i2c pins. |
| 32 | + * |
| 33 | + * Given board provides i2c-master support. |
| 34 | + * When i2c-master is initialized (and then de-initialized) using valid set of i2c pins. |
| 35 | + * Then the operation is successfull. |
| 36 | + * |
| 37 | + */ |
| 38 | +void fpga_test_i2c_init_free(PinName sda, PinName scl); |
| 39 | + |
| 40 | +/** Test that I2C master is able to read data from I2C bus using i2c_byte_read. |
| 41 | + * |
| 42 | + * Given board provides I2C master support. |
| 43 | + * When I2C master reads data from I2C bus using i2c_byte_read. |
| 44 | + * Then data is successfully read. |
| 45 | + * |
| 46 | + */ |
| 47 | +void fpga_i2c_test_byte_read(PinName sda, PinName scl); |
| 48 | + |
| 49 | +/** Test that I2C master is able to write data to I2C bus using i2c_byte_write. |
| 50 | + * |
| 51 | + * Given board provides I2C master support. |
| 52 | + * When I2C master writes data to the I2C bus using i2c_byte_write. |
| 53 | + * Then data is successfully transmitted. |
| 54 | + * |
| 55 | + */ |
| 56 | +void fpga_i2c_test_byte_write(PinName sda, PinName scl); |
| 57 | + |
| 58 | +/** Test that I2C master is able to read data from I2C bus using i2c_read. |
| 59 | + * |
| 60 | + * Given board provides I2C master support. |
| 61 | + * When I2C master reads data from I2C bus using i2c_read. |
| 62 | + * Then data is successfully read. |
| 63 | + * |
| 64 | + */ |
| 65 | +void fpga_i2c_test_read(PinName sda, PinName scl); |
| 66 | + |
| 67 | +/** Test that I2C master is able to write data to I2C bus using i2c_write. |
| 68 | + * |
| 69 | + * Given board provides I2C master support. |
| 70 | + * When I2C master writes data to the I2C bus using i2c_write. |
| 71 | + * Then data is successfully transmitted. |
| 72 | + * |
| 73 | + */ |
| 74 | +void fpga_i2c_test_write(PinName sda, PinName scl); |
| 75 | + |
| 76 | +/**@}*/ |
| 77 | + |
| 78 | +#ifdef __cplusplus |
| 79 | +} |
| 80 | +#endif |
| 81 | + |
| 82 | +#endif |
| 83 | + |
| 84 | +#endif |
| 85 | + |
| 86 | +/**@}*/ |
0 commit comments