Difference between revisions of "Unit I2S"

From Ultibo.org
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
'''Ultibo I2S/PCM interface unit'''
+
'''Ultibo I2S/PCM Interface unit'''
 
+
''To be documented''
+
  
 
=== Constants ===
 
=== Constants ===
Line 70: Line 68:
 
| <code>I2S_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code>
 
| <code>I2S_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code>
 
| I2S informational messages, such as a device being attached or detached
 
| I2S informational messages, such as a device being attached or detached
 +
|-
 +
| <code>I2S_LOG_LEVEL_WARN = LOG_LEVEL_WARN;</code>
 +
| I2S warning messages
 
|-
 
|-
 
| <code>I2S_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code>
 
| <code>I2S_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code>
Line 208: Line 209:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 223: Line 224:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 235: Line 236:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to new I2S entry or nil if I2S could not be created
 
| Pointer to new I2S entry or nil if I2S could not be created
 
|-
 
|-
Line 247: Line 248:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Size'''
+
! Size
 
| Size in bytes to allocate for new I2S (Including the I2S entry)
 
| Size in bytes to allocate for new I2S (Including the I2S entry)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to new I2S entry or nil if I2S could not be created
 
| Pointer to new I2S entry or nil if I2S could not be created
 
|-
 
|-
Line 262: Line 263:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 274: Line 275:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 286: Line 287:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 298: Line 299:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 310: Line 311:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 322: Line 323:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 334: Line 335:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 346: Line 347:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 356: Line 357:
  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function I2SGetCount:LongWord; inline;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function I2SGetCount:LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current I2S count</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current I2S count</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 368: Line 369:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function I2SDeviceGetDefault:PI2SDevice; inline;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function I2SDeviceGetDefault:PI2SDevice;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default I2S device</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default I2S device</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 385: Line 386:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 397: Line 398:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 409: Line 410:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 421: Line 422:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure I2SLogWarn(I2S:PI2SDevice; const AText:String); inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 433: Line 446:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 445: Line 458:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-

Latest revision as of 03:47, 15 December 2022

Return to Unit Reference


Description


Ultibo I2S/PCM Interface unit

Constants



I2S specific constants I2S_*
I2S_NAME_PREFIX = 'I2S'; Name prefix for I2S Devices


I2S device types I2S_TYPE_*
I2S_TYPE_NONE = 0;  


I2S device states I2S_STATE_*
I2S_STATE_DISABLED = 0;  
I2S_STATE_ENABLED = 1;  


I2S device flags I2S_FLAG_*
I2S_FLAG_NONE = $00000000;  


I2S logging I2S_LOG_*
I2S_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG; I2S debugging messages
I2S_LOG_LEVEL_INFO = LOG_LEVEL_INFO; I2S informational messages, such as a device being attached or detached
I2S_LOG_LEVEL_WARN = LOG_LEVEL_WARN; I2S warning messages
I2S_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR; I2S error messages
I2S_LOG_LEVEL_NONE = LOG_LEVEL_NONE; No I2S messages


Type definitions



I2S properties

PI2SProperties = ^TI2SProperties;

TI2SProperties = record

   

I2S enumeration callback

TI2SEnumerate = function(I2S:PI2SDevice; Data:Pointer):LongWord;

I2S notification callback

TI2SNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

I2S device get properties

TI2SDeviceGetProperties = function(I2S:PI2SDevice; Properties:PI2SProperties):LongWord;

I2S device

PI2SDevice = ^TI2SDevice;

TI2SDevice = record

Device Properties
Device:TDevice; The Device entry for this I2S
I2S Properties
I2SId:LongWord; Unique Id of this I2S in the I2S table
I2SState:LongWord; I2S state (eg I2S_STATE_ENABLED)
DeviceGetProperties:TI2SDeviceGetProperties; A Device specific DeviceGetProperties method implementing the standard I2S device interface
Statistics Properties
 
Driver Properties
Lock:TMutexHandle; Device lock
Properties:TI2SProperties; Device properties
Internal Properties
Prev:PI2SDevice; Previous entry in I2S table
Next:PI2SDevice; Next entry in I2S table


Public variables



I2S logging

I2S_DEFAULT_LOG_LEVEL:LongWord = I2S_LOG_LEVEL_DEBUG; Minimum level for I2S messages. Only messages with level greater than or equal to this will be printed.
I2S_LOG_ENABLED:Boolean;


Function declarations



Initialization functions

procedure I2SInit;
Description: To be documented
Note None documented


I2S functions

function I2SDeviceGetProperties(I2S:PI2SDevice; Properties:PI2SProperties):LongWord;
Description: To be documented
Note None documented


function I2SDeviceCreate:PI2SDevice;
Description: Create a new I2S entry
Return Pointer to new I2S entry or nil if I2S could not be created


function I2SDeviceCreateEx(Size:LongWord):PI2SDevice;
Description: Create a new I2S entry
Size Size in bytes to allocate for new I2S (Including the I2S entry)
Return Pointer to new I2S entry or nil if I2S could not be created


function I2SDeviceDestroy(I2S:PI2SDevice):LongWord;
Description: Destroy an existing I2S entry
Note None documented


function I2SDeviceRegister(I2S:PI2SDevice):LongWord;
Description: Register a new I2S in the I2S table
Note None documented


function I2SDeviceDeregister(I2S:PI2SDevice):LongWord;
Description: Deregister a I2S from the I2S table
Note None documented


function I2SDeviceFind(I2SId:LongWord):PI2SDevice;
Description: To be documented
Note None documented


function I2SDeviceFindByName(const Name:String):PI2SDevice; inline;
Description: To be documented
Note None documented


function I2SDeviceFindByDescription(const Description:String):PI2SDevice; inline;
Description: To be documented
Note None documented


function I2SDeviceEnumerate(Callback:TI2SEnumerate; Data:Pointer):LongWord;
Description: To be documented
Note None documented


function I2SDeviceNotification(I2S:PI2SDevice; Callback:TI2SNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented
Note None documented


I2S helper functions

function I2SGetCount:LongWord;
Description: Get the current I2S count
Note None documented


function I2SDeviceGetDefault:PI2SDevice;
Description: Get the current default I2S device
Note None documented


function I2SDeviceSetDefault(I2S:PI2SDevice):LongWord;
Description: Set the current default I2S device
Note None documented


function I2SDeviceCheck(I2S:PI2SDevice):PI2SDevice;
Description: Check if the supplied I2S is in the I2S table
Note None documented


procedure I2SLog(Level:LongWord; I2S:PI2SDevice; const AText:String);
Description: To be documented
Note None documented


procedure I2SLogInfo(I2S:PI2SDevice; const AText:String); inline;
Description: To be documented
Note None documented


procedure I2SLogWarn(I2S:PI2SDevice; const AText:String); inline;
Description: To be documented
Note None documented


procedure I2SLogError(I2S:PI2SDevice; const AText:String); inline;
Description: To be documented
Note None documented


procedure I2SLogDebug(I2S:PI2SDevice; const AText:String); inline;
Description: To be documented
Note None documented


Return to Unit Reference