summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-02-22 22:14:50 +0700
committerhathach <[email protected]>2023-02-22 22:14:50 +0700
commit1466afafeb927621f9cbb6efd2a0d7e4b6cf8d41 (patch)
tree7fb9b6a1e67b0da37da027c04314f81ae29336d6 /src/common
parent4c846af53e993d635e6fff7e2611a554b55fc441 (diff)
move and add optional tusb_app_virt_to_phys/tusb_app_phys_to_virt
also add place holder for tusb_app_dcache_flush() and tusb_app_dcache_invalidate()
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_common.h15
-rw-r--r--src/common/tusb_mcu.h4
2 files changed, 17 insertions, 2 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h
index b1ee40a1a..270339cca 100644
--- a/src/common/tusb_common.h
+++ b/src/common/tusb_common.h
@@ -76,6 +76,21 @@
#include "tusb_timeout.h" // TODO remove
//--------------------------------------------------------------------+
+// Optional API implemented by application if needed
+// TODO move to a more ovious place/file
+//--------------------------------------------------------------------+
+
+// flush data cache
+TU_ATTR_WEAK extern void tusb_app_dcache_flush(uintptr_t addr, uint32_t data_size);
+
+// invalidate data cache
+TU_ATTR_WEAK extern void tusb_app_dcache_invalidate(uintptr_t addr, uint32_t data_size);
+
+// Optional physical <-> virtual address translation
+TU_ATTR_WEAK extern void* tusb_app_virt_to_phys(void *virt_addr);
+TU_ATTR_WEAK extern void* tusb_app_phys_to_virt(void *phys_addr);
+
+//--------------------------------------------------------------------+
// Internal Inline Functions
//--------------------------------------------------------------------+
diff --git a/src/common/tusb_mcu.h b/src/common/tusb_mcu.h
index a599c4fe9..e7d4e2c32 100644
--- a/src/common/tusb_mcu.h
+++ b/src/common/tusb_mcu.h
@@ -28,8 +28,8 @@
#define TUSB_MCU_H_
//--------------------------------------------------------------------+
-// Port Specific
-// TUP stand for TinyUSB Port (can be renamed)
+// Port/Platform Specific
+// TUP stand for TinyUSB Port/Platform (can be renamed)
//--------------------------------------------------------------------+
//------------- Unaligned Memory Access -------------//