Hello,
I had been using class Pin to write to pyboard GPIO but I was wondering if I can write to a GPIO port in parallel so all pins in a port will transition at once. I searched documentation but could not find a reference. Also, is there facility like "bus out" object in mbed that you can use as direct in/out variable ?
Eg: busout data = 0x12, will write 8 bits to bus.
int check = (data == 0x0F) will check lower 4 bit nibble.
Thanks !
Can micropython write to GPIO port in parallel as a group ?
Re: Can micropython write to GPIO port in parallel as a group ?
There isn't a direct API to do this, but you can write directly to the stm registers by using the stm module.
Here's an example from the documentation: http://docs.micropython.org/en/latest/p ... e-directly
There is also a forum post here: viewtopic.php?f=2&t=134&p=498 This uses the BSRR registers which is a slightly different way of setting. The forum post explains the difference between the 2 methods.
Here's an example from the documentation: http://docs.micropython.org/en/latest/p ... e-directly
There is also a forum post here: viewtopic.php?f=2&t=134&p=498 This uses the BSRR registers which is a slightly different way of setting. The forum post explains the difference between the 2 methods.