SNAKE_STM32F3
Loading...
Searching...
No Matches
joystick.h
Go to the documentation of this file.
1
12
13#ifndef INC_JOYSTICK_H_
14#define INC_JOYSTICK_H_
15
16#include "2dspace.h"
17#include "main.h"
18#include <stdbool.h>
19
27void joystick_init(ADC_HandleTypeDef * adc_handler);
28
37
43bool joystick_check_tilt(void);
44
51
52
53#endif /* INC_JOYSTICK_H_ */
Definition of 2D space orientation types.
direction_t
Movement direction type.
Definition 2dspace.h:19
void joystick_init(ADC_HandleTypeDef *adc_handler)
Initializes joystick handling by passing given ADC handler and starting ADC.
Definition joystick.c:42
bool joystick_check_tilt(void)
Checks if joystick is tilted past the defined dead zone.
Definition joystick.c:67
direction_t joystick_get_direction(void)
interprets current joystick state as one of 4 directions or NONE.
Definition joystick.c:80
vec2_t joystick_read(void)
Reads current joystick position from ADC.
Definition joystick.c:48
X-Y position type.
Definition 2dspace.h:31