File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /*
2+ * This file is intended to be read from the sdkwrapper.hpp.
3+ * The user program must not include this file.
4+ */
5+
16#if __has_include(<gmock/gmock.h>)
27
38class MockSdkWrapper : public SdkWrapper {
Original file line number Diff line number Diff line change 1+ /*
2+ * This file is not to be included from the user program.
3+ *
4+ * Some of the rpp_driver code include this file. The contents
5+ * of this file is alternate type definition for Pico SDK.
6+ * These types are declared inside pico SDK. So, x86 build cannot use.
7+ */
8+
19#ifndef PICO_API_ALTERNATE_DEFS_HPP__
210#define PICO_API_ALTERNATE_DEFS_HPP__
311
Original file line number Diff line number Diff line change 1+ /*
2+ * Definition of the Pico SDK API Stub.
3+ *
4+ * Stubs in this file is weakly bounded. So, if the hardware_xxx or
5+ * the pico_xxx library is not linked in the application, the stub
6+ * function in this file will be linked.
7+ *
8+ * There are two purposes.
9+ *
10+ * The first one to allow programmer not to link the unused library.
11+ * For example, assume a program which doesn't use hardware_i2c lib.
12+ * While program doesn't use the API inside this library, the
13+ * rpp_driver::SdkWrapper class needs the API. On the other hand,
14+ * linking all library of Pico SDK just suppress the error message is
15+ * nonsense. So, linking stub is the solution for this problem.
16+ *
17+ * The second purpose is warning for the unlinked API. Assume a
18+ * program which doesn't link the hardware_i2c while it is used.
19+ * In this case, there is no link error because the weakly bounded
20+ * stub API function is linked. To let the programmer know, the
21+ * stub function output the error message to the serial port.
22+ */
123#include < stdint.h>
224#include < stdlib.h>
325
Original file line number Diff line number Diff line change 1-
1+ /*
2+ * Pico SDK has separated directory and files for the prototype definition.
3+ * To include all, we gather the include files in this one file.
4+ *
5+ * This file is dedicated to be read from the sdkwrapper.hpp.
6+ *
7+ * Not intended to be read from the application program.
8+ */
9+ #include <../../hardware_clocks/include/hardware/clocks.h>
10+ #include <../../hardware_gpio/include/hardware/gpio.h>
211#include <../../hardware_i2c/include/hardware/i2c.h>
312#include <../../hardware_pio/include/hardware/pio.h>
4- #include <../../hardware_gpio/include/hardware/gpio.h>
5- #include <../../hardware_clocks/include/hardware/clocks.h>
6- #include <../../pico_time/include/pico/time.h>
713#include <../../pico_stdio/include/pico/stdio.h>
14+ #include <../../pico_time/include/pico/time.h>
Original file line number Diff line number Diff line change 1+ /*
2+ * This file is intended to be read from the sdkwrapper.hpp.
3+ * The user program must not include this file.
4+ */
5+
16#if __has_include(<gmock/gmock.h>)
27
38class MockSdkWrapper : public SdkWrapper {
Original file line number Diff line number Diff line change 1+ /*
2+ * This file is not to be included from the user program.
3+ *
4+ * Some of the rpp_driver code include this file. The contents
5+ * of this file is alternate type definition for Pico SDK.
6+ * These types are declared inside pico SDK. So, x86 build cannot use.
7+ */
8+
19#ifndef PICO_API_ALTERNATE_DEFS_HPP__
210#define PICO_API_ALTERNATE_DEFS_HPP__
311
Original file line number Diff line number Diff line change 1+ /*
2+ * Definition of the Pico SDK API Stub.
3+ *
4+ * Stubs in this file is weakly bounded. So, if the hardware_xxx or
5+ * the pico_xxx library is not linked in the application, the stub
6+ * function in this file will be linked.
7+ *
8+ * There are two purposes.
9+ *
10+ * The first one to allow programmer not to link the unused library.
11+ * For example, assume a program which doesn't use hardware_i2c lib.
12+ * While program doesn't use the API inside this library, the
13+ * rpp_driver::SdkWrapper class needs the API. On the other hand,
14+ * linking all library of Pico SDK just suppress the error message is
15+ * nonsense. So, linking stub is the solution for this problem.
16+ *
17+ * The second purpose is warning for the unlinked API. Assume a
18+ * program which doesn't link the hardware_i2c while it is used.
19+ * In this case, there is no link error because the weakly bounded
20+ * stub API function is linked. To let the programmer know, the
21+ * stub function output the error message to the serial port.
22+ */
123#include < stdint.h>
224#include < stdlib.h>
325
Original file line number Diff line number Diff line change 1+ /* *
2+ * @file sdkwrapper.hpp
3+ * @brief Wrapper for RasPi Pico SDK API.
4+ * @copyright COPYRIGHT 2024 Seiichi Horie
5+ * @details
6+ * This file is generated by the scripts in the
7+ * src/sdk/scripts.
8+ * To re-generate, run :
9+ * @code
10+ * export PICO_SDK_PATH=/your/path/to/sdk
11+ * generate_wrapper.sh
12+ * @endcode
13+ */
14+
115#ifndef PICO_DRIVER_SRC_SDK_SDKWRAPPER_HPP_
216#define PICO_DRIVER_SRC_SDK_SDKWRAPPER_HPP_
317
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ cp blocks/mocksdkwrapper_preumble.hpp output/mocksdkwrapper.hpp
1616cp blocks/pico_sdk_apistub_preumble.cpp output/pico_sdk_apistub.cpp
1717cp blocks/pico_api_alternate_defs.hpp output/pico_api_alternate_defs.hpp
1818# echo "" > output/fffsdkwrapper.hpp
19- echo " " > output/pico_sdk_headers.h
19+ cp blocks/pico_sdk_headers_preumble.hpp output/pico_sdk_headers.h
2020echo " " > debug.hpp
2121
2222# read FILE
Original file line number Diff line number Diff line change 1+ /* *
2+ * @file sdkwrapper.hpp
3+ * @brief Wrapper for RasPi Pico SDK API.
4+ * @copyright COPYRIGHT 2024 Seiichi Horie
5+ * @details
6+ * This file is generated by the scripts in the
7+ * src/sdk/scripts.
8+ * To re-generate, run :
9+ * @code
10+ * export PICO_SDK_PATH=/your/path/to/sdk
11+ * generate_wrapper.sh
12+ * @endcode
13+ */
14+
115#ifndef PICO_DRIVER_SRC_SDK_SDKWRAPPER_HPP_
216#define PICO_DRIVER_SRC_SDK_SDKWRAPPER_HPP_
317
You can’t perform that action at this time.
0 commit comments