Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
fpga.h File Reference
#include <errno.h>
#include <zephyr/types.h>
#include <zephyr/sys/util.h>
#include <zephyr/device.h>

Go to the source code of this file.

Data Structures

struct  fpga_driver_api
 

Macros

#define FPGA_GET_INFO_DEFAULT   "n/a"
 

Typedefs

typedef enum FPGA_status(* fpga_api_get_status) (const struct device *dev)
 
typedef int(* fpga_api_load) (const struct device *dev, uint32_t *image_ptr, uint32_t img_size)
 
typedef int(* fpga_api_reset) (const struct device *dev)
 
typedef int(* fpga_api_on) (const struct device *dev)
 
typedef int(* fpga_api_off) (const struct device *dev)
 
typedef const char *(* fpga_api_get_info) (const struct device *dev)
 

Enumerations

enum  FPGA_status { FPGA_STATUS_INACTIVE , FPGA_STATUS_ACTIVE }
 

Functions

static enum FPGA_status fpga_get_status (const struct device *dev)
 Read the status of FPGA.
 
static int fpga_reset (const struct device *dev)
 Reset the FPGA.
 
static int fpga_load (const struct device *dev, uint32_t *image_ptr, uint32_t img_size)
 Load the bitstream and program the FPGA.
 
static int fpga_on (const struct device *dev)
 Turns on the FPGA.
 
static const char * fpga_get_info (const struct device *dev)
 Returns information about the FPGA.
 
static int fpga_off (const struct device *dev)
 Turns off the FPGA.
 

Macro Definition Documentation

◆ FPGA_GET_INFO_DEFAULT

#define FPGA_GET_INFO_DEFAULT   "n/a"

Typedef Documentation

◆ fpga_api_get_info

typedef const char *(* fpga_api_get_info) (const struct device *dev)

◆ fpga_api_get_status

typedef enum FPGA_status(* fpga_api_get_status) (const struct device *dev)

◆ fpga_api_load

typedef int(* fpga_api_load) (const struct device *dev, uint32_t *image_ptr, uint32_t img_size)

◆ fpga_api_off

typedef int(* fpga_api_off) (const struct device *dev)

◆ fpga_api_on

typedef int(* fpga_api_on) (const struct device *dev)

◆ fpga_api_reset

typedef int(* fpga_api_reset) (const struct device *dev)

Enumeration Type Documentation

◆ FPGA_status

Enumerator
FPGA_STATUS_INACTIVE 
FPGA_STATUS_ACTIVE 

Function Documentation

◆ fpga_get_info()

static const char * fpga_get_info ( const struct device dev)
inlinestatic

Returns information about the FPGA.

Parameters
devFPGA device structure.
Returns
String containing information.

◆ fpga_get_status()

static enum FPGA_status fpga_get_status ( const struct device dev)
inlinestatic

Read the status of FPGA.

Parameters
devFPGA device structure.
Return values
0if the FPGA is in INACTIVE state.
1if the FPGA is in ACTIVE state.

◆ fpga_load()

static int fpga_load ( const struct device dev,
uint32_t image_ptr,
uint32_t  img_size 
)
inlinestatic

Load the bitstream and program the FPGA.

Parameters
devFPGA device structure.
image_ptrPointer to bitstream.
img_sizeBitstream size in bytes.
Return values
0if successful.
FailedOtherwise.

◆ fpga_off()

static int fpga_off ( const struct device dev)
inlinestatic

Turns off the FPGA.

Parameters
devFPGA device structure.
Return values
0if successful.
negativeerrno code on failure.

◆ fpga_on()

static int fpga_on ( const struct device dev)
inlinestatic

Turns on the FPGA.

Parameters
devFPGA device structure.
Return values
0if successful.
negativeerrno code on failure.

◆ fpga_reset()

static int fpga_reset ( const struct device dev)
inlinestatic

Reset the FPGA.

Parameters
devFPGA device structure.
Return values
0if successful.
FailedOtherwise.