Skip to content

Commit 36d80e7

Browse files
committed
I2c DMA:restrict creation of (Tx/Rx/No)DMA outside
1 parent 0cd34b7 commit 36d80e7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/i2c/dma.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub enum Error {
1616
}
1717

1818
/// Tag for TX/RX channel that a corresponding channel should not be used in DMA mode
19+
#[non_exhaustive]
1920
pub struct NoDMA;
2021

2122
/// Callback type to notify user code of completion I2C transfers
@@ -256,7 +257,7 @@ where
256257
I2C: Instance,
257258
TX_STREAM: Stream,
258259
{
259-
pub fn new(stream: TX_STREAM) -> Self {
260+
fn new(stream: TX_STREAM) -> Self {
260261
let tx = Tx { i2c: PhantomData };
261262

262263
Self {
@@ -321,7 +322,7 @@ where
321322
I2C: Instance,
322323
RX_STREAM: Stream,
323324
{
324-
pub fn new(stream: RX_STREAM) -> Self {
325+
fn new(stream: RX_STREAM) -> Self {
325326
let tx = Rx { i2c: PhantomData };
326327

327328
Self {

0 commit comments

Comments
 (0)