-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjoystick.h
21 lines (20 loc) · 921 Bytes
/
joystick.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// ------------BSP_Joystick_Init------------
// Initialize a GPIO pin for input, which corresponds
// with BoosterPack pin J1.5 (Select button).
// Initialize two ADC pins, which correspond with
// BoosterPack pins J1.2 (X) and J3.26 (Y).
// Input: none
// Output: none
void BSP_Joystick_Init(void);
// ------------BSP_Joystick_Input------------
// Read and return the immediate status of the
// joystick. Button de-bouncing for the Select
// button is not considered. The joystick X- and
// Y-positions are returned as 10-bit numbers,
// even if the ADC on the LaunchPad is more precise.
// Input: x is pointer to store X-position (0 to 1023)
// y is pointer to store Y-position (0 to 1023)
// select is pointer to store Select status (0 if pressed)
// Output: none
// Assumes: BSP_Joystick_Init() has been called
void BSP_Joystick_Input(uint16_t *x, uint16_t *y, uint8_t *select);