1
0
mirror of https://github.com/bmartini/zynq-axis.git synced 2024-09-05 19:19:27 +08:00
zynq-axis/lib/interface.h
Berin Martini 66f4315fdd Add some more configuration bus functions
Similar functions could be constructed using calls to the already existing
functions, however, it seems more efficient to add them to the library in case
the application cannot optimizes external library calls.
2015-01-09 17:17:34 -05:00

46 lines
1001 B
C

#ifndef INTERFACE_H
#define INTERFACE_H
#ifdef __cplusplus
extern "C" {
#endif
#define REGISTER_NB 32
#define MEM_SIZE (63*1024*1024)
// init/exit function for device interface
int axis_init(const char *path);
int axis_exit();
// configuration bus
void cfg_write(unsigned int addr, unsigned int data);
void cfg_write_array(unsigned int addr, unsigned int *data, int length);
void cfg_write_sequence(unsigned int *addr,
unsigned int *data, int length);
int cfg_read(unsigned int addr);
void cfg_poll(unsigned int addr, unsigned int data);
// dma memory
void *mem_alloc(const int length, const int byte_nb);
int mem_alloc_size(const int length, const int byte_nb);
int mem_alloc_length(const int length, const int byte_nb);
// axis ports
unsigned int axis_port_id(const int index, const int dirc);
unsigned int axis_memory_addr(void *ptr);
unsigned int axis_stream_length(const int length, const int byte_nb);
#ifdef __cplusplus
}
#endif
#endif /* INTERFACE_H */