libjoybus
Joybus implementation for 32-bit MCUs
Loading...
Searching...
No Matches

N64 pak implementation which emulates a Rumble Pak, providing a callback for motor state changes. More...

Data Structures

struct  joybus_target_n64_pak_rumble
 N64 Rumble Pak pak. More...

Macros

#define JOYBUS_TARGET_N64_PAK_RUMBLE(pak)
 Macro to cast from a generic N64 pak to a rumble pak.

Typedefs

typedef void(* joybus_target_n64_pak_rumble_motor_cb) (struct joybus_target_n64_pak_rumble *pak, bool active)
 Callback type for rumble pak motor state change events.

Functions

void joybus_target_n64_pak_rumble_init (struct joybus_target_n64_pak_rumble *pak)
 Initialize a rumble pak.
void joybus_target_n64_pak_rumble_set_motor_cb (struct joybus_target_n64_pak_rumble *pak, joybus_target_n64_pak_rumble_motor_cb callback)
 Set the motor state change callback for the rumble pak.

Detailed Description

N64 pak implementation which emulates a Rumble Pak, providing a callback for motor state changes.

Macro Definition Documentation

◆ JOYBUS_TARGET_N64_PAK_RUMBLE

#define JOYBUS_TARGET_N64_PAK_RUMBLE ( pak)
Value:
N64 Rumble Pak pak.
Definition n64_pak_rumble.h:36

Macro to cast from a generic N64 pak to a rumble pak.

Typedef Documentation

◆ joybus_target_n64_pak_rumble_motor_cb

typedef void(* joybus_target_n64_pak_rumble_motor_cb) (struct joybus_target_n64_pak_rumble *pak, bool active)

Callback type for rumble pak motor state change events.

Runs in interrupt context, on the response critical path, so it must return quickly. Mark the implementation with JOYBUS_RAM_FUNC.

Parameters
pakthe rumble pak whose motor state changed
activetrue if the motor should be on, false if off

Function Documentation

◆ joybus_target_n64_pak_rumble_init()

void joybus_target_n64_pak_rumble_init ( struct joybus_target_n64_pak_rumble * pak)

Initialize a rumble pak.

Parameters
pakthe rumble pak to initialize

◆ joybus_target_n64_pak_rumble_set_motor_cb()

void joybus_target_n64_pak_rumble_set_motor_cb ( struct joybus_target_n64_pak_rumble * pak,
joybus_target_n64_pak_rumble_motor_cb callback )

Set the motor state change callback for the rumble pak.

NOTE: Motor callbacks are called from interrupt context, do not perform any blocking operations within the callback.

Parameters
pakthe rumble pak to set the callback for
callbackthe callback function