ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbDrvMod.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <ngc/core/ngcbDrv.h>

Macros

#define _GNU_SOURCE
 
#define _REENTRANT
 

Functions

void ngcbModInit (ngcb_mod_t *m)
 
int ngcbModOpen (const char *path, ngcb_mod_t *m, char *erms)
 
int ngcbModClose (ngcb_mod_t *m, char *erms)
 
int ngcbModTimeout (ngcb_mod_t *m, int seconds, char *erms)
 
int ngcbModFifo (ngcb_mod_t *m, int size, char *erms)
 
int ngcbModRead (ngcb_mod_t *m, int addr, int *buffer, int size, char *erms)
 
int ngcbModWrite (ngcb_mod_t *m, int addr, const int *buffer, int size, char *erms)
 
int ngcbModWait (ngcb_mod_t *m, int addr, int mask, int timeout, char *erms)
 

Detailed Description

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ _REENTRANT

#define _REENTRANT

Function Documentation

◆ ngcbModClose()

int ngcbModClose ( ngcb_mod_t * m,
char * erms )

Close DFE module interface

◆ ngcbModFifo()

int ngcbModFifo ( ngcb_mod_t * m,
int size,
char * erms )

Set the transfer FIFO size (in 32-bit words). The default FIFO size is 128 words for backwards compatibility reasons. Current maximum is 1024 words. There are various setups in between. To optimize performance, the calling application may adapt the FIFO size depending on the board and revision to be addressed.

◆ ngcbModInit()

void ngcbModInit ( ngcb_mod_t * m)

Initialze module handle

◆ ngcbModOpen()

int ngcbModOpen ( const char * path,
ngcb_mod_t * m,
char * erms )

Open and enable path to DFE module

◆ ngcbModRead()

int ngcbModRead ( ngcb_mod_t * m,
int addr,
int * buffer,
int size,
char * erms )

Read a buffer from an address on a DFE-module

◆ ngcbModTimeout()

int ngcbModTimeout ( ngcb_mod_t * m,
int seconds,
char * erms )

Set the timeout for read/write accesses in seconds

◆ ngcbModWait()

int ngcbModWait ( ngcb_mod_t * m,
int addr,
int mask,
int timeout,
char * erms )

Poll address until all bits in mask are set. The timeout is given in seconds. A negative value indicates an infinite timoeut.

◆ ngcbModWrite()

int ngcbModWrite ( ngcb_mod_t * m,
int addr,
const int * buffer,
int size,
char * erms )

Write a buffer to an address on a DFE-module