diff --git a/UNITTESTS/target_h/PeripheralNames.h b/UNITTESTS/target_h/PeripheralNames.h deleted file mode 100644 index 3ca0e7b..0000000 --- a/UNITTESTS/target_h/PeripheralNames.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2017, Arm Limited and affiliates. - * 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 - * - * http://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. - */ - -#ifndef MBED_PERIPHERALNAMES_H -#define MBED_PERIPHERALNAMES_H - -#endif diff --git a/UNITTESTS/target_h/PinNames.h b/UNITTESTS/target_h/PinNames.h deleted file mode 100644 index 92fa9fb..0000000 --- a/UNITTESTS/target_h/PinNames.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2017, Arm Limited and affiliates. - * 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 - * - * http://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. - */ - -#ifndef MBED_PINNAMES_H -#define MBED_PINNAMES_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - PIN_INPUT, - PIN_OUTPUT -} PinDirection; - -typedef enum { - PTC0 = 0, - PTC1 = 1, - NC = (int)0xFFFFFFFF -} PinName; - -typedef enum { - PullNone = 0, - PullDown = 1, - PullUp = 2, - PullDefault = PullUp -} PinMode; - -typedef enum { - PortA = 0, -} PortName; - -#ifdef __cplusplus -} -#endif -#include "hal/pinmap.h" - -#endif diff --git a/UNITTESTS/target_h/device.h b/UNITTESTS/target_h/device.h deleted file mode 100644 index c052aa0..0000000 --- a/UNITTESTS/target_h/device.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2017, Arm Limited and affiliates. - * 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 - * - * http://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. - */ - -#ifndef MBED_DEVICE_H -#define MBED_DEVICE_H - -#include "objects.h" -#include "PinNames.h" - -#endif diff --git a/UNITTESTS/target_h/gpio_object.h b/UNITTESTS/target_h/gpio_object.h deleted file mode 100644 index 9f31aeb..0000000 --- a/UNITTESTS/target_h/gpio_object.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2017, Arm Limited and affiliates. - * 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 - * - * http://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. - */ - -#ifndef MBED_GPIO_OBJECT_H -#define MBED_GPIO_OBJECT_H - -#include "mbed_assert.h" -#include "PeripheralNames.h" -#include "PinNames.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - int unused; -} gpio_t; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/UNITTESTS/target_h/objects.h b/UNITTESTS/target_h/objects.h deleted file mode 100644 index 23a634d..0000000 --- a/UNITTESTS/target_h/objects.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2017, Arm Limited and affiliates. - * 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 - * - * http://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. - */ - -#ifndef MBED_OBJECTS_H -#define MBED_OBJECTS_H - -#include -#include "PeripheralNames.h" -#include "PinNames.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct gpio_irq_s { - uint32_t ch; -}; - -struct serial_s { - int x; -}; - -struct dac_s { - int unused; -}; - -struct i2c_s { - int unused; -}; - -struct qspi_s { - int unused; -}; - -struct spi_s { - int unused; -}; - -struct analogin_s { - int unused; -}; - -struct port_s { - int unused; -}; - -struct pwmout_s { - int unused; -}; - -struct flash_s { - int unused; -}; - -struct can_s { - int unused; -}; - -#include "gpio_object.h" - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/hal/tests/UNITTESTS/doubles/CMakeLists.txt b/hal/tests/UNITTESTS/doubles/CMakeLists.txt index 3dc1950..f82ceb5 100644 --- a/hal/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/hal/tests/UNITTESTS/doubles/CMakeLists.txt @@ -5,6 +5,7 @@ target_include_directories(mbed-headers-hal INTERFACE + . ${mbed-os_SOURCE_DIR}/hal ${mbed-os_SOURCE_DIR}/hal/include ) diff --git a/hal/tests/UNITTESTS/doubles/PeripheralNames.h b/hal/tests/UNITTESTS/doubles/PeripheralNames.h new file mode 100644 index 0000000..3ca0e7b --- /dev/null +++ b/hal/tests/UNITTESTS/doubles/PeripheralNames.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2017, Arm Limited and affiliates. + * 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 + * + * http://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. + */ + +#ifndef MBED_PERIPHERALNAMES_H +#define MBED_PERIPHERALNAMES_H + +#endif diff --git a/hal/tests/UNITTESTS/doubles/PinNames.h b/hal/tests/UNITTESTS/doubles/PinNames.h new file mode 100644 index 0000000..92fa9fb --- /dev/null +++ b/hal/tests/UNITTESTS/doubles/PinNames.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017, Arm Limited and affiliates. + * 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 + * + * http://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. + */ + +#ifndef MBED_PINNAMES_H +#define MBED_PINNAMES_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + PIN_INPUT, + PIN_OUTPUT +} PinDirection; + +typedef enum { + PTC0 = 0, + PTC1 = 1, + NC = (int)0xFFFFFFFF +} PinName; + +typedef enum { + PullNone = 0, + PullDown = 1, + PullUp = 2, + PullDefault = PullUp +} PinMode; + +typedef enum { + PortA = 0, +} PortName; + +#ifdef __cplusplus +} +#endif +#include "hal/pinmap.h" + +#endif diff --git a/hal/tests/UNITTESTS/doubles/device.h b/hal/tests/UNITTESTS/doubles/device.h new file mode 100644 index 0000000..c052aa0 --- /dev/null +++ b/hal/tests/UNITTESTS/doubles/device.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2017, Arm Limited and affiliates. + * 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 + * + * http://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. + */ + +#ifndef MBED_DEVICE_H +#define MBED_DEVICE_H + +#include "objects.h" +#include "PinNames.h" + +#endif diff --git a/hal/tests/UNITTESTS/doubles/gpio_object.h b/hal/tests/UNITTESTS/doubles/gpio_object.h new file mode 100644 index 0000000..9f31aeb --- /dev/null +++ b/hal/tests/UNITTESTS/doubles/gpio_object.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2017, Arm Limited and affiliates. + * 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 + * + * http://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. + */ + +#ifndef MBED_GPIO_OBJECT_H +#define MBED_GPIO_OBJECT_H + +#include "mbed_assert.h" +#include "PeripheralNames.h" +#include "PinNames.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + int unused; +} gpio_t; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/hal/tests/UNITTESTS/doubles/objects.h b/hal/tests/UNITTESTS/doubles/objects.h new file mode 100644 index 0000000..23a634d --- /dev/null +++ b/hal/tests/UNITTESTS/doubles/objects.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2017, Arm Limited and affiliates. + * 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 + * + * http://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. + */ + +#ifndef MBED_OBJECTS_H +#define MBED_OBJECTS_H + +#include +#include "PeripheralNames.h" +#include "PinNames.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct gpio_irq_s { + uint32_t ch; +}; + +struct serial_s { + int x; +}; + +struct dac_s { + int unused; +}; + +struct i2c_s { + int unused; +}; + +struct qspi_s { + int unused; +}; + +struct spi_s { + int unused; +}; + +struct analogin_s { + int unused; +}; + +struct port_s { + int unused; +}; + +struct pwmout_s { + int unused; +}; + +struct flash_s { + int unused; +}; + +struct can_s { + int unused; +}; + +#include "gpio_object.h" + +#ifdef __cplusplus +} +#endif + +#endif