7#ifndef ZEPHYR_INCLUDE_DRIVERS_FPGA_H_
8#define ZEPHYR_INCLUDE_DRIVERS_FPGA_H_
37typedef const char *(*fpga_api_get_info)(
const struct device *dev);
84 if (api->
reset == NULL) {
88 return api->
reset(dev);
107 if (api->
load == NULL) {
111 return api->
load(dev, image_ptr, img_size);
127 if (api->
on == NULL) {
134#define FPGA_GET_INFO_DEFAULT "n/a"
168 if (api->
off == NULL) {
172 return api->
off(dev);
enum FPGA_status(* fpga_api_get_status)(const struct device *dev)
Definition fpga.h:31
FPGA_status
Definition fpga.h:20
@ FPGA_STATUS_INACTIVE
Definition fpga.h:24
@ FPGA_STATUS_ACTIVE
Definition fpga.h:28
static enum FPGA_status fpga_get_status(const struct device *dev)
Read the status of FPGA.
Definition fpga.h:56
static int fpga_load(const struct device *dev, uint32_t *image_ptr, uint32_t img_size)
Load the bitstream and program the FPGA.
Definition fpga.h:101
const char *(* fpga_api_get_info)(const struct device *dev)
Definition fpga.h:37
int(* fpga_api_reset)(const struct device *dev)
Definition fpga.h:34
int(* fpga_api_off)(const struct device *dev)
Definition fpga.h:36
int(* fpga_api_load)(const struct device *dev, uint32_t *image_ptr, uint32_t img_size)
Definition fpga.h:32
static int fpga_off(const struct device *dev)
Turns off the FPGA.
Definition fpga.h:163
#define FPGA_GET_INFO_DEFAULT
Definition fpga.h:134
static const char * fpga_get_info(const struct device *dev)
Returns information about the FPGA.
Definition fpga.h:143
static int fpga_on(const struct device *dev)
Turns on the FPGA.
Definition fpga.h:122
static int fpga_reset(const struct device *dev)
Reset the FPGA.
Definition fpga.h:79
int(* fpga_api_on)(const struct device *dev)
Definition fpga.h:35
#define ENOTSUP
Unsupported value.
Definition errno.h:114
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Runtime device structure (in ROM) per driver instance.
Definition device.h:403
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:409
fpga_api_on on
Definition fpga.h:43
fpga_api_load load
Definition fpga.h:42
fpga_api_off off
Definition fpga.h:44
fpga_api_get_info get_info
Definition fpga.h:45
fpga_api_reset reset
Definition fpga.h:41
fpga_api_get_status get_status
Definition fpga.h:40