-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Description
Hi there,
I'm trying to use the SAI peripheral on an H735... But I'm stuck as I don't have an SdB pin and using None
on the tuple will lead to rustc E0282
and rustc E0283
.
let sai1_pins = (
mclk_a_pin.into_alternate(),
sck_a_pin.into_alternate(),
fs_a_pin.into_alternate(),
sd_a_pin.into_alternate(),
None
);
The compiler says I should say what Option none belongs to... So I thought something like this would work, but now I've got another compiler error, rustc E0277
.
let sai1_pins = (
mclk_a_pin.into_alternate(),
sck_a_pin.into_alternate(),
fs_a_pin.into_alternate(),
sd_a_pin.into_alternate(),
None::<sai::i2s::I2SPinSdB<pac::SAI1>>
);
The SAI example available in the examples
directory uses SdB pin... but it's not shown anywhere how None
should be used in the case you don't have this pin.
The log of the first error is as follows:
error[E0283]: type annotations needed
--> src/pcm_4202_driver.rs:62:13
|
62 | None
| ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option`
...
65 | let mut sai1 = sai1.i2s_ch_a(
| -------- type must be known at this point
|
= note: multiple `impl`s satisfying `_: sai::i2s::I2SPinSdB<stm32h7xx_hal::stm32::SAI1>` found in the `stm32h7xx_hal` crate:
- impl sai::i2s::I2SPinSdB<stm32h7xx_hal::stm32::SAI1> for stm32h7xx_hal::gpio::Pin<'E', 3, stm32h7xx_hal::gpio::Alternate<6>>;
- impl sai::i2s::I2SPinSdB<stm32h7xx_hal::stm32::SAI1> for stm32h7xx_hal::gpio::Pin<'F', 6, stm32h7xx_hal::gpio::Alternate<6>>;
= note: required for `(stm32h7xx_hal::gpio::Pin<'E', 2, stm32h7xx_hal::gpio::Alternate<6>>, ..., ..., ..., ...)` to implement `sai::i2s::I2SPinsChA<stm32h7xx_hal::stm32::SAI1>`
= note: the full type name has been written to 'target/thumbv7em-none-eabihf/debug/deps/tcc-9b1e8f6e0ab9f3e3.long-type-11402833594598164313.txt'
note: required by a bound in `i2s_ch_a`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/stm32h7xx-hal-0.13.1/src/sai/i2s.rs:359:15
|
359 | PINS: I2SPinsChA<Self>;
| ^^^^^^^^^^^^^^^^ required by this bound in `i2s_ch_a`
help: consider specifying the generic argument
|
62 | None::<T>
| +++++
Now I'm definitely not an expert in the language, I've only used it for a few years now, but not professionally nor with this heavy usage of templates and etc... Am I missing something really stupid?
Metadata
Metadata
Assignees
Labels
No labels