Open ost-ing opened 4 years ago
I know next to nothing about I2S, but to the best of my knowledge, it is not supported. I'm also not aware of any plans to implement it, but of course any contributions doing so would be very welcome.
Thanks for the response @hannobraun. When I find the time, I could begin to look into it.
For further reference, the stm32f429-hal
implements it.
Kind regards, Oliver
I've begun implementing I2S support, but I need some assistance regarding the way the HAL currently implements the rcc::CFGR
.
I'm porting the I2S initialization C++ function HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s)
.
This function requires access to:
plli2scfgr
register, specifically the plli2sn
and plli2sr
values.These values are then used to determine the I2S MCK
value, which is crucial for I2S Master operation.
After calling constrain()
on pac::RCC
, I lose access to read these registries. Further the stm32f7xx_hal::rcc::CFGR freeze
function returns a Clocks
struct that also cannot help me.
Is there an example somewhere of accessing these registries (read-only) in a safe or unsafe way after constraining? If not, I could attempt to modify the rcc.rs to allow accessing read-only values, or is there any suggestion on how to handle this situation?
cc. @hannobraun & @no111u3
Kind regards, Oliver
You can always conjure up an instance of pac::RCC
via pac::RCC::ptr()
. Or you could just add the required information to Clocks
. I don't have a strong opinion here.
Thanks for pointing me in the right direction :+1:
@ostenning Did you get anywhere with the I2S implementation? I am thinking of possibly implementing it myself if not :)
@andybest Sorry, no I ended up going in a different direction with my project. But take a look at the stm32h7xx-hal
, its already implemented there.
@ostenning No worries! Thanks, I'll see if I can port over the implementation from there :)
I'm trying to determine if the SPI implementation can support I2S? If not, any plans in the future to add this? I assume that its related to SPI, as the datasheet for stm32f747zg suggests:
Thanks!