-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from RusPiRo/feature/specialized_shared_irq_han…
…dling enable irq handler for shared interrupt lines like Aux
- Loading branch information
Showing
7 changed files
with
234 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
[package] | ||
name = "ruspiro-interrupt" | ||
authors = ["André Borrmann <[email protected]>"] | ||
version = "0.1.1" # remember to update html_root_url | ||
authors = ["Andre Borrmann <[email protected]>"] | ||
version = "0.2.0" # remember to update html_root_url | ||
description = "Providing a simple and convinient way to implement interrupt handler for Raspberry Pi interrupts." | ||
license = "Apache-2.0" | ||
repository = "https://github.com/RusPiRo/ruspiro-interrupt/tree/v0.1.1" | ||
documentation = "https://docs.rs/ruspiro-interrupt/0.1.1" | ||
repository = "https://github.com/RusPiRo/ruspiro-interrupt/tree/v0.2.0" | ||
documentation = "https://docs.rs/ruspiro-interrupt/0.2.0" | ||
readme = "README.md" | ||
keywords = ["RusPiRo", "baremetal", "raspberrypi", "interrupt"] | ||
categories = ["no-std", "embedded"] | ||
edition = "2018" | ||
|
||
[badges] | ||
travis-ci = { repository = "RusPiRo/ruspiro-interrupt", branch = "master" } | ||
maintenance = { status = "actively-developed" } | ||
|
||
[workspace] | ||
members = ["macros"] | ||
|
||
[lib] | ||
|
||
[dependencies] | ||
paste = "0.1.5" | ||
ruspiro-register = "0.1.1" | ||
ruspiro-interrupt-macros = { path = "./macros", version = "0.1.0" } | ||
ruspiro-interrupt-macros = { path = "./macros", version = "0.2.0" } | ||
ruspiro-singleton = "0.1.0" | ||
|
||
[features] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
[package] | ||
name = "ruspiro-interrupt-macros" | ||
authors = ["André Borrmann <[email protected]>"] | ||
version = "0.1.0" # remember to update html_root_url | ||
authors = ["Andre Borrmann <[email protected]>"] | ||
version = "0.2.0" # remember to update html_root_url | ||
description = "Macros used to implement interrupt handler. !!This crate is only useful in conjunction with the `ruspiro-interrupt` crate and shall never be used standalone!!" | ||
license = "Apache-2.0" | ||
repository = "https://github.com/RusPiRo/ruspiro-interrupt/tree/v0.1.0" | ||
documentation = "https://docs.rs/ruspiro-interrupt/0.1.0" | ||
repository = "https://github.com/RusPiRo/ruspiro-interrupt/tree/v0.2.0" | ||
documentation = "https://docs.rs/ruspiro-interrupt/0.2.0" | ||
readme = "README.md" | ||
keywords = ["RusPiRo", "baremetal", "raspberrypi", "interrupt"] | ||
categories = ["no-std", "embedded"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/*********************************************************************************************************************** | ||
* Copyright (c) 2019 by the authors | ||
* | ||
* Author: André Borrmann | ||
* License: Apache License 2.0 | ||
**********************************************************************************************************************/ | ||
//! # Aux interrupt line special handler | ||
//! | ||
//! The Aux interrupt line is shared between Uart1, Spi1 and Spi2. Therefore the | ||
//! | ||
use ruspiro_register::define_registers; | ||
|
||
#[cfg(feature="ruspiro_pi3")] | ||
const PERIPHERAL_BASE: u32 = 0x3F00_0000; | ||
|
||
pub(crate) fn aux_handler() { | ||
// special Aux handling, as one IRQ line shares interrupts between Uart1, SPI1 and SPI2 | ||
if AUX_IRQ::Register.read(AUX_IRQ::UART1) == 1 { | ||
crate::__irq_handler__Aux_Uart1(); | ||
} | ||
|
||
if AUX_IRQ::Register.read(AUX_IRQ::SPI1) == 1 { | ||
crate::__irq_handler__Aux_Spi1(); | ||
} | ||
|
||
if AUX_IRQ::Register.read(AUX_IRQ::SPI2) == 1 { | ||
crate::__irq_handler__Aux_Spi2(); | ||
} | ||
} | ||
|
||
define_registers! [ | ||
AUX_IRQ: ReadWrite<u32> @ PERIPHERAL_BASE + 0x0021_5000 => [ | ||
SPI2 OFFSET(2), | ||
SPI1 OFFSET(1), | ||
UART1 OFFSET(0) | ||
] | ||
]; |
Oops, something went wrong.