#include "board.h"
#include "gpio.h"
#include "intc.h"
#include "qt60168_controller_init.h"
#include "controller.h"
#include "cycle_counter.h"
#include "spi.h"
#include "conf_qt60168.h"
Macros | |
#define | JOYSTICK_STATUS_DOWN 0x00000002 |
#define | JOYSTICK_STATUS_IDLE 0x00000000 |
#define | JOYSTICK_STATUS_LEFT 0x00000008 |
#define | JOYSTICK_STATUS_PRESSED 0x00000010 |
#define | JOYSTICK_STATUS_RIGHT 0x00000004 |
#define | JOYSTICK_STATUS_UP 0x00000001 |
Functions | |
void | controller_init (uint32_t fcpu_hz, uint32_t fhsb_hz, uint32_t fpbb_hz, uint32_t fpba_hz) |
Initialization function of the controller interface. More... | |
void | evaluate_detect_status (bool status, int status_pressed) |
bool | is_joystick_down (void) |
check if down is pressed. More... | |
bool | is_joystick_left (void) |
check if left is pressed. More... | |
bool | is_joystick_pressed (void) |
check if pressed is pressed. More... | |
bool | is_joystick_right (void) |
check if right is pressed. More... | |
bool | is_joystick_up (void) |
check if up is pressed. More... | |
void | update_joystick_status (unsigned short new_status) |
Update the internal controller status and test a specific event. More... | |
Variables | |
static int | qwheel_status = JOYSTICK_STATUS_IDLE |
#define JOYSTICK_STATUS_DOWN 0x00000002 |
Referenced by is_joystick_down(), and update_joystick_status().
#define JOYSTICK_STATUS_IDLE 0x00000000 |
#define JOYSTICK_STATUS_LEFT 0x00000008 |
Referenced by is_joystick_left(), and update_joystick_status().
#define JOYSTICK_STATUS_PRESSED 0x00000010 |
Referenced by is_joystick_pressed(), and update_joystick_status().
#define JOYSTICK_STATUS_RIGHT 0x00000004 |
Referenced by is_joystick_right(), and update_joystick_status().
#define JOYSTICK_STATUS_UP 0x00000001 |
Referenced by is_joystick_up(), and update_joystick_status().
void controller_init | ( | uint32_t | fcpu_hz, |
uint32_t | fhsb_hz, | ||
uint32_t | fpbb_hz, | ||
uint32_t | fpba_hz | ||
) |
Initialization function of the controller interface.
fcpu_hz | CPU frequency. |
fhsb_hz | HSB frequency. |
fpbb_hz | PBB frequency. |
fpba_hz | PBA frequency. |
References gpio_enable_module(), qt60168_init(), QT60168_SPI, QT60168_SPI_BITS, QT60168_SPI_MASTER_SPEED, QT60168_SPI_MISO_FUNCTION, QT60168_SPI_MISO_PIN, QT60168_SPI_MOSI_FUNCTION, QT60168_SPI_MOSI_PIN, QT60168_SPI_NCPS, QT60168_SPI_NPCS0_FUNCTION, QT60168_SPI_NPCS0_PIN, QT60168_SPI_SCK_FUNCTION, QT60168_SPI_SCK_PIN, spi_options_t::reg, rtc_init_qt(), spi_enable(), spi_initMaster(), spi_selectionMode(), and spi_setupChipReg().
Referenced by main().
void evaluate_detect_status | ( | bool | status, |
int | status_pressed | ||
) |
References qwheel_status.
Referenced by update_joystick_status().
bool is_joystick_down | ( | void | ) |
check if down is pressed.
References JOYSTICK_STATUS_DOWN, and qwheel_status.
Referenced by is_usb_hid_event().
bool is_joystick_left | ( | void | ) |
check if left is pressed.
References JOYSTICK_STATUS_LEFT, and qwheel_status.
Referenced by is_usb_hid_event().
bool is_joystick_pressed | ( | void | ) |
check if pressed is pressed.
References JOYSTICK_STATUS_PRESSED, and qwheel_status.
Referenced by device_audio_task(), and is_usb_hid_event().
bool is_joystick_right | ( | void | ) |
check if right is pressed.
References JOYSTICK_STATUS_RIGHT, and qwheel_status.
Referenced by is_usb_hid_event().
bool is_joystick_up | ( | void | ) |
check if up is pressed.
References JOYSTICK_STATUS_UP, and qwheel_status.
Referenced by is_usb_hid_event().
void update_joystick_status | ( | unsigned short | new_status | ) |
Update the internal controller status and test a specific event.
References evaluate_detect_status(), JOYSTICK_STATUS_DOWN, JOYSTICK_STATUS_LEFT, JOYSTICK_STATUS_PRESSED, JOYSTICK_STATUS_RIGHT, JOYSTICK_STATUS_UP, QT60168_TOUCH_SENSOR_BUTTON_0, QT60168_TOUCH_SENSOR_WHEEL_DOWN, QT60168_TOUCH_SENSOR_WHEEL_LEFT, QT60168_TOUCH_SENSOR_WHEEL_RIGHT, and QT60168_TOUCH_SENSOR_WHEEL_UP.
Referenced by rtc_irq().
|
static |
Referenced by evaluate_detect_status(), is_joystick_down(), is_joystick_left(), is_joystick_pressed(), is_joystick_right(), and is_joystick_up().