root / lab4 / .minix-src / include / lcom / lab2.h @ 14
History | View | Annotate | Download (1.11 KB)
1 |
#pragma once
|
---|---|
2 |
|
3 |
#include <stdint.h> |
4 |
|
5 |
#include "timer.h" |
6 |
#include "utils.h" |
7 |
|
8 |
/**
|
9 |
* @brief Tests display of timer config
|
10 |
*
|
11 |
* Just calls timer_get_conf() followed by timer_display_conf()
|
12 |
*
|
13 |
* @param timer Timer whose config to read (Ranges from 0 to 2)
|
14 |
* @param field Configuration field to display
|
15 |
* @return Return 0 upon success and non-zero otherwise
|
16 |
*/
|
17 |
int (timer_test_read_config)(uint8_t timer, enum timer_status_field field); |
18 |
|
19 |
/**
|
20 |
* @brief Tests change of Timer O interrupt frequency
|
21 |
*
|
22 |
* Programs Timer 0 to generate interrupts with input frequency
|
23 |
*
|
24 |
* @param timer Timer whose time-base should be changed (Ranges from 0 to 2)
|
25 |
* @param freq Frequency of interrupts to generate
|
26 |
* @return Return 0 upon success and non-zero otherwise
|
27 |
*/
|
28 |
int (timer_test_time_base)(uint8_t timer, uint32_t freq);
|
29 |
|
30 |
/**
|
31 |
* @brief Tests Timer 0 interrupt handling
|
32 |
*
|
33 |
* Subscribes Timer 0 interrupts and prints a message once
|
34 |
* per second for the specified time interval
|
35 |
*
|
36 |
* @param time Length of time interval while interrupts are subscribed
|
37 |
* @return Return 0 upon success and non-zero otherwise
|
38 |
*/
|
39 |
int (timer_test_int)(uint8_t time);
|