@@ -171,9 +171,58 @@ spi_pins! {
171
171
}
172
172
}
173
173
174
+ /// Filler for a SCK pin
175
+ ///
176
+ /// Usefull if you don't want to utilize the sck pin,
177
+ /// but a pin parameter is required
178
+ pub struct NoSck {
179
+ _1 : ( ) ,
180
+ }
181
+
182
+ impl NoSck {
183
+ /// Create a new filler sck pin
184
+ pub unsafe fn new ( ) -> Self {
185
+ Self { _1 : ( ) }
186
+ }
187
+ }
188
+
189
+ /// Filler for a MISO Pin
190
+ ///
191
+ /// Usefull if you don't want to utilize the miso pin,
192
+ /// but a pin parameter is required
193
+ pub struct NoMiso {
194
+ _1 : ( ) ,
195
+ }
196
+
197
+ impl NoMiso {
198
+ /// Create a new filler mosi pin
199
+ pub unsafe fn new ( ) -> Self {
200
+ Self { _1 : ( ) }
201
+ }
202
+ }
203
+
204
+ /// Filler for a MOSI Pin
205
+ ///
206
+ /// Usefull if you don't want to utilize the miso pin,
207
+ /// but a pin parameter is required
208
+ pub struct NoMosi {
209
+ _1 : ( ) ,
210
+ }
211
+
212
+ impl NoMosi {
213
+ /// Create a new filler mosi pin
214
+ pub unsafe fn new ( ) -> Self {
215
+ Self { _1 : ( ) }
216
+ }
217
+ }
218
+
174
219
macro_rules! spi {
175
220
( $( $SPI: ident: ( $spi: ident, $spiXen: ident, $spiXrst: ident, $apbenr: ident, $apbrstr: ident) , ) +) => {
176
221
$(
222
+ impl SckPin <$SPI> for NoSck { }
223
+ impl MisoPin <$SPI> for NoMiso { }
224
+ impl MosiPin <$SPI> for NoMosi { }
225
+
177
226
impl <SCKPIN , MISOPIN , MOSIPIN > Spi <$SPI, SCKPIN , MISOPIN , MOSIPIN > {
178
227
/// Creates a new spi instance
179
228
pub fn $spi<F >(
0 commit comments