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 76e102294b Add function to help configure the axis ports
This frees the application writer from having to know low level details like
the physical memory address of arrays etc.
2015-01-09 17:15:12 -05:00

39 lines
788 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);
int cfg_read(unsigned int addr);
// 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 */