forked from Bananymous/banan-os
Joystick axis and buttons are now named to standard values, this allows interfacing multiple different controllers (only DS3 is supported) Add ioctl calls for userspace to set joystick player leds and rumble Only use DS3 code paths when we detect that the attached device is actually an DS3 controller update test-joystick program to the new interface and add support to control rumble and player leds
71 lines
1.9 KiB
C
71 lines
1.9 KiB
C
#ifndef _SYS_IOCTL_H
|
|
#define _SYS_IOCTL_H 1
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
__BEGIN_DECLS
|
|
|
|
#define I_ATMARK 1
|
|
#define I_CANPUT 2
|
|
#define I_CKBAND 3
|
|
#define I_FDINSERT 4
|
|
#define I_FIND 5
|
|
#define I_FLUSH 6
|
|
#define I_FLUSHBAND 7
|
|
#define I_GETBAND 8
|
|
#define I_GETCLTIME 9
|
|
#define I_GETSIG 10
|
|
#define I_GRDOPT 11
|
|
#define I_GWROPT 12
|
|
#define I_LINK 13
|
|
#define I_LIST 14
|
|
#define I_LOOK 15
|
|
#define I_NREAD 16
|
|
#define I_PEEK 17
|
|
#define I_PLINK 18
|
|
#define I_POP 19
|
|
#define I_PUNLINK 20
|
|
#define I_PUSH 21
|
|
#define I_RECVFD 22
|
|
#define I_SENDFD 23
|
|
#define I_SETCLTIME 24
|
|
#define I_SETSIG 25
|
|
#define I_SRDOPT 26
|
|
#define I_STR 27
|
|
#define I_SWROPT 28
|
|
#define I_UNLINK 29
|
|
|
|
#define KDLOADFONT 30
|
|
|
|
#define FIONREAD 40 /* get number of input bytes available */
|
|
#define FIONBIO 41
|
|
|
|
struct winsize
|
|
{
|
|
unsigned short ws_row;
|
|
unsigned short ws_col;
|
|
unsigned short ws_xpixel; /* unused by kernel */
|
|
unsigned short ws_ypixel; /* unused by kernel */
|
|
};
|
|
#define TIOCGWINSZ 50
|
|
#define TIOCSWINSZ 51
|
|
|
|
#define SND_GET_CHANNELS 60 /* stores number of channels to uint32_t argument */
|
|
#define SND_GET_SAMPLE_RATE 61 /* stores sample rate to uint32_t argument */
|
|
#define SND_RESET_BUFFER 62 /* stores the size of internal buffer to uint32_t argument and clears the buffer */
|
|
#define SND_GET_BUFFERSZ 63 /* stores the size of internal buffer to uint32_t argument */
|
|
#define SND_GET_TOTAL_PINS 64 /* gets the number of pins on the current device as uint32_t */
|
|
#define SND_GET_PIN 65 /* gets the currently active pin as uint32_t */
|
|
#define SND_SET_PIN 66 /* sets the currently active pin to uint32_t */
|
|
|
|
#define JOYSTICK_GET_LEDS 80 /* get controller led bitmap to uint8_t argument */
|
|
#define JOYSTICK_SET_LEDS 81 /* set controller leds to uint8_t bitmap */
|
|
#define JOYSTICK_GET_RUMBLE 82 /* get controller rumble strength to uint8_t argument */
|
|
#define JOYSTICK_SET_RUMBLE 83 /* set controller rumble strength to uint8_t argument */
|
|
|
|
int ioctl(int, int, ...);
|
|
|
|
__END_DECLS
|
|
|
|
#endif
|