#include "dsp_process.h"
#include "gui.h"
#include "controller.h"
#include "board.h"
#include "twi.h"
#include "pm.h"
#include "tpa6130.h"
#include "gpio.h"
#include "print_funcs.h"
#include "flashc.h"
#include "conf_demo.h"
Macros | |
#define | TEXT_FILTER "Filters\nUP - PLAY - DOWN:\n Select filter" |
#define | TEXT_FUNC1 "UP" |
#define | TEXT_FUNC2 "PLAY" |
#define | TEXT_FUNC3 "DOWN" |
#define | TEXT_FUNC_NOT_IMPLEMENTED "Function not\nimplemented" |
#define | TEXT_IDLE "UP - Frame/s\nPLAY - Volume\nPREV/NEXT - Select box" |
#define | TEXT_INPUT "Input signal\nUP - Time/FFT\nDOWN - Zoom" |
#define | TEXT_OUTPUT "Output signal\nUP - Time/FFT\nDOWN - Zoom" |
#define | TEXT_SOURCE1 "Source1\nUP - Amplitude\nPLAY - Frequency\nDOWN - Zoom" |
#define | TEXT_SOURCE2 "Source2\nUP - Amplitude\nPLAY - Frequency\nDOWN - Zoom" |
#define | TEXT_WHEEL "(Use the PREV/NEXT)" |
Enumerations | |
enum | state_function { STATE_FCT_IDLE, STATE_FCT_FUNCTION1, STATE_FCT_FUNCTION2, STATE_FCT_FUNCTION3, STATE_FCT_ZOOM } |
enum | state_master { STATE_IDLE, STATE_SOURCE1, STATE_SOURCE2, STATE_FILTER, STATE_INPUT, STATE_OUTPUT } |
Functions | |
void | init_sys_clocks (void) |
Initializes the MCU system clocks. More... | |
int | main (void) |
static bool | state_machine_filter (enum state_function *state) |
static bool | state_machine_idle (enum state_function *state) |
static bool | state_machine_signal (enum state_master id, enum state_function *state) |
static bool | state_machine_source (int source_id, enum state_function *state) |
static void | state_machine_task (void) |
static void | switch_state (enum state_master state) |
static void | twi_init (void) |
Variables | |
volatile bool | input_fft_view = false |
static bool | new_state_fct = false |
volatile bool | output_fft_view = false |
static enum state_master | state = STATE_IDLE |
static enum state_function | state_fct = STATE_FCT_IDLE |
volatile bool | zoom_view = false |
volatile int | zoom_view_id |
#define TEXT_FILTER "Filters\nUP - PLAY - DOWN:\n Select filter" |
Referenced by state_machine_filter().
#define TEXT_FUNC1 "UP" |
Referenced by state_machine_idle(), state_machine_signal(), and state_machine_source().
#define TEXT_FUNC2 "PLAY" |
Referenced by state_machine_idle(), and state_machine_source().
#define TEXT_FUNC3 "DOWN" |
#define TEXT_FUNC_NOT_IMPLEMENTED "Function not\nimplemented" |
Referenced by state_machine_idle(), and state_machine_signal().
#define TEXT_IDLE "UP - Frame/s\nPLAY - Volume\nPREV/NEXT - Select box" |
Referenced by main(), and state_machine_idle().
#define TEXT_INPUT "Input signal\nUP - Time/FFT\nDOWN - Zoom" |
Referenced by state_machine_signal().
#define TEXT_OUTPUT "Output signal\nUP - Time/FFT\nDOWN - Zoom" |
Referenced by state_machine_signal().
#define TEXT_SOURCE1 "Source1\nUP - Amplitude\nPLAY - Frequency\nDOWN - Zoom" |
Referenced by state_machine_source().
#define TEXT_SOURCE2 "Source2\nUP - Amplitude\nPLAY - Frequency\nDOWN - Zoom" |
Referenced by state_machine_source().
#define TEXT_WHEEL "(Use the PREV/NEXT)" |
Referenced by state_machine_idle(), and state_machine_source().
enum state_function |
enum state_master |
void init_sys_clocks | ( | void | ) |
Initializes the MCU system clocks.
References flashc_set_wait_state(), FOSC0, FOSC1, OSC0_STARTUP, OSC1_STARTUP, pm_enable_clk1(), pm_enable_osc1_crystal(), pm_pll_enable(), pm_pll_set_option(), pm_pll_setup(), pm_switch_to_clock(), pm_switch_to_osc0(), pm_wait_for_pll0_locked(), and pm_wait_for_pll1_locked().
Referenced by main().
int main | ( | void | ) |
References controller_init(), controller_task(), cpu_irq_enable, dsp_process_init(), dsp_process_task(), FCPU_HZ, FHSB_HZ, filter_active_get_description(), FPBA_HZ, FPBB_HZ, GUI_COMMENT_ID, GUI_FILTER_ID, gui_init(), gui_task(), gui_text_print(), init_dbg_rs232(), init_sys_clocks(), irq_initialize_vectors, print_dbg(), state_machine_task(), TEXT_IDLE, and twi_init().
|
static |
References controller_reset(), controller_wheel_left(), controller_wheel_right(), filter_active_get_description(), filter_set_active(), GUI_COMMENT_ID, GUI_FILTER_ID, gui_set_selection(), gui_text_print(), new_state_fct, STATE_FCT_FUNCTION1, STATE_FCT_FUNCTION2, STATE_FCT_FUNCTION3, STATE_FCT_IDLE, STATE_FCT_ZOOM, STATE_INPUT, STATE_OUTPUT, switch_state(), and TEXT_FILTER.
Referenced by state_machine_task().
|
static |
References controller_wheel_left(), controller_wheel_right(), gui_change_update_fs(), GUI_COMMENT_ID, gui_get_update_fs(), GUI_NO_SEL, gui_set_selection(), gui_text_print(), gui_text_printf, new_state_fct, STATE_FCT_FUNCTION1, STATE_FCT_FUNCTION2, STATE_FCT_FUNCTION3, STATE_FCT_IDLE, STATE_FCT_ZOOM, STATE_SOURCE1, switch_state(), TEXT_FUNC1, TEXT_FUNC2, TEXT_FUNC_NOT_IMPLEMENTED, TEXT_IDLE, TEXT_WHEEL, tpa6130_get_volume(), tpa6130_set_volume(), TPA6130_VOL_MAX, TPA6130_VOL_MIN, and signal_source::volume.
Referenced by state_machine_task().
|
static |
References controller_reset(), controller_wheel_left(), controller_wheel_right(), GUI_COMMENT_ID, GUI_INPUT_ID, GUI_OUTPUT_ID, gui_set_selection(), gui_text_print(), input_fft_view, new_state_fct, output_fft_view, STATE_FCT_FUNCTION1, STATE_FCT_FUNCTION2, STATE_FCT_FUNCTION3, STATE_FCT_IDLE, STATE_FCT_ZOOM, STATE_FILTER, STATE_INPUT, STATE_OUTPUT, STATE_SOURCE2, switch_state(), TEXT_FUNC1, TEXT_FUNC_NOT_IMPLEMENTED, TEXT_INPUT, TEXT_OUTPUT, zoom_view, and zoom_view_id.
Referenced by state_machine_task().
|
static |
References controller_reset(), controller_wheel_left(), controller_wheel_right(), DSP16_Q, GUI_COMMENT_ID, gui_set_selection(), GUI_SOURCE1_ID, GUI_SOURCE2_ID, gui_text_print(), gui_text_printf, new_state_fct, signal1_generator, signal2_generator, signal_source_get_freq(), signal_source_get_volume(), signal_source_set_freq(), signal_source_set_volume(), STATE_FCT_FUNCTION1, STATE_FCT_FUNCTION2, STATE_FCT_FUNCTION3, STATE_FCT_IDLE, STATE_FCT_ZOOM, STATE_INPUT, STATE_SOURCE1, STATE_SOURCE2, switch_state(), TEXT_FUNC1, TEXT_FUNC2, TEXT_SOURCE1, TEXT_SOURCE2, TEXT_WHEEL, zoom_view, and zoom_view_id.
Referenced by state_machine_task().
|
static |
References controller_key_back(), controller_key_fct1(), controller_key_fct2(), controller_key_fct3(), controller_key_fct3_pressed(), controller_key_reset(), controller_reset(), filter_active_get_description(), gui_clear_view(), GUI_FILTER_ID, gui_text_print(), new_state_fct, Reset_CPU, state, state_fct, STATE_FCT_FUNCTION1, STATE_FCT_FUNCTION2, STATE_FCT_FUNCTION3, STATE_FCT_IDLE, STATE_FCT_ZOOM, STATE_FILTER, STATE_IDLE, STATE_INPUT, state_machine_filter(), state_machine_idle(), state_machine_signal(), state_machine_source(), STATE_OUTPUT, STATE_SOURCE1, STATE_SOURCE2, and zoom_view.
Referenced by main().
|
static |
References new_state_fct, state, state_fct, and STATE_FCT_IDLE.
Referenced by state_machine_filter(), state_machine_idle(), state_machine_signal(), and state_machine_source().
|
static |
Referenced by gui_task(), and state_machine_signal().
Referenced by gui_task(), and state_machine_signal().
|
static |
Referenced by state_machine_task(), and switch_state().
|
static |
Referenced by state_machine_task(), and switch_state().
volatile int zoom_view_id |
Referenced by gui_print_fft_box(), gui_print_signal_box(), state_machine_signal(), and state_machine_source().