root / lab2 / lab2.h @ 9
History | View | Annotate | Download (1.26 KB)
1 | 3 | up20180645 | //
|
---|---|---|---|
2 | // Created by goncalo on 29/09/19.
|
||
3 | //
|
||
4 | |||
5 | #ifndef LAB2_LAB2_H
|
||
6 | #define LAB2_LAB2_H
|
||
7 | #pragma once
|
||
8 | |||
9 | /** @defgroup lab2 lab2
|
||
10 | * @{
|
||
11 | *
|
||
12 | * Lab2's top-level functions
|
||
13 | */
|
||
14 | #include <stdint.h> |
||
15 | |||
16 | #include "timer.h" |
||
17 | |||
18 | /**
|
||
19 | * @brief Tests display of timer config
|
||
20 | *
|
||
21 | * Just calls timer_get_conf() followed by timer_display_conf()
|
||
22 | *
|
||
23 | * @param timer Timer whose config to read (Ranges from 0 to 2)
|
||
24 | * @param field Configuration field to display
|
||
25 | * @return Return 0 upon success and non-zero otherwise
|
||
26 | */
|
||
27 | int (timer_test_read_config)(uint8_t timer, enum timer_status_field field); |
||
28 | |||
29 | /**
|
||
30 | * @brief Tests change of Timer O interrupt frequency
|
||
31 | *
|
||
32 | * Programs Timer 0 to generate interrupts with input frequency
|
||
33 | *
|
||
34 | * @param timer Timer whose time-base should be changed (Ranges from 0 to 2)
|
||
35 | * @param freq Frequency of interrupts to generate
|
||
36 | * @return Return 0 upon success and non-zero otherwise
|
||
37 | */
|
||
38 | int (timer_test_time_base)(uint8_t timer, uint32_t freq);
|
||
39 | |||
40 | /**
|
||
41 | * @brief Tests Timer 0 interrupt handling
|
||
42 | *
|
||
43 | * Subscribes Timer 0 interrupts and prints a message once
|
||
44 | * per second for the specified time interval
|
||
45 | *
|
||
46 | * @param time Length of time interval while interrupts are subscribed
|
||
47 | * @return Return 0 upon success and non-zero otherwise
|
||
48 | */
|
||
49 | int (timer_test_int)(uint8_t time);
|
||
50 | #endif //LAB2_LAB2_H |