```
        # Use a GPIO peripheral to control four LEDs:
        m.submodules.gpio = gpio = GPIOPeripheral(addr_width=8, data_width=8, pin_count=4)
        for n in range(4):
            connect(m, gpio.pins[n], platform.request("led", n))
```
this requires the platform resource to be defined as `dir="io"`, which leds typically won't be -- should we allow indicating the direction so we can connect it to unidirectional pins, or require all pins to be bidirectional?