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

Joybus target implementation for standard N64 controllers. More...

Topics

 N64 Pak
 Interface for implementing N64 "Pak" behavior (Rumble Pak, Controller Pak, etc.) when attached to an N64 controller target.

Data Structures

struct  joybus_target_n64_controller
 N64 controller Joybus target. More...

Macros

#define JOYBUS_TARGET_N64_CONTROLLER(target)
 Macro to cast from a generic Joybus target to an N64 controller target.

Typedefs

typedef void(* joybus_target_n64_controller_reset_cb) (struct joybus_target_n64_controller *controller)
 Callback type for N64 controller reset events.

Functions

void joybus_target_n64_controller_init (struct joybus_target_n64_controller *controller)
 Initialize an N64 controller.
void joybus_target_n64_controller_set_reset_cb (struct joybus_target_n64_controller *controller, joybus_target_n64_controller_reset_cb callback)
 Set the reset callback for the controller.
void joybus_target_n64_controller_attach_pak (struct joybus_target_n64_controller *controller, struct joybus_target_n64_pak *pak)
 Attach an pak to the controller.
void joybus_target_n64_controller_detach_pak (struct joybus_target_n64_controller *controller)
 Detach the currently attached pak from the controller.
void joybus_target_n64_controller_calibrate (struct joybus_target_n64_controller *controller)
 Sample the current stick position as the controller's neutral origin.

Detailed Description

Joybus target implementation for standard N64 controllers.

Macro Definition Documentation

◆ JOYBUS_TARGET_N64_CONTROLLER

#define JOYBUS_TARGET_N64_CONTROLLER ( target)
Value:
((struct joybus_target_n64_controller *)(target))
N64 controller Joybus target.
Definition n64_controller.h:33

Macro to cast from a generic Joybus target to an N64 controller target.

Typedef Documentation

◆ joybus_target_n64_controller_reset_cb

typedef void(* joybus_target_n64_controller_reset_cb) (struct joybus_target_n64_controller *controller)

Callback type for N64 controller reset events.

Parameters
controllerthe controller that was reset

Function Documentation

◆ joybus_target_n64_controller_attach_pak()

void joybus_target_n64_controller_attach_pak ( struct joybus_target_n64_controller * controller,
struct joybus_target_n64_pak * pak )

Attach an pak to the controller.

Parameters
controllerthe controller to attach the pak to
pakthe pak to attach

◆ joybus_target_n64_controller_calibrate()

void joybus_target_n64_controller_calibrate ( struct joybus_target_n64_controller * controller)

Sample the current stick position as the controller's neutral origin.

Parameters
controllerthe controller to calibrate

◆ joybus_target_n64_controller_detach_pak()

void joybus_target_n64_controller_detach_pak ( struct joybus_target_n64_controller * controller)

Detach the currently attached pak from the controller.

Parameters
controllerthe controller to detach the pak from

◆ joybus_target_n64_controller_init()

void joybus_target_n64_controller_init ( struct joybus_target_n64_controller * controller)

Initialize an N64 controller.

This function sets up the initial state, and registers Joybus command handlers for OEM N64 controller commands.

Parameters
controllerthe controller to initialize

◆ joybus_target_n64_controller_set_reset_cb()

void joybus_target_n64_controller_set_reset_cb ( struct joybus_target_n64_controller * controller,
joybus_target_n64_controller_reset_cb callback )

Set the reset callback for the controller.

Parameters
controllerthe controller to set the callback for
callbackthe callback function