That works a charm, thanks!
Now to get the scope on the GPIO's to make sure it's behaving as expected.
Also need to work around the fact that the delays currently block simultaneous GPIO signal changes.
USB Host, what solution?
Re: USB Host, what solution?
Note that STM32 core provide dwt api to help usage. 
And that delayMicroseconds use it when it is available.

And that delayMicroseconds use it when it is available.
Re: USB Host, what solution?
Yup, but tbh it's easier to get the usb OTG host only & HID working in cube for now.
So I have everything wired and the mouse works, after a fashion, on the Amiga - still need to get the scope on the signals because the mouse is behaving as if massively accelerated at the moment (big delta movements for corresponding mouse movements - so it's 'unusable').
BUT... the device doesn't recognise the mouse until I replug it.
Anyone know how I can re-enumerate USB? Googling seems to turn up a lot of kludges, is there something elegant?
So I have everything wired and the mouse works, after a fashion, on the Amiga - still need to get the scope on the signals because the mouse is behaving as if massively accelerated at the moment (big delta movements for corresponding mouse movements - so it's 'unusable').
BUT... the device doesn't recognise the mouse until I replug it.
Anyone know how I can re-enumerate USB? Googling seems to turn up a lot of kludges, is there something elegant?
Re: USB Host, what solution?
This depends of your board:
https://github.com/stm32duino/Arduino_C ... _if.c#L130
https://github.com/stm32duino/Arduino_C ... _if.c#L130
Re: USB Host, what solution?
Fixed the 'acceleration' issue. basically the mouse data wasn't being cleared once processed, so the quadrature signals kept getting looped over. Setting them back to zero between samples fixes this (am disabling interrupts whilst the GPIO's are manipulated).
Will read that thanks Frederic.
Will read that thanks Frederic.