Copyright (c) LibDriver
14 | * All rights reserved.
15 | *
16 | * The MIT License (MIT)
17 | *
18 | * Permission is hereby granted, free of charge, to any person obtaining a copy
19 | * of this software and associated documentation files (the "Software"), to deal
20 | * in the Software without restriction, including without limitation the rights
21 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22 | * copies of the Software, and to permit persons to whom the Software is
23 | * furnished to do so, subject to the following conditions:
24 | *
25 | * The above copyright notice and this permission notice shall be included in all
26 | * copies or substantial portions of the Software.
27 | *
28 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34 | * SOFTWARE.
35 | */
36 |
--------------------------------------------------------------------------------
/doc/html/group__cs100__test__driver.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
37 |
--------------------------------------------------------------------------------
/doc/html/group__cs100__base__driver.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
37 |
--------------------------------------------------------------------------------
/doc/html/group__cs100__link__driver.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
37 |
--------------------------------------------------------------------------------
/project/stm32f407/cmsis/cmsis_version.h:
--------------------------------------------------------------------------------
1 | /**************************************************************************//**
2 | * @file cmsis_version.h
3 | * @brief CMSIS Core(M) Version definitions
4 | * @version V5.0.2
5 | * @date 19. April 2017
6 | ******************************************************************************/
7 | /*
8 | * Copyright (c) 2009-2017 ARM Limited. All rights reserved.
9 | *
10 | * SPDX-License-Identifier: Apache-2.0
11 | *
12 | * Licensed under the Apache License, Version 2.0 (the License); you may
13 | * not use this file except in compliance with the License.
14 | * You may obtain a copy of the License at
15 | *
16 | * www.apache.org/licenses/LICENSE-2.0
17 | *
18 | * Unless required by applicable law or agreed to in writing, software
19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT
20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 | * See the License for the specific language governing permissions and
22 | * limitations under the License.
23 | */
24 |
25 | #if defined ( __ICCARM__ )
26 | #pragma system_include /* treat file as system include file for MISRA check */
27 | #elif defined (__clang__)
28 | #pragma clang system_header /* treat file as system include file */
29 | #endif
30 |
31 | #ifndef __CMSIS_VERSION_H
32 | #define __CMSIS_VERSION_H
33 |
34 | /* CMSIS Version definitions */
35 | #define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */
36 | #define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */
37 | #define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \
38 | __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */
39 | #endif
40 |
--------------------------------------------------------------------------------
/doc/html/group__cs100__example__driver_ga2e6ede7576d8d80f9ac32ecf476167fb_cgraph.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
40 |
--------------------------------------------------------------------------------
/doc/html/group__cs100__example__driver_ga8c60b88bf223f7f23474b3079a578c85_cgraph.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
40 |
--------------------------------------------------------------------------------
/doc/html/group__cs100__example__driver.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
38 |
--------------------------------------------------------------------------------
/doc/html/group__cs100__interface__driver.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
38 |
--------------------------------------------------------------------------------
/project/raspberrypi4b/cmake/config.cmake.in:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 - present LibDriver All rights reserved
3 | #
4 | # The MIT License (MIT)
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in all
14 | # copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | # SOFTWARE.
23 | #
24 |
25 | # set the package init
26 | @PACKAGE_INIT@
27 |
28 | # include dependency macro
29 | include(CMakeFindDependencyMacro)
30 |
31 | # find the pkgconfig and use this tool to find the third party packages
32 | find_package(PkgConfig REQUIRED)
33 |
34 | # find the third party packages with pkgconfig
35 | pkg_search_module(GPIOD REQUIRED libgpiod)
36 |
37 | # include the cmake targets
38 | include(${CMAKE_CURRENT_LIST_DIR}/@CMAKE_PROJECT_NAME@-targets.cmake)
39 |
40 | # get the include header directories
41 | get_target_property(@CMAKE_PROJECT_NAME@_INCLUDE_DIRS @CMAKE_PROJECT_NAME@ INTERFACE_INCLUDE_DIRECTORIES)
42 |
43 | # get the library directories
44 | get_target_property(@CMAKE_PROJECT_NAME@_LIBRARIES @CMAKE_PROJECT_NAME@ IMPORTED_LOCATION_RELEASE)
45 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | LibDriver takes the security of our code seriously.If you believe you have found a security vulnerability in our code, please report it to us as described below.
4 |
5 | ## Reporting a Vulnerability
6 |
7 | LibDriver is generally backwards compatible with very few exceptions, so we recommend users to always use the latest version to experience stability, performance and security.
8 |
9 | **Please do not report security vulnerabilities through public issues.**
10 |
11 | Instead, please send an email to lishifenging@outlook.com. You should receive a response within 24 hours. If for some reason you do not, please send again to ensure we received your original message. If your report was previously undisclosed, we’ll also mention your name in the credits.
12 |
13 | Please include the requested information listed below to help us better understand the nature and scope of the possible issue:
14 |
15 | - Type of issue
16 | - Full paths of source file(s) related to the manifestation of the issue
17 | - The location of the affected source code
18 | - Any special configuration required to reproduce the issue
19 | - Step-by-step instructions to reproduce the issue
20 | - Proof-of-concept or exploit code
21 | - Impact of the issue, including how an attacker might exploit the issue
22 |
23 | After receiving your report, we will evaluate your report as soon as possible and notify you of the results. Bug fixes depend on the bug itself, and we will try to fix bugs as quickly as possible.
24 |
25 | ## Preferred Languages
26 |
27 | We prefer all communications to be in English.
28 |
29 | ## Responsible Disclosure
30 |
31 | In some cases, we may apply a responsible disclosure process to reported or otherwise discovered vulnerabilities. We will usually do that for a critical vulnerability, and only if we have a good reason to believe information about it is not yet public.
32 |
33 | This process involves providing an early notification about the vulnerability, its impact and mitigations to a short list of vendors under a time-limited embargo on public disclosure.
--------------------------------------------------------------------------------
/project/stm32f407/interface/inc/clock.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file clock.h
25 | * @brief clock header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef CLOCK_H
38 | #define CLOCK_H
39 |
40 | #include "stm32f4xx_hal.h"
41 |
42 | #ifdef __cplusplus
43 | extern "C"{
44 | #endif
45 |
46 | /**
47 | * @defgroup clock clock function
48 | * @brief clock function modules
49 | * @{
50 | */
51 |
52 | /**
53 | * @brief chip clock init
54 | * @note none
55 | */
56 | void clock_init(void);
57 |
58 | /**
59 | * @}
60 | */
61 |
62 | #ifdef __cplusplus
63 | }
64 | #endif
65 |
66 | #endif
67 |
--------------------------------------------------------------------------------
/doc/html/cookie.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Cookie helper functions
3 | Copyright (c) 2023 Dimitri van Heesch
4 | Released under MIT license.
5 | */
6 | let Cookie = {
7 | cookie_namespace: 'doxygen_',
8 |
9 | readSetting(cookie,defVal) {
10 | if (window.chrome) {
11 | const val = localStorage.getItem(this.cookie_namespace+cookie) ||
12 | sessionStorage.getItem(this.cookie_namespace+cookie);
13 | if (val) return val;
14 | } else {
15 | let myCookie = this.cookie_namespace+cookie+"=";
16 | if (document.cookie) {
17 | const index = document.cookie.indexOf(myCookie);
18 | if (index != -1) {
19 | const valStart = index + myCookie.length;
20 | let valEnd = document.cookie.indexOf(";", valStart);
21 | if (valEnd == -1) {
22 | valEnd = document.cookie.length;
23 | }
24 | return document.cookie.substring(valStart, valEnd);
25 | }
26 | }
27 | }
28 | return defVal;
29 | },
30 |
31 | writeSetting(cookie,val,days=10*365) { // default days='forever', 0=session cookie, -1=delete
32 | if (window.chrome) {
33 | if (days==0) {
34 | sessionStorage.setItem(this.cookie_namespace+cookie,val);
35 | } else {
36 | localStorage.setItem(this.cookie_namespace+cookie,val);
37 | }
38 | } else {
39 | let date = new Date();
40 | date.setTime(date.getTime()+(days*24*60*60*1000));
41 | const expiration = days!=0 ? "expires="+date.toGMTString()+";" : "";
42 | document.cookie = this.cookie_namespace + cookie + "=" +
43 | val + "; SameSite=Lax;" + expiration + "path=/";
44 | }
45 | },
46 |
47 | eraseSetting(cookie) {
48 | if (window.chrome) {
49 | if (localStorage.getItem(this.cookie_namespace+cookie)) {
50 | localStorage.removeItem(this.cookie_namespace+cookie);
51 | } else if (sessionStorage.getItem(this.cookie_namespace+cookie)) {
52 | sessionStorage.removeItem(this.cookie_namespace+cookie);
53 | }
54 | } else {
55 | this.writeSetting(cookie,'',-1);
56 | }
57 | },
58 | }
59 |
--------------------------------------------------------------------------------
/doc/html/driver__cs100_8h.js:
--------------------------------------------------------------------------------
1 | var driver__cs100_8h =
2 | [
3 | [ "CS100_READ_RETRY_TIMES", "group__cs100__base__driver.html#ga9ab9fff636a397b768cdbb2d5c39ac6e", null ],
4 | [ "DRIVER_CS100_LINK_DEBUG_PRINT", "group__cs100__link__driver.html#ga12f0924f0d15a53d4ec84439aba18f3d", null ],
5 | [ "DRIVER_CS100_LINK_DELAY_MS", "group__cs100__link__driver.html#ga03a43ad74690d46a3b8dc7677121c36d", null ],
6 | [ "DRIVER_CS100_LINK_DELAY_US", "group__cs100__link__driver.html#ga90ee25d2c900b451bc31162bfdd53a15", null ],
7 | [ "DRIVER_CS100_LINK_ECHO_DEINIT", "group__cs100__link__driver.html#gaae1f487b9d5cff9f251c474556348e37", null ],
8 | [ "DRIVER_CS100_LINK_ECHO_INIT", "group__cs100__link__driver.html#ga236ee5c6463827f1fca89aacff2a1e07", null ],
9 | [ "DRIVER_CS100_LINK_ECHO_WRITE", "group__cs100__link__driver.html#ga6c96a216ec88a6f698700f48e57cb97f", null ],
10 | [ "DRIVER_CS100_LINK_INIT", "group__cs100__link__driver.html#ga3adffa5f0a7d2b4fd90e86b9fa8b833a", null ],
11 | [ "DRIVER_CS100_LINK_TIMESTAMP_READ", "group__cs100__link__driver.html#gaa1637bd70557ad71a1820c723512f12c", null ],
12 | [ "DRIVER_CS100_LINK_TRIG_DEINIT", "group__cs100__link__driver.html#gacb74f18feceb396edbcd7943ccea111d", null ],
13 | [ "DRIVER_CS100_LINK_TRIG_INIT", "group__cs100__link__driver.html#ga2fbcf55d4e2d5e9dfcbb6f3e7d3e4af0", null ],
14 | [ "DRIVER_CS100_LINK_TRIG_WRITE", "group__cs100__link__driver.html#ga182e5fa485cdfeb42ab393c8f4d9f31c", null ],
15 | [ "cs100_handle_t", "group__cs100__base__driver.html#ga55444d069aa739ea9565e1c01b31b8e1", null ],
16 | [ "cs100_info_t", "group__cs100__base__driver.html#ga0c39bccc7299c56f3e8435342517762a", null ],
17 | [ "cs100_time_t", "group__cs100__base__driver.html#ga383cabafeb8f9c93ad81a8490106d0d5", null ],
18 | [ "cs100_deinit", "group__cs100__base__driver.html#gae4568feac1c50b12520af80d703910f3", null ],
19 | [ "cs100_info", "group__cs100__base__driver.html#ga9810c9aba375864526bb5da41b105fd2", null ],
20 | [ "cs100_init", "group__cs100__base__driver.html#ga4fe3432564b78c97043ed098d6ef6ada", null ],
21 | [ "cs100_read", "group__cs100__base__driver.html#gaeef03946dadfb3af7df907fcd4dd0385", null ]
22 | ];
--------------------------------------------------------------------------------
/doc/html/driver__cs100__read__test_8h__dep__incl.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
42 |
--------------------------------------------------------------------------------
/doc/html/driver__cs100__basic_8h__dep__incl.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
42 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32_assert_template.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32_assert.h
4 | * @author MCD Application Team
5 | * @brief STM32 assert template file.
6 | * This file should be copied to the application folder and renamed
7 | * to stm32_assert.h.
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * Copyright (c) 2017 STMicroelectronics.
12 | * All rights reserved.
13 | *
14 | * This software is licensed under terms that can be found in the LICENSE file
15 | * in the root directory of this software component.
16 | * If no LICENSE file comes with this software, it is provided AS-IS.
17 | *
18 | ******************************************************************************
19 | */
20 |
21 | /* Define to prevent recursive inclusion -------------------------------------*/
22 | #ifndef __STM32_ASSERT_H
23 | #define __STM32_ASSERT_H
24 |
25 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif
28 |
29 | /* Exported types ------------------------------------------------------------*/
30 | /* Exported constants --------------------------------------------------------*/
31 | /* Includes ------------------------------------------------------------------*/
32 | /* Exported macro ------------------------------------------------------------*/
33 | #ifdef USE_FULL_ASSERT
34 | /**
35 | * @brief The assert_param macro is used for function's parameters check.
36 | * @param expr If expr is false, it calls assert_failed function
37 | * which reports the name of the source file and the source
38 | * line number of the call that failed.
39 | * If expr is true, it returns no value.
40 | * @retval None
41 | */
42 | #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
43 | /* Exported functions ------------------------------------------------------- */
44 | void assert_failed(uint8_t* file, uint32_t line);
45 | #else
46 | #define assert_param(expr) ((void)0U)
47 | #endif /* USE_FULL_ASSERT */
48 |
49 | #ifdef __cplusplus
50 | }
51 | #endif
52 |
53 | #endif /* __STM32_ASSERT_H */
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/test/driver_cs100_read_test.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file driver_cs100_read_test.h
25 | * @brief driver cs100 read test header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2024-07-30
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2024/07/30
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef DRIVER_CS100_READ_TEST_H
38 | #define DRIVER_CS100_READ_TEST_H
39 |
40 | #include
41 |
42 | #ifdef __cplusplus
43 | extern "C"{
44 | #endif
45 |
46 | /**
47 | * @defgroup cs100_test_driver cs100 test driver function
48 | * @brief cs100 test driver modules
49 | * @ingroup cs100_driver
50 | * @{
51 | */
52 |
53 | /**
54 | * @brief read test
55 | * @param[in] times test times
56 | * @return status code
57 | * - 0 success
58 | * - 1 test failed
59 | * @note none
60 | */
61 | uint8_t cs100_read_test(uint32_t times);
62 |
63 | /**
64 | * @}
65 | */
66 |
67 | #ifdef __cplusplus
68 | }
69 | #endif
70 |
71 | #endif
72 |
--------------------------------------------------------------------------------
/doc/html/menudata.js:
--------------------------------------------------------------------------------
1 | /*
2 | @licstart The following is the entire license notice for the JavaScript code in this file.
3 |
4 | The MIT License (MIT)
5 |
6 | Copyright (C) 1997-2020 by Dimitri van Heesch
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software
9 | and associated documentation files (the "Software"), to deal in the Software without restriction,
10 | including without limitation the rights to use, copy, modify, merge, publish, distribute,
11 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all copies or
15 | substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
18 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 |
23 | @licend The above is the entire license notice for the JavaScript code in this file
24 | */
25 | var menudata={children:[
26 | {text:"Main Page",url:"index.html"},
27 | {text:"Topics",url:"topics.html"},
28 | {text:"Data Structures",url:"annotated.html",children:[
29 | {text:"Data Structures",url:"annotated.html"},
30 | {text:"Data Structure Index",url:"classes.html"},
31 | {text:"Data Fields",url:"functions.html",children:[
32 | {text:"All",url:"functions.html"},
33 | {text:"Variables",url:"functions_vars.html"}]}]},
34 | {text:"Files",url:"files.html",children:[
35 | {text:"File List",url:"files.html"},
36 | {text:"Globals",url:"globals.html",children:[
37 | {text:"All",url:"globals.html",children:[
38 | {text:"c",url:"globals.html#index_c"},
39 | {text:"d",url:"globals.html#index_d"},
40 | {text:"m",url:"globals.html#index_m"},
41 | {text:"s",url:"globals.html#index_s"},
42 | {text:"t",url:"globals.html#index_t"}]},
43 | {text:"Functions",url:"globals_func.html",children:[
44 | {text:"c",url:"globals_func.html#index_c"}]},
45 | {text:"Typedefs",url:"globals_type.html"},
46 | {text:"Macros",url:"globals_defs.html"}]}]}]}
47 |
--------------------------------------------------------------------------------
/doc/html/dir_13e138d54eb8818da29c3992edef070a_dep.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
44 |
--------------------------------------------------------------------------------
/project/stm32f407/interface/inc/delay.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file delay.h
25 | * @brief delay header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef DELAY_H
38 | #define DELAY_H
39 |
40 | #include "stm32f4xx_hal.h"
41 |
42 | #ifdef __cplusplus
43 | extern "C"{
44 | #endif
45 |
46 | /**
47 | * @defgroup delay delay function
48 | * @brief delay function modules
49 | * @{
50 | */
51 |
52 | /**
53 | * @brief delay clock init
54 | * @return status code
55 | * - 0 success
56 | * @note none
57 | */
58 | uint8_t delay_init(void);
59 |
60 | /**
61 | * @brief delay us
62 | * @param[in] us time
63 | * @note none
64 | */
65 | void delay_us(uint32_t us);
66 |
67 | /**
68 | * @brief delay ms
69 | * @param[in] ms time
70 | * @note none
71 | */
72 | void delay_ms(uint32_t ms);
73 |
74 | /**
75 | * @}
76 | */
77 |
78 | #ifdef __cplusplus
79 | }
80 | #endif
81 |
82 | #endif
83 |
--------------------------------------------------------------------------------
/doc/html/dir_b31d54d5631803016a26f28213a41162_dep.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
44 |
--------------------------------------------------------------------------------
/doc/html/dir_cfafba98a580ce4b62f8a6fa96d7cbb0_dep.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
44 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/src/stm32f4xx_ll_pwr.c:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_ll_pwr.c
4 | * @author MCD Application Team
5 | * @brief PWR LL module driver.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2017 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file in
13 | * the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | ******************************************************************************
16 | */
17 | #if defined(USE_FULL_LL_DRIVER)
18 |
19 | /* Includes ------------------------------------------------------------------*/
20 | #include "stm32f4xx_ll_pwr.h"
21 | #include "stm32f4xx_ll_bus.h"
22 |
23 | /** @addtogroup STM32F4xx_LL_Driver
24 | * @{
25 | */
26 |
27 | #if defined(PWR)
28 |
29 | /** @defgroup PWR_LL PWR
30 | * @{
31 | */
32 |
33 | /* Private types -------------------------------------------------------------*/
34 | /* Private variables ---------------------------------------------------------*/
35 | /* Private constants ---------------------------------------------------------*/
36 | /* Private macros ------------------------------------------------------------*/
37 | /* Private function prototypes -----------------------------------------------*/
38 |
39 | /* Exported functions --------------------------------------------------------*/
40 | /** @addtogroup PWR_LL_Exported_Functions
41 | * @{
42 | */
43 |
44 | /** @addtogroup PWR_LL_EF_Init
45 | * @{
46 | */
47 |
48 | /**
49 | * @brief De-initialize the PWR registers to their default reset values.
50 | * @retval An ErrorStatus enumeration value:
51 | * - SUCCESS: PWR registers are de-initialized
52 | * - ERROR: not applicable
53 | */
54 | ErrorStatus LL_PWR_DeInit(void)
55 | {
56 | /* Force reset of PWR clock */
57 | LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_PWR);
58 |
59 | /* Release reset of PWR clock */
60 | LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_PWR);
61 |
62 | return SUCCESS;
63 | }
64 |
65 | /**
66 | * @}
67 | */
68 |
69 | /**
70 | * @}
71 | */
72 |
73 | /**
74 | * @}
75 | */
76 | #endif /* defined(PWR) */
77 | /**
78 | * @}
79 | */
80 |
81 | #endif /* USE_FULL_LL_DRIVER */
82 |
--------------------------------------------------------------------------------
/doc/html/navtreedata.js:
--------------------------------------------------------------------------------
1 | /*
2 | @licstart The following is the entire license notice for the JavaScript code in this file.
3 |
4 | The MIT License (MIT)
5 |
6 | Copyright (C) 1997-2020 by Dimitri van Heesch
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software
9 | and associated documentation files (the "Software"), to deal in the Software without restriction,
10 | including without limitation the rights to use, copy, modify, merge, publish, distribute,
11 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all copies or
15 | substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
18 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 |
23 | @licend The above is the entire license notice for the JavaScript code in this file
24 | */
25 | var NAVTREE =
26 | [
27 | [ "LibDriver CS100", "index.html", [
28 | [ "Topics", "topics.html", "topics" ],
29 | [ "Data Structures", "annotated.html", [
30 | [ "Data Structures", "annotated.html", "annotated_dup" ],
31 | [ "Data Structure Index", "classes.html", null ],
32 | [ "Data Fields", "functions.html", [
33 | [ "All", "functions.html", null ],
34 | [ "Variables", "functions_vars.html", null ]
35 | ] ]
36 | ] ],
37 | [ "Files", "files.html", [
38 | [ "File List", "files.html", "files_dup" ],
39 | [ "Globals", "globals.html", [
40 | [ "All", "globals.html", null ],
41 | [ "Functions", "globals_func.html", null ],
42 | [ "Typedefs", "globals_type.html", null ],
43 | [ "Macros", "globals_defs.html", null ]
44 | ] ]
45 | ] ]
46 | ] ]
47 | ];
48 |
49 | var NAVTREEINDEX =
50 | [
51 | "annotated.html"
52 | ];
53 |
54 | var SYNCONMSG = 'click to disable panel synchronization';
55 | var SYNCOFFMSG = 'click to enable panel synchronization';
56 | var LISTOFALLMEMBERS = 'List of all members';
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_flash_ramfunc.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_flash_ramfunc.h
4 | * @author MCD Application Team
5 | * @brief Header file of FLASH RAMFUNC driver.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2017 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file in
13 | * the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | ******************************************************************************
16 | */
17 |
18 | /* Define to prevent recursive inclusion -------------------------------------*/
19 | #ifndef __STM32F4xx_FLASH_RAMFUNC_H
20 | #define __STM32F4xx_FLASH_RAMFUNC_H
21 |
22 | #ifdef __cplusplus
23 | extern "C" {
24 | #endif
25 | #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx) || defined(STM32F412Zx) ||\
26 | defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx)
27 |
28 | /* Includes ------------------------------------------------------------------*/
29 | #include "stm32f4xx_hal_def.h"
30 |
31 | /** @addtogroup STM32F4xx_HAL_Driver
32 | * @{
33 | */
34 |
35 | /** @addtogroup FLASH_RAMFUNC
36 | * @{
37 | */
38 |
39 | /* Exported types ------------------------------------------------------------*/
40 | /* Exported macro ------------------------------------------------------------*/
41 | /* Exported functions --------------------------------------------------------*/
42 | /** @addtogroup FLASH_RAMFUNC_Exported_Functions
43 | * @{
44 | */
45 |
46 | /** @addtogroup FLASH_RAMFUNC_Exported_Functions_Group1
47 | * @{
48 | */
49 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_StopFlashInterfaceClk(void);
50 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_StartFlashInterfaceClk(void);
51 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_EnableFlashSleepMode(void);
52 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_DisableFlashSleepMode(void);
53 | /**
54 | * @}
55 | */
56 |
57 | /**
58 | * @}
59 | */
60 |
61 | /**
62 | * @}
63 | */
64 |
65 | /**
66 | * @}
67 | */
68 |
69 | #endif /* STM32F410xx || STM32F411xE || STM32F446xx || STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F412Cx */
70 | #ifdef __cplusplus
71 | }
72 | #endif
73 |
74 |
75 | #endif /* __STM32F4xx_FLASH_RAMFUNC_H */
76 |
77 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_ltdc_ex.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_ltdc_ex.h
4 | * @author MCD Application Team
5 | * @brief Header file of LTDC HAL Extension module.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2016 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef STM32F4xx_HAL_LTDC_EX_H
21 | #define STM32F4xx_HAL_LTDC_EX_H
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | /* Includes ------------------------------------------------------------------*/
28 | #include "stm32f4xx_hal_def.h"
29 |
30 | #if defined (LTDC) && defined (DSI)
31 |
32 | #include "stm32f4xx_hal_dsi.h"
33 |
34 | /** @addtogroup STM32F4xx_HAL_Driver
35 | * @{
36 | */
37 |
38 | /** @addtogroup LTDCEx
39 | * @{
40 | */
41 |
42 | /* Exported types ------------------------------------------------------------*/
43 | /* Exported constants --------------------------------------------------------*/
44 | /* Exported macro ------------------------------------------------------------*/
45 | /* Exported functions --------------------------------------------------------*/
46 | /** @addtogroup LTDCEx_Exported_Functions
47 | * @{
48 | */
49 |
50 | /** @addtogroup LTDCEx_Exported_Functions_Group1
51 | * @{
52 | */
53 | HAL_StatusTypeDef HAL_LTDCEx_StructInitFromVideoConfig(LTDC_HandleTypeDef *hltdc, DSI_VidCfgTypeDef *VidCfg);
54 | HAL_StatusTypeDef HAL_LTDCEx_StructInitFromAdaptedCommandConfig(LTDC_HandleTypeDef *hltdc, DSI_CmdCfgTypeDef *CmdCfg);
55 | /**
56 | * @}
57 | */
58 |
59 | /**
60 | * @}
61 | */
62 |
63 | /* Private types -------------------------------------------------------------*/
64 | /* Private variables ---------------------------------------------------------*/
65 | /* Private constants ---------------------------------------------------------*/
66 | /* Private macros ------------------------------------------------------------*/
67 | /* Private functions ---------------------------------------------------------*/
68 |
69 | /**
70 | * @}
71 | */
72 |
73 | /**
74 | * @}
75 | */
76 |
77 | #endif /* LTDC && DSI */
78 |
79 | #ifdef __cplusplus
80 | }
81 | #endif
82 |
83 | #endif /* STM32F4xx_HAL_LTDC_EX_H */
84 |
--------------------------------------------------------------------------------
/example/driver_cs100_basic.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file driver_cs100_basic.h
25 | * @brief driver cs100 basic header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2024-07-30
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2024/07/30
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef DRIVER_CS100_BASIC_H
38 | #define DRIVER_CS100_BASIC_H
39 |
40 | #include "driver_cs100_interface.h"
41 |
42 | #ifdef __cplusplus
43 | extern "C"{
44 | #endif
45 |
46 | /**
47 | * @defgroup cs100_example_driver cs100 example driver function
48 | * @brief cs100 example driver modules
49 | * @ingroup cs100_driver
50 | * @{
51 | */
52 |
53 | /**
54 | * @brief basic example init
55 | * @return status code
56 | * - 0 success
57 | * - 1 init failed
58 | * @note none
59 | */
60 | uint8_t cs100_basic_init(void);
61 |
62 | /**
63 | * @brief basic example deinit
64 | * @return status code
65 | * - 0 success
66 | * - 1 deinit failed
67 | * @note none
68 | */
69 | uint8_t cs100_basic_deinit(void);
70 |
71 | /**
72 | * @brief basic example read
73 | * @param[out] *m pointer to a distance buffer
74 | * @return status code
75 | * - 0 success
76 | * - 1 read failed
77 | * @note none
78 | */
79 | uint8_t cs100_basic_read(float *m);
80 |
81 | /**
82 | * @}
83 | */
84 |
85 | #ifdef __cplusplus
86 | }
87 | #endif
88 |
89 | #endif
90 |
--------------------------------------------------------------------------------
/project/stm32f407/usr/inc/system_stm32f4xx.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file system_stm32f4xx.h
4 | * @author MCD Application Team
5 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2017 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /** @addtogroup CMSIS
20 | * @{
21 | */
22 |
23 | /** @addtogroup stm32f4xx_system
24 | * @{
25 | */
26 |
27 | /**
28 | * @brief Define to prevent recursive inclusion
29 | */
30 | #ifndef __SYSTEM_STM32F4XX_H
31 | #define __SYSTEM_STM32F4XX_H
32 |
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif
36 |
37 | /** @addtogroup STM32F4xx_System_Includes
38 | * @{
39 | */
40 |
41 | /**
42 | * @}
43 | */
44 |
45 |
46 | /** @addtogroup STM32F4xx_System_Exported_types
47 | * @{
48 | */
49 | /* This variable is updated in three ways:
50 | 1) by calling CMSIS function SystemCoreClockUpdate()
51 | 2) by calling HAL API function HAL_RCC_GetSysClockFreq()
52 | 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
53 | Note: If you use this function to configure the system clock; then there
54 | is no need to call the 2 first functions listed above, since SystemCoreClock
55 | variable is updated automatically.
56 | */
57 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
58 |
59 | extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */
60 | extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */
61 |
62 | /**
63 | * @}
64 | */
65 |
66 | /** @addtogroup STM32F4xx_System_Exported_Constants
67 | * @{
68 | */
69 |
70 | /**
71 | * @}
72 | */
73 |
74 | /** @addtogroup STM32F4xx_System_Exported_Macros
75 | * @{
76 | */
77 |
78 | /**
79 | * @}
80 | */
81 |
82 | /** @addtogroup STM32F4xx_System_Exported_Functions
83 | * @{
84 | */
85 |
86 | extern void SystemInit(void);
87 | extern void SystemCoreClockUpdate(void);
88 | /**
89 | * @}
90 | */
91 |
92 | #ifdef __cplusplus
93 | }
94 | #endif
95 |
96 | #endif /*__SYSTEM_STM32F4XX_H */
97 |
98 | /**
99 | * @}
100 | */
101 |
102 | /**
103 | * @}
104 | */
105 |
--------------------------------------------------------------------------------
/project/raspberrypi4b/cmake/uninstall.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 - present LibDriver All rights reserved
3 | #
4 | # The MIT License (MIT)
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in all
14 | # copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | # SOFTWARE.
23 | #
24 |
25 | # check the install_manifest.txt
26 | if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
27 | # output the error
28 | message(FATAL_ERROR "cannot find install manifest: ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
29 | endif()
30 |
31 | # read install_manifest.txt to uninstall_list
32 | file(READ "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt" ${CMAKE_PROJECT_NAME}_uninstall_list)
33 |
34 | # replace '\n' to ';'
35 | string(REGEX REPLACE "\n" ";" ${CMAKE_PROJECT_NAME}_uninstall_list "${${CMAKE_PROJECT_NAME}_uninstall_list}")
36 |
37 | # uninstall the list files
38 | foreach(${CMAKE_PROJECT_NAME}_uninstall_list ${${CMAKE_PROJECT_NAME}_uninstall_list})
39 | # if a link or a file
40 | if(IS_SYMLINK "$ENV{DESTDIR}${${CMAKE_PROJECT_NAME}_uninstall_list}" OR EXISTS "$ENV{DESTDIR}${${CMAKE_PROJECT_NAME}_uninstall_list}")
41 | # delete the file
42 | execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${${CMAKE_PROJECT_NAME}_uninstall_list}
43 | RESULT_VARIABLE rm_retval
44 | )
45 |
46 | # check the retval
47 | if(NOT "${rm_retval}" STREQUAL 0)
48 | # output the error
49 | message(FATAL_ERROR "failed to remove file: '${${CMAKE_PROJECT_NAME}_uninstall_list}'.")
50 | else()
51 | # uninstalling files
52 | message(STATUS "uninstalling: $ENV{DESTDIR}${${CMAKE_PROJECT_NAME}_uninstall_list}")
53 | endif()
54 | else()
55 | # output the error
56 | message(STATUS "file: $ENV{DESTDIR}${${CMAKE_PROJECT_NAME}_uninstall_list} does not exist.")
57 | endif()
58 | endforeach()
59 |
--------------------------------------------------------------------------------
/project/stm32f407/cmsis/tz_context.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * @file tz_context.h
3 | * @brief Context Management for Armv8-M TrustZone
4 | * @version V1.0.1
5 | * @date 10. January 2018
6 | ******************************************************************************/
7 | /*
8 | * Copyright (c) 2017-2018 Arm Limited. All rights reserved.
9 | *
10 | * SPDX-License-Identifier: Apache-2.0
11 | *
12 | * Licensed under the Apache License, Version 2.0 (the License); you may
13 | * not use this file except in compliance with the License.
14 | * You may obtain a copy of the License at
15 | *
16 | * www.apache.org/licenses/LICENSE-2.0
17 | *
18 | * Unless required by applicable law or agreed to in writing, software
19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT
20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 | * See the License for the specific language governing permissions and
22 | * limitations under the License.
23 | */
24 |
25 | #if defined ( __ICCARM__ )
26 | #pragma system_include /* treat file as system include file for MISRA check */
27 | #elif defined (__clang__)
28 | #pragma clang system_header /* treat file as system include file */
29 | #endif
30 |
31 | #ifndef TZ_CONTEXT_H
32 | #define TZ_CONTEXT_H
33 |
34 | #include
35 |
36 | #ifndef TZ_MODULEID_T
37 | #define TZ_MODULEID_T
38 | /// \details Data type that identifies secure software modules called by a process.
39 | typedef uint32_t TZ_ModuleId_t;
40 | #endif
41 |
42 | /// \details TZ Memory ID identifies an allocated memory slot.
43 | typedef uint32_t TZ_MemoryId_t;
44 |
45 | /// Initialize secure context memory system
46 | /// \return execution status (1: success, 0: error)
47 | uint32_t TZ_InitContextSystem_S (void);
48 |
49 | /// Allocate context memory for calling secure software modules in TrustZone
50 | /// \param[in] module identifies software modules called from non-secure mode
51 | /// \return value != 0 id TrustZone memory slot identifier
52 | /// \return value 0 no memory available or internal error
53 | TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module);
54 |
55 | /// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S
56 | /// \param[in] id TrustZone memory slot identifier
57 | /// \return execution status (1: success, 0: error)
58 | uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id);
59 |
60 | /// Load secure context (called on RTOS thread context switch)
61 | /// \param[in] id TrustZone memory slot identifier
62 | /// \return execution status (1: success, 0: error)
63 | uint32_t TZ_LoadContext_S (TZ_MemoryId_t id);
64 |
65 | /// Store secure context (called on RTOS thread context switch)
66 | /// \param[in] id TrustZone memory slot identifier
67 | /// \return execution status (1: success, 0: error)
68 | uint32_t TZ_StoreContext_S (TZ_MemoryId_t id);
69 |
70 | #endif // TZ_CONTEXT_H
71 |
--------------------------------------------------------------------------------
/README_zh-Hans.md:
--------------------------------------------------------------------------------
1 | [English](/README.md) | [ 简体中文](/README_zh-Hans.md) | [繁體中文](/README_zh-Hant.md) | [日本語](/README_ja.md) | [Deutsch](/README_de.md) | [한국어](/README_ko.md)
2 |
3 |
6 |
7 | ## LibDriver CS100
8 |
9 | [](/misra/README.md) [](https://www.libdriver.com/docs/cs100/index.html) [](/LICENSE)
10 |
11 | CS100超聲波測距模塊可提供 2cm-400cm的非接觸式距離感測功能,測距精度可達3mm。模塊包括超聲波發射器、接收器與控制電路。
12 |
13 | LibDriver CS100是LibDriver推出的CS100全功能驅動,該驅動提供超聲波測距的功能並且它符合MISRA標準。
14 |
15 | ### 目錄
16 |
17 | - [說明](#說明)
18 | - [安裝](#安裝)
19 | - [使用](#使用)
20 | - [example basic](#example-basic)
21 | - [文檔](#文檔)
22 | - [貢獻](#貢獻)
23 | - [版權](#版權)
24 | - [聯繫我們](#聯繫我們)
25 |
26 | ### 說明
27 |
28 | /src目錄包含了LibDriver CS100的源文件。
29 |
30 | /interface目錄包含了LibDriver CS100與平台無關的gpio模板。
31 |
32 | /test目錄包含了LibDriver CS100驅動測試程序,該程序可以簡單的測試芯片必要功能。
33 |
34 | /example目錄包含了LibDriver CS100編程範例。
35 |
36 | /doc目錄包含了LibDriver CS100離線文檔。
37 |
38 | /datasheet目錄包含了CS100數據手冊。
39 |
40 | /project目錄包含了常用Linux與單片機開發板的工程樣例。所有工程均採用shell腳本作為調試方法,詳細內容可參考每個工程裡面的README.md。
41 |
42 | /misra目錄包含了LibDriver MISRA程式碼掃描結果。
43 |
44 | ### 安裝
45 |
46 | 參考/interface目錄下與平台無關的gpio模板,完成指定平台的gpio驅動。
47 |
48 | 將/src目錄,您使用平臺的介面驅動和您開發的驅動加入工程,如果您想要使用默認的範例驅動,可以將/example目錄加入您的工程。
49 |
50 | ### 使用
51 |
52 | 您可以參考/example目錄下的程式設計範例完成適合您的驅動,如果您想要使用默認的程式設計範例,以下是它們的使用方法。
53 |
54 | #### example basic
55 |
56 | ```C
57 | #include "driver_cs100_basic.h"
58 |
59 | uint8_t res;
60 | uint8_t i;
61 | float m;
62 |
63 | res = cs100_basic_init();
64 | if (res != 0)
65 | {
66 | return 1;
67 | }
68 |
69 | ...
70 |
71 | for (i = 0; i < 3; i++)
72 | {
73 | res = cs100_basic_read((float *)&m);
74 | if (res != 0)
75 | {
76 | (void)cs100_basic_deinit();
77 |
78 | return 1;
79 | }
80 | cs100_interface_delay_ms(1000);
81 | cs100_interface_debug_print("cs100: distance is %0.4fm.\n", m);
82 |
83 | ...
84 |
85 | }
86 |
87 | ...
88 |
89 | (void)cs100_basic_deinit();
90 |
91 | return 0;
92 | ```
93 |
94 | ### 文檔
95 |
96 | 在線文檔: [https://www.libdriver.com/docs/cs100/index.html](https://www.libdriver.com/docs/cs100/index.html)。
97 |
98 | 離線文檔: /doc/html/index.html。
99 |
100 | ### 貢獻
101 |
102 | 請參攷CONTRIBUTING.md。
103 |
104 | ### 版權
105 |
106 | 版權 (c) 2015 - 現在 LibDriver 版權所有
107 |
108 | MIT 許可證(MIT)
109 |
110 | 特此免費授予任何獲得本軟件副本和相關文檔文件(下稱“軟件”)的人不受限制地處置該軟件的權利,包括不受限制地使用、複製、修改、合併、發布、分發、轉授許可和/或出售該軟件副本,以及再授權被配發了本軟件的人如上的權利,須在下列條件下:
111 |
112 | 上述版權聲明和本許可聲明應包含在該軟件的所有副本或實質成分中。
113 |
114 | 本軟件是“如此”提供的,沒有任何形式的明示或暗示的保證,包括但不限於對適銷性、特定用途的適用性和不侵權的保證。在任何情況下,作者或版權持有人都不對任何索賠、損害或其他責任負責,無論這些追責來自合同、侵權或其它行為中,還是產生於、源於或有關於本軟件以及本軟件的使用或其它處置。
115 |
116 | ### 聯繫我們
117 |
118 | 請聯繫lishifenging@outlook.com。
119 |
--------------------------------------------------------------------------------
/doc/html/clipboard.js:
--------------------------------------------------------------------------------
1 | /**
2 |
3 | The code below is based on the Doxygen Awesome project, see
4 | https://github.com/jothepro/doxygen-awesome-css
5 |
6 | MIT License
7 |
8 | Copyright (c) 2021 - 2022 jothepro
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy
11 | of this software and associated documentation files (the "Software"), to deal
12 | in the Software without restriction, including without limitation the rights
13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | copies of the Software, and to permit persons to whom the Software is
15 | furnished to do so, subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in all
18 | copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | SOFTWARE.
27 |
28 | */
29 |
30 | let clipboard_title = "Copy to clipboard"
31 | let clipboard_icon = ``
32 | let clipboard_successIcon = ``
33 | let clipboard_successDuration = 1000
34 |
35 | $(function() {
36 | if(navigator.clipboard) {
37 | const fragments = document.getElementsByClassName("fragment")
38 | for(const fragment of fragments) {
39 | const clipboard_div = document.createElement("div")
40 | clipboard_div.classList.add("clipboard")
41 | clipboard_div.innerHTML = clipboard_icon
42 | clipboard_div.title = clipboard_title
43 | $(clipboard_div).click(function() {
44 | const content = this.parentNode.cloneNode(true)
45 | // filter out line number and folded fragments from file listings
46 | content.querySelectorAll(".lineno, .ttc, .foldclosed").forEach((node) => { node.remove() })
47 | let text = content.textContent
48 | // remove trailing newlines and trailing spaces from empty lines
49 | text = text.replace(/^\s*\n/gm,'\n').replace(/\n*$/,'')
50 | navigator.clipboard.writeText(text);
51 | this.classList.add("success")
52 | this.innerHTML = clipboard_successIcon
53 | window.setTimeout(() => { // switch back to normal icon after timeout
54 | this.classList.remove("success")
55 | this.innerHTML = clipboard_icon
56 | }, clipboard_successDuration);
57 | })
58 | fragment.insertBefore(clipboard_div, fragment.firstChild)
59 | }
60 | }
61 | })
62 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_dma_ex.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_dma_ex.h
4 | * @author MCD Application Team
5 | * @brief Header file of DMA HAL extension module.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2017 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file in
13 | * the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef __STM32F4xx_HAL_DMA_EX_H
21 | #define __STM32F4xx_HAL_DMA_EX_H
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | /* Includes ------------------------------------------------------------------*/
28 | #include "stm32f4xx_hal_def.h"
29 |
30 | /** @addtogroup STM32F4xx_HAL_Driver
31 | * @{
32 | */
33 |
34 | /** @addtogroup DMAEx
35 | * @{
36 | */
37 |
38 | /* Exported types ------------------------------------------------------------*/
39 | /** @defgroup DMAEx_Exported_Types DMAEx Exported Types
40 | * @brief DMAEx Exported types
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief HAL DMA Memory definition
46 | */
47 | typedef enum
48 | {
49 | MEMORY0 = 0x00U, /*!< Memory 0 */
50 | MEMORY1 = 0x01U /*!< Memory 1 */
51 | }HAL_DMA_MemoryTypeDef;
52 |
53 | /**
54 | * @}
55 | */
56 |
57 | /* Exported functions --------------------------------------------------------*/
58 | /** @defgroup DMAEx_Exported_Functions DMAEx Exported Functions
59 | * @brief DMAEx Exported functions
60 | * @{
61 | */
62 |
63 | /** @defgroup DMAEx_Exported_Functions_Group1 Extended features functions
64 | * @brief Extended features functions
65 | * @{
66 | */
67 |
68 | /* IO operation functions *******************************************************/
69 | HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength);
70 | HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength);
71 | HAL_StatusTypeDef HAL_DMAEx_ChangeMemory(DMA_HandleTypeDef *hdma, uint32_t Address, HAL_DMA_MemoryTypeDef memory);
72 |
73 | /**
74 | * @}
75 | */
76 | /**
77 | * @}
78 | */
79 |
80 | /* Private functions ---------------------------------------------------------*/
81 | /** @defgroup DMAEx_Private_Functions DMAEx Private Functions
82 | * @brief DMAEx Private functions
83 | * @{
84 | */
85 | /**
86 | * @}
87 | */
88 |
89 | /**
90 | * @}
91 | */
92 |
93 | /**
94 | * @}
95 | */
96 |
97 | #ifdef __cplusplus
98 | }
99 | #endif
100 |
101 | #endif /*__STM32F4xx_HAL_DMA_EX_H*/
102 |
103 |
--------------------------------------------------------------------------------
/misra/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ### Table of Contents
6 |
7 | - [Introduce](#Introduce)
8 | - [Classification](#Classification)
9 | - [Compliance](#Compliance)
10 | - [Code](#Code)
11 | - [Report](#Report)
12 |
13 | ### Introduce
14 |
15 | MISRA C is a set of software development guidelines for the C programming language developed by The MISRA Consortium. Its aims are to facilitate code safety, security, portability and reliability in the context of embedded systems, specifically those systems programmed in ISO C / C90 / C99.
16 |
17 | Although originally specifically targeted at the automotive industry, MISRA C has evolved as a widely accepted model for best practices by leading developers in sectors including automotive, aerospace, telecom, medical devices, defense, railway, and others.
18 |
19 | ### Classification
20 |
21 | Each Guideline is classified as Mandatory(new for MISRA C:2012), Required or Advisory.
22 |
23 | - Mandatory guidelines shall always be complied with
24 | - Required guidelines shall be complied with, unless subject to a Deviation
25 | - Advisory guidelines are considered good practice, but compliance is less formal.
26 |
27 | ### Compliance
28 |
29 | In order for a piece of software to claim to be compliant to the MISRA C Guidelines, all mandatory rules shall be met and all required rules and directives shall either be met or subject to a formal deviation.
30 |
31 | Many MISRA C rules can be characterized as guidelines because under certain condition software engineers may deviate from rules and still be considered compliant with the standard. Deviations must be documented either in the code or in a file. In addition; proof must be provided that the software engineer has considered the safety of the system and that deviating from the rule will not have a negative impact, requirements for deviations also include:
32 |
33 | - The rule deviated from.
34 | - Rationale for deviation.
35 |
36 | ### Code
37 |
38 | LibDriver complies with deviated MISRA standards. LibDriver complies with all mandatory guidelines and most required guidelines, the deviations are shown in Table 1.
39 |
40 |
Table 1. Guideline Deviations
41 |
42 | | Guideline | Description | Status | Explanation | Severity |
43 | | --------- | ------------------------------------------------------------ | ------------ | ------------------------------------------------------------ | -------- |
44 | | 10.4 | Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category. (\|, &, <<, >>) | incompatible | We use this function to convert driver data and drivers guarantee the safety of the operation. | very low |
45 | | 10.8 | The value of a composite expression shall not be cast to a different essential type category or a wider essential type. | incompatible | We use this function to convert driver data and drivers guarantee the safety of the operation. | very low |
46 |
47 | ### Report
48 |
49 | Detailed reports can be found in /misra/cs100_polyspace_report.pdf.
50 |
--------------------------------------------------------------------------------
/doc/html/group__cs100__base__driver.js:
--------------------------------------------------------------------------------
1 | var group__cs100__base__driver =
2 | [
3 | [ "cs100_time_s", "structcs100__time__s.html", [
4 | [ "microsecond", "structcs100__time__s.html#ae8f6fcb839f13e81b2edc3679d1147b0", null ],
5 | [ "millisecond", "structcs100__time__s.html#a53f7baced583fe51c9a6f7df5977954a", null ]
6 | ] ],
7 | [ "cs100_handle_s", "structcs100__handle__s.html", [
8 | [ "debug_print", "structcs100__handle__s.html#a769d5b3a6c14790a0e126e8fe70b384b", null ],
9 | [ "delay_ms", "structcs100__handle__s.html#a406c9433252b7366de417b7a60915c81", null ],
10 | [ "delay_us", "structcs100__handle__s.html#a538ee5e27967b126ec220df6386d3f43", null ],
11 | [ "echo_deinit", "structcs100__handle__s.html#a7509d96f6e6ce46577b13e85a6abc04c", null ],
12 | [ "echo_init", "structcs100__handle__s.html#aec302f5f133b24b28015ba16debf1475", null ],
13 | [ "echo_read", "structcs100__handle__s.html#a51e661d74ab40a6bd36c4ceab62b7809", null ],
14 | [ "inited", "structcs100__handle__s.html#a19bedf28d2b9748f6a62d9ae93f4e68f", null ],
15 | [ "timestamp_read", "structcs100__handle__s.html#a22896342547ba90f9a8db9e18a259250", null ],
16 | [ "trig_deinit", "structcs100__handle__s.html#a8718ff3ae6d699a9954bcc5ccfb63a65", null ],
17 | [ "trig_init", "structcs100__handle__s.html#a9659dbaddeda5b509977a525914e62db", null ],
18 | [ "trig_write", "structcs100__handle__s.html#a8519ecd7e11e0093ee1e7afc3559a6ab", null ]
19 | ] ],
20 | [ "cs100_info_s", "structcs100__info__s.html", [
21 | [ "chip_name", "structcs100__info__s.html#af890958c72bd715cc6454a10dc846ae6", null ],
22 | [ "driver_version", "structcs100__info__s.html#a41b0bd442708b70d252c50b92c75265a", null ],
23 | [ "interface", "structcs100__info__s.html#aebaa6c28dd4f2c3dc27566fcb910fd28", null ],
24 | [ "manufacturer_name", "structcs100__info__s.html#ad25285dbf810c90f8eaf3fcef6f2b2ea", null ],
25 | [ "max_current_ma", "structcs100__info__s.html#a9db82802561bf22d799b03a345f1d1dc", null ],
26 | [ "supply_voltage_max_v", "structcs100__info__s.html#a3d2b12bcac7a85ea8646bff9debe8660", null ],
27 | [ "supply_voltage_min_v", "structcs100__info__s.html#ad8bde6ddadaf43d951e62f3befb9d35a", null ],
28 | [ "temperature_max", "structcs100__info__s.html#a3366a5dce9b829e03c3d321c2b4df3f6", null ],
29 | [ "temperature_min", "structcs100__info__s.html#a8f9dbe66ac0b66ebae0a36fcb4ba368e", null ]
30 | ] ],
31 | [ "CS100_READ_RETRY_TIMES", "group__cs100__base__driver.html#ga9ab9fff636a397b768cdbb2d5c39ac6e", null ],
32 | [ "cs100_handle_t", "group__cs100__base__driver.html#ga55444d069aa739ea9565e1c01b31b8e1", null ],
33 | [ "cs100_info_t", "group__cs100__base__driver.html#ga0c39bccc7299c56f3e8435342517762a", null ],
34 | [ "cs100_time_t", "group__cs100__base__driver.html#ga383cabafeb8f9c93ad81a8490106d0d5", null ],
35 | [ "cs100_deinit", "group__cs100__base__driver.html#gae4568feac1c50b12520af80d703910f3", null ],
36 | [ "cs100_info", "group__cs100__base__driver.html#ga9810c9aba375864526bb5da41b105fd2", null ],
37 | [ "cs100_init", "group__cs100__base__driver.html#ga4fe3432564b78c97043ed098d6ef6ada", null ],
38 | [ "cs100_read", "group__cs100__base__driver.html#gaeef03946dadfb3af7df907fcd4dd0385", null ]
39 | ];
--------------------------------------------------------------------------------
/project/stm32f407/usr/inc/stm32f4xx_it.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file stm32f4xx_it.h
25 | * @brief stm32f4xx it header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef STM32F4XX_IT_H
38 | #define STM32F4XX_IT_H
39 |
40 | #include "stm32f4xx_hal.h"
41 |
42 | #ifdef __cplusplus
43 | extern "C" {
44 | #endif
45 |
46 | /**
47 | * @defgroup IT HAL_IT_Private_Functions
48 | * @{
49 | */
50 |
51 | /**
52 | * @brief nmi handler
53 | * @note none
54 | */
55 | void NMI_Handler(void);
56 |
57 | /**
58 | * @brief hardfault handler
59 | * @note none
60 | */
61 | void HardFault_Handler(void);
62 |
63 | /**
64 | * @brief memory manage handler
65 | * @note none
66 | */
67 | void MemManage_Handler(void);
68 |
69 | /**
70 | * @brief bus fault handler
71 | * @note none
72 | */
73 | void BusFault_Handler(void);
74 |
75 | /**
76 | * @brief usage fault handler
77 | * @note none
78 | */
79 | void UsageFault_Handler(void);
80 |
81 | /**
82 | * @brief svc handler
83 | * @note none
84 | */
85 | void SVC_Handler(void);
86 |
87 | /**
88 | * @brief debug handler
89 | * @note none
90 | */
91 | void DebugMon_Handler(void);
92 |
93 | /**
94 | * @brief pendsv handler
95 | * @note none
96 | */
97 | void PendSV_Handler(void);
98 |
99 | /**
100 | * @brief systick handler
101 | * @note none
102 | */
103 | void SysTick_Handler(void);
104 |
105 | /**
106 | * @brief usart1 irq handler
107 | * @note none
108 | */
109 | void USART1_IRQHandler(void);
110 |
111 | /**
112 | * @brief usart2 irq handler
113 | * @note none
114 | */
115 | void USART2_IRQHandler(void);
116 |
117 | /**
118 | * @}
119 | */
120 |
121 | #ifdef __cplusplus
122 | }
123 | #endif
124 |
125 | #endif
126 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/src/stm32f4xx_hal_msp_template.c:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_msp_template.c
4 | * @author MCD Application Team
5 | * @brief This file contains the HAL System and Peripheral (PPP) MSP initialization
6 | * and de-initialization functions.
7 | * It should be copied to the application folder and renamed into 'stm32f4xx_hal_msp.c'.
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * Copyright (c) 2017 STMicroelectronics.
12 | * All rights reserved.
13 | *
14 | * This software is licensed under terms that can be found in the LICENSE file
15 | * in the root directory of this software component.
16 | * If no LICENSE file comes with this software, it is provided AS-IS.
17 | *
18 | ******************************************************************************
19 | */
20 |
21 | /* Includes ------------------------------------------------------------------*/
22 | #include "stm32f4xx_hal.h"
23 |
24 | /** @addtogroup STM32F4xx_HAL_Driver
25 | * @{
26 | */
27 |
28 | /** @defgroup HAL_MSP HAL MSP
29 | * @brief HAL MSP module.
30 | * @{
31 | */
32 |
33 | /* Private typedef -----------------------------------------------------------*/
34 | /* Private define ------------------------------------------------------------*/
35 | /* Private macro -------------------------------------------------------------*/
36 | /* Private variables ---------------------------------------------------------*/
37 | /* Private function prototypes -----------------------------------------------*/
38 | /* Private functions ---------------------------------------------------------*/
39 |
40 | /** @defgroup HAL_MSP_Private_Functions HAL MSP Private Functions
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initializes the Global MSP.
46 | * @note This function is called from HAL_Init() function to perform system
47 | * level initialization (GPIOs, clock, DMA, interrupt).
48 | * @retval None
49 | */
50 | void HAL_MspInit(void)
51 | {
52 |
53 | }
54 |
55 | /**
56 | * @brief DeInitializes the Global MSP.
57 | * @note This functiona is called from HAL_DeInit() function to perform system
58 | * level de-initialization (GPIOs, clock, DMA, interrupt).
59 | * @retval None
60 | */
61 | void HAL_MspDeInit(void)
62 | {
63 |
64 | }
65 |
66 | /**
67 | * @brief Initializes the PPP MSP.
68 | * @note This functiona is called from HAL_PPP_Init() function to perform
69 | * peripheral(PPP) system level initialization (GPIOs, clock, DMA, interrupt)
70 | * @retval None
71 | */
72 | void HAL_PPP_MspInit(void)
73 | {
74 |
75 | }
76 |
77 | /**
78 | * @brief DeInitializes the PPP MSP.
79 | * @note This functiona is called from HAL_PPP_DeInit() function to perform
80 | * peripheral(PPP) system level de-initialization (GPIOs, clock, DMA, interrupt)
81 | * @retval None
82 | */
83 | void HAL_PPP_MspDeInit(void)
84 | {
85 |
86 | }
87 |
88 | /**
89 | * @}
90 | */
91 |
92 | /**
93 | * @}
94 | */
95 |
96 | /**
97 | * @}
98 | */
99 |
100 |
101 |
--------------------------------------------------------------------------------
/doc/image/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/src/stm32f4xx_ll_rng.c:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_ll_rng.c
4 | * @author MCD Application Team
5 | * @brief RNG LL module driver.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2016 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 | #if defined(USE_FULL_LL_DRIVER)
19 |
20 | /* Includes ------------------------------------------------------------------*/
21 | #include "stm32f4xx_ll_rng.h"
22 | #include "stm32f4xx_ll_bus.h"
23 |
24 | #ifdef USE_FULL_ASSERT
25 | #include "stm32_assert.h"
26 | #else
27 | #define assert_param(expr) ((void)0U)
28 | #endif /* USE_FULL_ASSERT */
29 |
30 | /** @addtogroup STM32F4xx_LL_Driver
31 | * @{
32 | */
33 |
34 | #if defined (RNG)
35 |
36 | /** @addtogroup RNG_LL
37 | * @{
38 | */
39 |
40 | /* Private types -------------------------------------------------------------*/
41 | /* Private variables ---------------------------------------------------------*/
42 | /* Private constants ---------------------------------------------------------*/
43 | /* Private macros ------------------------------------------------------------*/
44 | /* Private function prototypes -----------------------------------------------*/
45 |
46 | /* Exported functions --------------------------------------------------------*/
47 | /** @addtogroup RNG_LL_Exported_Functions
48 | * @{
49 | */
50 |
51 | /** @addtogroup RNG_LL_EF_Init
52 | * @{
53 | */
54 |
55 | /**
56 | * @brief De-initialize RNG registers (Registers restored to their default values).
57 | * @param RNGx RNG Instance
58 | * @retval An ErrorStatus enumeration value:
59 | * - SUCCESS: RNG registers are de-initialized
60 | * - ERROR: not applicable
61 | */
62 | ErrorStatus LL_RNG_DeInit(RNG_TypeDef *RNGx)
63 | {
64 | ErrorStatus status = SUCCESS;
65 |
66 | /* Check the parameters */
67 | assert_param(IS_RNG_ALL_INSTANCE(RNGx));
68 | if (RNGx == RNG)
69 | {
70 | #if !defined(RCC_AHB2_SUPPORT)
71 | /* Enable RNG reset state */
72 | LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_RNG);
73 |
74 | /* Release RNG from reset state */
75 | LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_RNG);
76 | #else
77 | /* Enable RNG reset state */
78 | LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_RNG);
79 |
80 | /* Release RNG from reset state */
81 | LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_RNG);
82 | #endif /* !RCC_AHB2_SUPPORT */
83 | }
84 | else
85 | {
86 | status = ERROR;
87 | }
88 |
89 | return status;
90 | }
91 |
92 | /**
93 | * @}
94 | */
95 |
96 | /**
97 | * @}
98 | */
99 |
100 | /**
101 | * @}
102 | */
103 |
104 | #endif /* RNG */
105 |
106 | /**
107 | * @}
108 | */
109 |
110 | #endif /* USE_FULL_LL_DRIVER */
111 |
112 |
--------------------------------------------------------------------------------
/project/stm32f407/interface/inc/tim.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2022 - present LibTutorial All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file tim.h
25 | * @brief tim header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef TIM_H
38 | #define TIM_H
39 |
40 | #include "stm32f4xx_hal.h"
41 |
42 | #ifdef __cplusplus
43 | extern "C" {
44 | #endif
45 |
46 | /**
47 | * @defgroup tim tim function
48 | * @brief tim function modules
49 | * @{
50 | */
51 |
52 | /**
53 | * @brief timer init
54 | * @param[in] us interrupt time
55 | * @param[in] *tim_irq pointer to a timer irq function address
56 | * @return status code
57 | * - 0 success
58 | * - 1 init failed
59 | * - 2 us must be over zero
60 | * @note none
61 | */
62 | uint8_t tim_init(uint32_t us, void (*tim_irq)(uint32_t us));
63 |
64 | /**
65 | * @brief timer deint
66 | * @return status code
67 | * - 0 success
68 | * - 1 deinit
69 | * @note none
70 | */
71 | uint8_t tim_deinit(void);
72 |
73 | /**
74 | * @brief start the timer
75 | * @return status code
76 | * - 0 success
77 | * - 1 start failed
78 | * @note none
79 | */
80 | uint8_t tim_start(void);
81 |
82 | /**
83 | * @brief stop the timer
84 | * @return status code
85 | * - 0 success
86 | * - 1 stop failed
87 | * @note none
88 | */
89 | uint8_t tim_stop(void);
90 |
91 | /**
92 | * @brief get the timer handle
93 | * @return pointer to a timer handle
94 | * @note none
95 | */
96 | TIM_HandleTypeDef* tim_get_handle(void);
97 |
98 | /**
99 | * @brief timer irq handler
100 | * @note none
101 | */
102 | void tim_irq_handler(void);
103 |
104 | /**
105 | * @}
106 | */
107 |
108 | #ifdef __cplusplus
109 | }
110 | #endif
111 |
112 | #endif
113 |
--------------------------------------------------------------------------------
/project/stm32f407/interface/src/delay.c:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file delay.c
25 | * @brief delay source file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #include "delay.h"
38 |
39 | static volatile uint32_t gs_fac_us = 0; /**< fac cnt */
40 |
41 | /**
42 | * @brief delay clock init
43 | * @return status code
44 | * - 0 success
45 | * @note none
46 | */
47 | uint8_t delay_init(void)
48 | {
49 | /* usr HCLK */
50 | HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
51 |
52 | /* set fac */
53 | gs_fac_us = 168;
54 |
55 | return 0;
56 | }
57 |
58 | /**
59 | * @brief delay us
60 | * @param[in] us time
61 | * @note none
62 | */
63 | void delay_us(uint32_t us)
64 | {
65 | uint32_t ticks;
66 | uint32_t told;
67 | uint32_t tnow;
68 | uint32_t tcnt;
69 | uint32_t reload;
70 |
71 | /* set the used param */
72 | tcnt = 0;
73 | reload = SysTick->LOAD;
74 | ticks = us * gs_fac_us;
75 | told = SysTick->VAL;
76 |
77 | /* delay */
78 | while (1)
79 | {
80 | tnow = SysTick->VAL;
81 | if (tnow != told)
82 | {
83 | if (tnow < told)
84 | {
85 | tcnt += told - tnow;
86 | }
87 | else
88 | {
89 | tcnt += reload - tnow + told;
90 | }
91 | told = tnow;
92 | if (tcnt >= ticks)
93 | {
94 | break;
95 | }
96 | }
97 | }
98 | }
99 |
100 | /**
101 | * @brief delay ms
102 | * @param[in] ms time
103 | * @note none
104 | */
105 | void delay_ms(uint32_t ms)
106 | {
107 | /* use the hal delay */
108 | HAL_Delay(ms);
109 | }
110 |
--------------------------------------------------------------------------------
/project/stm32f407/interface/inc/wire.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file wire.h
25 | * @brief wire header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef WIRE_H
38 | #define WIRE_H
39 |
40 | #include "stm32f4xx_hal.h"
41 |
42 | #ifdef __cplusplus
43 | extern "C" {
44 | #endif
45 |
46 | /**
47 | * @defgroup wire wire function
48 | * @brief wire function modules
49 | * @{
50 | */
51 |
52 | /**
53 | * @brief wire bus init
54 | * @return status code
55 | * - 0 success
56 | * @note IO is PA8
57 | */
58 | uint8_t wire_init(void);
59 |
60 | /**
61 | * @brief wire bus deint
62 | * @return status code
63 | * - 0 success
64 | * @note none
65 | */
66 | uint8_t wire_deinit(void);
67 |
68 | /**
69 | * @brief wire bus read data
70 | * @param[out] *value pointer to a read data buffer
71 | * @return status code
72 | * - 0 success
73 | * @note none
74 | */
75 | uint8_t wire_read(uint8_t *value);
76 |
77 | /**
78 | * @brief wire bus write data
79 | * @param[in] value write data
80 | * @return status code
81 | * - 0 success
82 | * @note none
83 | */
84 | uint8_t wire_write(uint8_t value);
85 |
86 | /**
87 | * @brief wire bus init
88 | * @return status code
89 | * - 0 success
90 | * @note IO is PA0
91 | */
92 | uint8_t wire_clock_init(void);
93 |
94 | /**
95 | * @brief wire bus deint
96 | * @return status code
97 | * - 0 success
98 | * @note none
99 | */
100 | uint8_t wire_clock_deinit(void);
101 |
102 | /**
103 | * @brief wire bus write the data
104 | * @param[in] value write data
105 | * @return status code
106 | * - 0 success
107 | * @note none
108 | */
109 | uint8_t wire_clock_write(uint8_t value);
110 |
111 | /**
112 | * @}
113 | */
114 |
115 | #ifdef __cplusplus
116 | }
117 | #endif
118 |
119 | #endif
120 |
--------------------------------------------------------------------------------
/project/stm32f407/interface/src/clock.c:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file clock.c
25 | * @brief clock source file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
6 |
7 | ## LibDriver CS100
8 |
9 | [](/misra/README.md) [](https://www.libdriver.com/docs/cs100/index.html) [](/LICENSE)
10 |
11 | CS100 초음파 범위 모듈은 2cm-400cm의 비접촉 거리 감지 기능을 제공할 수 있습니다. 범위 정확도는 3mm에 도달할 수 있습니다. 모듈에는 초음파 송신기, 수신기 및 제어 회로가 포함됩니다.
12 |
13 | LibDriver CS100는 LibDriver에서 출시한 CS100 전체 기능 드라이버입니다. 초음파 측정 기능을 제공합니다. LibDriver는 MISRA를 준수합니다.
14 |
15 | ### 콘텐츠
16 |
17 | - [설명](#설명)
18 | - [설치](#설치)
19 | - [사용](#사용)
20 | - [example basic](#example-basic)
21 | - [문서](#문서)
22 | - [기고](#기고)
23 | - [저작권](#저작권)
24 | - [문의하기](#문의하기)
25 |
26 | ### 설명
27 |
28 | /src 디렉토리에는 LibDriver CS100의 소스 파일이 포함되어 있습니다.
29 |
30 | /interface 디렉토리에는 LibDriver CS100용 플랫폼 독립적인 gpio버스 템플릿이 포함되어 있습니다.
31 |
32 | /test 디렉토리에는 LibDriver CS100드라이버 테스트 프로그램이 포함되어 있어 칩의 필요한 기능을 간단히 테스트할 수 있습니다.
33 |
34 | /example 디렉토리에는 LibDriver CS100프로그래밍 예제가 포함되어 있습니다.
35 |
36 | /doc 디렉토리에는 LibDriver CS100오프라인 문서가 포함되어 있습니다.
37 |
38 | /datasheet 디렉토리에는 CS100데이터시트가 있습니다.
39 |
40 | /project 디렉토리에는 일반적으로 사용되는 Linux 및 마이크로컨트롤러 개발 보드의 프로젝트 샘플이 포함되어 있습니다. 모든 프로젝트는 디버깅 방법으로 셸 스크립트를 사용하며, 자세한 내용은 각 프로젝트의 README.md를 참조하십시오.
41 |
42 | /misra 에는 LibDriver misra 코드 검색 결과가 포함됩니다.
43 |
44 | ### 설치
45 |
46 | /interface 디렉토리에서 플랫폼 독립적인 gpio 버스 템플릿을 참조하여 지정된 플랫폼에 대한 gpioI 버스 드라이버를 완성하십시오.
47 |
48 | /src 디렉터리, 플랫폼용 인터페이스 드라이버 및 자체 드라이버를 프로젝트에 추가합니다. 기본 예제 드라이버를 사용하려면 /example 디렉터리를 프로젝트에 추가합니다.
49 |
50 | ### 사용
51 |
52 | /example 디렉터리의 예제를 참조하여 자신만의 드라이버를 완성할 수 있습니다. 기본 프로그래밍 예제를 사용하려는 경우 사용 방법은 다음과 같습니다.
53 |
54 | #### example basic
55 |
56 | ```C
57 | #include "driver_cs100_basic.h"
58 |
59 | uint8_t res;
60 | uint8_t i;
61 | float m;
62 |
63 | res = cs100_basic_init();
64 | if (res != 0)
65 | {
66 | return 1;
67 | }
68 |
69 | ...
70 |
71 | for (i = 0; i < 3; i++)
72 | {
73 | res = cs100_basic_read((float *)&m);
74 | if (res != 0)
75 | {
76 | (void)cs100_basic_deinit();
77 |
78 | return 1;
79 | }
80 | cs100_interface_delay_ms(1000);
81 | cs100_interface_debug_print("cs100: distance is %0.4fm.\n", m);
82 |
83 | ...
84 |
85 | }
86 |
87 | ...
88 |
89 | (void)cs100_basic_deinit();
90 |
91 | return 0;
92 | ```
93 |
94 | ### 문서
95 |
96 | 온라인 문서: [https://www.libdriver.com/docs/cs100/index.html](https://www.libdriver.com/docs/cs100/index.html).
97 |
98 | 오프라인 문서: /doc/html/index.html.
99 |
100 | ### 기고
101 |
102 | CONTRIBUTING.md 를 참조하십시오.
103 |
104 | ### 저작권
105 |
106 | 저작권 (c) 2015 - 지금 LibDriver 판권 소유
107 |
108 | MIT 라이선스(MIT)
109 |
110 | 이 소프트웨어 및 관련 문서 파일("소프트웨어")의 사본을 얻은 모든 사람은 이에 따라 무제한 사용, 복제, 수정, 통합, 출판, 배포, 2차 라이선스를 포함하여 소프트웨어를 처분할 수 있는 권리가 부여됩니다. 소프트웨어의 사본에 대한 라이선스 및/또는 판매, 그리고 소프트웨어가 위와 같이 배포된 사람의 권리에 대한 2차 라이선스는 다음 조건에 따릅니다.
111 |
112 | 위의 저작권 표시 및 이 허가 표시는 이 소프트웨어의 모든 사본 또는 내용에 포함됩니다.
113 |
114 | 이 소프트웨어는 상품성, 특정 목적에의 적합성 및 비침해에 대한 보증을 포함하되 이에 국한되지 않는 어떠한 종류의 명시적 또는 묵시적 보증 없이 "있는 그대로" 제공됩니다. 어떤 경우에도 저자 또는 저작권 소유자는 계약, 불법 행위 또는 기타 방식에 관계없이 소프트웨어 및 기타 소프트웨어 사용으로 인해 발생하거나 이와 관련하여 발생하는 청구, 손해 또는 기타 책임에 대해 책임을 지지 않습니다.
115 |
116 | ### 문의하기
117 |
118 | 연락주세요lishifenging@outlook.com.
--------------------------------------------------------------------------------
/README_ja.md:
--------------------------------------------------------------------------------
1 | [English](/README.md) | [ 简体中文](/README_zh-Hans.md) | [繁體中文](/README_zh-Hant.md) | [日本語](/README_ja.md) | [Deutsch](/README_de.md) | [한국어](/README_ko.md)
2 |
3 |
4 |
5 |
6 |
7 | ## LibDriver CS100
8 |
9 | [](/misra/README.md) [](https://www.libdriver.com/docs/cs100/index.html) [](/LICENSE)
10 |
11 | CS100超音波測距モジュールは、2cm〜400cmの非接触距離検知機能を提供できます。測距精度は3mmに達することができます。 モジュールには、超音波送信機、受信機、および制御回路が含まれています。
12 |
13 | LibDriver CS100は、LibDriverによって起動されたCS100フル機能ドライバーです。超音波レンジングの機能を提供します。LibDriverはMISRAに準拠しています。
14 |
15 | ### 目次
16 |
17 | - [説明](#説明)
18 | - [インストール](#インストール)
19 | - [使用](#使用)
20 | - [example basic](#example-basic)
21 | - [ドキュメント](#ドキュメント)
22 | - [貢献](#貢献)
23 | - [著作権](#著作権)
24 | - [連絡して](#連絡して)
25 |
26 | ### 説明
27 |
28 | / srcディレクトリには、LibDriver CS100のソースファイルが含まれています。
29 |
30 | / interfaceディレクトリには、LibDriver CS100用のプラットフォームに依存しないgpioバステンプレートが含まれています。
31 |
32 | / testディレクトリには、チップの必要な機能を簡単にテストできるLibDriver CS100ドライバーテストプログラムが含まれています。
33 |
34 | / exampleディレクトリには、LibDriver CS100プログラミング例が含まれています。
35 |
36 | / docディレクトリには、LibDriver CS100オフラインドキュメントが含まれています。
37 |
38 | / datasheetディレクトリには、CS100データシートが含まれています。
39 |
40 | / projectディレクトリには、一般的に使用されるLinuxおよびマイクロコントローラー開発ボードのプロジェクトサンプルが含まれています。 すべてのプロジェクトは、デバッグ方法としてシェルスクリプトを使用しています。詳細については、各プロジェクトのREADME.mdを参照してください。
41 |
42 | / misraはLibDriver misraコードスキャン結果を含む。
43 |
44 | ### インストール
45 |
46 | / interfaceディレクトリにあるプラットフォームに依存しないgpioバステンプレートを参照して、指定したプラットフォームのgpioバスドライバを完成させます。
47 |
48 | /src ディレクトリ、プラットフォームのインターフェイス ドライバー、および独自のドライバーをプロジェクトに追加します。デフォルトのサンプル ドライバーを使用する場合は、/example ディレクトリをプロジェクトに追加します。
49 |
50 | ### 使用
51 |
52 | /example ディレクトリ内のサンプルを参照して、独自のドライバーを完成させることができます。 デフォルトのプログラミング例を使用したい場合の使用方法は次のとおりです。
53 |
54 | #### example basic
55 |
56 | ```C
57 | #include "driver_cs100_basic.h"
58 |
59 | uint8_t res;
60 | uint8_t i;
61 | float m;
62 |
63 | res = cs100_basic_init();
64 | if (res != 0)
65 | {
66 | return 1;
67 | }
68 |
69 | ...
70 |
71 | for (i = 0; i < 3; i++)
72 | {
73 | res = cs100_basic_read((float *)&m);
74 | if (res != 0)
75 | {
76 | (void)cs100_basic_deinit();
77 |
78 | return 1;
79 | }
80 | cs100_interface_delay_ms(1000);
81 | cs100_interface_debug_print("cs100: distance is %0.4fm.\n", m);
82 |
83 | ...
84 |
85 | }
86 |
87 | ...
88 |
89 | (void)cs100_basic_deinit();
90 |
91 | return 0;
92 | ```
93 |
94 | ### ドキュメント
95 |
96 | オンラインドキュメント: [https://www.libdriver.com/docs/cs100/index.html](https://www.libdriver.com/docs/cs100/index.html)。
97 |
98 | オフラインドキュメント: /doc/html/index.html。
99 |
100 | ### 貢献
101 |
102 | CONTRIBUTING.mdを参照してください。
103 |
104 | ### 著作権
105 |
106 | 著作権(c)2015-今 LibDriver 全著作権所有
107 |
108 | MITライセンス(MIT)
109 |
110 | このソフトウェアおよび関連するドキュメントファイル(「ソフトウェア」)のコピーを取得した人は、無制限の使用、複製、変更、組み込み、公開、配布、サブライセンスを含む、ソフトウェアを処分する権利を制限なく付与されます。ソフトウェアのライセンスおよび/またはコピーの販売、および上記のようにソフトウェアが配布された人の権利のサブライセンスは、次の条件に従うものとします。
111 |
112 | 上記の著作権表示およびこの許可通知は、このソフトウェアのすべてのコピーまたは実体に含まれるものとします。
113 |
114 | このソフトウェアは「現状有姿」で提供され、商品性、特定目的への適合性、および非侵害の保証を含むがこれらに限定されない、明示または黙示を問わず、いかなる種類の保証もありません。 いかなる場合も、作者または著作権所有者は、契約、不法行為、またはその他の方法で、本ソフトウェアおよび本ソフトウェアの使用またはその他の廃棄に起因または関連して、請求、損害、またはその他の責任を負わないものとします。
115 |
116 | ### 連絡して
117 |
118 | お問い合わせくださいlishifenging@outlook.com。
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_i2c_ex.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_i2c_ex.h
4 | * @author MCD Application Team
5 | * @brief Header file of I2C HAL Extension module.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2016 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef __STM32F4xx_HAL_I2C_EX_H
21 | #define __STM32F4xx_HAL_I2C_EX_H
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | #if defined(I2C_FLTR_ANOFF)&&defined(I2C_FLTR_DNF)
28 | /* Includes ------------------------------------------------------------------*/
29 | #include "stm32f4xx_hal_def.h"
30 |
31 | /** @addtogroup STM32F4xx_HAL_Driver
32 | * @{
33 | */
34 |
35 | /** @addtogroup I2CEx
36 | * @{
37 | */
38 |
39 | /* Exported types ------------------------------------------------------------*/
40 | /* Exported constants --------------------------------------------------------*/
41 | /** @defgroup I2CEx_Exported_Constants I2C Exported Constants
42 | * @{
43 | */
44 |
45 | /** @defgroup I2CEx_Analog_Filter I2C Analog Filter
46 | * @{
47 | */
48 | #define I2C_ANALOGFILTER_ENABLE 0x00000000U
49 | #define I2C_ANALOGFILTER_DISABLE I2C_FLTR_ANOFF
50 | /**
51 | * @}
52 | */
53 |
54 | /**
55 | * @}
56 | */
57 |
58 | /* Exported macro ------------------------------------------------------------*/
59 | /* Exported functions --------------------------------------------------------*/
60 | /** @addtogroup I2CEx_Exported_Functions
61 | * @{
62 | */
63 |
64 | /** @addtogroup I2CEx_Exported_Functions_Group1
65 | * @{
66 | */
67 | /* Peripheral Control functions ************************************************/
68 | HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter);
69 | HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter);
70 | /**
71 | * @}
72 | */
73 |
74 | /**
75 | * @}
76 | */
77 | /* Private types -------------------------------------------------------------*/
78 | /* Private variables ---------------------------------------------------------*/
79 | /* Private constants ---------------------------------------------------------*/
80 | /** @defgroup I2CEx_Private_Constants I2C Private Constants
81 | * @{
82 | */
83 |
84 | /**
85 | * @}
86 | */
87 |
88 | /* Private macros ------------------------------------------------------------*/
89 | /** @defgroup I2CEx_Private_Macros I2C Private Macros
90 | * @{
91 | */
92 | #define IS_I2C_ANALOG_FILTER(FILTER) (((FILTER) == I2C_ANALOGFILTER_ENABLE) || \
93 | ((FILTER) == I2C_ANALOGFILTER_DISABLE))
94 | #define IS_I2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000FU)
95 | /**
96 | * @}
97 | */
98 |
99 | /**
100 | * @}
101 | */
102 |
103 | /**
104 | * @}
105 | */
106 |
107 | #endif
108 |
109 | #ifdef __cplusplus
110 | }
111 | #endif
112 |
113 | #endif /* __STM32F4xx_HAL_I2C_EX_H */
114 |
115 |
116 |
--------------------------------------------------------------------------------
/project/raspberrypi4b/interface/inc/wire.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file wire.h
25 | * @brief wire header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef WIRE_H
38 | #define WIRE_H
39 |
40 | #include
41 | #include
42 | #include
43 |
44 | #ifdef __cplusplus
45 | extern "C" {
46 | #endif
47 |
48 | /**
49 | * @defgroup wire wire function
50 | * @brief wire function modules
51 | * @{
52 | */
53 |
54 | /**
55 | * @brief wire bus init
56 | * @return status code
57 | * - 0 success
58 | * - 1 init failed
59 | * @note none
60 | */
61 | uint8_t wire_init(void);
62 |
63 | /**
64 | * @brief wire bus deint
65 | * @return status code
66 | * - 0 success
67 | * @note none
68 | */
69 | uint8_t wire_deinit(void);
70 |
71 | /**
72 | * @brief wire bus read data
73 | * @param[out] *value pointer to a data buffer
74 | * @return status code
75 | * - 0 success
76 | * - 1 read failed
77 | * @note none
78 | */
79 | uint8_t wire_read(uint8_t *value);
80 |
81 | /**
82 | * @brief wire bus write data
83 | * @param[in] value write data
84 | * @return status code
85 | * - 0 success
86 | * - 1 write failed
87 | * @note none
88 | */
89 | uint8_t wire_write(uint8_t value);
90 |
91 | /**
92 | * @brief wire bus init
93 | * @return status code
94 | * - 0 success
95 | * - 1 init failed
96 | * @note none
97 | */
98 | uint8_t wire_clock_init(void);
99 |
100 | /**
101 | * @brief wire bus deint
102 | * @return status code
103 | * - 0 success
104 | * @note none
105 | */
106 | uint8_t wire_clock_deinit(void);
107 |
108 | /**
109 | * @brief wire bus write data
110 | * @param[in] value write data
111 | * @return status code
112 | * - 0 success
113 | * - 1 write failed
114 | * @note none
115 | */
116 | uint8_t wire_clock_write(uint8_t value);
117 |
118 | /**
119 | * @}
120 | */
121 |
122 | #ifdef __cplusplus
123 | }
124 | #endif
125 |
126 | #endif
127 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_pcd_ex.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_pcd_ex.h
4 | * @author MCD Application Team
5 | * @brief Header file of PCD HAL Extension module.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2016 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef STM32F4xx_HAL_PCD_EX_H
21 | #define STM32F4xx_HAL_PCD_EX_H
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif /* __cplusplus */
26 |
27 | /* Includes ------------------------------------------------------------------*/
28 | #include "stm32f4xx_hal_def.h"
29 |
30 | #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
31 | /** @addtogroup STM32F4xx_HAL_Driver
32 | * @{
33 | */
34 |
35 | /** @addtogroup PCDEx
36 | * @{
37 | */
38 | /* Exported types ------------------------------------------------------------*/
39 | /* Exported constants --------------------------------------------------------*/
40 | /* Exported macros -----------------------------------------------------------*/
41 | /* Exported functions --------------------------------------------------------*/
42 | /** @addtogroup PCDEx_Exported_Functions PCDEx Exported Functions
43 | * @{
44 | */
45 | /** @addtogroup PCDEx_Exported_Functions_Group1 Peripheral Control functions
46 | * @{
47 | */
48 |
49 | #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
50 | HAL_StatusTypeDef HAL_PCDEx_SetTxFiFo(PCD_HandleTypeDef *hpcd, uint8_t fifo, uint16_t size);
51 | HAL_StatusTypeDef HAL_PCDEx_SetRxFiFo(PCD_HandleTypeDef *hpcd, uint16_t size);
52 | #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
53 |
54 | #if defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx)
55 | HAL_StatusTypeDef HAL_PCDEx_ActivateLPM(PCD_HandleTypeDef *hpcd);
56 | HAL_StatusTypeDef HAL_PCDEx_DeActivateLPM(PCD_HandleTypeDef *hpcd);
57 | #endif /* defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx) */
58 | #if defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx)
59 | HAL_StatusTypeDef HAL_PCDEx_ActivateBCD(PCD_HandleTypeDef *hpcd);
60 | HAL_StatusTypeDef HAL_PCDEx_DeActivateBCD(PCD_HandleTypeDef *hpcd);
61 | void HAL_PCDEx_BCD_VBUSDetect(PCD_HandleTypeDef *hpcd);
62 | #endif /* defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx) */
63 | void HAL_PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg);
64 | void HAL_PCDEx_BCD_Callback(PCD_HandleTypeDef *hpcd, PCD_BCD_MsgTypeDef msg);
65 |
66 | /**
67 | * @}
68 | */
69 |
70 | /**
71 | * @}
72 | */
73 |
74 | /**
75 | * @}
76 | */
77 |
78 | /**
79 | * @}
80 | */
81 | #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
82 |
83 | #ifdef __cplusplus
84 | }
85 | #endif /* __cplusplus */
86 |
87 |
88 | #endif /* STM32F4xx_HAL_PCD_EX_H */
89 |
--------------------------------------------------------------------------------
/doc/html/search/all_2.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['debug_5fprint_0',['debug_print',['../structcs100__handle__s.html#a769d5b3a6c14790a0e126e8fe70b384b',1,'cs100_handle_s']]],
4 | ['delay_5fms_1',['delay_ms',['../structcs100__handle__s.html#a406c9433252b7366de417b7a60915c81',1,'cs100_handle_s']]],
5 | ['delay_5fus_2',['delay_us',['../structcs100__handle__s.html#a538ee5e27967b126ec220df6386d3f43',1,'cs100_handle_s']]],
6 | ['driver_20function_3',['driver function',['../group__cs100__base__driver.html',1,'cs100 base driver function'],['../group__cs100__driver.html',1,'cs100 driver function'],['../group__cs100__example__driver.html',1,'cs100 example driver function'],['../group__cs100__interface__driver.html',1,'cs100 interface driver function'],['../group__cs100__link__driver.html',1,'cs100 link driver function'],['../group__cs100__test__driver.html',1,'cs100 test driver function']]],
7 | ['driver_5fcs100_2ec_4',['driver_cs100.c',['../driver__cs100_8c.html',1,'']]],
8 | ['driver_5fcs100_2eh_5',['driver_cs100.h',['../driver__cs100_8h.html',1,'']]],
9 | ['driver_5fcs100_5fbasic_2ec_6',['driver_cs100_basic.c',['../driver__cs100__basic_8c.html',1,'']]],
10 | ['driver_5fcs100_5fbasic_2eh_7',['driver_cs100_basic.h',['../driver__cs100__basic_8h.html',1,'']]],
11 | ['driver_5fcs100_5finterface_2eh_8',['driver_cs100_interface.h',['../driver__cs100__interface_8h.html',1,'']]],
12 | ['driver_5fcs100_5finterface_5ftemplate_2ec_9',['driver_cs100_interface_template.c',['../driver__cs100__interface__template_8c.html',1,'']]],
13 | ['driver_5fcs100_5flink_5fdebug_5fprint_10',['DRIVER_CS100_LINK_DEBUG_PRINT',['../group__cs100__link__driver.html#ga12f0924f0d15a53d4ec84439aba18f3d',1,'driver_cs100.h']]],
14 | ['driver_5fcs100_5flink_5fdelay_5fms_11',['DRIVER_CS100_LINK_DELAY_MS',['../group__cs100__link__driver.html#ga03a43ad74690d46a3b8dc7677121c36d',1,'driver_cs100.h']]],
15 | ['driver_5fcs100_5flink_5fdelay_5fus_12',['DRIVER_CS100_LINK_DELAY_US',['../group__cs100__link__driver.html#ga90ee25d2c900b451bc31162bfdd53a15',1,'driver_cs100.h']]],
16 | ['driver_5fcs100_5flink_5fecho_5fdeinit_13',['DRIVER_CS100_LINK_ECHO_DEINIT',['../group__cs100__link__driver.html#gaae1f487b9d5cff9f251c474556348e37',1,'driver_cs100.h']]],
17 | ['driver_5fcs100_5flink_5fecho_5finit_14',['DRIVER_CS100_LINK_ECHO_INIT',['../group__cs100__link__driver.html#ga236ee5c6463827f1fca89aacff2a1e07',1,'driver_cs100.h']]],
18 | ['driver_5fcs100_5flink_5fecho_5fwrite_15',['DRIVER_CS100_LINK_ECHO_WRITE',['../group__cs100__link__driver.html#ga6c96a216ec88a6f698700f48e57cb97f',1,'driver_cs100.h']]],
19 | ['driver_5fcs100_5flink_5finit_16',['DRIVER_CS100_LINK_INIT',['../group__cs100__link__driver.html#ga3adffa5f0a7d2b4fd90e86b9fa8b833a',1,'driver_cs100.h']]],
20 | ['driver_5fcs100_5flink_5ftimestamp_5fread_17',['DRIVER_CS100_LINK_TIMESTAMP_READ',['../group__cs100__link__driver.html#gaa1637bd70557ad71a1820c723512f12c',1,'driver_cs100.h']]],
21 | ['driver_5fcs100_5flink_5ftrig_5fdeinit_18',['DRIVER_CS100_LINK_TRIG_DEINIT',['../group__cs100__link__driver.html#gacb74f18feceb396edbcd7943ccea111d',1,'driver_cs100.h']]],
22 | ['driver_5fcs100_5flink_5ftrig_5finit_19',['DRIVER_CS100_LINK_TRIG_INIT',['../group__cs100__link__driver.html#ga2fbcf55d4e2d5e9dfcbb6f3e7d3e4af0',1,'driver_cs100.h']]],
23 | ['driver_5fcs100_5flink_5ftrig_5fwrite_20',['DRIVER_CS100_LINK_TRIG_WRITE',['../group__cs100__link__driver.html#ga182e5fa485cdfeb42ab393c8f4d9f31c',1,'driver_cs100.h']]],
24 | ['driver_5fcs100_5fread_5ftest_2ec_21',['driver_cs100_read_test.c',['../driver__cs100__read__test_8c.html',1,'']]],
25 | ['driver_5fcs100_5fread_5ftest_2eh_22',['driver_cs100_read_test.h',['../driver__cs100__read__test_8h.html',1,'']]],
26 | ['driver_5fversion_23',['DRIVER_VERSION',['../driver__cs100_8c.html#ae578001fe043b4cca7a0edd801cfe9c4',1,'driver_cs100.c']]],
27 | ['driver_5fversion_24',['driver_version',['../structcs100__info__s.html#a41b0bd442708b70d252c50b92c75265a',1,'cs100_info_s']]]
28 | ];
29 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_cryp_ex.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_cryp_ex.h
4 | * @author MCD Application Team
5 | * @brief Header file of CRYP HAL Extension module.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2016 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef __STM32F4xx_HAL_CRYP_EX_H
21 | #define __STM32F4xx_HAL_CRYP_EX_H
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | /* Includes ------------------------------------------------------------------*/
28 | #include "stm32f4xx_hal_def.h"
29 |
30 | /** @addtogroup STM32F4xx_HAL_Driver
31 | * @{
32 | */
33 |
34 | /** @addtogroup CRYPEx
35 | * @{
36 | */
37 | /* Exported types ------------------------------------------------------------*/
38 | /** @defgroup CRYPEx_Exported_Types CRYPEx Exported types
39 | * @{
40 | */
41 |
42 | /**
43 | * @}
44 | */
45 | /* Exported constants --------------------------------------------------------*/
46 | /** @defgroup CRYPEx_Exported_Constants CRYPEx Exported constants
47 | * @{
48 | */
49 |
50 | /**
51 | * @}
52 | */
53 |
54 | /* Private types -------------------------------------------------------------*/
55 | /** @defgroup CRYPEx_Private_Types CRYPEx Private Types
56 | * @{
57 | */
58 |
59 | /**
60 | * @}
61 | */
62 |
63 | /* Private variables ---------------------------------------------------------*/
64 | /** @defgroup CRYPEx_Private_Variables CRYPEx Private Variables
65 | * @{
66 | */
67 |
68 | /**
69 | * @}
70 | */
71 |
72 | /* Private constants ---------------------------------------------------------*/
73 | /** @defgroup CRYPEx_Private_Constants CRYPEx Private Constants
74 | * @{
75 | */
76 |
77 | /**
78 | * @}
79 | */
80 |
81 | /* Private macros ------------------------------------------------------------*/
82 | /** @defgroup CRYPEx_Private_Macros CRYPEx Private Macros
83 | * @{
84 | */
85 |
86 | /**
87 | * @}
88 | */
89 |
90 | /* Private functions ---------------------------------------------------------*/
91 | /** @defgroup CRYPEx_Private_Functions CRYPEx Private Functions
92 | * @{
93 | */
94 |
95 | /**
96 | * @}
97 | */
98 |
99 | /* Exported functions --------------------------------------------------------*/
100 | /** @defgroup CRYPEx_Exported_Functions CRYPEx Exported Functions
101 | * @{
102 | */
103 | #if defined (CRYP) || defined (AES)
104 | /** @addtogroup CRYPEx_Exported_Functions_Group1
105 | * @{
106 | */
107 | HAL_StatusTypeDef HAL_CRYPEx_AESGCM_GenerateAuthTAG(CRYP_HandleTypeDef *hcryp, uint32_t *AuthTag, uint32_t Timeout);
108 | HAL_StatusTypeDef HAL_CRYPEx_AESCCM_GenerateAuthTAG(CRYP_HandleTypeDef *hcryp, uint32_t *AuthTag, uint32_t Timeout);
109 | /**
110 | * @}
111 | */
112 | #endif /* CRYP||AES */
113 |
114 | #if defined (AES)
115 | /** @addtogroup CRYPEx_Exported_Functions_Group2
116 | * @{
117 | */
118 | void HAL_CRYPEx_EnableAutoKeyDerivation(CRYP_HandleTypeDef *hcryp);
119 | void HAL_CRYPEx_DisableAutoKeyDerivation(CRYP_HandleTypeDef *hcryp);
120 | /**
121 | * @}
122 | */
123 | #endif /* AES */
124 |
125 | /**
126 | * @}
127 | */
128 |
129 | /**
130 | * @}
131 | */
132 |
133 | /**
134 | * @}
135 | */
136 |
137 | #ifdef __cplusplus
138 | }
139 | #endif
140 |
141 | #endif /* __STM32F4xx_HAL_CRYP_EX_H */
142 |
143 |
--------------------------------------------------------------------------------
/project/stm32f407/README.md:
--------------------------------------------------------------------------------
1 | ### 1. Chip
2 |
3 | #### 1.1 Chip Info
4 |
5 | Chip Name: STM32F407ZGT6.
6 |
7 | Extern Oscillator: 8MHz.
8 |
9 | UART Pin: TX/RX PA9/PA10.
10 |
11 | GPIO Pin: Echo/TrigPA8/PA0.
12 |
13 | ### 2. Development and Debugging
14 |
15 | #### 2.1 Integrated Development Environment
16 |
17 | LibDriver provides both Keil and IAR integrated development environment projects.
18 |
19 | MDK is the Keil ARM project and your Keil version must be 5 or higher.Keil ARM project needs STMicroelectronics STM32F4 Series Device Family Pack and you can download from https://www.keil.com/dd2/stmicroelectronics/stm32f407zgtx.
20 |
21 | EW is the IAR ARM project and your IAR version must be 9 or higher.
22 |
23 | #### 2.2 Serial Port Parameter
24 |
25 | Baud Rate: 115200.
26 |
27 | Data Bits : 8.
28 |
29 | Stop Bits: 1.
30 |
31 | Parity: None.
32 |
33 | Flow Control: None.
34 |
35 | #### 2.3 Serial Port Assistant
36 |
37 | We use '\n' to wrap lines.If your serial port assistant displays exceptions (e.g. the displayed content does not divide lines), please modify the configuration of your serial port assistant or replace one that supports '\n' parsing.
38 |
39 | ### 3. CS100
40 |
41 | #### 3.1 Command Instruction
42 |
43 | 1. Show cs100 chip and driver information.
44 |
45 | ```shell
46 | cs100 (-i | --information)
47 | ```
48 |
49 | 2. Show cs100 help.
50 |
51 | ```shell
52 | cs100 (-h | --help)
53 | ```
54 |
55 | 3. Show cs100 pin connections of the current board.
56 |
57 | ```shell
58 | cs100 (-p | --port)
59 | ```
60 |
61 | 4. Run cs100 read test, num means the test times.
62 |
63 | ```shell
64 | cs100 (-t read | --test=read) [--times=]
65 | ```
66 |
67 | 5. Run cs100 read function, num means the read times.
68 |
69 | ```shell
70 | cs100 (-e read | --example=read) [--times=]
71 | ```
72 |
73 | #### 3.2 Command Example
74 |
75 | ```shell
76 | cs100 -i
77 |
78 | cs100: chip is angoSense CS100.
79 | cs100: manufacturer is angoSense.
80 | cs100: interface is GPIO.
81 | cs100: driver version is 1.0.
82 | cs100: min supply voltage is 3.0V.
83 | cs100: max supply voltage is 5.5V.
84 | cs100: max current is 5.30mA.
85 | cs100: max temperature is 85.0C.
86 | cs100: min temperature is -40.0C.
87 | ```
88 |
89 | ```shell
90 | cs100 -p
91 |
92 | cs100: trig pin connected to GPIOA PIN0.
93 | cs100: echo pin connected to GPIOA PIN8.
94 | ```
95 |
96 | ```shell
97 | cs100 -t read --times=3
98 |
99 | cs100: chip is angoSense CS100.
100 | cs100: manufacturer is angoSense.
101 | cs100: interface is GPIO.
102 | cs100: driver version is 1.0.
103 | cs100: min supply voltage is 3.0V.
104 | cs100: max supply voltage is 5.5V.
105 | cs100: max current is 5.30mA.
106 | cs100: max temperature is 85.0C.
107 | cs100: min temperature is -40.0C.
108 | cs100: start read test.
109 | cs100: distance is 10.574000cm.
110 | cs100: distance is 10.234000cm.
111 | cs100: distance is 10.250999cm.
112 | cs100: finish read test.
113 | ```
114 |
115 | ```shell
116 | cs100 -e read --times=3
117 |
118 | cs100: 1/3.
119 | cs100: distance is 0.1064m.
120 | cs100: 2/3.
121 | cs100: distance is 0.1073m.
122 | cs100: 3/3.
123 | cs100: distance is 0.1068m.
124 | ```
125 |
126 | ```shell
127 | cs100 -h
128 |
129 | Usage:
130 | cs100 (-i | --information)
131 | cs100 (-h | --help)
132 | cs100 (-p | --port)
133 | cs100 (-t read | --test=read) [--times=]
134 | cs100 (-e read | --example=read) [--times=]
135 |
136 | Options:
137 | -e , --example= Run the driver example.
138 | -h, --help Show the help.
139 | -i, --information Show the chip information.
140 | -p, --port Display the pin connections of the current board.
141 | -t , --test= Run the driver test.
142 | --times= Set the running times.([default: 3])
143 | ```
144 |
145 |
--------------------------------------------------------------------------------
/project/raspberrypi4b/README.md:
--------------------------------------------------------------------------------
1 | ### 1. Board
2 |
3 | #### 1.1 Board Info
4 |
5 | Board Name: Raspberry Pi 4B.
6 |
7 | GPIO Pin: Trig/Echo GPIO27/GPIO17.
8 |
9 | ### 2. Install
10 |
11 | #### 2.1 Dependencies
12 |
13 | Install the necessary dependencies.
14 |
15 | ```shell
16 | sudo apt-get install libgpiod-dev pkg-config cmake -y
17 | ```
18 |
19 | #### 2.2 Makefile
20 |
21 | Build the project.
22 |
23 | ```shell
24 | make
25 | ```
26 |
27 | Install the project and this is optional.
28 |
29 | ```shell
30 | sudo make install
31 | ```
32 |
33 | Uninstall the project and this is optional.
34 |
35 | ```shell
36 | sudo make uninstall
37 | ```
38 |
39 | #### 2.3 CMake
40 |
41 | Build the project.
42 |
43 | ```shell
44 | mkdir build && cd build
45 | cmake ..
46 | make
47 | ```
48 |
49 | Install the project and this is optional.
50 |
51 | ```shell
52 | sudo make install
53 | ```
54 |
55 | Uninstall the project and this is optional.
56 |
57 | ```shell
58 | sudo make uninstall
59 | ```
60 |
61 | Test the project and this is optional.
62 |
63 | ```shell
64 | make test
65 | ```
66 |
67 | Find the compiled library in CMake.
68 |
69 | ```cmake
70 | find_package(cs100 REQUIRED)
71 | ```
72 |
73 | ### 3. CS100
74 |
75 | #### 3.1 Command Instruction
76 |
77 | 1. Show cs100 chip and driver information.
78 |
79 | ```shell
80 | cs100 (-i | --information)
81 | ```
82 |
83 | 2. Show cs100 help.
84 |
85 | ```shell
86 | cs100 (-h | --help)
87 | ```
88 |
89 | 3. Show cs100 pin connections of the current board.
90 |
91 | ```shell
92 | cs100 (-p | --port)
93 | ```
94 |
95 | 4. Run cs100 read test, num means the test times.
96 |
97 | ```shell
98 | cs100 (-t read | --test=read) [--times=]
99 | ```
100 |
101 | 5. Run cs100 read function, num means the read times.
102 |
103 | ```shell
104 | cs100 (-e read | --example=read) [--times=]
105 | ```
106 |
107 | #### 3.2 Command Example
108 |
109 | ```shell
110 | ./cs100 -i
111 |
112 | cs100: chip is angoSense CS100.
113 | cs100: manufacturer is angoSense.
114 | cs100: interface is GPIO.
115 | cs100: driver version is 1.0.
116 | cs100: min supply voltage is 3.0V.
117 | cs100: max supply voltage is 5.5V.
118 | cs100: max current is 5.30mA.
119 | cs100: max temperature is 85.0C.
120 | cs100: min temperature is -40.0C.
121 | ```
122 |
123 | ```shell
124 | ./cs100 -p
125 |
126 | cs100: trig pin connected to GPIO27(BCM).
127 | cs100: echo pin connected to GPIO17(BCM).
128 | ```
129 |
130 | ```shell
131 | ./cs100 -t read --times=3
132 |
133 | cs100: chip is angoSense CS100.
134 | cs100: manufacturer is angoSense.
135 | cs100: interface is GPIO.
136 | cs100: driver version is 1.0.
137 | cs100: min supply voltage is 3.0V.
138 | cs100: max supply voltage is 5.5V.
139 | cs100: max current is 5.30mA.
140 | cs100: max temperature is 85.0C.
141 | cs100: min temperature is -40.0C.
142 | cs100: start read test.
143 | cs100: distance is 9.863000cm.
144 | cs100: distance is 9.979000cm.
145 | cs100: distance is 10.013000cm.
146 | cs100: finish read test.
147 | ```
148 |
149 | ```shell
150 | ./cs100 -e read --times=3
151 |
152 | cs100: 1/3.
153 | cs100: distance is 0.0961m.
154 | cs100: 2/3.
155 | cs100: distance is 0.0996m.
156 | cs100: 3/3.
157 | cs100: distance is 0.1040m.
158 | ```
159 |
160 | ```shell
161 | ./cs100 -h
162 |
163 | Usage:
164 | cs100 (-i | --information)
165 | cs100 (-h | --help)
166 | cs100 (-p | --port)
167 | cs100 (-t read | --test=read) [--times=]
168 | cs100 (-e read | --example=read) [--times=]
169 |
170 | Options:
171 | -e , --example= Run the driver example.
172 | -h, --help Show the help.
173 | -i, --information Show the chip information.
174 | -p, --port Display the pin connections of the current board.
175 | -t , --test= Run the driver test.
176 | --times= Set the running times.([default: 3])
177 | ```
178 |
179 |
--------------------------------------------------------------------------------
/example/driver_cs100_basic.c:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file driver_cs100_basic.c
25 | * @brief driver cs100 basic source file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2024-07-30
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2024/07/30
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #include "driver_cs100_basic.h"
38 |
39 | static cs100_handle_t gs_handle; /**< cs100 handle */
40 |
41 | /**
42 | * @brief basic example init
43 | * @return status code
44 | * - 0 success
45 | * - 1 init failed
46 | * @note none
47 | */
48 | uint8_t cs100_basic_init(void)
49 | {
50 | uint8_t res;
51 |
52 | /* link interface function */
53 | DRIVER_CS100_LINK_INIT(&gs_handle, cs100_handle_t);
54 | DRIVER_CS100_LINK_TRIG_INIT(&gs_handle, cs100_interface_trig_init);
55 | DRIVER_CS100_LINK_TRIG_DEINIT(&gs_handle, cs100_interface_trig_deinit);
56 | DRIVER_CS100_LINK_TRIG_WRITE(&gs_handle, cs100_interface_trig_write);
57 | DRIVER_CS100_LINK_ECHO_INIT(&gs_handle, cs100_interface_echo_init);
58 | DRIVER_CS100_LINK_ECHO_DEINIT(&gs_handle, cs100_interface_echo_deinit);
59 | DRIVER_CS100_LINK_ECHO_WRITE(&gs_handle, cs100_interface_echo_read);
60 | DRIVER_CS100_LINK_TIMESTAMP_READ(&gs_handle, cs100_interface_timestamp_read);
61 | DRIVER_CS100_LINK_DELAY_MS(&gs_handle, cs100_interface_delay_ms);
62 | DRIVER_CS100_LINK_DELAY_US(&gs_handle, cs100_interface_delay_us);
63 | DRIVER_CS100_LINK_DEBUG_PRINT(&gs_handle, cs100_interface_debug_print);
64 |
65 | /* cs100 init */
66 | res = cs100_init(&gs_handle);
67 | if (res != 0)
68 | {
69 | cs100_interface_debug_print("cs100: init failed.\n");
70 |
71 | return 1;
72 | }
73 |
74 | return 0;
75 | }
76 |
77 | /**
78 | * @brief basic example read
79 | * @param[out] *m pointer to a distance buffer
80 | * @return status code
81 | * - 0 success
82 | * - 1 read failed
83 | * @note none
84 | */
85 | uint8_t cs100_basic_read(float *m)
86 | {
87 | uint32_t time_us;
88 |
89 | /* read distance */
90 | if (cs100_read(&gs_handle, (uint32_t *)&time_us, m) != 0)
91 | {
92 | return 1;
93 | }
94 |
95 | return 0;
96 | }
97 |
98 | /**
99 | * @brief basic example deinit
100 | * @return status code
101 | * - 0 success
102 | * - 1 deinit failed
103 | * @note none
104 | */
105 | uint8_t cs100_basic_deinit(void)
106 | {
107 | /* close cs100 */
108 | if (cs100_deinit(&gs_handle) != 0)
109 | {
110 | return 1;
111 | }
112 |
113 | return 0;
114 | }
115 |
--------------------------------------------------------------------------------
/project/stm32f407/usr/inc/shell.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file shell.h
25 | * @brief shell header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *