gba_rumble

Crates.iogba_rumble
lib.rsgba_rumble
version0.1.2
created_at2025-04-17 00:04:11.574456+00
updated_at2025-04-18 05:50:04.843953+00
descriptionRumble functionality on the Game Boy Advance.
homepage
repositoryhttps://github.com/Anders429/gba_rumble
max_upload_size
id1637069
size163,877
Anders Evensen (Anders429)

documentation

README

gba_rumble

GitHub Workflow Status crates.io docs.rs License

Library for enabling rumble functionality on the Game Boy Advance.

This crate supports rumble through both the cartridge itself using general purpose I/O (GPIO) and the Game Boy Player's rumble functionality. Functionality is provided for detecting available rumble features and using them fully.

The library is designed to be usable regardless of what other GBA development libraries may be in use. It is usable with popular libraries like gba and agb.

Usage

There are two ways to use this library: by using a cartridge's built-in rumble through Gpio and by using the Game Boy Player's rumble functionality through GameBoyPlayer.

Cartridge (GPIO) Rumble

To use a cartridge's built-in rumble through general purpose I/O (GPIO), use the Gpio struct.

let gpio = gba_rumble::Gpio;

// Activate the cartridge's rumble. This will continue until `stop()` is called.
gpio.start();

// Deactivate the cartridge's rumble.
gpio.stop();

Game Boy Player

To use the Game Boy Player's rubmle functionality, detect the Game Boy Player by calling GameBoyPlayer::detect() at the beginning of your program.

if let Some(game_boy_player) = gba_rumble::GameBoyPlayer::detect() {    
    // When a Game Boy Player is detected, you can interact with it through the returned
    // `GameBoyPlayer` object.
    //
    // To actually use it, you must also call `game_boy_player_interrupt()` when a serial
    // interrupt is received. This will be specific to your own code and any frameworks you may
    // be using.

    // Update the serial connection once a frame.
    game_boy_player.update();
    // Activate rumble in the controller. This will continue until `stop()` is called.
    game_boy_player.start();

    // Deactivate rumble in the controller.
    game_boy_player.stop();
}

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 21

cargo fmt