opalib_quick_start.h 1.73 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * Copyright (c) 2021 LAAS-CNRS
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published by
 *   the Free Software Foundation, either version 2.1 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser General Public License
 *   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * SPDX-License-Identifier: LGLPV2.1
 */

/**
 * @brief  This library provides a quick start configuration
 *         by configuring the paripherals to perform a measure
 *         on all defined ADCs, and running a user-defined
 *         task periodically.
 *
 * @author Clément Foucher <clement.foucher@laas.fr>
 */

#ifndef OPALIB_QUICK_START_H_
#define OPALIB_QUICK_START_H_


// Stdlib
#include <stdint.h>


#ifdef __cplusplus
extern "C" {
#endif


/**
 * @brief Library initialization function.
44
45
 *        This function uses Timer 6 is a user periodic
 *        task is to be executed.
46
47
48
 *
 * @param periodic_task Pointer to the void(void) function
 *        to be executed periodically.
49
 *        Can be NULL if no task has to be executed.
50
51
 * @param task_period_us Period of the function in µs.
 *        Allowed range: 1 to 6553 µs.
52
 *        Value is ignored if first parameter is NULL.
53
54
55
56
57
58
59
60
61
 */
void opalib_quick_start_init(void (*periodic_task)(), uint32_t task_period_us);


#ifdef __cplusplus
}
#endif

#endif // OPALIB_QUICK_START_H_