Added handle for nfp and ntag functions

This commit is contained in:
Maschell 2017-07-21 12:06:30 +02:00
parent 7a31349744
commit 50ee5c62b7
4 changed files with 160 additions and 0 deletions

38
nfp_functions.c Normal file
View File

@ -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();
}

42
nfp_functions.h Normal file
View File

@ -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 <gctypes.h>
extern u32 nfp_handle;
void InitNFPFunctionPointers(void);
void InitAcquireNFP(void);
#ifdef __cplusplus
}
#endif
#endif // __NFP_FUNCTIONS_H_

38
ntag_functions.c Normal file
View File

@ -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();
}

42
ntag_functions.h Normal file
View File

@ -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 <gctypes.h>
extern u32 ntag_handle;
void InitNTAGFunctionPointers(void);
void InitAcquireNTAG(void);
#ifdef __cplusplus
}
#endif
#endif // __NTAG_FUNCTIONS_H_