code refactoring

This commit is contained in:
2025-02-16 19:32:01 +01:00
parent f3c2569a30
commit c8bda25d90
42 changed files with 439 additions and 543 deletions

View File

@@ -1,3 +1,5 @@
#ifndef _DRV_LOADER_H
#define _DRV_LOADER_H
/*
* JTAG Core library
* Copyright (c) 2008 - 2024 Viveris Technologies
@@ -22,29 +24,9 @@
* @brief driver functions definitions
* @author Jean-François DEL NERO <Jean-Francois.DELNERO@viveris.fr>
*/
enum {
GET_DRV_ID = 1,
GET_DRV_DESCRIPTION,
GET_DRV_FUNCPTR,
GET_DRV_DETECT
};
typedef int (*DRV_DETECT) (void* jtag_core);
typedef int (*DRV_INIT) (void* jtag_core,int sub_drv,char * params);
typedef int (*DRV_TXRXDATA) (void* jtag_core, unsigned char * str_out, unsigned char * str_in, int size);
typedef int (*DRV_TXTMS) (void* jtag_core, unsigned char * str_out, int size);
typedef int (*DRV_GETMODULEINFOS) (void* jtag_core,int sub_drv,unsigned int infotype, void * returnvalue);
typedef int (*DRV_DEINIT) (void* jtag_core);
#include "config/bs_defines.h"
typedef struct drv_ptr_
{
DRV_DETECT drv_Detect;
DRV_INIT drv_Init;
DRV_DEINIT drv_DeInit;
DRV_TXTMS drv_TX_TMS;
DRV_TXRXDATA drv_TXRX_DATA;
DRV_GETMODULEINFOS drv_Get_ModInfos;
} drv_ptr;
int GetDrvInfo(void * jc_ctx, unsigned long infotype, void * returnvalue, const char * drv_id, const char * drv_desc, drv_ptr * drv_func);
int GetDrvInfo(void * jc_ctx, unsigned long infotype, void * returnvalue, const char * drv_id, const char * drv_desc, drv_ptr * drv_func);
#endif