Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Nintendo Nunchuk joystick. More...

Files

file  input_nunchuk.h
 Header file for Nunchuk input driver synchronous reading.

Macros

#define INPUT_NUNCHUK_ACCEL_X   0
 Acceleration on the X axis reported by the Nunchuk.
#define INPUT_NUNCHUK_ACCEL_Y   1
 Acceleration on the Y axis reported by the Nunchuk.
#define INPUT_NUNCHUK_ACCEL_Z   2
 Acceleration on the Z axis reported by the Nunchuk.

Functions

int nunchuk_read (const struct device *dev)
 Starts the reading process of the current button states, joystick position and optionally the acceleration (if CONFIG_INPUT_NUNCHUK_ACCELERATION is enabled) from the Nunchuk.

Detailed Description

Nintendo Nunchuk joystick.

Macro Definition Documentation

◆ INPUT_NUNCHUK_ACCEL_X

#define INPUT_NUNCHUK_ACCEL_X   0

#include <zephyr/input/input_nunchuk.h>

Acceleration on the X axis reported by the Nunchuk.

Attention
Available only when the following Kconfig option is enabled: CONFIG_INPUT_NUNCHUK_ACCELERATION.

◆ INPUT_NUNCHUK_ACCEL_Y

#define INPUT_NUNCHUK_ACCEL_Y   1

#include <zephyr/input/input_nunchuk.h>

Acceleration on the Y axis reported by the Nunchuk.

Attention
Available only when the following Kconfig option is enabled: CONFIG_INPUT_NUNCHUK_ACCELERATION.

◆ INPUT_NUNCHUK_ACCEL_Z

#define INPUT_NUNCHUK_ACCEL_Z   2

#include <zephyr/input/input_nunchuk.h>

Acceleration on the Z axis reported by the Nunchuk.

Attention
Available only when the following Kconfig option is enabled: CONFIG_INPUT_NUNCHUK_ACCELERATION.

Function Documentation

◆ nunchuk_read()

int nunchuk_read ( const struct device * dev)

#include <zephyr/input/input_nunchuk.h>

Starts the reading process of the current button states, joystick position and optionally the acceleration (if CONFIG_INPUT_NUNCHUK_ACCELERATION is enabled) from the Nunchuk.

This function does only function if the property 'polling-interval-ms' is set to 0 in the DTS definition for the Nunchuk input driver, so that background polling is disabled.

Note that the function exits immediately and the data is read from the Nunchuk in the background and reported via the standard input event interface.

Parameters
devPointer to the Nunchuk device
Return values
SUCCESSif the data read process could be started.
-errnoIn case of any error.