Commit 88e9fe34 authored by Clément Foucher's avatar Clément Foucher
Browse files

Add support for Current mode to library.

parent 904f91be
......@@ -28,6 +28,7 @@
#include "timer.h"
#include "hrtim.h"
#include "data_acquisition.h"
#include "comparator.h"
#include "dac.h"
......@@ -76,3 +77,25 @@ void opalib_quick_start_init_voltage(void (*periodic_task)(), uint32_t task_peri
_opalib_init_task(periodic_task, task_period_us);
}
}
void opalib_quick_start_init_current(void (*periodic_task)(), uint32_t task_period_us)
{
// ADC
data_acquisition_init();
// Comparator
comparator_init();
// HRTIM
hrtim_init_current();
// DAC
owntech_dac_dac2_constant_init();
owntech_dac_dac1_dac3_current_mode_init();
// User task
if (periodic_task != NULL)
{
_opalib_init_task(periodic_task, task_period_us);
}
}
......@@ -53,6 +53,19 @@ extern "C" {
*/
void opalib_quick_start_init_voltage(void (*periodic_task)(), uint32_t task_period_us);
/**
* @brief Library initialization function for current mode.
* This function uses Timer 6 is a user periodic
* task is to be executed.
*
* @param periodic_task Pointer to the void(void) function
* to be executed periodically.
* Can be NULL if no task has to be executed.
* @param task_period_us Period of the function in µs.
* Allowed range: 1 to 6553 µs.
* Value is ignored if first parameter is NULL.
*/
void opalib_quick_start_init_current(void (*periodic_task)(), uint32_t task_period_us);
#ifdef __cplusplus
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment