Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analog and Rotary Encoder doc updates #51

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Input latency is tested using the methodology outlined at [WydD's inputlag.scien

Full results can be found in the [GP2040-CE v0.7.8 Firmware Latency Test Results](https://github.com/OpenStickCommunity/Site/raw/main/latency_testing/GP2040-CE_Firmware_Latency_Test_Results_v0.7.8.xlsx) .xlsx Sheet.

Results from v0.7.7 can be found [HERE](https://github.com/OpenStickCommunity/Site/raw/main/latency_testing/GP2040-CE_Firmware_Latency_Test_Results_v0.7.7.xlsx). Previous results can be found in the `latency_testing` folder.
Results from v0.7.7 can be found [HERE](https://github.com/OpenStickCommunity/Site/raw/main/latency_testing/GP2040-CE_Firmware_Latency_Test_Results_v0.7.7.xlsx). Previous results can be found in the `latency_testing` folder [HERE](https://github.com/OpenStickCommunity/Site/tree/main/latency_testing).

## Support

Expand Down
31 changes: 17 additions & 14 deletions docs/add-ons/analog.mdx → docs/add-ons/analog-internal.mdx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
title: Analog
title: Analog (Internal ADC)
# tags:
# -
pagination_next: null
pagination_prev: null
description: "Add-on to use hardware analog joysticks with GP2040-CE"
---

# Analog
# Analog (Internal ADC)

Purpose: This add-on is intended for the use of an hardware analog joystick with GP2040-CE for the left and right analog sticks of the gamepad.

![GP2040-CE Configurator - Add-Ons Analog](../assets/images/gpc-add-ons-analog.png)
**Purpose:** Enable the use of analog joysticks using the built-in ADC of the RP2040.

## Web Configurator Options

![GP2040-CE Configurator - Analog (Internal ADC) options](../assets/images/gpc-add-ons-analog.png)

- `Analog Stick 1 X Pin` - The GPIO pin used for the Analog joystick 1 X value. Only ADC pins 26, 27, 28 and 29 are allowed here.
- `Analog Stick 1 Y Pin` - The GPIO pin used for the Analog joystick 1 Y value. Only ADC pins 26, 27, 28 and 29 are allowed here.
- `Analog Stick 1 Mode` - Choose if Analog joystick 1 is to be used for Left Analog or Right Analog.
Expand All @@ -31,18 +31,15 @@ Purpose: This add-on is intended for the use of an hardware analog joystick with

### Requirements

A minimum of one hardware analog joystick is required for the use of this add-on. Each joystick will have at least 4 pins, one for each of the following.

- Reference Voltage (ADC_VREF/3.3V)
- X-Axis Input Voltage (Vx)
- Y-Axis Input Voltage (Vy)
- Ground (GND)
A minimum of one hardware analog joystick is required for the use of this add-on.

Each axis input voltage pin requires an Analog to Digital Converter (ADC) pin to operate. As such, some boards may have a limit on the maximum number of possible joysticks that can be used (e.g. the Raspberry Pi Pico only has 3 ADC pins available so only 1 joystick can be used).
Each joystick will require the use of 2 Analog to Digital Converter (ADC) pins to operate.

:::note Joystick Buttons
:::note Check ADC Pin Availability!!!

The analog joystick may have an additional pin for the joystick button. This can be connected to any GPIO pin and used as a regular button.
The **Raspberry Pi Pico and some of its clone boards do not expose GPIO 29**, leaving only 3 usable ADC GPIO pins: **26, 27, 28**.
Keep this in mind when designing hardware that uses analog inputs from one of these boards, or similar boards that don't expose all
4 of the RP2040 ADC pins, as this will limit the number of joysticks that can be used.

:::

Expand All @@ -55,6 +52,12 @@ Connect the pins of the analog joystick to the board as follows and then set the
- Y-Axis Input Voltage (Vy) -> Any ADC GPIO Pin
- Ground (GND) -> Any GND Pin

:::note Joystick Buttons

The analog joystick may have an additional pin for the joystick button. This can be connected to any GPIO pin and used as a regular button.

:::

The specific location of the ADC pins on your board will vary depending on the design and manufacturer, but they will always be one of the following GPIO pins on the RP2040

- GPIO 26
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: I2C Analog ADS1219
title: Analog (I2C ADC ADS1219)
# tags:
# -
pagination_next: null
Expand All @@ -9,22 +9,23 @@ description: "Add-on to use an ADS1219 ADC for Left and Right analog joysticks o

import I2CTable from "../snippets/_i2c-block-table.mdx";

# I2C Analog ADS1219
# Analog (I2C ADC ADS1219)

Purpose: This add-on is intended to allow you to add Left and Right analog joystick functionality using the ADS1219 24-bit, analog-to-digital
converter (ADC).
**Purpose:** Enable the use of analog joysticks using an ADS1219 24-bit, analog-to-digital
converter (ADC) module connected via the I2C bus.

![GP2040-CE Configurator - Add-Ons ADS1219](../assets/images/gpc-add-ons-ads1219.png)
:::info I2C Setup

## Web Configurator Options
This addon requires I2C to be configured in [`Peripheral Mapping`](../web-configurator/menu-pages/03-peripheral-mapping.mdx#i2c)
in order to be used.

:::info GPIO Pin Assignment
:::

The SDA and SCL pins for I2C and speed are now configured in [`Configuration > Peripheral Mapping - I2C`](../web-configurator/menu-pages/03-peripheral-mapping.mdx#i2c).
## Web Configurator Options

:::
![GP2040-CE Configurator - Analog (I2C ADC ADS1219) options](../assets/images/gpc-add-ons-ads1219.png)

- `I2C Analog ADS1219 Block` - The block of I2C to use (i2c0 or i2c1).
- `I2C Analog ADS1219 Block` - The [`I2C Block`](../web-configurator/menu-pages/03-peripheral-mapping.mdx#i2c) to use (i2c0 or i2c1).
- `I2C Analog ADS1219 Address` - Sets the address for the I2C Analog ADS1219 based on the pins used for SDA and SCL according to the table below.

| A0 | A1 | I2C Address |
Expand All @@ -44,8 +45,8 @@ Connect the pins on the ADS1219 according to the table below

| ADS1219 Pin | Function |
| :---------: | ---------------------------- |
| A0 | SDA or SCL |
| A1 | SDA or SCL |
| A0 | I2C Block SDA or SCL |
| A1 | I2C Block SDA or SCL |
| AIN0 | Left analog joystick X-Axis |
| AIN1 | Left analog joystick Y-Axis |
| AIN2 | Right analog joystick X-Axis |
Expand Down
80 changes: 80 additions & 0 deletions docs/add-ons/analog-module-spi-ads1256.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
title: Analog (SPI ADC ADS1256)
# tags:
# -
pagination_next: null
pagination_prev: null
description: "Add-on to use ADS1256 SPI for compatible accessories (currently in early beta)"
---

# Analog (SPI ADC ADS1256)

**Purpose:** Enable the use of analog joysticks and triggers using an ADS1256 8-channel, 24-bit analog-to-digital
converter (ADC) module via the SPI bus.

:::info SPI Setup

This addon requires SPI to be configured in [`Peripheral Mapping`](../web-configurator/menu-pages/03-peripheral-mapping.mdx#spi)
in order to be used.

:::

:::caution BETA

Please note the `Analog (SPI ADC ADS1256)` feature is currently in beta.
Please create a [Bug Report](https://github.com/OpenStickCommunity/GP2040-CE/issues/new?labels=bug&template=issue---bug-report.md)
if you find any issues.

:::

## Web Configurator Options

![GP2040-CE Configurator - Analog (SPI ADC ADS1256) options](../assets/images/gpc-add-ons-ads1256-spi.png)

- `SPI Block` - The [`SPI Block`](../web-configurator/menu-pages/03-peripheral-mapping.mdx#spi) to use (spi0 or spi1).
- `Chip Select (CS) Pin` - The GPIO pin to use for Chip Select signal. The option labeled `(HW)` is the hardware CS pin configured
for the [`SPI Block`](../web-configurator/menu-pages/03-peripheral-mapping.mdx#spi).
- `Data Ready (DRDY) Pin` - The GPIO pin to use for the Data Ready signal.
- `Analog Max` - The maximum voltage to be used for analog reads. Options are `3.3V` and `5V`.
- `Enable Triggers` - Flag to enable reading and reporting of triggers with this module.

### Setting Analog Max Value

The ADS1256 requires an analog source voltage of 5V. This allows joysticks and analog triggers to use either 3.3V or 5V as a
reference voltage (VREF). Set the `Analog Max` value to match the VREF of your analog controls.

## Hardware

### Requirements

This add-on requires an ADS1256 analog-to-digital converter (ADC) to function properly.

### Installation

Connect the pins on the ADS1256 according to the table below

| ADS1256 Pin | Connects To |
| :---------: | ----------------------------- |
| DIN | SPI Block TX |
| DOUT | SPI Block RX |
| CS* | SPI Block CS |
| SCLK | SPI Block SCK |
| DRDY | Data Ready (DRDY) Pin |
| AIN0 | Left analog joystick X-Axis |
| AIN1 | Left analog joystick Y-Axis |
| AIN2 | Right analog joystick X-Axis |
| AIN3 | Right analog joystick Y-Axis |
| AIN4** | Left trigger Axis |
| AIN5** | Right trigger Axis |

\* The ADS1256 CS pin can optionally be attached to any other available GPIO pin if there are multiple SPI devices on the same
[`SPI Block`](../web-configurator/menu-pages/03-peripheral-mapping.mdx#spi).

\** Requires the `Enable Triggers` option to be enabled.

## Miscellaneous Notes

These installation instructions do not cover the additional circuitry required for the use of the ADS1256 ADC, only the wiring to
the RP2040 and analog controls.

[ADS1256 Product Sheet](https://www.ti.com/lit/ds/symlink/ads1256.pdf)
33 changes: 0 additions & 33 deletions docs/add-ons/i2c-analog-ads1256-spi.mdx

This file was deleted.

26 changes: 15 additions & 11 deletions docs/add-ons/rotary-encoders.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,32 @@ description: "Add-on to allow for the use of rotary encoders."

# Rotary Encoders

:::Note
**Purpose:** `Rotary Encoders` allows for continuous or limited min-max pulses on specified pins.
Up to 2 rotary encoders can be enabled.

Please note that rotary encoders are currently in beta.
:::
:::caution BETA

Purpose: Rotary encoders allow for continuous or limited min-max pulses on specified pins.
Please note the `Rotary Encoders` feature is currently in beta.
Please create a [Bug Report](https://github.com/OpenStickCommunity/GP2040-CE/issues/new?labels=bug&template=issue---bug-report.md)
if you find any issues.

![GP2040-CE Configuration - Add-Ons Rotary Encoders](../assets/images/gpc-add-ons-rotary-encoders.png)
:::

## Web Configurator Options

![GP2040-CE Configuration - Add-Ons Rotary Encoders](../assets/images/gpc-add-ons-rotary-encoders.png)

- `Enabled` - Enables or disables `Encoder 1` or `Encoder 2`.
- `Pin A/CLK` - The `Clock` pin for the encoder.
- `Pin B/DT` - The `Data` pin for the encoder`.
- `Pulses/Revolutions (PPR)` - The number of puleses/revolutions on your encoder.
- `Pulses/Revolutions (PPR)` - The number of pulses/revolutions on your encoder.
- `Multiplier` - Use this multiplier to fine tune your encoder performance in GP2040-CE.
- `Reset After (ms)` - The number of miliseconds to wait before resetting the value to `0` / `center`.
- `Reset After (ms)` - The number of miliseconds to wait before resetting the reported encoder value to neutral, or no output.
A value of `0` will disable resetting the reported encoder value.
- `Control Mode` - Choose how this encoder will function.
- `Allow Wrap-Around` - Allows the encoder to reach an axis max and wrap-around to the axis minimum.

-
- `Allow Wrap-Around` - Allows the reported encoder value to wrap around to the min or max value when continually
rotating in a single direction.

## Hardware

At this time we do not have recommended modules. This is a newly introduced feature.
At this time we do not have recommended modules. This is a newly introduced feature.
2 changes: 1 addition & 1 deletion docs/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ Selected D-Pad mode and SOCD cleaning mode are saved across power cycles.

## Add-Ons and Additional Features

There are a number of add-ons that expand the functionality of GP2040-CE, such as [analog joystick emulation](./add-ons/analog.mdx) and [turbo functions](./add-ons/turbo.mdx). Due to the large number of add-ons created by the community, they are located in a separate documentation page. Navigate to Add-Ons page for more information on the individual add-ons.
There are a number of add-ons that expand the functionality of GP2040-CE, such as [analog joystick emulation](./add-ons/analog-internal.mdx) and [turbo functions](./add-ons/turbo.mdx). Due to the large number of add-ons created by the community, they are located in a separate documentation page. Navigate to Add-Ons page for more information on the individual add-ons.
2 changes: 1 addition & 1 deletion docs/web-configurator/menu-pages/03-peripheral-mapping.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Here you can assign the GPIO pins necessary for using input modes, peripherals,
- [PS4 Input Mode](./01-settings.mdx#additional-ps4-settings)
- [PS5 Input Mode](./01-settings.mdx#additional-ps5-settings)
- [OLED Display](./07-display-configuration.mdx)
- [I2C Analog ADS1219](../../add-ons/i2c-analog-ads1219.mdx)
- [Analog (I2C ADC ADS1219)](../../add-ons/analog-module-i2c-ads1219.mdx)
- [Xbox One Input Mode](./01-settings.mdx#additional-xbox-one-settings)
- [Keyboard Host Add-on](../../add-ons/keyboard-host.mdx)

Expand Down
20 changes: 13 additions & 7 deletions docs/web-configurator/menu-pages/08-add-ons-configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,32 @@ Some of these add-ons are experimental and not all add-ons are interoperable wit

## Available Add-ons

- [Analog](../../add-ons/analog.mdx)
- [Analog (Internal ADC)](../../add-ons/analog-internal.mdx)
- [Analog (I2C ADC ADS1219)](../../add-ons/analog-module-i2c-ads1219.mdx)
- [Analog (SPI ADC ADS1256)](../../add-ons/analog-module-spi-ads1256.mdx)
- [BOOTSEL Button Configuration](../../add-ons/bootsel-button.mdx)
- [Buzzer Speaker](../../add-ons/buzzer-speaker.mdx)
- [Dual Directional Input](../../add-ons/dual-direction-input.mdx)
- [Focus Mode Configuration](../../add-ons/focus-mode.mdx)
- [I2C Analog ADS1219](../../add-ons/i2c-analog-ads1219.mdx)
- [Input History](../../add-ons/input-history.mdx)
- [Input Reverse](../../add-ons/input-reverse.mdx)
- [Joystick Selection Slider](../../add-ons/joystick-selection-slider.mdx)
- [Keyboard Host Configuration](../../add-ons/keyboard-host.mdx)
- [On-board LED Configuration](../../add-ons/on-board-led.mdx)
- [Player Number (X-INPUT ONLY)](../../add-ons/player-number.mdx)
- [SNES Input](../../add-ons/snes-input.mdx)
- [SOCD Selection Slider](../../add-ons/socd-selection-slider.mdx)
- [Rotary Encoders](../../add-ons/rotary-encoders.mdx)
- [SNES Extension Configuration](../../add-ons/snes-input.mdx)
- [SOCD Cleaning Mode Selection Slider](../../add-ons/socd-selection-slider.mdx)
- [Tilt Input](../../add-ons/tilt-input.mdx)
- [Turbo](../../add-ons/turbo.mdx)
- [Wii Extensions](../../add-ons/wii-extensions.mdx)

## Deprecated Add-ons

- PS4 Mode
- PS Passthrough
- Xbox One Passthrough
- PS4 Mode *
- PS Passthrough **
- Xbox One Passthrough ***

* PS4 Mode has been moved to the main settings section under `Current Input Mode` / `PS4` when you select `Upload Key Files` for the `Authentication Settings`.
** PS Passthrough mode has been moved to the main settings section under both `PS4` and `PS5` modes.
*** Xbox One Passthrough mode has been moved to the main settins section under `Xbox One` mode and is turned on by default.
Loading