forked from unfrozen/stm8_libs
-
Notifications
You must be signed in to change notification settings - Fork 2
/
lib_w1209.h
80 lines (63 loc) · 1.4 KB
/
lib_w1209.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* File name: lib_w1209.h
* Date first: 01/22/2019
* Date last: 02/23/2019
*
* Description: STM8 Library for W1209 thermostat board.
*
* Author: Richard Hodges
*
* Copyright (C) 2019 Richard Hodges. All rights reserved.
* Permission is hereby granted for any use.
*
******************************************************************************
*
* Configuration
*/
#define KB_SIZE 4 /* size of key buffer */
#define KB_DEBOUNCE 40 /* debounce count in milliseconds */
#define LED_UPDATE 5 /* milliseconds between LED updates */
/*
* Initialize board
*/
void w12_init(void);
/*
* Write digit/char to LED
* in: ASCII digit or char (use bit-7 for decimal point)
*/
void w12_putc(char);
/*
* Write string to LED
* in: ASCII string (insert decimal point where desired.)
*/
void w12_puts(char *);
/*
* Set cursor position
* in: column (0-2)
*/
void w12_curs(char);
/*
* Set LED blinking
* in: Blink rate * 1/100 second or 0 (disable)
*/
void w12_blink(char);
/*
* Get keypress
* out: zero or ASCII key ('0' to '2'), bit-7 set if released
*/
char w12_getc(void);
/*
* Poll for display, keys, and blinking
* (call every millisecond)
*/
void w12_poll(void);
/*
* Turn the relay on/off
* in: zero = off, non-zero = on
*/
void w12_relay(char);
/*
* Get the current temperature probe value
* out: current A/D value, -1 if timeout
*/
short w12_probe(void);