This repository was archived by the owner on Aug 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSDBridge32.hpp
More file actions
46 lines (42 loc) · 1.34 KB
/
SDBridge32.hpp
File metadata and controls
46 lines (42 loc) · 1.34 KB
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
44
45
46
/*
* This file is part of the Capibara zero (https://github.com/CapibaraZero/fw).
* Copyright (c) 2024 Andrea Canale.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sdkconfig.h"
#if CONFIG_TINYUSB_HID_ENABLED
#include "USB.h"
#include "USBMSC.h"
#include "SD.h"
class SDBridge32
{
private:
USBMSC msc;
static int32_t onWrite(uint32_t lba, uint32_t offset, uint8_t *buffer, uint32_t bufsize)
{
SD.writeRAW((uint8_t *)buffer, lba);
return bufsize;
}
static int32_t onRead(uint32_t lba, uint32_t offset, void *buffer, uint32_t bufsize)
{
SD.readRAW((uint8_t *)buffer, lba);
return bufsize;
}
public:
SDBridge32();
~SDBridge32();
void begin(const char *vendor_id, const char *product_id, const char *product_revision);
void end();
};
#endif