source: libvcomm/vactions.h @ 2fba30a

Revision 2fba30a, 9.9 KB checked in by Tarmo Kople <tarmo@…>, 7 years ago (diff)

+ added Vblast_irframe action

Vblast_irframe(hid_device vhandle, uint8_t freq, uint8_t duty)
Blasts previously captured or set IRframe

  • Property mode set to 100755
Line 
1/** \file
2 * This file contains communication actions (like get or set IRframe, Eventmap ...)
3 * @author Tarmo Kople <tarmo@flycom.ee>
4 * @date 11.09.2012
5 */
6
7
8#ifndef VACTIONS_H_
9#define VACTIONS_H_
10
11#include "vcomm.h"
12
13#ifdef _WIN32
14#ifdef VCOMM_NO_DLL
15/* Define with no value on non-Windows OSes. */
16#define VCOMMAPI /**< API export macro */
17#define VCOMMCALL /**< API call macro */
18#else
19/* You should define VCOMM_EXPORTS *only* when building the DLL. */
20#ifdef VCOMM_EXPORTS
21#define VCOMMAPI __declspec(dllexport)
22#else
23#define VCOMMAPI __declspec(dllimport)
24#endif
25
26/* Define calling convention in one place, for convenience. */
27#define VCOMMCALL __cdecl
28#endif
29
30#else /* _WIN32 not defined. */
31
32/* Define with no value on non-Windows OSes. */
33#define VCOMMAPI /**< API export macro */
34#define VCOMMCALL /**< API call macro */
35
36#endif
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42/**
43 * \brief Get single event from IRvoodoo.
44 *
45 *      @ingroup vapi
46 *      @param[in] vhandle IRvoodoo connection handle
47 *      @param[out] ev event structure
48 *      @param[in] eventnum in Eventmap
49 *
50 *  @returns
51 *      This function returns 0 on success or error code on error.
52 *
53 */
54VCOMMAPI int VCOMMCALL Vget_event(hid_device **vhandle, irevent_t *ev, int eventnum);
55/**
56 * \brief Get whole eventmap from IRvoodoo.
57 *
58 *      @ingroup vapi
59 *      @param[in] vhandle IRvoodoo connection handle
60 *      @param[out] em eventmap structure
61 *
62 *  @returns
63 *      This function returns 0 on success or error code on error.
64 *
65 */
66VCOMMAPI int VCOMMCALL Vget_eventmap(hid_device **vhandle, eventmap_t *em);
67/**
68 * \brief Get last decoded IRcode from IRvoodoo.
69 *
70 *      @ingroup vapi
71 *      @param[in] vhandle IRvoodoo connection handle
72 *      @param[out] ircode IRcode structure
73 *
74 *  @returns
75 *      This function returns 0 on success or error code on error.
76 *
77 */
78VCOMMAPI int VCOMMCALL Vget_ircode(hid_device **vhandle, ircode_t *ircode);
79/**
80 * \brief Get IRframe from IRvoodoo.
81 *
82 *      @ingroup vapi
83 *      @param[in] vhandle IRvoodoo connection handle
84 *      @param[out] irframe IRframe structure
85 *
86 *  @returns
87 *      This function returns 0 on success or error code on error.
88 *
89 */
90VCOMMAPI int VCOMMCALL Vget_irframe(hid_device **vhandle, irframe_t *irframe);
91/**
92 * \brief Get IRvoodoo firmware version.
93 *
94 *      @ingroup vapi
95 *      @param[in] vhandle IRvoodoo connection handle
96 *      @param[out] fwver firmware version
97 *
98 *  @returns
99 *      This function returns 0 on success or error code on error.
100 *
101 */
102VCOMMAPI int VCOMMCALL Vget_fw_version(hid_device **vhandle, uint32_t *fwver);
103/**
104 * \brief Get IRvoodoo hardware info.
105 * Gets MCU type and UUID
106 *
107 *      @ingroup vapi
108 *      @param[in] vhandle IRvoodoo connection handle
109 *      @param[out] id hardware info structure #hwid_t
110 *
111 *  @returns
112 *      This function returns 0 on success or error code on error.
113 *
114 */
115VCOMMAPI int VCOMMCALL Vget_id(hid_device **vhandle, hwid_t *id);
116/**
117 * \brief Download firmware from IRvoodoo.
118 *
119 * Download (backup) whole flash memory content.
120 *
121 *      @ingroup vapi
122 *      @param[in] vhandle IRvoodoo connection handle
123 *      @param[out] fwdata pointer to databuffer. @b NB! buffer size must equal to flash size (32 * 1024 bytes)
124 *
125 *  @returns
126 *      This function returns 0 on success or error code on error.
127 *
128 */
129VCOMMAPI int VCOMMCALL Vget_fw(hid_device **vhandle, uint8_t *fwdata);
130/**
131 * \brief Set IRvoodoo operation mode.
132 *
133 * Operation modes:
134 * -# #REQ_SET_MODE_NORMAL normal operation mode
135 * -# #REQ_SET_MODE_CFG configuration mode. Out events (keyboard, mouse, ...) are disabled.
136 * -# #REQ_SET_MODE_CAPT special capture mode for raw IR data capturing. Out events (keyboard, mouse, ...) are disabled.
137 *      @ingroup vapi
138 *      @param[in] vhandle IRvoodoo connection handle
139 *      @param[in] mode operation mode
140 *
141 *  @returns
142 *      This function returns 0 on success or error code on error.
143 *
144 */
145VCOMMAPI int VCOMMCALL Vset_mode(hid_device **vhandle, int mode);
146/**
147 * \brief Switch led on or off.
148 *
149 *      @ingroup vapi
150 *      @param[in] vhandle IRvoodoo connection handle
151 *      @param[in] ledstate (0 = LED off, 1 = LED on)
152 *
153 *  @returns
154 *      This function returns 0 on success or error code on error.
155 *
156 */
157VCOMMAPI int VCOMMCALL Vset_led(hid_device **vhandle, int ledstate);
158/**
159 * \brief Clear last decoded IRcode and IRframe.
160 *
161 *
162 *      @ingroup vapi
163 *      @param[in] vhandle IRvoodoo connection handle
164 *
165 *  @returns
166 *      This function returns 0 on success or error code on error.
167 *
168 */
169VCOMMAPI int VCOMMCALL Vclear_last(hid_device **vhandle);
170/**
171 * \brief Clear eventmap in EEPROM
172 *
173 *
174 *      @ingroup vapi
175 *      @param[in] vhandle IRvoodoo connection handle
176 *
177 *  @returns
178 *      This function returns 0 on success or error code on error.
179 *
180 */
181VCOMMAPI int VCOMMCALL Vclear_eventmap(hid_device **vhandle);
182/**
183 * \brief Set and blast IRcode
184 *
185 *      @ingroup vapi
186 *      @param[in] vhandle IRvoodoo connection handle
187 *      @param[in] ircode IRcode to blast
188 *      @param[out] cmdstat Vset_ircode command response from IRvoodoo
189 *
190 *  @returns
191 *      This function returns 0 on success or error code on error.
192 *
193 */
194VCOMMAPI int VCOMMCALL Vset_ircode(hid_device **vhandle, ircode_t *ircode, cmdstat_t *cmdstat );
195/**
196 * \brief Create and save IRevent to eventmap
197 *
198 *      @ingroup vapi
199 *      @param[in] vhandle IRvoodoo connection handle
200 *      @param[in] from_ircode from IRcode
201 *      @param[in] to_ircode to IRcode
202 *      @param[out] cmdstat command response from IRvoodoo
203 *
204 *  @returns
205 *      This function returns 0 on success or error code on error.
206 *
207 */
208VCOMMAPI int VCOMMCALL Vset_event(hid_device **vhandle, ircode_t *from_ircode, ircode_t *to_ircode, cmdstat_t *cmdstat );
209/**
210 * \brief Set (upload) page of IRframe data from computer to IRvoodoo
211 *
212 *      @ingroup vapi
213 *      @param[in] vhandle IRvoodoo connection handle
214 *      @param[in] page_num page number (0..15)
215 *      @param[in] page_data pointer to page data (12 * uint_32t)
216 *      @param[out] cmdstat command response from IRvoodoo
217 *
218 *  @returns
219 *      This function returns 0 on success or error code on error.
220 *
221 */
222VCOMMAPI int VCOMMCALL Vset_irframe_page(hid_device **vhandle, uint8_t page_num, uint32_t *page_data, cmdstat_t *cmdstat );
223/**
224 * \brief Set number of pulses count in IRframe.
225 *
226 *      @ingroup vapi
227 *      @param[in] vhandle IRvoodoo connection handle
228 *      @param[in] num_pulses Number of pulses in IRframe
229 *      @param[out] cmdstat command response from IRvoodoo
230 *
231 *  @returns
232 *      This function returns 0 on success or error code on error.
233 *
234 */
235VCOMMAPI int VCOMMCALL Vset_irframe_info(hid_device **vhandle, uint16_t num_pulses, cmdstat_t *cmdstat );
236/**
237 * \brief Set (upload) whole IRframe from computer to IRvoodoo. Useful for blasting IR data from computer.
238 *
239 *
240 *      @ingroup vapi
241 *      @param[in] vhandle IRvoodoo connection handle
242 *      @param[in] irframe IRframe to send
243 *
244 *  @returns
245 *      This function returns 0 on success or error code on error.
246 *
247 */
248VCOMMAPI int VCOMMCALL Vset_irframe(hid_device **vhandle, irframe_t *irframe);
249/**
250 * \brief Blasts IRframe from IRvoodoo.
251 *
252 *      @ingroup vapi
253 *      @param[in] vhandle IRvoodoo connection handle
254 *      @param[in] freq Frequency of carrier signal in KHz
255 *      @param[in] duty Duty cycle of carrier signal in % (0 - 50)
256 *
257 *  @returns
258 *      This function returns 0 on success or error code on error.
259 *
260 */
261VCOMMAPI int VCOMMCALL Vblast_irframe(hid_device **vhandle, uint8_t freq, uint8_t duty);
262/**
263 * \brief Delete event from eventmap
264 *
265 * Find event from EventMap by IRcode and delete it.
266 *
267 *      @ingroup vapi
268 *      @param[in] vhandle IRvoodoo connection handle
269 *      @param[in] irframe IRframe to find
270 *      @param[out] cmdstat command response from IRvoodoo
271 *
272 *
273 */
274VCOMMAPI int VCOMMCALL Vclear_event_ircode(hid_device **vhandle, ircode_t *ircode, cmdstat_t *cmdstat );
275/**
276 * \brief Delete event NUM from eventmap
277 *
278 *
279 *      @ingroup vapi
280 *      @param[in] vhandle IRvoodoo connection handle
281 *      @param[in] eventnum Event number in eventmap
282 *      @param[out] cmdstat command response from IRvoodoo
283 *
284 *  @returns
285 *      This function returns 0 on success or error code on error.
286 *
287 */
288VCOMMAPI int VCOMMCALL Vclear_event_num(hid_device **vhandle, int eventnum, cmdstat_t *cmdstat );
289/**
290 * \brief Get configuration from IRvoodoo.
291 *
292 *      @ingroup vapi
293 *      @param[in] vhandle IRvoodoo connection handle
294 *      @param[out] config IRvoodoo configuration structure
295 *
296 *  @returns
297 *      This function returns 0 on success or error code on error.
298 *
299 */
300VCOMMAPI int VCOMMCALL Vget_config(hid_device **vhandle, config_t *config );
301/**
302 * \brief Set configuration.
303 *
304 *      @ingroup vapi
305 *      @param[in] vhandle IRvoodoo connection handle
306 *      @param[out] config IRvoodoo configuration structure
307 *
308 *  @returns
309 *      This function returns 0 on success or error code on error.
310 *
311 */
312VCOMMAPI int VCOMMCALL Vset_config(hid_device **vhandle, config_t *config );
313/**
314 * \brief Reset configuration to default values.
315 *
316 *      @ingroup vapi
317 *      @param[in] vhandle IRvoodoo connection handle
318 *
319 *  @returns
320 *      This function returns 0 on success or error code on error.
321 *
322 */
323VCOMMAPI int VCOMMCALL Vreset_config(hid_device **vhandle);
324/**
325 * \brief Get runtime statistics
326 *
327 *      @ingroup vapi
328 *      @param[in] vhandle IRvoodoo connection handle
329 *      @param[out] stat IRvoodoo runtime statistics
330 *
331 *  @returns
332 *      This function returns 0 on success or error code on error.
333 *
334 */
335VCOMMAPI int VCOMMCALL Vget_stat(hid_device **vhandle, stat_t *stat );
336/**
337 * \brief Enter ISP mode
338 *
339 * Enter ISP mode (become USB MSC device) for firmware upgrade. Restart IRvoodoo after n sec
340 *      @ingroup vapi
341 *      @param[in] vhandle IRvoodoo connection handle
342 *      @param[in] time ISP timeout (restart IRvoodoo to normal mode)
343 *
344 *
345 */
346VCOMMAPI int VCOMMCALL Venter_isp(hid_device **vhandle, uint8_t time );
347/**
348 * \brief Get button state. Useful for hardware testing
349 *
350 *      @ingroup vapi
351 *      @param[in] vhandle IRvoodoo connection handle
352 *      @param[out] status IRvoodoo button status (1 button down, 0 button up)
353 *
354 *  @returns
355 *      This function returns 0 on success or error code on error.
356 *
357 */
358VCOMMAPI int VCOMMCALL Vget_btn(hid_device **vhandle, uint8_t *state );
359#ifdef __cplusplus
360}
361#endif
362
363#endif /* VACTIONS_H_ */
Note: See TracBrowser for help on using the repository browser.