Functions
Paddle_Update
void Paddle_Update()

Update both joystick port and store paddles information

Paddle_IsConnected
inline bool Paddle_IsConnected(
u8 port
)

Check if a paddle is connected to the given port

Parameters
port
u8

Index of the port to check (0: Port A, 1: Port B)

Returns

TRUE if a paddle is connected to that port

Paddle_GetAngle
inline u16 Paddle_GetAngle(
u8 port
)

Get the rotation angle of a paddle on the given port

Parameters
port
u8

Index of the port to check (0: Port A, 1: Port B)

Returns

Paddle angle (theorical value goes from 0 to 510, but valid range is around 110 to 380)

Paddle_IsButtonPressed
inline bool Paddle_IsButtonPressed(
u8 port
)

Check if the given paddle's button is pressed

Parameters
port
u8

Index of the port to check (0: Port A, 1: Port B)

Returns

TRUE if the given paddle's button is pressed

Paddle_SetCalibration
inline void Paddle_SetCalibration(
u8 port,
u16 min,
u16 max
)

Calibrate the given paddle

Parameters
port
u8

Index of the port to check (0: Port A, 1: Port B)

min
u16

Minimum recoreded value

max
u16

Maximum recoreded value

Paddle_GetCalibratedAngle
u8 Paddle_GetCalibratedAngle(
u8 port
)

Get the callibrated rotation angle of a paddle on the given port

Parameters
port
u8

Index of the port to check (0: Port A, 1: Port B)

Returns

Paddle angle (from 0 to 255)