|
SNAKE_STM32F3
|
Implementation of joystick handling module (STM32 HAL). More...
#include "joystick.h"
Macros | |
| #define | JOYSTICK_TH_LOW 100 |
| #define | JOYSTICK_TH_HIGH 3900 |
Functions | |
| void | joystick_init (ADC_HandleTypeDef *adc_handler) |
| Initializes joystick handling by passing given ADC handler and starting ADC. | |
| vec2_t | joystick_read (void) |
| Reads current joystick position from ADC. | |
| bool | joystick_check_tilt (void) |
| Checks if joystick is tilted past the defined dead zone. | |
| direction_t | joystick_get_direction (void) |
| interprets current joystick state as one of 4 directions or NONE. | |
Implementation of joystick handling module (STM32 HAL).
SPDX-License-Identifier: MIT
| #define JOYSTICK_TH_HIGH 3900 |
| #define JOYSTICK_TH_LOW 100 |
| bool joystick_check_tilt | ( | void | ) |
Checks if joystick is tilted past the defined dead zone.

| direction_t joystick_get_direction | ( | void | ) |
interprets current joystick state as one of 4 directions or NONE.

| void joystick_init | ( | ADC_HandleTypeDef * | adc_handler | ) |
Initializes joystick handling by passing given ADC handler and starting ADC.
| adc_handler | pointer to ADC handler of choice. |