Skip to content

Commit d515b02

Browse files
Merge pull request #137 from FrameworkComputer/examples
More examples
2 parents 5263617 + 74281f3 commit d515b02

File tree

2 files changed

+100
-19
lines changed

2 files changed

+100
-19
lines changed

EXAMPLES.md

+81-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22

33
## Check firmware versions
44

5+
### BIOS (Mainboard, UEFI, EC, PD)
6+
7+
Example on Framework 13 AMD Ryzen AI 300 Series:
8+
9+
```
10+
> framework_tool --versions
11+
Mainboard Hardware
12+
Type: Laptop 13 (AMD Ryzen AI 300 Series)
13+
Revision: MassProduction
14+
UEFI BIOS
15+
Version: 03.00
16+
Release Date: 03/10/2025
17+
EC Firmware
18+
Build version: "lilac-3.0.0-1541dc6 2025-05-05 11:31:24 zoid@localhost"
19+
RO Version: "lilac-3.0.0-1541dc6"
20+
RW Version: "lilac-3.0.0-1541dc6"
21+
Current image: RO
22+
PD Controllers
23+
Right (01)
24+
Main: 0.0.0E (Active)
25+
Backup: 0.0.0E
26+
Left (23)
27+
Main: 0.0.0E (Active)
28+
Backup: 0.0.0E
29+
[...]
30+
```
31+
532
### Camera (Framework 12, Framework 13, Framework 16)
633

734
Example on Framework 12:
@@ -128,21 +155,33 @@ Positions:
128155
## Check temperatures and fan speed
129156

130157
```
131-
> sudo ./target/debug/framework_tool --thermal
158+
> sudo framework_tool --thermal
132159
F75303_Local: 43 C
133160
F75303_CPU: 44 C
134161
F75303_DDR: 39 C
135162
APU: 62 C
136163
Fan Speed: 0 RPM
137164
```
138165

139-
## Check sensors (ALS and G-Sensor)
166+
## Check sensors
167+
168+
### Ambient Light (Framework 13, Framework 16)
140169

141170
```
142-
> sudo ./target/debug/framework_tool --sensors
171+
> sudo framework_tool --sensors
143172
ALS: 76 Lux
144173
```
145174

175+
### Accelerometer (Framework 12)
176+
```
177+
> sudo framework_tool --sensors
178+
ALS: 0 Lux
179+
Accelerometers:
180+
Lid Angle: 122 Deg
181+
Sensor 1: X=+0.00G Y=+0.84G, Z=+0.52G
182+
Sensor 2: X=-0.03G Y=+0.00G, Z=+1.01G
183+
```
184+
146185
## Set custom fan duty/RPM
147186

148187
```
@@ -296,6 +335,45 @@ Battery Status
296335
> sudo framework_tool --charge-current-limit 2000 80
297336
```
298337

338+
## EC Console
339+
340+
```
341+
# Get recent EC console logs and watch for more
342+
> framework_tool.exe --console follow
343+
[53694.741000 Battery 62% (Display 61.1 %) / 3h:18 to empty]
344+
[53715.010000 Battery 62% (Display 61.0 %) / 3h:21 to empty]
345+
[53734.281200 Battery 62% (Display 60.9 %) / 3h:18 to empty]
346+
[53738.037200 Battery 61% (Display 60.9 %) / 3h:6 to empty]
347+
[53752.301500 Battery 61% (Display 60.8 %) / 3h:15 to empty]
348+
```
349+
350+
## Keyboard backlight
351+
352+
```
353+
# Check current keyboard backlight brightness
354+
> framework_tool.exe --kblight
355+
Keyboard backlight: 5%
356+
357+
# Set keyboard backlight brightness
358+
# Off
359+
> framework_tool.exe --kblight 0
360+
# 20%
361+
> framework_tool.exe --kblight 20
362+
```
363+
364+
## RGB LED (Framework Desktop)
365+
366+
```
367+
# To set three LEDs to red, green, blue
368+
sudo framework_tool --rgbkbd 0 0xFF0000 0x00FF00 0x0000FF
369+
370+
# To clear 8 LEDs
371+
sudo framework_tool --rgbkbd 0 0 0 0 0 0 0 0 0
372+
373+
# Just turn the 3rd LED red
374+
sudo framework_tool --rgbkbd 2 0xFF0000
375+
```
376+
299377
## Stylus (Framework 12)
300378

301379
```

framework_lib/src/power.rs

+19-16
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl fmt::Display for AccelData {
190190
let x = (self.x as f32) / quarter;
191191
let y = (self.y as f32) / quarter;
192192
let z = (self.z as f32) / quarter;
193-
write!(f, "X: {:.2}G Y: {:.2}G, Z: {:.2}G", x, y, z)
193+
write!(f, "X={:+.2}G Y={:+.2}G, Z={:+.2}G", x, y, z)
194194
}
195195
}
196196

@@ -288,22 +288,25 @@ pub fn print_sensors(ec: &CrosEc) {
288288
let accel_1 = ec.read_memory(EC_MEMMAP_ACC_DATA + 2, 0x06).unwrap();
289289
let accel_2 = ec.read_memory(EC_MEMMAP_ACC_DATA + 8, 0x06).unwrap();
290290

291-
println!("Accelerometers:");
292-
println!(" Status Bit: {} 0x{:X}", acc_status, acc_status);
293-
println!(" Present: {}", (acc_status & 0x80) > 0);
294-
println!(" Busy: {}", (acc_status & 0x8) > 0);
295-
print!(" Lid Angle: ");
296-
if lid_angle == LID_ANGLE_UNRELIABLE {
297-
println!("Unreliable");
298-
} else {
299-
println!("{} Deg", lid_angle);
291+
let present = (acc_status & 0x80) > 0;
292+
if present {
293+
println!("Accelerometers:");
294+
debug!(" Status Bit: {} 0x{:X}", acc_status, acc_status);
295+
debug!(" Present: {}", present);
296+
debug!(" Busy: {}", (acc_status & 0x8) > 0);
297+
print!(" Lid Angle: ");
298+
if lid_angle == LID_ANGLE_UNRELIABLE {
299+
println!("Unreliable");
300+
} else {
301+
println!("{} Deg", lid_angle);
302+
}
303+
println!(" Sensor 1: {}", AccelData::from(accel_1));
304+
println!(" Sensor 2: {}", AccelData::from(accel_2));
305+
// Accelerometers
306+
// Lid Angle: 26 Deg
307+
// Sensor 1: 00.00 X 00.00 Y 00.00 Z
308+
// Sensor 2: 00.00 X 00.00 Y 00.00 Z
300309
}
301-
println!(" Sensor 1: {}", AccelData::from(accel_1));
302-
println!(" Sensor 2: {}", AccelData::from(accel_2));
303-
// Accelerometers
304-
// Lid Angle: 26 Deg
305-
// Sensor 1: 00.00 X 00.00 Y 00.00 Z
306-
// Sensor 2: 00.00 X 00.00 Y 00.00 Z
307310
}
308311

309312
pub fn print_thermal(ec: &CrosEc) {

0 commit comments

Comments
 (0)