-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgarminhr.h
More file actions
136 lines (107 loc) · 2.8 KB
/
Copy pathgarminhr.h
File metadata and controls
136 lines (107 loc) · 2.8 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// anthrm - http://mylcd.sourceforge.net/
// An LCD framebuffer and text rendering API
// Michael McElligott
// okio@users.sourceforge.net
// Copyright (c) 2005-2011 Michael McElligott
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE
// as published by the Free Software Foundation; either version 2
// 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 LIBRARY GENERAL PUBLIC LICENSE for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free
// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef _GARMINHR_H_
#define _GARMINHR_H_
#include "libantplus.h"
#define KEY_SIZE 8
#define MARQUEE_CENTER 0x01
#define MARQUEE_LEFT 0x02
enum _akeys {
KEY_ANTSPORT,
KEY_SUUNTO,
KEY_GARMIN,
KEY_ANTPLUS,
KEY_TOTAL
};
typedef struct{
char line[MAX_PATH]; // text to display
unsigned int time; // display until this time is reached
}TMARQUEELINE;
typedef struct{
TMARQUEELINE *entry;
int total;
HANDLE hLock; // in this instance, this lock isn't actually required as we're single threaded. can be removed.
unsigned int flags;
int ready;
}TMARQUEE;
typedef struct{
int channel;
int keyIdx;
int RFFreq;
int channelPeriod;
int searchTimeout;
int searchWaveform;
int channelType;
int networkNumber;
int deviceNumber;
int deviceType;
int transType;
void *lock; // ready to update hr
void *unlock; // update complete
}TDCONFIG;
typedef struct{
int channelStatus;
int chanIdOnce;
int running;
int vDisplay;
int openCt;
}TCONNSTATES;
#define HRBMP_BUFFERLENGTH (1024)
typedef struct{
unsigned char bpm[HRBMP_BUFFERLENGTH];
unsigned char currentBpm;
int currentSequence;
int previousSequence;
int low; // lowest thus far
int high; // maximum read thus far
}THRBUFFER;
typedef struct{
int scidDeviceNumber;
int scidDeviceType;
int scidTransType;
}TDEVICET;
enum _imglist {
IMG_NUM0,
IMG_NUM1,
IMG_NUM2,
IMG_NUM3,
IMG_NUM4,
IMG_NUM5,
IMG_NUM6,
IMG_NUM7,
IMG_NUM8,
IMG_NUM9,
IMG_BACKGROUND,
IMG_TOTAL
};
typedef struct{
TFRAME *list[IMG_TOTAL];
}TIMAGES;
typedef struct{
TLIBANTPLUS *ant;
TDCONFIG *dcfg;
TDEVICET *dev;
THRBUFFER *rate;
TCONNSTATES *cstates;
TMARQUEE *marquee;
TIMAGES *images;
}THR;
int messageEventCb (const int chan, const int msgId, const unsigned char *payLoad, const size_t dataLength, void *uPtr);
#endif