blob: 88c57fbd1d1a030e2c98eb6cf4ae7486c0815d0b [file] [log] [blame]
/* device_types.h
*
* Driver Framework, Device API, Type Definitions
*
* The document "Driver Framework Porting Guide" contains the detailed
* specification of this API. The information contained in this header file
* is for reference only.
*/
/*****************************************************************************
* Copyright (c) 2007-2020 by Rambus, Inc. and/or its subsidiaries.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef INCLUDE_GUARD_DEVICE_TYPES_H
#define INCLUDE_GUARD_DEVICE_TYPES_H
/*----------------------------------------------------------------------------
* Device_Handle_t
*
* This handle represents a device, typically one hardware block instance.
*
* The Device API can access the static device resources (registers and RAM
* inside the device) using offsets inside the device. This abstracts memory
* map knowledge and simplifies device instantiation.
*
* Each device has its own configuration, including the endianness swapping
* need for the words transferred. Endianness swapping can thus be performed
* on the fly and transparent to the caller.
*
* The details of the handle are implementation specific and must not be
* relied on, with one exception: NULL is guaranteed to be a non-existing
* handle.
*/
typedef void * Device_Handle_t;
/*----------------------------------------------------------------------------
* Device_Reference_t
*
* This is an implementation-specific reference for the device. It can
* be passed from the implementation of the Device API to other modules
* for use, for example, with OS services that require such a reference.
*
* The details of the handle are implementation specific and must not be
* relied on, with one exception: NULL is guaranteed to be a non-existing
* handle.
*/
typedef void * Device_Reference_t;
/*----------------------------------------------------------------------------
* Device_Data_t
*
* This is an implementation-specific reference for the device. It can
* be passed from the implementation of the Device API to other modules
* for use, for example, with OS services that require such a reference.
*/
typedef struct
{
// Physical address of the device mapped in memory
void * PhysAddr;
} Device_Data_t;
// Device properties structure
typedef struct
{
// Device name
char * Name_p;
// Device offset range inside system memory map
unsigned int StartByteOffset;
unsigned int LastByteOffset;
// Implementation specific device flags
char Flags;
} Device_Properties_t;
#endif /* Include Guard */
/* end of file device_types.h */