Microchip® Advanced Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Joystick interface (5-way)

A 5-way joystick (left, right, up, down, press) interface using 5 GPIOs.

Functions

static __always_inline int is_joystick_down (void)
 This function test it the joystick is down. More...
 
static __always_inline int is_joystick_left (void)
 This function test it the joystick is on the left. More...
 
static __always_inline int is_joystick_pressed (void)
 This function test it the joystick is pressed. More...
 
static __always_inline int is_joystick_right (void)
 This function test it the joystick is on the right. More...
 
static __always_inline int is_joystick_up (void)
 This function test it the joystick is up. More...
 

static __always_inline int is_joystick_down ( void  )
static

This function test it the joystick is down.

Returns
true if the joystick is down, otherwise 0.

References gpio_get_pin_value(), GPIO_JOYSTICK_DOWN, and GPIO_JOYSTICK_DOWN_PRESSED.

Referenced by b_joystick_get_value(), device_cdc_task(), hid_report_in(), and is_usb_mouse_event().

static __always_inline int is_joystick_left ( void  )
static

This function test it the joystick is on the left.

Returns
true if the joystick is on the left, otherwise 0.

References gpio_get_pin_value(), GPIO_JOYSTICK_LEFT, and GPIO_JOYSTICK_LEFT_PRESSED.

Referenced by b_joystick_get_value(), device_cdc_task(), hid_report_in(), and is_usb_mouse_event().

static __always_inline int is_joystick_pressed ( void  )
static

This function test it the joystick is pressed.

Returns
true if the joystick is pressed, otherwise 0.

References gpio_get_pin_value(), GPIO_JOYSTICK_PUSH, and GPIO_JOYSTICK_PUSH_PRESSED.

Referenced by b_joystick_get_value(), device_cdc_task(), and is_usb_mouse_event().

static __always_inline int is_joystick_right ( void  )
static

This function test it the joystick is on the right.

Returns
true if the joystick is on the right, otherwise 0.

References gpio_get_pin_value(), GPIO_JOYSTICK_RIGHT, and GPIO_JOYSTICK_RIGHT_PRESSED.

Referenced by b_joystick_get_value(), device_cdc_task(), hid_report_in(), and is_usb_mouse_event().

static __always_inline int is_joystick_up ( void  )
static

This function test it the joystick is up.

Returns
true if the joystick is up, otherwise 0.

References gpio_get_pin_value(), GPIO_JOYSTICK_UP, and GPIO_JOYSTICK_UP_PRESSED.

Referenced by b_joystick_get_value(), device_cdc_task(), hid_report_in(), and is_usb_mouse_event().