Skip to content

Commit 1b3335a

Browse files
committed
Prepare release
1 parent 09975fa commit 1b3335a

25 files changed

+225
-123
lines changed

.github/workflows/ci.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
target:
12+
- thumbv7em-none-eabi
13+
- x86_64-unknown-linux-gnu
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Install build dependencies
19+
shell: bash
20+
run: |
21+
env && pwd && sudo apt-get update -y -qq && sudo apt-get install -y -qq llvm libc6-dev-i386 libclang-dev
22+
23+
- uses: fiam/arm-none-eabi-gcc@v1
24+
with:
25+
release: "9-2020-q2"
26+
27+
- uses: actions-rs/toolchain@v1
28+
with:
29+
profile: minimal
30+
toolchain: stable
31+
target: ${{ matrix.target }}
32+
override: true
33+
components: llvm-tools-preview
34+
35+
- name: Build
36+
run: cargo build --release --verbose
37+
38+
- name: Build examples
39+
run: make build-examples-verbosely
40+

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
88
- Add INPUTMUX and PINT peripherals
99
- Add example using PINT + INPUTMUX to make an external interrupt on a pin
1010

11+
## [v0.1.0] - 2021-02-26
12+
Stabilize things somewhat
13+
1114
## [v0.0.4] - 2021-02-01
1215
Quick release to use littlefs2-0.1.0
1316

Cargo.toml

+21-42
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lpc55-hal"
3-
version = "0.0.4"
3+
version = "0.1.0"
44
edition = "2018"
55
description = "Hardware Abstraction Layer (HAL) for the NXP LPC55S6x ARM Cortex-33 microcontrollers"
66
repository = "https://github.com/nickray/lpc55-hal"
@@ -16,53 +16,35 @@ build = "build.rs"
1616
targets = []
1717

1818
[dependencies]
19-
bare-metal = "1"
20-
block-buffer = "0.9.0"
21-
block-cipher = "0.8.0"
22-
cortex-m = "0.6"
23-
cortex-m-semihosting = "0.3"
24-
digest = "0.9.0"
19+
block-buffer = "0.9"
20+
cipher = "0.2"
21+
cortex-m = "0.7"
22+
digest = "0.9"
2523
embedded-hal = { version = "0.2", features = ["unproven"] }
26-
generic-array = "0.14.3"
27-
# incompatibility of cortex-m 0.7 (in pac 0.1.1) with RTIC
28-
lpc55-pac = "=0.1.0"
29-
24+
generic-array = "0.14.2"
25+
lpc55-pac = "0.3"
3026
nb = "1"
31-
# no-panic = "0.1.12"
32-
# nom = { version = "^5", default-features = false }
33-
cortex-m-rtic = { version = "0.5.1", optional = true }
34-
littlefs2 = { version = "0.1.0", optional = true }
35-
rand_core = "0.5.1"
36-
usb-device = "0.2.3"
37-
usbd-serial = "0.1.0"
38-
vcell = "0.1.2"
27+
rand_core = "0.6"
28+
usb-device = "0.2"
29+
vcell = "0.1"
3930
void = { version = "1", default-features = false }
40-
aligned = "0.3.2"
41-
# enum_dispatch = { git = "https://gitlab.com/antonok/enum_dispatch" }
42-
# salty = { path = "../salty", features = ["haase"] }
31+
32+
# optional dependencies
33+
cortex-m-rtic = { version = "0.5", optional = true }
34+
littlefs2 = { version = "0.2.1", optional = true }
4335

4436
[dev-dependencies]
45-
aes-soft = "0.4"
37+
aes-soft = "0.6"
4638
cortex-m-rt = "0.6"
47-
cortex-m-rtic = "0.5.1"
39+
cortex-m-rtic = "0.5"
4840
cortex-m-semihosting = "0.3"
49-
# ga14 = { package = "generic-array", version = "0.14" }
50-
# digest = { version = "0.8", default-features = false }
51-
heapless = "0.5"
41+
heapless = "0.6"
5242
panic-halt = "0.2"
5343
panic-semihosting = { version = "0.5", features = ["jlink-quirks"] }
54-
# salty = { path = "../salty", features = ["haase"] }
55-
# salty = { path = "../salty", features = ["tweetnacl"] }
56-
sha2 = { version = "0.9.1", default-features = false }
57-
ssd1306 = "0.3.0-alpha.2"
58-
sha-1 = { version = "0.9.1", default-features = false }
59-
# ssd1306 = { git = "https://github.com/jamwaffles/ssd1306.git", branch = "70x42-ish" }
60-
# ssd1306 = { path = "../ssd1306-tiny" }
61-
62-
# generic-array = "0.13.2"
63-
# aead = { version = "0.2.0", default-features = false }
64-
# aead = { path = "../RustCrypto/traits/aead", default-features = false, features = ["heapless"] }
65-
# chacha20poly1305 = { version = "0.3.0", default-features = false, features = ["heapless", "xchacha20poly1305"] }
44+
sha2 = { version = "0.9", default-features = false }
45+
ssd1306 = "0.3"
46+
sha-1 = { version = "0.9", default-features = false }
47+
usbd-serial = "0.1"
6648

6749
[features]
6850
default = ["rt"]
@@ -71,9 +53,6 @@ rt = ["lpc55-pac/rt"]
7153
rtic-peripherals = ["cortex-m-rtic"]
7254
# no longer a HAL feature, just for the usb examples
7355
highspeed-usb-example = []
74-
# # Boards
75-
# lpcxpresso55s69 = []
76-
# solo = []
7756

7857
[profile.release]
7958
codegen-units = 1

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Hardware Abstraction Layer (HAL) for [NXP LPC55][nxp-lpc55] series [Cortex-M33][cortex-m33] microcontrollers,
33
written in Rust.
44

5-
[![Build Status][build-image]][build-link]
5+
[![Build Status][github-action-image]][github-action-link]
66
[![crates.io][crates-image]][crates-link]
77
![LICENSE][license-image]
88
[![Documentation][docs-image]][docs-link]
@@ -104,8 +104,8 @@ from the various [STM32 HALs][stm32-rs].
104104

105105
[crates-image]: https://img.shields.io/crates/v/lpc55-hal.svg?style=flat-square
106106
[crates-link]: https://crates.io/crates/lpc55-hal
107-
[build-image]: https://img.shields.io/circleci/build/github/nickray/lpc55-hal/main.svg?style=flat-square
108-
[build-link]: https://circleci.com/gh/nickray/lpc55-hal/tree/main
107+
[github-action-image]: https://github.com/lpc55/lpc55-hal/workflows/build/badge.svg?branch=main
108+
[github-action-link]: https://github.com/lpc55/lpc55-hal/actions
109109
[docs-image]: https://docs.rs/lpc55-hal/badge.svg?style=flat-square
110110
[docs-link]: https://docs.rs/lpc55-hal
111111
[docs-master-image]: https://img.shields.io/badge/docs-master-blue?style=flat-square
@@ -120,4 +120,4 @@ from the various [STM32 HALs][stm32-rs].
120120
[errata]: https://www.nxp.com/docs/en/errata/ES_LPC55S6x.pdf
121121
[genericuserguide]: https://static.docs.arm.com/100235/0004/arm_cortex_m33_dgug_100235_0004_00_en.pdf
122122
[evkusermanual]: https://www.nxp.com/webapp/Download?colCode=UM11158
123-
[rust_install_manual]: https://rust-embedded.github.io/book/intro/install.html
123+
[rust_install_manual]: https://rust-embedded.github.io/book/intro/install.html

examples/aes.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ use hal::prelude::*;
1414
#[allow(unused_imports)]
1515
use lpc55_hal as hal;
1616

17-
use aes_soft::block_cipher::{BlockCipher, NewBlockCipher};
17+
use aes_soft::cipher::{BlockCipher, NewBlockCipher};
1818

19-
use block_cipher::BlockCipher as _;
2019
use generic_array::GenericArray;
2120

2221
use cortex_m_semihosting::{dbg, hprintln};

examples/external_interrupts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![no_main]
22
#![no_std]
33

4-
use panic_semihosting; // 4004 bytes
4+
use panic_semihosting as _; // 4004 bytes
55
// extern crate panic_halt; // 672 bytes
66

77
// #[macro_use(block)]
@@ -75,4 +75,4 @@ fn main() -> ! {
7575
}
7676

7777
}
78-
}
78+
}

examples/flash.rs

+4-25
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,8 @@ use cortex_m_semihosting::{dbg, hprintln};
88
use lpc55_hal as hal;
99
use hal::prelude::*;
1010

11-
macro_rules! dbgx {
12-
() => {
13-
$crate::hprintln!("[{}:{}]", file!(), line!()).unwrap();
14-
};
15-
($val:expr) => {
16-
// Use of `match` here is intentional because it affects the lifetimes
17-
// of temporaries - https://stackoverflow.com/a/48732525/1063961
18-
match $val {
19-
tmp => {
20-
$crate::hprintln!("[{}:{}] {} = {:#x}",
21-
file!(), line!(), stringify!($val), &tmp).unwrap();
22-
tmp
23-
}
24-
}
25-
};
26-
// Trailing comma with single argument is ignored
27-
($val:expr,) => { $crate::dbg!($val) };
28-
($($val:expr),+ $(,)?) => {
29-
($($crate::dbg!($val)),+,)
30-
};
31-
}
32-
3311
#[repr(C)]
12+
#[allow(dead_code)]
3413
enum FlashCommands {
3514
Init = 0x0,
3615
PowerDown = 0x1,
@@ -62,7 +41,7 @@ fn main() -> ! {
6241
let mut pmc = hal.pmc;
6342
let mut syscon = hal.syscon;
6443

65-
let clocks = hal::ClockRequirements::default()
44+
hal::ClockRequirements::default()
6645
.system_frequency(12.mhz())
6746
.configure(&mut anactrl, &mut pmc, &mut syscon)
6847
.unwrap();
@@ -169,15 +148,15 @@ fn main() -> ! {
169148
hprintln!("{:#034x}", flash.read_u128(0x4_0000)).ok();
170149

171150
dbg!("after writing");
172-
flash.write_u32(WHERE, 0x1234_5678);
151+
flash.write_u32(WHERE, 0x1234_5678).unwrap();
173152
hprintln!("{:#034x}", flash.read_u128(0x4_0000)).ok();
174153

175154
dbg!("after erasing again");
176155
flash.erase_page(WHERE >> 4).unwrap();
177156
hprintln!("{:#034x}", flash.read_u128(0x4_0000)).ok();
178157

179158
dbg!("after writing with offset 4");
180-
flash.write_u32(WHERE + 4, 0x1234_5678);
159+
flash.write_u32(WHERE + 4, 0x1234_5678).unwrap();
181160
hprintln!("{:#034x}", flash.read_u128(0x4_0000)).ok();
182161

183162
hprintln!("{:#034x}", flash.read_u128(0x4_0010)).ok();

examples/itm.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
extern crate panic_semihosting;
55
use cortex_m::iprintln;
66
use cortex_m_rt::entry;
7-
use cortex_m_semihosting::{dbg, hprintln};
7+
use cortex_m_semihosting::hprintln;
88

99
use hal::prelude::*;
1010
use lpc55_hal as hal;
@@ -56,20 +56,20 @@ fn main() -> ! {
5656
.into_gpio_pin(&mut iocon, &mut gpio)
5757
.into_output(hal::drivers::pins::Level::High); // start turned off
5858

59-
let clocks = hal::ClockRequirements::default()
59+
hal::ClockRequirements::default()
6060
// .support_usbfs()
6161
.system_frequency(12.mhz())
6262
.configure(&mut anactrl, &mut pmc, &mut syscon)
6363
.unwrap();
6464

6565
loop {
66-
for i in 0..10_000 {
66+
for _ in 0..10_000 {
6767
red.set_low().unwrap();
6868
}
6969
iprintln!(stim, "led on");
7070
// hprintln!("printed led on");
7171

72-
for i in 0..10_000 {
72+
for _ in 0..10_000 {
7373
red.set_high().unwrap();
7474
}
7575
iprintln!(stim, "led off");

examples/prince.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn main() -> ! {
5454
flash.erase_page((DATA_ADDR/512) + 0).unwrap();
5555
flash.erase_page((DATA_ADDR/512) + 1).unwrap();
5656

57-
prince.write_encrypted(|prince| {
57+
prince.write_encrypted(|_prince| {
5858
let vector = [0xAA; 1024];
5959
flash.write(DATA_ADDR, &vector).unwrap();
6060
});
File renamed without changes.

examples/semihosting.rs.hidden examples/semihosting.rs

-9
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,7 @@ fn main() -> ! {
6767
let DIEID: *mut u32 = 0x4000_0ffc as *mut u32;
6868
hprintln!("{:x?}", unsafe { DIEID.read_volatile() }).unwrap();
6969

70-
dbg!(peripherals.SYSCON.device_id0.read().flash_size().bits());
71-
dbg!(peripherals
72-
.SYSCON
73-
.device_id0
74-
.read()
75-
.modelnum_extention()
76-
.bits());
77-
dbg!(peripherals.SYSCON.device_id0.read().partconfig().bits());
7870
dbg!(peripherals.SYSCON.device_id0.read().rom_rev_minor().bits());
79-
dbg!(peripherals.SYSCON.device_id0.read().sram_size().bits());
8071

8172
dbg!("Entering the endless loop...");
8273
loop {

examples/touch.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use hal::{
1717
drivers::{
1818
Pins,
1919
Timer,
20-
timer::Lap,
2120
touch::{
2221
TouchSensorChannel,
2322
TouchSensor,
@@ -27,10 +26,9 @@ use hal::{
2726
}
2827
},
2928
};
29+
use hal::drivers::pins::Level;
3030
pub use hal::typestates::pin::state;
3131

32-
use hal::{drivers::pins::Level, prelude::*};
33-
3432

3533
#[entry]
3634
fn main() -> ! {
@@ -95,8 +93,8 @@ fn main() -> ! {
9593
profile_touch_sensing(&mut touch_sensor, &mut delay_timer, &mut results, &mut times );
9694
for i in 0 .. 125 {
9795
let src = (results[i] & (0xf << 24)) >> 24;
98-
let sample_num = (times[i] - 1196)/802;
99-
let button_sample_num = (times[i] - 1192)/(802* 3);
96+
let _sample_num = (times[i] - 1196)/802;
97+
let _button_sample_num = (times[i] - 1192)/(802* 3);
10098
// heprintln!("{}",src).unwrap();
10199
// heprintln!("{}\t{}\t{}\t{}\t{}\t{}",times[i], i, sample_num,src, counts[(src-3) as usize], button_sample_num).unwrap();
102100

examples/usb.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn main() -> ! {
5050
.configure(&mut anactrl, &mut pmc, &mut syscon)
5151
.unwrap();
5252

53-
let mut delay_timer = Timer::new(hal.ctimer.0.enabled(&mut syscon, clocks.support_1mhz_fro_token().unwrap()));
53+
let mut _delay_timer = Timer::new(hal.ctimer.0.enabled(&mut syscon, clocks.support_1mhz_fro_token().unwrap()));
5454

5555
// Can use compile to use either the "HighSpeed" or "FullSpeed" USB peripheral.
5656
// Default is full speed.
@@ -59,7 +59,7 @@ fn main() -> ! {
5959
&mut anactrl,
6060
&mut pmc,
6161
&mut syscon,
62-
&mut delay_timer,
62+
&mut _delay_timer,
6363
clocks.support_usbhs_token()
6464
.unwrap()
6565
);

examples/usb_test_class.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn main() -> ! {
3737
.expect("Clock configuration failed");
3838

3939

40-
let mut delay_timer = Timer::new(hal.ctimer.0.enabled(&mut syscon, clocks.support_1mhz_fro_token().unwrap()));
40+
let mut _delay_timer = Timer::new(hal.ctimer.0.enabled(&mut syscon, clocks.support_1mhz_fro_token().unwrap()));
4141

4242
// Can use compile to use either the "HighSpeed" or "FullSpeed" USB peripheral.
4343
// Default is full speed.
@@ -46,7 +46,7 @@ fn main() -> ! {
4646
&mut anactrl,
4747
&mut pmc,
4848
&mut syscon,
49-
&mut delay_timer,
49+
&mut _delay_timer,
5050
clocks.support_usbhs_token()
5151
.unwrap()
5252
);

0 commit comments

Comments
 (0)