summaryrefslogtreecommitdiff
blob: 5fe313ee1dfdfd299a90edc0988bdf898d6883c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**** POSIX *******************************************************************/
#include <string.h>

/**** LIBEVDEV ****************************************************************/
#include <libevdev/libevdev.h>

/**** RELABSD *****************************************************************/
#include <relabsd/device/axis.h>

/******************************************************************************/
/**** LOCAL FUNCTIONS *********************************************************/
/******************************************************************************/

/******************************************************************************/
/**** EXPORTED FUNCTIONS ******************************************************/
/******************************************************************************/
void relabsd_axis_initialize
(
   struct relabsd_axis axis [const restrict static 1]
)
{
   (void) memset(axis, 0, sizeof(struct relabsd_axis));
}

void relabsd_axis_to_absinfo
(
   struct relabsd_axis axis [const restrict static 1],
   struct input_absinfo absinfo [const restrict static 1]
)
{
   absinfo->value = (__s32) 0;
   absinfo->minimum = (__s32) axis->min;
   absinfo->maximum = (__s32) axis->max;
   absinfo->fuzz = (__s32) axis->fuzz;
   absinfo->flat = (__s32) axis->flat;
   absinfo->resolution = (__s32) axis->resolution;
}

void relabsd_axis_enable
(
   struct relabsd_axis axis [const restrict static 1]
)
{
   axis->is_enabled = 1;
}

int relabsd_axis_is_enabled
(
   const struct relabsd_axis axis [const restrict static 1]
)
{
   return axis->is_enabled;
}