Base CPU class for AF. More...
#include <AFCPU.h>
Public Member Functions | |
| AFCPU (AFCore *core) | |
| Constructor for AFCPU. | |
| virtual AF_STATUS | Init ()=0 |
| Initializes the CPU. | |
| virtual BOOL | Deinit ()=0 |
| Deinitializes the CPU. | |
| virtual AF_STATUS | InitControlBus () |
| Initializes the control bus. | |
| virtual HANDLE | GetControlBus () |
| Method to get the handle to the control bus. | |
| virtual DWORD | ReadCodecRegister (UCHAR *regData, UCHAR *inData, DWORD inDataSize) |
| Reads a codec register through control bus (hardware independent). | |
| virtual DWORD | WriteCodecRegister (UCHAR *outData, DWORD outDataSize) |
| Writes a codec register through control bus (hardware independent). | |
| virtual DWORD | GetAudioDMAPageSize ()=0 |
| Retrieve the DMA page size. | |
| virtual DWORD | GetAudioDMABufferSize ()=0 |
| Retrieve the DMA buffer size. | |
| virtual PBYTE * | GetOutputDMABufferVirtual ()=0 |
| Method to get a pointer to a virtual output DMA buffer. | |
| virtual PBYTE * | GetInputDMABufferVirtual ()=0 |
| Method to get a pointer to a virtual input DMA buffer. | |
| virtual BOOL | InitInputDMA ()=0 |
| Initializes input DMA. | |
| virtual BOOL | InitOutputDMA ()=0 |
| Initializes output DMA. | |
| virtual VOID | StartInputDMA ()=0 |
| Starts the input DMA transfer (CPU <= codec). | |
| virtual VOID | StartOutputDMA ()=0 |
| Starts the output DMA transfer (CPU => codec). | |
| virtual VOID | StopInputDMA ()=0 |
| Stops the input DMA transfer. | |
| virtual VOID | StopOutputDMA ()=0 |
| Stops the output DMA transfer. | |
| virtual VOID | OutputDMAISR ()=0 |
| Provides the callback for the output DMA interrupt service routine. | |
| virtual VOID | InputDMAISR ()=0 |
| Provides the callback for the input DMA interrupt service routine. | |
| virtual VOID | OutputDMAThreadInterruptDoneCallback (DWORD outputTransferred, DWORD outputDMAStatus)=0 |
| Output DMA transfer done callback. | |
| virtual VOID | InputDMAThreadInterruptDoneCallback (DWORD inputTransferred, DWORD inputDMAStatus)=0 |
| Input DMA transfer done callback. | |
| virtual AF_STATUS | InitI2SBus (AFI2SBusCap *cap)=0 |
| Initializes the I2S bus. | |
| virtual VOID | StartOutputI2S ()=0 |
| Starts the output I2S transfer. | |
| virtual VOID | StopOutputI2S ()=0 |
| Stops the output I2S transfer. | |
| virtual VOID | StartInputI2S ()=0 |
| Starts the input I2S transfer. | |
| virtual VOID | StopInputI2S ()=0 |
| Stops the input I2S transfer. | |
| virtual BOOL | PowerUp ()=0 |
| CPU power up routine. | |
| virtual BOOL | PowerDown ()=0 |
| CPU power down routine. | |
| virtual AFI2SBusCaps * | GetI2SBusCaps () |
| Method to get the CPU supported I2S bus capabilities. | |
| virtual AFI2SBusCap * | GetCurrentI2SBusCap () |
| Method to get a current I2S bus configuration the CPU is working in. | |
| virtual FLOAT | GetSysClk () |
| Method to get the system clock frequency (in Hz) of the CPU. | |
| virtual HANDLE | GetOutputDMAInterruptHandle () |
| virtual HANDLE | GetInputDMAInterruptHandle () |
| virtual | ~AFCPU () |
| Empty destructor for AFCPU. | |
Protected Attributes | |
| AFCore * | core |
| HANDLE | hControlBus |
| CFIo | r2WireIO |
| CFIo | w2WireIO |
| AFI2SBusCaps | i2sBusCaps |
| AFI2SBusCap * | currentI2SBusCap |
| FLOAT | sysClk |
| DWORD | audioDMAPageSize |
| DWORD | audioDMABufferSize |
| HANDLE | outputDMAInterrupt |
| HANDLE | inputDMAInterrupt |
Base CPU class for AF.
The purpose of the base CPU class is to provide the set of methods that should be implemented in every hardware-specific CPU driver for AF.
Definition at line 64 of file AFCPU.h.
| AFCPU::AFCPU | ( | AFCore * | core | ) | [inline] |
| virtual AFCPU::~AFCPU | ( | ) | [inline, virtual] |
| virtual BOOL AFCPU::Deinit | ( | ) | [pure virtual] |
Deinitializes the CPU.
Typical actions performed include: unmapping the registers, releasing DMA channels, etc.
| TRUE | Deinitialization succeeded. | |
| FALSE | Deinitialization failed. |
Implemented in AFCPUHardware.
| virtual DWORD AFCPU::GetAudioDMABufferSize | ( | ) | [pure virtual] |
| virtual DWORD AFCPU::GetAudioDMAPageSize | ( | ) | [pure virtual] |
| virtual HANDLE AFCPU::GetControlBus | ( | ) | [inline, virtual] |
| virtual AFI2SBusCap* AFCPU::GetCurrentI2SBusCap | ( | ) | [inline, virtual] |
Method to get a current I2S bus configuration the CPU is working in.
| virtual AFI2SBusCaps* AFCPU::GetI2SBusCaps | ( | ) | [inline, virtual] |
Method to get the CPU supported I2S bus capabilities.
This method returns the CPU supported I2S bus capabilites as a pointer to AFI2SBusCaps structure (pointer to the array of the capabilities and the total count).
| virtual PBYTE* AFCPU::GetInputDMABufferVirtual | ( | ) | [pure virtual] |
Method to get a pointer to a virtual input DMA buffer.
Implemented in AFCPUHardware.
| virtual HANDLE AFCPU::GetInputDMAInterruptHandle | ( | ) | [inline, virtual] |
| virtual PBYTE* AFCPU::GetOutputDMABufferVirtual | ( | ) | [pure virtual] |
Method to get a pointer to a virtual output DMA buffer.
Implemented in AFCPUHardware.
| virtual HANDLE AFCPU::GetOutputDMAInterruptHandle | ( | ) | [inline, virtual] |
| virtual FLOAT AFCPU::GetSysClk | ( | ) | [inline, virtual] |
| virtual AF_STATUS AFCPU::Init | ( | ) | [pure virtual] |
Initializes the CPU.
Typical actions performed include: mapping the registers, DMA buffers, etc.
Implemented in AFCPUHardware.
| AF_STATUS AFCPU::InitControlBus | ( | ) | [virtual] |
| virtual AF_STATUS AFCPU::InitI2SBus | ( | AFI2SBusCap * | cap | ) | [pure virtual] |
Initializes the I2S bus.
Every hardware specific implementation of AFCPU should override this method providing the initialization sequences for each of the I2S capabilities (AFI2SBusCap in AFI2SBus.h) they export as supported ones. This method will be called by the core after matching best supported I2S configurations between the CPU and the codec.
| cap | Pointer to the particular I2S configuration (AFI2SBusCap) to be initialized. |
Implemented in AFCPUHardware.
| virtual BOOL AFCPU::InitInputDMA | ( | ) | [pure virtual] |
Initializes input DMA.
| TRUE | Initialization succeeded. | |
| FALSE | Intialization failed. |
Implemented in AFCPUHardware.
| virtual BOOL AFCPU::InitOutputDMA | ( | ) | [pure virtual] |
Initializes output DMA.
| TRUE | Initialization succeeded. | |
| FALSE | Intialization failed. |
Implemented in AFCPUHardware.
| virtual VOID AFCPU::InputDMAISR | ( | ) | [pure virtual] |
Provides the callback for the input DMA interrupt service routine.
This method is called when the input DMA interrupt is fired, and provides CPU driver the opportunity to perform hardware specific actions like clear the interrupt pending bits, etc.
Implemented in AFCPUHardware.
| virtual VOID AFCPU::InputDMAThreadInterruptDoneCallback | ( | DWORD | inputTransferred, | |
| DWORD | inputDMAStatus | |||
| ) | [pure virtual] |
Input DMA transfer done callback.
This method allows the CPU to perform hardware-specific actions after a single input DMA transfer.
| inputTransferred | The number of bytes to be transferred. | |
| inputDMAStatus | A flag indicating which DMA buffer to enable. |
Implemented in AFCPUHardware.
| virtual VOID AFCPU::OutputDMAISR | ( | ) | [pure virtual] |
Provides the callback for the output DMA interrupt service routine.
This method is called when the output DMA interrupt is fired, and provides CPU driver the opportunity to perform hardware specific actions like clear the interrupt pending bits, etc.
Implemented in AFCPUHardware.
| virtual VOID AFCPU::OutputDMAThreadInterruptDoneCallback | ( | DWORD | outputTransferred, | |
| DWORD | outputDMAStatus | |||
| ) | [pure virtual] |
Output DMA transfer done callback.
This method allows the CPU to perform hardware-specific actions after a single output DMA transfer.
| outputTransferred | The number of bytes to be transferred. | |
| outputDMAStatus | A flag indicating which DMA buffer to enable. |
Implemented in AFCPUHardware.
| virtual BOOL AFCPU::PowerDown | ( | ) | [pure virtual] |
CPU power down routine.
This routine is called from the higher layers of the driver (usually on power state changes, i.e. on device suspend).
| TRUE | Powering down succeeded. | |
| FALSE | Powering down failed. |
Implemented in AFCPUHardware.
| virtual BOOL AFCPU::PowerUp | ( | ) | [pure virtual] |
CPU power up routine.
This routine is called from the higher layers of the driver (usually on power state changes, i.e. on device wake-up from suspend).
| TRUE | Powering up succeeded. | |
| FALSE | Powering up failed. |
Implemented in AFCPUHardware.
| DWORD AFCPU::ReadCodecRegister | ( | UCHAR * | regData, | |
| UCHAR * | inData, | |||
| DWORD | inDataSize | |||
| ) | [virtual] |
Reads a codec register through control bus (hardware independent).
This method depends on the Control Framework implementation to read/write data over control bus from/to the codec.
| regData | Pointer to the byte buffer with the data to be sent (size given in AFCodec::GetRegisterWidth()). | |
| inData | Pointer to the byte buffer for the received data. | |
| inDataSize | Received data buffer (inData) size in bytes. |
| virtual VOID AFCPU::StartInputDMA | ( | ) | [pure virtual] |
Starts the input DMA transfer (CPU <= codec).
Implemented in AFCPUHardware.
| virtual VOID AFCPU::StartInputI2S | ( | ) | [pure virtual] |
Starts the input I2S transfer.
Implemented in AFCPUHardware.
| virtual VOID AFCPU::StartOutputDMA | ( | ) | [pure virtual] |
Starts the output DMA transfer (CPU => codec).
Implemented in AFCPUHardware.
| virtual VOID AFCPU::StartOutputI2S | ( | ) | [pure virtual] |
Starts the output I2S transfer.
Implemented in AFCPUHardware.
| virtual VOID AFCPU::StopInputDMA | ( | ) | [pure virtual] |
Stops the input DMA transfer.
Implemented in AFCPUHardware.
| virtual VOID AFCPU::StopInputI2S | ( | ) | [pure virtual] |
Stops the input I2S transfer.
Implemented in AFCPUHardware.
| virtual VOID AFCPU::StopOutputDMA | ( | ) | [pure virtual] |
Stops the output DMA transfer.
Implemented in AFCPUHardware.
| virtual VOID AFCPU::StopOutputI2S | ( | ) | [pure virtual] |
Stops the output I2S transfer.
Implemented in AFCPUHardware.
| DWORD AFCPU::WriteCodecRegister | ( | UCHAR * | outData, | |
| DWORD | outDataSize | |||
| ) | [virtual] |
Writes a codec register through control bus (hardware independent).
This method depends on the Control Framework implementation to write data over control bus to the codec.
| outData | Pointer to the byte buffer with the data to be sent. | |
| outDataSize | Output data buffer (outData) size in bytes. |
DWORD AFCPU::audioDMABufferSize [protected] |
DWORD AFCPU::audioDMAPageSize [protected] |
AFCore* AFCPU::core [protected] |
AFI2SBusCap* AFCPU::currentI2SBusCap [protected] |
HANDLE AFCPU::hControlBus [protected] |
AFI2SBusCaps AFCPU::i2sBusCaps [protected] |
HANDLE AFCPU::inputDMAInterrupt [protected] |
HANDLE AFCPU::outputDMAInterrupt [protected] |
CFIo AFCPU::r2WireIO [protected] |
FLOAT AFCPU::sysClk [protected] |
CFIo AFCPU::w2WireIO [protected] |
1.6.1