Browse Source

inital commit

Tobias Müller 7 months ago
parent
commit
6e7a395eb0

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+build

+ 31 - 0
.vscode/launch.json

@@ -0,0 +1,31 @@
+{
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "name": "Pico Debug",
+            "cwd": "${workspaceRoot}",
+            "executable": "${command:cmake.launchTargetPath}",
+            "request": "launch",
+            "type": "cortex-debug",
+            "servertype": "openocd",
+            // This may need to be "arm-none-eabi-gdb" for some previous builds
+            "gdbPath" : "arm-none-eabi-gdb",
+            //"gdbPath" : "gdb-multiarch",
+            "device": "RP2040",
+            "configFiles": [
+                // This may need to be "interface/picoprobe.cfg" for some previous builds
+                "interface/cmsis-dap.cfg",
+                //"interface/picoprobe.cfg",
+                "target/rp2040.cfg"
+            ],
+            "svdFile": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd",
+            "runToEntryPoint": "main",
+            // Work around for stopping at main on restart
+            "postRestartCommands": [
+                "break main",
+                "continue"
+            ],
+            "searchDir": ["${workspaceFolder}/../openocd/tcl/"],
+        }
+    ]
+}

+ 38 - 0
.vscode/settings.json

@@ -0,0 +1,38 @@
+{
+    // These settings tweaks to the cmake plugin will ensure
+    // that you debug using cortex-debug instead of trying to launch
+    // a Pico binary on the host
+    "cmake.statusbar.advanced": {
+
+        "debug": {
+            "visibility": "hidden"
+        },
+        "launch": {
+            "visibility": "hidden"
+        },
+        "build": {
+            "visibility": "default"
+        },
+        "buildTarget": {
+            "visibility": "hidden"
+        }
+    },
+    "cmake.buildBeforeRun": true,
+    "cmake.configureOnOpen": true,
+    "cmake.statusbar.visibility": "icon",
+    "cmake.generator": "Unix Makefiles",
+    "cmake.environment": {
+      "PICO_SDK_PATH": "${workspaceFolder}/../pico-sdk"
+    },
+    "cmake.configureArgs": [
+        "-DPICO_DEOPTIMIZED_DEBUG=1"
+    ],
+    "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
+    "C_Cpp.default.cppStandard": "gnu++17",
+    "C_Cpp.default.cStandard": "gnu11",
+    "cortex-debug.openocdPath": "${workspaceFolder}/../openocd/src/openocd",
+    "files.associations": {
+        "*.c": "c",
+        "blink.h": "c"
+    }
+}

+ 32 - 0
CMakeLists.txt

@@ -0,0 +1,32 @@
+# Set minimum required version of CMake
+cmake_minimum_required(VERSION 3.12)
+
+# Include build functions from Pico SDK
+include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
+
+# Set name of project (as PROJECT_NAME) and C/C   standards
+project(blink C CXX ASM)
+set(CMAKE_C_STANDARD 11)
+set(CMAKE_CXX_STANDARD 17)
+
+# Creates a pico-sdk subdirectory in our project for the libraries
+pico_sdk_init()
+
+# Tell CMake where to find the executable source file
+add_executable(${PROJECT_NAME} 
+    src/main.c
+)
+
+# Create map/bin/hex/uf2 files
+pico_add_extra_outputs(${PROJECT_NAME})
+
+target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/inc)
+
+# Link to pico_stdlib (gpio, time, etc. functions)
+target_link_libraries(${PROJECT_NAME} 
+    pico_stdlib
+)
+
+# Enable usb output, disable uart output
+pico_enable_stdio_usb(${PROJECT_NAME} 0)
+pico_enable_stdio_uart(${PROJECT_NAME} 1)

+ 1 - 1
LICENSE

@@ -238,4 +238,4 @@ Also add information on how to contact you by electronic and paper mail.
 
 If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.
 
-You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <http://www.gnu.org/licenses/>.
+You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <http://www.gnu.org/licenses/>.

File diff suppressed because it is too large
+ 48 - 1
README.md


BIN
docs/Datasheets/Maker_Pi_Pico_Datasheet.pdf


BIN
docs/Datasheets/RP2040_Datasheet.pdf


BIN
docs/Datasheets/Raspberry_Pi_Pico_Datasheet.pdf


BIN
docs/Datasheets/Raspberry_Pi_Pico_W_Datasheet.pdf


BIN
docs/Getting_Started/Connecting_to_Internet_Pico_W.pdf


BIN
docs/Getting_Started/Getting_started_with_Pico.pdf


BIN
docs/Hardware/Design/Hardware_Design_RP2040.pdf


BIN
docs/Hardware/Pinout/Maker_Pi_Pico_Pinout.pdf


BIN
docs/Hardware/Pinout/Raspberry_Pi_Pico_Pinout.pdf


BIN
docs/Hardware/Pinout/Raspberry_Pi_Pico_W_Pinout.pdf


BIN
docs/Hardware/Schematics/Maker_Pi_Pico_Schematic.pdf


BIN
docs/Hardware/Schematics/Raspberry_Pi_Pico_Schematic.pdf


BIN
docs/Hardware/Schematics/Raspberry_Pi_Pico_W_Schematic.pdf


+ 3 - 0
docs/README.md

@@ -0,0 +1,3 @@
+# Documentations
+
+Contains documentations of the Raspberry Pi Pico.

BIN
docs/Software_Development_Kit/Raspberry_Pi_Pico_C_SDK.pdf


BIN
docs/Software_Development_Kit/Raspberry_Pi_Pico_Python_SDK.pdf


+ 11 - 0
inc/header.h

@@ -0,0 +1,11 @@
+#ifndef HEADER_H
+#define HEADER_H
+
+#include <stdio.h>
+#include "pico/stdlib.h"
+
+#ifndef SLEEP_TIME_MS
+#define SLEEP_TIME_MS 500
+#endif
+
+#endif

+ 3 - 0
libs/README.md

@@ -0,0 +1,3 @@
+# Libraries
+
+Contains user defined libraries and modules, which can be used inside of the main program.

BIN
pics/HSA-Banner.png


File diff suppressed because it is too large
+ 82 - 0
pics/HSA_Logo_digital.svg


BIN
pics/Raspberry_Pi_Pico.png


+ 25 - 0
src/main.c

@@ -0,0 +1,25 @@
+#include "header.h"
+
+int main() {
+
+    // Initialize LED pin
+    gpio_init(PICO_DEFAULT_LED_PIN);
+    gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
+
+    // Initialize chosen serial port
+    stdio_init_all();
+
+    int i = 0;
+
+    // Loop forever
+    while (true) {
+
+        // Blink LED
+        printf("Blinking!\r\n");
+        gpio_put(PICO_DEFAULT_LED_PIN, true);
+        sleep_ms(SLEEP_TIME_MS);
+        gpio_put(PICO_DEFAULT_LED_PIN, false);
+        sleep_ms(SLEEP_TIME_MS);
+        i++;
+    }
+}