8000 Porky layout by andrewdavidmackenzie · Pull Request #509 · andrewdavidmackenzie/pigg · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Porky layout #509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
if: runner.os != 'Windows'
run: |
grcov . --binary-path target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
lcov --ignore-errors empty --remove lcov.info -o lcov.info --erase-functions "(?=^.*fmt).+"
lcov --ignore-errors empty,empty --remove lcov.info -o lcov.info --erase-functions "(?=^.*fmt).+"

- name: UploadCoverage
if: runner.os != 'Windows'
Expand Down
4 changes: 4 additions & 0 deletions assets/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ Here are some gifs and links to YouTube videos showing some of the features.
## Remote GPIO from piggui to piglet using Connect Dialog

[![Remote GPIO from piggui to piglet using Command Line option](https://img.youtube.com/vi/aToJ1aT7NeM/maxresdefault.jpg)](https://youtu.be/aToJ1aT7NeM)

## Piggui controlling a Pi Pico with porky

[![Piggui controlling a remote Pi Pico via porky](images/porky.png)](https://youtube.com/shorts/-u8HXCff3Pc?feature=share)
Binary file added assets/images/porky.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions porky/src/pin_descriptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,15 @@ const PIN_40: PinDescription = PinDescription {
};

/// Array of 40 [PinDescription]s of the 40 pins on a Pi Pico W
/// NOTE: They are ordered by rows in the physical layout, so the rows go like this:
/// 1 - 40
/// 2 - 39
/// 3 - 38
/// ...
/// 20 - 21
pub const PIN_DESCRIPTIONS: [PinDescription; 40] = [
PIN_1, PIN_2, PIN_3, PIN_4, PIN_5, PIN_6, PIN_7, PIN_8, PIN_9, PIN_10, PIN_11, PIN_12, PIN_13,
PIN_14, PIN_15, PIN_16, PIN_17, PIN_18, PIN_19, PIN_20, PIN_21, PIN_22, PIN_23, PIN_24, PIN_25,
PIN_26, PIN_27, PIN_28, PIN_29, PIN_30, PIN_31, PIN_32, PIN_33, PIN_34, PIN_35, PIN_36, PIN_37,
PIN_38, PIN_39, PIN_40,
PIN_1, PIN_40, PIN_2, PIN_39, PIN_3, PIN_38, PIN_4, PIN_37, PIN_5, PIN_36, PIN_6, PIN_35,
PIN_7, PIN_34, PIN_8, PIN_33, PIN_9, PIN_32, PIN_10, PIN_31, PIN_11, PIN_30, PIN_12, PIN_29,
PIN_13, PIN_28, PIN_14, PIN_27, PIN_15, PIN_26, PIN_16, PIN_25, PIN_17, PIN_24, PIN_18, PIN_23,
PIN_19, PIN_22, PIN_20, PIN_21,
];
5 changes: 1 addition & 4 deletions porky/src/porky.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ use heapless::FnvIndexMap;
use heapless::Vec;
use hw_definition::config::HardwareConfigMessage::*;
use hw_definition::config::{HardwareConfig, HardwareConfigMessage, InputPull, LevelChange};
use hw_definition::description::{
HardwareDescription, HardwareDetails, PinDescriptionSet, PinNumberingScheme,
};
use hw_definition::description::{HardwareDescription, HardwareDetails, PinDescriptionSet};
use hw_definition::pin_function::PinFunction;
use hw_definition::{BCMPinNumber, PinLevel};
use panic_probe as _;
Expand Down Expand Up @@ -427,7 +425,6 @@ async fn tcp_accept(socket: &mut TcpSocket<'_>, ip_address: &Ipv4Address, device
let hw_desc = HardwareDescription {
details,
pins: PinDescriptionSet {
pin_numbering: PinNumberingScheme::CounterClockwise,
pins: Vec::from_slice(&PIN_DESCRIPTIONS).unwrap(),
},
};
Expand Down
20 changes: 2 additions & 18 deletions src/hw/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ use crate::hw_definition::pin_function::PinFunction;
use crate::hw_definition::{BCMPinNumber, PinLevel};

use crate::hw::pin_descriptions::*;
use crate::hw_definition::description::{
HardwareDescription, HardwareDetails, PinDescription, PinDescriptionSet, PinNumberingScheme,
};
use crate::hw_definition::description::{HardwareDescription, HardwareDetails, PinDescriptionSet};

mod hardware_description;
mod pin_descriptions;
Expand All @@ -20,16 +18,6 @@ pub const PIGLET_ALPN: &[u8] = b"pigg/piglet/0";

pub mod config;

/// Model the 40 pin GPIO connections - including Ground, 3.3V and 5V outputs
/// For now, we will use the same descriptions for all hardware
//noinspection DuplicatedCode
const GPIO_PIN_DESCRIPTIONS: [PinDescription; 40] = [
PIN_1, PIN_2, PIN_3, PIN_4, PIN_5, PIN_6, PIN_7, PIN_8, PIN_9, PIN_10, PIN_11, PIN_12, PIN_13,
PIN_14, PIN_15, PIN_16, PIN_17, PIN_18, PIN_19, PIN_20, PIN_21, PIN_22, PIN_23, PIN_24, PIN_25,
PIN_26, PIN_27, PIN_28, PIN_29, PIN_30, PIN_31, PIN_32, PIN_33, PIN_34, PIN_35, PIN_36, PIN_37,
PIN_38, PIN_39, PIN_40,
];

#[cfg(all(
target_os = "linux",
any(target_arch = "aarch64", target_arch = "arm"),
Expand Down Expand Up @@ -91,7 +79,6 @@ impl HW {
Ok(HardwareDescription {
details: Self::get_details()?,
pins: PinDescriptionSet {
pin_numbering: PinNumberingScheme::Rows,
pins: GPIO_PIN_DESCRIPTIONS.to_vec(),
},
})
Expand Down Expand Up @@ -334,9 +321,7 @@ impl HW {
#[cfg(test)]
mod test {
use crate::hw;
use crate::hw_definition::description::{
PinDescription, PinDescriptionSet, PinNumberingScheme,
};
use crate::hw_definition::description::{PinDescription, PinDescriptionSet};
use crate::hw_definition::pin_function::PinFunction;
use std::borrow::Cow;

Expand Down Expand Up @@ -460,7 +445,6 @@ mod test {
pin7.clone(),
];
let pin_set = PinDescriptionSet {
pin_numbering: PinNumberingScheme::Rows,
pins: pins.to_vec(),
};
assert_eq!(
Expand Down
Loading
0