Skip to content

Commit 59c1bd8

Browse files
authored
Merge pull request #45 from luojia65/luojia65/propose-rename-spi-interface
Propose to use CamelCase for SpiInterface structure
2 parents 528bcf5 + 5aac502 commit 59c1bd8

File tree

6 files changed

+20
-19
lines changed

6 files changed

+20
-19
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1616
- New `AsyncWriteOnlyDataCommand` trait.
1717
- i2c, spi: `async/await` support.
1818
- parallel-gpio: Added `Generic16BitBus`
19-
- parallel-gpio: Added `PGPIO16BitInterface`
19+
- parallel-gpio: Added `PGpio16BitInterface`
2020
- added `defmt-03` feature
2121

2222
## Changed
2323

2424
- **Breaking** raised MSRV to 1.75
25-
- spi: `SPIInterface` now wraps objects that implement the `SpiDeviceWrite` trait from embedded-hal 1.0.0
26-
- spi: `SPIInterface` now wraps objects that implement the `SpiDeviceWrite` trait from embedded-hal-async 1.0.0
25+
- spi: `SpiInterface` now wraps objects that implement the `SpiDeviceWrite` trait from embedded-hal 1.0.0
26+
- spi: `SpiInterface` now wraps objects that implement the `SpiDeviceWrite` trait from embedded-hal-async 1.0.0
2727
- parallel-gpio: Fixed bug with fallible pins
2828
- **Breaking** parallel-gpio: `GenericxBitBus::new` is now infallible
29+
- **Breaking** lib: `{SPI, I2C}Interface, PGPIO{8, 16}BitInterface` is renamed to `{Spi, I2c}Interface, PGpio{8, 16}BitInterface`
2930

3031
## [v0.4.1] - 2021-05-10
3132

i2c/src/asynch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use display_interface::{AsyncWriteOnlyDataCommand, DataFormat, DisplayError};
22

3-
use crate::I2CInterface;
3+
use crate::I2cInterface;
44

5-
impl<I2C> AsyncWriteOnlyDataCommand for I2CInterface<I2C>
5+
impl<I2C> AsyncWriteOnlyDataCommand for I2cInterface<I2C>
66
where
77
I2C: embedded_hal_async::i2c::I2c,
88
{

i2c/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ mod asynch;
77
use display_interface::{DataFormat, DisplayError, WriteOnlyDataCommand};
88

99
/// I2C communication interface
10-
pub struct I2CInterface<I2C> {
10+
pub struct I2cInterface<I2C> {
1111
i2c: I2C,
1212
addr: u8,
1313
data_byte: u8,
1414
}
1515

16-
impl<I2C> I2CInterface<I2C> {
16+
impl<I2C> I2cInterface<I2C> {
1717
/// Create new I2C interface for communication with a display driver
1818
pub fn new(i2c: I2C, addr: u8, data_byte: u8) -> Self {
1919
Self {
@@ -30,7 +30,7 @@ impl<I2C> I2CInterface<I2C> {
3030
}
3131
}
3232

33-
impl<I2C> WriteOnlyDataCommand for I2CInterface<I2C>
33+
impl<I2C> WriteOnlyDataCommand for I2cInterface<I2C>
3434
where
3535
I2C: embedded_hal::i2c::I2c,
3636
{

parallel-gpio/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ generic_bus! {
143143
/// All pins are supposed to be high-active, high for the D/C pin meaning "data" and the
144144
/// write-enable being pulled low before the setting of the bits and supposed to be sampled at a
145145
/// low to high edge.
146-
pub struct PGPIO8BitInterface<BUS, DC, WR> {
146+
pub struct PGpio8BitInterface<BUS, DC, WR> {
147147
bus: BUS,
148148
dc: DC,
149149
wr: WR,
150150
}
151151

152-
impl<BUS, DC, WR> PGPIO8BitInterface<BUS, DC, WR>
152+
impl<BUS, DC, WR> PGpio8BitInterface<BUS, DC, WR>
153153
where
154154
BUS: OutputBus<Word = u8>,
155155
DC: OutputPin,
@@ -201,7 +201,7 @@ where
201201
}
202202
}
203203

204-
impl<BUS, DC, WR> WriteOnlyDataCommand for PGPIO8BitInterface<BUS, DC, WR>
204+
impl<BUS, DC, WR> WriteOnlyDataCommand for PGpio8BitInterface<BUS, DC, WR>
205205
where
206206
BUS: OutputBus<Word = u8>,
207207
DC: OutputPin,
@@ -227,13 +227,13 @@ where
227227
/// All pins are supposed to be high-active, high for the D/C pin meaning "data" and the
228228
/// write-enable being pulled low before the setting of the bits and supposed to be sampled at a
229229
/// low to high edge.
230-
pub struct PGPIO16BitInterface<BUS, DC, WR> {
230+
pub struct PGpio16BitInterface<BUS, DC, WR> {
231231
bus: BUS,
232232
dc: DC,
233233
wr: WR,
234234
}
235235

236-
impl<BUS, DC, WR> PGPIO16BitInterface<BUS, DC, WR>
236+
impl<BUS, DC, WR> PGpio16BitInterface<BUS, DC, WR>
237237
where
238238
BUS: OutputBus<Word = u16>,
239239
DC: OutputPin,
@@ -276,7 +276,7 @@ where
276276
}
277277
}
278278

279-
impl<BUS, DC, WR> WriteOnlyDataCommand for PGPIO16BitInterface<BUS, DC, WR>
279+
impl<BUS, DC, WR> WriteOnlyDataCommand for PGpio16BitInterface<BUS, DC, WR>
280280
where
281281
BUS: OutputBus<Word = u16>,
282282
DC: OutputPin,

spi/src/asynch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use embedded_hal_async::spi::SpiDevice;
66

77
use display_interface::{AsyncWriteOnlyDataCommand, DataFormat, DisplayError};
88

9-
use crate::{SPIInterface, BUFFER_SIZE};
9+
use crate::{SpiInterface, BUFFER_SIZE};
1010

1111
type Result = core::result::Result<(), DisplayError>;
1212

@@ -116,7 +116,7 @@ where
116116
}
117117
}
118118

119-
impl<SPI, DC> AsyncWriteOnlyDataCommand for SPIInterface<SPI, DC>
119+
impl<SPI, DC> AsyncWriteOnlyDataCommand for SpiInterface<SPI, DC>
120120
where
121121
SPI: SpiDevice,
122122
DC: OutputPin,

spi/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ where
108108
/// SPI display interface.
109109
///
110110
/// This combines the SPI peripheral and a data/command pin
111-
pub struct SPIInterface<SPI, DC> {
111+
pub struct SpiInterface<SPI, DC> {
112112
spi: SPI,
113113
dc: DC,
114114
}
115115

116-
impl<SPI, DC> SPIInterface<SPI, DC> {
116+
impl<SPI, DC> SpiInterface<SPI, DC> {
117117
/// Create new SPI interface for communication with a display driver
118118
pub fn new(spi: SPI, dc: DC) -> Self {
119119
Self { spi, dc }
@@ -126,7 +126,7 @@ impl<SPI, DC> SPIInterface<SPI, DC> {
126126
}
127127
}
128128

129-
impl<SPI, DC> WriteOnlyDataCommand for SPIInterface<SPI, DC>
129+
impl<SPI, DC> WriteOnlyDataCommand for SpiInterface<SPI, DC>
130130
where
131131
SPI: SpiDevice,
132132
DC: OutputPin,

0 commit comments

Comments
 (0)