Microchip® Advanced Software Framework

applications/uc3-audio-player/user_interface/controller/controller.h File Reference
#include "compiler.h"
#include "gui.h"

Functions

void controller_clear (void)
 Reset the key state. More...
 
Constructor/Destructor
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 controller_shutdown (void)
 Shutdown the controller. More...
 
Navigation view
bool controller_navigation_cursor_previous (void)
 This function is called to check if the user has pressed the previous file selection key. More...
 
bool controller_navigation_cursor_next (void)
 This function is called to check if the user has pressed the next file selection key. More...
 
bool controller_navigation_go_to_parent_directory (void)
 This function is called to check if the user has pressed the go to parent directory key. More...
 
bool controller_navigation_change_directory (void)
 This function is called to check if the user has pressed the change directory key. More...
 
Playback view
bool controller_playback_toggle_play_pause (void)
 This function is called to check if the user has pressed the play/pause key. More...
 
bool controller_playback_increase_volume (void)
 This function is called to check if the user has pressed the increase volume key. More...
 
bool controller_playback_decrease_volume (void)
 This function is called to check if the user has pressed the decrease volume key. More...
 
bool controller_playback_previous_track (void)
 This function is called to check if the user has pressed the previous track key. More...
 
bool controller_playback_next_track (void)
 This function is called to check if the user has pressed the next track key. More...
 
bool controller_playback_ffw (bool new_track)
 This function is called to check if the user has pressed the fast forward key. More...
 
bool controller_playback_frw (bool new_track)
 This function is called to check if the user has pressed the fast rewind key. More...
 
Configuration view
bool controller_config_change_mode (void)
 This function is called to check if the user has pressed the configuration change key. More...
 
bool controller_config_next_option (void)
 This function is called to check if the user has pressed the next option key. More...
 
bool controller_config_previous_option (void)
 This function is called to check if the user has pressed the previous option key. More...
 
bool controller_navigation_play (void)
 This function is called to check if the user has pressed the play selected file key. More...
 
View switching
bool controller_switch_to_navigation_view (enum gui_update_view view)
 This function is called to check if the user has requested to move to the navigation view. More...
 
bool controller_switch_to_playback_view (enum gui_update_view view)
 This function is called to check if the user has requested to move to the playback view. More...
 
bool controller_switch_to_config_view (enum gui_update_view view)
 This function is called to check if the user has requested to move to the configuration view. More...
 

void controller_clear ( void  )

Reset the key state.

References controller_state, i, STATE_IDLE, TOUCH_IDLE, and touch_states.

Referenced by config_task(), navigation_task(), playback_task(), and rtc_init_qt().

bool controller_config_change_mode ( void  )

This function is called to check if the user has pressed the configuration change key.

Returns
true if the key has been pressed. false otherwise.

References controller_key_cs2(), and controller_key_cs3().

Referenced by config_task().

bool controller_config_next_option ( void  )

This function is called to check if the user has pressed the next option key.

Returns
true if the key has been pressed. false otherwise.

References controller_wheel_right().

Referenced by config_task().

bool controller_config_previous_option ( void  )

This function is called to check if the user has pressed the previous option key.

Returns
true if the key has been pressed. false otherwise.

References controller_wheel_left().

Referenced by config_task().

void controller_init ( U32  fcpu_hz,
U32  fhsb_hz,
U32  fpbb_hz,
U32  fpba_hz 
)

Initialization function of the controller interface.

Parameters
fcpu_hzCPU frequency.
fhsb_hzHSB frequency.
fpbb_hzPBB frequency.
fpba_hzPBA frequency.

Initialization function of the controller interface.

Parameters
fcpu_hzCPU frequency.
fhsb_hzHSB frequency.
fpbb_hzPBB frequency.
fpba_hzPBA frequency.

Initialization function of the controller interface.

References cpu_set_timeout(), gpio_enable_module(), qt60168_init(), qt60168_resources_init(), QT60168_SPI_BITS, QT60168_SPI_MASTER_SPEED, spi_options_t::reg, rtc_init_qt(), spi_enable(), spi_initMaster(), spi_selectionMode(), and spi_setupChipReg().

Referenced by app_engine(), com_task(), and main().

bool controller_navigation_change_directory ( void  )

This function is called to check if the user has pressed the change directory key.

Returns
true if the key has been pressed. false otherwise.

References CLEAR_RELEASED_STATE, controller_state, and STATE_WHEEL_RIGHT_RELEASED.

Referenced by navigation_task().

bool controller_navigation_cursor_next ( void  )

This function is called to check if the user has pressed the next file selection key.

Returns
true if the key has been pressed. false otherwise.

References CLEAR_RELEASED_STATE, controller_state, controller_wheel_right(), and STATE_WHEEL_DOWN_RELEASED.

Referenced by navigation_task().

bool controller_navigation_cursor_previous ( void  )

This function is called to check if the user has pressed the previous file selection key.

Returns
true if the key has been pressed. false otherwise.

References CLEAR_RELEASED_STATE, controller_state, controller_wheel_left(), and STATE_WHEEL_UP_RELEASED.

Referenced by navigation_task().

bool controller_navigation_go_to_parent_directory ( void  )

This function is called to check if the user has pressed the go to parent directory key.

Returns
true if the key has been pressed. false otherwise.

References CLEAR_RELEASED_STATE, controller_state, and STATE_WHEEL_LEFT_RELEASED.

Referenced by navigation_task().

bool controller_navigation_play ( void  )

This function is called to check if the user has pressed the play selected file key.

Returns
true if the key has been pressed. false otherwise.

References controller_key_cs3().

Referenced by navigation_task().

bool controller_playback_decrease_volume ( void  )

This function is called to check if the user has pressed the decrease volume key.

Returns
true if the key has been pressed. false otherwise.

References CLEAR_RELEASED_STATE, controller_state, and STATE_WHEEL_DOWN_RELEASED.

Referenced by playback_task().

bool controller_playback_ffw ( bool  new_track)

This function is called to check if the user has pressed the fast forward key.

Returns
true if the key has been pressed. false otherwise.

References controller_wheel_right().

Referenced by playback_task().

bool controller_playback_frw ( bool  new_track)

This function is called to check if the user has pressed the fast rewind key.

Returns
true if the key has been pressed. false otherwise.

References controller_wheel_left().

Referenced by playback_task().

bool controller_playback_increase_volume ( void  )

This function is called to check if the user has pressed the increase volume key.

Returns
true if the key has been pressed. false otherwise.

References CLEAR_RELEASED_STATE, controller_state, and STATE_WHEEL_UP_RELEASED.

Referenced by playback_task().

bool controller_playback_next_track ( void  )

This function is called to check if the user has pressed the next track key.

Returns
true if the key has been pressed. false otherwise.

References CLEAR_RELEASED_STATE, controller_state, and STATE_WHEEL_RIGHT_RELEASED.

Referenced by playback_task().

bool controller_playback_previous_track ( void  )

This function is called to check if the user has pressed the previous track key.

Returns
true if the key has been pressed. false otherwise.

References CLEAR_RELEASED_STATE, controller_state, and STATE_WHEEL_LEFT_RELEASED.

Referenced by playback_task().

bool controller_playback_toggle_play_pause ( void  )

This function is called to check if the user has pressed the play/pause key.

Returns
true if the key has been pressed. false otherwise.

References controller_key_cs3().

Referenced by playback_task().

void controller_shutdown ( void  )

Shutdown the controller.

References cpu_irq_disable, cpu_irq_enable, Disable_global_interrupt, Enable_global_interrupt, and rtc_disable().

Referenced by com_task().

bool controller_switch_to_config_view ( enum gui_update_view  view)

This function is called to check if the user has requested to move to the configuration view.

Parameters
viewThe current view.
Returns
true if the key has been pressed. false otherwise.

References controller_key_cs4(), and GUI_UPDATE_VIEW_PLAYBACK.

Referenced by navigation_task(), and playback_task().

bool controller_switch_to_navigation_view ( enum gui_update_view  view)

This function is called to check if the user has requested to move to the navigation view.

Parameters
viewThe current view.
Returns
true if the key has been pressed. false otherwise.

References controller_key_cs1(), and GUI_UPDATE_VIEW_PLAYBACK.

Referenced by config_task(), and playback_task().

bool controller_switch_to_playback_view ( enum gui_update_view  view)

This function is called to check if the user has requested to move to the playback view.

Parameters
viewThe current view.
Returns
true if the key has been pressed. false otherwise.

References controller_key_cs1(), controller_key_cs4(), GUI_UPDATE_VIEW_CONFIG, and GUI_UPDATE_VIEW_NAVIGATION.

Referenced by config_task(), and navigation_task().