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_rumble_pak
 N64 Rumble Pak pak. More...

Macros

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

Typedefs

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

Functions

void joybus_target_n64_rumble_pak_init (struct joybus_target_n64_rumble_pak *pak)
 Initialize a rumble pak.
void joybus_target_n64_rumble_pak_set_motor_cb (struct joybus_target_n64_rumble_pak *pak, joybus_target_n64_rumble_pak_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_RUMBLE_PAK

#define JOYBUS_TARGET_N64_RUMBLE_PAK ( pak)
Value:
N64 Rumble Pak pak.
Definition n64_rumble_pak.h:33

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

Typedef Documentation

◆ joybus_target_n64_rumble_pak_motor_cb

typedef void(* joybus_target_n64_rumble_pak_motor_cb) (struct joybus_target_n64_rumble_pak *pak, bool active)

Callback type for rumble pak motor state change events.

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

Function Documentation

◆ joybus_target_n64_rumble_pak_init()

void joybus_target_n64_rumble_pak_init ( struct joybus_target_n64_rumble_pak * pak)

Initialize a rumble pak.

Parameters
pakthe rumble pak to initialize

◆ joybus_target_n64_rumble_pak_set_motor_cb()

void joybus_target_n64_rumble_pak_set_motor_cb ( struct joybus_target_n64_rumble_pak * pak,
joybus_target_n64_rumble_pak_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