1 # SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
3 # SPDX-License-Identifier: MIT
5 Support for getting the URL from the BLINKA_FT232H
6 and BLINKA_FT2232H_{} environment variables.
14 Return the FTDI url to use. If BLINKA_FT232H starts with ftdi:, returns
15 that. Otherwise, returns a default value.
18 url = os.environ.get("BLINKA_FT232H", "1")
20 if url.startswith("ftdi:"):
23 return "ftdi://ftdi:ft232h/1"
26 def get_ft2232h_url(interface_id):
28 Return the FTDI url to use. If BLINKA_FT2232H_{} starts with ftdi:, returns
29 that. Otherwise, returns a default value.
32 url = os.environ.get("BLINKA_FT2232H_{}".format(interface_id), "1")
34 if url.startswith("ftdi:"):
37 return "ftdi://ftdi:ft2232h/{}".format(interface_id + 1)