summaryrefslogtreecommitdiff
path: root/tmk_core/tool/mbed/mbed-sdk/libraries/tests/usb/device/raw_hid/main.cpp
blob: 0a5d69cfeee71bceddf130ce28d470cb0e51fbec (plain)
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
#include "mbed.h"
#include "USBHID.h"

//We declare a USBHID device
USBHID hid;

//This report will contain data to be sent
HID_REPORT send_report;

Ticker tic;

void tic_handler();
void tic_handler() {
    hid.send(&send_report);
}

int main(void) {
    //Fill the report
    for(int i = 0; i < 64; i++)
        send_report.data[i] = i;
    send_report.length = 64;

    tic.attach(tic_handler, 1);

    while (1);
}