64 lines
1.3 KiB
C
64 lines
1.3 KiB
C
#pragma once
|
|
#include "hw_button.h"
|
|
#include "bitmap_disp_buttons.h"
|
|
#include "ctrl_app_types.h"
|
|
|
|
typedef struct
|
|
{
|
|
uint32_t frequency;
|
|
uint16_t amplitude;
|
|
int16_t offset;
|
|
uint16_t phase;
|
|
uint8_t duty;
|
|
uint8_t enabled;
|
|
} GEN_pwm_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint32_t frequency;
|
|
uint16_t amplitude;
|
|
int16_t offset;
|
|
uint16_t phase;
|
|
uint8_t wave;
|
|
uint8_t enabled;
|
|
uint8_t link;
|
|
} GEN_fg_t;
|
|
|
|
typedef struct
|
|
{
|
|
GEN_type_t gen_type;
|
|
void *const gen;
|
|
} GENERATOR_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint8_t freq_focus_digit;
|
|
uint8_t ampl_focus_digit;
|
|
uint8_t offs_focus_digit;
|
|
uint8_t phas_focus_digit;
|
|
uint8_t duty_focus_digit;
|
|
|
|
GEN_type_t curr_gen_type;
|
|
void *generator;
|
|
|
|
GEN_channel_t curr_channel;
|
|
STATE_layout_t curr_state_lay;
|
|
STATE_button_t curr_state_btn;
|
|
|
|
uint8_t isChannelChange;
|
|
uint8_t isGraphChange;
|
|
uint8_t isValueChange;
|
|
uint8_t isButtonChange;
|
|
uint8_t isButtonBlink;
|
|
uint8_t timer_blink[DISP_BTN_MAX];
|
|
|
|
} APP_data_t;
|
|
|
|
void APP_init(APP_data_t *app_data);
|
|
void CTRL_buttonsInit(void);
|
|
void CTRL_buttonsHandler(void);
|
|
void CTRL_pushedDispBtnEvent(ButtonKey_t *key);
|
|
void CTRL_pushedChanBtnEvent(ButtonKey_t *key);
|
|
void CTRL_encoderEvent(int8_t enc);
|
|
BITMAP_buttonName_t CTRL_getBitmapName(LAY_dispBtn_t disp_btn);
|