Projet modèle
This commit is contained in:
		
						commit
						a9c39df4d6
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| build/ | ||||
							
								
								
									
										37
									
								
								.vscode/c_cpp_properties.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								.vscode/c_cpp_properties.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,37 @@ | ||||
| { | ||||
|     "env": { | ||||
|         "myDefaultIncludePath": [ | ||||
|             "${workspaceFolder}", | ||||
|             "${workspaceFolder}/VL53L8CX_ULD_API/inc", | ||||
|             "${workspaceFolder}/build", | ||||
|             "${env:PICO_SDK_PATH}/src/**/include", | ||||
|             "${env:PICO_SDK_PATH}/src/common/pico_base/include", | ||||
|             "${env:PICO_SDK_PATH}/build/generated/pico_base", | ||||
|             "${env:PICO_SDK_PATH}/src/common/pico_base/include/pico", | ||||
|             "${env:PICO_SDK_PATH}/src/common/pico_stdlib/include" | ||||
|         ], | ||||
|         "myCompilerPath": "/usr/bin/arm-none-eabi-gcc" | ||||
|     }, | ||||
|     "configurations": [ | ||||
|         { | ||||
|             "name": "Linux", | ||||
|             "intelliSenseMode": "linux-gcc-arm", | ||||
|             "includePath": [ | ||||
|                 "${myDefaultIncludePath}", | ||||
|                 "${workspaceFolder}/build/" | ||||
|             ], | ||||
|             "compilerPath": "/usr/bin/arm-none-eabi-gcc", | ||||
|             "cStandard": "c11", | ||||
|             "cppStandard": "c++17", | ||||
|             "browse": { | ||||
|                 "path": [ | ||||
|                     "${workspaceFolder}" | ||||
|                 ], | ||||
|                 "limitSymbolsToIncludedHeaders": true, | ||||
|                 "databaseFilename": "" | ||||
|             }, | ||||
|             "configurationProvider": "ms-vscode.cmake-tools" | ||||
|         } | ||||
|     ], | ||||
|     "version": 4 | ||||
| } | ||||
							
								
								
									
										5
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | ||||
| { | ||||
|     "files.associations": { | ||||
| 
 | ||||
|     } | ||||
| } | ||||
							
								
								
									
										25
									
								
								.vscode/tasks.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								.vscode/tasks.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,25 @@ | ||||
| { | ||||
|     "tasks": [ | ||||
|         { | ||||
|             "type": "shell", | ||||
|             "command": "cd build; cmake ../; make", | ||||
|             "label": "CMake in build/", | ||||
|             "problemMatcher": [], | ||||
|             "group": { | ||||
|                 "kind": "build", | ||||
|                 "isDefault": false | ||||
|             } | ||||
|         }, | ||||
|         { | ||||
|             "type": "shell", | ||||
|             "command": "cd build; cmake ../; make Flash", | ||||
|             "label": "CMake & Make & Flash", | ||||
|             "problemMatcher": [], | ||||
|             "group": { | ||||
|                 "kind": "build", | ||||
|                 "isDefault": true | ||||
|             } | ||||
|         } | ||||
|     ], | ||||
|     "version": "2.0.0" | ||||
| } | ||||
							
								
								
									
										34
									
								
								CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,34 @@ | ||||
| cmake_minimum_required(VERSION 3.13) | ||||
| 
 | ||||
| include(pico_sdk_import.cmake) | ||||
| 
 | ||||
| project(Mon_Projet C CXX ASM) | ||||
| set(CMAKE_C_STNDARD 11) | ||||
| set(CMAKE_CXX_STANDARD 17) | ||||
| 
 | ||||
| set(PICO_EXAMPLES_PATH ${PROJECT_SOURCE_DIR}) | ||||
| 
 | ||||
| pico_sdk_init() | ||||
| 
 | ||||
| add_executable(Mon_Projet | ||||
|   main.c | ||||
| ) | ||||
| 
 | ||||
| target_include_directories(Mon_Projet PRIVATE Mon_Projet_ULD_API/inc/) | ||||
| 
 | ||||
| target_link_libraries(Mon_Projet | ||||
|   hardware_i2c  | ||||
|   hardware_uart  | ||||
|   pico_stdlib | ||||
|   pico_multicore | ||||
| ) | ||||
| 
 | ||||
| pico_enable_stdio_usb(Mon_Projet 1) | ||||
| pico_enable_stdio_uart(Mon_Projet 1) | ||||
| 
 | ||||
| pico_add_extra_outputs(Mon_Projet) | ||||
| 
 | ||||
| add_custom_target(Flash | ||||
|     DEPENDS Mon_Projet | ||||
|     COMMAND sudo picotool load -f ${PROJECT_BINARY_DIR}/Mon_Projet.uf2 | ||||
| ) | ||||
							
								
								
									
										4
									
								
								Readme.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								Readme.md
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,4 @@ | ||||
| Projet modèle pour le Rpi Pico (RP2040) | ||||
| ======================================= | ||||
| 
 | ||||
| Ce projet est un example pour le RPI Pico, tentant d'être le plus prêt à l'emploi possible. | ||||
							
								
								
									
										63
									
								
								changelog.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								changelog.txt
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,63 @@ | ||||
| ******************************************************************************** | ||||
| * | ||||
| * STMicroelectronics - VL53L8CX - Ultra Lite Driver | ||||
| * | ||||
| ******************************************************************************** | ||||
| 
 | ||||
| # Driver version history  | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------------------- | ||||
| 
 | ||||
| Version : 1.0.0 | ||||
| Date : 11/09/2022 | ||||
| Comments : Initial driver release. | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------------------- | ||||
| 
 | ||||
| Version : 1.0.1 | ||||
| Date : 11/14/2022 | ||||
| Comments : Changed module id in function vl53l8cx_is_alive(). | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------------------- | ||||
| 
 | ||||
| Version : 1.0.2 | ||||
| Date : 01/19/2023 | ||||
| Comments :  | ||||
| 	- Changed licences for full BSD3 | ||||
| 	- Fixed distance computing that might be wrong in some cases (random apparition) | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------------------- | ||||
| 
 | ||||
| 
 | ||||
| Version : 1.0.3 | ||||
| Date : 04/17/2023 | ||||
| - Fixed bug in motion indicator: configuration was not correctly sent when resolution was changed | ||||
| - Fixed SPI limitation in initialization sequence | ||||
| 
 | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------------------- | ||||
| 
 | ||||
| 
 | ||||
| Version : 1.0.4 | ||||
| Date : 04/24/2023 | ||||
| - Fixed stop function that may fail when multi-sensors where used | ||||
| 
 | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------------------- | ||||
| 
 | ||||
| 
 | ||||
| Version : 1.0.5 | ||||
| Date : 06/09/2023 | ||||
| - Added an error code VL53L8CX_STATUS_XTALK_FAILED when Xtalk calibration fails due to too good coverglass | ||||
| - Updated stop() function as it has been wrongly implemented in v1.0.4. Fixed issues relative to sensor stopping. | ||||
| 
 | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------------------- | ||||
| 
 | ||||
| Version : 1.1.0 | ||||
| Date : 11/09/2023 | ||||
| Comments :  | ||||
| - Added a firmware checksum. If a bit is missing during firmware download, the error status VL53L8CX_STATUS_FW_CHECKSUM_FAIL | ||||
| is raised. | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------------------- | ||||
							
								
								
									
										16
									
								
								main.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								main.c
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,16 @@ | ||||
| /*****
 | ||||
|  * Copyright (c) 2023 - Poivron Robotique | ||||
|  * | ||||
|  * SPDX-License-Identifier: BSD-3-Clause | ||||
| */ | ||||
| #include "pico/stdlib.h" | ||||
| #include <stdio.h> | ||||
| 
 | ||||
| void main(void) | ||||
| { | ||||
|     stdio_init_all(); | ||||
| 	while(1){ | ||||
| 		printf("Exemple\n"); | ||||
| 		sleep_ms(1000); | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										62
									
								
								pico_sdk_import.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								pico_sdk_import.cmake
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,62 @@ | ||||
| # This is a copy of <PICO_SDK_PATH>/external/pico_sdk_import.cmake | ||||
| 
 | ||||
| # This can be dropped into an external project to help locate this SDK | ||||
| # It should be include()ed prior to project() | ||||
| 
 | ||||
| if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH)) | ||||
|     set(PICO_SDK_PATH $ENV{PICO_SDK_PATH}) | ||||
|     message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')") | ||||
| endif () | ||||
| 
 | ||||
| if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT} AND (NOT PICO_SDK_FETCH_FROM_GIT)) | ||||
|     set(PICO_SDK_FETCH_FROM_GIT $ENV{PICO_SDK_FETCH_FROM_GIT}) | ||||
|     message("Using PICO_SDK_FETCH_FROM_GIT from environment ('${PICO_SDK_FETCH_FROM_GIT}')") | ||||
| endif () | ||||
| 
 | ||||
| if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_PATH)) | ||||
|     set(PICO_SDK_FETCH_FROM_GIT_PATH $ENV{PICO_SDK_FETCH_FROM_GIT_PATH}) | ||||
|     message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')") | ||||
| endif () | ||||
| 
 | ||||
| set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi Pico SDK") | ||||
| set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of SDK from git if not otherwise locatable") | ||||
| set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK") | ||||
| 
 | ||||
| if (NOT PICO_SDK_PATH) | ||||
|     if (PICO_SDK_FETCH_FROM_GIT) | ||||
|         include(FetchContent) | ||||
|         set(FETCHCONTENT_BASE_DIR_SAVE ${FETCHCONTENT_BASE_DIR}) | ||||
|         if (PICO_SDK_FETCH_FROM_GIT_PATH) | ||||
|             get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}") | ||||
|         endif () | ||||
|         FetchContent_Declare( | ||||
|                 pico_sdk | ||||
|                 GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk | ||||
|                 GIT_TAG master | ||||
|         ) | ||||
|         if (NOT pico_sdk) | ||||
|             message("Downloading Raspberry Pi Pico SDK") | ||||
|             FetchContent_Populate(pico_sdk) | ||||
|             set(PICO_SDK_PATH ${pico_sdk_SOURCE_DIR}) | ||||
|         endif () | ||||
|         set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE}) | ||||
|     else () | ||||
|         message(FATAL_ERROR | ||||
|                 "SDK location was not specified. Please set PICO_SDK_PATH or set PICO_SDK_FETCH_FROM_GIT to on to fetch from git." | ||||
|                 ) | ||||
|     endif () | ||||
| endif () | ||||
| 
 | ||||
| get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}") | ||||
| if (NOT EXISTS ${PICO_SDK_PATH}) | ||||
|     message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' not found") | ||||
| endif () | ||||
| 
 | ||||
| set(PICO_SDK_INIT_CMAKE_FILE ${PICO_SDK_PATH}/pico_sdk_init.cmake) | ||||
| if (NOT EXISTS ${PICO_SDK_INIT_CMAKE_FILE}) | ||||
|     message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' does not appear to contain the Raspberry Pi Pico SDK") | ||||
| endif () | ||||
| 
 | ||||
| set(PICO_SDK_PATH ${PICO_SDK_PATH} CACHE PATH "Path to the Raspberry Pi Pico SDK" FORCE) | ||||
| 
 | ||||
| include(${PICO_SDK_INIT_CMAKE_FILE}) | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user