forked from virtualabs/cc2531-killerbee-fw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkb-usb.h
43 lines (32 loc) · 795 Bytes
/
kb-usb.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
#ifndef __INC_USB_PROTO_H
#define __INC_USB_PROTO_H
#include "contiki.h"
/*
* Contiki hack: load models.h before loading usb-arch.h, in this way
* all USB structures will take the right values for EP2
* and EP3 buffers.
*/
#include "models.h"
#include "usb-arch.h"
#include "dev/leds.h"
#include "dev/leds-arch.h"
#include "descriptors.h"
#include "utils.h"
#define EPIN 0x82
#define EPOUT 0x03
#define BUFSIZE 256
#define BUFFER_SIZE 64
typedef enum {
KBS_IDLE,
KBS_WAIT_PAYLOAD,
KBS_PACKET_RECEIVED
} kb_usb_state;
typedef struct {
unsigned char command;
uint32_t payload_size;
uint8_t *payload;
} kb_event_t;
PROCESS_NAME(kb_serial_process);
void kb_usb_init(void);
void kb_usb_send(kb_event_t *p_event);
#endif /* __INC_USB_PROTO_H */