hw_device_t Struct Reference

hw_device_t Struct Reference

#include < hardware.h >

Data Fields

uint32_t  tag
 
uint32_t  version
 
struct hw_module_t module
 
uint32_t  reserved [12]
 
int(*  close )(struct hw_device_t *device)
 

Detailed Description

Every device data structure must begin with hw_device_t followed by module specific public methods and attributes.

Definition at line 167 of file hardware.h .

Field Documentation

int(* close)(struct hw_device_t *device)

Close this device

Definition at line 200 of file hardware.h .

struct hw_module_t * module

reference to the module this device belongs to

Definition at line 190 of file hardware.h .

uint32_t reserved[12]

padding reserved for future use

Definition at line 196 of file hardware.h .

uint32_t tag

tag must be initialized to HARDWARE_DEVICE_TAG

Definition at line 169 of file hardware.h .

uint32_t version

Version of the module-specific device API. This value is used by the derived-module user to manage different device implementations.

The module user is responsible for checking the module_api_version and device version fields to ensure that the user is capable of communicating with the specific module implementation.

One module can support multiple devices with different versions. This can be useful when a device interface changes in an incompatible way but it is still necessary to support older implementations at the same time. One such example is the Camera 2.0 API.

This field is interpreted by the module user and is ignored by the HAL interface itself.

Definition at line 187 of file hardware.h .


The documentation for this struct was generated from the following file: