-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
platform/avr: implement lufa hid driver and hid hal
Signed-off-by: Rafael Silva <[email protected]>
- Loading branch information
Showing
6 changed files
with
209 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ source = [ | |
'boot.c', | ||
'usb.c', | ||
'usb_descriptors.c', | ||
'hal/hid.c', | ||
] | ||
|
||
[dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* SPDX-License-Identifier: MIT | ||
* SPDX-FileCopyrightText: 2021 Rafael Silva <[email protected]> | ||
*/ | ||
|
||
#include "platform/avr/hal/hid.h" | ||
#include "platform/avr/usb.h" | ||
|
||
int hid_hal_send(struct hid_hal_t interface, u8 *buffer, size_t buffer_size) | ||
{ | ||
usb_write_descriptor(0, buffer, buffer_size); | ||
} | ||
|
||
struct hid_hal_t hid_hal_init(void) | ||
{ | ||
struct hid_hal_t hal = { | ||
.send = hid_hal_send, | ||
.drv_data = NULL, | ||
}; | ||
return hal; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* SPDX-License-Identifier: MIT | ||
* SPDX-FileCopyrightText: 2021 Rafael Silva <[email protected]> | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "hal/hid.h" | ||
#include "util/types.h" | ||
|
||
struct hid_hal_t hid_hal_init(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.