libnds
Functions
rumble.h File Reference

Slot-2 Rumble. More...

#include <stdbool.h>
#include <stdint.h>
#include <nds/arm9/peripherals/slot2.h>

Functions

bool isRumbleInserted (void)
 Check if a rumble device has been inserted. More...
 
uint8_t rumbleGetMaxRawStrength (void)
 Get the maximum rumble strength. More...
 
static void rumbleInit (void)
 Initialize the rumble device. More...
 
bool rumbleIsEdgeActivated (void)
 Check if a rumble device is edge-activated. More...
 
static void rumbleTick (uint8_t rawStrength)
 Emit a single, fast rumble tick. More...
 
void setRumble (uint8_t rawStrength)
 Set the rumble device enable/disable pin. More...
 

Detailed Description

Slot-2 Rumble.

Function Documentation

◆ isRumbleInserted()

bool isRumbleInserted ( void  )

Check if a rumble device has been inserted.

Returns
True if a rumble device has been inserted, false otherwise.

◆ rumbleGetMaxRawStrength()

uint8_t rumbleGetMaxRawStrength ( void  )

Get the maximum rumble strength.

Returns
The maximum rumble strength for this device.

◆ rumbleInit()

static void rumbleInit ( void  )
inlinestatic

Initialize the rumble device.

Deprecated:
Use of peripheralSlot2Init() is recommended instead.

◆ rumbleIsEdgeActivated()

bool rumbleIsEdgeActivated ( void  )

Check if a rumble device is edge-activated.

An edge-activated rumble device triggers its actuator when calling setRumble(1) if setRumble(0) was called prior.

A non-edge-activated rumble device triggers its motor starting from when setRumble(1) was called, until setRumble(0) is called.

Returns
It returns true if the device is edge-activated.

◆ rumbleTick()

static void rumbleTick ( uint8_t  rawStrength)
inlinestatic

Emit a single, fast rumble tick.

Parameters
rawStrengthThe raw rumble strength (rumbleGetMaxRawStrength()).

◆ setRumble()

void setRumble ( uint8_t  rawStrength)

Set the rumble device enable/disable pin.

Note that rumbleEnable() and rumbleDisable() are more user-friendly.

Parameters
rawStrengthThe raw rumble strength (rumbleGetMaxRawStrength()).
See also
rumbleIsEdgeActivated