Skip to content

GPIO Configuration

gtxaspec edited this page Feb 6, 2024 · 11 revisions

GPIO Specific Variables

  • gpio_default: GPIOs configured during device boot.
  • gpio_default_net: GPIOs configured at boot only if the device lacks a physical ethernet connection.
  • gpio_ircut: GPIOs set at device boot for IRCUT safety. De-energizes common IRCUT GPIOs to prevent damage to IRCUT coils.
  • gpio_user: General set defined by the user.
  • gpio_mmc_power: If sd_disable is set to false, these GPIOs are configured during boot to enable operations with the SD card.
  • gpio_button: GPIO used for configuring a physical reset button.

GPIO Configuration Format

  • GPIO Number: Numerical identifier for the specific GPIO.
  • Operation Mode: Indicated by appending letters to the GPIO number.
    • I (uppercase 'i'): Configures the GPIO as an Input.
    • O (uppercase 'o'): Sets the GPIO as an Output with a High (logic 1) state.
    • o (lowercase 'o'): Sets the GPIO as an Output with a Low (logic 0) state.
    • U (uppercase 'u') or u (lowercase 'u'): Disables the pull-up resistor for the GPIO (when in input mode).
    • D (uppercase 'd') or d (lowercase 'd'): Disables the pull-down resistor for the GPIO (when in input mode).
    • Space Separation: Each GPIO setting must be separated by a space to distinguish individual configurations

GPIO Specific MOTOR Variables

  • Different Format Alert: Unlike other GPIO configurations, gpio_motor_v and gpio_motor_h use a unique format:
    • gpio_motor_v and gpio_motor_h: These variables configure the GPIOs for vertical and horizontal motors. They use a space-separated format for GPIO numbers, each critical for managing motor operation phases. For example, gpio_motor_v=12 13 14 15 assigns GPIOs 12 to 15 to different phases of the vertical motor's function. These motor-specific GPIOs will be set to an input state at boot. This setup prevents motor overheating, particularly if the unit is stuck in the bootloader, thereby ensuring motor integrity and efficient, safe operation.

GPIO Examples

  • gpio_default=62O:
    • Sets GPIO 62 as an Output with a High state.
  • gpio_default=62o 54O 64I:
    • GPIO 62 is set as an Output with a Low state.
    • GPIO 54 is set as an Output with a High state.
    • GPIO 64 is configured as an Input.
    • Each GPIO configuration is distinctly separated by spaces.
  • gpio_default=17IDU:
    • GPIO 17 as Input with both pull-up and pull-down resistors disabled.
  • gpio_motor_h=52 53 57 51:
    • Assigns GPIOs 52, 53, 57, and 51 to Phases A, B, C, and D of the horizontal motor, respectively.

This format provides a straightforward and efficient method for defining GPIO pin states and configurations in the bootloader, including advanced options for pull resistor management.

Clone this wiki locally