Professional Documents
Culture Documents
h>
#include <sys/mman.h>
#include <unistd.h>
#include "bf16-gpiodevice.h"
#include "driver-bitfury16.h"
#include "miner.h"
typedef struct {
unsigned int* oe_addr; // R/W, bit==1 -> input, bit==0 -> output,
unsigned int* data_out; // R/W
unsigned int* data_set; // W/O
unsigned int* data_clr; // W/O
unsigned int* data_in; // R/O
} gpio_attr_t;
typedef struct {
unsigned int* data_control;
} ctrl_attr_t;
typedef struct {
gpio_attr_t gpio0;
gpio_attr_t gpio1;
gpio_attr_t gpio2;
gpio_attr_t gpio3;
ctrl_attr_t* ctrl;
} mmap_attr_t;
return 0;
}
return -1;
}
return -1;
}
return gpio;
}
close(fd);
return mmap_addr;
}
return 0;
}