# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2020—2026, Glasgow Interface Explorer contributors
# This file is distributed under the same license as the Glasgow Interface Explorer package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2026.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Glasgow Interface Explorer \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-07-25 07:37+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: cn\n"
"Language-Team: cn <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.17.0\n"

#: ../../src/use/basic.rst:2
msgid "Basic usage"
msgstr ""

#: ../../src/use/basic.rst:6
msgid "Getting started with Glasgow"
msgstr ""

#: ../../src/use/basic.rst:8
msgid "After :ref:`installing <initial-setup>` the Glasgow software, the ``glasgow`` utility should be operational.  The ``glasgow`` utility is the most common (but not the only) way to interact with Glasgow hardware.  Test to see if ``glasgow`` is installed correctly with:"
msgstr ""

#: ../../src/use/basic.rst:14
msgid "``glasgow`` has a number of subcommands. At all times, the ``--help`` argument may be appended for more details."
msgstr ""

#: ../../src/use/basic.rst:18
msgid "As you build up the ``glasgow`` tool's command line, the `context` changes --- for example, the output of each of the following ``--help`` s are all different:"
msgstr ""

#: ../../src/use/basic.rst:26
msgid "The upshot of this is that different arguments need to be placed at different positions in the command line. The help section at each level should clarify where each argument should be placed. For example, the ``--serial`` parameter is recognized by the top-level ``glasgow`` command, and not by the third-level ``glasgow run uart`` command."
msgstr ""

#: ../../src/use/basic.rst:38
msgid "Returning Glasgow to a safe state"
msgstr ""

#: ../../src/use/basic.rst:40
msgid "To begin with, use the ``glasgow safe`` command to make sure that the ``glasgow`` utility can communicate with your Glasgow hardware.   The ``glasgow safe`` command sets all I/O to a `safe` state --- it disables voltage outputs, and sets all I/O pins to a high impedance state.  Try it with:"
msgstr ""

#: ../../src/use/basic.rst:46
msgid "This command has the same effect as pressing the physical `E-STOP / RESET` button that is present on ``revC3`` and later hardware revisions.  You may prefer to get in the habit of using the physical button if you're sitting next to your Glasgow; the button gives tactile feedback that the device has entered a safe state, in a way that ``glasgow safe`` cannot!"
msgstr ""

#: ../../src/use/basic.rst:48
msgid "You can use this command at any time to put your Glasgow hardware into a `safe` state; if it is successful, it will provide the output:"
msgstr ""

#: ../../src/use/basic.rst:57
msgid "If the ``glasgow`` tool cannot detect your connected Glasgow hardware, look at the LEDs.  A Glasgow device that is unable to establish a USB connection will slowly fade the `FX2` LED on and off to indicate a failure. This most commonly occurs if you use a power-only USB cable to connect the Glasgow device to your computer."
msgstr ""

#: ../../src/use/basic.rst:61
msgid "Working with applets"
msgstr ""

#: ../../src/use/basic.rst:63
msgid "``glasgow`` is based around the concept of `applets`, with each implementing a particular mode of operation or interface. For example, there are applets such as ``uart``, ``i2c-controller``, and ``spi-controller`` --- each implementing the gateware (which runs on the FPGA) and software (which runs on the host PC). The Glasgow software framework coordinates building, caching, and operating these applets for you."
msgstr ""

#: ../../src/use/basic.rst:65
msgid "A list of available applets [#applet_sources]_ can be shown by running ``glasgow run --help``.  You can interact with applets from the ``glasgow`` tool in one of four ways:"
msgstr ""

#: ../../src/use/basic.rst:67
msgid "**Running an applet**.  Most applets come with command line programs that perform a specific task related to the gateware that they interface with; ``glasgow run`` ning an applet allows you to invoke one or more of these applet-associated programs.  This usage is described below."
msgstr ""

#: ../../src/use/basic.rst:69
msgid "**Using an applet from the REPL.**  Applets provide a Python programming interface.  ``glasgow repl`` launches a Python prompt (a \"REPL\") that you can use to interactively explore the gateware implemented by an applet, and hardware connected to it.  This is described in the :ref:`REPL & script operation <repl-script>` section."
msgstr ""

#: ../../src/use/basic.rst:71
msgid "**Scripting an applet**.  It is often useful to use an applet's Python programming interface non-interactively, to run a stored set of operations using the Glasgow platform.  This is described in the :ref:`script usage <script-usage>` section."
msgstr ""

#: ../../src/use/basic.rst:73
msgid "**Using an offline tool**.  Some applets come with offline tools that do not use the Glasgow hardware at all.  For instance, the ``memory-floppy`` applet has a tool to manipulate raw disk images that may have been captured by ``glasgow run`` ning the applet.  This is not currently described in this document, but can be accessed with the ``glasgow tool`` command."
msgstr ""

#: ../../src/use/basic.rst:75
msgid "In this basic usage, we describe only using ``glasgow run`` to run an applet."
msgstr ""

#: ../../src/use/basic.rst:79
msgid "Using ``glasgow run``"
msgstr ""

#: ../../src/use/basic.rst:81
msgid "Applets that have ``run`` nable programs often have `subcommands` to specify what task you would like to accomplish.  For instance, the ``uart`` applet has three subcommands -- ``tty``, which attaches the UART to stdin; ``pty``, which creates a UNIX pseudoterminal; and ``socket``, which attaches the UART to either a UNIX or TCP socket.  You can get a list of an applet's subcommands by using the ``--help`` argument; each subcommand may also have arguments of its own:"
msgstr ""

#: ../../src/use/basic.rst:100
msgid "Applets also can have `build arguments` that specify how the gateware is constructed, and `run arguments` that modify the behavior of the applet as a whole; these are also listed in the ``--help`` output."
msgstr ""

#: ../../src/use/basic.rst:102
msgid "A common run argument is ``-V ...``, which sets the I/O voltage, as well as setting the supply output voltage. Be careful that you set the correct voltage for your connected devices! The following are the possible syntaxes for configuring voltage:"
msgstr ""

#: ../../src/use/basic.rst:104
msgid "all ports:        ``-V 3.3``"
msgstr ""

#: ../../src/use/basic.rst:105
msgid "one port:         ``-V A=3.3``"
msgstr ""

#: ../../src/use/basic.rst:106
msgid "several ports:    ``-V A=3.3,B=5.0`` or ``-V A=3.3 -V B=5.0``"
msgstr ""

#: ../../src/use/basic.rst:107
msgid "sense and repeat: ``-V A=SA`` or ``-V AB=SA``"
msgstr ""

#: ../../src/use/basic.rst:109
msgid "Putting it together, the following command will run the ``uart`` applet, with an I/O voltage of 3.3 V, and will configure pin ``A0`` to be `Tx` (Glasgow transmitting), and pin ``A1`` to be `Rx` (Glasgow receiving).  It uses the ``socket`` subcommand to bridge the UART to a socket:"
msgstr ""

#: ../../src/use/basic.rst:120
msgid "As the applet's output suggests, you can connect to TCP port 4321 using a tool of your choice --- ``nc`` or PuTTY will both work."
msgstr ""

#: ../../src/use/basic.rst:124
msgid "Inverting pins"
msgstr ""

#: ../../src/use/basic.rst:126
msgid "Any pin can be inverted via the command-line interface using one of the following syntaxes:"
msgstr ""

#: ../../src/use/basic.rst:128
msgid "single pin: ``--x A0#``"
msgstr ""

#: ../../src/use/basic.rst:129
msgid "pin range:  ``--x A0:7#``         (inverts the entire range)"
msgstr ""

#: ../../src/use/basic.rst:130
msgid "pin list:   ``--x A0,A1#,A2#,A3`` (inverts only specified pins)"
msgstr ""

#: ../../src/use/basic.rst:132
msgid "Pull-ups configured for a pin with inversion get converted to pull-downs and vice versa."
msgstr ""

#: ../../src/use/basic.rst:136
msgid "Examples"
msgstr ""

#: ../../src/use/basic.rst:140
msgid "UART"
msgstr ""

#: ../../src/use/basic.rst:142
msgid "The ``uart`` applet provides a basic full-duplex UART interface that can operate at virtually any reasonable baudrate, and also supports automatically detecting the baudrate based on frames sent by the remote device. The transmit and receive signals can also be easily inverted."
msgstr ""

#: ../../src/use/basic.rst:144
msgid "By running the applet using the ``tty`` mode, you will be delivered a direct pipe to the UART --- characters you enter into the terminal will be transmitted by the Glasgow hardware, and characters received by the Glasgow hardware will appear in the terminal."
msgstr ""

#: ../../src/use/basic.rst:146
msgid "The baud rate can be set using ``-b 57600``, and automatic baud rate detection can be enabled with ``-a``. Although reliable and particularly convenient for devices that change their baud rate as they boot, this detection mechanism is not perfect, and sometimes you may have to set the baud rate manually."
msgstr ""

#: ../../src/use/basic.rst:148
msgid "Aside from the ``tty`` mode, others are available (``pty``, ``socket``), which are explained further by the help text."
msgstr ""

#: ../../src/use/basic.rst:156
msgid "SPI controller"
msgstr ""

#: ../../src/use/basic.rst:158
msgid "The ``spi-controller`` applet implements an SPI controller, allowing full-duplex transfer to an SPI device. The following command will assert `CS#`, send the five bytes ``03 01 23 5f f5``, and then de-assert `CS#`, before printing the received data to the console."
msgstr ""

#: ../../src/use/basic.rst:167
msgid "I²C controller"
msgstr ""

#: ../../src/use/basic.rst:169
msgid "The ``i2c-controller`` applet implements an I²C controller, which features a simple bus scan operation from the command line, using the on-board pull-up resistors."
msgstr ""

#: ../../src/use/basic.rst:175
msgid "Using the :ref:`repl or script modes <repl-script>`, it's possible to easily communicate with devices, obeying clock stretching and other factors that are often ignored with bit-banged interfaces."
msgstr ""

#: ../../src/use/basic.rst:177
msgid "In the current Glasgow software, all applets are packaged as part of the Glasgow software distribution; future versions of Glasgow :ref:`may support out-of-tree applets <applet>`.  For the curious, the list of applets is retrieved from the `installed package's metadata <https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/#using-package-metadata>`_; this list, in turn, comes from the |pyproject_toml|_ file's ``project.entry-points.\"glasgow.applet\"`` section."
msgstr ""

