Copyright (c) Hyperion Entertainment and contributors.

Difference between revisions of "Xena Resource"

From AmigaOS Documentation Wiki
Jump to navigation Jump to search
(Created page with "== Xena Resource == {| class="wikitable" !colspan="2"|Xena Resource Information |- | Includes || resources/xena.h |- | AutoDocs || xenares.doc |- | Libraries || [[Expansi...")
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Xena Resource ==
 
== Xena Resource ==
  +
  +
The Xena Resource provides access to the Xena chip on the AmigaOne X1000. Two functions allow you to use the Xena chip.
  +
  +
'''Xena Resource Functions'''
  +
{| class="wikitable"
  +
| AllocResource() || Obtain exclusive access to one of the Xena resources.
  +
|-
  +
| FreeResource() || Returns a resource to the system.
  +
|}
   
 
{| class="wikitable"
 
{| class="wikitable"
Line 7: Line 16:
 
|-
 
|-
 
| AutoDocs || [[xenares.doc]]
 
| AutoDocs || [[xenares.doc]]
|-
 
| Libraries || [[Expansion Library|expansion.library]]
 
 
|}
 
|}
  +
  +
There are four separate resources that may be requested.
  +
The application must secure as many as it requires to access the Xena system.
  +
XR_XTAGPORT is for access to the JTAG control lines that access the Xena chip and any additional devices on the Xorro board.
  +
XR_DATABUS is for the fast Localbus access to Core0.
  +
XR_INTERRUPT is used for Xena to interrupt the PA6T when it needs attention. This is likely to be used with XR_DATABUS
  +
XR_LONELYBIT is the extra unassigned pin
  +
  +
Example code to use the XTAG port:
  +
<syntaxhighlight>
  +
#include <proto/xena.h>
  +
#include <resources/xena.h>
  +
struct XenaIFace *IXena;
  +
IXena = IExec->OpenResource("xena.resource");
  +
if(NULL == IXena)
  +
{
  +
exit(-5);
  +
}
  +
STRPTR result = IXena->AllocResource(XR_XTAGPORT, "MyAppName");
  +
if(NULL == result)
  +
{
  +
// we have exclusive access,
  +
// code using the JTAG port goes here
  +
  +
//when finished, just
  +
IXena->FreeResource(XR_XTAGPORT);
  +
}
  +
else
  +
{
  +
IDOS->Printf("We cannot access the port because %s got here first\n", result);
  +
}
  +
</syntaxhighlight>

Latest revision as of 04:47, 24 May 2012

Xena Resource

The Xena Resource provides access to the Xena chip on the AmigaOne X1000. Two functions allow you to use the Xena chip.

Xena Resource Functions

AllocResource() Obtain exclusive access to one of the Xena resources.
FreeResource() Returns a resource to the system.
Xena Resource Information
Includes resources/xena.h
AutoDocs xenares.doc

There are four separate resources that may be requested. The application must secure as many as it requires to access the Xena system. XR_XTAGPORT is for access to the JTAG control lines that access the Xena chip and any additional devices on the Xorro board. XR_DATABUS is for the fast Localbus access to Core0. XR_INTERRUPT is used for Xena to interrupt the PA6T when it needs attention. This is likely to be used with XR_DATABUS XR_LONELYBIT is the extra unassigned pin

Example code to use the XTAG port:

#include <proto/xena.h>
#include <resources/xena.h>
struct XenaIFace *IXena;
IXena = IExec->OpenResource("xena.resource");
if(NULL == IXena)
{
    exit(-5);
}
STRPTR result = IXena->AllocResource(XR_XTAGPORT, "MyAppName");
if(NULL == result)
{
    // we have exclusive access, 
    // code using the JTAG port goes here
 
    //when finished, just
    IXena->FreeResource(XR_XTAGPORT);
}
else
{
    IDOS->Printf("We cannot access the port because %s got here first\n", result);
}