@@ -201,9 +201,58 @@ spi_pins! {
201
201
}
202
202
}
203
203
204
+ /// Filler for a SCK pin
205
+ ///
206
+ /// Usefull if you don't want to utilize the sck pin,
207
+ /// but a pin parameter is required
208
+ pub struct NoSck {
209
+ _1 : ( ) ,
210
+ }
211
+
212
+ impl NoSck {
213
+ /// Create a new filler sck pin
214
+ pub unsafe fn new ( ) -> Self {
215
+ Self { _1 : ( ) }
216
+ }
217
+ }
218
+
219
+ /// Filler for a MISO Pin
220
+ ///
221
+ /// Usefull if you don't want to utilize the miso pin,
222
+ /// but a pin parameter is required
223
+ pub struct NoMiso {
224
+ _1 : ( ) ,
225
+ }
226
+
227
+ impl NoMiso {
228
+ /// Create a new filler mosi pin
229
+ pub unsafe fn new ( ) -> Self {
230
+ Self { _1 : ( ) }
231
+ }
232
+ }
233
+
234
+ /// Filler for a MOSI Pin
235
+ ///
236
+ /// Usefull if you don't want to utilize the miso pin,
237
+ /// but a pin parameter is required
238
+ pub struct NoMosi {
239
+ _1 : ( ) ,
240
+ }
241
+
242
+ impl NoMosi {
243
+ /// Create a new filler mosi pin
244
+ pub unsafe fn new ( ) -> Self {
245
+ Self { _1 : ( ) }
246
+ }
247
+ }
248
+
204
249
macro_rules! spi {
205
250
( $( $SPI: ident: ( $spi: ident, $spiXen: ident, $spiXrst: ident, $apbenr: ident, $apbrstr: ident) , ) +) => {
206
251
$(
252
+ impl SckPin <$SPI> for NoSck { }
253
+ impl MisoPin <$SPI> for NoMiso { }
254
+ impl MosiPin <$SPI> for NoMosi { }
255
+
207
256
impl <SCKPIN , MISOPIN , MOSIPIN > Spi <$SPI, SCKPIN , MISOPIN , MOSIPIN > {
208
257
/// Creates a new spi instance
209
258
pub fn $spi<F >(
0 commit comments