Commit b32b9361 authored by Astro's avatar Astro
Browse files

rm old crates

parent ae2ee4f3
Pipeline #3019 failed with stage
in 4 minutes and 45 seconds
......@@ -26,11 +26,8 @@ rename with the `.elf` extension!
| Crate | Description |
| ---- | --- |
| card10 | Helpers for implementing custom firmwares |
| example | l0dable example |
| l0dable | Helpers for building l0dables |
| max32665 | Peripheral Access Crate for implementing your own drivers |
| watchapp | Sample firmware |
## TODO
......
[package]
edition = "2018"
name = "card10"
version = "0.0.0"
authors = ["Astro <astro@spaceboyz.net>"]
[dependencies]
max32665 = { path = "../max32665", features = ["rt"] }
cortex-m-rt = { version = "0.6", features = ["device"] }
[build-dependencies]
cc = "1.0"
use std::env;
use std::fs::File;
use std::io::Write;
use std::path::PathBuf;
fn main() {
println!("cargo:rerun-if-changed=build.rs");
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
File::create(out.join("memory.x"))
.unwrap()
.write_all(include_bytes!("memory.x"))
.unwrap();
println!("cargo:rustc-link-search={}", out.display());
println!("cargo:rerun-if-changed=memory.x");
cc::Build::new()
.target("thumbv7em-none-eabihf")
.compiler("arm-none-eabihf-gcc")
.define("TARGET", "MAX32665")
.define("TARGET_UC", "MAX32665")
.define("TARGET_LC", "max32665")
.define("TARGET_REV", "0x4131")
.define("BOARD", "card10")
.opt_level_str("s")
.debug(true)
.pic(false)
.include("../c/lib/card10")
.include("../c/lib/gfx")
.include("../c/lib/gfx/GUI_DEV")
.include("../c/lib/gfx/LCD")
.include("../c/lib/gfx/Fonts")
.include("../c/lib/vendor/Bosch/BHy1/driver/inc")
.include("../c/lib/vendor/Bosch/BHy1/examples/firmware")
.include("../c/lib/vendor/Bosch/BME680")
.include("../c/lib/vendor/Bosch/BMA400")
.include("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Include")
.include("../c/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include")
.include("../c/lib/sdk/Libraries/CMSIS/Include")
.include("../c/lib/sdk/Libraries/Boards/card10/Include")
.include("../c/lib/vendor/Maxim/MAX77650")
.include("../c/lib/sdk/Libraries/Boards/Include")
.file("../c/lib/card10/card10.c")
.file("../c/lib/card10/pb.c")
.file("../c/lib/card10/pmic.c")
.file("../c/lib/card10/portexpander.c")
.file("../c/lib/card10/leds.c")
.file("../c/lib/card10/bosch.c")
.file("../c/lib/card10/display.c")
.file("../c/lib/gfx/LCD/LCD_Driver.c")
.file("../c/lib/gfx/GUI_DEV/DEV_Config.c")
.file("../c/lib/gfx/GUI_DEV/GUI_Paint.c")
.file("../c/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/system_max32665.c")
.file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/i2c.c")
.file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/gpio.c")
.file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/tmr.c")
.file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/tmr_utils.c")
.file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/rtc.c")
.file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/spi.c")
.file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/spi17y.c")
.file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/mxc_delay.c")
.file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/mxc_lock.c")
.file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/mxc_sys.c")
.file("../c/lib/sdk/Libraries/MAX32665PeriphDriver/Source/mxc_pins.c")
.file("../c/lib/sdk/Libraries/Boards/card10/Source/board.c")
// .file("../c/lib/sdk/Libraries/Boards/Source/stdio.c")
.file("../c/lib/vendor/Bosch/BMA400/bma400.c")
.file("../c/lib/vendor/Bosch/BME680/bme680.c")
.file("../c/lib/vendor/Bosch/BHy1/driver/src/bhy.c")
.file("../c/lib/vendor/Bosch/BHy1/driver/src/bhy_uc_driver.c")
.file("../c/lib/vendor/Bosch/BHy1/driver/src/bhy_support.c")
.file("../c/lib/vendor/Maxim/MAX77650/MAX77650-Arduino-Library.c")
.compile("card10");
}
MEMORY {
SPIX (rx) : ORIGIN = 0x08000000, LENGTH = 128M
FLASH (rx) : ORIGIN = 0x10010000, LENGTH = 960k
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 512k
SPID (r) : ORIGIN = 0x80000000, LENGTH = 512M
}
SECTIONS
{
/DISCARD/ :
{
/* cortex-m-rt's link.x drops only `.ARM.exidx.*` */
*(.ARM.exidx);
}
}
#[link(name = "card10")]
extern {
fn LCD_SetBacklight(brightness: usize);
fn LCD_Clear(color: usize);
fn LCD_ClearWindow(xstart: usize, ystart: usize, xend: usize, yend: usize, color: usize);
fn LCD_SetWindowColor(xstart: usize, ystart: usize, xend: usize, yend: usize, color: usize);
fn LCD_SetUWORD(x: usize, y: usize, color: usize);
fn LCD_Update();
}
pub const W: usize = 160;
pub const H: usize = 80;
pub fn set_backlight(brightness: usize) {
unsafe {
LCD_SetBacklight(brightness);
}
}
pub fn put_pixel(x: usize, y: usize, color: usize) {
unsafe {
LCD_SetUWORD(x, y, color);
}
}
pub fn update() {
unsafe {
LCD_Update();
}
}
#[link(name = "card10")]
extern {
fn leds_init();
fn leds_update();
fn leds_set_dim(led: u8,dim: u8);
fn leds_set(led: u8,r: u8,g: u8,b: u8);
fn leds_set_hsv(led: u8, h: f32, s: f32, v: f32);
}
pub struct Leds;
impl Leds {
pub fn new() -> Self {
unsafe { leds_init(); }
Leds
}
pub fn len(&self) -> usize {
15
}
pub fn led(&self, idx: usize) -> Led {
Led { idx }
}
pub fn iter(&self) -> impl Iterator<Item=Led> {
(0..self.len()).map(|idx| Led { idx })
}
pub fn update(&self) {
unsafe { leds_update(); }
}
}
pub struct Led {
idx: usize,
}
impl Led {
pub fn set_dim(&self, dim: u8) {
unsafe { leds_set_dim(self.idx as u8, dim); }
}
pub fn set(&self, r: u8, g: u8, b: u8) {
unsafe { leds_set(self.idx as u8, r, g, b); }
}
pub fn set_hsv(&self, h: f32, s: f32, v: f32) {
unsafe { leds_set_hsv(self.idx as u8, h, s, v); }
}
}
#![no_std]
pub use max32665;
pub use cortex_m_rt as _;
pub use cortex_m_rt::entry;
pub mod lcd;
pub mod leds;
#[link(name = "card10")]
extern {
fn card10_init();
fn card10_diag();
}
#[no_mangle]
pub extern "C" fn puts() {
/* Stub */
}
#[no_mangle]
pub extern "C" fn printf() {
/* Stub */
}
pub fn init() {
unsafe {
card10_init();
card10_diag();
}
}
[package]
edition = "2018"
name = "max32665"
version = "0.0.0"
authors = ["Astro <astro@spaceboyz.net>"]
description = "Peripheral Access Crate for the Maxim-Integrated MAX32665"
keywords = ["cortex-m", "svd2rust", "no_std", "embedded"]
categories = ["embedded", "no-std"]
license = "MIT/Apache-2.0"
[dependencies]
bare-metal = "0.2.4"
vcell = "0.1.0"
cortex-m = ">=0.5.8,<0.7"
[dependencies.cortex-m-rt]
optional = true
version = "0.6.8"
[package.metadata.docs.rs]
features = ['rt']
[features]
default = []
rt = ["cortex-m-rt/device"]
use std::env;
use std::fs::File;
use std::io::Write;
use std::path::PathBuf;
fn main() {
if env::var_os("CARGO_FEATURE_RT").is_some() {
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
File::create(out.join("device.x"))
.unwrap()
.write_all(include_bytes!("device.x"))
.unwrap();
println!("cargo:rustc-link-search={}", out.display());
println!("cargo:rerun-if-changed=device.x");
}
println!("cargo:rerun-if-changed=build.rs");
}
PROVIDE(WDT0 = DefaultHandler);
PROVIDE(USB = DefaultHandler);
PROVIDE(RTC = DefaultHandler);
PROVIDE(TRNG = DefaultHandler);
PROVIDE(TMR0 = DefaultHandler);
PROVIDE(TMR1 = DefaultHandler);
PROVIDE(TMR2 = DefaultHandler);
PROVIDE(TMR3 = DefaultHandler);
PROVIDE(TMR4 = DefaultHandler);
PROVIDE(TMR5 = DefaultHandler);
PROVIDE(I2C0 = DefaultHandler);
PROVIDE(UART0 = DefaultHandler);
PROVIDE(UART1 = DefaultHandler);
PROVIDE(SPI17Y1 = DefaultHandler);
PROVIDE(SPI17Y2 = DefaultHandler);
PROVIDE(ADC = DefaultHandler);
PROVIDE(FLASH_CONTROLLER = DefaultHandler);
PROVIDE(GPIO0 = DefaultHandler);
PROVIDE(GPIO1 = DefaultHandler);
PROVIDE(GPIO2 = DefaultHandler);
PROVIDE(CRYPTO_ENGINE = DefaultHandler);
PROVIDE(DMA0 = DefaultHandler);
PROVIDE(DMA1 = DefaultHandler);
PROVIDE(DMA2 = DefaultHandler);
PROVIDE(DMA3 = DefaultHandler);
PROVIDE(UART2 = DefaultHandler);
PROVIDE(I2C1 = DefaultHandler);
PROVIDE(SPIXFC = DefaultHandler);
PROVIDE(WAKEUP_TIMER = DefaultHandler);
PROVIDE(SPI0 = DefaultHandler);
PROVIDE(WDT1 = DefaultHandler);
PROVIDE(PT = DefaultHandler);
PROVIDE(SMARTDMA = DefaultHandler);
PROVIDE(I2C2 = DefaultHandler);
PROVIDE(SDHC = DefaultHandler);
PROVIDE(ONEWIRE = DefaultHandler);
PROVIDE(DMA4 = DefaultHandler);
PROVIDE(DMA5 = DefaultHandler);
PROVIDE(DMA6 = DefaultHandler);
PROVIDE(DMA7 = DefaultHandler);
PROVIDE(DMA8 = DefaultHandler);
PROVIDE(DMA9 = DefaultHandler);
PROVIDE(DMA10 = DefaultHandler);
PROVIDE(DMA11 = DefaultHandler);
PROVIDE(DMA12 = DefaultHandler);
PROVIDE(DMA13 = DefaultHandler);
PROVIDE(DMA14 = DefaultHandler);
PROVIDE(DMA15 = DefaultHandler);
PROVIDE(HTIMER = DefaultHandler);
PROVIDE(HTMR1 = DefaultHandler);
This diff is collapsed.
[package]
edition = "2018"
name = "watchapp"
version = "0.0.0"
authors = ["Astro <astro@spaceboyz.net>"]
[dependencies]
card10 = { path = "../card10" }
panic-abort = "0.3.1"
#![no_std]
#![no_main]
use panic_abort as _;
use card10::{entry, lcd, leds::Leds};
#[entry]
fn main() -> ! {
card10::init();
let leds = Leds::new();
lcd::set_backlight(1000);
let mut t = 0;
loop {
for x in 0..lcd::W {
for y in 0..lcd::H {
if (((x - 2 * t) / 8) + ((y + t) / 8)) % 2 == 0 {
lcd::put_pixel(x, y, 0);
} else {
lcd::put_pixel(x, y, 0xffff);
}
}
}
lcd::update();
for led in leds.iter() {
led.set(((t << 2) & 0xFF) as u8, ((t << 1) & 0xFF) as u8, ((t >> 2) & 0xFF) as u8);
}
leds.update();
t += 1;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment