|
| 1 | +#ifndef _DOLPHIN_AMC_AMCEXI2COMM_H_ |
| 2 | +#define _DOLPHIN_AMC_AMCEXI2COMM_H_ |
| 3 | + |
| 4 | +#include <dolphin/os.h> |
| 5 | +#include <dolphin/amc/AmcTypes.h> |
| 6 | + |
| 7 | +#ifdef __cplusplus |
| 8 | +extern "C" { |
| 9 | +#endif |
| 10 | + |
| 11 | +typedef enum |
| 12 | +{ |
| 13 | + AMC_EXI_NO_ERROR = 0, |
| 14 | + AMC_EXI_UNSELECTED, |
| 15 | +} AmcExiError; |
| 16 | + |
| 17 | +// --------------------------------------------------------------------------- |
| 18 | +// |
| 19 | +// void EXI2_Init( volatile unsigned char **inputPendingPtrRef, |
| 20 | +// EXICallback monitorCallback ); |
| 21 | +// |
| 22 | +// Description: Initialize the EXI2 driver (without interrupts). The |
| 23 | +// parameter 'inputPendingPtrref' is a flag showing whether input |
| 24 | +// is waiting in the EXI2 buffer and 'monitorCallback' is a |
| 25 | +// pointer to a callback function that is invoked at the end of |
| 26 | +// the EXI2 ISR. |
| 27 | +// |
| 28 | +// --------------------------------------------------------------------------- |
| 29 | +void EXI2_Init(volatile unsigned char **inputPendingPtrRef, EXICallback monitorCallback); |
| 30 | + |
| 31 | +// --------------------------------------------------------------------------- |
| 32 | +// |
| 33 | +// void EXI2_EnableInterrupts( void ); |
| 34 | +// |
| 35 | +// Description: Enable EXI2 interrupts. This function must be called to use |
| 36 | +// interrupts on the EXI2 interface. Call this function only |
| 37 | +// after EXI2_Init() has been invoked. |
| 38 | +// |
| 39 | +// --------------------------------------------------------------------------- |
| 40 | +void EXI2_EnableInterrupts( void ); |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +// --------------------------------------------------------------------------- |
| 45 | +// |
| 46 | +// int EXI2_Poll( void ); |
| 47 | +// |
| 48 | +// Description: Returns the number of bytes waiting to be read in the EXI2 |
| 49 | +// buffer. |
| 50 | +// |
| 51 | +// --------------------------------------------------------------------------- |
| 52 | +int EXI2_Poll( void ); |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +// --------------------------------------------------------------------------- |
| 57 | +// |
| 58 | +// AmcExiError EXI2_ReadN( void *bytes, unsigned long length ); |
| 59 | +// |
| 60 | +// Description: Read length bytes and return in bytes[] array. |
| 61 | +// |
| 62 | +// Returns: One of AMC_EXI_*. |
| 63 | +// |
| 64 | +// --------------------------------------------------------------------------- |
| 65 | +AmcExiError EXI2_ReadN( void *bytes, unsigned long length); |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | +// --------------------------------------------------------------------------- |
| 70 | +// |
| 71 | +// AmcExiError EXI2_WriteN( const void *bytes, unsigned long length ); |
| 72 | +// |
| 73 | +// Description: Write length bytes stored in bytes[] array. |
| 74 | +// |
| 75 | +// Returns: One of AMC_EXI_*. |
| 76 | +// |
| 77 | +// --------------------------------------------------------------------------- |
| 78 | +AmcExiError EXI2_WriteN( const void *bytes, unsigned long length); |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | +// --------------------------------------------------------------------------- |
| 83 | +// |
| 84 | +// void EXI2_Reserve( void ); |
| 85 | +// |
| 86 | +// Description: Disable non-monitor communications over the EXI2 port. |
| 87 | +// This function must be called before the monitor takes |
| 88 | +// control of the processor. |
| 89 | +// |
| 90 | +// --------------------------------------------------------------------------- |
| 91 | +void EXI2_Reserve( void ); |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +// --------------------------------------------------------------------------- |
| 96 | +// |
| 97 | +// void EXI2_Unreserve( void ); |
| 98 | +// |
| 99 | +// Description: Re-enable non-monitor communications over the EXI2 port. |
| 100 | +// This function must be called just before the monitor |
| 101 | +// gives control of the processor back to the application. |
| 102 | +// |
| 103 | +// --------------------------------------------------------------------------- |
| 104 | +void EXI2_Unreserve( void ); |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | +// --------------------------------------------------------------------------- |
| 109 | +// |
| 110 | +// AmcExiError EXI2_GetStatusReg( u16* pu16StatusReg ); |
| 111 | +// |
| 112 | +// Description: Read and store the value of the status register into |
| 113 | +// *pu16StatusReg. |
| 114 | +// |
| 115 | +// Returns: One of AMC_EXI_*. |
| 116 | +// --------------------------------------------------------------------------- |
| 117 | +AmcExiError EXI2_GetStatusReg( u16* pu16StatusReg ); |
| 118 | + |
| 119 | +#ifdef __cplusplus |
| 120 | +} |
| 121 | +#endif |
| 122 | + |
| 123 | +#endif |
0 commit comments