SNAKE_STM32F3
Toggle main menu visibility
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
27
void
joystick_init
(ADC_HandleTypeDef * adc_handler);
28
36
vec2_t
joystick_read
(
void
);
37
43
bool
joystick_check_tilt
(
void
);
44
50
direction_t
joystick_get_direction
(
void
);
51
52
53
#endif
/* INC_JOYSTICK_H_ */
2dspace.h
Definition of 2D space orientation types.
direction_t
direction_t
Movement direction type.
Definition
2dspace.h:19
joystick_init
void joystick_init(ADC_HandleTypeDef *adc_handler)
Initializes joystick handling by passing given ADC handler and starting ADC.
Definition
joystick.c:42
joystick_check_tilt
bool joystick_check_tilt(void)
Checks if joystick is tilted past the defined dead zone.
Definition
joystick.c:67
joystick_get_direction
direction_t joystick_get_direction(void)
interprets current joystick state as one of 4 directions or NONE.
Definition
joystick.c:80
joystick_read
vec2_t joystick_read(void)
Reads current joystick position from ADC.
Definition
joystick.c:48
vec2_t
X-Y position type.
Definition
2dspace.h:31
firmware
SNAKE_STM32F3
libs
joystick
joystick.h
Generated by
1.17.0