diff --git a/boards/beaglebone/ai-64/02-quick-start.rst b/boards/beaglebone/ai-64/02-quick-start.rst index b754f63ba824c087441c1d6a67ee8b25ead62193..81b108c10f24b35bb5d471c4a8009d1c03469b60 100644 --- a/boards/beaglebone/ai-64/02-quick-start.rst +++ b/boards/beaglebone/ai-64/02-quick-start.rst @@ -71,8 +71,6 @@ Each of these configurations is discussed in general terms in the following sect In this configuration, the board is powered by the PC via a single USB cable. The board is accessed either as a USB storage drive or via the browser on the connected PC. You need to use either Firefox or Chrome on the PC, Internet Explorer will not work properly. - .. _tethered-figure: - .. figure:: media/ch03/usb-tethering.* :width: 740px :align: center @@ -85,23 +83,17 @@ Each of these configurations is discussed in general terms in the following sect unsure that the system can provide the required power or are otherwise using a USB-A to Type-C cable which will always require power from the DC barrel jack. - .. _connect-the-cable-to-the-board: - **Connect the Cable to the Board** 1. Connect the type C USB cable to the board as shown in :ref:`usb-c-connect-figure`. The connector is on the top side of the board near barrel jack. - .. _usb-c-connect-figure: - .. figure:: media/ch03/usb-c-connection.* :width: 740px :align: center USB Connection to the Board - 2. Connect the USB-A end of the cable to your PC or laptop USB port as shown in the :ref:`usb-a-connect-figure` below. - - .. _usb-a-connect-figure: + 1. Connect the USB-A end of the cable to your PC or laptop USB port as shown in the :ref:`usb-a-connect-figure` below. .. figure:: media/ch03/usb-a-connection.* :width: 740px @@ -109,9 +101,7 @@ Each of these configurations is discussed in general terms in the following sect USB Connection to the PC/Laptop - 3. The board will power on and the power LED will be on as shown in :ref:`power-led-figure` below. - - .. _power-led-figure: + 1. The board will power on and the power LED will be on as shown in :ref:`power-led-figure` below. .. figure:: media/ch03/power-led.* :width: 740px @@ -119,9 +109,7 @@ Each of these configurations is discussed in general terms in the following sect Board Power LED - 4. When the board starts to the booting process started by the process of applying power, the LEDs will come on in sequence as shown in :ref:`boot-status-figure` below. It will take a few seconds for the status LEDs to come on, so be patient. The LEDs will be flashing in an erratic manner as it begins to boot the Linux kernel. - - .. _boot-status-figure: + 1. When the board starts to the booting process started by the process of applying power, the LEDs will come on in sequence as shown in :ref:`boot-status-figure` below. It will take a few seconds for the status LEDs to come on, so be patient. The LEDs will be flashing in an erratic manner as it begins to boot the Linux kernel. .. figure:: media/ch03/led-pattern.* :width: 740px @@ -129,8 +117,6 @@ Each of these configurations is discussed in general terms in the following sect Board Boot Status - .. _accessing-the-board-as-a-storage-drive: - **Accessing the Board as a Storage Drive** The board will appear around a USB Storage drive on your PC after thekernel has booted, which will take a round 10 seconds. The kernel on the board needs to boot before the port gets enumerated. Once the board appears as a storage drive, do the following: @@ -144,8 +130,6 @@ Each of these configurations is discussed in general terms in the following sect In this configuration, the board works more like a PC, totally free from any connection to a PC as shown in :ref:`desktop-config-figure`. It allows you to create your code to make the board do whatever you need it to do. It will however require certain common PC accessories. These accessories and instructions are described in the following section. - .. _desktop-config-figure: - .. figure:: media/ch03/desktop-configuration.* :width: 740px :align: center @@ -154,8 +138,6 @@ Each of these configurations is discussed in general terms in the following sect Ethernet cable and M.2 WiFi + Bluetooth card are optional. They can be used if network access required. - .. _required-accessories: - **Required Accessories** In order to use the board in this configuration, you will need the following accessories: @@ -167,23 +149,17 @@ Each of these configurations is discussed in general terms in the following sect * powered USB HUB (OPTIONAL). The board has only two USB Type-A host ports, so you may need to use a powered USB Hub if you wish to add additional USB devices, such as a USB WiFi adapter. * M.2 Bluetooth & WiFi module (OPTIONAL). For wireless connections, a USB WiFi adapter or a recommended M.2 WiFi module can provide wireless networking. - .. _connecting-up-the-board: - **Connecting Up the Board** 1. Connect the miniDP to DP or active miniDP to HDMI cable from your BeagleBone AI-64 to your monitor. - .. _display-cable-figure,miniDP-DP or active miniDP-HDMI cable connection figure: - .. figure:: media/ch03/monitor-cable.* :width: 740px :align: center Connect miniDP-DP or active miniDP-HDMI cable to BeagleBone AI-64 - 2. If you have an Display Port or HDMI monitor with HDMI-HDMI or DP-DP cable you can use adapters as shown in. :ref:`display-adapters-figure`. - - .. _display-adapters-figure: + 1. If you have an Display Port or HDMI monitor with HDMI-HDMI or DP-DP cable you can use adapters as shown in. :ref:`display-adapters-figure`. .. figure:: media/ch03/display-adapters.* :width: 740px @@ -191,10 +167,7 @@ Each of these configurations is discussed in general terms in the following sect Display adapters - 3. If you have wired/wireless USB keyboard and mouse such as seen in :ref:`keyboard-mouse-figure` below, you need to plug the receiver in the USB host port of the board as shown in :ref:`keyboard-mouse-figure`. - - - .. _keyboard-mouse-figure: + 1. If you have wired/wireless USB keyboard and mouse such as seen in :ref:`keyboard-mouse-figure` below, you need to plug the receiver in the USB host port of the board as shown in :ref:`keyboard-mouse-figure`. .. figure:: media/ch03/mouse-keyboard.* :width: 740px @@ -202,14 +175,12 @@ Each of these configurations is discussed in general terms in the following sect Keyboard and Mouse - 4. Connect the Ethernet Cable + 1. Connect the Ethernet Cable If you decide you want to connect to your local area network, an Ethernet cable can be used. Connect the Ethernet Cable to the Ethernet port as shown in :ref:`ethernet-cable-figure`. Any standard 100M Ethernet cable should work. - .. _ethernet-cable-figure: - .. figure:: media/ch03/ethernet-cable.* :width: 740px :align: center @@ -217,9 +188,7 @@ Each of these configurations is discussed in general terms in the following sect Ethernet Cable Connection - 5. The final step is to plug in the DC power supply to the DC power jack as shown in :ref:`barrel-jack-figure` below. - - .. _barrel-jack-figure: + 1. The final step is to plug in the DC power supply to the DC power jack as shown in :ref:`barrel-jack-figure` below. .. figure:: media/ch03/barrel-jack.* :width: 740px @@ -227,9 +196,7 @@ Each of these configurations is discussed in general terms in the following sect External DC Power - 6. The cable needed to connect to your display is a miniDP-DP or active miniDP-HDMI. Connect the miniDP connector end to the board at this time. The connector is on the top side of the board as shown in :ref:`miniDP-figure` below. - - .. _miniDP-figure: + 1. The cable needed to connect to your display is a miniDP-DP or active miniDP-HDMI. Connect the miniDP connector end to the board at this time. The connector is on the top side of the board as shown in :ref:`miniDP-figure` below. .. figure:: media/ch03/miniDP-connector.* :width: 740px @@ -239,12 +206,10 @@ Each of these configurations is discussed in general terms in the following sect The connector is fairly robust, but we suggest that you not use the cable as a leash for your Beagle. Take proper care not to put too much stress on the connector or cable. - 7. Booting the Board + 1. Booting the Board As soon as the power is applied to the board, it will start the booting up process. When the board starts to boot the LEDs will come on. It will take a few seconds for the status LEDs to come on, so be patient. The LEDs will be flashing in an erratic manner as it boots the Linux kernel. - .. _LEDs-figure,BeagleBone AI-64 LEDs figure: - .. figure:: media/ch03/leds.* :width: 740px :align: center @@ -260,15 +225,13 @@ Each of these configurations is discussed in general terms in the following sect * **USR3** turns on when the onboard eMMC is being accessed. * **USR4** is an activity indicator for WiFi. - 8. A Booted System + 1. A Booted System a. The board will have a mouse pointer appear on the screen as it enters the Linux boot step. You may have to move the physical mouse to get the mouse pointer to appear. The system can come up in the suspend mode with the monitor in a sleep mode. b. After a minute or two a login screen will appear. You do not have to do anything at this point. c. After a minute or two the desktop will appear. It should be similar to the one shown in :ref:`figure-16`. HOWEVER, it will change from one release to the next, so do not expect your system to look exactly like the one in the figure, but it will be very similar. d. And at this point you are ready to go! :ref:`figure-16` shows the desktop after booting. - .. _figure-16: - .. figure:: media/ch03/xfce-desktop.* :width: 740px :align: center diff --git a/books/beaglebone-cookbook/02sensors/sensors.rst b/books/beaglebone-cookbook/02sensors/sensors.rst index 87700d59ed44992442fd9a4a76bda1c44a085856..e17006ae97244444d1bcb5d9110213513017c542 100644 --- a/books/beaglebone-cookbook/02sensors/sensors.rst +++ b/books/beaglebone-cookbook/02sensors/sensors.rst @@ -167,14 +167,11 @@ or both on the Bone, as shown in :ref:`js_pushbutton_fig`. Diagram for wiring a pushbutton and magnetic reed switch input -The code in :ref:`py_pushbutton_code` -reads GPIO port *P9_42*, which is attached to the pushbutton. +The code below reads GPIO port *P9_42*, which is attached to the pushbutton. .. tabs:: .. group-tab:: Python - .. _py_pushbutton_code: - .. literalinclude:: ../code/02sensors/pushbutton.py :caption: Monitoring a pushbutton (pushbutton.py) :language: python @@ -184,8 +181,6 @@ reads GPIO port *P9_42*, which is attached to the pushbutton. .. group-tab:: c - .. _c_pushbutton_code: - .. literalinclude:: ../code/02sensors/pushbutton.c :caption: Monitoring a pushbutton (pushbutton.c) :language: c @@ -313,15 +308,13 @@ is wired to one of the seven analog-in ports (*P9_36*). Wiring a 10 |kohm| variable resistor (trimpot) to an ADC port -:ref:`py_analogIn_code` shows the code used to read the variable resistor. +The section below shows the code used to read the variable resistor. Add the code to a file called *analogIn.py* and run it; then change the resistor and run it again. The voltage read will change. .. tabs:: .. group-tab:: Python - .. _py_analogIn_code: - .. literalinclude:: ../code/02sensors/analogIn.py :caption: Reading an analog voltage (analogIn.py) :language: python @@ -331,8 +324,6 @@ Add the code to a file called *analogIn.py* and run it; then change the resistor .. group-tab:: JavaScript - .. _sensors_analogIn_code: - .. literalinclude:: ../code/02sensors/analogIn.js :caption: Reading an analog voltage (analogIn.js) :language: JavaScript @@ -342,8 +333,7 @@ Add the code to a file called *analogIn.py* and run it; then change the resistor .. note:: - The code in :ref:`sensors_analogIn_code` - outputs a value between 0 and 4096. + The code above outputs a value between 0 and 4096. A variable resistor with two terminals ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -362,8 +352,7 @@ across the flex sensor. Reading a two-terminal flex resistor -The code in :ref:`py_analogIn_code` and -:ref:`sensors_analogIn_code` also works for this setup. +The code in ``analogIn.py`` also works for this setup. Reading a Distance Sensor (Analog or Variable Voltage Sensor) ============================================================= @@ -398,15 +387,12 @@ as shown in :ref:`sensors_ultrasonic_fig`. The device outputs ~6.4 mV/in when po Wiring the LV-MaxSonar-EZ1 Sonar Range Finder to the *P9_33* analog-in port -:ref:`py_ultrasonicRange_code` -shows the code that reads the sensor at a fixed interval. +``ultrasonicRange.py`` shows the code that reads the sensor at a fixed interval. .. tabs:: .. group-tab:: Python - .. _py_ultrasonicRange_code: - .. literalinclude:: ../code/02sensors/ultrasonicRange.py :caption: Reading an analog voltage (ultrasonicRange.py) :language: python @@ -416,8 +402,6 @@ shows the code that reads the sensor at a fixed interval. .. group-tab:: JavaScript - .. _sensors_ultrasonicRange_code: - .. literalinclude:: ../code/02sensors/ultrasonicRange.js :caption: Reading an analog voltage (ultrasonicRange.js) :language: JavaScript @@ -556,15 +540,12 @@ Then run the following commands: This will enable *eQEP2* on pins *P8_11* and *P8_12*. The *2* after the *qep* returned by *show-pins* shows it's *eQEP2*. -Finally, add the code in :ref:`digital_rotaryEncoder_py` -to a file named *rotaryEncoder.py* and run it. +Finally, add the code below to a file named *rotaryEncoder.py* and run it. .. tabs:: .. group-tab:: Python - .. _digital_rotaryEncoder_py: - .. literalinclude:: ../code/02sensors/rotaryEncoder.py :caption: Reading a rotary encoder (rotaryEncoder.py) :language: python @@ -574,8 +555,6 @@ to a file named *rotaryEncoder.py* and run it. .. group-tab:: JavaScript - .. _digital_rotaryEncoder_js: - .. literalinclude:: ../code/02sensors/rotaryEncoder.js :caption: Reading a rotary encoder (rotaryEncoder.js) :language: JavaScript @@ -737,8 +716,7 @@ the value. It returns the temperature in hexadecimal and degrees C. In this example, 0x18 = 24{deg}C, which is 75.2{deg}F. (Hmmm, the office is a bit warm today.) Try warming up the TMP101 with your finger and running *i2cget* again. -.. todo - fix deg +.. todo:: fix deg .. _js_i2cTools: @@ -832,13 +810,12 @@ You can try the Linux Kernel Driver Database, https://cateee.net/lkddb/ to see them. Once the driver is in place, you can read it via code. -:ref:`py_i2cTemp_code` shows how to read the TMP101. +``i2cTemp.py``` shows how to read the TMP101. .. tabs:: + .. group-tab:: Python - .. _py_i2cTemp_code: - .. literalinclude:: ../code/02sensors/i2cTemp.py :caption: Reading an |I2C| device (i2cTemp.py) :language: python @@ -848,8 +825,6 @@ Once the driver is in place, you can read it via code. .. group-tab:: JavaScript - .. _js_i2cTemp_code: - .. literalinclude:: ../code/02sensors/i2cTemp.js :caption: Reading an |I2C| device (i2cTemp.js) :language: JavaScript @@ -969,16 +944,13 @@ Now run the following command to discover the serial number on your device: I have two devices wired in parallel on the same P9_12 input. This shows the serial numbers for all the devices. -Finally, add the code in :ref:`py_onewire__code` in to a -file named *w1.py*, edit the path assigned to *w1* so +Finally, add the code below in to a file named *w1.py*, edit the path assigned to *w1* so that the path points to your device, and then run it. .. tabs:: .. group-tab:: Python - .. _py_onewire__code: - .. literalinclude:: ../code/02sensors/w1.py :caption: Reading a temperature with a DS18B20 (w1.py) :language: python @@ -988,8 +960,6 @@ that the path points to your device, and then run it. .. group-tab:: JavaScript - .. _sensors_onewire__code: - .. literalinclude:: ../code/02sensors/w1.js :caption: Reading a temperature with a DS18B20 (w1.js) :language: JavaScript diff --git a/conf.py b/conf.py index ba9af0b8e8d139d33f917a4ca59e18657f91b2b4..4f3c4db4d3616c734827268d893b5fd3ba1641f7 100644 --- a/conf.py +++ b/conf.py @@ -178,34 +178,35 @@ html_theme_options = { } # parse version from 'VERSION' file -# with open("VERSION") as f: -# m = re.match( -# ( -# r"^VERSION_MAJOR\s*=\s*(\d+)$\n" -# + r"^VERSION_MINOR\s*=\s*(\d+)$\n" -# + r"^PATCHLEVEL\s*=\s*(\d+)$\n" -# + r"^VERSION_TWEAK\s*=\s*\d+$\n" -# + r"^EXTRAVERSION\s*=\s*(.*)$" -# ), -# f.read(), -# re.MULTILINE, -# ) - -# if not m: -# sys.stderr.write("Warning: Could not extract docs version\n") -# version = "Unknown" -# else: -# major, minor, patch, extra = m.groups(1) -# version = ".".join((major, minor, patch)) -# release_version = ".".join((major, minor)) -# if extra: -# version += "-" + extra - -# release = version + +with open("VERSION") as f: + m = re.match( + ( + r"^VERSION_MAJOR\s*=\s*(\d+)$\n" + + r"^VERSION_MINOR\s*=\s*(\d+)$\n" + + r"^PATCHLEVEL\s*=\s*(\d+)$\n" + + r"^VERSION_TWEAK\s*=\s*\d+$\n" + + r"^EXTRAVERSION\s*=\s*(.*)$" + ), + f.read(), + re.MULTILINE, + ) + + if not m: + sys.stderr.write("Warning: Could not extract docs version\n") + version = "Unknown" + else: + major, minor, patch, extra = m.groups(1) + version = ".".join((major, minor, patch)) + release_version = ".".join((major, minor)) + if extra: + version += "-" + extra + +release = version # Variables here holds default settings pages_url = "https://docs.beagleboard.io" -# pages_slug = "latest" +pages_slug = "latest" gitlab_user = "docs" gitlab_version = "main" gitlab_url = "https://openbeagle.org" @@ -213,32 +214,33 @@ gitlab_repo = "docs.beagleboard.io" docs_url = "https://docs.beagleboard.io" # parse pages details from 'PAGES' file -# with open("PAGES") as f: -# m = re.match( -# ( -# r"^PAGES_URL\s*=\s*(\S+)$\n" -# + r"^PAGES_SLUG\s*=\s*(\S+)$\n" -# + r"^GITLAB_USER\s*=\s*(\S+)$\n" -# + r"^PROJECT_BRANCH\s*=\s*(\S+)$\n" -# + r"^GITLAB_HOST\s*=\s*(\S+)$\n" -# + r"^PROJECT_REPO\s*=\s*(\S+)$\n" -# ), -# f.read(), -# re.MULTILINE, -# ) - -# if not m: -# sys.stderr.write("Warning: Could not extract pages information\n") -# else: -# url, slug, user, branch, host, repo = m.groups(1) -# slug = "latest" if slug == "main" else slug -# pages_url = url -# pages_slug = slug -# gitlab_user = user -# gitlab_version = branch -# gitlab_url = host -# gitlab_repo = repo -# docs_url = "/".join((url, slug)) + +with open("PAGES") as f: + m = re.match( + ( + r"^PAGES_URL\s*=\s*(\S+)$\n" + + r"^PAGES_SLUG\s*=\s*(\S+)$\n" + + r"^GITLAB_USER\s*=\s*(\S+)$\n" + + r"^PROJECT_BRANCH\s*=\s*(\S+)$\n" + + r"^GITLAB_HOST\s*=\s*(\S+)$\n" + + r"^PROJECT_REPO\s*=\s*(\S+)$\n" + ), + f.read(), + re.MULTILINE, + ) + + if not m: + sys.stderr.write("Warning: Could not extract pages information\n") + else: + url, slug, user, branch, host, repo = m.groups(1) + slug = "latest" if slug == "main" else slug + pages_url = url + pages_slug = slug + gitlab_user = user + gitlab_version = branch + gitlab_url = host + gitlab_repo = repo + docs_url = "/".join((url, slug)) html_context = { "display_gitlab": True, @@ -248,7 +250,6 @@ html_context = { "gitlab_version": gitlab_version, "doc_path": "", #"use_edit_page_button": True, - #"edit_page_provider_name": "OpenBeagle", #"edit_page_url_template": "https://openbeagle.org/XXXX/{{ file_name }}", "conf_py_path": "", "show_license": True, @@ -262,23 +263,23 @@ html_context = { # -- Options for LaTeX output -- -# latex_elements = { -# "papersize": "a4paper", -# "maketitle": open("_static/latex/title.tex").read(), -# "preamble": open("_static/latex/preamble.tex").read(), -# "sphinxsetup": ",".join( -# ( -# "verbatimwithframe=false", -# "VerbatimColor={HTML}{f0f2f4}", -# "InnerLinkColor={HTML}{2980b9}", -# "warningBgColor={HTML}{e9a499}", -# "warningborder=0pt", -# r"HeaderFamily=\rmfamily\bfseries", -# ) -# ), -# } -# latex_engine = "xelatex" -# latex_logo = "_static/images/logo-latex.pdf" -# latex_documents = [ -# ("index-tex", "beagleboard-docs.tex", "BeagleBoard Docs", author, "manual"), -# ] \ No newline at end of file +latex_elements = { + "papersize": "a4paper", + "maketitle": open("_static/latex/title.tex").read(), + "preamble": open("_static/latex/preamble.tex").read(), + "sphinxsetup": ",".join( + ( + "verbatimwithframe=false", + "VerbatimColor={HTML}{f0f2f4}", + "InnerLinkColor={HTML}{2980b9}", + "warningBgColor={HTML}{e9a499}", + "warningborder=0pt", + r"HeaderFamily=\rmfamily\bfseries", + ) + ), +} +latex_engine = "xelatex" +latex_logo = "_static/images/logo-latex.pdf" +latex_documents = [ + ("index-tex", "beagleboard-docs.tex", "BeagleBoard Docs", author, "manual"), +] \ No newline at end of file