Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Luiz Fernando Lavado Villa
OPALIB Quick Start
Commits
88e9fe34
Commit
88e9fe34
authored
Jul 16, 2021
by
Clément Foucher
Browse files
Add support for Current mode to library.
parent
904f91be
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/opalib_quick_start.c
View file @
88e9fe34
...
...
@@ -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
);
}
}
src/opalib_quick_start.h
View file @
88e9fe34
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment