Add basic rpi2040 blink demo app

Phew, things build!  Lets check in how far we got.

Change-Id: Id82e2f4c73eed6620b2b4661726f931e79a6b0c1
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/frc971/imu/BUILD b/frc971/imu/BUILD
new file mode 100644
index 0000000..f386da4
--- /dev/null
+++ b/frc971/imu/BUILD
@@ -0,0 +1,25 @@
+load("//third_party/pico-sdk:hex.bzl", "uf2_from_elf")
+
+# TODO(austin): We should be able to either push the linker script into the crosstool, or wrap this in a macro.
+cc_binary(
+    name = "blink.elf",
+    srcs = [
+        "blink.c",
+        "//third_party/pico-sdk/src/rp2_common/boot_stage2:bs2_default_padded_checksummed.S",
+    ],
+    additional_linker_inputs = [
+        "//third_party/pico-sdk:src/rp2_common/pico_standard_link/memmap_default.ld",
+    ],
+    linkopts = [
+        "-Wl,--script=third_party/pico-sdk/src/rp2_common/pico_standard_link/memmap_default.ld",
+    ],
+    target_compatible_with = [
+        "@platforms//os:none",
+        "//tools/platforms/hardware:cortex_m0plus",
+    ],
+    deps = ["//third_party/pico-sdk"],
+)
+
+uf2_from_elf(
+    name = "blink",
+)
diff --git a/frc971/imu/blink.c b/frc971/imu/blink.c
new file mode 100644
index 0000000..d478d78
--- /dev/null
+++ b/frc971/imu/blink.c
@@ -0,0 +1,23 @@
+/**
+ * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include "pico/stdlib.h"
+
+int main() {
+#ifndef PICO_DEFAULT_LED_PIN
+#warning blink example requires a board with a regular LED
+#else
+    const uint LED_PIN = PICO_DEFAULT_LED_PIN;
+    gpio_init(LED_PIN);
+    gpio_set_dir(LED_PIN, GPIO_OUT);
+    while (true) {
+        gpio_put(LED_PIN, 1);
+        sleep_ms(250);
+        gpio_put(LED_PIN, 0);
+        sleep_ms(250);
+    }
+#endif
+}