Previous journal: | Next journal: |
---|---|
0096-2023-06-17.md | 0098-2023-06-19.md |
- I implemented basic command argument support (
getarg_str
andgetarg_u32
). - New commands:
o
{outmask} - Configure outputs: Each high bit in outmask will configure its corresponding GPIO to be an output.i
{inmask} - Configure inputs: As above, but to configure GPIOs as inputs.=
{set_mask} {set_vals} - Set GPIOs identified in set_mask to corresponding values in set_vals.r
- Software reset. May not allow USB-CDC to reconnect properly? Not sure yet. NOTE: Wokwi doesn't support this (watchdog-based) method.
- It doesn't look like the pico-sdk has a high-level Hardware API call to get the "direction" of all GPIOs
in one go, but from reading the pico-sdk source it looks like reading the
SIO_GPIO_OE
register is the way to go, and the nice way to do this is viasio_hw->gpio_oe
- NOTE: The code defines
GPIO_MASK
which is used to prevent changing the state of any GPIOs that have special Pico functions. - With the new commands above I've now been able to test outputs, and the DE0-Nano design appears to detect them as expected.