add lib_dnr lib_roleswitch
This commit is contained in:
6
lib_dnr/lib_dnr/lib_build_info.cmake
Normal file
6
lib_dnr/lib_dnr/lib_build_info.cmake
Normal file
@@ -0,0 +1,6 @@
|
||||
set(LIB_NAME lib_dnr)
|
||||
set(LIB_VERSION 1.0.0)
|
||||
set(LIB_INCLUDES api)
|
||||
set(LIB_DEPENDENT_MODULES "")
|
||||
|
||||
XMOS_REGISTER_MODULE()
|
||||
BIN
lib_dnr/lib_dnr/libdnr_11ms.a
Normal file
BIN
lib_dnr/lib_dnr/libdnr_11ms.a
Normal file
Binary file not shown.
BIN
lib_dnr/lib_dnr/libdnr_50ms.a
Normal file
BIN
lib_dnr/lib_dnr/libdnr_50ms.a
Normal file
Binary file not shown.
12
lib_dnr/lib_dnr/module_build_info
Normal file
12
lib_dnr/lib_dnr/module_build_info
Normal file
@@ -0,0 +1,12 @@
|
||||
# You can set flags specifically for your module by using the MODULE_XCC_FLAGS
|
||||
# variable. So the following
|
||||
#
|
||||
# MODULE_XCC_FLAGS = $(XCC_FLAGS) -O3
|
||||
#
|
||||
# specifies that everything in the modules should have the application
|
||||
# build flags with -O3 appended (so the files will build at
|
||||
# optimization level -O3).
|
||||
#
|
||||
# You can also set MODULE_XCC_C_FLAGS, MODULE_XCC_XC_FLAGS etc..
|
||||
|
||||
VERSION = 1.0.0
|
||||
15
lib_roleswitch/lib_roleswitch/README.txt
Normal file
15
lib_roleswitch/lib_roleswitch/README.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
module_roleswitch
|
||||
*****************
|
||||
|
||||
scope:
|
||||
General Use
|
||||
|
||||
description:
|
||||
Roleswitch helper functions
|
||||
|
||||
keywords:
|
||||
Apple, USB, roleswitch, MFI
|
||||
|
||||
boards:
|
||||
XK-USB-AUDIO-U8-2C
|
||||
11
lib_roleswitch/lib_roleswitch/include/roleswitchflag.h
Normal file
11
lib_roleswitch/lib_roleswitch/include/roleswitchflag.h
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
#define USB_IN_FLAG 0x11AA
|
||||
#define COAX_IN_FLAG 0x22BB
|
||||
#define OPT_IN_FLAG 0x33CC
|
||||
#define UAC1_IN_FLAG 0x44DD
|
||||
#define BT_IN_FLAG 0x55EE
|
||||
#define I2S_IN_FLAG 0x66FF
|
||||
|
||||
|
||||
void SetRoleSwitchFlag(unsigned flagVal);
|
||||
unsigned GetRoleSwitchFlag();
|
||||
6
lib_roleswitch/lib_roleswitch/lib_build_info.cmake
Normal file
6
lib_roleswitch/lib_roleswitch/lib_build_info.cmake
Normal file
@@ -0,0 +1,6 @@
|
||||
set(LIB_NAME lib_roleswitch)
|
||||
set(LIB_VERSION 0.0.1)
|
||||
set(LIB_INCLUDES include)
|
||||
set(LIB_COMPILER_FLAGS -Os)
|
||||
|
||||
XMOS_REGISTER_MODULE()
|
||||
22
lib_roleswitch/lib_roleswitch/src/roleswitchflag.xc
Normal file
22
lib_roleswitch/lib_roleswitch/src/roleswitchflag.xc
Normal file
@@ -0,0 +1,22 @@
|
||||
#if defined(__XS2A__)
|
||||
/* Note range 0x7FFC8 - 0x7FFFF guarenteed to be untouched by tools */
|
||||
#define FLAG_ADDRESS 0x7ffc8
|
||||
#else
|
||||
/* Note range 0xFFFC8 - 0xFFFFF guarenteed to be untouched by tools */
|
||||
#define FLAG_ADDRESS 0xfffc8
|
||||
#endif
|
||||
|
||||
|
||||
/* Store Flag to fixed address */
|
||||
void SetRoleSwitchFlag(unsigned x)
|
||||
{
|
||||
asm volatile("stw %0, %1[0]" :: "r"(x), "r"(FLAG_ADDRESS));
|
||||
}
|
||||
|
||||
/* Load flag from fixed address */
|
||||
unsigned GetRoleSwitchFlag()
|
||||
{
|
||||
unsigned x;
|
||||
asm volatile("ldw %0, %1[0]" : "=r"(x) : "r"(FLAG_ADDRESS));
|
||||
return x;
|
||||
}
|
||||
Reference in New Issue
Block a user