AWE Core OS 8.B.19 Documentation
Macros | Functions
AWECoreUtils.h File Reference

The AWECore Helper Functions File. More...

#include "ProxyIDs.h"
#include "Errors.h"
#include "TargetProcessor.h"

Go to the source code of this file.

Macros

#define MAX_PROCESSING_INSTANCES   (256)
 
#define PACKET_LENGTH_WORDS(x)   (x[0]>>16)
 This will determine the length of a packet in words.
 
#define PACKET_LENGTH_BYTES(x)   ((x[0]>>16) * sizeof(x[0]))
 This will determine the length of a packet in bytes.
 
#define PACKET_INSTANCEID(x)   (x[0] >> 8) & 0xff
 This will get the instance ID of a packet. More...
 
#define PACKET_OPCODE(x)   ((INT32)x[0] & 0xffU)
 Get the OPCODE of the packet. More...
 
#define AWB_DONE   1
 return value that indicates that the end of the AWB has been reached
 
#define AWB_NOT_DONE   0
 return value that indicates that the end of the AWB has been reached and another command should be processed
 
#define INCOMPLETE_PACKET   0
 
#define COMPLETE_NEW_PACKET   1
 
#define COMPLETE_REPEATED_PACKET   2
 

Functions

void GenerateInstanceTableReply (UINT32 *pPacketBuffer, UINT32 numInstances, UINT32 *pInstanceTable)
 Generate an instance table reply for Server based on the arguments. More...
 
INT32 float_to_fract32 (FLOAT32 x)
 Convert audio data from floating point to Fract32 sample by sample. More...
 
FLOAT32 fract32_to_float (INT32 x)
 Convert audio data from fract32 to float sample by sample. More...
 
INT32 awe_getNextAWBCmd (const UINT32 *pArray, UINT32 arraySize, UINT32 *pErrorOffset, UINT32 *pPacketBuffer)
 Get the next command from an array of AWB commands and write it into a packetBuffer to be processed. More...
 

Detailed Description

The AWECore Helper Functions File.

Macro Definition Documentation

◆ PACKET_INSTANCEID

#define PACKET_INSTANCEID (   x)    (x[0] >> 8) & 0xff

This will get the instance ID of a packet.

Used by the tuning interface to determine the destination of an incoming packet

◆ PACKET_OPCODE

#define PACKET_OPCODE (   x)    ((INT32)x[0] & 0xffU)

Get the OPCODE of the packet.

All opcodes are defined in ProxyIDs.h. Required when doing multi instance to detect the GetInstanceTable PFID and send an instanceTable reply.

Function Documentation

◆ GenerateInstanceTableReply()

void GenerateInstanceTableReply ( UINT32 *  pPacketBuffer,
UINT32  numInstances,
UINT32 *  pInstanceTable 
)

Generate an instance table reply for Server based on the arguments.

Parameters
[out]pPacketBufferpointer to your instance's packet buffer
[in]numInstancesnumber of instances on your system
[in]pInstanceTablepointer to your instanceID's table

◆ float_to_fract32()

INT32 float_to_fract32 ( FLOAT32  x)

Convert audio data from floating point to Fract32 sample by sample.

Parameters
[in]xThe floating point value that you wish to convert
Returns
The converted value in fract32 format
Examples
Libtester.c, and Multi-Instance.c.

◆ fract32_to_float()

FLOAT32 fract32_to_float ( INT32  x)

Convert audio data from fract32 to float sample by sample.

Parameters
[in]xThe fract32 point value that you wish to convert
Returns
The converted value as a float

◆ awe_getNextAWBCmd()

INT32 awe_getNextAWBCmd ( const UINT32 *  pArray,
UINT32  arraySize,
UINT32 *  pErrorOffset,
UINT32 *  pPacketBuffer 
)

Get the next command from an array of AWB commands and write it into a packetBuffer to be processed.

Parameters
[in]*pArrayThe AWB array
[in]arraySizeThe size of the AWB array
[out]*pErrorOffsetcurrent position in the array (index of command)
[in]*pPacketBufferThe packetBuffer to write the next command into.
Returns
AWB_NOT_DONE if processing of array is not complete
AWB_DONE if processing of array is complete
negative number if error encountered