#include "taskTests.h"
#include "../../software/signal_processing/system/data_channel.h"
#include "../../software/signal_processing/system/binding.h"
#include "../../software/signal_processing/system/task_sine.h"
#include "../../software/signal_processing/system/task_rand.h"
#include "../../software/signal_processing/system/task_add.h"
#include "../../software/signal_processing/system/task_fft.h"
#include "../../software/signal_processing/system/task_crc.h"
#include "../../software/signal_processing/system/sine_config.h"
#include "../../software/signal_processing/system/rand_config.h"
#include "../../software/signal_processing/system/add_config.h"
#include "../../software/signal_processing/system/fft_config.h"
#include "../../software/signal_processing/system/crc_config.h"
#include "../../software/signal_processing_bsp/system.h"

#include <cmath>

void configureAndRunSine() {
    DataChannelBinding binding = { BINDING_HW, BINDING_HW };
    data_channel_bind( DATA_CHANNEL_0_BASE, & binding );

    task_sine_run( & SINE_CONFIG );
}

void configureAndRunCosine() {
    DataChannelBinding binding = { BINDING_HW, BINDING_HW };
    data_channel_bind( DATA_CHANNEL_1_BASE, & binding );

    task_sine_run( & COSINE_CONFIG );
}

void configureAndRunRand() {
    DataChannelBinding binding = { BINDING_HW, BINDING_HW };
    data_channel_bind( DATA_CHANNEL_2_BASE, & binding );

    task_rand_run( & RAND_CONFIG );
}

void configureAndRunAddSineCosine() {
    DataChannelBinding binding = { BINDING_HW, BINDING_HW };
    data_channel_bind( DATA_CHANNEL_3_BASE, & binding );

    task_add_run( & ADD_SINE_COSINE_CONFIG );
}

void configureAndRunAddRand() {
    DataChannelBinding binding = { BINDING_HW, BINDING_HW };
    data_channel_bind( DATA_CHANNEL_4_BASE, & binding );

    task_add_run( & ADD_RAND_CONFIG );
}

void configureAndRunFft() {
    DataChannelBinding binding = { BINDING_HW, BINDING_HW };
    data_channel_bind( DATA_CHANNEL_5_BASE, & binding );

    task_fft_run( & FFT_CONFIG );
}

void configureAndRunCrc() {
    DataChannelBinding binding = { BINDING_HW, BINDING_HW };
    data_channel_bind( DATA_CHANNEL_6_BASE, & binding );

    task_crc_run( & CRC_CONFIG );
}

