Sonochan II 0.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
image.h
Go to the documentation of this file.
1 /* -*- mode: c++; tab-width: 4; c-basic-offset: 4 -*- */
2 /*
3 * image.h
4 *
5 * Created on: 2011-02-25
6 * Author: Roger E Critchlow Jr, AD5DZ
7 */
8
9 #ifndef IMAGE_H_
10 #define IMAGE_H_
11
12 #include "compiler.h"
13 #include <stdint.h>
14
15 //
16 // the image defines the usb descriptor and
17 // all the components that implement the descriptor
18 //
19 // each defined image initializes this structure
20 // with pointers to its own functions for performing
21 // the necessary steps of bringing the image to life
22 //
23 typedef struct {
24 // image launch
25 void (*boot)(void);
26 void (*init)(void);
27 void (*task_init)(void);
28 // descriptor access
29 uint8_t *(*get_dev_desc_pointer)(void);
30 uint16_t (*get_dev_desc_length)(void);
31 uint8_t *(*get_conf_desc_pointer)(void);
32 uint16_t (*get_conf_desc_length)(void);
33 uint8_t *(*get_conf_desc_fs_pointer)(void);
34 uint16_t (*get_conf_desc_fs_length)(void);
35 uint8_t *(*get_conf_desc_hs_pointer)(void);
36 uint16_t (*get_conf_desc_hs_length)(void);
37 uint8_t *(*get_qualifier_desc_pointer)(void);
38 uint16_t (*get_qualifier_desc_length)(void);
39 // usb specific request handling
40 void (*user_endpoint_init)(uint8_t conf_nb);
41 Bool (*user_read_request)(uint8_t type, uint8_t request);
42 void (*user_set_interface)(U8 wIndex, U8 wValue);
43 } image_t;
44
45 //
46 // these functions decide which image_t gets used,
47 // depending on the image feature selected, and
48 // uses it.
49 //
50 // image launch
51 extern void image_boot(void);
52 extern void image_init(void);
53 extern void image_task_init(void);
54 // descriptor access
55 extern uint8_t *image_get_dev_desc_pointer(void);
56 extern uint16_t image_get_dev_desc_length(void);
57 extern uint8_t *image_get_conf_desc_pointer(void);
58 extern uint16_t image_get_conf_desc_length(void);
59 extern uint8_t *image_get_conf_desc_fs_pointer(void);
60 extern uint16_t image_get_conf_desc_fs_length(void);
61 extern uint8_t *image_get_conf_desc_hs_pointer(void);
62 extern uint16_t image_get_conf_desc_hs_length(void);
63 extern uint8_t *image_get_qualifier_desc_pointer(void);
64 extern uint16_t image_get_qualifier_desc_length(void);
65 // usb specific request handling
66 extern void image_user_endpoint_init(uint8_t conf_nb);
67 extern Bool image_user_read_request(uint8_t type, uint8_t request);
68 extern void image_user_set_interface(U8 wIndex, U8 wValue);
69
70 //
71 // these are the image_t defined by the image specific
72 // source code. This is "magically" kept in sync with
73 // the images defined in features.h by the efforts of
74 // the programmers who write this code.
75 //
76 extern const image_t uac1_audio_image;
77 extern const image_t uac2_audio_image;
78
79 #endif /* IMAGE_H_ */