Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
14d0a9d
Initial Commit
siny-over-cosy Oct 14, 2024
4644a57
Merge branch 'main' into yu-lei/hype-30-implement-led-driver
siny-over-cosy Oct 21, 2024
250436f
added register addresses
siny-over-cosy Oct 27, 2024
9b6a600
SNS - I2C Temperature (HYPE-14) (#12)
davidbeechey Oct 15, 2024
dc4d615
SNS - Keyence (HYPE-12) (#6)
davidbeechey Oct 15, 2024
2d4a56a
Update README (#37)
davidbeechey Oct 23, 2024
0db24f5
SNS - Create `HypedSpi` trait (#38)
davidbeechey Oct 25, 2024
cb41fd4
INFRA - Add STM32F767ZI board support (#35)
davidbeechey Oct 25, 2024
5c2985f
SNS - Create `MockI2c` (and temperature sensor tests) (#39)
davidbeechey Oct 28, 2024
04a61fa
Added LED colour control function (work in progress)
siny-over-cosy Oct 31, 2024
84c3b71
Added LED colour setting function (work in progress)
siny-over-cosy Oct 31, 2024
29e12b9
Added bank-control-setting for LEDs and modified function new().
siny-over-cosy Nov 8, 2024
bfe231b
Added reset LEDs function
siny-over-cosy Nov 12, 2024
e1cc692
Written tests for all functions
siny-over-cosy Nov 16, 2024
11f3f6b
Written tests for all functions
siny-over-cosy Nov 16, 2024
a0987cf
Written tests for all functions
siny-over-cosy Nov 16, 2024
d7aa0db
Test debugging change - ignore
siny-over-cosy Nov 16, 2024
d0dfbab
changed test reset values
siny-over-cosy Nov 16, 2024
74c4d50
Changed reset test to only check value of reset register
siny-over-cosy Nov 16, 2024
4e1fab8
Ran cargo fmt
siny-over-cosy Nov 16, 2024
7d31131
Merge branch 'main' into yu-lei/hype-30-implement-led-driver
siny-over-cosy Nov 16, 2024
1aa8f9e
Resolving merge conflicts
siny-over-cosy Nov 16, 2024
28e18c4
Resolving merge conflicts 2
siny-over-cosy Nov 16, 2024
81fd9fc
Added documentation
siny-over-cosy Nov 25, 2024
c7bb2bd
Created LED driver task
siny-over-cosy Nov 25, 2024
968813b
Added led_driver
siny-over-cosy Nov 25, 2024
71c149f
Fixed all_led_config1 test value
siny-over-cosy Nov 25, 2024
0abd2ba
Fixed string concatenation in test
siny-over-cosy Nov 25, 2024
663843c
no change
siny-over-cosy Jan 13, 2025
2c6236f
added looping LED flash test
siny-over-cosy Jan 13, 2025
05b34b4
reformatted things
siny-over-cosy Jan 13, 2025
8d723f3
fixed match type error
siny-over-cosy Jan 13, 2025
8f8f56f
fix formatting errors
siny-over-cosy Jan 13, 2025
c6b7eef
fixed formatting errors 2
siny-over-cosy Jan 13, 2025
5c11275
fixed formatting errors 3
siny-over-cosy Jan 13, 2025
3494d58
fixed formatting errors 5 (i think)
siny-over-cosy Jan 13, 2025
d87a05a
fixed formatting errors 6
siny-over-cosy Jan 13, 2025
2b46a7a
fixed formatting errors 7
siny-over-cosy Jan 13, 2025
8070879
added line at end of file
siny-over-cosy Jan 13, 2025
7f4e76a
fixed typos
siny-over-cosy Jan 13, 2025
7e44580
enumerated LED_CONFIGx addresses
siny-over-cosy Jan 16, 2025
a2da7d1
enumerated LED_CONFIGx addresses
siny-over-cosy Jan 16, 2025
e0f5ce0
fixed formatting issues
siny-over-cosy Jan 16, 2025
73bf218
fixed formatting issues 2
siny-over-cosy Jan 16, 2025
2d8e67c
fixed formatting issues
siny-over-cosy Jan 16, 2025
ee9e415
fixed formatting issues 4
siny-over-cosy Jan 16, 2025
03470e7
fixed formatting issues 5
siny-over-cosy Jan 16, 2025
753bf95
fixed mismatched type in set_led_colour() test
siny-over-cosy Jan 16, 2025
9f7a4f2
modified type for led_configx argument in set_led_colour()
siny-over-cosy Jan 16, 2025
09ab498
modified LedConfig0 argument type
siny-over-cosy Jan 16, 2025
ce58eef
formatting errors 5
siny-over-cosy Jan 16, 2025
b156ffd
formatting errors 6
siny-over-cosy Jan 16, 2025
856085f
updated documentation
siny-over-cosy Jan 16, 2025
ac70349
fixed documentation formatting error
siny-over-cosy Jan 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
with:
key: ${{ matrix.board }}
- run: cargo build --verbose
working-directory: boards/${{ matrix.board }}
working-directory: boards/${{ matrix.board }}
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ exclude = [
"boards/stm32f767zi",
"boards/stm32l432kc",
]
resolver = "2"
resolver = "2"
1 change: 1 addition & 0 deletions boards/stm32l476rg/src/tasks.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pub mod keyence;
pub mod led_driver;
pub mod temperature;
45 changes: 45 additions & 0 deletions boards/stm32l476rg/src/tasks/led_driver.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
use crate::io::i2c::Stm32l476rgI2c;
use defmt_rtt as _;
use embassy_stm32::i2c::I2c;
use embassy_stm32::time::Hertz;
use hyped_sensors::led_driver::{LedDriver, LedDriverAddresses, LedDriverConfigAddresses};

#[embassy_executor::task]
pub async fn write_led() -> ! {
let p = embassy_stm32::init(Default::default());
let i2c = I2c::new_blocking(p.I2C1, p.PB8, p.PB9, Hertz(100_000), Default::default());
let mut hyped_i2c = Stm32l476rgI2c::new(i2c);

let mut led_driver_sensor = LedDriver::new(&mut hyped_i2c, LedDriverAddresses::Address30)
.expect("Failed to create LED driver instance. Check wiring and I2C address of component.");

const DRIVER_ADDRESSES: [u8; 8] = [0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF];
let mut index = 0;

loop {
// flash each LED in sequence
if index == 8 {
// reset LED Driver after flashing 8th test LED
match led_driver_sensor.reset() {
Ok(_) => (),
Err(_) => {
defmt::error!("Failed to reset LED Driver");
}
};
}
match led_driver_sensor.set_led_colour(
LedDriverConfigAddresses::LedConfig0,
DRIVER_ADDRESSES[index],
0xFF,
0xFF,
0xFF,
0xFF,
) {
Ok(_) => (),
Err(_) => {
defmt::error!("Failed to set colour of LED.");
}
};
index += 1;
}
}
234 changes: 0 additions & 234 deletions lib/core/Cargo.lock

This file was deleted.

Loading