mirror of
https://github.com/brmlab/edubrm.git
synced 2025-06-09 05:14:01 +02:00
firmware wip3
This commit is contained in:
parent
bd82084531
commit
e1cc9144ee
2 changed files with 24 additions and 21 deletions
|
@ -32,25 +32,27 @@ USB_DEV_INFO DeviceInfo;
|
|||
HID_DEVICE_INFO HidDevInfo;
|
||||
ROM ** rom = (ROM **)0x1fff1ff8;
|
||||
|
||||
/*
|
||||
* Get HID Input Report -> InReport
|
||||
*/
|
||||
|
||||
static uint8_t buffer[64];
|
||||
/* --------------------------------------------------- */
|
||||
|
||||
#define INSIZE 8
|
||||
#define OUTSIZE 2
|
||||
|
||||
void GetInReport (uint8_t src[], uint32_t length)
|
||||
{
|
||||
memcpy(src, buffer, length);
|
||||
int i;
|
||||
for (i = 0; i < INSIZE; ++i) {
|
||||
src[i] = 'A' + i;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set HID Output Report <- OutReport
|
||||
*/
|
||||
void SetOutReport (uint8_t dst[], uint32_t length)
|
||||
{
|
||||
memcpy(buffer, dst, length);
|
||||
// TODO: parse dst
|
||||
}
|
||||
|
||||
/* --------------------------------------------------- */
|
||||
|
||||
int main (void)
|
||||
{
|
||||
/* for delay loop */
|
||||
|
@ -66,8 +68,8 @@ int main (void)
|
|||
HidDevInfo.idProduct = USB_PROD_ID;
|
||||
HidDevInfo.bcdDevice = USB_DEVICE;
|
||||
HidDevInfo.StrDescPtr = (uint32_t)&USB_StringDescriptor[0];
|
||||
HidDevInfo.InReportCount = 1;
|
||||
HidDevInfo.OutReportCount = 1;
|
||||
HidDevInfo.InReportCount = INSIZE;
|
||||
HidDevInfo.OutReportCount = OUTSIZE;
|
||||
HidDevInfo.SampleInterval = 0x20;
|
||||
HidDevInfo.InReport = GetInReport;
|
||||
HidDevInfo.OutReport = SetOutReport;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue