diff --git a/nfp_functions.c b/nfp_functions.c new file mode 100644 index 0000000..d7ccab7 --- /dev/null +++ b/nfp_functions.c @@ -0,0 +1,38 @@ +/**************************************************************************** + * Copyright (C) 2015 + * by Dimok + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any + * damages arising from the use of this software. + * + * Permission is granted to anyone to use this software for any + * purpose, including commercial applications, and to alter it and + * redistribute it freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you + * must not claim that you wrote the original software. If you use + * this software in a product, an acknowledgment in the product + * documentation would be appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and + * must not be misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. + ***************************************************************************/ +#include "os_functions.h" +#include "nfp_functions.h" + +u32 nfp_handle __attribute__((section(".data"))) = 0; + +void InitAcquireNFP(void) +{ + OSDynLoad_Acquire("nn_nfp.rpl", &nfp_handle); +} + +void InitNFPFunctionPointers(void) +{ + u32 *funcPointer = 0; + InitAcquireNFP(); +} diff --git a/nfp_functions.h b/nfp_functions.h new file mode 100644 index 0000000..67a3f79 --- /dev/null +++ b/nfp_functions.h @@ -0,0 +1,42 @@ +/**************************************************************************** + * Copyright (C) 2015 + * by Dimok + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any + * damages arising from the use of this software. + * + * Permission is granted to anyone to use this software for any + * purpose, including commercial applications, and to alter it and + * redistribute it freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you + * must not claim that you wrote the original software. If you use + * this software in a product, an acknowledgment in the product + * documentation would be appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and + * must not be misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. + ***************************************************************************/ +#ifndef __NFP_FUNCTIONS_H_ +#define __NFP_FUNCTIONS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +extern u32 nfp_handle; + +void InitNFPFunctionPointers(void); +void InitAcquireNFP(void); + +#ifdef __cplusplus +} +#endif + +#endif // __NFP_FUNCTIONS_H_ diff --git a/ntag_functions.c b/ntag_functions.c new file mode 100644 index 0000000..15e7e2c --- /dev/null +++ b/ntag_functions.c @@ -0,0 +1,38 @@ +/**************************************************************************** + * Copyright (C) 2015 + * by Dimok + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any + * damages arising from the use of this software. + * + * Permission is granted to anyone to use this software for any + * purpose, including commercial applications, and to alter it and + * redistribute it freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you + * must not claim that you wrote the original software. If you use + * this software in a product, an acknowledgment in the product + * documentation would be appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and + * must not be misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. + ***************************************************************************/ +#include "os_functions.h" +#include "ntag_functions.h" + +u32 ntag_handle __attribute__((section(".data"))) = 0; + +void InitAcquireNTAG(void) +{ + OSDynLoad_Acquire("ntag.rpl", &ntag_handle); +} + +void InitNTAGFunctionPointers(void) +{ + u32 *funcPointer = 0; + InitAcquireNTAG(); +} diff --git a/ntag_functions.h b/ntag_functions.h new file mode 100644 index 0000000..0f7e631 --- /dev/null +++ b/ntag_functions.h @@ -0,0 +1,42 @@ +/**************************************************************************** + * Copyright (C) 2015 + * by Dimok + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any + * damages arising from the use of this software. + * + * Permission is granted to anyone to use this software for any + * purpose, including commercial applications, and to alter it and + * redistribute it freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you + * must not claim that you wrote the original software. If you use + * this software in a product, an acknowledgment in the product + * documentation would be appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and + * must not be misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. + ***************************************************************************/ +#ifndef __NTAG_FUNCTIONS_H_ +#define __NTAG_FUNCTIONS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +extern u32 ntag_handle; + +void InitNTAGFunctionPointers(void); +void InitAcquireNTAG(void); + +#ifdef __cplusplus +} +#endif + +#endif // __NTAG_FUNCTIONS_H_