Fernando,
if I understand well you want modify all the IO bits
"at the same time" like you do in an x bits port.
First of all you must define the pins that you want use ....
each pin is associated with a specific bit of the ports.
It is not really easy to do, at least in basic, because the bits are not all free and contiguous.
The bit association is simple as the registers are 32 bits but only the first 16 bits are used.
So
bit 0 ->GPIO0
bit 1 ->GPIO1
bit 2 ->GPIO2
......
bit15 ->GPIO15
The GPIO16 is handled differently so you can avoid to use it.
The rule between GPIO and bits can be written as:
Code: [Local Link Removed for Guests]
binary_value = 1 << bit
So, for the GPIO0, the value is
Code: [Local Link Removed for Guests]
binary_value = 1 << 0
And, for the GPIO15, the value is
Code: [Local Link Removed for Guests]
binary_value = 1 << 15
Now, because you want use the pins 0, 1, 2, 3, 4, 5, 12, 13, 14, 15
you must isolate bit per bit, compose the complete binary word and then write in a one shoot.
let's say that you want write a word included in a variable LEDS.
This variable contains 10 bits where each bit controls a led
Let's say that
the bit 0 is connected to the pin 0
the bit 1 is connected to the pin 1
the bit 2 is connected to the pin 2
the bit 3 is connected to the pin 3
the bit 4 is connected to the pin 4
the bit 5 is connected to the pin 5
the bit 6 is connected to the pin 12
the bit 7 is connected to the pin 13
the bit 8 is connected to the pin 14
the bit 9 is connected to the pin 15
To do that you must do something as below :
Code: [Local Link Removed for Guests]
LEDS = &b1010101010
x = LEDS
val = 0
val = val or ((x and 1) << 0
x = x >> 1
val = val or ((x and 1) << 1
x = x >> 1
val = val or ((x and 1) << 2
x = x >> 1
val = val or ((x and 1) << 3
x = x >> 1
val = val or ((x and 1) << 4
x = x >> 1
val = val or ((x and 1) << 5
x = x >> 1
val = val or ((x and 1) << 12
x = x >> 1
val = val or ((x and 1) << 13
x = x >> 1
val = val or ((x and 1) << 14
x = x >> 1
val = val or ((x and 1) << 15
at the end, the variable val will contain the value that you can write in the final register as below:
Code: [Local Link Removed for Guests]
GPIO_ENABLE_SET = &H60000310
GPIO_OUT = &H60000300
GPIO_IN = &H60000318
'define the output mask bits
mask = &b1111000000111111 ' pins 0,1,2,3,4,5,12,13,14,15
bas.poke GPIO_ENABLE_SET , mask ' each bit=1 means output
'and finally, you can write the word in the output (but you must read the previous value before)
prev = bas.peek(GPIO_IN)
'mask the bits that you don't want change
prev = (prev and &h111111000000)
'compose the final word
bas.poke GPIO_OUT , prev or val
AS you can see, it seems a little bit complicate to do in basic; probably should be much easy in C.
One of the big problems when trying to play with the registers is that the CHIP can do other tasks in the background (in particular the ESP32) so, it is probable that the value read from the input can change during the execution time of the interpreted line of code.