PowerBlocks SDK
 
Loading...
Searching...
No Matches
gpio.c File Reference

Wii GPIO. More...

#include "gpio.h"

Macros

#define GPIO_OUT   (*(volatile uint32_t*)0xCD8000C0)
 
#define GPIO_DIR   (*(volatile uint32_t*)0xCD8000C4)
 
#define GPIO_IN   (*(volatile uint32_t*)0xCD8000C8)
 
#define GPIO_INTLVL   (*(volatile uint32_t*)0xCD8000CC)
 
#define GPIO_INTFLAG   (*(volatile uint32_t*)0xCD8000D0)
 
#define GPIO_INTMASK   (*(volatile uint32_t*)0xCD8000D4)
 
#define GPIO_STRAPS   (*(volatile uint32_t*)0xCD8000D8)
 
#define GPIO_ENABLE   (*(volatile uint32_t*)0xCD8000DC)
 

Functions

void gpio_write (uint32_t bit, bool set)
 Writes a GPIO output.
 
bool gpio_read (uint32_t bit)
 Reads a GPIO Input.
 
void gpio_set_direction (uint32_t bit, bool direction)
 Sets the direction of the GPIO.
 

Detailed Description

Wii GPIO.

Control the GPIO controller on the Wii

Author
Samuel Fitzsimons (rainbain)
Date
2025 @license MIT (see LICENSE file)

Function Documentation

◆ gpio_read()

bool gpio_read ( uint32_t bit)

Reads a GPIO Input.

Reads the value of a GPIO Input

Parameters
bitBit to read value of

◆ gpio_set_direction()

void gpio_set_direction ( uint32_t bit,
bool direction )

Sets the direction of the GPIO.

Sets the direction of a bit.

This is set to the expected value before the game runs.

Parameters
bitBit to set
DirectionFalse = Input, True = Output

◆ gpio_write()

void gpio_write ( uint32_t bit,
bool set )

Writes a GPIO output.

Writes the bit to the GPIO controller.

Parameters
bitBit to set/clear