Tim Edwards
01/27/2023, 1:58 PMPhilipp Gühring
01/28/2023, 4:09 PMTim Edwards
01/28/2023, 4:15 PMgpio_config_io()
to bit-bang the serial transfer, just set the configuration data per the output of gpio_convert.py
, then run reg_mprj_xfer = 1; while (reg_mprj_xfer == 1);
to run the automatic serial transfer. Follow that transfer by setting the configuration values to what they were intended to be, so that the housekeeping module understands which GPIOs are supposed to be inputs and which are supposed to be outputs.gpio_convert.py
. This is for the Efabless example user project (which is just a simple multi-bit counter). I want to set all of the GPIOs to output, which puts the counter value on the GPIO outputs. So I run the usual python to calibrate the chip and to get the two bit-bang bitstreams. Then, once I have the file gpio_config_data.py
for the configuration I want in my program, I run gpio_convert.py
, which gives me an output that I drop into my program, and that gives me lines 20 to 57 in the attached C code (counter.c
) below. Then in lines 65-67 I run the automatic serial load, and in lines 72-109 I set the configuration in the housekeeping registers back to what was intended (which is all outputs).