├── iron-coder-boards ├── .gitignore ├── Adafruit │ ├── Feather_RP2040 │ │ ├── examples │ │ │ ├── neopixel │ │ │ │ ├── src │ │ │ │ │ ├── NeoPixel.rs │ │ │ │ │ └── main.rs │ │ │ │ ├── Cargo.toml │ │ │ │ └── .ironcoder.toml │ │ │ └── blinky │ │ │ │ ├── .gitignore │ │ │ │ ├── src │ │ │ │ ├── test.rs │ │ │ │ └── main.rs │ │ │ │ ├── README.md │ │ │ │ ├── memory.x │ │ │ │ ├── Cargo.toml │ │ │ │ ├── .ironcoder.toml │ │ │ │ └── .cargo │ │ │ │ └── config │ │ ├── template │ │ │ ├── .gitignore │ │ │ ├── memory.x │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ └── main.rs │ │ │ └── .cargo │ │ │ │ └── config │ │ ├── feather_rp2040.png │ │ ├── bsp │ │ │ ├── src │ │ │ │ ├── prelude.rs │ │ │ │ ├── usb_manager.rs │ │ │ │ └── lib.rs │ │ │ ├── Cargo.toml │ │ │ └── Cargo.lock │ │ └── feather_rp2040.toml │ ├── FeatherWing_propmaker │ │ ├── prop-maker.png │ │ ├── bsp │ │ │ ├── Cargo.toml │ │ │ ├── src │ │ │ │ └── lib.rs │ │ │ └── Cargo.lock │ │ └── prop-maker.toml │ ├── Feather_nRF52832 │ │ ├── feather_nRF52832.png │ │ ├── bsp │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── lib.rs │ │ ├── template │ │ │ ├── Cargo.toml │ │ │ ├── src │ │ │ │ └── main.rs │ │ │ └── .cargo │ │ │ │ └── config │ │ └── feather_nRF52832.toml │ ├── PiTTF_32_cap_touch │ │ ├── pitft32-cap-touch.png │ │ ├── pitft32-cap-touch.toml │ │ └── bsp │ │ │ ├── Cargo.toml │ │ │ ├── src │ │ │ └── lib.rs │ │ │ └── Cargo.lock │ └── FeatherWing_OLED_128x64 │ │ ├── featherwing_oled_128x64.png │ │ ├── featherwing_oled_128x64.toml │ │ └── bsp │ │ ├── Cargo.toml │ │ ├── src │ │ └── lib.rs │ │ └── Cargo.lock └── Sparkfun │ ├── MicroMod-ESP32 │ ├── template │ │ ├── rust-toolchain.toml │ │ ├── .cargo │ │ │ └── config │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ ├── bsp │ │ ├── examples │ │ │ └── blinky │ │ │ │ ├── rust-toolchain.toml │ │ │ │ ├── .gitignore │ │ │ │ ├── .cargo │ │ │ │ └── config.toml │ │ │ │ ├── Cargo.toml │ │ │ │ ├── src │ │ │ │ └── main.rs │ │ │ │ ├── LICENSE-MIT │ │ │ │ ├── .github │ │ │ │ └── workflows │ │ │ │ │ └── rust_ci.yml │ │ │ │ └── LICENSE-APACHE │ │ ├── src │ │ │ └── lib.rs │ │ ├── Cargo.lock │ │ └── Cargo.toml │ ├── micromod_esp32.png │ └── micromod_esp32.toml │ └── MicroMod-RP2040 │ ├── micromod_rp2040.png │ ├── template │ ├── memory.x │ ├── Cargo.toml │ ├── .cargo │ │ └── config │ └── src │ │ └── main.rs │ └── micromod_rp2040.toml ├── iron_coder.exe ├── assets ├── fonts │ ├── vcr_osd_mono │ │ ├── README.md │ │ └── VCR_OSD_MONO_1.001.ttf │ ├── platinum-sign │ │ ├── README.md │ │ ├── Platinum-Sign.ttf │ │ ├── Platinum-Sign-Over.ttf │ │ └── Platinum-Sign-Under.ttf │ ├── REAMDE.md │ ├── chintzycpu │ │ ├── chintzy.ttf │ │ ├── chintzys.ttf │ │ └── chintzycpu.txt │ ├── unispace │ │ ├── unispace bd.otf │ │ ├── unispace it.otf │ │ ├── unispace rg.otf │ │ ├── unispace bd it.otf │ │ └── Typodermic Desktop EULA 2023.pdf │ └── Roboto_Mono │ │ ├── static │ │ ├── RobotoMono-Bold.ttf │ │ ├── RobotoMono-Light.ttf │ │ ├── RobotoMono-Thin.ttf │ │ ├── RobotoMono-Italic.ttf │ │ ├── RobotoMono-Medium.ttf │ │ ├── RobotoMono-Regular.ttf │ │ ├── RobotoMono-BoldItalic.ttf │ │ ├── RobotoMono-ExtraLight.ttf │ │ ├── RobotoMono-SemiBold.ttf │ │ ├── RobotoMono-ThinItalic.ttf │ │ ├── RobotoMono-LightItalic.ttf │ │ ├── RobotoMono-MediumItalic.ttf │ │ ├── RobotoMono-SemiBoldItalic.ttf │ │ └── RobotoMono-ExtraLightItalic.ttf │ │ ├── RobotoMono-VariableFont_wght.ttf │ │ ├── RobotoMono-Italic-VariableFont_wght.ttf │ │ ├── README.txt │ │ └── LICENSE.txt ├── images │ ├── rp400.jpg │ ├── feather-logo.png │ ├── feather_rp2040.jpg │ ├── feather_rp2040.png │ └── Adafruit_logo_small.png ├── icons │ ├── pack │ │ ├── white │ │ │ ├── chip.png │ │ │ ├── gear.png │ │ │ ├── 005b_13.gif │ │ │ ├── 005b_15.gif │ │ │ ├── 005b_19.gif │ │ │ ├── 005b_23.gif │ │ │ ├── 005b_27.gif │ │ │ ├── 005b_35.gif │ │ │ ├── 005b_39.gif │ │ │ ├── 005b_43.gif │ │ │ ├── 005b_44.gif │ │ │ ├── 005b_49.gif │ │ │ ├── 005b_50.gif │ │ │ ├── 005b_53.gif │ │ │ ├── 005b_56.gif │ │ │ ├── 005b_65.gif │ │ │ └── 005b_75.gif │ │ ├── black │ │ │ ├── 005b_01.gif │ │ │ ├── 005b_02.gif │ │ │ ├── 005b_03.gif │ │ │ ├── 005b_04.gif │ │ │ ├── 005b_05.gif │ │ │ ├── 005b_06.gif │ │ │ ├── 005b_07.gif │ │ │ ├── 005b_08.gif │ │ │ ├── 005b_09.gif │ │ │ ├── 005b_10.gif │ │ │ ├── 005b_11.gif │ │ │ ├── 005b_12.gif │ │ │ ├── 005b_13.gif │ │ │ ├── 005b_14.gif │ │ │ ├── 005b_15.gif │ │ │ ├── 005b_16.gif │ │ │ ├── 005b_17.gif │ │ │ ├── 005b_18.gif │ │ │ ├── 005b_19.gif │ │ │ ├── 005b_20.gif │ │ │ ├── 005b_21.gif │ │ │ ├── 005b_22.gif │ │ │ ├── 005b_23.gif │ │ │ ├── 005b_24.gif │ │ │ ├── 005b_25.gif │ │ │ ├── 005b_26.gif │ │ │ ├── 005b_27.gif │ │ │ ├── 005b_28.gif │ │ │ ├── 005b_29.gif │ │ │ ├── 005b_30.gif │ │ │ ├── 005b_31.gif │ │ │ ├── 005b_32.gif │ │ │ ├── 005b_33.gif │ │ │ ├── 005b_34.gif │ │ │ ├── 005b_35.gif │ │ │ ├── 005b_36.gif │ │ │ ├── 005b_37.gif │ │ │ ├── 005b_38.gif │ │ │ ├── 005b_39.gif │ │ │ ├── 005b_40.gif │ │ │ ├── 005b_41.gif │ │ │ ├── 005b_42.gif │ │ │ ├── 005b_43.gif │ │ │ ├── 005b_44.gif │ │ │ ├── 005b_45.gif │ │ │ ├── 005b_46.gif │ │ │ ├── 005b_47.gif │ │ │ ├── 005b_48.gif │ │ │ ├── 005b_49.gif │ │ │ ├── 005b_50.gif │ │ │ ├── 005b_51.gif │ │ │ ├── 005b_52.gif │ │ │ ├── 005b_53.gif │ │ │ ├── 005b_54.gif │ │ │ ├── 005b_55.gif │ │ │ ├── 005b_56.gif │ │ │ ├── 005b_57.gif │ │ │ ├── 005b_58.gif │ │ │ ├── 005b_59.gif │ │ │ ├── 005b_60.gif │ │ │ ├── 005b_61.gif │ │ │ ├── 005b_62.gif │ │ │ ├── 005b_63.gif │ │ │ ├── 005b_64.gif │ │ │ ├── 005b_65.gif │ │ │ ├── 005b_66.gif │ │ │ ├── 005b_67.gif │ │ │ ├── 005b_68.gif │ │ │ ├── 005b_69.gif │ │ │ ├── 005b_70.gif │ │ │ ├── 005b_71.gif │ │ │ ├── 005b_72.gif │ │ │ ├── 005b_73.gif │ │ │ ├── 005b_74.gif │ │ │ └── 005b_75.gif │ │ └── readme.txt │ └── README.md └── code-snippets │ ├── ws2812-pio │ └── constructor.rs │ └── REAMDE.md ├── docs ├── ic-poster.png ├── iron-coder-paper.pdf ├── iron-coder-proposal.pdf └── Iron_Coder_ASEE_Final.pdf ├── rust-toolchain.toml ├── src ├── lib.rs ├── project │ ├── test.rs │ ├── egui_helpers.rs │ └── system.rs ├── app │ ├── test.rs │ ├── icons.rs │ └── colorscheme.rs ├── main.rs └── board │ ├── test.rs │ ├── pinout.rs │ ├── svg_reader.rs │ ├── parsing.rs │ ├── mod.rs │ └── display.rs ├── screenshots └── iron-coder.png ├── mindmap ├── Excalidraw │ ├── Pasted Image 20230509110821_653.png │ └── Pasted Image 20230510184138_555.png ├── egui integrations.md ├── spec viewer.md └── code editor.md ├── .gitignore ├── .github └── workflows │ └── rust.yml ├── Cargo.toml ├── todo.txt └── README.md /iron-coder-boards/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .vscode -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/examples/neopixel/src/NeoPixel.rs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/template/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /iron_coder.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/iron_coder.exe -------------------------------------------------------------------------------- /assets/fonts/vcr_osd_mono/README.md: -------------------------------------------------------------------------------- 1 | sourced from https://www.dafont.com/vcr-osd-mono.font 2 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/examples/blinky/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | Cargo.lock -------------------------------------------------------------------------------- /assets/fonts/platinum-sign/README.md: -------------------------------------------------------------------------------- 1 | sourced from: https://www.dafont.com/platinum-sign.font 2 | -------------------------------------------------------------------------------- /docs/ic-poster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/docs/ic-poster.png -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "stable" 3 | # targets = ["x86_64-pc-windows-msvc"] -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | mod app; 2 | mod board; 3 | mod project; 4 | pub use app::{IronCoderOptions, IronCoderApp}; -------------------------------------------------------------------------------- /assets/images/rp400.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/images/rp400.jpg -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/template/rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "esp" 3 | -------------------------------------------------------------------------------- /assets/fonts/REAMDE.md: -------------------------------------------------------------------------------- 1 | Other fonts I like: 2 | 3 | * https://www.fontspace.com/code-squared-font-f25246 4 | 5 | -------------------------------------------------------------------------------- /docs/iron-coder-paper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/docs/iron-coder-paper.pdf -------------------------------------------------------------------------------- /screenshots/iron-coder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/screenshots/iron-coder.png -------------------------------------------------------------------------------- /docs/iron-coder-proposal.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/docs/iron-coder-proposal.pdf -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/bsp/examples/blinky/rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "esp" 3 | -------------------------------------------------------------------------------- /assets/icons/pack/white/chip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/chip.png -------------------------------------------------------------------------------- /assets/icons/pack/white/gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/gear.png -------------------------------------------------------------------------------- /assets/images/feather-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/images/feather-logo.png -------------------------------------------------------------------------------- /assets/images/feather_rp2040.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/images/feather_rp2040.jpg -------------------------------------------------------------------------------- /assets/images/feather_rp2040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/images/feather_rp2040.png -------------------------------------------------------------------------------- /docs/Iron_Coder_ASEE_Final.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/docs/Iron_Coder_ASEE_Final.pdf -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/examples/blinky/src/test.rs: -------------------------------------------------------------------------------- 1 | // a test file! 2 | 3 | pub struct TestStruct { 4 | 5 | } -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/examples/neopixel/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello, world!"); 3 | } 4 | -------------------------------------------------------------------------------- /assets/fonts/chintzycpu/chintzy.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/chintzycpu/chintzy.ttf -------------------------------------------------------------------------------- /assets/fonts/chintzycpu/chintzys.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/chintzycpu/chintzys.ttf -------------------------------------------------------------------------------- /assets/fonts/unispace/unispace bd.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/unispace/unispace bd.otf -------------------------------------------------------------------------------- /assets/fonts/unispace/unispace it.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/unispace/unispace it.otf -------------------------------------------------------------------------------- /assets/fonts/unispace/unispace rg.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/unispace/unispace rg.otf -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_01.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_01.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_02.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_02.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_03.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_03.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_04.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_04.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_05.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_05.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_06.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_06.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_07.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_07.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_08.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_08.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_09.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_09.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_10.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_11.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_12.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_13.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_14.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_15.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_16.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_17.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_18.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_19.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_20.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_21.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_22.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_23.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_24.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_25.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_26.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_27.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_28.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_29.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_30.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_31.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_32.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_33.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_34.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_35.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_36.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_37.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_38.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_39.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_40.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_41.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_42.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_43.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_44.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_45.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_46.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_47.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_48.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_49.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_50.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_51.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_52.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_53.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_54.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_55.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_56.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_57.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_58.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_59.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_60.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_61.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_62.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_63.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_64.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_65.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_66.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_67.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_68.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_69.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_70.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_70.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_71.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_72.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_72.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_73.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_73.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_74.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_74.gif -------------------------------------------------------------------------------- /assets/icons/pack/black/005b_75.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/black/005b_75.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_13.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_15.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_19.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_23.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_27.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_35.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_39.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_43.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_44.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_49.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_50.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_53.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_56.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_65.gif -------------------------------------------------------------------------------- /assets/icons/pack/white/005b_75.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/icons/pack/white/005b_75.gif -------------------------------------------------------------------------------- /assets/images/Adafruit_logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/images/Adafruit_logo_small.png -------------------------------------------------------------------------------- /assets/fonts/chintzycpu/chintzycpu.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/chintzycpu/chintzycpu.txt -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/bsp/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Iron Coder BSP for MicroMod ESP32 2 | 3 | pub struct Board { 4 | 5 | } -------------------------------------------------------------------------------- /assets/fonts/unispace/unispace bd it.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/unispace/unispace bd it.otf -------------------------------------------------------------------------------- /assets/fonts/platinum-sign/Platinum-Sign.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/platinum-sign/Platinum-Sign.ttf -------------------------------------------------------------------------------- /assets/fonts/platinum-sign/Platinum-Sign-Over.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/platinum-sign/Platinum-Sign-Over.ttf -------------------------------------------------------------------------------- /assets/fonts/vcr_osd_mono/VCR_OSD_MONO_1.001.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/vcr_osd_mono/VCR_OSD_MONO_1.001.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-Light.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-Thin.ttf -------------------------------------------------------------------------------- /assets/fonts/platinum-sign/Platinum-Sign-Under.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/platinum-sign/Platinum-Sign-Under.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-Italic.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-Medium.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/unispace/Typodermic Desktop EULA 2023.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/unispace/Typodermic Desktop EULA 2023.pdf -------------------------------------------------------------------------------- /mindmap/Excalidraw/Pasted Image 20230509110821_653.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/mindmap/Excalidraw/Pasted Image 20230509110821_653.png -------------------------------------------------------------------------------- /mindmap/Excalidraw/Pasted Image 20230510184138_555.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/mindmap/Excalidraw/Pasted Image 20230510184138_555.png -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/RobotoMono-VariableFont_wght.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/RobotoMono-VariableFont_wght.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-BoldItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-ExtraLight.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-SemiBold.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-ThinItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-LightItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-MediumItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/feather_rp2040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/iron-coder-boards/Adafruit/Feather_RP2040/feather_rp2040.png -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/micromod_esp32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/iron-coder-boards/Sparkfun/MicroMod-ESP32/micromod_esp32.png -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-RP2040/micromod_rp2040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/iron-coder-boards/Sparkfun/MicroMod-RP2040/micromod_rp2040.png -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/RobotoMono-Italic-VariableFont_wght.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/RobotoMono-Italic-VariableFont_wght.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/static/RobotoMono-ExtraLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/assets/fonts/Roboto_Mono/static/RobotoMono-ExtraLightItalic.ttf -------------------------------------------------------------------------------- /assets/icons/README.md: -------------------------------------------------------------------------------- 1 | Some notes regarding icons 2 | 3 | * it seems difficult to find retro-theme icons 4 | * what is an icon vs a font? what about using an emoji font as icons? 5 | * -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/FeatherWing_propmaker/prop-maker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/iron-coder-boards/Adafruit/FeatherWing_propmaker/prop-maker.png -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_nRF52832/feather_nRF52832.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/iron-coder-boards/Adafruit/Feather_nRF52832/feather_nRF52832.png -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/PiTTF_32_cap_touch/pitft32-cap-touch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/iron-coder-boards/Adafruit/PiTTF_32_cap_touch/pitft32-cap-touch.png -------------------------------------------------------------------------------- /assets/code-snippets/ws2812-pio/constructor.rs: -------------------------------------------------------------------------------- 1 | let mut neopixels = Ws2812::new( 2 | pins.d5.into_mode(), 3 | &mut pio, 4 | sm0, 5 | clocks.peripheral_clock.freq(), 6 | timer.count_down(), 7 | ); -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/FeatherWing_OLED_128x64/featherwing_oled_128x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shulltronics/iron-coder/HEAD/iron-coder-boards/Adafruit/FeatherWing_OLED_128x64/featherwing_oled_128x64.png -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/FeatherWing_propmaker/bsp/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "iron-coder-featherwing-propmaker-bsp" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | embedded-hal = "0.2.7" 8 | lis3dh = "0.4.2" -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/bsp/src/prelude.rs: -------------------------------------------------------------------------------- 1 | pub use adafruit_feather_rp2040::entry; 2 | pub use embedded_hal::digital::v2::OutputPin; 3 | pub use crate::Board; 4 | pub use smart_leds::{brightness, SmartLedsWrite, RGB8}; -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/micromod_esp32.toml: -------------------------------------------------------------------------------- 1 | 2 | name = "MicroMod ESP32 Processor" 3 | manufacturer = "Sparkfun" 4 | is_main_board = true 5 | standard = "MicroMod" 6 | cpu = "ESP32" 7 | 8 | bsp = "iron-coder-micromod-esp32-bsp" -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/bsp/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "iron-coder-micromod-esp32-bsp" 7 | version = "0.1.0" 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .obsidian/ 3 | tmp/ 4 | settings.toml 5 | 6 | # for now don't track these as they constantly have breaking changes 7 | projects/ 8 | 9 | # Added by cargo 10 | 11 | /target 12 | /Cargo.lock 13 | *.lock 14 | /settings.toml 15 | -------------------------------------------------------------------------------- /assets/code-snippets/REAMDE.md: -------------------------------------------------------------------------------- 1 | This directory contains platform-independent code snippets for use in Iron Coder. The snippets are organized according to the crate they're related to 2 | 3 | MCU-specific snippets should be placed in the appropriate `board` directory -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/examples/blinky/README.md: -------------------------------------------------------------------------------- 1 | Embedded Rust Template Project for Feather RP2040 2 | ================================================= 3 | 4 | This repo contains a simple blinky-led example in embedded rust for the Adafruit Feather RP2040. -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/examples/neopixel/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "neopixel" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/bsp/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "iron-coder-micromod-esp32-bsp" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /assets/icons/pack/readme.txt: -------------------------------------------------------------------------------- 1 | "BacktoPixel 1.0" icons set by Icojoy.com 2 | 3 | Ammount of icons: 4 | 75 5 | 6 | Colors: 7 | 10+ 8 | 9 | Icon Sizes: 10 | 9x9, 18x18, 28x28 11 | 12 | File Types: 13 | .gif (indexed) 14 | .png (RGBA) 15 | 16 | Note: These icons are free for use. -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/bsp/examples/blinky/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | debug/ 4 | target/ 5 | 6 | # These are backup files generated by rustfmt 7 | **/*.rs.bk 8 | 9 | # MSVC Windows builds of rustc generate these, which store debugging information 10 | *.pdb 11 | -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/template/.cargo/config: -------------------------------------------------------------------------------- 1 | [target.xtensa-esp32-none-elf] 2 | runner = "espflash flash --monitor" 3 | 4 | [build] 5 | rustflags = [ 6 | "-C", "link-arg=-Tlinkall.x", 7 | "-C", "link-arg=-nostartfiles", 8 | ] 9 | 10 | target = "xtensa-esp32-none-elf" 11 | 12 | [unstable] 13 | build-std = ["core"] 14 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/examples/neopixel/.ironcoder.toml: -------------------------------------------------------------------------------- 1 | name = "neopixel_example" 2 | location = 'C:\Users\carst\Projects\iron-coder\boards\Adafruit\Feather_RP2040\examples\neopixel' 3 | 4 | [[boards]] 5 | name = "Feather RP2040" 6 | manufacturer = "Adafruit" 7 | standard = "Feather" 8 | cpu = "Cortex-M0" 9 | ram = 264 10 | flash = 8000 11 | -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/bsp/examples/blinky/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [target.xtensa-esp32-none-elf] 2 | runner = "espflash flash --monitor" 3 | 4 | [build] 5 | rustflags = [ 6 | "-C", "link-arg=-Tlinkall.x", 7 | "-C", "link-arg=-nostartfiles", 8 | ] 9 | 10 | target = "xtensa-esp32-none-elf" 11 | 12 | [unstable] 13 | build-std = ["core"] 14 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/FeatherWing_OLED_128x64/featherwing_oled_128x64.toml: -------------------------------------------------------------------------------- 1 | 2 | name = "OLED Featherwing (128x64)" 3 | manufacturer = "Adafruit" 4 | is_main_board = false 5 | standard = "Feather" 6 | 7 | related_crates = ["sh1107"] 8 | 9 | bsp = "iron-coder-featherwing-oled-bsp" 10 | 11 | [[pinout]] 12 | pins = ["8", "9"] 13 | interface = { iface_type = "I2C", direction = "Input" } -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/template/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = {{ name }} 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | hal = { package = "esp32-hal", version = "0.13.0" } 8 | esp-backtrace = { version = "0.7.0", features = ["esp32", "panic-handler", "exception-handler", "print-uart"] } 9 | esp-println = { version = "0.5.0", features = ["esp32"] } 10 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_nRF52832/bsp/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "iron-coder-nRF52832-bsp" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | embedded-hal = "0.2.7" 10 | # sh1106 = "0.4.0" 11 | sh1107 = { git = "https://github.com/shulltronics/sh1107.git", branch = "embedded-graphics-fix" } 12 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/template/memory.x: -------------------------------------------------------------------------------- 1 | MEMORY { 2 | BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100 3 | FLASH : ORIGIN = 0x10000100, LENGTH = 2048K - 0x100 4 | RAM : ORIGIN = 0x20000000, LENGTH = 256K 5 | } 6 | 7 | EXTERN(BOOT2_FIRMWARE) 8 | 9 | SECTIONS { 10 | /* ### Boot loader */ 11 | .boot2 ORIGIN(BOOT2) : 12 | { 13 | KEEP(*(.boot2)); 14 | } > BOOT2 15 | } INSERT BEFORE .text; 16 | -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-RP2040/template/memory.x: -------------------------------------------------------------------------------- 1 | MEMORY { 2 | BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100 3 | FLASH : ORIGIN = 0x10000100, LENGTH = 2048K - 0x100 4 | RAM : ORIGIN = 0x20000000, LENGTH = 256K 5 | } 6 | 7 | EXTERN(BOOT2_FIRMWARE) 8 | 9 | SECTIONS { 10 | /* ### Boot loader */ 11 | .boot2 ORIGIN(BOOT2) : 12 | { 13 | KEEP(*(.boot2)); 14 | } > BOOT2 15 | } INSERT BEFORE .text; 16 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/FeatherWing_OLED_128x64/bsp/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "iron-coder-featherwing-oled-bsp" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | embedded-hal = "0.2.7" 10 | # sh1106 = "0.4.0" 11 | sh1107 = { git = "https://github.com/shulltronics/sh1107.git", branch = "embedded-graphics-fix" } 12 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/examples/blinky/memory.x: -------------------------------------------------------------------------------- 1 | MEMORY { 2 | BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100 3 | FLASH : ORIGIN = 0x10000100, LENGTH = 2048K - 0x100 4 | RAM : ORIGIN = 0x20000000, LENGTH = 256K 5 | } 6 | 7 | EXTERN(BOOT2_FIRMWARE) 8 | 9 | SECTIONS { 10 | /* ### Boot loader */ 11 | .boot2 ORIGIN(BOOT2) : 12 | { 13 | KEEP(*(.boot2)); 14 | } > BOOT2 15 | } INSERT BEFORE .text; 16 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/examples/blinky/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "feather-rp2040-test" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | panic-halt = "0.2.0" 10 | cortex-m = "0.7.2" 11 | cortex-m-rt = "0.7" 12 | embedded-time = "0.12.0" 13 | embedded-hal = "0.2.5" 14 | adafruit-feather-rp2040 = "0.1.0" 15 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/examples/blinky/.ironcoder.toml: -------------------------------------------------------------------------------- 1 | name = "test proj" 2 | location = 'C:\Users\carst\Projects\iron-coder\boards\Adafruit\Feather_RP2040\examples\blinky' 3 | 4 | [[boards]] 5 | name = "Feather RP2040" 6 | manufacturer = "Adafruit" 7 | standard = "Feather" 8 | cpu = "Cortex-M0" 9 | ram = 264 10 | flash = 8000 11 | 12 | [[boards]] 13 | name = "Feather nRF52840 Express" 14 | manufacturer = "Adafruit" 15 | standard = "Feather" 16 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/FeatherWing_propmaker/prop-maker.toml: -------------------------------------------------------------------------------- 1 | 2 | name = "PropMaker Featherwing" 3 | manufacturer = "Adafruit" 4 | is_main_board = false 5 | standard = "Feather" 6 | 7 | related_crates = ["lis3dh"] 8 | 9 | bsp = "iron-coder-featherwing-propmaker-bsp" 10 | 11 | # Each element of the Pinout Vec should be prefaced with [[pinout]] 12 | [[pinout]] 13 | pins = ["5", "9"] 14 | interface = { iface_type = "I2C", direction = "Input" } 15 | ident = "Accelerometer" -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/PiTTF_32_cap_touch/pitft32-cap-touch.toml: -------------------------------------------------------------------------------- 1 | 2 | name = "PiTFT 3.2 with Capacitive Touch Screen" 3 | manufacturer = "Adafruit" 4 | is_main_board = false 5 | 6 | related_crates = ["ili9341", "embedded-graphics"] 7 | 8 | bsp = "iron-coder-pitft-32-cap-touch-bsp" 9 | 10 | # Each element of the Pinout Vec should be prefaced with [[pinout]] 11 | [[pinout]] 12 | pins = ["pin", "out"] 13 | interface = { iface_type = "SPI", direction = "Input" } 14 | ident = "Display" -------------------------------------------------------------------------------- /src/project/test.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod project_tests { 3 | use crate::project::*; 4 | 5 | #[test] 6 | pub fn test_save_as() { 7 | let mut project: Project = Project{name : "test_project".to_string(), location: None, system: Default::default(), code_editor: Default::default(), terminal_buffer: "".to_string(), receiver: None, current_view: Default::default(), known_boards: vec![], repo: Repository }; 8 | project.save_as(true).expect("Project Failed to Save!"); 9 | } 10 | } -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/bsp/examples/blinky/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "blinky" 3 | version = "0.1.0" 4 | authors = ["Carsten Thue-Bludworth "] 5 | edition = "2021" 6 | license = "MIT OR Apache-2.0" 7 | 8 | [dependencies] 9 | hal = { package = "esp32-hal", version = "0.13.0" } 10 | esp-backtrace = { version = "0.7.0", features = ["esp32", "panic-handler", "exception-handler", "print-uart"] } 11 | esp-println = { version = "0.5.0", features = ["esp32"] } 12 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/PiTTF_32_cap_touch/bsp/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "iron-coder-pitft-32-cap-touch-bsp" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | display-interface = "0.4.1" 10 | display-interface-spi = "0.4.1" 11 | embedded-hal = { version = "0.2.7" } 12 | embedded-hal-one = { package = "embedded-hal", version = "^1.0.0-alpha.9" } 13 | ft6236 = "0.0.3" 14 | ili9341 = "0.5.0" 15 | 16 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/template/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "feather-rp2040-blink" 3 | version = "0.2.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | panic-halt = "0.2.0" 10 | cortex-m = "0.7.7" 11 | cortex-m-rt = "0.7.3" 12 | embedded-hal = "0.2.7" 13 | adafruit-feather-rp2040 = "0.7.0" 14 | usbd-serial = "0.1.1" 15 | usb-device = "0.2.9" 16 | critical-section = "1.1.2" -------------------------------------------------------------------------------- /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v3 19 | - name: Build 20 | run: sudo apt-get update; sudo apt-get upgrade; 21 | sudo apt-get install libglib2.0-dev libssl-dev libatk1.0-dev libgtk-3-dev; 22 | cargo build --verbose 23 | - name: Run tests 24 | run: cargo test --verbose 25 | -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-RP2040/template/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "micromod-rp2040-blink" 3 | version = "0.2.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | panic-halt = "0.2.0" 10 | cortex-m = "0.7.7" 11 | cortex-m-rt = "0.7.3" 12 | embedded-hal = "1.0.0" 13 | sparkfun-micromod-rp2040 = "0.3.0" 14 | usbd-serial = "0.2.1" 15 | usb-device = "0.3.2" 16 | critical-section = "1.1.2" -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/bsp/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "iron-coder-feather-rp2040-bsp" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | adafruit-feather-rp2040 = "0.6.0" 8 | rp2040-hal = { features = ["eh1_0_alpha"] } 9 | embedded-hal = "0.2.7" 10 | ws2812-pio = "0.6.0" 11 | smart-leds = "0.3.0" 12 | usbd-serial = "0.1.1" 13 | usb-device = "0.2.9" 14 | critical-section = "1.1.1" 15 | fugit = "0.3.7" 16 | rtt-target = "0.4.0" 17 | cortex-m = "0.7.7" 18 | #shared-bus = { version = "0.2.5", path = "../../../../../shared-bus" } 19 | shared-bus = "0.2.5" 20 | -------------------------------------------------------------------------------- /src/app/test.rs: -------------------------------------------------------------------------------- 1 | /// TODO - Write more tests mainly testing egui related functionality (more research needed) 2 | #[cfg(test)] 3 | mod app_tests { 4 | use crate::IronCoderApp; 5 | 6 | #[test] 7 | fn test_initialization() { 8 | let app : IronCoderApp = IronCoderApp::default(); 9 | assert_ne!(app.boards.len(), 0); 10 | } 11 | #[test] 12 | fn test_get_boards() { 13 | let app : IronCoderApp = IronCoderApp::default(); 14 | let boards = app.get_boards(); 15 | assert_ne!(boards.len(), 0); 16 | assert_eq!(boards, app.boards); 17 | } 18 | } -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/template/README.md: -------------------------------------------------------------------------------- 1 | Embedded Rust Template Project for Feather RP2040 2 | ================================================= 3 | 4 | This repo contains a simple blinky-led example in embedded rust for the Adafruit Feather RP2040. The template includes code that will configure the USB peripheral as a serial port to allow for printing of formatted strings via the `write!` macro. Additionally, panic messages are sent to the serial port, and will show up when properly connected to a utility such as minicom, nRF terminal, or putty. 5 | 6 | ### Acknowledgements 7 | Most of this code is adapted from [this](https://github.com/eterevsky/rp2040-blink/blob/main/README.md) repository -- thanks! 8 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_nRF52832/template/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "feather-nRF52832-blink" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | panic-halt = "0.2.0" 10 | rtt-target = { version = "0.3.1", features = ["cortex-m"] } 11 | cortex-m-rt = "0.7.3" 12 | nb = "1.0.0" 13 | cortex-m = "0.7.7" 14 | embedded-hal = "1.0.0" 15 | nrf52832-hal = "0.16.0" 16 | nrf52832-pac = "0.12.2" 17 | usbd-serial = "0.2.0" 18 | usb-device = "0.3.1" 19 | critical-section = "1.1.2" 20 | -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-RP2040/micromod_rp2040.toml: -------------------------------------------------------------------------------- 1 | 2 | name = "MicroMod RP2040" 3 | manufacturer = "Sparkfun" 4 | is_main_board = true 5 | standard = "MicroMod" 6 | cpu = "Cortex-M0" 7 | ram = 264 8 | flash = 8000 9 | required_crates = ["sparkfun_micromod_rp2040", "embedded-hal", "embedded-time", "cortex-m-rt", "cortex-m", "panic-halt"] 10 | 11 | # Each element of the Pinout Vec should be prefaced with [[pinout]] 12 | [[pinout]] 13 | pins = ["rx", "tx"] 14 | interface = { iface_type = "UART", direction = "Bidirectional" } 15 | 16 | [[pinout]] 17 | pins = ["scl", "sda"] 18 | interface = { iface_type = "I2C", direction = "Output" } 19 | 20 | [[pinout]] 21 | pins = ["mosi", "miso", "sclk"] 22 | interface = { iface_type = "SPI", direction = "Output" } -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/feather_rp2040.toml: -------------------------------------------------------------------------------- 1 | 2 | name = "Feather RP2040" 3 | manufacturer = "Adafruit" 4 | is_main_board = true 5 | standard = "Feather" 6 | cpu = "Cortex-M0" 7 | ram = 264 8 | flash = 8000 9 | required_crates = ["adafruit-feather-rp2040", "embedded-hal", "embedded-time", "cortex-m-rt", "cortex-m", "panic-halt"] 10 | related_crates = ["smart-leds", "ws2812-pio"] 11 | 12 | bsp = "iron-coder-feather-rp2040-bsp" 13 | 14 | # Each element of the Pinout Vec should be prefaced with [[pinout]] 15 | [[pinout]] 16 | pins = ["rx", "tx"] 17 | interface = { iface_type = "UART", direction = "Bidirectional" } 18 | 19 | [[pinout]] 20 | pins = ["scl", "sda"] 21 | interface = { iface_type = "I2C", direction = "Output" } 22 | 23 | [[pinout]] 24 | pins = ["mosi", "miso", "sclk"] 25 | interface = { iface_type = "SPI", direction = "Output" } -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_nRF52832/feather_nRF52832.toml: -------------------------------------------------------------------------------- 1 | 2 | name = "Feather nRF52832" 3 | manufacturer = "Adafruit" 4 | is_main_board = true 5 | standard = "Feather" 6 | cpu = "Cortex-M4" 7 | ram = 64 8 | flash = 512 9 | required_crates = ["nRF52832-hal", "nrf52832-pac", "nb", "embedded-hal", "embedded-time", "cortex-m-rt", "cortex-m", "panic-halt"] 10 | related_crates = ["smart-leds", "ws2812-pio"] 11 | 12 | bsp = "iron-coder-nRF52832-bsp" 13 | 14 | # Each element of the Pinout Vec should be prefaced with [[pinout]] 15 | [[pinout]] 16 | pins = ["rx", "tx"] 17 | interface = { iface_type = "UART", direction = "Bidirectional" } 18 | 19 | [[pinout]] 20 | pins = ["scl", "sda"] 21 | interface = { iface_type = "I2C", direction = "Output" } 22 | 23 | [[pinout]] 24 | pins = ["mosi", "miso", "sclk"] 25 | interface = { iface_type = "SPI", direction = "Output" } -------------------------------------------------------------------------------- /mindmap/egui integrations.md: -------------------------------------------------------------------------------- 1 | The `egui` documentation isn't super clear about the differences in building for Wayland vs X11. 2 | 3 | Do include `cargo.lock` in version control, as this is an application. See [here](https://doc.rust-lang.org/cargo/faq.html#why-do-binaries-have-cargolock-in-version-control-but-not-libraries) 4 | 5 | **TODO** : overall GUI integrations: 6 | * Menu bar 7 | * Logos and icons 8 | * Fonts 9 | * Color schemes 10 | * Move / hide / pop-out panels 11 | * etc... 12 | 13 | **TODO** : Try to get a [[code editor]] in the window. My first attempt will probably be to copy-modify-paste the code from the [demo](https://github.com/emilk/egui/blob/master/crates/egui_demo_lib/src/demo/code_editor.rs). But I also want to explore getting the editor logic from Lapce. 14 | 15 | **TODO** : regarding the [[spec viewer]], for the 3D model, should I use something like [Bevy](https://github.com/bevyengine/bevy)? -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/FeatherWing_propmaker/bsp/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Propmaker Featherwing Iron Coder BSP 2 | 3 | #![no_std] 4 | 5 | use lis3dh::{Lis3dh, Lis3dhI2C, SlaveAddr}; 6 | use lis3dh::accelerometer::Accelerometer; 7 | use embedded_hal::blocking::i2c::{WriteRead, Write}; 8 | 9 | pub struct Accelerometer 10 | where I2C: WriteRead + Write 11 | { 12 | accelerometer: Lis3dh>, 13 | } 14 | 15 | impl Accelerometer 16 | where T: WriteRead + Write, E: core::fmt::Debug 17 | { 18 | // Create a new PropMaker. This should probably take arguments of the 19 | // configured interfaces from the programmable board. 20 | pub fn init(i2c: T) -> Self { 21 | Self { 22 | accelerometer: Lis3dh::new_i2c(i2c, SlaveAddr::Default).unwrap(), 23 | } 24 | } 25 | 26 | pub fn read(&mut self) -> Result { 27 | a.accel_norm.unwrap()[0]; 28 | } 29 | } -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use log::info; 2 | use clap::Parser; 3 | use std::str::FromStr; 4 | 5 | use iron_coder::IronCoderOptions; 6 | 7 | fn main() -> eframe::Result<()> { 8 | 9 | let mut app_options = IronCoderOptions::parse(); 10 | if app_options.persistence.is_none() { 11 | app_options.persistence = Some(true); 12 | } 13 | 14 | // Setup the subscriber with a logging level. 15 | let debug_level: tracing::Level = if let Some(verbosity) = app_options.clone().verbosity { 16 | tracing::Level::from_str(&verbosity).unwrap_or_else(|_| { 17 | println!("Unknown debug level, using INFO instead."); 18 | tracing::Level::INFO 19 | }) 20 | } else { 21 | tracing::Level::INFO 22 | }; 23 | tracing_subscriber::fmt().with_max_level(debug_level).init(); 24 | 25 | info!("Running Iron Coder with options:\n{:?}", app_options); 26 | 27 | let native_options = eframe::NativeOptions::default(); 28 | eframe::run_native( 29 | "Iron Coder", 30 | native_options, 31 | Box::new(|cc| Box::new(iron_coder::IronCoderApp::with_options(cc, app_options))), 32 | ) 33 | } 34 | -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/template/src/main.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![no_main] 3 | 4 | use esp_backtrace as _; 5 | use esp_println::println; 6 | use hal::{clock::ClockControl, peripherals::Peripherals, prelude::*, timer::TimerGroup, Rtc}; 7 | #[entry] 8 | fn main() -> ! { 9 | let peripherals = Peripherals::take(); 10 | let mut system = peripherals.DPORT.split(); 11 | let clocks = ClockControl::boot_defaults(system.clock_control).freeze(); 12 | 13 | // Disable the RTC and TIMG watchdog timers 14 | let mut rtc = Rtc::new(peripherals.RTC_CNTL); 15 | let timer_group0 = TimerGroup::new( 16 | peripherals.TIMG0, 17 | &clocks, 18 | &mut system.peripheral_clock_control, 19 | ); 20 | let mut wdt0 = timer_group0.wdt; 21 | let timer_group1 = TimerGroup::new( 22 | peripherals.TIMG1, 23 | &clocks, 24 | &mut system.peripheral_clock_control, 25 | ); 26 | let mut wdt1 = timer_group1.wdt; 27 | rtc.rwdt.disable(); 28 | wdt0.disable(); 29 | wdt1.disable(); 30 | 31 | 32 | 33 | println!("Hello world!"); 34 | 35 | loop { 36 | // println!("Hello world!"); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/bsp/examples/blinky/src/main.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![no_main] 3 | 4 | use esp_backtrace as _; 5 | use esp_println::println; 6 | use hal::{clock::ClockControl, peripherals::Peripherals, prelude::*, timer::TimerGroup, Rtc}; 7 | #[entry] 8 | fn main() -> ! { 9 | let peripherals = Peripherals::take(); 10 | let mut system = peripherals.DPORT.split(); 11 | let clocks = ClockControl::boot_defaults(system.clock_control).freeze(); 12 | 13 | // Disable the RTC and TIMG watchdog timers 14 | let mut rtc = Rtc::new(peripherals.RTC_CNTL); 15 | let timer_group0 = TimerGroup::new( 16 | peripherals.TIMG0, 17 | &clocks, 18 | &mut system.peripheral_clock_control, 19 | ); 20 | let mut wdt0 = timer_group0.wdt; 21 | let timer_group1 = TimerGroup::new( 22 | peripherals.TIMG1, 23 | &clocks, 24 | &mut system.peripheral_clock_control, 25 | ); 26 | let mut wdt1 = timer_group1.wdt; 27 | rtc.rwdt.disable(); 28 | wdt0.disable(); 29 | wdt1.disable(); 30 | 31 | 32 | 33 | println!("Hello world!"); 34 | 35 | loop { 36 | // println!("Hello world!"); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/bsp/examples/blinky/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright [year] [fullname] 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /mindmap/spec viewer.md: -------------------------------------------------------------------------------- 1 | *this note is for the **spec viewer** portion of the project* 2 | 3 | Thoughts: 4 | 5 | * ~~Integrate 3D model view~~ I've chosen the transparent image approach, as it will be more robust; boards which don't have a 3d model can easily be added, and external contributors will be more easily able to add new boards. 6 | 7 | * Decide on backend for the board types.. should it be some kind of relational database, or just text files? 8 | * For now I'm doing a file hierarchy system. This seems easy and totally practical. 9 | 10 | * TODO -- how can I include "main" and "peripheral" boards? 11 | * My vision is that a person, when starting a project, can select the dev boards that they are working with, and then have some examples/resources to get started with that set. But this is challenging because each set might have multiple configurations and use-cases. 12 | * One simplifying assumption is that each "project" can only have one "main" board (i.e. the board that the firmware is running on). 13 | * Should the app detect if boards are "compatible" or should this be left to the user? 14 | * How to display projects with multiple boards? 15 | * Integrate related crates and examples in spec viewer. -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/bsp/examples/blinky/.github/workflows/rust_ci.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Integration 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - "**/README.md" 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | env: 11 | CARGO_TERM_COLOR: always 12 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 13 | 14 | jobs: 15 | rust-checks: 16 | name: Rust Checks 17 | runs-on: ubuntu-latest 18 | strategy: 19 | fail-fast: false 20 | matrix: 21 | action: 22 | - command: build 23 | args: --release 24 | - command: fmt 25 | args: --all -- --check --color always 26 | - command: clippy 27 | args: --all-targets --all-features --workspace -- -D warnings 28 | steps: 29 | - name: Checkout repository 30 | uses: actions/checkout@v3 31 | - name: Enable caching 32 | uses: Swatinem/rust-cache@v2 33 | - name: Setup Rust 34 | uses: esp-rs/xtensa-toolchain@v1.5 35 | with: 36 | default: true 37 | buildtargets: esp32 38 | ldproxy: false 39 | - name: Run command 40 | run: cargo ${{ matrix.action.command }} ${{ matrix.action.args }} 41 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_nRF52832/template/src/main.rs: -------------------------------------------------------------------------------- 1 | #![no_main] 2 | #![no_std] 3 | 4 | use hal::{gpio, prelude::*, pwm, pwm::Pwm, timer, timer::Timer}; 5 | use nb::block; 6 | use nrf52832_hal as hal; 7 | use rtt_target::{rprintln, rtt_init_print}; 8 | 9 | #[panic_handler] 10 | fn panic(_: &core::panic::PanicInfo) -> ! { 11 | loop { 12 | cortex_m::asm::bkpt(); 13 | } 14 | } 15 | 16 | #[cortex_m_rt::entry] 17 | fn main() -> ! { 18 | rtt_init_print!(); 19 | 20 | let p = hal::pac::Peripherals::take().unwrap(); 21 | 22 | let (pwm, mut timer) = init_device(p); 23 | 24 | pwm.set_period(500u32.hz()); 25 | 26 | rprintln!("PWM Blinky demo starting"); 27 | 28 | let wait_time = 1_000_000u32 / pwm.get_max_duty() as u32; 29 | loop { 30 | for duty in 0..pwm.get_max_duty() { 31 | pwm.set_duty_on_common(duty); 32 | delay(&mut timer, wait_time); 33 | } 34 | } 35 | } 36 | 37 | fn init_device(p: hal::pac::Peripherals) -> (Pwm, Timer) { 38 | let p0 = gpio::p0::Parts::new(p.P0); 39 | 40 | let pwm = Pwm::new(p.PWM0); 41 | pwm.set_output_pin( 42 | pwm::Channel::C0, 43 | p0.p0_19.into_push_pull_output(gpio::Level::High).degrade(), 44 | ); 45 | 46 | let timer = Timer::new(p.TIMER0); 47 | 48 | (pwm, timer) 49 | } 50 | 51 | fn delay(timer: &mut Timer, cycles: u32) 52 | where 53 | T: timer::Instance, 54 | { 55 | timer.start(cycles); 56 | let _ = block!(timer.wait()); 57 | } -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/FeatherWing_OLED_128x64/bsp/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Iron Coder BSP for Featherwing OLED 2 | 3 | #![no_std] 4 | 5 | use embedded_hal::blocking::i2c::Write; 6 | use sh1107::{self, prelude::*}; 7 | 8 | // use embedded_graphics::{ 9 | // mono_font::{ascii::FONT_6X10, MonoTextStyle}, 10 | // pixelcolor::Rgb565, 11 | // prelude::*, 12 | // text::Text, 13 | // }; 14 | 15 | pub struct Board 16 | where I2C: Write 17 | { 18 | pub display: Option>> 19 | } 20 | 21 | impl Board 22 | where I2C: Write, E: core::fmt::Debug 23 | { 24 | pub fn new() -> Self { 25 | Self { 26 | display: None, 27 | } 28 | } 29 | 30 | pub fn init_display(&mut self, i2c: I2C) { 31 | 32 | let disp_size = DisplaySize::Display64x128; 33 | let mut rotation = DisplayRotation::Rotate270; 34 | 35 | let mut d: GraphicsMode<_> = sh1107::Builder::new() 36 | .with_size(disp_size) 37 | .with_rotation(rotation) 38 | .connect_i2c(i2c) 39 | .into(); 40 | 41 | d.init().unwrap(); 42 | d.flush().unwrap(); 43 | 44 | // // Create a new character style 45 | // let style = MonoTextStyle::new(&FONT_6X10, Rgb565::WHITE); 46 | // // Create a text at position (20, 30) and draw it using the previously defined style 47 | // Text::new("Hello Rust!", Point::new(20, 30), style).draw(d).unwrap(); 48 | // d.flush().unwrap(); 49 | 50 | self.display = Some(d); 51 | } 52 | } -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/template/src/main.rs: -------------------------------------------------------------------------------- 1 | //! Blinks the LED on a Adafruit Feather RP2040 board 2 | //! 3 | //! This will blink on-board LED. 4 | #![no_std] 5 | #![no_main] 6 | 7 | use adafruit_feather_rp2040::entry; 8 | use adafruit_feather_rp2040::{ 9 | hal::{ 10 | clocks::{init_clocks_and_plls, Clock}, 11 | pac, 12 | watchdog::Watchdog, 13 | Sio, 14 | }, 15 | Pins, XOSC_CRYSTAL_FREQ, 16 | }; 17 | use embedded_hal::digital::v2::OutputPin; 18 | use panic_halt as _; 19 | 20 | #[entry] 21 | fn main() -> ! { 22 | let mut pac = pac::Peripherals::take().unwrap(); 23 | let core = pac::CorePeripherals::take().unwrap(); 24 | 25 | let mut watchdog = Watchdog::new(pac.WATCHDOG); 26 | 27 | let clocks = init_clocks_and_plls( 28 | XOSC_CRYSTAL_FREQ, 29 | pac.XOSC, 30 | pac.CLOCKS, 31 | pac.PLL_SYS, 32 | pac.PLL_USB, 33 | &mut pac.RESETS, 34 | &mut watchdog, 35 | ) 36 | .ok() 37 | .unwrap(); 38 | 39 | let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().to_Hz()); 40 | 41 | let sio = Sio::new(pac.SIO); 42 | let pins = Pins::new( 43 | pac.IO_BANK0, 44 | pac.PADS_BANK0, 45 | sio.gpio_bank0, 46 | &mut pac.RESETS, 47 | ); 48 | let mut led_pin = pins.d13.into_push_pull_output(); 49 | 50 | loop { 51 | led_pin.set_high().unwrap(); 52 | delay.delay_ms(1500); 53 | led_pin.set_low().unwrap(); 54 | delay.delay_ms(1500); 55 | } 56 | } -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_nRF52832/bsp/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Iron Coder BSP for nRF52832 microcontroller 2 | 3 | #![no_std] 4 | 5 | use embedded_hal::blocking::i2c::Write; 6 | use sh1107::{self, prelude::*}; 7 | 8 | // use embedded_graphics::{ 9 | // mono_font::{ascii::FONT_6X10, MonoTextStyle}, 10 | // pixelcolor::Rgb565, 11 | // prelude::*, 12 | // text::Text, 13 | // }; 14 | 15 | pub struct Board 16 | where I2C: Write 17 | { 18 | pub display: Option>> 19 | } 20 | 21 | impl Board 22 | where I2C: Write, E: core::fmt::Debug 23 | { 24 | pub fn new() -> Self { 25 | Self { 26 | display: None, 27 | } 28 | } 29 | 30 | pub fn init_display(&mut self, i2c: I2C) { 31 | 32 | let disp_size = DisplaySize::Display64x128; 33 | let mut rotation = DisplayRotation::Rotate270; 34 | 35 | let mut d: GraphicsMode<_> = sh1107::Builder::new() 36 | .with_size(disp_size) 37 | .with_rotation(rotation) 38 | .connect_i2c(i2c) 39 | .into(); 40 | 41 | d.init().unwrap(); 42 | d.flush().unwrap(); 43 | 44 | // // Create a new character style 45 | // let style = MonoTextStyle::new(&FONT_6X10, Rgb565::WHITE); 46 | // // Create a text at position (20, 30) and draw it using the previously defined style 47 | // Text::new("Hello Rust!", Point::new(20, 30), style).draw(d).unwrap(); 48 | // d.flush().unwrap(); 49 | 50 | self.display = Some(d); 51 | } 52 | } -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "iron_coder" 3 | authors = ["Carsten Thue-Bludworth "] 4 | version = "0.2.0" 5 | edition = "2021" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | egui = { version = "0.27.2", features = ["serde", "persistence", "deadlock_detection"] } 11 | eframe = { version = "0.27.2", default-features = false, features = [ 12 | "default_fonts", # Embed the default egui fonts. 13 | "glow", # Use the glow rendering backend. Alternative: "wgpu". 14 | "persistence", # Enable restoring app state when restarting the app. 15 | ] } 16 | tracing = "0.1.37" 17 | tracing-subscriber = "0.3" 18 | log = "0.4.19" 19 | # You only need serde if you want app persistence: 20 | serde = { version = "1", features = ["derive"] } 21 | egui_extras = { version = "0.27.2", features = ["image", "all_loaders"] } 22 | image = { version = "0.24.7", features = ["jpeg", "png", "gif"] } 23 | toml = "0.8.14" 24 | syntect = "5.0.0" 25 | rfd = "0.14.1" 26 | fs_extra = "1.3.0" 27 | duct = "0.13.6" 28 | enum-iterator = "2.1.0" 29 | ra_ap_rust-analyzer = "0.0.220" 30 | ra_ap_ide = "0.0.220" 31 | syn = { version = "2.0.25", features = ["full", "extra-traits", "parsing", "visit"] } 32 | quote = "1.0.29" 33 | proc-macro2 = "1.0.64" 34 | prettyplease = "0.2.10" 35 | slotmap = "1.0.6" 36 | clap = { version = "4.3.19", features = ["derive"] } 37 | usvg = "0.35.0" 38 | generate = "1.5.0" 39 | savefile-derive = "0.17.4" 40 | k_board = "1.2.2" 41 | git2 = "0.19.0" 42 | 43 | [profile.release] 44 | opt-level = 'z' 45 | lto = true 46 | codegen-units = 1 47 | panic = 'abort' 48 | strip = true 49 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/template/.cargo/config: -------------------------------------------------------------------------------- 1 | # 2 | # Cargo Configuration for the https://github.com/rp-rs/rp-hal.git repository. 3 | # 4 | # Copyright (c) The RP-RS Developers, 2021 5 | # 6 | # You might want to make a similar file in your own repository if you are 7 | # writing programs for Raspberry Silicon microcontrollers. 8 | # 9 | # This file is MIT or Apache-2.0 as per the repository README.md file 10 | # 11 | 12 | [build] 13 | # Set the default target to match the Cortex-M0+ in the RP2040 14 | target = "thumbv6m-none-eabi" 15 | 16 | # Target specific options 17 | [target.thumbv6m-none-eabi] 18 | # Pass some extra options to rustc, some of which get passed on to the linker. 19 | # 20 | # * linker argument --nmagic turns off page alignment of sections (which saves 21 | # flash space) 22 | # * linker argument -Tlink.x tells the linker to use link.x as the linker 23 | # script. This is usually provided by the cortex-m-rt crate, and by default 24 | # the version in that crate will include a file called `memory.x` which 25 | # describes the particular memory layout for your specific chip. 26 | # * inline-threshold=5 makes the compiler more aggressive and inlining functions 27 | # * no-vectorize-loops turns off the loop vectorizer (seeing as the M0+ doesn't 28 | # have SIMD) 29 | rustflags = [ 30 | "-C", "link-arg=--nmagic", 31 | "-C", "link-arg=-Tlink.x", 32 | "-C", "inline-threshold=5", 33 | "-C", "no-vectorize-loops", 34 | ] 35 | 36 | # This runner will make a UF2 file and then copy it to a mounted RP2040 in USB 37 | # Bootloader mode: 38 | runner = "elf2uf2-rs -d" 39 | 40 | # This runner will find a supported SWD debug probe and flash your RP2040 over 41 | # SWD: 42 | # runner = "probe-run --chip RP2040" 43 | -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-RP2040/template/.cargo/config: -------------------------------------------------------------------------------- 1 | # 2 | # Cargo Configuration for the https://github.com/rp-rs/rp-hal.git repository. 3 | # 4 | # Copyright (c) The RP-RS Developers, 2021 5 | # 6 | # You might want to make a similar file in your own repository if you are 7 | # writing programs for Raspberry Silicon microcontrollers. 8 | # 9 | # This file is MIT or Apache-2.0 as per the repository README.md file 10 | # 11 | 12 | [build] 13 | # Set the default target to match the Cortex-M0+ in the RP2040 14 | target = "thumbv6m-none-eabi" 15 | 16 | # Target specific options 17 | [target.thumbv6m-none-eabi] 18 | # Pass some extra options to rustc, some of which get passed on to the linker. 19 | # 20 | # * linker argument --nmagic turns off page alignment of sections (which saves 21 | # flash space) 22 | # * linker argument -Tlink.x tells the linker to use link.x as the linker 23 | # script. This is usually provided by the cortex-m-rt crate, and by default 24 | # the version in that crate will include a file called `memory.x` which 25 | # describes the particular memory layout for your specific chip. 26 | # * inline-threshold=5 makes the compiler more aggressive and inlining functions 27 | # * no-vectorize-loops turns off the loop vectorizer (seeing as the M0+ doesn't 28 | # have SIMD) 29 | rustflags = [ 30 | "-C", "link-arg=--nmagic", 31 | "-C", "link-arg=-Tlink.x", 32 | "-C", "inline-threshold=5", 33 | "-C", "no-vectorize-loops", 34 | ] 35 | 36 | # This runner will make a UF2 file and then copy it to a mounted RP2040 in USB 37 | # Bootloader mode: 38 | runner = "elf2uf2-rs -d" 39 | 40 | # This runner will find a supported SWD debug probe and flash your RP2040 over 41 | # SWD: 42 | # runner = "probe-run --chip RP2040" 43 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/examples/blinky/.cargo/config: -------------------------------------------------------------------------------- 1 | # 2 | # Cargo Configuration for the https://github.com/rp-rs/rp-hal.git repository. 3 | # 4 | # Copyright (c) The RP-RS Developers, 2021 5 | # 6 | # You might want to make a similar file in your own repository if you are 7 | # writing programs for Raspberry Silicon microcontrollers. 8 | # 9 | # This file is MIT or Apache-2.0 as per the repository README.md file 10 | # 11 | 12 | [build] 13 | # Set the default target to match the Cortex-M0+ in the RP2040 14 | target = "thumbv6m-none-eabi" 15 | 16 | # Target specific options 17 | [target.thumbv6m-none-eabi] 18 | # Pass some extra options to rustc, some of which get passed on to the linker. 19 | # 20 | # * linker argument --nmagic turns off page alignment of sections (which saves 21 | # flash space) 22 | # * linker argument -Tlink.x tells the linker to use link.x as the linker 23 | # script. This is usually provided by the cortex-m-rt crate, and by default 24 | # the version in that crate will include a file called `memory.x` which 25 | # describes the particular memory layout for your specific chip. 26 | # * inline-threshold=5 makes the compiler more aggressive and inlining functions 27 | # * no-vectorize-loops turns off the loop vectorizer (seeing as the M0+ doesn't 28 | # have SIMD) 29 | rustflags = [ 30 | "-C", "link-arg=--nmagic", 31 | "-C", "link-arg=-Tlink.x", 32 | "-C", "inline-threshold=5", 33 | "-C", "no-vectorize-loops", 34 | ] 35 | 36 | # This runner will make a UF2 file and then copy it to a mounted RP2040 in USB 37 | # Bootloader mode: 38 | runner = "elf2uf2-rs -d" 39 | 40 | # This runner will find a supported SWD debug probe and flash your RP2040 over 41 | # SWD: 42 | # runner = "probe-run --chip RP2040" 43 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_nRF52832/template/.cargo/config: -------------------------------------------------------------------------------- 1 | # 2 | # Cargo Configuration for the https://github.com/rp-rs/rp-hal.git repository. 3 | # 4 | # Copyright (c) The RP-RS Developers, 2021 5 | # 6 | # You might want to make a similar file in your own repository if you are 7 | # writing programs for Raspberry Silicon microcontrollers. 8 | # 9 | # This file is MIT or Apache-2.0 as per the repository README.md file 10 | # 11 | 12 | [build] 13 | # Set the default target to match the Cortex-M0+ in the RP2040 14 | target = "thumbv7em-none-eabi" 15 | 16 | # Target specific options 17 | [target.thumbv7em-none-eabi] 18 | # Pass some extra options to rustc, some of which get passed on to the linker. 19 | # 20 | # * linker argument --nmagic turns off page alignment of sections (which saves 21 | # flash space) 22 | # * linker argument -Tlink.x tells the linker to use link.x as the linker 23 | # script. This is usually provided by the cortex-m-rt crate, and by default 24 | # the version in that crate will include a file called `memory.x` which 25 | # describes the particular memory layout for your specific chip. 26 | # * inline-threshold=5 makes the compiler more aggressive and inlining functions 27 | # * no-vectorize-loops turns off the loop vectorizer (seeing as the M0+ doesn't 28 | # have SIMD) 29 | rustflags = [ 30 | "-C", "link-arg=--nmagic", 31 | "-C", "link-arg=-Tlink.x", 32 | "-C", "inline-threshold=5", 33 | "-C", "no-vectorize-loops", 34 | ] 35 | 36 | # This runner will make a UF2 file and then copy it to a mounted RP2040 in USB 37 | # Bootloader mode: 38 | #runner = "elf2uf2-rs -d" 39 | 40 | # This runner will find a supported SWD debug probe and flash your RP2040 over 41 | # SWD: 42 | runner = "probe-run --chip nRF52832_xxAB" 43 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/PiTTF_32_cap_touch/bsp/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Iron Coder BSP for PiTFT display 2 | 3 | #![no_std] 4 | 5 | use ili9341; 6 | use embedded_hal::{ 7 | digital::v2::OutputPin, 8 | blocking::spi::Write, 9 | blocking::delay::DelayMs, 10 | blocking::i2c::WriteRead, 11 | }; 12 | use embedded_hal_one::i2c::I2c; 13 | use display_interface_spi::SPIInterface; 14 | 15 | pub struct Display 16 | where SPI: Write, 17 | CS: OutputPin, 18 | DC: OutputPin, 19 | RST: OutputPin, 20 | I2C: I2c, 21 | { 22 | pub display: Option, RST>>, 23 | pub touchscreen: Option>, 24 | } 25 | 26 | impl Display 27 | where SPI: Write, 28 | CS: OutputPin, 29 | DC: OutputPin, 30 | RST: OutputPin, 31 | I2C: I2c, 32 | { 33 | 34 | pub fn new() -> Self { 35 | Self { 36 | display: None, 37 | touchscreen: None, 38 | } 39 | } 40 | 41 | pub fn init_display(&mut self, spi: SPI, dc: DC, cs: CS, rst: RST, delay: &mut DELAYMS) 42 | where DELAYMS: DelayMs 43 | { 44 | let iface = SPIInterface::new(spi, dc, cs); 45 | let size = ili9341::DisplaySize240x320; 46 | let orient = ili9341::Orientation::LandscapeFlipped; 47 | let ili = ili9341::Ili9341::new( 48 | iface, 49 | rst, 50 | delay, 51 | orient, 52 | size).unwrap(); 53 | self.display = Some(ili); 54 | } 55 | 56 | pub fn init_touchscreen(&mut self, i2c: I2C) 57 | { 58 | let ts = ft6236::FT6236::new(i2c); 59 | self.touchscreen = Some(ts); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/examples/blinky/src/main.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![no_main] 3 | 4 | /**** low-level imports *****/ 5 | use panic_halt as _; 6 | //use cortex_m::prelude::*; 7 | use cortex_m_rt::entry; 8 | use embedded_hal::{ 9 | digital::v2::{OutputPin}, 10 | }; 11 | use embedded_time::rate::*; 12 | 13 | /***** board-specific imports *****/ 14 | use adafruit_feather_rp2040::{ 15 | hal::{ 16 | clocks::{init_clocks_and_plls, Clock}, 17 | pac, 18 | watchdog::Watchdog, 19 | Sio, 20 | }, 21 | Pins, XOSC_CRYSTAL_FREQ, 22 | }; 23 | 24 | #[entry] 25 | fn main() -> ! { 26 | // Grab the singleton objects 27 | let mut pac = pac::Peripherals::take().unwrap(); 28 | let core = pac::CorePeripherals::take().unwrap(); 29 | // Init the watchdog timer, to pass into the clock init 30 | let mut watchdog = Watchdog::new(pac.WATCHDOG); 31 | let clocks = init_clocks_and_plls( 32 | XOSC_CRYSTAL_FREQ, 33 | pac.XOSC, 34 | pac.CLOCKS, 35 | pac.PLL_SYS, 36 | pac.PLL_USB, 37 | &mut pac.RESETS, 38 | &mut watchdog, 39 | ).ok().unwrap(); 40 | 41 | // initialize the Single Cycle IO 42 | let sio = Sio::new(pac.SIO); 43 | // initialize the pins to default state 44 | let pins = Pins::new( 45 | pac.IO_BANK0, 46 | pac.PADS_BANK0, 47 | sio.gpio_bank0, 48 | &mut pac.RESETS, 49 | ); 50 | 51 | let mut timer = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().integer()); 52 | let mut led_pin = pins.d13.into_push_pull_output(); 53 | 54 | /* Loop Section */ 55 | let delay: u32 = 70; // loop delay in ms 56 | loop { 57 | led_pin.set_low().unwrap(); 58 | timer.delay_ms((delay + 1200) as u32); 59 | led_pin.set_high().unwrap(); 60 | timer.delay_ms(delay as u32); 61 | } 62 | 63 | } -------------------------------------------------------------------------------- /src/app/icons.rs: -------------------------------------------------------------------------------- 1 | //! Title: Iron Coder App Module - Icons 2 | //! Description: This module defines the IconSet type, which is a mapping of static str 3 | //! to RetainedImages. It also defines functionality to load icons from the filesystem, 4 | 5 | use log::error; 6 | 7 | use std::path::Path; 8 | use std::collections::HashMap; 9 | 10 | use image; 11 | use egui::{Vec2, Image}; 12 | 13 | pub type IconSet<'a> = HashMap<&'static str, Image<'a>>; 14 | pub const ICON_DIR: &'static str = "file://assets/icons/pack/white/"; 15 | pub const SMALL_ICON_SIZE: Vec2 = Vec2::new(8.0, 8.0); 16 | pub const DEFAULT_ICON_SIZE: Vec2 = Vec2::new(12.0, 12.0); 17 | 18 | // This function returns a mapping of icon names to RetainedImages 19 | pub fn load_icons(icon_path: &Path) -> HashMap<&'static str, Image> { 20 | 21 | let mut icon_map = HashMap::new(); 22 | 23 | let icon_names_and_files: [(&str, &str); 16] = [ 24 | ("settings_icon", "gear.png"), 25 | ("boards_icon", "chip.png"), 26 | ("about_icon", "005b_13.gif"), 27 | ("trash_icon", "005b_15.gif"), 28 | ("folder_icon", "005b_43.gif"), 29 | ("save_icon", "005b_23.gif"), 30 | ("build_icon", "005b_35.gif"), 31 | ("load_icon", "005b_56.gif"), 32 | ("menu_icon", "005b_44.gif"), 33 | ("quit_icon", "005b_75.gif"), 34 | ("folder_closed_icon", "005b_49.gif"), 35 | ("folder_open_icon", "005b_50.gif"), 36 | ("file_icon", "005b_65.gif"), 37 | ("edit_icon", "005b_19.gif"), 38 | ("plus_icon", "005b_39.gif"), 39 | ("right_arrow_icon", "005b_53.gif"), 40 | ]; 41 | for (icon_name, icon_file) in icon_names_and_files.into_iter() { 42 | let p = icon_path.join(icon_file).as_path().to_str().unwrap().to_string(); 43 | // attempt to open the icon image file 44 | let image = Image::new(p).fit_to_exact_size(DEFAULT_ICON_SIZE); 45 | icon_map.insert(icon_name, image); 46 | } 47 | return icon_map; 48 | } -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/bsp/src/usb_manager.rs: -------------------------------------------------------------------------------- 1 | use adafruit_feather_rp2040::hal as hal; 2 | use usb_device; 3 | use usb_device::{ 4 | bus::UsbBusAllocator, 5 | device::{UsbDevice, UsbDeviceBuilder, UsbVidPid}, 6 | }; 7 | use usbd_serial::SerialPort; 8 | 9 | pub struct UsbManager { 10 | device: UsbDevice<'static, hal::usb::UsbBus>, 11 | serial: SerialPort<'static, hal::usb::UsbBus>, 12 | } 13 | 14 | impl UsbManager { 15 | pub fn new(usb_bus: &'static UsbBusAllocator) -> Self { 16 | 17 | let serial = usbd_serial::SerialPort::new(usb_bus); 18 | 19 | let device = UsbDeviceBuilder::new(usb_bus, UsbVidPid(0x2E8A, 0x000a)) 20 | .manufacturer("Raspberry Pi") 21 | .product("Pico") 22 | .serial_number("TEST") 23 | .device_class(2) 24 | .max_packet_size_0(64) // yay! works on windows :) 25 | .build(); 26 | 27 | UsbManager { device, serial } 28 | } 29 | 30 | pub unsafe fn interrupt(&mut self) { 31 | rtt_target::rprintln!("in interrupt"); 32 | if self.device.poll(&mut [&mut self.serial]) { 33 | let mut buf = [0u8; 64]; 34 | match self.serial.read(&mut buf) { 35 | Err(_e) => { 36 | // Do nothing 37 | } 38 | Ok(_count) => { 39 | // Do nothing 40 | } 41 | } 42 | } 43 | } 44 | } 45 | 46 | impl core::fmt::Write for UsbManager { 47 | fn write_str(&mut self, s: &str) -> core::fmt::Result { 48 | critical_section::with(|_| { 49 | // Now interrupts are disabled 50 | match self.serial.write(s.as_bytes()) { 51 | Err(_e) => { 52 | // Do nothing 53 | } 54 | Ok(_) => { 55 | // Do nothing 56 | } 57 | } 58 | }); 59 | Ok(()) 60 | } 61 | } -------------------------------------------------------------------------------- /todo.txt: -------------------------------------------------------------------------------- 1 | todo 2 | 3 | * Improve consistency of error handling in src/project/mod.rs file saving/loading. 4 | * don't force a project to have a repository. 5 | * don't crash or hang if trying to reload a project that doesn't exist (work around by running with -p flag or deleting C:\Users\\AppData\Roaming\Iron Coder\). 6 | * do some check about if the user has rust toolchain installed, along with proper targets for the current main board, and required cargo sub-commands. 7 | * Why has GIF image support broken after upgrading image crate? 8 | * Create a consistent list of `egui::Id`s that are used to track UI state; also figure out "double use of Id" in board editor. 9 | 10 | testing: 11 | * Include SVG parsing test for all supported boards 12 | 13 | GUI: 14 | * Overhaul of rendering, including: 15 | * More clear separation of logic from rendering. 16 | * More granular rendering methods to manage complexity. 17 | * Make boards editor more grid-like, enhance ability to zoom and scroll using mouse wheel. 18 | * Make keybindings more intuitive and evident to user. 19 | 20 | Release message: 21 | 22 | This is a pre-alpha release of the Iron Coder embedded Rust IDE. The core feature set isn't complete yet, but the application is usable for simple examples. This also is the first version for which I successfully used the executable on a computer that it wasn't built on (i.e. no rust toolchain installed). Current features include: 23 | 24 | **Graphical Editor** 25 | * A minimal set of boards available in the "add board" menu. 26 | * Ability to make simple connections between two pins in the graphical editor, and change the connection name via a context menu. 27 | * Loading and saving of projects. 28 | 29 | **Text Editor** 30 | * File explorer to browse project directory and select files for editing. 31 | * Multi-tab code editor with syntax highlighting and save-state indication. 32 | * Buttons to build code, load code, push to git, etc.. 33 | 34 | **General** 35 | * Minimal set of keyboard shortcuts (needs documentation). 36 | * Incomplete and in-progress metaprogramming features, hinted at by "Gen Sys Mod" button -------------------------------------------------------------------------------- /src/board/test.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | 3 | fn cli_cmd(str: &str) { 4 | let output = if cfg!(target_os = "windows") { 5 | Command::new("powershell") 6 | .args(["/C", &str]) 7 | .output() 8 | .expect("failed to execute process") 9 | } else { 10 | return; 11 | }; 12 | let str = String::from_utf8(output.stdout).expect("Returned output"); 13 | print!("{}", str); 14 | } 15 | 16 | #[cfg(test)] 17 | mod board_tests { 18 | use std::collections::HashSet; 19 | use std::path::Path; 20 | use eframe::glow::FALSE; 21 | use egui::TextBuffer; 22 | use crate::board; 23 | use crate::board::get_boards; 24 | use crate::board::test::cli_cmd; 25 | 26 | #[test] 27 | pub fn test_get_boards() { 28 | let mut board_names: HashSet<&str> = HashSet::from(["Feather nRF52832", "Feather RP2040", "OLED Featherwing (128x64)", "PropMaker Featherwing", "PiTFT 3.2 with Capacitive Touch Screen", "MicroMod ESP32 Processor"]); 29 | let boards = board::get_boards(Path::new("./iron-coder-boards")); 30 | for board in boards { 31 | assert!(board_names.contains(board.get_name())); 32 | board_names.remove(board.get_name()); 33 | } 34 | assert!(board_names.is_empty()); 35 | } 36 | #[test] 37 | pub fn test_board_info() { 38 | // Ensure boards have crates associated with them. 39 | let mut boards = board::get_boards(Path::new("./iron-coder-boards")); 40 | for board in boards { 41 | assert!(board.related_crates().unwrap().is_empty() == FALSE); 42 | } 43 | } 44 | #[test] 45 | pub fn test_board_crates() { 46 | // Ensure crates don't have any errors. 47 | let mut boards = board::get_boards(Path::new("./iron-coder-boards")); 48 | let mut cmd = "cargo check --features".to_owned(); 49 | for board in boards { 50 | for crates in board.related_crates().unwrap() { 51 | cmd.push_str(crates.as_str()); 52 | cli_cmd(cmd.as_mut_str()); 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/project/egui_helpers.rs: -------------------------------------------------------------------------------- 1 | //! Title: Iron Coder Project Module - Egui Helpers 2 | //! Description: This module contains helper functions for drawing egui elements in the project module. 3 | 4 | use std::sync::Arc; 5 | 6 | use crate::project::Project; 7 | use crate::app::icons::{ 8 | IconSet, 9 | }; 10 | 11 | use egui::{ 12 | Align, 13 | Layout, 14 | Response, 15 | Ui, 16 | Context, 17 | RichText, 18 | }; 19 | 20 | use egui::widgets::{ 21 | Label, 22 | ImageButton, 23 | }; 24 | 25 | impl Project { 26 | // this function will draw the project name on the left of the Ui, and an "edit" icon on the right. 27 | pub fn label_with_action(&mut self, ctx: &Context, ui: &mut Ui) -> Response { 28 | // Grab the icons for a moment from the shared data 29 | let icons_ref: Arc = ctx.data_mut(|data| { 30 | data.get_temp("icons".into()).expect("couldn't load icons!") 31 | }); 32 | let icons = icons_ref.clone(); 33 | ui.with_layout(Layout::top_down(Align::Center), |ui| { 34 | let color = ui.style().visuals.window_stroke.color; 35 | let mut height: f32 = 0.0; 36 | // prepare the project name label 37 | let text = RichText::new(self.borrow_name().clone()).underline().italics(); 38 | let project_label = Label::new(text); 39 | // create a column for the text and a column for the buttons 40 | ui.columns(2, |columns| { 41 | let resp = columns[0].add(project_label).on_hover_text(self.get_location()); 42 | // capture the height of drawn text 43 | height = (resp.rect.max - resp.rect.min).y; 44 | let button = ImageButton::new( 45 | icons.get("edit_icon").unwrap().clone(), 46 | ).frame(false).tint(color); 47 | columns[1].with_layout(Layout::top_down(Align::RIGHT), |ui| { 48 | // slightly confusing, but we leave the semi-colons off here so that 49 | // the inner response contains the response from this Ui addition 50 | ui.add(button).on_hover_text("edit project") 51 | }) 52 | }).inner //\\__ return the response from the button 53 | }).inner // 54 | } 55 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Iron Coder 2 | A system-level, hardware-aware embedded Rust IDE. 3 | 4 | #### By Carsten Thue-Bludworth, 2023 5 | 6 | ![Screenshot](screenshots/iron-coder.png) 7 | 8 | ## Concept 9 | Iron Coder is an Integrated Development Environment aimed at lowering the barrier to entry for embedded development in Rust. Inspired by modern modular hardware ecosystems, such as Adafruit's Feather specification, Sparkfun's MicroMod and QUIIC systems, and Arduino's Shield system, Iron Coder generates project templates and boilerplate code from a description of the system's hardware architecture. This gives entry-level developers a fun and easy-to-use interface to begin learning Rust, while allowing for rapid prototyping of embedded hardware/firmware systems. 10 | 11 | This project has a few inspirations and goals: 12 | * Engage newcomers to Rust and/or embedded development, and build a community similar to Arduino. 13 | * Allow for community-driven additions to supported development boards. 14 | 15 | ## Project Architecture 16 | #### `Board`s and `Project`s 17 | A `Board`, representing a development board, is the fundamental datastructure of Iron Coder, and can be loaded into memory from the filesystem. A list of "known boards" is loaded from a specified path when Iron Coder is launched, and each Board description must contain the following items: 18 | * A `.toml` file, which contains information about the board. 19 | * A `.png` image, which will be used to display the board in the GUI. 20 | * A `bsp` folder, which is a Rust library crate that exposes the Board's functionality to Iron Coder (TODO - document these requirements). 21 | 22 | Rust's strong support for metaprogramming makes it a perfect language for the task of generating code. 23 | The following tools are used: 24 | * `egui` for the GUI toolkit 25 | * `syntect` for syntax highlighting 26 | * `image` for loading images from various file types 27 | * `serde` for loading and saving persistant state 28 | * `toml` for loading and saving board definition files 29 | 30 | This repository contains the code and documentation for Iron Coder. 31 | * The [docs](./docs/) folder contains conventional documentation. 32 | * The [mindmap](./mindmap/) folder contains Obsidian/Excalidraw brainstorming and notes. 33 | * The [src](./src/) folder contains the Rust code for the application. 34 | * The [assets](./assets/) folder contains fonts, icons, and other app-related assets. 35 | * The [boards](./boards/) folder contains board definition files, images, and example projects, and is sorted by board manufacturer, then board type. 36 | 37 | ## Future Goals 38 | * Support WASM for an online IDE, integrate Iron Coder web account for forumns and sharing ideas/code, maybe making an IoT online thing? -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/README.txt: -------------------------------------------------------------------------------- 1 | Roboto Mono Variable Font 2 | ========================= 3 | 4 | This download contains Roboto Mono as both variable fonts and static fonts. 5 | 6 | Roboto Mono is a variable font with this axis: 7 | wght 8 | 9 | This means all the styles are contained in these files: 10 | RobotoMono-VariableFont_wght.ttf 11 | RobotoMono-Italic-VariableFont_wght.ttf 12 | 13 | If your app fully supports variable fonts, you can now pick intermediate styles 14 | that aren’t available as static fonts. Not all apps support variable fonts, and 15 | in those cases you can use the static font files for Roboto Mono: 16 | static/RobotoMono-Thin.ttf 17 | static/RobotoMono-ExtraLight.ttf 18 | static/RobotoMono-Light.ttf 19 | static/RobotoMono-Regular.ttf 20 | static/RobotoMono-Medium.ttf 21 | static/RobotoMono-SemiBold.ttf 22 | static/RobotoMono-Bold.ttf 23 | static/RobotoMono-ThinItalic.ttf 24 | static/RobotoMono-ExtraLightItalic.ttf 25 | static/RobotoMono-LightItalic.ttf 26 | static/RobotoMono-Italic.ttf 27 | static/RobotoMono-MediumItalic.ttf 28 | static/RobotoMono-SemiBoldItalic.ttf 29 | static/RobotoMono-BoldItalic.ttf 30 | 31 | Get started 32 | ----------- 33 | 34 | 1. Install the font files you want to use 35 | 36 | 2. Use your app's font picker to view the font family and all the 37 | available styles 38 | 39 | Learn more about variable fonts 40 | ------------------------------- 41 | 42 | https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts 43 | https://variablefonts.typenetwork.com 44 | https://medium.com/variable-fonts 45 | 46 | In desktop apps 47 | 48 | https://theblog.adobe.com/can-variable-fonts-illustrator-cc 49 | https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts 50 | 51 | Online 52 | 53 | https://developers.google.com/fonts/docs/getting_started 54 | https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide 55 | https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts 56 | 57 | Installing fonts 58 | 59 | MacOS: https://support.apple.com/en-us/HT201749 60 | Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux 61 | Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows 62 | 63 | Android Apps 64 | 65 | https://developers.google.com/fonts/docs/android 66 | https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts 67 | 68 | License 69 | ------- 70 | Please read the full license text (LICENSE.txt) to understand the permissions, 71 | restrictions and requirements for usage, redistribution, and modification. 72 | 73 | You can use them in your products & projects – print or digital, 74 | commercial or otherwise. 75 | 76 | This isn't legal advice, please consider consulting a lawyer and see the full 77 | license for all details. 78 | -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-RP2040/template/src/main.rs: -------------------------------------------------------------------------------- 1 | //! # SparkFun MicroMod Blinky Example 2 | //! 3 | //! Blinks the LED on a SparkFun MicroMod RP2040 board. 4 | //! 5 | //! This will blink an LED attached to GP25, which is the pin the SparkFun MicroMod RP2040 uses for 6 | //! the on-board LED. 7 | //! 8 | //! See the `Cargo.toml` file for Copyright and license details. 9 | 10 | #![no_std] 11 | #![no_main] 12 | 13 | // The macro for our start-up function 14 | use sparkfun_micromod_rp2040::entry; 15 | 16 | // GPIO traits 17 | use embedded_hal::digital::OutputPin; 18 | 19 | // Ensure we halt the program on panic (if we don't mention this crate it won't 20 | // be linked) 21 | use panic_halt as _; 22 | 23 | // Pull in any important traits 24 | use sparkfun_micromod_rp2040::hal::prelude::*; 25 | 26 | // A shorter alias for the Peripheral Access Crate, which provides low-level 27 | // register access 28 | use sparkfun_micromod_rp2040::hal::pac; 29 | 30 | // A shorter alias for the Hardware Abstraction Layer, which provides 31 | // higher-level drivers. 32 | use sparkfun_micromod_rp2040::hal; 33 | 34 | /// Entry point to our bare-metal application. 35 | /// 36 | /// The `#[entry]` macro ensures the Cortex-M start-up code calls this function 37 | /// as soon as all global variables are initialised. 38 | /// 39 | /// The function configures the RP2040 peripherals, then blinks the LED in an 40 | /// infinite loop. 41 | #[entry] 42 | fn main() -> ! { 43 | // Grab our singleton objects 44 | let mut pac = pac::Peripherals::take().unwrap(); 45 | let core = pac::CorePeripherals::take().unwrap(); 46 | 47 | // Set up the watchdog driver - needed by the clock setup code 48 | let mut watchdog = hal::Watchdog::new(pac.WATCHDOG); 49 | 50 | // Configure the clocks 51 | // 52 | // The default is to generate a 125 MHz system clock 53 | let clocks = hal::clocks::init_clocks_and_plls( 54 | sparkfun_micromod_rp2040::XOSC_CRYSTAL_FREQ, 55 | pac.XOSC, 56 | pac.CLOCKS, 57 | pac.PLL_SYS, 58 | pac.PLL_USB, 59 | &mut pac.RESETS, 60 | &mut watchdog, 61 | ) 62 | .ok() 63 | .unwrap(); 64 | 65 | // The delay object lets us wait for specified amounts of time (in 66 | // milliseconds) 67 | let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().to_Hz()); 68 | 69 | // The single-cycle I/O block controls our GPIO pins 70 | let sio = hal::Sio::new(pac.SIO); 71 | 72 | // Set the pins up according to their function on this particular board 73 | let pins = sparkfun_micromod_rp2040::Pins::new( 74 | pac.IO_BANK0, 75 | pac.PADS_BANK0, 76 | sio.gpio_bank0, 77 | &mut pac.RESETS, 78 | ); 79 | 80 | // Set the LED to be an output 81 | let mut led_pin = pins.led.into_push_pull_output(); 82 | 83 | // Blink the LED at 1 Hz 84 | loop { 85 | led_pin.set_high().unwrap(); 86 | delay.delay_ms(500); 87 | led_pin.set_low().unwrap(); 88 | delay.delay_ms(500); 89 | } 90 | } 91 | 92 | // End of file -------------------------------------------------------------------------------- /mindmap/code editor.md: -------------------------------------------------------------------------------- 1 | *this note is for thinking about the **code editor** portion of the project* 2 | 3 | ### Prior Art 4 | [Lapce](https://github.com/lapce/lapce) seems really cool. 5 | * I wonder though: does it expose a crate that I could integrate into my [[egui integrations]]? 6 | * Could I make the [[spec viewer]] be a separate crate that could also be compiled to WASI format as a Lapce plugin? 7 | 8 | **TODO** 9 | * __App__ 10 | * Properly support colorschemes 11 | * Improve terminal integration 12 | * Provide tests to ensure that cargo, rustc, etc are properly installed on the host system 13 | * Provide a simple "status" message with single-line status updates based on latest actions 14 | * Integrate a proper debug logging system, in idiomatic Rust style 15 | * Integrate tests and benchmarks in idiomatic Rust style 16 | * Long-term goal is to have a "systems level" IDE, that might include multiple sub-projects. i.e. maybe one has a LoRa system that involves a gateway and multiple nodes, which would have two Programmable Boards. It would be awesome to have a way to help make the sub Projects consistent, such as shared protocol definitions, etc, and a way to test/benchmark the system as a whole 17 | * __Project__ 18 | * Read from/write to disk for save/open of projects 19 | * TODO -- check that we don't overwrite an existing project! 20 | * Allow for creation of new projects and editing of existing ones 21 | * Fix issue where CodeEditor state is lost after project edit 22 | * Force a project to make sense, i.e. should there be exactly one "Programmable Board"? Should I ensure that peripheral boards are compatible, or at least provide a warning if they might not be (i.e. using an I2S mic with a processor that doesn't have I2S)? A long-term goal is to be able to define the connections between boards (like I2C, SPI, etc), and like it to their pinouts. 23 | * Another long-term goal is to have "code blocks" that help link Programmable Boards to Peripheral Boards 24 | * Provide build stats like executable size, etc 25 | * Consider ways to measure and monitor performance. I'd like to write some benchmarking code similar to CoreMark, but in Rust. It would also be cool to benchmark other interesting HW-specific things, such as IO, floating-point stuff, bandwidth tests of WiFi/BLE/LoRa type boards. 26 | * __Board__ 27 | * Make Boards widget collapsible 28 | * Link docs.rs, datasheet, other resources to Board 29 | * Link examples to Board 30 | * ?? How to differentiate an "example" for a processor, vs an "example" project? Maybe for each Programmable Board there are core examples, and then there are also Project examples that use that board (possibly with other peripheral Boards). It might make sense either way for these to be packaged as Projects, likely read-only, similar to Arduino examples. 31 | * __CodeEditor__ 32 | * Line numbers (togglable in settings) 33 | * Fix issues with opening the same file twice, and reloading of file if edited elsewhere (or by Iron Coder itself, e.g. when editing the Project). 34 | * Syntax Highlighting 35 | * Benchmarking / optimizations 36 | * supporting all colorschemes of the overall app -------------------------------------------------------------------------------- /src/board/pinout.rs: -------------------------------------------------------------------------------- 1 | /// This module defines interfaces that a development board has 2 | use enum_iterator::Sequence; 3 | 4 | use syn; 5 | 6 | use serde::{Serialize, Deserialize}; 7 | use std::fmt; 8 | 9 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, Sequence)] 10 | #[non_exhaustive] 11 | pub enum InterfaceDirection { 12 | Unknown, 13 | Input, 14 | Output, 15 | Bidirectional, 16 | } 17 | 18 | impl fmt::Display for InterfaceDirection { 19 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 20 | write!(f, "{:?}", self) 21 | } 22 | } 23 | 24 | #[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Eq, Sequence)] 25 | #[non_exhaustive] 26 | /// The various types of electrical interfaces we use with dev boards 27 | pub enum InterfaceType { 28 | NONE, 29 | GPIO, 30 | ADC, 31 | PWM, 32 | UART, 33 | I2C, 34 | SPI, 35 | } 36 | 37 | impl fmt::Display for InterfaceType { 38 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 39 | write!(f, "{:?}", self) 40 | } 41 | } 42 | 43 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, Sequence)] 44 | pub struct Interface { 45 | pub iface_type: InterfaceType, 46 | pub direction: InterfaceDirection, 47 | } 48 | 49 | impl fmt::Display for Interface { 50 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 51 | write!(f, "{:?}", self) 52 | } 53 | } 54 | 55 | impl Default for Interface { 56 | fn default() -> Self { 57 | Self { 58 | iface_type: InterfaceType::NONE, 59 | direction: InterfaceDirection::Unknown, 60 | } 61 | } 62 | } 63 | 64 | /// And InterfaceMapping is a map of an Interface to a set of pins on the Board. 65 | /// TODO: I think a "pin" should be able to be referenced by multiple different criteria, 66 | /// such as the "silkscreen labal", the physical pin number (i.e. counting around the board), 67 | /// the logical pin number, or possibly some other criteria. 68 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] 69 | #[serde(default)] 70 | pub struct InterfaceMapping { 71 | pub interface: Interface, 72 | pub pins: Vec, 73 | #[serde(skip)] 74 | pub bsp_field: Option, 75 | } 76 | 77 | impl Default for InterfaceMapping { 78 | fn default() -> Self { 79 | Self { 80 | interface: Interface::default(), 81 | pins: Vec::new(), 82 | bsp_field: None, 83 | } 84 | } 85 | } 86 | 87 | /// A Pinout is a description of the available interfaces on a Board 88 | // #[derive(Serialize, Deserialize, Clone, Debug)] 89 | // pub struct Pinout { 90 | // pinout: Vec, 91 | // } 92 | 93 | pub type Pinout = Vec; 94 | 95 | // impl Default for Pinout { 96 | // fn default() -> Self { 97 | // Self { 98 | // pinout: Vec::new(), 99 | // } 100 | // } 101 | // } 102 | 103 | // impl Iterator for Pinout { 104 | // type Item = InterfaceMapping; 105 | // fn next(&self) -> Option { 106 | // self.pinout.next(); 107 | // } 108 | // } -------------------------------------------------------------------------------- /src/app/colorscheme.rs: -------------------------------------------------------------------------------- 1 | //! Title: Iron Coder App Module - ColorScheme 2 | //! Description: This module defines the ColorScheme struct and some built-in color schemes for the app. 3 | 4 | use egui::Color32; 5 | use serde::{Serialize, Deserialize}; 6 | 7 | use std::borrow::Cow; 8 | 9 | #[derive(PartialEq, Clone, Serialize, Deserialize)] 10 | pub struct ColorScheme { 11 | // pub name: &'static str, 12 | pub name: Cow<'static, str>, 13 | is_dark: bool, 14 | colors: [Color32; 4], 15 | } 16 | 17 | impl Default for ColorScheme { 18 | fn default() -> Self { 19 | SOLARIZED_DARK 20 | } 21 | } 22 | 23 | pub fn set_colorscheme(ctx: &egui::Context, cs: ColorScheme) { 24 | // get current style 25 | let mut style = (*ctx.style()).clone(); 26 | 27 | style.visuals.dark_mode = cs.is_dark; 28 | 29 | // TODO style.dark_mode = false; 30 | // TODO style.widgets.... all widget styling 31 | 32 | // Background colors 33 | style.visuals.extreme_bg_color = cs.colors[0]; 34 | style.visuals.faint_bg_color = cs.colors[1]; 35 | style.visuals.code_bg_color = cs.colors[1]; 36 | style.visuals.panel_fill = cs.colors[1]; 37 | style.visuals.window_fill = cs.colors[1]; 38 | 39 | // Foreground colors 40 | // TODO style.selection = ; 41 | style.visuals.hyperlink_color = cs.colors[3]; 42 | style.visuals.window_stroke.color = cs.colors[2]; 43 | style.visuals.warn_fg_color = cs.colors[3]; 44 | style.visuals.error_fg_color = cs.colors[3]; 45 | 46 | ctx.set_style(style); 47 | } 48 | 49 | // TODO -- make these serializable in a toml file for addition of new ones 50 | // without re-complilation (but maybe there also are some built-in ones) 51 | pub const SOLARIZED_DARK: ColorScheme = ColorScheme { 52 | name: Cow::Borrowed("Solarized Dark"), 53 | is_dark: true, 54 | colors: [ 55 | Color32::from_rgb( 0, 43, 54), // Base 03 (background) 56 | Color32::from_rgb( 7, 54, 66), // Base 02 (background highlights) 57 | Color32::from_rgb( 88, 110, 117), // Base 01 (secondary text) 58 | Color32::from_rgb(131, 148, 150), // Base 0 (body text) 59 | ], 60 | }; 61 | 62 | pub const SOLARIZED_LIGHT: ColorScheme = ColorScheme { 63 | name: Cow::Borrowed("Solarized Light"), 64 | is_dark: false, 65 | colors: [ 66 | Color32::from_rgb(253, 246, 227), // Base 3 (background) 67 | Color32::from_rgb(238, 232, 213), // Base 2 (background highlights) 68 | Color32::from_rgb(147, 161, 161), // Base 1 (secondary text) 69 | Color32::from_rgb(101, 123, 131), // Base 00 (body text) 70 | ], 71 | }; 72 | 73 | pub const INDUSTRIAL_DARK: ColorScheme = ColorScheme { 74 | name: Cow::Borrowed("Industrial Dark"), 75 | is_dark: true, 76 | colors: [ 77 | Color32::from_rgb(31, 31, 31), // Base 3 (background) 78 | Color32::from_rgb(42, 42, 42), // Base 2 (background highlights) 79 | Color32::from_rgb(204, 204, 204), // Base 1 (secondary text) 80 | Color32::from_rgb(248, 81, 73), // Base 00 (body text) 81 | ] 82 | }; 83 | 84 | pub const SYSTEM_COLORSCHEMES: [ColorScheme; 3] = [ 85 | SOLARIZED_DARK, 86 | SOLARIZED_LIGHT, 87 | INDUSTRIAL_DARK, 88 | ]; -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/PiTTF_32_cap_touch/bsp/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "az" 7 | version = "1.2.1" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" 10 | 11 | [[package]] 12 | name = "byte-slice-cast" 13 | version = "0.3.5" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "b0a5e3906bcbf133e33c1d4d95afc664ad37fbdb9f6568d8043e7ea8c27d93d3" 16 | 17 | [[package]] 18 | name = "byteorder" 19 | version = "1.4.3" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 22 | 23 | [[package]] 24 | name = "display-interface" 25 | version = "0.4.1" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "7517c040926d7b02b111884aa089177db80878533127f7c1b480d852c5fb4112" 28 | 29 | [[package]] 30 | name = "display-interface-spi" 31 | version = "0.4.1" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "489378ad054862146fbd1f09f51d585ccbe4bd1e2feadcda2a13ac33f840e1a5" 34 | dependencies = [ 35 | "byte-slice-cast", 36 | "display-interface", 37 | "embedded-hal 0.2.7", 38 | ] 39 | 40 | [[package]] 41 | name = "embedded-graphics-core" 42 | version = "0.3.3" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | checksum = "b8b1239db5f3eeb7e33e35bd10bd014e7b2537b17e071f726a09351431337cfa" 45 | dependencies = [ 46 | "az", 47 | "byteorder", 48 | ] 49 | 50 | [[package]] 51 | name = "embedded-hal" 52 | version = "0.2.7" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" 55 | dependencies = [ 56 | "nb 0.1.3", 57 | "void", 58 | ] 59 | 60 | [[package]] 61 | name = "embedded-hal" 62 | version = "1.0.0-alpha.11" 63 | source = "registry+https://github.com/rust-lang/crates.io-index" 64 | checksum = "f7724ebabcadfeb15920571dd727bc8ccde8586e52f2890bdb8182fdf42c3ff2" 65 | 66 | [[package]] 67 | name = "ft6236" 68 | version = "0.0.3" 69 | source = "registry+https://github.com/rust-lang/crates.io-index" 70 | checksum = "53e47719f31bca775dbbb33b130f1fb90711bb1fac21e2dafbe56f2b19583ce5" 71 | dependencies = [ 72 | "embedded-hal 0.2.7", 73 | "embedded-hal 1.0.0-alpha.11", 74 | ] 75 | 76 | [[package]] 77 | name = "ili9341" 78 | version = "0.5.0" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "52897a923ee65051ae7da0f0b3d326c08d3b0998aa59346dc9a856e3f137c0a9" 81 | dependencies = [ 82 | "display-interface", 83 | "embedded-graphics-core", 84 | "embedded-hal 0.2.7", 85 | ] 86 | 87 | [[package]] 88 | name = "iron-coder-pitft-32-cap-touch-bsp" 89 | version = "0.1.0" 90 | dependencies = [ 91 | "display-interface", 92 | "display-interface-spi", 93 | "embedded-hal 0.2.7", 94 | "embedded-hal 1.0.0-alpha.11", 95 | "ft6236", 96 | "ili9341", 97 | ] 98 | 99 | [[package]] 100 | name = "nb" 101 | version = "0.1.3" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" 104 | dependencies = [ 105 | "nb 1.1.0", 106 | ] 107 | 108 | [[package]] 109 | name = "nb" 110 | version = "1.1.0" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" 113 | 114 | [[package]] 115 | name = "void" 116 | version = "1.0.2" 117 | source = "registry+https://github.com/rust-lang/crates.io-index" 118 | checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 119 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/FeatherWing_propmaker/bsp/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "accelerometer" 7 | version = "0.12.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "1a4586d95cb0695e748760c9a751141eebb68265b1b20392a0f14db608679f7a" 10 | dependencies = [ 11 | "micromath", 12 | ] 13 | 14 | [[package]] 15 | name = "embedded-hal" 16 | version = "0.2.7" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" 19 | dependencies = [ 20 | "nb 0.1.3", 21 | "void", 22 | ] 23 | 24 | [[package]] 25 | name = "generic-array" 26 | version = "0.14.7" 27 | source = "registry+https://github.com/rust-lang/crates.io-index" 28 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 29 | dependencies = [ 30 | "typenum", 31 | "version_check", 32 | ] 33 | 34 | [[package]] 35 | name = "iron-coder-featherwing-propmaker-bsp" 36 | version = "0.1.0" 37 | dependencies = [ 38 | "embedded-hal", 39 | "lis3dh", 40 | ] 41 | 42 | [[package]] 43 | name = "lis3dh" 44 | version = "0.4.2" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | checksum = "0f41b6bb1f0a9cf25c0f184469382e73112fa0071b206ef5b3c6b235c7353a84" 47 | dependencies = [ 48 | "accelerometer", 49 | "embedded-hal", 50 | "num_enum", 51 | ] 52 | 53 | [[package]] 54 | name = "micromath" 55 | version = "1.1.1" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "bc4010833aea396656c2f91ee704d51a6f1329ec2ab56ffd00bfd56f7481ea94" 58 | dependencies = [ 59 | "generic-array", 60 | ] 61 | 62 | [[package]] 63 | name = "nb" 64 | version = "0.1.3" 65 | source = "registry+https://github.com/rust-lang/crates.io-index" 66 | checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" 67 | dependencies = [ 68 | "nb 1.1.0", 69 | ] 70 | 71 | [[package]] 72 | name = "nb" 73 | version = "1.1.0" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" 76 | 77 | [[package]] 78 | name = "num_enum" 79 | version = "0.5.11" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" 82 | dependencies = [ 83 | "num_enum_derive", 84 | ] 85 | 86 | [[package]] 87 | name = "num_enum_derive" 88 | version = "0.5.11" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" 91 | dependencies = [ 92 | "proc-macro2", 93 | "quote", 94 | "syn", 95 | ] 96 | 97 | [[package]] 98 | name = "proc-macro2" 99 | version = "1.0.64" 100 | source = "registry+https://github.com/rust-lang/crates.io-index" 101 | checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" 102 | dependencies = [ 103 | "unicode-ident", 104 | ] 105 | 106 | [[package]] 107 | name = "quote" 108 | version = "1.0.29" 109 | source = "registry+https://github.com/rust-lang/crates.io-index" 110 | checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" 111 | dependencies = [ 112 | "proc-macro2", 113 | ] 114 | 115 | [[package]] 116 | name = "syn" 117 | version = "1.0.109" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 120 | dependencies = [ 121 | "proc-macro2", 122 | "quote", 123 | "unicode-ident", 124 | ] 125 | 126 | [[package]] 127 | name = "typenum" 128 | version = "1.16.0" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" 131 | 132 | [[package]] 133 | name = "unicode-ident" 134 | version = "1.0.10" 135 | source = "registry+https://github.com/rust-lang/crates.io-index" 136 | checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" 137 | 138 | [[package]] 139 | name = "version_check" 140 | version = "0.9.4" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 143 | 144 | [[package]] 145 | name = "void" 146 | version = "1.0.2" 147 | source = "registry+https://github.com/rust-lang/crates.io-index" 148 | checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 149 | -------------------------------------------------------------------------------- /src/board/svg_reader.rs: -------------------------------------------------------------------------------- 1 | //! A module to help parse and SVG file with an embedded image, and various 2 | //! SVG paths that should be converted into egui elements. 3 | //! 4 | //! A few things are assumed about the SVG files: 5 | //! * The units should be in mm 6 | //! * All transforms have been removed and the units of all elements are absolute 7 | //! * All paths that should be displayed in Iron Coder have element id's that are also in the board manifest pinouts section. 8 | 9 | use usvg::{ 10 | Options, 11 | TreeParsing, 12 | Tree, 13 | NodeKind, 14 | ImageKind, 15 | }; 16 | use std::io::Cursor; 17 | use std::path::Path; 18 | use std::fs; 19 | use std::vec::Vec; 20 | 21 | use std::borrow::Borrow; 22 | 23 | use image; 24 | use egui::{ 25 | ColorImage, 26 | Pos2, 27 | Rect, 28 | Vec2, 29 | }; 30 | 31 | /// A struct that holds the decoded SVG for use in egui. 32 | #[derive(Default, Clone)] 33 | pub struct SvgBoardInfo { 34 | /// The SVG size (should be in mm) 35 | pub physical_size: Vec2, 36 | /// The egui ColorImage of the board. This can be any size in px. 37 | pub image: ColorImage, 38 | /// A vector of egui Rects that represent the pin locations on the Board 39 | pub pin_rects: Vec<(String, Rect)>, 40 | } 41 | 42 | impl SvgBoardInfo { 43 | 44 | /// Parse an Iron Coder SVG Board image from the filesystem. 45 | pub fn from_path(path: &Path) -> Result { 46 | 47 | let mut svg_board_info = SvgBoardInfo::default(); 48 | 49 | let svg_string = match fs::read_to_string(path) { 50 | Ok(string) => string, 51 | Err(e) => return Err(Error::FsError(e)), 52 | }; 53 | 54 | let options = Options::default(); 55 | let tree = match Tree::from_str(&svg_string.as_str(), &options) { 56 | Ok(t) => t, 57 | Err(_e) => return Err(Error::OtherError), 58 | }; 59 | 60 | // At this point we have a valid SVG tree to work with 61 | 62 | svg_board_info.physical_size = Vec2 { 63 | x: tree.view_box.rect.width(), 64 | y: tree.view_box.rect.height(), 65 | }; 66 | 67 | // iterate through the svg looking for elements 68 | let mut board_image: Option = None; 69 | for node in tree.root.descendants() { 70 | // first, look for the image 71 | match node.borrow().clone() { 72 | NodeKind::Image(img) => { 73 | if let ImageKind::PNG(png_bytes) = img.kind.clone() { 74 | //let size = [img.view_box.rect.width().round() as usize, img.view_box.rect.height() as usize]; 75 | let borrowed_bytes: &Vec = png_bytes.borrow(); 76 | let png = match image::io::Reader::new(Cursor::new(borrowed_bytes)).with_guessed_format() { 77 | Ok(ok) => ok, 78 | Err(_e) => return Err(Error::ImageDecodeError), 79 | }; 80 | let image = png.decode().unwrap(); 81 | // get the image size from the PNG itself 82 | let size = [image.width() as usize, image.height() as usize]; 83 | let image_bytes = image.to_rgba8(); 84 | let color_image = ColorImage::from_rgba_unmultiplied( 85 | size, 86 | &image_bytes, 87 | ); 88 | board_image = Some(color_image); 89 | } 90 | }, 91 | NodeKind::Path(path) => { 92 | let id = path.id; 93 | let bounds = path.data.bounds(); 94 | let min = Pos2 { 95 | x: bounds.left(), 96 | y: bounds.top(), 97 | }; 98 | let max = Pos2 { 99 | x: bounds.right(), 100 | y: bounds.bottom(), 101 | }; 102 | let rect = Rect::from_min_max(min, max); 103 | svg_board_info.pin_rects.push((String::from(id), rect)); 104 | }, 105 | _ => {}, 106 | } 107 | } 108 | 109 | if let Some(board_image) = board_image { 110 | svg_board_info.image = board_image; 111 | } else { 112 | return Err(Error::NoImage); 113 | } 114 | 115 | return Ok(svg_board_info); 116 | } 117 | 118 | } 119 | 120 | #[derive(Debug)] 121 | pub enum Error { 122 | FsError(std::io::Error), 123 | ImageDecodeError, 124 | ArcError, 125 | NoImage, 126 | OtherError, 127 | } -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/FeatherWing_OLED_128x64/bsp/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "autocfg" 7 | version = "1.1.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 10 | 11 | [[package]] 12 | name = "az" 13 | version = "1.2.1" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" 16 | 17 | [[package]] 18 | name = "byteorder" 19 | version = "1.4.3" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 22 | 23 | [[package]] 24 | name = "embedded-graphics" 25 | version = "0.7.1" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "750082c65094fbcc4baf9ba31583ce9a8bb7f52cadfb96f6164b1bc7f922f32b" 28 | dependencies = [ 29 | "az", 30 | "byteorder", 31 | "embedded-graphics-core", 32 | "float-cmp", 33 | "micromath", 34 | ] 35 | 36 | [[package]] 37 | name = "embedded-graphics-core" 38 | version = "0.3.3" 39 | source = "registry+https://github.com/rust-lang/crates.io-index" 40 | checksum = "b8b1239db5f3eeb7e33e35bd10bd014e7b2537b17e071f726a09351431337cfa" 41 | dependencies = [ 42 | "az", 43 | "byteorder", 44 | ] 45 | 46 | [[package]] 47 | name = "embedded-hal" 48 | version = "0.2.7" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" 51 | dependencies = [ 52 | "nb 0.1.3", 53 | "void", 54 | ] 55 | 56 | [[package]] 57 | name = "enum-iterator" 58 | version = "0.7.0" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" 61 | dependencies = [ 62 | "enum-iterator-derive", 63 | ] 64 | 65 | [[package]] 66 | name = "enum-iterator-derive" 67 | version = "0.7.0" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" 70 | dependencies = [ 71 | "proc-macro2", 72 | "quote", 73 | "syn", 74 | ] 75 | 76 | [[package]] 77 | name = "float-cmp" 78 | version = "0.8.0" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" 81 | dependencies = [ 82 | "num-traits", 83 | ] 84 | 85 | [[package]] 86 | name = "iron-coder-featherwing-oled-bsp" 87 | version = "0.1.0" 88 | dependencies = [ 89 | "embedded-hal", 90 | "sh1107", 91 | ] 92 | 93 | [[package]] 94 | name = "micromath" 95 | version = "1.1.1" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "bc4010833aea396656c2f91ee704d51a6f1329ec2ab56ffd00bfd56f7481ea94" 98 | 99 | [[package]] 100 | name = "nb" 101 | version = "0.1.3" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" 104 | dependencies = [ 105 | "nb 1.1.0", 106 | ] 107 | 108 | [[package]] 109 | name = "nb" 110 | version = "1.1.0" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" 113 | 114 | [[package]] 115 | name = "num-traits" 116 | version = "0.2.17" 117 | source = "registry+https://github.com/rust-lang/crates.io-index" 118 | checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" 119 | dependencies = [ 120 | "autocfg", 121 | ] 122 | 123 | [[package]] 124 | name = "proc-macro2" 125 | version = "1.0.70" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" 128 | dependencies = [ 129 | "unicode-ident", 130 | ] 131 | 132 | [[package]] 133 | name = "quote" 134 | version = "1.0.33" 135 | source = "registry+https://github.com/rust-lang/crates.io-index" 136 | checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" 137 | dependencies = [ 138 | "proc-macro2", 139 | ] 140 | 141 | [[package]] 142 | name = "sh1107" 143 | version = "0.3.5" 144 | source = "git+https://github.com/shulltronics/sh1107.git?branch=embedded-graphics-fix#b0617e8fa27f977d8710fd00ca3895c82b559781" 145 | dependencies = [ 146 | "embedded-graphics", 147 | "embedded-hal", 148 | "enum-iterator", 149 | ] 150 | 151 | [[package]] 152 | name = "syn" 153 | version = "1.0.109" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 156 | dependencies = [ 157 | "proc-macro2", 158 | "quote", 159 | "unicode-ident", 160 | ] 161 | 162 | [[package]] 163 | name = "unicode-ident" 164 | version = "1.0.12" 165 | source = "registry+https://github.com/rust-lang/crates.io-index" 166 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 167 | 168 | [[package]] 169 | name = "void" 170 | version = "1.0.2" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 173 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/bsp/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | 3 | pub mod prelude; 4 | use embedded_hal::blocking::i2c; 5 | use prelude::*; 6 | 7 | use adafruit_feather_rp2040 as feather; 8 | 9 | use feather::{Pins, XOSC_CRYSTAL_FREQ}; 10 | use feather::hal::{ 11 | pac, 12 | pac::interrupt, 13 | clocks::{init_clocks_and_plls, Clock}, 14 | watchdog::Watchdog, 15 | timer::Timer, 16 | Sio, 17 | gpio::pin::Pin, 18 | gpio::pin::PushPullOutput, 19 | gpio::pin::bank0::*, // all gpios into scope 20 | gpio::FunctionI2C, 21 | gpio::FunctionSpi, 22 | I2C, 23 | Spi, 24 | pio::PIOExt, 25 | }; 26 | 27 | use fugit::RateExtU32; 28 | 29 | // a SYSTIC-based delay timer 30 | use cortex_m::delay::Delay; 31 | // struct for neopixels 32 | use ws2812_pio::Ws2812Direct; 33 | 34 | // USB Device support 35 | use usb_device::class_prelude::*; 36 | // USB Communications Class Device support 37 | mod usb_manager; 38 | use usb_manager::UsbManager; 39 | use core::fmt::Write as _; 40 | 41 | // Global USB objects & interrupt 42 | static mut USB_BUS: Option> = None; 43 | static mut USB_MANAGER: Option = None; 44 | #[allow(non_snake_case)] 45 | #[interrupt] 46 | unsafe fn USBCTRL_IRQ() { 47 | match USB_MANAGER.as_mut() { 48 | Some(manager) => manager.interrupt(), 49 | None => (), 50 | }; 51 | } 52 | 53 | pub type OnboardLed = Pin; 54 | 55 | type OnboardNeopixel = Ws2812Direct< 56 | feather::hal::pac::PIO0, 57 | feather::hal::pio::SM0, 58 | feather::hal::gpio::pin::bank0::Gpio16, 59 | >; 60 | 61 | pub type I2CBus = I2C< 62 | pac::I2C1, 63 | (Pin, Pin) 64 | >; 65 | 66 | pub type SPIBus = Spi< 67 | adafruit_feather_rp2040::hal::spi::Enabled, 68 | pac::SPI0, 69 | 8, 70 | >; 71 | 72 | pub type Cs = Pin; 73 | pub type Rst = Pin; 74 | pub type Dc = Pin; 75 | 76 | pub struct Board { 77 | // pub pins: Pins, 78 | pub d4: Option>, 79 | pub d5: Option>, 80 | pub d24: Option>, 81 | pub d25: Option>, 82 | pub red_led: OnboardLed, 83 | neopixel: OnboardNeopixel, 84 | pub i2c_manager: shared_bus::BusManagerSimple,//Option, 85 | pub spi_bus: Option, 86 | pub delay_timer: Delay, 87 | pub test: Option, 88 | usb: &'static mut UsbManager, 89 | } 90 | 91 | impl Board { 92 | pub fn new() -> Self { 93 | let mut pac = pac::Peripherals::take().unwrap(); 94 | let core = pac::CorePeripherals::take().unwrap(); 95 | let mut watchdog = Watchdog::new(pac.WATCHDOG); 96 | let clocks = init_clocks_and_plls( 97 | XOSC_CRYSTAL_FREQ, 98 | pac.XOSC, 99 | pac.CLOCKS, 100 | pac.PLL_SYS, 101 | pac.PLL_USB, 102 | &mut pac.RESETS, 103 | &mut watchdog, 104 | ).ok().unwrap(); 105 | 106 | // Setup USB 107 | let usb = unsafe { 108 | USB_BUS = Some(UsbBusAllocator::new(feather::hal::usb::UsbBus::new( 109 | pac.USBCTRL_REGS, 110 | pac.USBCTRL_DPRAM, 111 | clocks.usb_clock, 112 | true, 113 | &mut pac.RESETS, 114 | ))); 115 | USB_MANAGER = Some(UsbManager::new(USB_BUS.as_ref().unwrap())); 116 | // Enable the USB interrupt 117 | feather::pac::NVIC::unmask(feather::hal::pac::Interrupt::USBCTRL_IRQ); 118 | USB_MANAGER.as_mut().unwrap() 119 | }; 120 | 121 | // initialize the Single Cycle IO 122 | let sio = Sio::new(pac.SIO); 123 | // initialize the pins to default state 124 | let pins = Pins::new( 125 | pac.IO_BANK0, 126 | pac.PADS_BANK0, 127 | sio.gpio_bank0, 128 | &mut pac.RESETS, 129 | ); 130 | 131 | // Setup the I2C1 instance, connected to the SCL/SDA pins on the Feather 132 | let scl = pins.scl.into_mode::(); 133 | let sda = pins.sda.into_mode::(); 134 | let i2c1: I2CBus = I2C::i2c1( 135 | pac.I2C1, 136 | sda, 137 | scl, 138 | RateExtU32::kHz(400), 139 | &mut pac.RESETS, 140 | &clocks.system_clock, 141 | ); 142 | // Create the bus manager 143 | let i2c_manager = shared_bus::BusManagerSimple::new(i2c1); 144 | 145 | let mosi = pins.mosi.into_mode::(); 146 | let miso = pins.miso.into_mode::(); 147 | let sclk = pins.sclk.into_mode::(); 148 | let spi = Spi::<_, _, 8>::new(pac.SPI0); 149 | 150 | // Exchange the uninitialised SPI driver for an initialised one 151 | let mut spi = spi.init( 152 | &mut pac.RESETS, 153 | clocks.peripheral_clock.freq(), 154 | 16.MHz(), 155 | &embedded_hal::spi::MODE_0, 156 | ); 157 | 158 | // setup the general-purpose delay timer 159 | let dt = Delay::new(core.SYST, clocks.system_clock.freq().to_Hz()); 160 | 161 | // setup the on-board neopixel 162 | let _timer = Timer::new(pac.TIMER, &mut pac.RESETS); 163 | let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); 164 | let np = Ws2812Direct::new( 165 | pins.neopixel.into_mode(), 166 | &mut pio, 167 | sm0, 168 | clocks.peripheral_clock.freq(), 169 | //timer.count_down(), 170 | ); 171 | 172 | Self { 173 | d4: Some(pins.d4.into_mode::()), 174 | d5: Some(pins.d5.into_mode::()), 175 | d24: Some(pins.d24.into_mode::()), 176 | d25: Some(pins.d25.into_mode::()), 177 | red_led: pins.d13.into_push_pull_output(), 178 | neopixel: np, 179 | i2c_manager: i2c_manager,//Some(i2c1), 180 | spi_bus: Some(spi), 181 | delay_timer: dt, 182 | test: Some(true), 183 | usb: usb, 184 | } 185 | } 186 | 187 | pub fn delay(&mut self, ms: u32) { 188 | self.delay_timer.delay_ms(ms); 189 | } 190 | 191 | pub fn set_led(&mut self, state: bool) { 192 | match state { 193 | true => self.red_led.set_high().unwrap(), 194 | false => self.red_led.set_low().unwrap(), 195 | } 196 | } 197 | 198 | pub fn set_neopixel_color(&mut self, color: smart_leds::RGB8) { 199 | let _ = self.neopixel.write(brightness([color].iter().cloned(), 50)); 200 | } 201 | 202 | pub fn serial_write(&mut self, s: impl core::fmt::Debug) { 203 | write!(self.usb, "{:?}\r\n", s).unwrap(); 204 | } 205 | 206 | } -------------------------------------------------------------------------------- /src/project/system.rs: -------------------------------------------------------------------------------- 1 | //! Title: Iron Coder Poject Module - System 2 | //! Description: This module represents a hardware system, i.e. a main board, 3 | //! a set of peripheral boards, and the connections between them. 4 | 5 | use log::{info, warn}; 6 | 7 | use std::collections::HashSet; 8 | use std::fs; 9 | use std::path::Path; 10 | use serde::{Deserialize, Serialize}; 11 | 12 | use syn::Ident; 13 | use quote::quote; 14 | 15 | use crate::board::Board; 16 | use crate::board::pinout::InterfaceMapping; 17 | 18 | pub type Result = core::result::Result<(), SystemError>; 19 | 20 | #[non_exhaustive] 21 | #[derive(Debug)] 22 | pub enum SystemError { 23 | BoardNotInSystemError, 24 | } 25 | 26 | /// A Connection is a physical bus connecting two Boards (e.g. I2C, GPIO, SPI, etc). 27 | /// TODO - determine best way of representing a connection. Can it represent a bus connecting 28 | /// more than one board? i.e. one I2C main device talking to multiple peripherals, or a CAN 29 | /// network. 30 | #[derive(Serialize, Deserialize, Debug, Clone)] 31 | pub struct Connection { 32 | /// The name of the connection. Iron Coder will search for this name 33 | /// in your source code to determine which variable is associated with this connection. 34 | pub name: String, 35 | pub start_board: Board, 36 | pub start_pin: String, 37 | pub end_board: Board, 38 | pub end_pin: String, 39 | pub interface_mapping: InterfaceMapping, 40 | } 41 | 42 | /// A system represents the development boards and their interconnections 43 | #[derive(Serialize, Deserialize, Clone, Debug, Default)] 44 | pub struct System { 45 | /// The main, programmable board in the system. 46 | pub main_board: Option, 47 | /// The list of peripheral boards in the system. 48 | pub peripheral_boards: Vec, 49 | /// The list of connections between boards. This is what the template generator will use to create 50 | /// the system module. 51 | pub connections: Vec, 52 | /// An optional board + pin for the current in-progress connecion. 53 | pub in_progress_connection_start: Option<(Board, String)>, 54 | pub in_progress_connection_end: Option<(Board, String)>, 55 | } 56 | 57 | /// A datastructure that will hold all of the information we need to populate the System module. 58 | #[derive(Default)] 59 | struct TokenStreamAccumulator { 60 | /// A set of crate Idents that need to be included in the system module. 61 | required_bsp_crates: HashSet, 62 | // /// A vector of : to include in the System struct declaration. 63 | // struct_field_and_type_list: Vec, 64 | // /// A vector of : to include in the System struct constructor. 65 | // struct_field_and_constructor_list: Vec, 66 | } 67 | 68 | impl System { 69 | 70 | /// Return a vector of all the system boards. If there is no main board, this returns an 71 | /// empty vector. 72 | pub fn get_all_boards(&self) -> Vec { 73 | let mut boards = Vec::new(); 74 | if let Some(mb) = self.main_board.clone() { 75 | boards.push(mb); 76 | } 77 | boards.append(&mut self.peripheral_boards.clone()); 78 | return boards; 79 | } 80 | 81 | /// Return a vector of mutable references to each board. This is used for reloading board 82 | /// resources on startup, or when opening a project from the filesystem. 83 | pub fn get_all_boards_mut(&mut self) -> Vec<&mut Board> { 84 | let mut boards = Vec::new(); 85 | if let Some(ref mut mb) = self.main_board { 86 | boards.push(mb); 87 | } 88 | self.peripheral_boards.iter_mut().for_each(|board| { 89 | boards.push(board); 90 | }); 91 | return boards; 92 | } 93 | 94 | /// Try to remove the provided Board from the system, along with all of it's connections. 95 | /// If everything is good, return Ok(()), otherwise return an error indicating what went wrong. 96 | pub fn remove_board(&mut self, board: Board) -> Result { 97 | if let Some(ref mb) = self.main_board { 98 | if *mb == board { 99 | self.main_board = None; 100 | self.remove_connections_involving_board(board); 101 | return Ok(()) 102 | } 103 | } 104 | if let Some(idx) = self.peripheral_boards.iter().position(|elem| *elem == board) { 105 | self.peripheral_boards.remove(idx); 106 | self.remove_connections_involving_board(board); 107 | return Ok(()); 108 | } 109 | return Err(SystemError::BoardNotInSystemError); 110 | } 111 | 112 | /// Iterate through the connection list, and remove connections that involve the provided board 113 | fn remove_connections_involving_board(&mut self, board: Board) { 114 | self.connections = self.connections.iter().filter(|elem| { 115 | !((**elem).start_board == board || (**elem).end_board == board) 116 | }).cloned().collect(); 117 | } 118 | 119 | /// Generate a module based on the system. Lots to improve here. For now, this just saves 120 | /// the module to the project root (i.e. doesn't account for the existance of a Cargo project). 121 | pub fn generate_system_module(&mut self, save_to: &Path) -> Result { 122 | 123 | // Fold through the list of connections, and capture the required information 124 | let TokenStreamAccumulator { 125 | required_bsp_crates, 126 | .. 127 | } = self.connections.iter().fold(TokenStreamAccumulator::default(), |mut acc, elem| { 128 | 129 | let Connection { 130 | start_board, 131 | end_board, 132 | .. 133 | } = elem; 134 | 135 | // get starting board info 136 | if let Some(start_board_bsp_info) = &start_board.bsp_parse_info { 137 | info!(" found some bsp info"); 138 | if let Some(start_board_crate_ident) = &start_board_bsp_info.bsp_crate_identifier { 139 | info!(" found a crate ident"); 140 | acc.required_bsp_crates.insert(start_board_crate_ident.clone()); 141 | } 142 | } 143 | 144 | // get ending board info 145 | if let Some(end_board_bsp_info) = &end_board.bsp_parse_info { 146 | if let Some(end_board_crate_ident) = &end_board_bsp_info.bsp_crate_identifier { 147 | acc.required_bsp_crates.insert(end_board_crate_ident.clone()); 148 | } 149 | } 150 | 151 | return acc; 152 | }); 153 | 154 | info!("after folding, num required crates is {}", required_bsp_crates.len()); 155 | 156 | let r = required_bsp_crates.iter(); 157 | 158 | /************* MODULE CODE HERE *************/ 159 | let output_tokens = quote! 160 | { 161 | #(use #r;)* 162 | 163 | // todo - include needed imports 164 | 165 | pub struct System { 166 | // #(#struct_field_and_type_list),* 167 | } 168 | 169 | impl System { 170 | pub fn new() -> Self { 171 | Self { 172 | // #(#struct_field_and_constructor_list),* 173 | } 174 | } 175 | } 176 | 177 | // #(#connection_impls)* 178 | 179 | }; 180 | /************* End Module Code *************/ 181 | 182 | // now output the module code to a file, passing through the prettyplease formatter 183 | let syn_code: syn::File = match syn::parse2(output_tokens) { 184 | Ok(syn_code) => syn_code, 185 | Err(e) => { 186 | warn!("couldn't parse output_tokens! {:?}", e); 187 | syn::parse_str("// error generating module").unwrap() 188 | } 189 | }; 190 | let code = prettyplease::unparse(&syn_code); 191 | match fs::write(save_to, code.as_str()) { 192 | Ok(_) => (), 193 | Err(e) => { 194 | warn!("error writing code to {:?}: {:?}", save_to.display(), e); 195 | } 196 | } 197 | 198 | Ok(()) 199 | 200 | } 201 | 202 | 203 | } 204 | -------------------------------------------------------------------------------- /src/board/parsing.rs: -------------------------------------------------------------------------------- 1 | //! This module contains data and operations pertaining to the parsing of a 2 | //! Board Support Package (BSP). 3 | 4 | use log::{info, warn}; 5 | use std::vec::Vec; 6 | use std::string::String; 7 | use std::fs; 8 | use proc_macro2::TokenStream; 9 | use quote::{ 10 | format_ident, 11 | quote, 12 | }; 13 | use syn::{ 14 | Ident, 15 | visit::Visit, 16 | }; 17 | 18 | use crate::board::Board; 19 | 20 | #[derive(Debug)] 21 | #[non_exhaustive] 22 | pub enum BspParseError { 23 | BspMissingError, 24 | OtherError, 25 | } 26 | 27 | pub type Result = core::result::Result<(), BspParseError>; 28 | 29 | /// This struct contains all the needed info for adding fields to the System module. 30 | #[derive(Default, Debug, Clone)] 31 | pub struct BspParseInfo { 32 | /// The identifier representing the name of the BSP crate 33 | pub bsp_crate_identifier: Option, 34 | /// The import statement to include this BSP in another module 35 | pub use_statement: TokenStream, 36 | /// A list of identifiers representing the field names for this board. For a main board, this will be 37 | /// "main_board", and for perihperal boards, TODO. 38 | pub board_field_identifiers: Vec, 39 | /// A list of identifiers representing the types of the fields of the System struct 40 | pub board_field_type_identifiers: Vec, 41 | /// A list of TokenStreams of the form : for use in the System struct 42 | pub field_type_token_streams: Vec, 43 | /// A list of TokenStreams of the form : for use in the System struct impl 44 | pub field_constructor_token_streams: Vec, 45 | /// A list of public type aliases offered by the main board BSP 46 | pub available_types: Vec, 47 | /// A mapping of generic types to concrete types for use in `self.board_field_type_identifiers` 48 | pub type_substitutions: Vec<(String, Option)>, 49 | } 50 | 51 | 52 | /// Use the `syn::visit::Visit` trait to explore the syntax tree of the BSP. 53 | impl<'ast> Visit<'ast> for BspParseInfo { 54 | 55 | /// Actions when we visit a top-level struct in the BSP. 56 | fn visit_item_struct(&mut self, item_struct: &'ast syn::ItemStruct) { 57 | if item_struct.ident.to_string() == "Board" { 58 | info!("found Board struct"); 59 | let (field, crat, typ) = ( 60 | self.board_field_identifiers.last().unwrap(), 61 | self.bsp_crate_identifier.clone().unwrap(), 62 | format_ident!("{}", "Board") 63 | ); 64 | self.board_field_type_identifiers.push(typ.clone()); 65 | self.field_type_token_streams.push(quote! { 66 | pub #field: #crat::#typ 67 | }); 68 | self.field_constructor_token_streams.push(quote! { 69 | #field: #crat::#typ::new() 70 | }); 71 | self.visit_generics(&item_struct.generics); 72 | // self.visit_where_clause(&item_struct.generics.where_clause.clone().unwrap()); 73 | } 74 | } 75 | /// Actions when we visit a top-level type in the BSP. 76 | fn visit_item_type(&mut self, item_type: &'ast syn::ItemType) { 77 | if item_type.ident.to_string() == "I2CBus" { 78 | info!("found a type with named 'I2CBus'"); 79 | self.available_types.push(item_type.ident.to_string().clone()); 80 | } 81 | } 82 | /// Actions when we visit some generic type parameters in the BSP. 83 | fn visit_generics(&mut self, generics: &'ast syn::Generics) { 84 | info!("found {} generic parameters", generics.params.len()); 85 | for (i, t) in generics.type_params().enumerate() { 86 | info!("generic {} Ident is {:?}", i, t.ident.clone()); 87 | let replacement = match t.ident.to_string().as_str() { 88 | "I2C" => { 89 | if self.available_types.contains(&String::from("I2CBus")) { 90 | let _ = self.field_type_token_streams.pop(); 91 | let id = self.board_field_type_identifiers.pop().unwrap(); 92 | let bsp = self.bsp_crate_identifier.clone(); 93 | let crat = self.bsp_crate_identifier.clone().unwrap(); 94 | let typ = format_ident!("{}", "I2CBus"); 95 | let field = self.board_field_identifiers.last().unwrap(); 96 | let field_type = quote! { 97 | pub #field: #crat::#id<#bsp::#typ> 98 | }; 99 | self.field_type_token_streams.push(field_type); 100 | Some(String::from("I2CBus")) 101 | } else { 102 | None 103 | } 104 | }, 105 | _ => { 106 | None 107 | } 108 | }; 109 | self.type_substitutions.push((t.ident.to_string().clone(), replacement)); 110 | } 111 | } 112 | } 113 | 114 | /// Board impls regarding parsing of BSP syntax 115 | impl Board { 116 | 117 | // Attempt to parse the BSP lib file. 118 | fn parse_bsp(&self) -> Option { 119 | let mut syntax = None; 120 | if let Some(bsp_dir) = self.bsp_path.clone() { 121 | let src = bsp_dir.join("src/lib.rs"); 122 | let src = fs::read_to_string(src.as_path()).unwrap(); 123 | syntax = match syn::parse_file(src.as_str()) { 124 | Ok(syntax) => { 125 | Some(syntax) 126 | }, 127 | Err(e) => { 128 | warn!("Couldn't parse BSP for board {:?} with syn: {:?}", self.get_name(), e); 129 | None 130 | }, 131 | }; 132 | } 133 | // self.bsp_syntax = syntax.clone(); 134 | return syntax; 135 | } 136 | 137 | /// Try to add the BSP info to self, returning Ok on success or otherwise indicating the type of error. 138 | pub fn load_bsp_info(&mut self) -> Result { 139 | 140 | let mut bsp_parse_info = BspParseInfo::default(); 141 | 142 | // Get the BSP crate names to construct the `use` statements and field type identifiers. 143 | let bsp = match self.bsp.clone() { 144 | Some(bsp) => bsp.replace("-", "_").replace("(", "").replace(")", "").replace(".", ""), 145 | None => return Err(BspParseError::BspMissingError), 146 | }; 147 | let bsp_crate_ident = quote::format_ident!( 148 | "{}", 149 | bsp, 150 | ); 151 | bsp_parse_info.bsp_crate_identifier = Some(bsp_crate_ident.clone()); 152 | bsp_parse_info.use_statement = quote! { 153 | use #bsp_crate_ident; 154 | }; 155 | 156 | let board_field_name = self.get_name() 157 | .replace(" ", "_") 158 | .replace("-", "_") 159 | .replace("(", "") 160 | .replace(")", "") 161 | .replace(".", "") 162 | .to_ascii_lowercase(); 163 | let board_field_ident = quote::format_ident!("{}", board_field_name); 164 | bsp_parse_info.board_field_identifiers.push(board_field_ident); 165 | 166 | // Parse the BSP to look at what's in it, determine if we need to resolve 167 | // any generic types, etc 168 | info!("sending board {:?} through the syn visitor!", self.get_name()); 169 | if let Some(syntax) = self.parse_bsp() { 170 | // iterate throught the AST, looking for a struct called "Board" 171 | syntax.items.iter().for_each(|item| { 172 | match item { 173 | syn::Item::Struct(item_struct) => { 174 | bsp_parse_info.visit_item_struct(item_struct); 175 | }, 176 | syn::Item::Type(item_type) => { 177 | bsp_parse_info.visit_item_type(item_type); 178 | } 179 | _ => (), 180 | } 181 | }); 182 | } else { 183 | warn!("couldn't parse BSP syntax for board {}!", self.get_name()); 184 | return Err(BspParseError::OtherError); 185 | } 186 | 187 | // debug!("after parsing BSPs, the datastructure looks like: \n{:#?}", bsp_parse_info); 188 | self.bsp_parse_info = Some(bsp_parse_info); 189 | Ok(()) 190 | } 191 | 192 | } -------------------------------------------------------------------------------- /src/board/mod.rs: -------------------------------------------------------------------------------- 1 | //! This module provides functionality for development boards 2 | 3 | use log::{warn, info, debug}; 4 | 5 | use std::path::{Path, PathBuf}; 6 | use std::fs; 7 | use std::vec::Vec; 8 | use std::fmt; 9 | use std::cmp; 10 | use std::hash::{Hash, Hasher}; 11 | 12 | use serde::{Serialize, Deserialize}; 13 | 14 | use ra_ap_ide; 15 | 16 | mod svg_reader; 17 | use svg_reader::SvgBoardInfo; 18 | 19 | pub mod display; 20 | 21 | pub mod pinout; 22 | use pinout::Pinout; 23 | 24 | pub mod parsing; 25 | mod test; 26 | 27 | use parsing::BspParseInfo; 28 | 29 | /// These are the various standard development board form factors 30 | #[non_exhaustive] 31 | #[derive(Serialize, Deserialize, Debug, Clone)] 32 | pub enum BoardStandards { 33 | Feather, 34 | Arduino, 35 | RaspberryPi, 36 | ThingPlus, 37 | MicroMod, 38 | } 39 | 40 | impl fmt::Display for BoardStandards { 41 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 42 | match self { 43 | BoardStandards::Feather => write!(f, "Feather"), 44 | BoardStandards::Arduino => write!(f, "Arduino"), 45 | BoardStandards::RaspberryPi => write!(f, "RaspberryPi"), 46 | BoardStandards::ThingPlus => write!(f, "ThingPlus"), 47 | BoardStandards::MicroMod => write!(f, "MicroMod"), 48 | // _ => write!(f, "Unknown Dev Board Standard"), 49 | } 50 | } 51 | } 52 | 53 | /// The board struct defines a board type 54 | #[derive(Serialize, Deserialize, Clone, Default)] 55 | #[serde(default)] 56 | pub struct Board { 57 | /// The name of the board 58 | name: String, 59 | /// The board manufacturer 60 | manufacturer: String, 61 | /// Whether or not the board has a processor that can run code 62 | is_main_board: bool, 63 | /// A possible form factor that the board adheres to 64 | standard: Option, 65 | cpu: Option, 66 | ram: Option, 67 | flash: Option, 68 | /// A list of the interfaces available on the board 69 | pub pinout: Pinout, 70 | /// A list of the Syntax Nodes of the BSP calculated by Rust Analyzer 71 | #[serde(skip)] 72 | pub ra_values: Vec, 73 | /// A list of examples 74 | #[serde(skip)] 75 | examples: Vec, 76 | /// An local path of a project template 77 | #[serde(skip)] 78 | template_dir: Option, 79 | /// The name of a BSP crate 80 | pub bsp: Option, 81 | /// An optional path to a local BSP (if None, means the BSP should be on crates.io) 82 | #[serde(skip)] 83 | pub bsp_path: Option, 84 | /// A syntax tree representation of the BSP 85 | #[serde(skip)] 86 | pub bsp_parse_info: Option, 87 | /// Possible image loaded from an SVG file, along with size info and pin locations 88 | #[serde(skip)] 89 | pub svg_board_info: Option, 90 | /// A list of required crates 91 | required_crates: Option>, 92 | /// A list of related, optional crates 93 | related_crates: Option>, 94 | } 95 | 96 | impl fmt::Debug for Board { 97 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 98 | write!(f, "Board {}\n", self.name)?; 99 | write!(f, " is main board? {}\n", self.is_main_board)?; 100 | write!(f, " num examples: {}\n", self.examples.len())?; 101 | write!(f, " num required crates: {}\n", self.required_crates.clone().unwrap_or_default().len())?; 102 | write!(f, " num related crates: {}\n", self.related_crates.clone().unwrap_or_default().len())?; 103 | write!(f, " has svg info: {}\n", self.svg_board_info.is_some())?; 104 | write!(f, " has template: {}\n", self.template_dir.is_some())?; 105 | write!(f, " bsp crate name: {:?}\n", self.bsp)?; 106 | write!(f, " has local bsp: {:?}\n", self.bsp_path)?; 107 | write!(f, " has some syntax loaded: {:?}\n", self.bsp_parse_info.is_some())?; 108 | Ok(()) 109 | } 110 | } 111 | 112 | /// Boards are uniquely identified by their name, and thus comparable. 113 | impl cmp::PartialEq for Board { 114 | fn eq(&self, other: &Self) -> bool { 115 | self.name == other.name 116 | } 117 | } 118 | impl cmp::Eq for Board {} 119 | 120 | /// Boards are uniquely identified by their name, and thus hashable. 121 | impl Hash for Board { 122 | fn hash(&self, state: &mut H) { 123 | self.name.hash(state); 124 | } 125 | } 126 | 127 | /// Basic implementation, including loading boards from the filesystem, and retrieving certain 128 | /// information about them. 129 | impl Board { 130 | 131 | /// Loads a board from its toml description 132 | fn load_from_toml(path: &Path) -> std::io::Result { 133 | 134 | let toml_str = fs::read_to_string(path)?; 135 | let mut b: Board = match toml::from_str(&toml_str) { 136 | Ok(b) => b, 137 | Err(_) => { 138 | return Err(std::io::Error::other("load from toml failed")); 139 | }, 140 | }; 141 | 142 | // See if there is an image 143 | if let Ok(pic_path) = path.with_extension("svg").canonicalize() { 144 | // BASED ON SVG WORK 145 | match SvgBoardInfo::from_path(&pic_path) { 146 | Ok(svg_board_info) => { 147 | info!("successfully decoded SVG for board {}. Board has physical size: {:?}", b.get_name(), svg_board_info.physical_size); 148 | b.svg_board_info = Some(svg_board_info); 149 | }, 150 | Err(e) => { 151 | warn!("error with svg parsing! {:?}", e); 152 | return Err(std::io::Error::other("unable to parse board SVG file.")); 153 | }, 154 | }; 155 | } else { 156 | warn!("no svg file for board {}", b.get_name()); 157 | return Err(std::io::Error::other("no SVG file for board.")); 158 | 159 | } 160 | 161 | // See if there are any examples 162 | if let Ok(examples_path) = path.parent().unwrap().join("examples").canonicalize() { 163 | for (_i, e) in examples_path.read_dir().unwrap().enumerate() { 164 | let example_path = e.unwrap().path(); 165 | b.examples.push(example_path); 166 | } 167 | } 168 | 169 | return Ok(b); 170 | } 171 | 172 | pub fn get_name(&self) -> &str { 173 | self.name.as_str() 174 | } 175 | 176 | pub fn get_pinout(&self) -> Pinout { 177 | self.pinout.clone() 178 | } 179 | 180 | pub fn required_crates(&self) -> Option> { 181 | self.required_crates.clone() 182 | } 183 | 184 | pub fn related_crates(&self) -> Option> { 185 | self.related_crates.clone() 186 | } 187 | 188 | pub fn is_main_board(&self) -> bool { 189 | self.is_main_board 190 | } 191 | 192 | pub fn get_template_dir(&self) -> Option { 193 | return self.template_dir.clone(); 194 | } 195 | 196 | } 197 | 198 | /// Iteratively gather the Boards from the filesystem. 199 | pub fn get_boards(boards_dir: &Path) -> Vec { 200 | let mut r = Vec::new(); 201 | if let Ok(manufacturers) = fs::read_dir(boards_dir) { 202 | // first tier of organization is by manufacturer 203 | for manufacturer in manufacturers { 204 | let manufacturer = manufacturer.expect("error with manufacturer directory"); 205 | if manufacturer.file_type().expect("error parsing file type").is_file() { 206 | continue; 207 | } 208 | let boards = fs::read_dir(manufacturer.path()).expect("error iterating over files in manufacturer directory"); 209 | for board in boards { 210 | let board = board.expect("error with Board directory"); 211 | if board.file_type().expect("error parsing file type within board dir").is_file() { 212 | continue; 213 | } 214 | let files = fs::read_dir(board.path()).expect("error iterating over files in board directory"); 215 | for file in files { 216 | let file = file.expect("error reading file within board directory"); 217 | if file.path().extension().unwrap_or_default() == "toml" { 218 | match Board::load_from_toml(&file.path()) { 219 | Ok(mut board) => { 220 | let parent = file.path().parent().unwrap().canonicalize().unwrap(); 221 | // look for a template directory 222 | let template_dir = parent.join("template"); 223 | if let Ok(true) = template_dir.try_exists() { 224 | debug!("found template dir for board <{}> at {:?}", board.name.clone(), file.path().parent().unwrap().canonicalize().unwrap().join("template")); 225 | board.template_dir = Some(template_dir); 226 | } else { 227 | debug!("no template directory found for board <{}>", board.name.clone()); 228 | } 229 | // look for a local BSP, and do things related to it if needed 230 | let bsp_dir = parent.join("bsp"); 231 | if let Ok(true) = bsp_dir.try_exists() { 232 | info!("found local bsp crate for board {}", board.name.clone()); 233 | board.bsp_path = Some(bsp_dir.clone()); 234 | // let bsp_string = fs::read_to_string(bsp_dir.join("src/lib.rs")).unwrap(); 235 | // let (analysis, fid) = ra_ap_ide::Analysis::from_single_file(bsp_string); 236 | // board.ra_values = analysis.file_structure(fid).unwrap(); 237 | match board.load_bsp_info() { 238 | Ok(_) => (), 239 | Err(e) => warn!("error parsing BSP for board {}: {:?}", board.get_name(), e), 240 | }; 241 | } else { 242 | debug!("no bsp directory found for board <{}>", board.name.clone()); 243 | } 244 | r.push(board); 245 | }, 246 | Err(e) => { 247 | warn!("error loading board from {}: {:?}", file.path().display().to_string(), e); 248 | }, 249 | } 250 | } 251 | } 252 | } 253 | } 254 | } 255 | return r; 256 | } 257 | -------------------------------------------------------------------------------- /iron-coder-boards/Sparkfun/MicroMod-ESP32/bsp/examples/blinky/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /src/board/display.rs: -------------------------------------------------------------------------------- 1 | //! This module contains code related to displaying Boards and related types in egui. 2 | 3 | use log::{info, debug}; 4 | use crate::board::Board; 5 | use egui::{ 6 | Color32, 7 | Ui, 8 | Response, 9 | FontFamily, 10 | FontId, 11 | }; 12 | use egui::text::{ 13 | TextFormat, 14 | LayoutJob, 15 | }; 16 | use egui::widgets::Widget; 17 | use egui_extras::RetainedImage; 18 | 19 | /// Construct a LayoutJob with a bold heading, followed by a colon, 20 | /// followed by some content, all with custom colors. 21 | fn make_field_widget_text(heading: &str, 22 | hcolor: Color32, 23 | content: &str, 24 | ccolor: Color32) -> LayoutJob { 25 | let mut job = LayoutJob::default(); 26 | job.append( 27 | heading, 28 | 0.0, 29 | TextFormat { 30 | font_id: FontId::new(12.0, FontFamily::Name("MonospaceBold".into())), 31 | color: hcolor, 32 | ..Default::default() 33 | }, 34 | ); 35 | job.append( 36 | content, 37 | 0.0, 38 | TextFormat { 39 | font_id: FontId::new(12.0, FontFamily::Monospace), 40 | color: ccolor, 41 | ..Default::default() 42 | }, 43 | ); 44 | return job; 45 | } 46 | 47 | /// Normal view for the board widget 48 | impl Widget for Board { 49 | // How to display a board as a widget 50 | fn ui(self, ui: &mut Ui) -> Response { 51 | let response: egui::Response; 52 | if let Some(svg_board_info) = self.svg_board_info { 53 | // Use a frame to display multiple widgets within our widget, 54 | // with an inner margin 55 | response = egui::Frame::none() 56 | .inner_margin(egui::Margin::same(10.0)) 57 | .show(ui, |ui| { 58 | // center all text 59 | ui.with_layout(egui::Layout::top_down(egui::Align::Center), |ui| { 60 | // let label = egui::RichText::new(self.name).strong(); 61 | ui.label(make_field_widget_text( 62 | "Board: ", 63 | ui.style().visuals.warn_fg_color, 64 | self.name.as_str(), 65 | ui.style().visuals.window_stroke.color, 66 | )); 67 | // ui.label(label); 68 | let retained_image = RetainedImage::from_color_image( 69 | "pic", 70 | svg_board_info.image, 71 | ); 72 | retained_image.show_max_size(ui, egui::vec2(150.0, 150.0)); 73 | }); 74 | ui.horizontal(|ui| { 75 | ui.label(make_field_widget_text( 76 | "Manufacturer: ", 77 | ui.style().visuals.warn_fg_color, 78 | self.manufacturer.as_str(), 79 | ui.style().visuals.window_stroke.color, 80 | )); 81 | // TODO -- make the manufacturer logos an app-wide resource 82 | // let p = Path::new("./assets/images/Adafruit_logo_small.png"); 83 | // let image = image::io::Reader::open(p).unwrap().decode().unwrap(); 84 | // let size = [image.width() as _, image.height() as _]; 85 | // let image_buffer = image.to_rgba8(); 86 | // let pixels = image_buffer.as_flat_samples(); 87 | // let color_image = egui::ColorImage::from_rgba_unmultiplied( 88 | // size, 89 | // pixels.as_slice(), 90 | // ); 91 | // let ri = egui_extras::RetainedImage::from_color_image("logo", color_image); 92 | // let image = egui::widgets::Image::new( 93 | // ri.texture_id(ui.ctx()), 94 | // egui::Vec2::new(47.0, 16.0) 95 | // ).tint(egui::Color32::GREEN); // TODO: replace with a val from current colorscheme 96 | // ui.add(image); 97 | }); 98 | ui.horizontal(|ui| { 99 | ui.label("Ecosystem: "); 100 | if let Some(standard) = self.standard { 101 | ui.label(standard.to_string()); 102 | } else { 103 | ui.label("none"); 104 | } 105 | }); 106 | ui.horizontal(|ui| { 107 | ui.label("CPU: "); 108 | if let Some(cpu) = self.cpu { 109 | ui.label(cpu); 110 | } else { 111 | ui.label("unknown"); 112 | } 113 | }); 114 | ui.horizontal(|ui| { 115 | ui.label("RAM Amount (in kb): "); 116 | if let Some(ram) = self.ram { 117 | ui.label(ram.to_string()); 118 | } else { 119 | ui.label("unknown"); 120 | } 121 | }); 122 | ui.horizontal(|ui| { 123 | ui.label("Flash Amount (in kb): "); 124 | if let Some(flash) = self.flash { 125 | ui.label(flash.to_string()); 126 | } else { 127 | ui.label("unknown"); 128 | } 129 | }); 130 | ui.separator(); 131 | // Show the examples 132 | ui.with_layout(egui::Layout::top_down(egui::Align::Center), |ui| { 133 | let label = egui::RichText::new("Examples").underline(); 134 | ui.label(label); 135 | }); 136 | for e in self.examples { 137 | ui.horizontal(|ui| { 138 | if ui.link(e.file_name().unwrap().to_str().unwrap()).clicked() { 139 | info!("TODO - open the example!") 140 | }; 141 | }); 142 | } 143 | ui.separator(); 144 | // show the interfaces 145 | ui.with_layout(egui::Layout::top_down(egui::Align::Center), |ui| { 146 | let label = egui::RichText::new("Pinout").underline(); 147 | ui.label(label); 148 | }); 149 | ui.label(format!("{:?}", self.pinout)); 150 | 151 | }).response.interact(egui::Sense::click()); 152 | 153 | if ui.rect_contains_pointer(response.rect) { 154 | // draw a bounding box 155 | ui.painter().rect_stroke(response.rect, 0.0, (1.0, egui::Color32::WHITE)); 156 | } 157 | 158 | //another way of doing it; clicking works but scaling is off 159 | // let th = ui.ctx().load_texture( 160 | // "pic", 161 | // color_image, 162 | // Default::default(), 163 | // ); 164 | // let i = egui::Image::new(&th, egui::vec2(128.0, 128.0)).sense(egui::Sense::click()); 165 | // response = ui.add(i); 166 | } else { 167 | response = ui.allocate_response(egui::vec2(128.0, 128.0), egui::Sense::click()); 168 | } 169 | return response; 170 | } 171 | 172 | } 173 | 174 | /// Display the board for use in the Board selector window 175 | pub struct BoardSelectorWidget(pub Board); 176 | impl Widget for BoardSelectorWidget { 177 | fn ui(self, ui: &mut Ui) -> Response { 178 | let this_board = self.0; 179 | let response: egui::Response; 180 | if let Some(svg_board_info) = this_board.clone().svg_board_info { 181 | // Use a frame to display multiple widgets within our widget, 182 | // with an inner margin 183 | response = egui::Frame::none() 184 | .inner_margin(egui::Margin::same(10.0)) 185 | .show(ui, |ui| { 186 | ui.with_layout(egui::Layout::top_down(egui::Align::Center), |ui| { 187 | // let label = egui::RichText::new(this_board.name).strong(); 188 | ui.label(make_field_widget_text( 189 | "Board: ", 190 | ui.style().visuals.warn_fg_color, 191 | this_board.name.as_str(), 192 | ui.style().visuals.window_stroke.color, 193 | )); 194 | // ui.label(label); 195 | let retained_image = RetainedImage::from_color_image( 196 | "pic", 197 | svg_board_info.image, 198 | ); 199 | let _ = retained_image.show_max_size(ui, egui::vec2(150.0, 150.0)); 200 | 201 | }); 202 | ui.horizontal(|ui| { 203 | ui.label(make_field_widget_text( 204 | "Manufacturer: ", 205 | ui.style().visuals.warn_fg_color, 206 | this_board.manufacturer.as_str(), 207 | ui.style().visuals.window_stroke.color, 208 | )); 209 | }); 210 | ui.horizontal(|ui| { 211 | ui.label("Ecosystem: "); 212 | if let Some(standard) = this_board.clone().standard { 213 | ui.label(standard.to_string()); 214 | } else { 215 | ui.label("none"); 216 | } 217 | }); 218 | }).response.interact(egui::Sense::click()); 219 | 220 | 221 | // draw a bounding box for main boards 222 | if this_board.clone().is_main_board() { 223 | ui.painter().rect_stroke(response.rect, 0.0, (1.0, egui::Color32::WHITE)); 224 | } 225 | 226 | } else { 227 | response = ui.allocate_response(egui::vec2(128.0, 128.0), egui::Sense::click()); 228 | } 229 | return response; 230 | } 231 | } 232 | 233 | /// Display the Board as a "mini widget" 234 | pub struct BoardMiniWidget(pub Board); 235 | impl Widget for BoardMiniWidget { 236 | fn ui(self, ui: &mut Ui) -> Response { 237 | let this_board = self.0; 238 | let response: egui::Response; 239 | if let Some(svg_board_info) = this_board.clone().svg_board_info { 240 | // Use a frame to display multiple widgets within our widget, 241 | // with an inner margin 242 | response = egui::Frame::none() 243 | .inner_margin(egui::Margin::same(5.0)) 244 | .show(ui, |ui| { 245 | ui.with_layout(egui::Layout::top_down(egui::Align::Center), |ui| { 246 | ui.label(this_board.clone().name); 247 | let retained_image = RetainedImage::from_color_image( 248 | "pic", 249 | svg_board_info.image, 250 | ); 251 | retained_image.show_max_size(ui, egui::vec2(96.0, 96.0)); 252 | }); 253 | }).response.interact(egui::Sense::click()); 254 | if this_board.clone().is_main_board() { 255 | // draw a bounding box 256 | ui.painter().rect_stroke(response.rect, 0.0, (1.0, egui::Color32::WHITE)); 257 | } 258 | } else { 259 | debug!("could not find color_image when rendering BoardMiniWidget"); 260 | response = ui.allocate_response(egui::vec2(128.0, 128.0), egui::Sense::click()); 261 | } 262 | return response; 263 | } 264 | } 265 | -------------------------------------------------------------------------------- /assets/fonts/Roboto_Mono/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /iron-coder-boards/Adafruit/Feather_RP2040/bsp/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "adafruit-feather-rp2040" 7 | version = "0.6.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "600aa82d1316cf5b3a9d9f008a025fb0ea9e33669054d36f69baf24c08f9babd" 10 | dependencies = [ 11 | "cortex-m", 12 | "cortex-m-rt", 13 | "rp2040-boot2", 14 | "rp2040-hal", 15 | ] 16 | 17 | [[package]] 18 | name = "arrayvec" 19 | version = "0.7.4" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" 22 | 23 | [[package]] 24 | name = "bare-metal" 25 | version = "0.2.5" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" 28 | dependencies = [ 29 | "rustc_version", 30 | ] 31 | 32 | [[package]] 33 | name = "bitfield" 34 | version = "0.13.2" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" 37 | 38 | [[package]] 39 | name = "bytemuck" 40 | version = "1.13.1" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" 43 | 44 | [[package]] 45 | name = "cortex-m" 46 | version = "0.7.7" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" 49 | dependencies = [ 50 | "bare-metal", 51 | "bitfield", 52 | "embedded-hal 0.2.7", 53 | "volatile-register", 54 | ] 55 | 56 | [[package]] 57 | name = "cortex-m-rt" 58 | version = "0.7.3" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "ee84e813d593101b1723e13ec38b6ab6abbdbaaa4546553f5395ed274079ddb1" 61 | dependencies = [ 62 | "cortex-m-rt-macros", 63 | ] 64 | 65 | [[package]] 66 | name = "cortex-m-rt-macros" 67 | version = "0.7.0" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "f0f6f3e36f203cfedbc78b357fb28730aa2c6dc1ab060ee5c2405e843988d3c7" 70 | dependencies = [ 71 | "proc-macro2", 72 | "quote", 73 | "syn", 74 | ] 75 | 76 | [[package]] 77 | name = "crc-any" 78 | version = "2.4.3" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "774646b687f63643eb0f4bf13dc263cb581c8c9e57973b6ddf78bda3994d88df" 81 | dependencies = [ 82 | "debug-helper", 83 | ] 84 | 85 | [[package]] 86 | name = "critical-section" 87 | version = "1.1.1" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | checksum = "6548a0ad5d2549e111e1f6a11a6c2e2d00ce6a3dafe22948d67c2b443f775e52" 90 | 91 | [[package]] 92 | name = "debug-helper" 93 | version = "0.3.13" 94 | source = "registry+https://github.com/rust-lang/crates.io-index" 95 | checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" 96 | 97 | [[package]] 98 | name = "either" 99 | version = "1.8.1" 100 | source = "registry+https://github.com/rust-lang/crates.io-index" 101 | checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" 102 | 103 | [[package]] 104 | name = "embedded-dma" 105 | version = "0.2.0" 106 | source = "registry+https://github.com/rust-lang/crates.io-index" 107 | checksum = "994f7e5b5cb23521c22304927195f236813053eb9c065dd2226a32ba64695446" 108 | dependencies = [ 109 | "stable_deref_trait", 110 | ] 111 | 112 | [[package]] 113 | name = "embedded-hal" 114 | version = "0.2.7" 115 | source = "registry+https://github.com/rust-lang/crates.io-index" 116 | checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" 117 | dependencies = [ 118 | "nb 0.1.3", 119 | "void", 120 | ] 121 | 122 | [[package]] 123 | name = "embedded-hal" 124 | version = "1.0.0-alpha.10" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "f65c4d073f5d91c66e629b216818a4c9747eeda0debedf2deda9a0a947e4e93b" 127 | 128 | [[package]] 129 | name = "embedded-hal-nb" 130 | version = "1.0.0-alpha.2" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | checksum = "1465fffd56a95bbc105c17965bca1c1d5815027b1cc6bb183bc05d04563d065c" 133 | dependencies = [ 134 | "embedded-hal 1.0.0-alpha.10", 135 | "nb 1.1.0", 136 | ] 137 | 138 | [[package]] 139 | name = "fugit" 140 | version = "0.3.7" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" 143 | dependencies = [ 144 | "gcd", 145 | ] 146 | 147 | [[package]] 148 | name = "gcd" 149 | version = "2.3.0" 150 | source = "registry+https://github.com/rust-lang/crates.io-index" 151 | checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" 152 | 153 | [[package]] 154 | name = "iron-coder-feather-rp2040-bsp" 155 | version = "0.1.0" 156 | dependencies = [ 157 | "adafruit-feather-rp2040", 158 | "cortex-m", 159 | "critical-section", 160 | "embedded-hal 0.2.7", 161 | "fugit", 162 | "rp2040-hal", 163 | "rtt-target", 164 | "shared-bus", 165 | "smart-leds", 166 | "usb-device", 167 | "usbd-serial", 168 | "ws2812-pio", 169 | ] 170 | 171 | [[package]] 172 | name = "itertools" 173 | version = "0.10.5" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 176 | dependencies = [ 177 | "either", 178 | ] 179 | 180 | [[package]] 181 | name = "nb" 182 | version = "0.1.3" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" 185 | dependencies = [ 186 | "nb 1.1.0", 187 | ] 188 | 189 | [[package]] 190 | name = "nb" 191 | version = "1.1.0" 192 | source = "registry+https://github.com/rust-lang/crates.io-index" 193 | checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" 194 | 195 | [[package]] 196 | name = "num_enum" 197 | version = "0.5.11" 198 | source = "registry+https://github.com/rust-lang/crates.io-index" 199 | checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" 200 | dependencies = [ 201 | "num_enum_derive", 202 | ] 203 | 204 | [[package]] 205 | name = "num_enum_derive" 206 | version = "0.5.11" 207 | source = "registry+https://github.com/rust-lang/crates.io-index" 208 | checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" 209 | dependencies = [ 210 | "proc-macro2", 211 | "quote", 212 | "syn", 213 | ] 214 | 215 | [[package]] 216 | name = "paste" 217 | version = "1.0.13" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" 220 | 221 | [[package]] 222 | name = "pio" 223 | version = "0.2.1" 224 | source = "registry+https://github.com/rust-lang/crates.io-index" 225 | checksum = "76e09694b50f89f302ed531c1f2a7569f0be5867aee4ab4f8f729bbeec0078e3" 226 | dependencies = [ 227 | "arrayvec", 228 | "num_enum", 229 | "paste", 230 | ] 231 | 232 | [[package]] 233 | name = "proc-macro2" 234 | version = "1.0.64" 235 | source = "registry+https://github.com/rust-lang/crates.io-index" 236 | checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" 237 | dependencies = [ 238 | "unicode-ident", 239 | ] 240 | 241 | [[package]] 242 | name = "quote" 243 | version = "1.0.29" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" 246 | dependencies = [ 247 | "proc-macro2", 248 | ] 249 | 250 | [[package]] 251 | name = "rand_core" 252 | version = "0.6.4" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 255 | 256 | [[package]] 257 | name = "rgb" 258 | version = "0.8.36" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "20ec2d3e3fc7a92ced357df9cebd5a10b6fb2aa1ee797bf7e9ce2f17dffc8f59" 261 | dependencies = [ 262 | "bytemuck", 263 | ] 264 | 265 | [[package]] 266 | name = "rp2040-boot2" 267 | version = "0.2.1" 268 | source = "registry+https://github.com/rust-lang/crates.io-index" 269 | checksum = "3c773ec49b836077aa144b58dc7654a243e1eecdb6cf0d25361ae7c7600fabd8" 270 | dependencies = [ 271 | "crc-any", 272 | ] 273 | 274 | [[package]] 275 | name = "rp2040-hal" 276 | version = "0.8.2" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "1369bb84862d7f69391a96606b2f29a00bfce7f29a749e23d5f01fc3f607ada0" 279 | dependencies = [ 280 | "cortex-m", 281 | "critical-section", 282 | "embedded-dma", 283 | "embedded-hal 0.2.7", 284 | "embedded-hal 1.0.0-alpha.10", 285 | "embedded-hal-nb", 286 | "fugit", 287 | "itertools", 288 | "nb 1.1.0", 289 | "paste", 290 | "pio", 291 | "rand_core", 292 | "rp2040-hal-macros", 293 | "rp2040-pac", 294 | "usb-device", 295 | "vcell", 296 | "void", 297 | ] 298 | 299 | [[package]] 300 | name = "rp2040-hal-macros" 301 | version = "0.1.0" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | checksum = "86479063e497efe1ae81995ef9071f54fd1c7427e04d6c5b84cde545ff672a5e" 304 | dependencies = [ 305 | "cortex-m-rt", 306 | "proc-macro2", 307 | "quote", 308 | "syn", 309 | ] 310 | 311 | [[package]] 312 | name = "rp2040-pac" 313 | version = "0.4.0" 314 | source = "registry+https://github.com/rust-lang/crates.io-index" 315 | checksum = "9192cafbb40d717c9e0ddf767aaf9c69fee1b4e48d22ed853b57b11f6d9f3d7e" 316 | dependencies = [ 317 | "cortex-m", 318 | "cortex-m-rt", 319 | "vcell", 320 | ] 321 | 322 | [[package]] 323 | name = "rtt-target" 324 | version = "0.4.0" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "3afa12c77ba1b9bf560e4039a9b9a08bb9cde0e9e6923955eeb917dd8d5cf303" 327 | dependencies = [ 328 | "critical-section", 329 | "ufmt-write", 330 | ] 331 | 332 | [[package]] 333 | name = "rustc_version" 334 | version = "0.2.3" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 337 | dependencies = [ 338 | "semver", 339 | ] 340 | 341 | [[package]] 342 | name = "semver" 343 | version = "0.9.0" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 346 | dependencies = [ 347 | "semver-parser", 348 | ] 349 | 350 | [[package]] 351 | name = "semver-parser" 352 | version = "0.7.0" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 355 | 356 | [[package]] 357 | name = "shared-bus" 358 | version = "0.2.5" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "05f8438a40b91c8b9531c664e9680c55b92bd78cd6809a8b45b4512b1e5765f2" 361 | dependencies = [ 362 | "embedded-hal 0.2.7", 363 | "nb 0.1.3", 364 | ] 365 | 366 | [[package]] 367 | name = "smart-leds" 368 | version = "0.3.0" 369 | source = "registry+https://github.com/rust-lang/crates.io-index" 370 | checksum = "38dd45fa275f70b4110eac5f5182611ad384f88bb22b68b9a9c3cafd7015290b" 371 | dependencies = [ 372 | "smart-leds-trait", 373 | ] 374 | 375 | [[package]] 376 | name = "smart-leds-trait" 377 | version = "0.2.1" 378 | source = "registry+https://github.com/rust-lang/crates.io-index" 379 | checksum = "ebf6d833fa93f16a1c1874e62c2aebe8567e5bdd436d59bf543ed258b6f7a8e3" 380 | dependencies = [ 381 | "rgb", 382 | ] 383 | 384 | [[package]] 385 | name = "stable_deref_trait" 386 | version = "1.2.0" 387 | source = "registry+https://github.com/rust-lang/crates.io-index" 388 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 389 | 390 | [[package]] 391 | name = "syn" 392 | version = "1.0.109" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 395 | dependencies = [ 396 | "proc-macro2", 397 | "quote", 398 | "unicode-ident", 399 | ] 400 | 401 | [[package]] 402 | name = "ufmt-write" 403 | version = "0.1.0" 404 | source = "registry+https://github.com/rust-lang/crates.io-index" 405 | checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" 406 | 407 | [[package]] 408 | name = "unicode-ident" 409 | version = "1.0.10" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" 412 | 413 | [[package]] 414 | name = "usb-device" 415 | version = "0.2.9" 416 | source = "registry+https://github.com/rust-lang/crates.io-index" 417 | checksum = "1f6cc3adc849b5292b4075fc0d5fdcf2f24866e88e336dd27a8943090a520508" 418 | 419 | [[package]] 420 | name = "usbd-serial" 421 | version = "0.1.1" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | checksum = "db75519b86287f12dcf0d171c7cf4ecc839149fe9f3b720ac4cfce52959e1dfe" 424 | dependencies = [ 425 | "embedded-hal 0.2.7", 426 | "nb 0.1.3", 427 | "usb-device", 428 | ] 429 | 430 | [[package]] 431 | name = "vcell" 432 | version = "0.1.3" 433 | source = "registry+https://github.com/rust-lang/crates.io-index" 434 | checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" 435 | 436 | [[package]] 437 | name = "void" 438 | version = "1.0.2" 439 | source = "registry+https://github.com/rust-lang/crates.io-index" 440 | checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 441 | 442 | [[package]] 443 | name = "volatile-register" 444 | version = "0.2.1" 445 | source = "registry+https://github.com/rust-lang/crates.io-index" 446 | checksum = "9ee8f19f9d74293faf70901bc20ad067dc1ad390d2cbf1e3f75f721ffee908b6" 447 | dependencies = [ 448 | "vcell", 449 | ] 450 | 451 | [[package]] 452 | name = "ws2812-pio" 453 | version = "0.6.0" 454 | source = "registry+https://github.com/rust-lang/crates.io-index" 455 | checksum = "7d219e3b43c1e14305b36363060c0348d560314e235d999cf492bbbab1f38e8d" 456 | dependencies = [ 457 | "cortex-m", 458 | "embedded-hal 0.2.7", 459 | "fugit", 460 | "nb 1.1.0", 461 | "pio", 462 | "rp2040-hal", 463 | "smart-leds-trait", 464 | ] 465 | --------------------------------------------------------------------------------