forked from unfrozen/stm8_libs
-
Notifications
You must be signed in to change notification settings - Fork 2
/
lib_clock.h
57 lines (45 loc) · 1.14 KB
/
lib_clock.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* File name: lib_clock.h
* Date first: 03/23/2018
* Date last: 04/14/2018
*
* Description: Library for maintaining a wall clock using timer 4
*
* Author: Richard Hodges
*
* Copyright (C) 2018 Richard Hodges. All rights reserved.
* Permission is hereby granted for any use.
*
******************************************************************************
*
* Initialize the clock (set up timer 4)
* in: Millisecond callback
*/
void clock_init(void (*void )(void), void (*void)(void));
/*
* Get string for current clock
* Formats like "22:00:00" (8 chars + zero)
*/
void clock_string(char *);
/*
* Set clock from ASCII string
* Format: "22:00:00"
*/
char clock_set(char *);
/*
* Get/set binary values for day, hour, minute, second
* out: (4 bytes set)
*/
void clock_bin_get(char *);
void clock_bin_set(char *);
/*
* Set large and fine clock trim
* Positive values speed up, negative values slow down
* in: large +/- (0.4%), fine +/- (0.1%)
*/
void clock_trim(signed char, signed char);
/*
* Interrupt service routine declaration
*/
#include "vectors.h"
void timer4_isr(void) __interrupt (IRQ_TIM4);