##// END OF EJS Templates
Bug with doxygen HTML frames fixed.
Bug with doxygen HTML frames fixed.

File last commit:

r68:1fb80e67e008 default
r68:1fb80e67e008 default
Show More
lpp_apb_functions.h
135 lines | 5.5 KiB | text/x-c | CLexer
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22 /*------------------------------------------------------------------------------
-- This file is a part of the LPP VHDL IP LIBRARY
-- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS
--
-- 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 3 of the License, or
-- (at your option) 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, write to the Free Software
martin
DAC driver added to LPP_drivers
r27 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22 -------------------------------------------------------------------------------*/
Alexis
Minor changes
r38 /*-- Author : Alexis Jeandet
-- Mail : alexis.jeandet@lpp.polytechnique.fr
----------------------------------------------------------------------------*/
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22 #ifndef LPP_APB_FUNCTIONS_H
#define LPP_APB_FUNCTIONS_H
alexis
Improved documentation for apb, uart, lcd drivers.
r66 #define APB_TBL_HEAD 0x800FF000 /**< Start address of APB devices list on AHB2APB bridge*/
#define APB_BASE_ADDRS 0x80000000 /**< Start address of APB bus*/
#define APB_MAX_DEVICES 256 /**< Maximun device count on APB bus*/
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22
Alexis
Added an automated Devices ID and Vendor ID handler
r36 #include "apb_devices_list.h"
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22
alexis
Improved documentation for apb, uart, lcd drivers.
r66
/*! \file lpp_apb_functions.h
\brief General purpose APB functions.
This library is written to work with AHB2APB VHDL module from Gaisler's GRLIB. It help you to find your device
on the APB bus by providing scan functions, it extract information such as device Version, IRQ value, Address mask.
You can use it to print the APB devices list on your SOC.
alexis
Improved doxygen html output, improved documentation on some VHDL and C files.
r67 \author Alexis Jeandet alexis.jeandet@lpp.polytechnique.fr
alexis
Improved documentation for apb, uart, lcd drivers.
r66 \todo implemente a descriptor structure for any APB device
alexis
Improved doxygen html output, improved documentation on some VHDL and C files.
r67
alexis
Improved documentation for apb, uart, lcd drivers.
r66 */
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22
alexis
Improved documentation for apb, uart, lcd drivers.
r66 /*! \struct apbPnPreg
\brief Structure representing a device descriptor register on Grlib's AHB2APB brige with plug and play feature
*/
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22 struct apbPnPreg
{
alexis
Improved documentation for apb, uart, lcd drivers.
r66 int idReg; /**< \brief id register composed of Vendor ID [31:24], Device ID [23:12], CT [11:10], Version [9:5], IRQ [4:0] */
int bar; /**< \brief Bank Address Register composed of Device's ADDRESS [31:20], MASK [14:4], TYPE [3:0] */
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22 };
alexis
Improved documentation for apb, uart, lcd drivers.
r66
/*! \struct apbdevinfo
\brief Structure holding an APB device informations
This information are extracted from the descriptor registers on Grlib's AHB2APB brige with plug and play feature
*/
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22 struct apbdevinfo
{
alexis
Improved documentation for apb, uart, lcd drivers.
r66 int vendorID; /**< \brief Stores the Vendor ID of the current device */
int productID; /**< \brief Stores the Product ID of the current device */
int version; /**< \brief Stores the Version of the current device */
int irq; /**< \brief Stores the interrupt Number of the current device */
int address; /**< \brief Stores the base address of the current device */
int mask; /**< \brief Stores the address mask of the current device, it gives the address space of this device */
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22 };
alexis
Improved documentation for apb, uart, lcd drivers.
r66
/*! \fn int* apbgetdevice(int PID,int VID,int count);
\brief Find device with given VID/PID
This Function scans APB devices table and returns counth device according to VID and PID
\param PID The PID of the device you whant to get.
\param VID The VID of the device you whant to get.
\param count The number of the device you whant to get. For example if you have 3 UARTS on your SOC you whant
to use UART1 so count = 2.
\return The pointer to the device.
*/
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22 int* apbgetdevice(int PID,int VID,int count);
alexis
Improved documentation for apb, uart, lcd drivers.
r66
/*! \fn void apbgetdeviceinfofromid(int PID,int VID,int count,struct apbdevinfo* devinfo);
\brief Record device informations with given VID/PID
This Function scans APB devices table and returns counth device informations according VID and PID.
\param PID The PID of the device you whant to get.
\param VID The VID of the device you whant to get.
\param count The number of the device you whant to get. For example if you have 3 UARTS on your SOC you whant
to use UART1 so count = 2.
\param devinfo The device information structure to be populated.
alexis
Improved doxygen html output, improved documentation on some VHDL and C files.
r67 \example scanAPB.c
alexis
Improved documentation for apb, uart, lcd drivers.
r66 */
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22 void apbgetdeviceinfofromid(int PID,int VID,int count,struct apbdevinfo* devinfo);
alexis
Improved documentation for apb, uart, lcd drivers.
r66
/*! \fn void apbgetdeviceinfofromdevptr(const struct apbPnPreg* dev,struct apbdevinfo* devinfo);
\brief Record device informations with given AHB2APB Plugn'Play register.
This Function extract device informations from the given AHB2APB Plugn'Play register end write them in devinfo.
\param dev AHB2APB Plugn'Play register corresponding to the device.
\param devinfo The device information structure to be populated.
*/
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22 void apbgetdeviceinfofromdevptr(const struct apbPnPreg* dev,struct apbdevinfo* devinfo);
alexis
Improved documentation for apb, uart, lcd drivers.
r66
/*! \fn void apbprintdeviceinfo(struct apbdevinfo devinfo);
\brief Print given device informations in stdout.
\param devinfo The device information structure to be printed.
*/
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22 void apbprintdeviceinfo(struct apbdevinfo devinfo);
alexis
Improved documentation for apb, uart, lcd drivers.
r66
/*! \fn void apbprintdeviceslist();
\brief Print APB devices informations in stdout.
This function list all devices on APB bus and print theirs informations.
alexis
Bug with doxygen HTML frames fixed.
r68
\example scanAPB.c
alexis
Improved documentation for apb, uart, lcd drivers.
r66 */
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22 void apbprintdeviceslist();
alexis
Improved documentation for apb, uart, lcd drivers.
r66
Alexis
Improved .hgignore filter, Added Makefiles for C drivers automated static lib genration.
r22 #endif // LPP_APB_FUNCTIONS_H
alexis
Improved documentation for apb, uart, lcd drivers.
r66