aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/ipcc.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-05-23 01:15:22 +0000
committerGitHub <[email protected]>2023-05-23 01:15:22 +0000
commit1fdde8f03fc8b98c7fdb91a94e2dfd47bcbc24cb (patch)
treeb28d26b4a54ecccce2de498e5106fc55be631061 /embassy-stm32/src/ipcc.rs
parentab7d129e152a9450b2a6445397365bcb3a3ce183 (diff)
parent64092169e3133b572626c1efa106963139a63b3f (diff)
Merge #1457
1457: TL Mbox read and write for stm32wb r=xoviat a=OueslatiGhaith Hello, This pull request is related to #1397 and #1401, inspired by #24, built upon the work done in #1405 and #1424, and was tested on an stm32wb55rg. This pull request aims to add read and write functionality to the TL mailbox for stm32wb microcontrollers Co-authored-by: goueslati <[email protected]> Co-authored-by: xoviat <[email protected]>
Diffstat (limited to 'embassy-stm32/src/ipcc.rs')
-rw-r--r--embassy-stm32/src/ipcc.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/embassy-stm32/src/ipcc.rs b/embassy-stm32/src/ipcc.rs
index 903aeca30..2b9caf8e5 100644
--- a/embassy-stm32/src/ipcc.rs
+++ b/embassy-stm32/src/ipcc.rs
@@ -35,6 +35,10 @@ pub struct Ipcc<'d> {
35 35
36impl<'d> Ipcc<'d> { 36impl<'d> Ipcc<'d> {
37 pub fn new(peri: impl Peripheral<P = IPCC> + 'd, _config: Config) -> Self { 37 pub fn new(peri: impl Peripheral<P = IPCC> + 'd, _config: Config) -> Self {
38 Self::new_inner(peri)
39 }
40
41 pub(crate) fn new_inner(peri: impl Peripheral<P = IPCC> + 'd) -> Self {
38 into_ref!(peri); 42 into_ref!(peri);
39 43
40 Self { _peri: peri } 44 Self { _peri: peri }
@@ -158,6 +162,10 @@ impl<'d> Ipcc<'d> {
158 pub fn is_rx_pending(&self, channel: IpccChannel) -> bool { 162 pub fn is_rx_pending(&self, channel: IpccChannel) -> bool {
159 self.c2_is_active_flag(channel) && self.c1_get_rx_channel(channel) 163 self.c2_is_active_flag(channel) && self.c1_get_rx_channel(channel)
160 } 164 }
165
166 pub fn as_mut_ptr(&self) -> *mut Self {
167 unsafe { &mut core::ptr::read(self) as *mut _ }
168 }
161} 169}
162 170
163impl sealed::Instance for crate::peripherals::IPCC { 171impl sealed::Instance for crate::peripherals::IPCC {